From 023fc0a5e150bb1057c360971cf98a9e4939cd05 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 20 Feb 2024 02:54:35 +0000 Subject: [PATCH] feat: update via SDK Studio --- .stats.yml | 2 +- README.md | 31 +- access.go | 4 +- accessappca.go | 466 - accessapp.go => accessapplication.go | 1687 +- ...ssapp_test.go => accessapplication_test.go | 123 +- accessapplicationca.go | 468 + ...pca_test.go => accessapplicationca_test.go | 16 +- accessapplicationpolicy.go | 12769 ++++++++++++ accessapplicationpolicy_test.go | 288 + accessapplicationuserpolicycheck.go | 226 + ...> accessapplicationuserpolicycheck_test.go | 4 +- accessapppolicy.go | 16481 ---------------- accessapppolicy_test.go | 377 - accessapprevoketoken.go | 80 - accessappuserpolicycheck.go | 229 - accessbookmark.go | 305 +- accessbookmark_test.go | 20 +- accesscertificate.go | 513 +- accesscertificate_test.go | 38 +- accesscertificatesetting.go | 239 +- accesscertificatesetting_test.go | 38 +- accesscustompage.go | 288 +- accesscustompage_test.go | 36 +- accessgroup.go | 12036 ++++++----- accessgroup_test.go | 148 +- accessidentityprovider.go | 6820 ++++--- accessidentityprovider_test.go | 72 +- accesskey.go | 263 +- accesskey_test.go | 36 +- accesskeyrotate.go | 147 - accesslogaccessrequest.go | 95 +- accesslogaccessrequest_test.go | 4 +- accessorganization.go | 445 +- accessorganization_test.go | 55 +- accessorganizationrevokeuser.go | 88 - accessorganizationrevokeuser_test.go | 47 - accessseat.go | 106 +- accessseat_test.go | 8 +- accessservicetoken.go | 603 +- accessservicetoken_test.go | 84 +- accessservicetokenrefresh.go | 152 - accessservicetokenrotate.go | 156 - accesstag.go | 446 + accesstag_test.go | 125 + accessuserfailedlogin.go | 97 +- accessuserfailedlogin_test.go | 4 +- accessuserlastseenidentity.go | 224 +- accessuserlastseenidentity_test.go | 4 +- account.go | 288 +- account_test.go | 42 +- accountmember.go | 1058 +- accountmember_test.go | 48 +- acmtotaltls.go | 98 +- acmtotaltls_test.go | 10 +- activationcheck.go | 77 +- activationcheck_test.go | 4 +- addressaddressmapaccount.go | 179 +- addressaddressmapaccount_test.go | 8 +- addressaddressmapip.go | 178 +- addressaddressmapip_test.go | 8 +- addressaddressmapzone.go | 178 +- addressaddressmapzone_test.go | 8 +- addressloadocument.go | 82 +- addressloadocument_test.go | 6 +- addressprefix.go | 511 +- addressprefix_test.go | 44 +- addressprefixbgpstatus.go | 182 +- addressprefixbgpstatus_test.go | 14 +- addressprefixdelegation.go | 349 +- addressprefixdelegation_test.go | 22 +- ai.go | 38 +- ai_test.go | 6 +- alerting.go | 2 - alertingv3.go | 141 + customnverify_test.go => alertingv3_test.go | 4 +- alertingv3availablealert.go | 166 - alertingv3destination.go | 12 +- alertingv3destinationeligible.go | 98 +- alertingv3destinationeligible_test.go | 4 +- alertingv3destinationpagerduty.go | 441 +- alertingv3destinationpagerduty_test.go | 86 +- alertingv3destinationwebhook.go | 496 +- alertingv3destinationwebhook_test.go | 42 +- alertingv3history.go | 162 +- alertingv3history_test.go | 6 +- alertingv3policy.go | 1207 +- alertingv3policy_test.go | 142 +- analytics.go | 30 - analyticscolo.go | 719 - analyticscolo_test.go | 49 - analyticsdashboard.go | 1080 - analyticsdashboard_test.go | 49 - analyticslatency.go | 156 - analyticslatency_test.go | 46 - analyticslatencycolo.go | 137 - analyticslatencycolo_test.go | 40 - api.md | 2673 ++- argotieredcaching.go | 186 +- argotieredcaching_test.go | 20 +- auditlog.go | 300 +- auditlog_test.go | 14 +- availablerateplan.go | 136 +- availablerateplan_test.go | 4 +- billingprofile.go | 73 +- billingprofile_test.go | 4 +- botmanagement.go | 569 +- botmanagement_test.go | 22 +- brandprotectionsubmit.go | 131 +- brandprotectionsubmit_test.go | 6 +- brandprotectionurlinfo.go | 168 +- brandprotectionurlinfo_test.go | 8 +- cach.go | 30 - cachcachereserve.go | 330 - cache.go | 346 +- cache_test.go | 38 +- cachecachereserve.go | 326 + ...tting_test.go => cachecachereserve_test.go | 12 +- cacheregionaltieredcache.go | 358 + cacheregionaltieredcache_test.go | 72 + cachereserve.go | 88 +- cachereserve_test.go | 6 +- cachetieredcachesmarttopology.go | 354 + ...o => cachetieredcachesmarttopology_test.go | 23 +- cachvariant.go => cachevariant.go | 437 +- cachvariant_test.go => cachevariant_test.go | 48 +- cachtieredcachesmarttopologyenable.go | 361 - call.go | 236 +- call_test.go | 30 +- certificate.go | 522 +- certificate_test.go | 26 +- certificateauthorityhostnameassociation.go | 171 +- ...ficateauthorityhostnameassociation_test.go | 12 +- cfdtunnel.go | 1770 -- cfdtunnelconfiguration.go | 429 - cfdtunnelconnection.go | 361 - cfdtunnelmanagement.go | 154 - cfdtunneltoken.go | 143 - challengewidget.go | 394 +- challengewidget_test.go | 44 +- client.go | 252 +- clientcertificate.go | 542 +- clientcertificate_test.go | 38 +- customcertificate.go | 6 +- customcertificateprioritize.go | 200 +- customcertificateprioritize_test.go | 8 +- customhostname.go | 1195 +- customhostname_test.go | 110 +- customhostnamefallbackorigin.go | 208 +- customhostnamefallbackorigin_test.go | 24 +- customn.go | 513 - customnameserver.go | 801 + customnameserver_test.go | 155 + customnavailability.go | 142 - customnverify.go | 211 - devicedextest.go | 559 +- devicedextest_test.go | 56 +- devicenetwork.go | 659 +- devicenetwork_test.go | 52 +- deviceoverridecode.go | 110 +- deviceoverridecode_test.go | 4 +- devicepolicy.go | 846 +- devicepolicy_test.go | 112 +- devicepolicydefaultpolicy.go | 144 + ...st.go => devicepolicydefaultpolicy_test.go | 4 +- devicepolicyexclude.go | 509 +- devicepolicyexclude_test.go | 87 +- devicepolicyfallbackdomain.go | 507 +- devicepolicyfallbackdomain_test.go | 82 +- devicepolicyinclude.go | 509 +- devicepolicyinclude_test.go | 87 +- deviceposture.go | 3896 ++-- deviceposture_test.go | 88 +- devicepostureintegration.go | 687 +- devicepostureintegration_test.go | 58 +- devicerevoke.go | 74 +- devicerevoke_test.go | 6 +- devicesetting.go | 160 +- devicesetting_test.go | 10 +- deviceunrevoke.go | 75 +- deviceunrevoke_test.go | 6 +- diagnostictraceroute.go | 201 +- diagnostictraceroute_test.go | 10 +- dispatcherscript.go | 471 +- dispatcherscript_test.go | 136 +- dlp.go | 2 + dlpdataset.go | 461 +- dlpdataset_test.go | 73 +- dlpdatasetupload.go | 331 + dlpdatasetupload_test.go | 75 + dlppattern.go | 122 +- ...scriptdetail_test.go => dlppattern_test.go | 9 +- dlppatternvalidate.go | 147 - dlppayloadlog.go | 159 +- dlppayloadlog_test.go | 10 +- dlpprofile.go | 238 +- dlpprofile_test.go | 6 +- dlpprofilecustom.go | 602 +- dlpprofilecustom_test.go | 244 +- dlpprofilepredefined.go | 124 +- dlpprofilepredefined_test.go | 28 +- dnsfirewall_test.go | 10 +- dnsfirewalldnsanalyticreport_test.go | 2 +- dnsfirewalldnsanalyticreportbytime_test.go | 2 +- dnsrecord.go | 5816 +++--- dnsrecord_test.go | 78 +- dnssec.go | 101 + dnssec_test.go | 30 +- email.go | 6 +- emailrouting.go | 108 +- emailrouting_test.go | 4 +- emailroutingaddress.go | 184 +- emailroutingaddress_test.go | 20 +- emailroutingdisable.go | 108 +- emailroutingdisable_test.go | 4 +- emailroutingdns.go | 148 +- emailroutingdns_test.go | 4 +- emailroutingenable.go | 108 +- emailroutingenable_test.go | 4 +- emailroutingrule.go | 931 +- emailroutingrule_test.go | 116 +- emailroutingrulecatchall.go | 311 +- emailroutingrulecatchall_test.go | 28 +- filter.go | 649 +- filter_test.go | 78 +- firewalllockdown.go | 670 +- firewalllockdown_test.go | 52 +- firewallrule.go | 1414 +- firewallrule_test.go | 78 +- firewalluarule.go | 481 +- firewalluarule_test.go | 44 +- firewallwafoverride.go | 706 +- firewallwafoverride_test.go | 38 +- firewallwafpackagegroup.go | 311 +- firewallwafpackagegroup_test.go | 26 +- fontsetting.go | 320 - gateway.go | 175 +- gateway_test.go | 8 +- gatewayapptype.go | 127 +- gatewayapptype_test.go | 4 +- gatewayauditsshsetting.go | 182 +- gatewayauditsshsetting_test.go | 22 +- gatewaycategory.go | 138 +- gatewaycategory_test.go | 4 +- gatewayconfiguration.go | 1102 +- gatewayconfiguration_test.go | 112 +- gatewaylist.go | 585 +- gatewaylist_test.go | 56 +- gatewaylistitem.go | 95 +- gatewaylistitem_test.go | 4 +- gatewaylocation.go | 539 +- gatewaylocation_test.go | 58 +- gatewaylogging.go | 196 +- gatewaylogging_test.go | 12 +- gatewayproxyendpoint.go | 391 +- gatewayproxyendpoint_test.go | 64 +- gatewayrule.go | 1793 +- gatewayrule_test.go | 130 +- healthcheck.go | 939 +- healthcheck_test.go | 86 +- healthcheckpreview.go | 644 +- healthcheckpreview_test.go | 82 +- hostnamesettingtls.go | 302 +- hostnamesettingtls_test.go | 26 +- hyperdriveconfig.go | 236 +- hyperdriveconfig_test.go | 34 +- imagev1.go | 565 +- imagev1_test.go | 32 +- imagev1blob.go | 2 +- imagev1blob_test.go | 4 +- imagev1key.go | 92 +- imagev1key_test.go | 4 +- imagev1stat.go | 93 +- imagev1stat_test.go | 4 +- imagev1variant.go | 653 +- imagev1variant_test.go | 52 +- imagev2directupload.go | 82 +- imagev2directupload_test.go | 6 +- intel.go | 4 + intelasn_test.go | 2 +- intelasnsubnet_test.go | 2 +- inteldns.go | 112 +- inteldns_test.go | 8 +- inteldomain.go | 187 +- inteldomain_test.go | 6 +- inteldomainbulk.go | 190 +- inteldomainbulk_test.go | 6 +- inteldomainhistory_test.go | 2 +- intelindicatorfeed.go | 415 +- intelindicatorfeed_test.go | 98 +- intelindicatorfeedpermission.go | 364 + ...go => intelindicatorfeedpermission_test.go | 24 +- intelip.go | 134 +- intelip_test.go | 6 +- inteliplist.go | 94 +- inteliplist_test.go | 4 +- intelmiscategorization.go | 90 +- intelmiscategorization_test.go | 8 +- intelwhois.go | 99 +- intelwhois_test.go | 6 +- internal/shared/union.go | 779 +- loadbalancermonitorpreview.go | 100 +- loadbalancermonitorpreview_test.go | 8 +- loadbalancermonitorreference.go | 111 +- loadbalancermonitorreference_test.go | 4 +- loadbalancerpoolhealth.go | 280 +- loadbalancerpoolhealth_test.go | 58 +- loadbalancerregion.go | 218 +- loadbalancerregion_test.go | 20 +- log.go | 10 +- logcontrolcmb.go | 4 +- logcontrolcmbconfig.go | 258 +- logcontrolcmbconfig_test.go | 24 +- logcontrolretentionflag.go | 176 +- logcontrolretentionflag_test.go | 20 +- logpush.go | 18 +- logpushedge.go | 78 +- logpushedge_test.go | 8 +- logpushjob.go | 564 +- logpushjob_test.go | 60 +- logpushownership.go | 202 +- logpushownership_test.go | 40 +- logpushownershipvalidate.go | 148 - logpushownershipvalidate_test.go | 48 - logpushvalidate.go | 237 +- ...nection_test.go => logpushvalidate_test.go | 24 +- logpushvalidatedestination.go | 27 - logpushvalidatedestinationexist.go | 146 - logpushvalidatedestinationexist_test.go | 47 - logpushvalidateorigin.go | 150 - logpushvalidateorigin_test.go | 47 - logreceived.go | 40 +- logreceived_test.go | 12 +- logreceivedfield.go | 16 +- logreceivedfield_test.go | 4 +- magiccfinterconnect.go | 581 +- magiccfinterconnect_test.go | 68 +- magicgretunnel.go | 836 +- magicgretunnel_test.go | 90 +- magicipsectunnel.go | 775 +- magicipsectunnel_test.go | 74 +- magicipsectunnelpskgenerate.go | 93 +- magicipsectunnelpskgenerate_test.go | 4 +- magicroute.go | 506 +- magicroute_test.go | 96 +- managedheader.go | 131 +- managedheader_test.go | 58 +- membership.go | 218 +- membership_test.go | 48 +- mnmconfig.go | 408 +- mnmconfig_test.go | 20 +- mnmconfigfull.go | 80 +- mnmconfigfull_test.go | 4 +- mnmrule.go | 528 +- mnmrule_test.go | 40 +- mnmruleadvertisement.go | 78 +- mnmruleadvertisement_test.go | 4 +- mtlscertificate.go | 78 +- mtlscertificate_test.go | 6 +- originpostquantumencryption.go | 180 +- originpostquantumencryption_test.go | 20 +- origintlsclientauthhostname.go | 292 +- origintlsclientauthhostname_test.go | 40 +- origintlsclientauthsetting.go | 162 +- origintlsclientauthsetting_test.go | 10 +- pageprojectdeployment.go | 447 +- pageprojectdeployment_test.go | 62 + pageprojectdeploymenthistorylog.go | 81 +- pageprojectdeploymenthistorylog_test.go | 4 +- pageprojectdeploymentretry.go | 256 - pageprojectdeploymentretry_test.go | 45 - pageprojectdeploymentrollback.go | 257 - pageprojectdeploymentrollback_test.go | 45 - pageprojectdomain.go | 379 +- pageprojectdomain_test.go | 34 +- pagerule.go | 414 +- pagerule_test.go | 64 +- pagerulesetting.go | 65 +- pagerulesetting_test.go | 4 +- pageshield.go | 83 +- pageshield_test.go | 8 +- pageshieldconnection.go | 192 +- pageshieldconnection_test.go | 38 +- pageshieldpolicy.go | 134 +- pageshieldpolicy_test.go | 38 +- pageshieldscript.go | 209 +- pageshieldscript_test.go | 40 +- pcap.go | 783 +- pcap_test.go | 46 +- pcapdownload.go | 2 +- pcapdownload_test.go | 4 +- pcapownership.go | 346 +- pcapownership_test.go | 53 +- pcapownershipvalidate.go | 171 - pcapownershipvalidate_test.go | 47 - purgecach.go | 222 - purgecach_test.go | 48 - radarbgphijack.go | 279 +- radarbgphijack_test.go | 12 +- radarbgproute.go | 435 +- radarbgproute_test.go | 106 - radarbgproutemoa.go | 173 + ...ycheck_test.go => radarbgproutemoa_test.go | 15 +- radarbgproutepfx2a.go | 165 + ...resh_test.go => radarbgproutepfx2a_test.go | 13 +- radarbgproutestat.go | 182 + ...otate_test.go => radarbgproutestat_test.go | 8 +- radarbgptopase.go | 127 +- radarbgptopase_test.go | 30 - radarbgptopaseprefix.go | 156 + ...te_test.go => radarbgptopaseprefix_test.go | 12 +- radarconnectiontampering.go | 173 +- radarconnectiontampering_test.go | 8 +- radardatasetdownload.go | 68 +- radardatasetdownload_test.go | 6 +- radaremailsecuritysummaryspam.go | 218 +- radaremailsecuritysummaryspam_test.go | 16 +- radarentity.go | 76 +- radarentity_test.go | 6 +- radarhttp.go | 1728 -- radarhttp_test.go | 346 - radarqualityiqi.go | 189 +- radarqualityiqi_test.go | 10 +- radarqualityspeedhistogram.go | 78 +- radarqualityspeedhistogram_test.go | 8 +- radarqualityspeedsummary.go | 154 +- radarqualityspeedsummary_test.go | 6 +- ratelimit.go | 207 + ratelimit_test.go | 62 + registrardomain.go | 218 +- registrardomain_test.go | 30 +- requesttracertrace.go | 300 +- role.go | 90 +- role_test.go | 4 +- rulelist.go | 408 +- rulelist_test.go | 42 +- rulelistitem.go | 635 +- rulelistitem_test.go | 158 +- ruleset.go | 2080 +- ruleset_test.go | 136 +- rulesetrule.go | 2455 ++- rulesetrule_test.go | 68 +- rulesetversion.go | 184 +- rulesetversion_test.go | 10 +- rumrule.go | 150 +- rumrule_test.go | 26 +- rumsiteinfo.go | 266 +- rumsiteinfo_test.go | 36 +- secondarydns.go | 8 +- secondarydnsacl.go | 449 +- secondarydnsacl_test.go | 42 +- secondarydnsforceaxfr.go | 61 +- secondarydnsforceaxfr_test.go | 4 +- secondarydnsincoming.go | 368 +- secondarydnsincoming_test.go | 34 +- secondarydnsoutgoing.go | 556 +- secondarydnsoutgoing_test.go | 106 +- secondarydnsoutgoingdisable.go | 118 - secondarydnsoutgoingdisable_test.go | 40 - secondarydnsoutgoingenable.go | 117 - secondarydnsoutgoingenable_test.go | 40 - secondarydnsoutgoingforcenotify.go | 118 - secondarydnsoutgoingforcenotify_test.go | 40 - secondarydnsoutgoingstatus.go | 61 +- secondarydnsoutgoingstatus_test.go | 4 +- secondarydnspeer.go | 489 +- secondarydnspeer_test.go | 48 +- secondarydnstsig.go | 435 +- secondarydnstsig_test.go | 42 +- setting.go | 6 +- settingearlyhint_test.go | 4 +- settingfontsetting.go | 320 + ...erve_test.go => settingfontsetting_test.go | 20 +- settingzerortt.go | 226 +- settingzerortt_test.go | 20 +- snippet.go | 232 +- snippet_test.go | 36 +- snippetsnippetrule.go | 198 +- snippetsnippetrule_test.go | 50 +- spectrumanalyticsaggregatecurrent.go | 76 +- spectrumanalyticsaggregatecurrent_test.go | 6 +- spectrumanalyticseventbytime.go | 134 +- spectrumanalyticseventbytime_test.go | 12 +- spectrumanalyticseventsummary.go | 114 +- spectrumanalyticseventsummary_test.go | 10 +- spectrumapp.go | 876 +- spectrumapp_test.go | 102 +- speed.go | 1075 + cfdtunnel_test.go => speed_test.go | 72 +- speedapi.go | 1835 -- speedapi_test.go | 300 - speedapischedule.go | 483 - speedavailability.go | 160 + ...ility_test.go => speedavailability_test.go | 4 +- speedpage.go | 440 + usertokenverify_test.go => speedpage_test.go | 4 +- speedschedule.go | 482 + ...ischedule_test.go => speedschedule_test.go | 8 +- speedtest.go | 168 + ...tternvalidate_test.go => speedtest_test.go | 11 +- ssl.go | 12 +- sslanalyze.go | 87 +- sslanalyze_test.go | 8 +- sslcertificatepack.go | 239 +- sslcertificatepack_test.go | 20 +- sslcertificatepackorder.go | 198 +- sslcertificatepackorder_test.go | 14 +- sslcertificatepackquota.go | 93 +- sslcertificatepackquota_test.go | 4 +- sslrecommendation_test.go | 2 +- ssluniversalsetting_test.go | 4 +- sslverification.go | 132 +- sslverification_test.go | 10 +- storagekvnamespace.go | 220 +- storagekvnamespace_test.go | 14 +- storagekvnamespacebulk.go | 84 +- storagekvnamespacebulk_test.go | 10 +- storagekvnamespacevalue.go | 178 +- storagekvnamespacevalue_test.go | 20 +- stream.go | 669 +- stream_test.go | 90 +- streamaudiotrack.go | 232 +- streamaudiotrack_test.go | 34 +- streamcaption.go | 215 +- streamcaption_test.go | 16 +- streamclip.go | 142 +- streamclip_test.go | 8 +- streamcopy.go | 175 +- streamcopy_test.go | 8 +- streamdirectupload.go | 107 +- streamdirectupload_test.go | 8 +- streamdownload.go | 225 +- streamdownload_test.go | 12 +- streamkey.go | 264 +- streamkey_test.go | 20 +- streamliveinput.go | 800 +- streamliveinput_test.go | 60 +- streamliveinputoutput.go | 308 +- streamliveinputoutput_test.go | 34 +- streamtoken.go | 106 +- streamtoken_test.go | 20 +- streamwatermark.go | 415 +- streamwatermark_test.go | 42 +- streamwebhook.go | 167 +- streamwebhook_test.go | 20 +- subscription.go | 987 +- subscription_test.go | 170 +- teamnetroute.go | 162 +- teamnetroute_test.go | 6 +- teamnetroutenetwork.go | 78 +- teamnetroutenetwork_test.go | 6 +- teamnetvirtualnetwork.go | 468 +- teamnetvirtualnetwork_test.go | 44 +- tunnel.go | 726 +- tunnel_test.go | 58 +- tunnelconfiguration.go | 417 + ...ion_test.go => tunnelconfiguration_test.go | 32 +- tunnelconnection.go | 193 + tunnelconnection_test.go | 30 + cfdtunnelconnector.go => tunnelconnector.go | 106 +- ...nnector_test.go => tunnelconnector_test.go | 4 +- tunnelmanagement.go | 154 + ...gement_test.go => tunnelmanagement_test.go | 8 +- tunneltoken.go | 137 + cfdtunneltoken_test.go => tunneltoken_test.go | 4 +- urlnormalization.go | 38 +- urlnormalization_test.go | 10 +- user.go | 144 +- user_test.go | 8 +- userbilling.go | 8 +- userbillinghistory.go | 178 +- userbillinghistory_test.go | 6 +- userbillingprofile.go | 72 +- userbillingprofile_test.go | 4 +- userfirewallaccessrulerule.go | 1186 +- userfirewallaccessrulerule_test.go | 78 +- userinvite.go | 261 +- userinvite_test.go | 8 +- userloadbalancermonitorpreview.go | 102 +- userloadbalancermonitorpreview_test.go | 8 +- userloadbalancerpool.go | 1903 +- userloadbalancerpool_test.go | 208 +- userloadbalancerpoolhealth.go | 72 +- userloadbalancerpoolhealth_test.go | 4 +- userloadbalancerpoolpreview.go | 100 +- userloadbalancerpoolpreview_test.go | 8 +- userloadbalancerpoolreference.go | 112 +- userloadbalancerpoolreference_test.go | 4 +- userloadbalancinganalyticevent.go | 113 +- userloadbalancinganalyticevent_test.go | 4 +- userorganization.go | 300 +- userorganization_test.go | 28 +- usersubscription.go | 499 +- usersubscription_test.go | 78 +- usertoken.go | 480 +- usertoken_test.go | 178 +- usertokenpermissiongroup.go | 82 +- usertokenpermissiongroup_test.go | 4 +- usertokenvalue.go | 64 +- usertokenvalue_test.go | 6 +- usertokenverify.go | 153 - vectorizeindex.go | 505 +- vectorizeindex_test.go | 94 +- waitingroom.go | 910 +- waitingroom_test.go | 114 +- waitingroomevent.go | 381 +- waitingroomevent_test.go | 56 +- waitingroomeventdetail.go | 36 +- waitingroomeventdetail_test.go | 4 +- waitingroompreview.go | 144 - waitingroompreview_test.go | 46 - waitingroomrule.go | 623 +- waitingroomrule_test.go | 54 +- waitingroomstatus.go | 50 +- waitingroomstatus_test.go | 4 +- web3hostname.go | 591 +- web3hostname_test.go | 42 +- web3hostnameipfsuniversalpathcontentlist.go | 189 +- ...stnameipfsuniversalpathcontentlist_test.go | 20 +- ...stnameipfsuniversalpathcontentlistentry.go | 520 +- ...eipfsuniversalpathcontentlistentry_test.go | 38 +- workeraccountsetting.go | 184 +- workeraccountsetting_test.go | 20 +- workerdeploymentbyscript.go | 187 +- workerdeploymentbyscript_test.go | 35 +- workerdeploymentbyscriptdetail.go | 138 - workerdomain.go | 301 +- workerdomain_test.go | 34 +- workerfilter.go | 360 +- workerfilter_test.go | 36 +- workerqueue.go | 212 +- workerqueue_test.go | 18 +- workerqueueconsumer.go | 261 +- workerqueueconsumer_test.go | 26 +- workerroute.go | 364 +- workerroute_test.go | 40 +- workerscript.go | 451 +- workerscript_test.go | 202 +- workerscriptcontent.go | 104 +- workerscriptcontent_test.go | 8 +- workerscriptschedule.go | 198 +- workerscriptschedule_test.go | 10 +- workerscripttail.go | 276 +- workerscripttail_test.go | 14 +- workerscriptusagemodel.go | 160 +- workerscriptusagemodel_test.go | 10 +- workerserviceenvironmentcontent.go | 122 +- workerserviceenvironmentcontent_test.go | 78 +- workerserviceenvironmentsetting.go | 1250 +- workerserviceenvironmentsetting_test.go | 100 +- ...rplatformdispatchnamespacescriptcontent.go | 124 +- ...formdispatchnamespacescriptcontent_test.go | 78 +- workersubdomain.go | 178 +- workersubdomain_test.go | 20 +- zaraz.go | 74 +- zaraz_test.go | 8 +- zarazconfig.go | 2795 +-- zarazconfig_test.go | 114 +- zarazhistory.go | 1196 +- zarazhistory_test.go | 22 +- zone.go | 4 +- zonehold.go | 204 +- zonehold_test.go | 26 +- 663 files changed, 84245 insertions(+), 102240 deletions(-) delete mode 100644 accessappca.go rename accessapp.go => accessapplication.go (53%) rename accessapp_test.go => accessapplication_test.go (79%) create mode 100644 accessapplicationca.go rename accessappca_test.go => accessapplicationca_test.go (89%) create mode 100644 accessapplicationpolicy.go create mode 100644 accessapplicationpolicy_test.go create mode 100644 accessapplicationuserpolicycheck.go rename accessapprevoketoken_test.go => accessapplicationuserpolicycheck_test.go (87%) delete mode 100644 accessapppolicy.go delete mode 100644 accessapppolicy_test.go delete mode 100644 accessapprevoketoken.go delete mode 100644 accessappuserpolicycheck.go delete mode 100644 accesskeyrotate.go delete mode 100644 accessorganizationrevokeuser.go delete mode 100644 accessorganizationrevokeuser_test.go delete mode 100644 accessservicetokenrefresh.go delete mode 100644 accessservicetokenrotate.go rename customnverify_test.go => alertingv3_test.go (87%) delete mode 100644 alertingv3availablealert.go delete mode 100644 analytics.go delete mode 100644 analyticscolo.go delete mode 100644 analyticscolo_test.go delete mode 100644 analyticsdashboard.go delete mode 100644 analyticsdashboard_test.go delete mode 100644 analyticslatency.go delete mode 100644 analyticslatency_test.go delete mode 100644 analyticslatencycolo.go delete mode 100644 analyticslatencycolo_test.go delete mode 100644 cach.go delete mode 100644 cachcachereserve.go create mode 100644 cachecachereserve.go rename fontsetting_test.go => cachecachereserve_test.go (83%) create mode 100644 cacheregionaltieredcache.go create mode 100644 cacheregionaltieredcache_test.go create mode 100644 cachetieredcachesmarttopology.go rename customn_test.go => cachetieredcachesmarttopology_test.go (79%) rename cachvariant.go => cachevariant.go (54%) rename cachvariant_test.go => cachevariant_test.go (84%) delete mode 100644 cachtieredcachesmarttopologyenable.go delete mode 100644 cfdtunnel.go delete mode 100644 cfdtunnelconfiguration.go delete mode 100644 cfdtunnelconnection.go delete mode 100644 cfdtunnelmanagement.go delete mode 100644 cfdtunneltoken.go delete mode 100644 customn.go create mode 100644 customnameserver.go create mode 100644 customnameserver_test.go delete mode 100644 customnavailability.go delete mode 100644 customnverify.go create mode 100644 devicepolicydefaultpolicy.go rename alertingv3availablealert_test.go => devicepolicydefaultpolicy_test.go (86%) create mode 100644 dlpdatasetupload.go create mode 100644 dlpdatasetupload_test.go rename workerdeploymentbyscriptdetail_test.go => dlppattern_test.go (83%) delete mode 100644 dlppatternvalidate.go delete mode 100644 fontsetting.go create mode 100644 intelindicatorfeedpermission.go rename cachtieredcachesmarttopologyenable_test.go => intelindicatorfeedpermission_test.go (73%) delete mode 100644 logpushownershipvalidate.go delete mode 100644 logpushownershipvalidate_test.go rename cfdtunnelconnection_test.go => logpushvalidate_test.go (74%) delete mode 100644 logpushvalidatedestination.go delete mode 100644 logpushvalidatedestinationexist.go delete mode 100644 logpushvalidatedestinationexist_test.go delete mode 100644 logpushvalidateorigin.go delete mode 100644 logpushvalidateorigin_test.go delete mode 100644 pageprojectdeploymentretry.go delete mode 100644 pageprojectdeploymentretry_test.go delete mode 100644 pageprojectdeploymentrollback.go delete mode 100644 pageprojectdeploymentrollback_test.go delete mode 100644 pcapownershipvalidate.go delete mode 100644 pcapownershipvalidate_test.go delete mode 100644 purgecach.go delete mode 100644 purgecach_test.go delete mode 100644 radarbgproute_test.go create mode 100644 radarbgproutemoa.go rename accessappuserpolicycheck_test.go => radarbgproutemoa_test.go (73%) create mode 100644 radarbgproutepfx2a.go rename accessservicetokenrefresh_test.go => radarbgproutepfx2a_test.go (70%) create mode 100644 radarbgproutestat.go rename accesskeyrotate_test.go => radarbgproutestat_test.go (75%) create mode 100644 radarbgptopaseprefix.go rename accessservicetokenrotate_test.go => radarbgptopaseprefix_test.go (74%) delete mode 100644 radarhttp_test.go delete mode 100644 secondarydnsoutgoingdisable.go delete mode 100644 secondarydnsoutgoingdisable_test.go delete mode 100644 secondarydnsoutgoingenable.go delete mode 100644 secondarydnsoutgoingenable_test.go delete mode 100644 secondarydnsoutgoingforcenotify.go delete mode 100644 secondarydnsoutgoingforcenotify_test.go create mode 100644 settingfontsetting.go rename cachcachereserve_test.go => settingfontsetting_test.go (79%) create mode 100644 speed.go rename cfdtunnel_test.go => speed_test.go (67%) delete mode 100644 speedapi.go delete mode 100644 speedapi_test.go delete mode 100644 speedapischedule.go create mode 100644 speedavailability.go rename customnavailability_test.go => speedavailability_test.go (87%) create mode 100644 speedpage.go rename usertokenverify_test.go => speedpage_test.go (87%) create mode 100644 speedschedule.go rename speedapischedule_test.go => speedschedule_test.go (82%) create mode 100644 speedtest.go rename dlppatternvalidate_test.go => speedtest_test.go (78%) create mode 100644 tunnelconfiguration.go rename cfdtunnelconfiguration_test.go => tunnelconfiguration_test.go (74%) rename cfdtunnelconnector.go => tunnelconnector.go (52%) rename cfdtunnelconnector_test.go => tunnelconnector_test.go (92%) create mode 100644 tunnelmanagement.go rename cfdtunnelmanagement_test.go => tunnelmanagement_test.go (80%) create mode 100644 tunneltoken.go rename cfdtunneltoken_test.go => tunneltoken_test.go (87%) delete mode 100644 usertokenverify.go delete mode 100644 waitingroompreview.go delete mode 100644 waitingroompreview_test.go delete mode 100644 workerdeploymentbyscriptdetail.go diff --git a/.stats.yml b/.stats.yml index 55af302ca96..42d27238982 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1147 +configured_endpoints: 1111 diff --git a/README.md b/README.md index 44cc49e9fb6..266d6bd8535 100644 --- a/README.md +++ b/README.md @@ -181,20 +181,14 @@ When the API returns a non-success status code, we return an error with type To handle errors, we recommend that you use the `errors.As` pattern: ```go -_, err := client.Zones.New(context.TODO(), cloudflare.ZoneNewParams{ - Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{ - ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - }), - Name: cloudflare.F("example.com"), - Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull), -}) +_, err := client.Zones.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { println(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response } - panic(err.Error()) // GET "/zones": 400 Bad Request { ... } + panic(err.Error()) // GET "/zones/{zone_id}": 400 Bad Request { ... } } ``` @@ -212,15 +206,10 @@ To set a per-retry timeout, use `option.WithRequestTimeout()`. // This sets the timeout for the request, including all the retries. ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() -client.Zones.New( +client.Zones.Update( ctx, - cloudflare.ZoneNewParams{ - Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{ - ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - }), - Name: cloudflare.F("example.com"), - Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull), - }, + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.ZoneUpdateParams{}, // This sets the per-retry timeout option.WithRequestTimeout(20*time.Second), ) @@ -241,15 +230,9 @@ client := cloudflare.NewClient( ) // Override per-request: -client.Zones.New( +client.Zones.Get( context.TODO(), - cloudflare.ZoneNewParams{ - Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{ - ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - }), - Name: cloudflare.F("example.com"), - Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull), - }, + "023e105f4ecef8ad9ca31a8372d0c353", option.WithMaxRetries(5), ) ``` diff --git a/access.go b/access.go index 6b1f8cb4126..5b5841cfdf3 100644 --- a/access.go +++ b/access.go @@ -12,7 +12,7 @@ import ( // service directly, and instead use the [NewAccessService] method instead. type AccessService struct { Options []option.RequestOption - Apps *AccessAppService + Applications *AccessApplicationService Certificates *AccessCertificateService Groups *AccessGroupService IdentityProviders *AccessIdentityProviderService @@ -33,7 +33,7 @@ type AccessService struct { func NewAccessService(opts ...option.RequestOption) (r *AccessService) { r = &AccessService{} r.Options = opts - r.Apps = NewAccessAppService(opts...) + r.Applications = NewAccessApplicationService(opts...) r.Certificates = NewAccessCertificateService(opts...) r.Groups = NewAccessGroupService(opts...) r.IdentityProviders = NewAccessIdentityProviderService(opts...) diff --git a/accessappca.go b/accessappca.go deleted file mode 100644 index 2bf2b9c0bb9..00000000000 --- a/accessappca.go +++ /dev/null @@ -1,466 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -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 -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAccessAppCaService] method -// instead. -type AccessAppCaService struct { - Options []option.RequestOption -} - -// NewAccessAppCaService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAccessAppCaService(opts ...option.RequestOption) (r *AccessAppCaService) { - r = &AccessAppCaService{} - r.Options = opts - return -} - -// Generates a new short-lived certificate CA and public key. -func (r *AccessAppCaService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessAppCaNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppCaNewResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists short-lived certificate CAs and their public keys. -func (r *AccessAppCaService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessAppCaListResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppCaListResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/ca", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes a short-lived certificate CA. -func (r *AccessAppCaService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessAppCaDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppCaDeleteResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches a short-lived certificate CA and its public key. -func (r *AccessAppCaService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessAppCaGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppCaGetResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [AccessAppCaNewResponseUnknown] or [shared.UnionString]. -type AccessAppCaNewResponse interface { - ImplementsAccessAppCaNewResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AccessAppCaNewResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AccessAppCaListResponse struct { - // The ID of the CA. - ID string `json:"id"` - // The Application Audience (AUD) tag. Identifies the application associated with - // the CA. - Aud string `json:"aud"` - // The public key to add to your SSH server configuration. - PublicKey string `json:"public_key"` - JSON accessAppCaListResponseJSON `json:"-"` -} - -// accessAppCaListResponseJSON contains the JSON metadata for the struct -// [AccessAppCaListResponse] -type accessAppCaListResponseJSON struct { - ID apijson.Field - Aud apijson.Field - PublicKey apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaDeleteResponse struct { - // The ID of the CA. - ID string `json:"id"` - JSON accessAppCaDeleteResponseJSON `json:"-"` -} - -// accessAppCaDeleteResponseJSON contains the JSON metadata for the struct -// [AccessAppCaDeleteResponse] -type accessAppCaDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by [AccessAppCaGetResponseUnknown] or [shared.UnionString]. -type AccessAppCaGetResponse interface { - ImplementsAccessAppCaGetResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AccessAppCaGetResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AccessAppCaNewResponseEnvelope struct { - Errors []AccessAppCaNewResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppCaNewResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppCaNewResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppCaNewResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppCaNewResponseEnvelopeJSON `json:"-"` -} - -// accessAppCaNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppCaNewResponseEnvelope] -type accessAppCaNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaNewResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppCaNewResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppCaNewResponseEnvelopeErrors] -type accessAppCaNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaNewResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppCaNewResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppCaNewResponseEnvelopeMessages] -type accessAppCaNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppCaNewResponseEnvelopeSuccess bool - -const ( - AccessAppCaNewResponseEnvelopeSuccessTrue AccessAppCaNewResponseEnvelopeSuccess = true -) - -type AccessAppCaListResponseEnvelope struct { - Errors []AccessAppCaListResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppCaListResponseEnvelopeMessages `json:"messages,required"` - Result []AccessAppCaListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AccessAppCaListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessAppCaListResponseEnvelopeResultInfo `json:"result_info"` - JSON accessAppCaListResponseEnvelopeJSON `json:"-"` -} - -// accessAppCaListResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppCaListResponseEnvelope] -type accessAppCaListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaListResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppCaListResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppCaListResponseEnvelopeErrors] -type accessAppCaListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaListResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppCaListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppCaListResponseEnvelopeMessages] -type accessAppCaListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppCaListResponseEnvelopeSuccess bool - -const ( - AccessAppCaListResponseEnvelopeSuccessTrue AccessAppCaListResponseEnvelopeSuccess = true -) - -type AccessAppCaListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessAppCaListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessAppCaListResponseEnvelopeResultInfoJSON contains the JSON metadata for the -// struct [AccessAppCaListResponseEnvelopeResultInfo] -type accessAppCaListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaDeleteResponseEnvelope struct { - 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,required"` - JSON accessAppCaDeleteResponseEnvelopeJSON `json:"-"` -} - -// accessAppCaDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppCaDeleteResponseEnvelope] -type accessAppCaDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppCaDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppCaDeleteResponseEnvelopeErrors] -type accessAppCaDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppCaDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppCaDeleteResponseEnvelopeMessages] -type accessAppCaDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppCaDeleteResponseEnvelopeSuccess bool - -const ( - AccessAppCaDeleteResponseEnvelopeSuccessTrue AccessAppCaDeleteResponseEnvelopeSuccess = true -) - -type AccessAppCaGetResponseEnvelope struct { - Errors []AccessAppCaGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppCaGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppCaGetResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppCaGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppCaGetResponseEnvelopeJSON `json:"-"` -} - -// accessAppCaGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppCaGetResponseEnvelope] -type accessAppCaGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppCaGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppCaGetResponseEnvelopeErrors] -type accessAppCaGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppCaGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppCaGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppCaGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppCaGetResponseEnvelopeMessages] -type accessAppCaGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppCaGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppCaGetResponseEnvelopeSuccess bool - -const ( - AccessAppCaGetResponseEnvelopeSuccessTrue AccessAppCaGetResponseEnvelopeSuccess = true -) diff --git a/accessapp.go b/accessapplication.go similarity index 53% rename from accessapp.go rename to accessapplication.go index fffd5c69e8e..6d59dba2e4a 100644 --- a/accessapp.go +++ b/accessapplication.go @@ -15,35 +15,34 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -// AccessAppService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewAccessAppService] method instead. -type AccessAppService struct { +// AccessApplicationService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewAccessApplicationService] method +// instead. +type AccessApplicationService struct { Options []option.RequestOption - Cas *AccessAppCaService - RevokeTokens *AccessAppRevokeTokenService - UserPolicyChecks *AccessAppUserPolicyCheckService - Policies *AccessAppPolicyService + Cas *AccessApplicationCaService + UserPolicyChecks *AccessApplicationUserPolicyCheckService + Policies *AccessApplicationPolicyService } -// NewAccessAppService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAccessAppService(opts ...option.RequestOption) (r *AccessAppService) { - r = &AccessAppService{} +// NewAccessApplicationService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewAccessApplicationService(opts ...option.RequestOption) (r *AccessApplicationService) { + r = &AccessApplicationService{} r.Options = opts - r.Cas = NewAccessAppCaService(opts...) - r.RevokeTokens = NewAccessAppRevokeTokenService(opts...) - r.UserPolicyChecks = NewAccessAppUserPolicyCheckService(opts...) - r.Policies = NewAccessAppPolicyService(opts...) + r.Cas = NewAccessApplicationCaService(opts...) + r.UserPolicyChecks = NewAccessApplicationUserPolicyCheckService(opts...) + r.Policies = NewAccessApplicationPolicyService(opts...) return } // Adds a new application to Access. -func (r *AccessAppService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessAppNewParams, opts ...option.RequestOption) (res *AccessAppNewResponse, err error) { +func (r *AccessApplicationService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessApplicationNewParams, opts ...option.RequestOption) (res *AccessApplicationNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessAppNewResponseEnvelope + var env AccessApplicationNewResponseEnvelope path := fmt.Sprintf("%s/%s/access/apps", accountOrZone, accountOrZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -53,12 +52,25 @@ func (r *AccessAppService) New(ctx context.Context, accountOrZone string, accoun return } -// Updates an Access application. -func (r *AccessAppService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessAppUpdateParamsVariant0AppID, body AccessAppUpdateParams, opts ...option.RequestOption) (res *AccessAppUpdateResponse, err error) { +// Lists all Access applications in an account or zone. +func (r *AccessApplicationService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessApplicationListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Deletes an application from Access. +func (r *AccessApplicationService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessApplicationDeleteParamsAppID, opts ...option.RequestOption) (res *AccessApplicationDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessAppUpdateResponseEnvelope + var env AccessApplicationDeleteResponseEnvelope path := fmt.Sprintf("%s/%s/access/apps/%v", accountOrZone, accountOrZoneID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -66,11 +78,11 @@ func (r *AccessAppService) Update(ctx context.Context, accountOrZone string, acc return } -// Lists all Access applications in an account or zone. -func (r *AccessAppService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessAppListResponse, err error) { +// Fetches information about an Access application. +func (r *AccessApplicationService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessApplicationGetParamsAppID, opts ...option.RequestOption) (res *AccessApplicationGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessAppListResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps", accountOrZone, accountOrZoneID) + var env AccessApplicationGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%v", accountOrZone, accountOrZoneID, appID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -79,12 +91,12 @@ func (r *AccessAppService) List(ctx context.Context, accountOrZone string, accou return } -// Deletes an application from Access. -func (r *AccessAppService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessAppDeleteParamsAppID, opts ...option.RequestOption) (res *AccessAppDeleteResponse, err error) { +// Updates an Access application. +func (r *AccessApplicationService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessApplicationReplaceParamsVariant0AppID, body AccessApplicationReplaceParams, opts ...option.RequestOption) (res *AccessApplicationReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessAppDeleteResponseEnvelope + var env AccessApplicationReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/apps/%v", accountOrZone, accountOrZoneID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -92,12 +104,12 @@ func (r *AccessAppService) Delete(ctx context.Context, accountOrZone string, acc return } -// Fetches information about an Access application. -func (r *AccessAppService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessAppGetParamsAppID, opts ...option.RequestOption) (res *AccessAppGetResponse, err error) { +// Revokes all tokens issued for an application. +func (r *AccessApplicationService) RevokeTokens(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessApplicationRevokeTokensParamsAppID, opts ...option.RequestOption) (res *AccessApplicationRevokeTokensResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessAppGetResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%v", accountOrZone, accountOrZoneID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env AccessApplicationRevokeTokensResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%v/revoke_tokens", accountOrZone, accountOrZoneID, appID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -105,19 +117,20 @@ func (r *AccessAppService) Get(ctx context.Context, accountOrZone string, accoun return } -// Union satisfied by [AccessAppNewResponseObject], [AccessAppNewResponseObject], -// [AccessAppNewResponseObject], [AccessAppNewResponseObject], -// [AccessAppNewResponseObject], [AccessAppNewResponseObject], -// [AccessAppNewResponseObject] or [AccessAppNewResponseObject]. -type AccessAppNewResponse interface { - implementsAccessAppNewResponse() +// Union satisfied by [AccessApplicationNewResponseObject], +// [AccessApplicationNewResponseObject], [AccessApplicationNewResponseObject], +// [AccessApplicationNewResponseObject], [AccessApplicationNewResponseObject], +// [AccessApplicationNewResponseObject], [AccessApplicationNewResponseObject] or +// [AccessApplicationNewResponseObject]. +type AccessApplicationNewResponse interface { + implementsAccessApplicationNewResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppNewResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationNewResponse)(nil)).Elem(), "") } -type AccessAppNewResponseObject struct { +type AccessApplicationNewResponseObject struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain string `json:"domain,required"` @@ -139,9 +152,9 @@ type AccessAppNewResponseObject struct { Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CorsHeaders AccessAppNewResponseObjectCorsHeaders `json:"cors_headers"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CorsHeaders AccessApplicationNewResponseObjectCorsHeaders `json:"cors_headers"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage string `json:"custom_deny_message"` @@ -181,14 +194,14 @@ type AccessAppNewResponseObject struct { SkipInterstitial bool `json:"skip_interstitial"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. - Tags []string `json:"tags"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppNewResponseObjectJSON `json:"-"` + Tags []string `json:"tags"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationNewResponseObjectJSON `json:"-"` } -// accessAppNewResponseObjectJSON contains the JSON metadata for the struct -// [AccessAppNewResponseObject] -type accessAppNewResponseObjectJSON struct { +// accessApplicationNewResponseObjectJSON contains the JSON metadata for the struct +// [AccessApplicationNewResponseObject] +type accessApplicationNewResponseObjectJSON struct { Domain apijson.Field Type apijson.Field ID apijson.Field @@ -219,13 +232,13 @@ type accessAppNewResponseObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppNewResponseObject) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationNewResponseObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessAppNewResponseObject) implementsAccessAppNewResponse() {} +func (r AccessApplicationNewResponseObject) implementsAccessApplicationNewResponse() {} -type AccessAppNewResponseObjectCorsHeaders struct { +type AccessApplicationNewResponseObjectCorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders bool `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -238,17 +251,17 @@ type AccessAppNewResponseObjectCorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders []interface{} `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods []AccessAppNewResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` + AllowedMethods []AccessApplicationNewResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` // Allowed origins. AllowedOrigins []interface{} `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. - MaxAge float64 `json:"max_age"` - JSON accessAppNewResponseObjectCorsHeadersJSON `json:"-"` + MaxAge float64 `json:"max_age"` + JSON accessApplicationNewResponseObjectCorsHeadersJSON `json:"-"` } -// accessAppNewResponseObjectCorsHeadersJSON contains the JSON metadata for the -// struct [AccessAppNewResponseObjectCorsHeaders] -type accessAppNewResponseObjectCorsHeadersJSON struct { +// accessApplicationNewResponseObjectCorsHeadersJSON contains the JSON metadata for +// the struct [AccessApplicationNewResponseObjectCorsHeaders] +type accessApplicationNewResponseObjectCorsHeadersJSON struct { AllowAllHeaders apijson.Field AllowAllMethods apijson.Field AllowAllOrigins apijson.Field @@ -261,38 +274,38 @@ type accessAppNewResponseObjectCorsHeadersJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppNewResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationNewResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppNewResponseObjectCorsHeadersAllowedMethod string +type AccessApplicationNewResponseObjectCorsHeadersAllowedMethod string const ( - AccessAppNewResponseObjectCorsHeadersAllowedMethodGet AccessAppNewResponseObjectCorsHeadersAllowedMethod = "GET" - AccessAppNewResponseObjectCorsHeadersAllowedMethodPost AccessAppNewResponseObjectCorsHeadersAllowedMethod = "POST" - AccessAppNewResponseObjectCorsHeadersAllowedMethodHead AccessAppNewResponseObjectCorsHeadersAllowedMethod = "HEAD" - AccessAppNewResponseObjectCorsHeadersAllowedMethodPut AccessAppNewResponseObjectCorsHeadersAllowedMethod = "PUT" - AccessAppNewResponseObjectCorsHeadersAllowedMethodDelete AccessAppNewResponseObjectCorsHeadersAllowedMethod = "DELETE" - AccessAppNewResponseObjectCorsHeadersAllowedMethodConnect AccessAppNewResponseObjectCorsHeadersAllowedMethod = "CONNECT" - AccessAppNewResponseObjectCorsHeadersAllowedMethodOptions AccessAppNewResponseObjectCorsHeadersAllowedMethod = "OPTIONS" - AccessAppNewResponseObjectCorsHeadersAllowedMethodTrace AccessAppNewResponseObjectCorsHeadersAllowedMethod = "TRACE" - AccessAppNewResponseObjectCorsHeadersAllowedMethodPatch AccessAppNewResponseObjectCorsHeadersAllowedMethod = "PATCH" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodGet AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "GET" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodPost AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "POST" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodHead AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "HEAD" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodPut AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "PUT" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodDelete AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "DELETE" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodConnect AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "CONNECT" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodOptions AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodTrace AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "TRACE" + AccessApplicationNewResponseObjectCorsHeadersAllowedMethodPatch AccessApplicationNewResponseObjectCorsHeadersAllowedMethod = "PATCH" ) -// Union satisfied by [AccessAppUpdateResponseObject], -// [AccessAppUpdateResponseObject], [AccessAppUpdateResponseObject], -// [AccessAppUpdateResponseObject], [AccessAppUpdateResponseObject], -// [AccessAppUpdateResponseObject], [AccessAppUpdateResponseObject] or -// [AccessAppUpdateResponseObject]. -type AccessAppUpdateResponse interface { - implementsAccessAppUpdateResponse() +// Union satisfied by [AccessApplicationListResponseObject], +// [AccessApplicationListResponseObject], [AccessApplicationListResponseObject], +// [AccessApplicationListResponseObject], [AccessApplicationListResponseObject], +// [AccessApplicationListResponseObject], [AccessApplicationListResponseObject] or +// [AccessApplicationListResponseObject]. +type AccessApplicationListResponse interface { + implementsAccessApplicationListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppUpdateResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationListResponse)(nil)).Elem(), "") } -type AccessAppUpdateResponseObject struct { +type AccessApplicationListResponseObject struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain string `json:"domain,required"` @@ -314,9 +327,9 @@ type AccessAppUpdateResponseObject struct { Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CorsHeaders AccessAppUpdateResponseObjectCorsHeaders `json:"cors_headers"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CorsHeaders AccessApplicationListResponseObjectCorsHeaders `json:"cors_headers"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage string `json:"custom_deny_message"` @@ -356,14 +369,14 @@ type AccessAppUpdateResponseObject struct { SkipInterstitial bool `json:"skip_interstitial"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. - Tags []string `json:"tags"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppUpdateResponseObjectJSON `json:"-"` + Tags []string `json:"tags"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationListResponseObjectJSON `json:"-"` } -// accessAppUpdateResponseObjectJSON contains the JSON metadata for the struct -// [AccessAppUpdateResponseObject] -type accessAppUpdateResponseObjectJSON struct { +// accessApplicationListResponseObjectJSON contains the JSON metadata for the +// struct [AccessApplicationListResponseObject] +type accessApplicationListResponseObjectJSON struct { Domain apijson.Field Type apijson.Field ID apijson.Field @@ -394,13 +407,13 @@ type accessAppUpdateResponseObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppUpdateResponseObject) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationListResponseObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessAppUpdateResponseObject) implementsAccessAppUpdateResponse() {} +func (r AccessApplicationListResponseObject) implementsAccessApplicationListResponse() {} -type AccessAppUpdateResponseObjectCorsHeaders struct { +type AccessApplicationListResponseObjectCorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders bool `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -413,17 +426,17 @@ type AccessAppUpdateResponseObjectCorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders []interface{} `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods []AccessAppUpdateResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` + AllowedMethods []AccessApplicationListResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` // Allowed origins. AllowedOrigins []interface{} `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. - MaxAge float64 `json:"max_age"` - JSON accessAppUpdateResponseObjectCorsHeadersJSON `json:"-"` + MaxAge float64 `json:"max_age"` + JSON accessApplicationListResponseObjectCorsHeadersJSON `json:"-"` } -// accessAppUpdateResponseObjectCorsHeadersJSON contains the JSON metadata for the -// struct [AccessAppUpdateResponseObjectCorsHeaders] -type accessAppUpdateResponseObjectCorsHeadersJSON struct { +// accessApplicationListResponseObjectCorsHeadersJSON contains the JSON metadata +// for the struct [AccessApplicationListResponseObjectCorsHeaders] +type accessApplicationListResponseObjectCorsHeadersJSON struct { AllowAllHeaders apijson.Field AllowAllMethods apijson.Field AllowAllOrigins apijson.Field @@ -436,37 +449,56 @@ type accessAppUpdateResponseObjectCorsHeadersJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppUpdateResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationListResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppUpdateResponseObjectCorsHeadersAllowedMethod string +type AccessApplicationListResponseObjectCorsHeadersAllowedMethod string const ( - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodGet AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "GET" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodPost AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "POST" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodHead AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "HEAD" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodPut AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "PUT" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodDelete AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "DELETE" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodConnect AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "CONNECT" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodOptions AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "OPTIONS" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodTrace AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "TRACE" - AccessAppUpdateResponseObjectCorsHeadersAllowedMethodPatch AccessAppUpdateResponseObjectCorsHeadersAllowedMethod = "PATCH" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodGet AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "GET" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodPost AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "POST" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodHead AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "HEAD" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodPut AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "PUT" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodDelete AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "DELETE" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodConnect AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "CONNECT" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodOptions AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodTrace AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "TRACE" + AccessApplicationListResponseObjectCorsHeadersAllowedMethodPatch AccessApplicationListResponseObjectCorsHeadersAllowedMethod = "PATCH" ) -// Union satisfied by [AccessAppListResponseObject], [AccessAppListResponseObject], -// [AccessAppListResponseObject], [AccessAppListResponseObject], -// [AccessAppListResponseObject], [AccessAppListResponseObject], -// [AccessAppListResponseObject] or [AccessAppListResponseObject]. -type AccessAppListResponse interface { - implementsAccessAppListResponse() +type AccessApplicationDeleteResponse struct { + // UUID + ID string `json:"id"` + JSON accessApplicationDeleteResponseJSON `json:"-"` +} + +// accessApplicationDeleteResponseJSON contains the JSON metadata for the struct +// [AccessApplicationDeleteResponse] +type accessApplicationDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [AccessApplicationGetResponseObject], +// [AccessApplicationGetResponseObject], [AccessApplicationGetResponseObject], +// [AccessApplicationGetResponseObject], [AccessApplicationGetResponseObject], +// [AccessApplicationGetResponseObject], [AccessApplicationGetResponseObject] or +// [AccessApplicationGetResponseObject]. +type AccessApplicationGetResponse interface { + implementsAccessApplicationGetResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppListResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationGetResponse)(nil)).Elem(), "") } -type AccessAppListResponseObject struct { +type AccessApplicationGetResponseObject struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain string `json:"domain,required"` @@ -488,9 +520,9 @@ type AccessAppListResponseObject struct { Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CorsHeaders AccessAppListResponseObjectCorsHeaders `json:"cors_headers"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CorsHeaders AccessApplicationGetResponseObjectCorsHeaders `json:"cors_headers"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage string `json:"custom_deny_message"` @@ -530,14 +562,14 @@ type AccessAppListResponseObject struct { SkipInterstitial bool `json:"skip_interstitial"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. - Tags []string `json:"tags"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppListResponseObjectJSON `json:"-"` + Tags []string `json:"tags"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationGetResponseObjectJSON `json:"-"` } -// accessAppListResponseObjectJSON contains the JSON metadata for the struct -// [AccessAppListResponseObject] -type accessAppListResponseObjectJSON struct { +// accessApplicationGetResponseObjectJSON contains the JSON metadata for the struct +// [AccessApplicationGetResponseObject] +type accessApplicationGetResponseObjectJSON struct { Domain apijson.Field Type apijson.Field ID apijson.Field @@ -568,13 +600,13 @@ type accessAppListResponseObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppListResponseObject) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationGetResponseObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessAppListResponseObject) implementsAccessAppListResponse() {} +func (r AccessApplicationGetResponseObject) implementsAccessApplicationGetResponse() {} -type AccessAppListResponseObjectCorsHeaders struct { +type AccessApplicationGetResponseObjectCorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders bool `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -587,17 +619,17 @@ type AccessAppListResponseObjectCorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders []interface{} `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods []AccessAppListResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` + AllowedMethods []AccessApplicationGetResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` // Allowed origins. AllowedOrigins []interface{} `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. - MaxAge float64 `json:"max_age"` - JSON accessAppListResponseObjectCorsHeadersJSON `json:"-"` + MaxAge float64 `json:"max_age"` + JSON accessApplicationGetResponseObjectCorsHeadersJSON `json:"-"` } -// accessAppListResponseObjectCorsHeadersJSON contains the JSON metadata for the -// struct [AccessAppListResponseObjectCorsHeaders] -type accessAppListResponseObjectCorsHeadersJSON struct { +// accessApplicationGetResponseObjectCorsHeadersJSON contains the JSON metadata for +// the struct [AccessApplicationGetResponseObjectCorsHeaders] +type accessApplicationGetResponseObjectCorsHeadersJSON struct { AllowAllHeaders apijson.Field AllowAllMethods apijson.Field AllowAllOrigins apijson.Field @@ -610,55 +642,41 @@ type accessAppListResponseObjectCorsHeadersJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppListResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationGetResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppListResponseObjectCorsHeadersAllowedMethod string +type AccessApplicationGetResponseObjectCorsHeadersAllowedMethod string const ( - AccessAppListResponseObjectCorsHeadersAllowedMethodGet AccessAppListResponseObjectCorsHeadersAllowedMethod = "GET" - AccessAppListResponseObjectCorsHeadersAllowedMethodPost AccessAppListResponseObjectCorsHeadersAllowedMethod = "POST" - AccessAppListResponseObjectCorsHeadersAllowedMethodHead AccessAppListResponseObjectCorsHeadersAllowedMethod = "HEAD" - AccessAppListResponseObjectCorsHeadersAllowedMethodPut AccessAppListResponseObjectCorsHeadersAllowedMethod = "PUT" - AccessAppListResponseObjectCorsHeadersAllowedMethodDelete AccessAppListResponseObjectCorsHeadersAllowedMethod = "DELETE" - AccessAppListResponseObjectCorsHeadersAllowedMethodConnect AccessAppListResponseObjectCorsHeadersAllowedMethod = "CONNECT" - AccessAppListResponseObjectCorsHeadersAllowedMethodOptions AccessAppListResponseObjectCorsHeadersAllowedMethod = "OPTIONS" - AccessAppListResponseObjectCorsHeadersAllowedMethodTrace AccessAppListResponseObjectCorsHeadersAllowedMethod = "TRACE" - AccessAppListResponseObjectCorsHeadersAllowedMethodPatch AccessAppListResponseObjectCorsHeadersAllowedMethod = "PATCH" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodGet AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "GET" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodPost AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "POST" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodHead AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "HEAD" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodPut AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "PUT" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodDelete AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "DELETE" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodConnect AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "CONNECT" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodOptions AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodTrace AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "TRACE" + AccessApplicationGetResponseObjectCorsHeadersAllowedMethodPatch AccessApplicationGetResponseObjectCorsHeadersAllowedMethod = "PATCH" ) -type AccessAppDeleteResponse struct { - // UUID - ID string `json:"id"` - JSON accessAppDeleteResponseJSON `json:"-"` -} - -// accessAppDeleteResponseJSON contains the JSON metadata for the struct -// [AccessAppDeleteResponse] -type accessAppDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by [AccessAppGetResponseObject], [AccessAppGetResponseObject], -// [AccessAppGetResponseObject], [AccessAppGetResponseObject], -// [AccessAppGetResponseObject], [AccessAppGetResponseObject], -// [AccessAppGetResponseObject] or [AccessAppGetResponseObject]. -type AccessAppGetResponse interface { - implementsAccessAppGetResponse() +// Union satisfied by [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject], +// [AccessApplicationReplaceResponseObject] or +// [AccessApplicationReplaceResponseObject]. +type AccessApplicationReplaceResponse interface { + implementsAccessApplicationReplaceResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppGetResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationReplaceResponse)(nil)).Elem(), "") } -type AccessAppGetResponseObject struct { +type AccessApplicationReplaceResponseObject struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain string `json:"domain,required"` @@ -680,9 +698,9 @@ type AccessAppGetResponseObject struct { Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CorsHeaders AccessAppGetResponseObjectCorsHeaders `json:"cors_headers"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CorsHeaders AccessApplicationReplaceResponseObjectCorsHeaders `json:"cors_headers"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage string `json:"custom_deny_message"` @@ -722,14 +740,14 @@ type AccessAppGetResponseObject struct { SkipInterstitial bool `json:"skip_interstitial"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. - Tags []string `json:"tags"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppGetResponseObjectJSON `json:"-"` + Tags []string `json:"tags"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationReplaceResponseObjectJSON `json:"-"` } -// accessAppGetResponseObjectJSON contains the JSON metadata for the struct -// [AccessAppGetResponseObject] -type accessAppGetResponseObjectJSON struct { +// accessApplicationReplaceResponseObjectJSON contains the JSON metadata for the +// struct [AccessApplicationReplaceResponseObject] +type accessApplicationReplaceResponseObjectJSON struct { Domain apijson.Field Type apijson.Field ID apijson.Field @@ -760,13 +778,13 @@ type accessAppGetResponseObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppGetResponseObject) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationReplaceResponseObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessAppGetResponseObject) implementsAccessAppGetResponse() {} +func (r AccessApplicationReplaceResponseObject) implementsAccessApplicationReplaceResponse() {} -type AccessAppGetResponseObjectCorsHeaders struct { +type AccessApplicationReplaceResponseObjectCorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders bool `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -779,17 +797,17 @@ type AccessAppGetResponseObjectCorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders []interface{} `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods []AccessAppGetResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` + AllowedMethods []AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod `json:"allowed_methods"` // Allowed origins. AllowedOrigins []interface{} `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. - MaxAge float64 `json:"max_age"` - JSON accessAppGetResponseObjectCorsHeadersJSON `json:"-"` + MaxAge float64 `json:"max_age"` + JSON accessApplicationReplaceResponseObjectCorsHeadersJSON `json:"-"` } -// accessAppGetResponseObjectCorsHeadersJSON contains the JSON metadata for the -// struct [AccessAppGetResponseObjectCorsHeaders] -type accessAppGetResponseObjectCorsHeadersJSON struct { +// accessApplicationReplaceResponseObjectCorsHeadersJSON contains the JSON metadata +// for the struct [AccessApplicationReplaceResponseObjectCorsHeaders] +type accessApplicationReplaceResponseObjectCorsHeadersJSON struct { AllowAllHeaders apijson.Field AllowAllMethods apijson.Field AllowAllOrigins apijson.Field @@ -802,34 +820,36 @@ type accessAppGetResponseObjectCorsHeadersJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppGetResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationReplaceResponseObjectCorsHeaders) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppGetResponseObjectCorsHeadersAllowedMethod string +type AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod string const ( - AccessAppGetResponseObjectCorsHeadersAllowedMethodGet AccessAppGetResponseObjectCorsHeadersAllowedMethod = "GET" - AccessAppGetResponseObjectCorsHeadersAllowedMethodPost AccessAppGetResponseObjectCorsHeadersAllowedMethod = "POST" - AccessAppGetResponseObjectCorsHeadersAllowedMethodHead AccessAppGetResponseObjectCorsHeadersAllowedMethod = "HEAD" - AccessAppGetResponseObjectCorsHeadersAllowedMethodPut AccessAppGetResponseObjectCorsHeadersAllowedMethod = "PUT" - AccessAppGetResponseObjectCorsHeadersAllowedMethodDelete AccessAppGetResponseObjectCorsHeadersAllowedMethod = "DELETE" - AccessAppGetResponseObjectCorsHeadersAllowedMethodConnect AccessAppGetResponseObjectCorsHeadersAllowedMethod = "CONNECT" - AccessAppGetResponseObjectCorsHeadersAllowedMethodOptions AccessAppGetResponseObjectCorsHeadersAllowedMethod = "OPTIONS" - AccessAppGetResponseObjectCorsHeadersAllowedMethodTrace AccessAppGetResponseObjectCorsHeadersAllowedMethod = "TRACE" - AccessAppGetResponseObjectCorsHeadersAllowedMethodPatch AccessAppGetResponseObjectCorsHeadersAllowedMethod = "PATCH" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodGet AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "GET" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodPost AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "POST" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodHead AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "HEAD" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodPut AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "PUT" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodDelete AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "DELETE" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodConnect AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "CONNECT" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodOptions AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodTrace AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "TRACE" + AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethodPatch AccessApplicationReplaceResponseObjectCorsHeadersAllowedMethod = "PATCH" ) +type AccessApplicationRevokeTokensResponse = interface{} + // This interface is a union satisfied by one of the following: -// [AccessAppNewParamsVariant0], [AccessAppNewParamsVariant1], -// [AccessAppNewParamsVariant2], [AccessAppNewParamsVariant3], -// [AccessAppNewParamsVariant4], [AccessAppNewParamsVariant5], -// [AccessAppNewParamsVariant6], [AccessAppNewParamsVariant7]. -type AccessAppNewParams interface { - ImplementsAccessAppNewParams() +// [AccessApplicationNewParamsVariant0], [AccessApplicationNewParamsVariant1], +// [AccessApplicationNewParamsVariant2], [AccessApplicationNewParamsVariant3], +// [AccessApplicationNewParamsVariant4], [AccessApplicationNewParamsVariant5], +// [AccessApplicationNewParamsVariant6], [AccessApplicationNewParamsVariant7]. +type AccessApplicationNewParams interface { + ImplementsAccessApplicationNewParams() } -type AccessAppNewParamsVariant0 struct { +type AccessApplicationNewParamsVariant0 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -847,8 +867,8 @@ type AccessAppNewParamsVariant0 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppNewParamsVariant0CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationNewParamsVariant0CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -891,15 +911,15 @@ type AccessAppNewParamsVariant0 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppNewParamsVariant0) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant0) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant0) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant0) ImplementsAccessApplicationNewParams() { } -type AccessAppNewParamsVariant0CorsHeaders struct { +type AccessApplicationNewParamsVariant0CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -912,32 +932,32 @@ type AccessAppNewParamsVariant0CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppNewParamsVariant0CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppNewParamsVariant0CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant0CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppNewParamsVariant0CorsHeadersAllowedMethod string +type AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod string const ( - AccessAppNewParamsVariant0CorsHeadersAllowedMethodGet AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "GET" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodPost AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "POST" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodHead AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "HEAD" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodPut AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "PUT" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodDelete AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "DELETE" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodConnect AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "CONNECT" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodOptions AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "OPTIONS" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodTrace AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "TRACE" - AccessAppNewParamsVariant0CorsHeadersAllowedMethodPatch AccessAppNewParamsVariant0CorsHeadersAllowedMethod = "PATCH" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodGet AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "GET" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodPost AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "POST" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodHead AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "HEAD" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodPut AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "PUT" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodDelete AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "DELETE" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodConnect AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodOptions AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodTrace AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "TRACE" + AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodPatch AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppNewParamsVariant1 struct { +type AccessApplicationNewParamsVariant1 struct { // 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"` @@ -951,8 +971,8 @@ type AccessAppNewParamsVariant1 struct { // The image URL for the logo shown in the App Launcher dashboard. LogoURL param.Field[string] `json:"logo_url"` // The name of the application. - Name param.Field[string] `json:"name"` - SaasApp param.Field[AccessAppNewParamsVariant1SaasApp] `json:"saas_app"` + Name param.Field[string] `json:"name"` + SaasApp param.Field[AccessApplicationNewParamsVariant1SaasApp] `json:"saas_app"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. Tags param.Field[[]string] `json:"tags"` @@ -960,35 +980,35 @@ type AccessAppNewParamsVariant1 struct { Type param.Field[string] `json:"type"` } -func (r AccessAppNewParamsVariant1) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant1) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant1) ImplementsAccessApplicationNewParams() { } -// Satisfied by [AccessAppNewParamsVariant1SaasAppAccessSamlSaasApp], -// [AccessAppNewParamsVariant1SaasAppAccessOidcSaasApp]. -type AccessAppNewParamsVariant1SaasApp interface { - implementsAccessAppNewParamsVariant1SaasApp() +// Satisfied by [AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasApp], +// [AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasApp]. +type AccessApplicationNewParamsVariant1SaasApp interface { + implementsAccessApplicationNewParamsVariant1SaasApp() } -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasApp struct { +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasApp struct { // Optional identifier indicating the authentication protocol used for the saas // app. Required for OIDC. Default if unset is "saml" - AuthType param.Field[AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthType] `json:"auth_type"` + AuthType param.Field[AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthType] `json:"auth_type"` // The service provider's endpoint that is responsible for receiving and parsing a // SAML assertion. - ConsumerServiceURL param.Field[string] `json:"consumer_service_url"` - CustomAttributes param.Field[AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes] `json:"custom_attributes"` + ConsumerServiceURL param.Field[string] `json:"consumer_service_url"` + CustomAttributes param.Field[AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes] `json:"custom_attributes"` // The URL that the user will be redirected to after a successful login for IDP // 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"` // The format of the name identifier sent to the SaaS application. - NameIDFormat param.Field[AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` + NameIDFormat param.Field[AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` // A [JSONata](https://jsonata.org/) expression that transforms an application's // user identities into a NameID value for its SAML assertion. This expression // should evaluate to a singular string. The output of this expression can override @@ -1002,72 +1022,72 @@ type AccessAppNewParamsVariant1SaasAppAccessSamlSaasApp struct { SSOEndpoint param.Field[string] `json:"sso_endpoint"` } -func (r AccessAppNewParamsVariant1SaasAppAccessSamlSaasApp) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessAppNewParamsVariant1SaasAppAccessSamlSaasApp) implementsAccessAppNewParamsVariant1SaasApp() { +func (r AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasApp) implementsAccessApplicationNewParamsVariant1SaasApp() { } // Optional identifier indicating the authentication protocol used for the saas // app. Required for OIDC. Default if unset is "saml" -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthType string +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthType string const ( - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthTypeSaml AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthType = "saml" - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthTypeOidc AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppAuthType = "oidc" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthTypeSaml AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthType = "saml" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthTypeOidc AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppAuthType = "oidc" ) -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes struct { +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes struct { // The name of the attribute. Name param.Field[string] `json:"name"` // A globally unique name for an identity or service provider. - NameFormat param.Field[AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat] `json:"name_format"` - Source param.Field[AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource] `json:"source"` + NameFormat param.Field[AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat] `json:"name_format"` + Source param.Field[AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource] `json:"source"` } -func (r AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A globally unique name for an identity or service provider. -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat string +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat string const ( - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUnspecified AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatBasic AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic" - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUri AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUnspecified AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatBasic AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUri AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" ) -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource struct { +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource struct { // The name of the IdP attribute. Name param.Field[string] `json:"name"` } -func (r AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The format of the name identifier sent to the SaaS application. -type AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat string +type AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat string const ( - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatID AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "id" - AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatEmail AccessAppNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "email" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatID AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "id" + AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatEmail AccessApplicationNewParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "email" ) -type AccessAppNewParamsVariant1SaasAppAccessOidcSaasApp struct { +type AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasApp struct { // The URL where this applications tile redirects users AppLauncherURL param.Field[string] `json:"app_launcher_url"` // Identifier of the authentication protocol used for the saas app. Required for // OIDC. - AuthType param.Field[AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthType] `json:"auth_type"` + AuthType param.Field[AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthType] `json:"auth_type"` // The application client id ClientID param.Field[string] `json:"client_id"` // The application client secret, only returned on POST request. ClientSecret param.Field[string] `json:"client_secret"` // The OIDC flows supported by this application - GrantTypes param.Field[[]AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantType] `json:"grant_types"` + GrantTypes param.Field[[]AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantType] `json:"grant_types"` // A regex to filter Cloudflare groups returned in ID token and userinfo endpoint GroupFilterRegex param.Field[string] `json:"group_filter_regex"` // The Access public certificate that will be used to verify your identity. @@ -1076,42 +1096,42 @@ type AccessAppNewParamsVariant1SaasAppAccessOidcSaasApp struct { // tokens RedirectUris param.Field[[]string] `json:"redirect_uris"` // Define the user information shared with access - Scopes param.Field[[]AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope] `json:"scopes"` + Scopes param.Field[[]AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope] `json:"scopes"` } -func (r AccessAppNewParamsVariant1SaasAppAccessOidcSaasApp) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessAppNewParamsVariant1SaasAppAccessOidcSaasApp) implementsAccessAppNewParamsVariant1SaasApp() { +func (r AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasApp) implementsAccessApplicationNewParamsVariant1SaasApp() { } // Identifier of the authentication protocol used for the saas app. Required for // OIDC. -type AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthType string +type AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthType string const ( - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthTypeSaml AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthType = "saml" - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthTypeOidc AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppAuthType = "oidc" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthTypeSaml AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthType = "saml" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthTypeOidc AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppAuthType = "oidc" ) -type AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantType string +type AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantType string const ( - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCode AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code" - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCodeWithPkce AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code_with_pkce" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCode AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCodeWithPkce AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code_with_pkce" ) -type AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope string +type AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope string const ( - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScopeOpenid AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope = "openid" - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScopeGroups AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope = "groups" - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScopeEmail AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope = "email" - AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScopeProfile AccessAppNewParamsVariant1SaasAppAccessOidcSaasAppScope = "profile" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScopeOpenid AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope = "openid" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScopeGroups AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope = "groups" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScopeEmail AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope = "email" + AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScopeProfile AccessApplicationNewParamsVariant1SaasAppAccessOidcSaasAppScope = "profile" ) -type AccessAppNewParamsVariant2 struct { +type AccessApplicationNewParamsVariant2 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -1129,8 +1149,8 @@ type AccessAppNewParamsVariant2 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppNewParamsVariant2CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationNewParamsVariant2CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -1173,15 +1193,15 @@ type AccessAppNewParamsVariant2 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppNewParamsVariant2) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant2) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant2) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant2) ImplementsAccessApplicationNewParams() { } -type AccessAppNewParamsVariant2CorsHeaders struct { +type AccessApplicationNewParamsVariant2CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -1194,32 +1214,32 @@ type AccessAppNewParamsVariant2CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppNewParamsVariant2CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppNewParamsVariant2CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant2CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppNewParamsVariant2CorsHeadersAllowedMethod string +type AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod string const ( - AccessAppNewParamsVariant2CorsHeadersAllowedMethodGet AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "GET" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodPost AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "POST" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodHead AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "HEAD" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodPut AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "PUT" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodDelete AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "DELETE" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodConnect AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "CONNECT" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodOptions AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "OPTIONS" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodTrace AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "TRACE" - AccessAppNewParamsVariant2CorsHeadersAllowedMethodPatch AccessAppNewParamsVariant2CorsHeadersAllowedMethod = "PATCH" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodGet AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "GET" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodPost AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "POST" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodHead AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "HEAD" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodPut AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "PUT" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodDelete AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "DELETE" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodConnect AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodOptions AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodTrace AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "TRACE" + AccessApplicationNewParamsVariant2CorsHeadersAllowedMethodPatch AccessApplicationNewParamsVariant2CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppNewParamsVariant3 struct { +type AccessApplicationNewParamsVariant3 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -1237,8 +1257,8 @@ type AccessAppNewParamsVariant3 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppNewParamsVariant3CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationNewParamsVariant3CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -1281,15 +1301,15 @@ type AccessAppNewParamsVariant3 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppNewParamsVariant3) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant3) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant3) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant3) ImplementsAccessApplicationNewParams() { } -type AccessAppNewParamsVariant3CorsHeaders struct { +type AccessApplicationNewParamsVariant3CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -1302,34 +1322,34 @@ type AccessAppNewParamsVariant3CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppNewParamsVariant3CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppNewParamsVariant3CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant3CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppNewParamsVariant3CorsHeadersAllowedMethod string +type AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod string const ( - AccessAppNewParamsVariant3CorsHeadersAllowedMethodGet AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "GET" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodPost AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "POST" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodHead AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "HEAD" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodPut AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "PUT" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodDelete AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "DELETE" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodConnect AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "CONNECT" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodOptions AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "OPTIONS" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodTrace AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "TRACE" - AccessAppNewParamsVariant3CorsHeadersAllowedMethodPatch AccessAppNewParamsVariant3CorsHeadersAllowedMethod = "PATCH" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodGet AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "GET" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodPost AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "POST" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodHead AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "HEAD" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodPut AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "PUT" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodDelete AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "DELETE" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodConnect AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodOptions AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodTrace AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "TRACE" + AccessApplicationNewParamsVariant3CorsHeadersAllowedMethodPatch AccessApplicationNewParamsVariant3CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppNewParamsVariant4 struct { +type AccessApplicationNewParamsVariant4 struct { // The application type. - Type param.Field[AccessAppNewParamsVariant4Type] `json:"type,required"` + Type param.Field[AccessApplicationNewParamsVariant4Type] `json:"type,required"` // 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"` @@ -1342,32 +1362,32 @@ type AccessAppNewParamsVariant4 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppNewParamsVariant4) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant4) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant4) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant4) ImplementsAccessApplicationNewParams() { } // The application type. -type AccessAppNewParamsVariant4Type string +type AccessApplicationNewParamsVariant4Type string const ( - AccessAppNewParamsVariant4TypeSelfHosted AccessAppNewParamsVariant4Type = "self_hosted" - AccessAppNewParamsVariant4TypeSaas AccessAppNewParamsVariant4Type = "saas" - AccessAppNewParamsVariant4TypeSSH AccessAppNewParamsVariant4Type = "ssh" - AccessAppNewParamsVariant4TypeVnc AccessAppNewParamsVariant4Type = "vnc" - AccessAppNewParamsVariant4TypeAppLauncher AccessAppNewParamsVariant4Type = "app_launcher" - AccessAppNewParamsVariant4TypeWarp AccessAppNewParamsVariant4Type = "warp" - AccessAppNewParamsVariant4TypeBiso AccessAppNewParamsVariant4Type = "biso" - AccessAppNewParamsVariant4TypeBookmark AccessAppNewParamsVariant4Type = "bookmark" - AccessAppNewParamsVariant4TypeDashSSO AccessAppNewParamsVariant4Type = "dash_sso" + AccessApplicationNewParamsVariant4TypeSelfHosted AccessApplicationNewParamsVariant4Type = "self_hosted" + AccessApplicationNewParamsVariant4TypeSaas AccessApplicationNewParamsVariant4Type = "saas" + AccessApplicationNewParamsVariant4TypeSSH AccessApplicationNewParamsVariant4Type = "ssh" + AccessApplicationNewParamsVariant4TypeVnc AccessApplicationNewParamsVariant4Type = "vnc" + AccessApplicationNewParamsVariant4TypeAppLauncher AccessApplicationNewParamsVariant4Type = "app_launcher" + AccessApplicationNewParamsVariant4TypeWarp AccessApplicationNewParamsVariant4Type = "warp" + AccessApplicationNewParamsVariant4TypeBiso AccessApplicationNewParamsVariant4Type = "biso" + AccessApplicationNewParamsVariant4TypeBookmark AccessApplicationNewParamsVariant4Type = "bookmark" + AccessApplicationNewParamsVariant4TypeDashSSO AccessApplicationNewParamsVariant4Type = "dash_sso" ) -type AccessAppNewParamsVariant5 struct { +type AccessApplicationNewParamsVariant5 struct { // The application type. - Type param.Field[AccessAppNewParamsVariant5Type] `json:"type,required"` + Type param.Field[AccessApplicationNewParamsVariant5Type] `json:"type,required"` // 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"` @@ -1380,32 +1400,32 @@ type AccessAppNewParamsVariant5 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppNewParamsVariant5) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant5) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant5) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant5) ImplementsAccessApplicationNewParams() { } // The application type. -type AccessAppNewParamsVariant5Type string +type AccessApplicationNewParamsVariant5Type string const ( - AccessAppNewParamsVariant5TypeSelfHosted AccessAppNewParamsVariant5Type = "self_hosted" - AccessAppNewParamsVariant5TypeSaas AccessAppNewParamsVariant5Type = "saas" - AccessAppNewParamsVariant5TypeSSH AccessAppNewParamsVariant5Type = "ssh" - AccessAppNewParamsVariant5TypeVnc AccessAppNewParamsVariant5Type = "vnc" - AccessAppNewParamsVariant5TypeAppLauncher AccessAppNewParamsVariant5Type = "app_launcher" - AccessAppNewParamsVariant5TypeWarp AccessAppNewParamsVariant5Type = "warp" - AccessAppNewParamsVariant5TypeBiso AccessAppNewParamsVariant5Type = "biso" - AccessAppNewParamsVariant5TypeBookmark AccessAppNewParamsVariant5Type = "bookmark" - AccessAppNewParamsVariant5TypeDashSSO AccessAppNewParamsVariant5Type = "dash_sso" + AccessApplicationNewParamsVariant5TypeSelfHosted AccessApplicationNewParamsVariant5Type = "self_hosted" + AccessApplicationNewParamsVariant5TypeSaas AccessApplicationNewParamsVariant5Type = "saas" + AccessApplicationNewParamsVariant5TypeSSH AccessApplicationNewParamsVariant5Type = "ssh" + AccessApplicationNewParamsVariant5TypeVnc AccessApplicationNewParamsVariant5Type = "vnc" + AccessApplicationNewParamsVariant5TypeAppLauncher AccessApplicationNewParamsVariant5Type = "app_launcher" + AccessApplicationNewParamsVariant5TypeWarp AccessApplicationNewParamsVariant5Type = "warp" + AccessApplicationNewParamsVariant5TypeBiso AccessApplicationNewParamsVariant5Type = "biso" + AccessApplicationNewParamsVariant5TypeBookmark AccessApplicationNewParamsVariant5Type = "bookmark" + AccessApplicationNewParamsVariant5TypeDashSSO AccessApplicationNewParamsVariant5Type = "dash_sso" ) -type AccessAppNewParamsVariant6 struct { +type AccessApplicationNewParamsVariant6 struct { // The application type. - Type param.Field[AccessAppNewParamsVariant6Type] `json:"type,required"` + Type param.Field[AccessApplicationNewParamsVariant6Type] `json:"type,required"` // 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"` @@ -1418,30 +1438,30 @@ type AccessAppNewParamsVariant6 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppNewParamsVariant6) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant6) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant6) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant6) ImplementsAccessApplicationNewParams() { } // The application type. -type AccessAppNewParamsVariant6Type string +type AccessApplicationNewParamsVariant6Type string const ( - AccessAppNewParamsVariant6TypeSelfHosted AccessAppNewParamsVariant6Type = "self_hosted" - AccessAppNewParamsVariant6TypeSaas AccessAppNewParamsVariant6Type = "saas" - AccessAppNewParamsVariant6TypeSSH AccessAppNewParamsVariant6Type = "ssh" - AccessAppNewParamsVariant6TypeVnc AccessAppNewParamsVariant6Type = "vnc" - AccessAppNewParamsVariant6TypeAppLauncher AccessAppNewParamsVariant6Type = "app_launcher" - AccessAppNewParamsVariant6TypeWarp AccessAppNewParamsVariant6Type = "warp" - AccessAppNewParamsVariant6TypeBiso AccessAppNewParamsVariant6Type = "biso" - AccessAppNewParamsVariant6TypeBookmark AccessAppNewParamsVariant6Type = "bookmark" - AccessAppNewParamsVariant6TypeDashSSO AccessAppNewParamsVariant6Type = "dash_sso" + AccessApplicationNewParamsVariant6TypeSelfHosted AccessApplicationNewParamsVariant6Type = "self_hosted" + AccessApplicationNewParamsVariant6TypeSaas AccessApplicationNewParamsVariant6Type = "saas" + AccessApplicationNewParamsVariant6TypeSSH AccessApplicationNewParamsVariant6Type = "ssh" + AccessApplicationNewParamsVariant6TypeVnc AccessApplicationNewParamsVariant6Type = "vnc" + AccessApplicationNewParamsVariant6TypeAppLauncher AccessApplicationNewParamsVariant6Type = "app_launcher" + AccessApplicationNewParamsVariant6TypeWarp AccessApplicationNewParamsVariant6Type = "warp" + AccessApplicationNewParamsVariant6TypeBiso AccessApplicationNewParamsVariant6Type = "biso" + AccessApplicationNewParamsVariant6TypeBookmark AccessApplicationNewParamsVariant6Type = "bookmark" + AccessApplicationNewParamsVariant6TypeDashSSO AccessApplicationNewParamsVariant6Type = "dash_sso" ) -type AccessAppNewParamsVariant7 struct { +type AccessApplicationNewParamsVariant7 struct { AppLauncherVisible param.Field[interface{}] `json:"app_launcher_visible"` // The URL or domain of the bookmark. Domain param.Field[interface{}] `json:"domain"` @@ -1456,26 +1476,26 @@ type AccessAppNewParamsVariant7 struct { Type param.Field[string] `json:"type"` } -func (r AccessAppNewParamsVariant7) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationNewParamsVariant7) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppNewParamsVariant7) ImplementsAccessAppNewParams() { +func (AccessApplicationNewParamsVariant7) ImplementsAccessApplicationNewParams() { } -type AccessAppNewResponseEnvelope struct { - Errors []AccessAppNewResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppNewResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppNewResponse `json:"result,required"` +type AccessApplicationNewResponseEnvelope struct { + Errors []AccessApplicationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationNewResponse `json:"result,required"` // Whether the API call was successful - Success AccessAppNewResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppNewResponseEnvelopeJSON `json:"-"` + Success AccessApplicationNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationNewResponseEnvelopeJSON `json:"-"` } -// accessAppNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppNewResponseEnvelope] -type accessAppNewResponseEnvelopeJSON struct { +// accessApplicationNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationNewResponseEnvelope] +type accessApplicationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1484,65 +1504,319 @@ type accessAppNewResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppNewResponseEnvelopeErrorsJSON `json:"-"` +type AccessApplicationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationNewResponseEnvelopeErrorsJSON `json:"-"` } -// accessAppNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [AccessAppNewResponseEnvelopeErrors] -type accessAppNewResponseEnvelopeErrorsJSON struct { +// accessApplicationNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationNewResponseEnvelopeErrors] +type accessApplicationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessAppNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppNewResponseEnvelopeMessagesJSON `json:"-"` +type AccessApplicationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationNewResponseEnvelopeMessagesJSON `json:"-"` } -// accessAppNewResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppNewResponseEnvelopeMessages] -type accessAppNewResponseEnvelopeMessagesJSON struct { +// accessApplicationNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessApplicationNewResponseEnvelopeMessages] +type accessApplicationNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessAppNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessAppNewResponseEnvelopeSuccess bool +type AccessApplicationNewResponseEnvelopeSuccess bool const ( - AccessAppNewResponseEnvelopeSuccessTrue AccessAppNewResponseEnvelopeSuccess = true + AccessApplicationNewResponseEnvelopeSuccessTrue AccessApplicationNewResponseEnvelopeSuccess = true ) -// This interface is a union satisfied by one of the following: -// [AccessAppUpdateParamsVariant0], [AccessAppUpdateParamsVariant1], -// [AccessAppUpdateParamsVariant2], [AccessAppUpdateParamsVariant3], -// [AccessAppUpdateParamsVariant4], [AccessAppUpdateParamsVariant5], -// [AccessAppUpdateParamsVariant6], [AccessAppUpdateParamsVariant7]. -type AccessAppUpdateParams interface { - ImplementsAccessAppUpdateParams() +type AccessApplicationListResponseEnvelope struct { + Errors []AccessApplicationListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessApplicationListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AccessApplicationListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessApplicationListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessApplicationListResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationListResponseEnvelope] +type accessApplicationListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationListResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationListResponseEnvelopeErrors] +type accessApplicationListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationListResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessApplicationListResponseEnvelopeMessages] +type accessApplicationListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccessAppUpdateParamsVariant0 struct { +// Whether the API call was successful +type AccessApplicationListResponseEnvelopeSuccess bool + +const ( + AccessApplicationListResponseEnvelopeSuccessTrue AccessApplicationListResponseEnvelopeSuccess = true +) + +type AccessApplicationListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessApplicationListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessApplicationListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AccessApplicationListResponseEnvelopeResultInfo] +type accessApplicationListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Identifier +// +// Satisfied by [shared.UnionString], [shared.UnionString]. +type AccessApplicationDeleteParamsAppID interface { + ImplementsAccessApplicationDeleteParamsAppID() +} + +type AccessApplicationDeleteResponseEnvelope struct { + Errors []AccessApplicationDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationDeleteResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationDeleteResponseEnvelope] +type accessApplicationDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationDeleteResponseEnvelopeErrors] +type accessApplicationDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationDeleteResponseEnvelopeMessages] +type accessApplicationDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationDeleteResponseEnvelopeSuccess bool + +const ( + AccessApplicationDeleteResponseEnvelopeSuccessTrue AccessApplicationDeleteResponseEnvelopeSuccess = true +) + +// Identifier +// +// Satisfied by [shared.UnionString], [shared.UnionString]. +type AccessApplicationGetParamsAppID interface { + ImplementsAccessApplicationGetParamsAppID() +} + +type AccessApplicationGetResponseEnvelope struct { + Errors []AccessApplicationGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationGetResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationGetResponseEnvelope] +type accessApplicationGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationGetResponseEnvelopeErrors] +type accessApplicationGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessApplicationGetResponseEnvelopeMessages] +type accessApplicationGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationGetResponseEnvelopeSuccess bool + +const ( + AccessApplicationGetResponseEnvelopeSuccessTrue AccessApplicationGetResponseEnvelopeSuccess = true +) + +// This interface is a union satisfied by one of the following: +// [AccessApplicationReplaceParamsVariant0], +// [AccessApplicationReplaceParamsVariant1], +// [AccessApplicationReplaceParamsVariant2], +// [AccessApplicationReplaceParamsVariant3], +// [AccessApplicationReplaceParamsVariant4], +// [AccessApplicationReplaceParamsVariant5], +// [AccessApplicationReplaceParamsVariant6], +// [AccessApplicationReplaceParamsVariant7]. +type AccessApplicationReplaceParams interface { + ImplementsAccessApplicationReplaceParams() +} + +type AccessApplicationReplaceParamsVariant0 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -1560,8 +1834,8 @@ type AccessAppUpdateParamsVariant0 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppUpdateParamsVariant0CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationReplaceParamsVariant0CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -1604,22 +1878,22 @@ type AccessAppUpdateParamsVariant0 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppUpdateParamsVariant0) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant0) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant0) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant0) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant0AppID interface { - ImplementsAccessAppUpdateParamsVariant0AppID() +type AccessApplicationReplaceParamsVariant0AppID interface { + ImplementsAccessApplicationReplaceParamsVariant0AppID() } -type AccessAppUpdateParamsVariant0CorsHeaders struct { +type AccessApplicationReplaceParamsVariant0CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -1632,32 +1906,32 @@ type AccessAppUpdateParamsVariant0CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppUpdateParamsVariant0CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant0CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod string +type AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod string const ( - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodGet AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "GET" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodPost AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "POST" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodHead AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "HEAD" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodPut AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "PUT" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodDelete AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "DELETE" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodConnect AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "CONNECT" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodOptions AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "OPTIONS" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodTrace AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "TRACE" - AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodPatch AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod = "PATCH" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodGet AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "GET" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodPost AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "POST" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodHead AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "HEAD" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodPut AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "PUT" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodDelete AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "DELETE" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodConnect AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodOptions AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodTrace AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "TRACE" + AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodPatch AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppUpdateParamsVariant1 struct { +type AccessApplicationReplaceParamsVariant1 struct { // 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"` @@ -1671,8 +1945,8 @@ type AccessAppUpdateParamsVariant1 struct { // The image URL for the logo shown in the App Launcher dashboard. LogoURL param.Field[string] `json:"logo_url"` // The name of the application. - Name param.Field[string] `json:"name"` - SaasApp param.Field[AccessAppUpdateParamsVariant1SaasApp] `json:"saas_app"` + Name param.Field[string] `json:"name"` + SaasApp param.Field[AccessApplicationReplaceParamsVariant1SaasApp] `json:"saas_app"` // The tags you want assigned to an application. Tags are used to filter // applications in the App Launcher dashboard. Tags param.Field[[]string] `json:"tags"` @@ -1680,42 +1954,42 @@ type AccessAppUpdateParamsVariant1 struct { Type param.Field[string] `json:"type"` } -func (r AccessAppUpdateParamsVariant1) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant1) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant1) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant1AppID interface { - ImplementsAccessAppUpdateParamsVariant1AppID() +type AccessApplicationReplaceParamsVariant1AppID interface { + ImplementsAccessApplicationReplaceParamsVariant1AppID() } -// Satisfied by [AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasApp], -// [AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasApp]. -type AccessAppUpdateParamsVariant1SaasApp interface { - implementsAccessAppUpdateParamsVariant1SaasApp() +// Satisfied by [AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasApp], +// [AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasApp]. +type AccessApplicationReplaceParamsVariant1SaasApp interface { + implementsAccessApplicationReplaceParamsVariant1SaasApp() } -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasApp struct { +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasApp struct { // Optional identifier indicating the authentication protocol used for the saas // app. Required for OIDC. Default if unset is "saml" - AuthType param.Field[AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthType] `json:"auth_type"` + AuthType param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthType] `json:"auth_type"` // The service provider's endpoint that is responsible for receiving and parsing a // SAML assertion. - ConsumerServiceURL param.Field[string] `json:"consumer_service_url"` - CustomAttributes param.Field[AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes] `json:"custom_attributes"` + ConsumerServiceURL param.Field[string] `json:"consumer_service_url"` + CustomAttributes param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes] `json:"custom_attributes"` // The URL that the user will be redirected to after a successful login for IDP // 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"` // The format of the name identifier sent to the SaaS application. - NameIDFormat param.Field[AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` + NameIDFormat param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` // A [JSONata](https://jsonata.org/) expression that transforms an application's // user identities into a NameID value for its SAML assertion. This expression // should evaluate to a singular string. The output of this expression can override @@ -1729,72 +2003,72 @@ type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasApp struct { SSOEndpoint param.Field[string] `json:"sso_endpoint"` } -func (r AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasApp) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasApp) implementsAccessAppUpdateParamsVariant1SaasApp() { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasApp) implementsAccessApplicationReplaceParamsVariant1SaasApp() { } // Optional identifier indicating the authentication protocol used for the saas // app. Required for OIDC. Default if unset is "saml" -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthType string +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthType string const ( - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthTypeSaml AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthType = "saml" - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthTypeOidc AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppAuthType = "oidc" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthTypeSaml AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthType = "saml" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthTypeOidc AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppAuthType = "oidc" ) -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes struct { +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes struct { // The name of the attribute. Name param.Field[string] `json:"name"` // A globally unique name for an identity or service provider. - NameFormat param.Field[AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat] `json:"name_format"` - Source param.Field[AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource] `json:"source"` + NameFormat param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat] `json:"name_format"` + Source param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource] `json:"source"` } -func (r AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributes) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A globally unique name for an identity or service provider. -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat string +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat string const ( - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUnspecified AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatBasic AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic" - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUri AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUnspecified AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatBasic AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:basic" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormatUrnOasisNamesTcSaml2_0AttrnameFormatUri AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesNameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:uri" ) -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource struct { +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource struct { // The name of the IdP attribute. Name param.Field[string] `json:"name"` } -func (r AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppCustomAttributesSource) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The format of the name identifier sent to the SaaS application. -type AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat string +type AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat string const ( - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatID AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "id" - AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatEmail AccessAppUpdateParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "email" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatID AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "id" + AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormatEmail AccessApplicationReplaceParamsVariant1SaasAppAccessSamlSaasAppNameIDFormat = "email" ) -type AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasApp struct { +type AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasApp struct { // The URL where this applications tile redirects users AppLauncherURL param.Field[string] `json:"app_launcher_url"` // Identifier of the authentication protocol used for the saas app. Required for // OIDC. - AuthType param.Field[AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthType] `json:"auth_type"` + AuthType param.Field[AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthType] `json:"auth_type"` // The application client id ClientID param.Field[string] `json:"client_id"` // The application client secret, only returned on POST request. ClientSecret param.Field[string] `json:"client_secret"` // The OIDC flows supported by this application - GrantTypes param.Field[[]AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantType] `json:"grant_types"` + GrantTypes param.Field[[]AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantType] `json:"grant_types"` // A regex to filter Cloudflare groups returned in ID token and userinfo endpoint GroupFilterRegex param.Field[string] `json:"group_filter_regex"` // The Access public certificate that will be used to verify your identity. @@ -1803,42 +2077,42 @@ type AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasApp struct { // tokens RedirectUris param.Field[[]string] `json:"redirect_uris"` // Define the user information shared with access - Scopes param.Field[[]AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope] `json:"scopes"` + Scopes param.Field[[]AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope] `json:"scopes"` } -func (r AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasApp) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasApp) implementsAccessAppUpdateParamsVariant1SaasApp() { +func (r AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasApp) implementsAccessApplicationReplaceParamsVariant1SaasApp() { } // Identifier of the authentication protocol used for the saas app. Required for // OIDC. -type AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthType string +type AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthType string const ( - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthTypeSaml AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthType = "saml" - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthTypeOidc AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppAuthType = "oidc" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthTypeSaml AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthType = "saml" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthTypeOidc AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppAuthType = "oidc" ) -type AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantType string +type AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantType string const ( - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCode AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code" - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCodeWithPkce AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code_with_pkce" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCode AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantTypeAuthorizationCodeWithPkce AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppGrantType = "authorization_code_with_pkce" ) -type AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope string +type AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope string const ( - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScopeOpenid AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope = "openid" - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScopeGroups AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope = "groups" - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScopeEmail AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope = "email" - AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScopeProfile AccessAppUpdateParamsVariant1SaasAppAccessOidcSaasAppScope = "profile" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScopeOpenid AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope = "openid" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScopeGroups AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope = "groups" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScopeEmail AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope = "email" + AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScopeProfile AccessApplicationReplaceParamsVariant1SaasAppAccessOidcSaasAppScope = "profile" ) -type AccessAppUpdateParamsVariant2 struct { +type AccessApplicationReplaceParamsVariant2 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -1856,8 +2130,8 @@ type AccessAppUpdateParamsVariant2 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppUpdateParamsVariant2CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationReplaceParamsVariant2CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -1900,22 +2174,22 @@ type AccessAppUpdateParamsVariant2 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppUpdateParamsVariant2) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant2) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant2) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant2) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant2AppID interface { - ImplementsAccessAppUpdateParamsVariant2AppID() +type AccessApplicationReplaceParamsVariant2AppID interface { + ImplementsAccessApplicationReplaceParamsVariant2AppID() } -type AccessAppUpdateParamsVariant2CorsHeaders struct { +type AccessApplicationReplaceParamsVariant2CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -1928,32 +2202,32 @@ type AccessAppUpdateParamsVariant2CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppUpdateParamsVariant2CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant2CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod string +type AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod string const ( - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodGet AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "GET" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodPost AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "POST" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodHead AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "HEAD" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodPut AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "PUT" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodDelete AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "DELETE" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodConnect AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "CONNECT" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodOptions AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "OPTIONS" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodTrace AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "TRACE" - AccessAppUpdateParamsVariant2CorsHeadersAllowedMethodPatch AccessAppUpdateParamsVariant2CorsHeadersAllowedMethod = "PATCH" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodGet AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "GET" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodPost AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "POST" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodHead AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "HEAD" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodPut AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "PUT" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodDelete AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "DELETE" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodConnect AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodOptions AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodTrace AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "TRACE" + AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethodPatch AccessApplicationReplaceParamsVariant2CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppUpdateParamsVariant3 struct { +type AccessApplicationReplaceParamsVariant3 struct { // The primary hostname and path that Access will secure. If the app is visible in // the App Launcher dashboard, this is the domain that will be displayed. Domain param.Field[string] `json:"domain,required"` @@ -1971,8 +2245,8 @@ type AccessAppUpdateParamsVariant3 struct { AppLauncherVisible param.Field[bool] `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. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CorsHeaders param.Field[AccessAppUpdateParamsVariant3CorsHeaders] `json:"cors_headers"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CorsHeaders param.Field[AccessApplicationReplaceParamsVariant3CorsHeaders] `json:"cors_headers"` // The custom error message shown to a user when they are denied access to the // application. CustomDenyMessage param.Field[string] `json:"custom_deny_message"` @@ -2015,22 +2289,22 @@ type AccessAppUpdateParamsVariant3 struct { Tags param.Field[[]string] `json:"tags"` } -func (r AccessAppUpdateParamsVariant3) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant3) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant3) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant3) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant3AppID interface { - ImplementsAccessAppUpdateParamsVariant3AppID() +type AccessApplicationReplaceParamsVariant3AppID interface { + ImplementsAccessApplicationReplaceParamsVariant3AppID() } -type AccessAppUpdateParamsVariant3CorsHeaders struct { +type AccessApplicationReplaceParamsVariant3CorsHeaders struct { // Allows all HTTP request headers. AllowAllHeaders param.Field[bool] `json:"allow_all_headers"` // Allows all HTTP request methods. @@ -2043,34 +2317,34 @@ type AccessAppUpdateParamsVariant3CorsHeaders struct { // Allowed HTTP request headers. AllowedHeaders param.Field[[]interface{}] `json:"allowed_headers"` // Allowed HTTP request methods. - AllowedMethods param.Field[[]AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod] `json:"allowed_methods"` + AllowedMethods param.Field[[]AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod] `json:"allowed_methods"` // Allowed origins. AllowedOrigins param.Field[[]interface{}] `json:"allowed_origins"` // The maximum number of seconds the results of a preflight request can be cached. MaxAge param.Field[float64] `json:"max_age"` } -func (r AccessAppUpdateParamsVariant3CorsHeaders) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant3CorsHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod string +type AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod string const ( - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodGet AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "GET" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodPost AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "POST" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodHead AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "HEAD" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodPut AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "PUT" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodDelete AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "DELETE" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodConnect AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "CONNECT" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodOptions AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "OPTIONS" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodTrace AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "TRACE" - AccessAppUpdateParamsVariant3CorsHeadersAllowedMethodPatch AccessAppUpdateParamsVariant3CorsHeadersAllowedMethod = "PATCH" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodGet AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "GET" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodPost AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "POST" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodHead AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "HEAD" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodPut AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "PUT" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodDelete AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "DELETE" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodConnect AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "CONNECT" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodOptions AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "OPTIONS" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodTrace AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "TRACE" + AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethodPatch AccessApplicationReplaceParamsVariant3CorsHeadersAllowedMethod = "PATCH" ) -type AccessAppUpdateParamsVariant4 struct { +type AccessApplicationReplaceParamsVariant4 struct { // The application type. - Type param.Field[AccessAppUpdateParamsVariant4Type] `json:"type,required"` + Type param.Field[AccessApplicationReplaceParamsVariant4Type] `json:"type,required"` // 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"` @@ -2083,39 +2357,39 @@ type AccessAppUpdateParamsVariant4 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppUpdateParamsVariant4) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant4) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant4) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant4) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant4AppID interface { - ImplementsAccessAppUpdateParamsVariant4AppID() +type AccessApplicationReplaceParamsVariant4AppID interface { + ImplementsAccessApplicationReplaceParamsVariant4AppID() } // The application type. -type AccessAppUpdateParamsVariant4Type string +type AccessApplicationReplaceParamsVariant4Type string const ( - AccessAppUpdateParamsVariant4TypeSelfHosted AccessAppUpdateParamsVariant4Type = "self_hosted" - AccessAppUpdateParamsVariant4TypeSaas AccessAppUpdateParamsVariant4Type = "saas" - AccessAppUpdateParamsVariant4TypeSSH AccessAppUpdateParamsVariant4Type = "ssh" - AccessAppUpdateParamsVariant4TypeVnc AccessAppUpdateParamsVariant4Type = "vnc" - AccessAppUpdateParamsVariant4TypeAppLauncher AccessAppUpdateParamsVariant4Type = "app_launcher" - AccessAppUpdateParamsVariant4TypeWarp AccessAppUpdateParamsVariant4Type = "warp" - AccessAppUpdateParamsVariant4TypeBiso AccessAppUpdateParamsVariant4Type = "biso" - AccessAppUpdateParamsVariant4TypeBookmark AccessAppUpdateParamsVariant4Type = "bookmark" - AccessAppUpdateParamsVariant4TypeDashSSO AccessAppUpdateParamsVariant4Type = "dash_sso" + AccessApplicationReplaceParamsVariant4TypeSelfHosted AccessApplicationReplaceParamsVariant4Type = "self_hosted" + AccessApplicationReplaceParamsVariant4TypeSaas AccessApplicationReplaceParamsVariant4Type = "saas" + AccessApplicationReplaceParamsVariant4TypeSSH AccessApplicationReplaceParamsVariant4Type = "ssh" + AccessApplicationReplaceParamsVariant4TypeVnc AccessApplicationReplaceParamsVariant4Type = "vnc" + AccessApplicationReplaceParamsVariant4TypeAppLauncher AccessApplicationReplaceParamsVariant4Type = "app_launcher" + AccessApplicationReplaceParamsVariant4TypeWarp AccessApplicationReplaceParamsVariant4Type = "warp" + AccessApplicationReplaceParamsVariant4TypeBiso AccessApplicationReplaceParamsVariant4Type = "biso" + AccessApplicationReplaceParamsVariant4TypeBookmark AccessApplicationReplaceParamsVariant4Type = "bookmark" + AccessApplicationReplaceParamsVariant4TypeDashSSO AccessApplicationReplaceParamsVariant4Type = "dash_sso" ) -type AccessAppUpdateParamsVariant5 struct { +type AccessApplicationReplaceParamsVariant5 struct { // The application type. - Type param.Field[AccessAppUpdateParamsVariant5Type] `json:"type,required"` + Type param.Field[AccessApplicationReplaceParamsVariant5Type] `json:"type,required"` // 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"` @@ -2128,39 +2402,39 @@ type AccessAppUpdateParamsVariant5 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppUpdateParamsVariant5) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant5) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant5) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant5) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant5AppID interface { - ImplementsAccessAppUpdateParamsVariant5AppID() +type AccessApplicationReplaceParamsVariant5AppID interface { + ImplementsAccessApplicationReplaceParamsVariant5AppID() } // The application type. -type AccessAppUpdateParamsVariant5Type string +type AccessApplicationReplaceParamsVariant5Type string const ( - AccessAppUpdateParamsVariant5TypeSelfHosted AccessAppUpdateParamsVariant5Type = "self_hosted" - AccessAppUpdateParamsVariant5TypeSaas AccessAppUpdateParamsVariant5Type = "saas" - AccessAppUpdateParamsVariant5TypeSSH AccessAppUpdateParamsVariant5Type = "ssh" - AccessAppUpdateParamsVariant5TypeVnc AccessAppUpdateParamsVariant5Type = "vnc" - AccessAppUpdateParamsVariant5TypeAppLauncher AccessAppUpdateParamsVariant5Type = "app_launcher" - AccessAppUpdateParamsVariant5TypeWarp AccessAppUpdateParamsVariant5Type = "warp" - AccessAppUpdateParamsVariant5TypeBiso AccessAppUpdateParamsVariant5Type = "biso" - AccessAppUpdateParamsVariant5TypeBookmark AccessAppUpdateParamsVariant5Type = "bookmark" - AccessAppUpdateParamsVariant5TypeDashSSO AccessAppUpdateParamsVariant5Type = "dash_sso" + AccessApplicationReplaceParamsVariant5TypeSelfHosted AccessApplicationReplaceParamsVariant5Type = "self_hosted" + AccessApplicationReplaceParamsVariant5TypeSaas AccessApplicationReplaceParamsVariant5Type = "saas" + AccessApplicationReplaceParamsVariant5TypeSSH AccessApplicationReplaceParamsVariant5Type = "ssh" + AccessApplicationReplaceParamsVariant5TypeVnc AccessApplicationReplaceParamsVariant5Type = "vnc" + AccessApplicationReplaceParamsVariant5TypeAppLauncher AccessApplicationReplaceParamsVariant5Type = "app_launcher" + AccessApplicationReplaceParamsVariant5TypeWarp AccessApplicationReplaceParamsVariant5Type = "warp" + AccessApplicationReplaceParamsVariant5TypeBiso AccessApplicationReplaceParamsVariant5Type = "biso" + AccessApplicationReplaceParamsVariant5TypeBookmark AccessApplicationReplaceParamsVariant5Type = "bookmark" + AccessApplicationReplaceParamsVariant5TypeDashSSO AccessApplicationReplaceParamsVariant5Type = "dash_sso" ) -type AccessAppUpdateParamsVariant6 struct { +type AccessApplicationReplaceParamsVariant6 struct { // The application type. - Type param.Field[AccessAppUpdateParamsVariant6Type] `json:"type,required"` + Type param.Field[AccessApplicationReplaceParamsVariant6Type] `json:"type,required"` // 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"` @@ -2173,37 +2447,37 @@ type AccessAppUpdateParamsVariant6 struct { SessionDuration param.Field[string] `json:"session_duration"` } -func (r AccessAppUpdateParamsVariant6) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant6) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant6) ImplementsAccessAppUpdateParams() { +func (AccessApplicationReplaceParamsVariant6) ImplementsAccessApplicationReplaceParams() { } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant6AppID interface { - ImplementsAccessAppUpdateParamsVariant6AppID() +type AccessApplicationReplaceParamsVariant6AppID interface { + ImplementsAccessApplicationReplaceParamsVariant6AppID() } // The application type. -type AccessAppUpdateParamsVariant6Type string +type AccessApplicationReplaceParamsVariant6Type string const ( - AccessAppUpdateParamsVariant6TypeSelfHosted AccessAppUpdateParamsVariant6Type = "self_hosted" - AccessAppUpdateParamsVariant6TypeSaas AccessAppUpdateParamsVariant6Type = "saas" - AccessAppUpdateParamsVariant6TypeSSH AccessAppUpdateParamsVariant6Type = "ssh" - AccessAppUpdateParamsVariant6TypeVnc AccessAppUpdateParamsVariant6Type = "vnc" - AccessAppUpdateParamsVariant6TypeAppLauncher AccessAppUpdateParamsVariant6Type = "app_launcher" - AccessAppUpdateParamsVariant6TypeWarp AccessAppUpdateParamsVariant6Type = "warp" - AccessAppUpdateParamsVariant6TypeBiso AccessAppUpdateParamsVariant6Type = "biso" - AccessAppUpdateParamsVariant6TypeBookmark AccessAppUpdateParamsVariant6Type = "bookmark" - AccessAppUpdateParamsVariant6TypeDashSSO AccessAppUpdateParamsVariant6Type = "dash_sso" + AccessApplicationReplaceParamsVariant6TypeSelfHosted AccessApplicationReplaceParamsVariant6Type = "self_hosted" + AccessApplicationReplaceParamsVariant6TypeSaas AccessApplicationReplaceParamsVariant6Type = "saas" + AccessApplicationReplaceParamsVariant6TypeSSH AccessApplicationReplaceParamsVariant6Type = "ssh" + AccessApplicationReplaceParamsVariant6TypeVnc AccessApplicationReplaceParamsVariant6Type = "vnc" + AccessApplicationReplaceParamsVariant6TypeAppLauncher AccessApplicationReplaceParamsVariant6Type = "app_launcher" + AccessApplicationReplaceParamsVariant6TypeWarp AccessApplicationReplaceParamsVariant6Type = "warp" + AccessApplicationReplaceParamsVariant6TypeBiso AccessApplicationReplaceParamsVariant6Type = "biso" + AccessApplicationReplaceParamsVariant6TypeBookmark AccessApplicationReplaceParamsVariant6Type = "bookmark" + AccessApplicationReplaceParamsVariant6TypeDashSSO AccessApplicationReplaceParamsVariant6Type = "dash_sso" ) -type AccessAppUpdateParamsVariant7 struct { +type AccessApplicationReplaceParamsVariant7 struct { AppLauncherVisible param.Field[interface{}] `json:"app_launcher_visible"` // The URL or domain of the bookmark. Domain param.Field[interface{}] `json:"domain"` @@ -2218,207 +2492,33 @@ type AccessAppUpdateParamsVariant7 struct { Type param.Field[string] `json:"type"` } -func (r AccessAppUpdateParamsVariant7) MarshalJSON() (data []byte, err error) { +func (r AccessApplicationReplaceParamsVariant7) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessAppUpdateParamsVariant7) ImplementsAccessAppUpdateParams() { - -} - -// Identifier -// -// Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUpdateParamsVariant7AppID interface { - ImplementsAccessAppUpdateParamsVariant7AppID() -} - -type AccessAppUpdateResponseEnvelope struct { - Errors []AccessAppUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppUpdateResponseEnvelopeJSON `json:"-"` -} - -// accessAppUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppUpdateResponseEnvelope] -type accessAppUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppUpdateResponseEnvelopeErrors] -type accessAppUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppUpdateResponseEnvelopeMessages] -type accessAppUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppUpdateResponseEnvelopeSuccess bool - -const ( - AccessAppUpdateResponseEnvelopeSuccessTrue AccessAppUpdateResponseEnvelopeSuccess = true -) - -type AccessAppListResponseEnvelope struct { - Errors []AccessAppListResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppListResponseEnvelopeMessages `json:"messages,required"` - Result []AccessAppListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AccessAppListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessAppListResponseEnvelopeResultInfo `json:"result_info"` - JSON accessAppListResponseEnvelopeJSON `json:"-"` -} - -// accessAppListResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppListResponseEnvelope] -type accessAppListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppListResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppListResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppListResponseEnvelopeErrors] -type accessAppListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppListResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppListResponseEnvelopeMessages] -type accessAppListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppListResponseEnvelopeSuccess bool - -const ( - AccessAppListResponseEnvelopeSuccessTrue AccessAppListResponseEnvelopeSuccess = true -) - -type AccessAppListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessAppListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessAppListResponseEnvelopeResultInfoJSON contains the JSON metadata for the -// struct [AccessAppListResponseEnvelopeResultInfo] -type accessAppListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +func (AccessApplicationReplaceParamsVariant7) ImplementsAccessApplicationReplaceParams() { -func (r *AccessAppListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) } // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppDeleteParamsAppID interface { - ImplementsAccessAppDeleteParamsAppID() +type AccessApplicationReplaceParamsVariant7AppID interface { + ImplementsAccessApplicationReplaceParamsVariant7AppID() } -type AccessAppDeleteResponseEnvelope struct { - Errors []AccessAppDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppDeleteResponse `json:"result,required"` +type AccessApplicationReplaceResponseEnvelope struct { + Errors []AccessApplicationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessAppDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppDeleteResponseEnvelopeJSON `json:"-"` + Success AccessApplicationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationReplaceResponseEnvelopeJSON `json:"-"` } -// accessAppDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppDeleteResponseEnvelope] -type accessAppDeleteResponseEnvelopeJSON struct { +// accessApplicationReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationReplaceResponseEnvelope] +type accessApplicationReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -2427,127 +2527,84 @@ type accessAppDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessAppDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AccessApplicationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessAppDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppDeleteResponseEnvelopeErrors] -type accessAppDeleteResponseEnvelopeErrorsJSON struct { +// accessApplicationReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessApplicationReplaceResponseEnvelopeErrors] +type accessApplicationReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessAppDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AccessApplicationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessAppDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppDeleteResponseEnvelopeMessages] -type accessAppDeleteResponseEnvelopeMessagesJSON struct { +// accessApplicationReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationReplaceResponseEnvelopeMessages] +type accessApplicationReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessAppDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessAppDeleteResponseEnvelopeSuccess bool +type AccessApplicationReplaceResponseEnvelopeSuccess bool const ( - AccessAppDeleteResponseEnvelopeSuccessTrue AccessAppDeleteResponseEnvelopeSuccess = true + AccessApplicationReplaceResponseEnvelopeSuccessTrue AccessApplicationReplaceResponseEnvelopeSuccess = true ) // Identifier // // Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppGetParamsAppID interface { - ImplementsAccessAppGetParamsAppID() +type AccessApplicationRevokeTokensParamsAppID interface { + ImplementsAccessApplicationRevokeTokensParamsAppID() } -type AccessAppGetResponseEnvelope struct { - Errors []AccessAppGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppGetResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppGetResponseEnvelopeJSON `json:"-"` +type AccessApplicationRevokeTokensResponseEnvelope struct { + Result AccessApplicationRevokeTokensResponse `json:"result,nullable"` + Success AccessApplicationRevokeTokensResponseEnvelopeSuccess `json:"success"` + JSON accessApplicationRevokeTokensResponseEnvelopeJSON `json:"-"` } -// accessAppGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppGetResponseEnvelope] -type accessAppGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field +// accessApplicationRevokeTokensResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessApplicationRevokeTokensResponseEnvelope] +type accessApplicationRevokeTokensResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessAppGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [AccessAppGetResponseEnvelopeErrors] -type accessAppGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessApplicationRevokeTokensResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessAppGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessAppGetResponseEnvelopeMessages] -type accessAppGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppGetResponseEnvelopeSuccess bool +type AccessApplicationRevokeTokensResponseEnvelopeSuccess bool const ( - AccessAppGetResponseEnvelopeSuccessTrue AccessAppGetResponseEnvelopeSuccess = true + AccessApplicationRevokeTokensResponseEnvelopeSuccessTrue AccessApplicationRevokeTokensResponseEnvelopeSuccess = true + AccessApplicationRevokeTokensResponseEnvelopeSuccessFalse AccessApplicationRevokeTokensResponseEnvelopeSuccess = false ) diff --git a/accessapp_test.go b/accessapplication_test.go similarity index 79% rename from accessapp_test.go rename to accessapplication_test.go index 184832ab36e..e77fe3e9ce2 100644 --- a/accessapp_test.go +++ b/accessapplication_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessAppNewWithOptionalParams(t *testing.T) { +func TestAccessApplicationNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,24 +30,24 @@ func TestAccessAppNewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.New( + _, err := client.Access.Applications.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessAppNewParamsVariant0{ + cloudflare.AccessApplicationNewParamsVariant0{ 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), AutoRedirectToIdentity: cloudflare.F(true), - CorsHeaders: cloudflare.F(cloudflare.AccessAppNewParamsVariant0CorsHeaders{ + CorsHeaders: cloudflare.F(cloudflare.AccessApplicationNewParamsVariant0CorsHeaders{ AllowAllHeaders: cloudflare.F(true), AllowAllMethods: cloudflare.F(true), AllowAllOrigins: cloudflare.F(true), AllowCredentials: cloudflare.F(true), AllowedHeaders: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - AllowedMethods: cloudflare.F([]cloudflare.AccessAppNewParamsVariant0CorsHeadersAllowedMethod{cloudflare.AccessAppNewParamsVariant0CorsHeadersAllowedMethodGet}), + AllowedMethods: cloudflare.F([]cloudflare.AccessApplicationNewParamsVariant0CorsHeadersAllowedMethod{cloudflare.AccessApplicationNewParamsVariant0CorsHeadersAllowedMethodGet}), AllowedOrigins: cloudflare.F([]interface{}{"https://example.com"}), MaxAge: cloudflare.F(-1.000000), }), @@ -77,7 +77,7 @@ func TestAccessAppNewWithOptionalParams(t *testing.T) { } } -func TestAccessAppUpdateWithOptionalParams(t *testing.T) { +func TestAccessApplicationList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,44 +93,41 @@ func TestAccessAppUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Update( + _, err := client.Access.Applications.List( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessApplicationDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Delete( context.TODO(), "string", "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), - AutoRedirectToIdentity: cloudflare.F(true), - CorsHeaders: cloudflare.F(cloudflare.AccessAppUpdateParamsVariant0CorsHeaders{ - AllowAllHeaders: cloudflare.F(true), - AllowAllMethods: cloudflare.F(true), - AllowAllOrigins: cloudflare.F(true), - AllowCredentials: cloudflare.F(true), - AllowedHeaders: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - AllowedMethods: cloudflare.F([]cloudflare.AccessAppUpdateParamsVariant0CorsHeadersAllowedMethod{cloudflare.AccessAppUpdateParamsVariant0CorsHeadersAllowedMethodGet}), - AllowedOrigins: cloudflare.F([]interface{}{"https://example.com"}), - MaxAge: cloudflare.F(-1.000000), - }), - CustomDenyMessage: cloudflare.F("string"), - CustomDenyURL: cloudflare.F("string"), - CustomNonIdentityDenyURL: cloudflare.F("string"), - CustomPages: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), - 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"), - Name: cloudflare.F("Admin Site"), - PathCookieAttribute: cloudflare.F(true), - SameSiteCookieAttribute: cloudflare.F("strict"), - SelfHostedDomains: cloudflare.F([]string{"test.example.com/admin", "test.anotherexample.com/staff"}), - ServiceAuth401Redirect: cloudflare.F(true), - SessionDuration: cloudflare.F("24h"), - SkipInterstitial: cloudflare.F(true), - Tags: cloudflare.F([]string{"engineers", "engineers", "engineers"}), - }, ) if err != nil { var apierr *cloudflare.Error @@ -141,7 +138,7 @@ func TestAccessAppUpdateWithOptionalParams(t *testing.T) { } } -func TestAccessAppList(t *testing.T) { +func TestAccessApplicationGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -157,10 +154,11 @@ func TestAccessAppList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.List( + _, err := client.Access.Applications.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + shared.UnionString("023e105f4ecef8ad9ca31a8372d0c353"), ) if err != nil { var apierr *cloudflare.Error @@ -171,7 +169,7 @@ func TestAccessAppList(t *testing.T) { } } -func TestAccessAppDelete(t *testing.T) { +func TestAccessApplicationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -187,11 +185,44 @@ func TestAccessAppDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Delete( + _, err := client.Access.Applications.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", shared.UnionString("023e105f4ecef8ad9ca31a8372d0c353"), + cloudflare.AccessApplicationReplaceParamsVariant0{ + 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), + AutoRedirectToIdentity: cloudflare.F(true), + CorsHeaders: cloudflare.F(cloudflare.AccessApplicationReplaceParamsVariant0CorsHeaders{ + AllowAllHeaders: cloudflare.F(true), + AllowAllMethods: cloudflare.F(true), + AllowAllOrigins: cloudflare.F(true), + AllowCredentials: cloudflare.F(true), + AllowedHeaders: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), + AllowedMethods: cloudflare.F([]cloudflare.AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethod{cloudflare.AccessApplicationReplaceParamsVariant0CorsHeadersAllowedMethodGet}), + AllowedOrigins: cloudflare.F([]interface{}{"https://example.com"}), + MaxAge: cloudflare.F(-1.000000), + }), + CustomDenyMessage: cloudflare.F("string"), + CustomDenyURL: cloudflare.F("string"), + CustomNonIdentityDenyURL: cloudflare.F("string"), + CustomPages: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), + 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"), + Name: cloudflare.F("Admin Site"), + PathCookieAttribute: cloudflare.F(true), + SameSiteCookieAttribute: cloudflare.F("strict"), + SelfHostedDomains: cloudflare.F([]string{"test.example.com/admin", "test.anotherexample.com/staff"}), + ServiceAuth401Redirect: cloudflare.F(true), + SessionDuration: cloudflare.F("24h"), + SkipInterstitial: cloudflare.F(true), + Tags: cloudflare.F([]string{"engineers", "engineers", "engineers"}), + }, ) if err != nil { var apierr *cloudflare.Error @@ -202,7 +233,7 @@ func TestAccessAppDelete(t *testing.T) { } } -func TestAccessAppGet(t *testing.T) { +func TestAccessApplicationRevokeTokens(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -218,7 +249,7 @@ func TestAccessAppGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Get( + _, err := client.Access.Applications.RevokeTokens( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/accessapplicationca.go b/accessapplicationca.go new file mode 100644 index 00000000000..01ba5654210 --- /dev/null +++ b/accessapplicationca.go @@ -0,0 +1,468 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +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" +) + +// AccessApplicationCaService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewAccessApplicationCaService] +// method instead. +type AccessApplicationCaService struct { + Options []option.RequestOption +} + +// NewAccessApplicationCaService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewAccessApplicationCaService(opts ...option.RequestOption) (r *AccessApplicationCaService) { + r = &AccessApplicationCaService{} + r.Options = opts + return +} + +// Generates a new short-lived certificate CA and public key. +func (r *AccessApplicationCaService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessApplicationCaNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationCaNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists short-lived certificate CAs and their public keys. +func (r *AccessApplicationCaService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessApplicationCaListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationCaListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/ca", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Deletes a short-lived certificate CA. +func (r *AccessApplicationCaService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessApplicationCaDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationCaDeleteResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches a short-lived certificate CA and its public key. +func (r *AccessApplicationCaService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessApplicationCaGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationCaGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/ca", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [AccessApplicationCaNewResponseUnknown] or +// [shared.UnionString]. +type AccessApplicationCaNewResponse interface { + ImplementsAccessApplicationCaNewResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AccessApplicationCaNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AccessApplicationCaListResponse struct { + // The ID of the CA. + ID string `json:"id"` + // The Application Audience (AUD) tag. Identifies the application associated with + // the CA. + Aud string `json:"aud"` + // The public key to add to your SSH server configuration. + PublicKey string `json:"public_key"` + JSON accessApplicationCaListResponseJSON `json:"-"` +} + +// accessApplicationCaListResponseJSON contains the JSON metadata for the struct +// [AccessApplicationCaListResponse] +type accessApplicationCaListResponseJSON struct { + ID apijson.Field + Aud apijson.Field + PublicKey apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaDeleteResponse struct { + // The ID of the CA. + ID string `json:"id"` + JSON accessApplicationCaDeleteResponseJSON `json:"-"` +} + +// accessApplicationCaDeleteResponseJSON contains the JSON metadata for the struct +// [AccessApplicationCaDeleteResponse] +type accessApplicationCaDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [AccessApplicationCaGetResponseUnknown] or +// [shared.UnionString]. +type AccessApplicationCaGetResponse interface { + ImplementsAccessApplicationCaGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AccessApplicationCaGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AccessApplicationCaNewResponseEnvelope struct { + Errors []AccessApplicationCaNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationCaNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationCaNewResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationCaNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationCaNewResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationCaNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationCaNewResponseEnvelope] +type accessApplicationCaNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationCaNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationCaNewResponseEnvelopeErrors] +type accessApplicationCaNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationCaNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationCaNewResponseEnvelopeMessages] +type accessApplicationCaNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationCaNewResponseEnvelopeSuccess bool + +const ( + AccessApplicationCaNewResponseEnvelopeSuccessTrue AccessApplicationCaNewResponseEnvelopeSuccess = true +) + +type AccessApplicationCaListResponseEnvelope struct { + Errors []AccessApplicationCaListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationCaListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessApplicationCaListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AccessApplicationCaListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessApplicationCaListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessApplicationCaListResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationCaListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationCaListResponseEnvelope] +type accessApplicationCaListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaListResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationCaListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationCaListResponseEnvelopeErrors] +type accessApplicationCaListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaListResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationCaListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationCaListResponseEnvelopeMessages] +type accessApplicationCaListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationCaListResponseEnvelopeSuccess bool + +const ( + AccessApplicationCaListResponseEnvelopeSuccessTrue AccessApplicationCaListResponseEnvelopeSuccess = true +) + +type AccessApplicationCaListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessApplicationCaListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessApplicationCaListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AccessApplicationCaListResponseEnvelopeResultInfo] +type accessApplicationCaListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaDeleteResponseEnvelope struct { + Errors []AccessApplicationCaDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationCaDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationCaDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationCaDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationCaDeleteResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationCaDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationCaDeleteResponseEnvelope] +type accessApplicationCaDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationCaDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessApplicationCaDeleteResponseEnvelopeErrors] +type accessApplicationCaDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationCaDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationCaDeleteResponseEnvelopeMessages] +type accessApplicationCaDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationCaDeleteResponseEnvelopeSuccess bool + +const ( + AccessApplicationCaDeleteResponseEnvelopeSuccessTrue AccessApplicationCaDeleteResponseEnvelopeSuccess = true +) + +type AccessApplicationCaGetResponseEnvelope struct { + Errors []AccessApplicationCaGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationCaGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationCaGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationCaGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationCaGetResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationCaGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessApplicationCaGetResponseEnvelope] +type accessApplicationCaGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationCaGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessApplicationCaGetResponseEnvelopeErrors] +type accessApplicationCaGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationCaGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationCaGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationCaGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessApplicationCaGetResponseEnvelopeMessages] +type accessApplicationCaGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationCaGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationCaGetResponseEnvelopeSuccess bool + +const ( + AccessApplicationCaGetResponseEnvelopeSuccessTrue AccessApplicationCaGetResponseEnvelopeSuccess = true +) diff --git a/accessappca_test.go b/accessapplicationca_test.go similarity index 89% rename from accessappca_test.go rename to accessapplicationca_test.go index 646a7d0f5b3..e7cd286b979 100644 --- a/accessappca_test.go +++ b/accessapplicationca_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessAppCaNew(t *testing.T) { +func TestAccessApplicationCaNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAccessAppCaNew(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Cas.New( + _, err := client.Access.Applications.Cas.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", @@ -44,7 +44,7 @@ func TestAccessAppCaNew(t *testing.T) { } } -func TestAccessAppCaList(t *testing.T) { +func TestAccessApplicationCaList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,7 +60,7 @@ func TestAccessAppCaList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Cas.List( + _, err := client.Access.Applications.Cas.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", @@ -74,7 +74,7 @@ func TestAccessAppCaList(t *testing.T) { } } -func TestAccessAppCaDelete(t *testing.T) { +func TestAccessApplicationCaDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -90,7 +90,7 @@ func TestAccessAppCaDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Cas.Delete( + _, err := client.Access.Applications.Cas.Delete( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", @@ -105,7 +105,7 @@ func TestAccessAppCaDelete(t *testing.T) { } } -func TestAccessAppCaGet(t *testing.T) { +func TestAccessApplicationCaGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -121,7 +121,7 @@ func TestAccessAppCaGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.Cas.Get( + _, err := client.Access.Applications.Cas.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/accessapplicationpolicy.go b/accessapplicationpolicy.go new file mode 100644 index 00000000000..257ed83bbee --- /dev/null +++ b/accessapplicationpolicy.go @@ -0,0 +1,12769 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "reflect" + "time" + + "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/option" +) + +// AccessApplicationPolicyService contains methods and other services that help +// with interacting with the cloudflare API. Note, unlike clients, this service +// does not read variables from the environment automatically. You should not +// instantiate this service directly, and instead use the +// [NewAccessApplicationPolicyService] method instead. +type AccessApplicationPolicyService struct { + Options []option.RequestOption +} + +// NewAccessApplicationPolicyService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewAccessApplicationPolicyService(opts ...option.RequestOption) (r *AccessApplicationPolicyService) { + r = &AccessApplicationPolicyService{} + r.Options = opts + return +} + +// Create a new Access policy for an application. +func (r *AccessApplicationPolicyService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessApplicationPolicyNewParams, opts ...option.RequestOption) (res *AccessApplicationPolicyNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationPolicyNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists Access policies configured for an application. +func (r *AccessApplicationPolicyService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *[]AccessApplicationPolicyListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationPolicyListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Delete an Access policy. +func (r *AccessApplicationPolicyService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, opts ...option.RequestOption) (res *AccessApplicationPolicyDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationPolicyDeleteResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches a single Access policy. +func (r *AccessApplicationPolicyService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, opts ...option.RequestOption) (res *AccessApplicationPolicyGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationPolicyGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Update a configured Access policy. +func (r *AccessApplicationPolicyService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, body AccessApplicationPolicyReplaceParams, opts ...option.RequestOption) (res *AccessApplicationPolicyReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationPolicyReplaceResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type AccessApplicationPolicyNewResponse struct { + // UUID + ID string `json:"id"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups []AccessApplicationPolicyNewResponseApprovalGroup `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired bool `json:"approval_required"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The action Access will take if a user matches this policy. + Decision AccessApplicationPolicyNewResponseDecision `json:"decision"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude []AccessApplicationPolicyNewResponseExclude `json:"exclude"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include []AccessApplicationPolicyNewResponseInclude `json:"include"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired bool `json:"isolation_required"` + // The name of the Access policy. + Name string `json:"name"` + // The order of execution for this policy. Must be unique for each policy. + Precedence int64 `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt string `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired bool `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require []AccessApplicationPolicyNewResponseRequire `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration string `json:"session_duration"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationPolicyNewResponseJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseJSON contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponse] +type accessApplicationPolicyNewResponseJSON struct { + ID apijson.Field + ApprovalGroups apijson.Field + ApprovalRequired apijson.Field + CreatedAt apijson.Field + Decision apijson.Field + Exclude apijson.Field + Include apijson.Field + IsolationRequired apijson.Field + Name apijson.Field + Precedence apijson.Field + PurposeJustificationPrompt apijson.Field + PurposeJustificationRequired apijson.Field + Require apijson.Field + SessionDuration apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyNewResponseApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded float64 `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses []interface{} `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid string `json:"email_list_uuid"` + JSON accessApplicationPolicyNewResponseApprovalGroupJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseApprovalGroupJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyNewResponseApprovalGroup] +type accessApplicationPolicyNewResponseApprovalGroupJSON struct { + ApprovalsNeeded apijson.Field + EmailAddresses apijson.Field + EmailListUuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyNewResponseDecision string + +const ( + AccessApplicationPolicyNewResponseDecisionAllow AccessApplicationPolicyNewResponseDecision = "allow" + AccessApplicationPolicyNewResponseDecisionDeny AccessApplicationPolicyNewResponseDecision = "deny" + AccessApplicationPolicyNewResponseDecisionNonIdentity AccessApplicationPolicyNewResponseDecision = "non_identity" + AccessApplicationPolicyNewResponseDecisionBypass AccessApplicationPolicyNewResponseDecision = "bypass" +) + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyNewResponseExcludeAccessEmailRule], +// [AccessApplicationPolicyNewResponseExcludeAccessEmailListRule], +// [AccessApplicationPolicyNewResponseExcludeAccessDomainRule], +// [AccessApplicationPolicyNewResponseExcludeAccessEveryoneRule], +// [AccessApplicationPolicyNewResponseExcludeAccessIPRule], +// [AccessApplicationPolicyNewResponseExcludeAccessIPListRule], +// [AccessApplicationPolicyNewResponseExcludeAccessCertificateRule], +// [AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewResponseExcludeAccessCountryRule], +// [AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyNewResponseExclude interface { + implementsAccessApplicationPolicyNewResponseExclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyNewResponseExclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyNewResponseExcludeAccessEmailRule struct { + Email AccessApplicationPolicyNewResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessEmailRule] +type accessApplicationPolicyNewResponseExcludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessEmailRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyNewResponseExcludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessEmailRuleEmail] +type accessApplicationPolicyNewResponseExcludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewResponseExcludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessEmailListRule] +type accessApplicationPolicyNewResponseExcludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessEmailListRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailList] +type accessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewResponseExcludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessDomainRule] +type accessApplicationPolicyNewResponseExcludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessDomainRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyNewResponseExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessEveryoneRule] +type accessApplicationPolicyNewResponseExcludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessEveryoneRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewResponseExcludeAccessIPRule struct { + IP AccessApplicationPolicyNewResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyNewResponseExcludeAccessIPRule] +type accessApplicationPolicyNewResponseExcludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessIPRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessIPRuleIP] +type accessApplicationPolicyNewResponseExcludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewResponseExcludeAccessIPListRule struct { + IPList AccessApplicationPolicyNewResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessIPListRule] +type accessApplicationPolicyNewResponseExcludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessIPListRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessIPListRuleIPList] +type accessApplicationPolicyNewResponseExcludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessCertificateRule] +type accessApplicationPolicyNewResponseExcludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessCertificateRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRule] +type accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRule] +type accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRule] +type accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRule] +type accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRule] +type accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRule] +type accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRule] +type accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRule] +type accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyNewResponseExcludeAccessCountryRule struct { + Geo AccessApplicationPolicyNewResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessCountryRule] +type accessApplicationPolicyNewResponseExcludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessCountryRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessCountryRuleGeo] +type accessApplicationPolicyNewResponseExcludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRule] +type accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRule] +type accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyNewResponseExclude() { +} + +type AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyNewResponseIncludeAccessEmailRule], +// [AccessApplicationPolicyNewResponseIncludeAccessEmailListRule], +// [AccessApplicationPolicyNewResponseIncludeAccessDomainRule], +// [AccessApplicationPolicyNewResponseIncludeAccessEveryoneRule], +// [AccessApplicationPolicyNewResponseIncludeAccessIPRule], +// [AccessApplicationPolicyNewResponseIncludeAccessIPListRule], +// [AccessApplicationPolicyNewResponseIncludeAccessCertificateRule], +// [AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewResponseIncludeAccessCountryRule], +// [AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyNewResponseInclude interface { + implementsAccessApplicationPolicyNewResponseInclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyNewResponseInclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyNewResponseIncludeAccessEmailRule struct { + Email AccessApplicationPolicyNewResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessEmailRule] +type accessApplicationPolicyNewResponseIncludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessEmailRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyNewResponseIncludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessEmailRuleEmail] +type accessApplicationPolicyNewResponseIncludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewResponseIncludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessEmailListRule] +type accessApplicationPolicyNewResponseIncludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessEmailListRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailList] +type accessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewResponseIncludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessDomainRule] +type accessApplicationPolicyNewResponseIncludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessDomainRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyNewResponseIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessEveryoneRule] +type accessApplicationPolicyNewResponseIncludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessEveryoneRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewResponseIncludeAccessIPRule struct { + IP AccessApplicationPolicyNewResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyNewResponseIncludeAccessIPRule] +type accessApplicationPolicyNewResponseIncludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessIPRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessIPRuleIP] +type accessApplicationPolicyNewResponseIncludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewResponseIncludeAccessIPListRule struct { + IPList AccessApplicationPolicyNewResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessIPListRule] +type accessApplicationPolicyNewResponseIncludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessIPListRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessIPListRuleIPList] +type accessApplicationPolicyNewResponseIncludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessCertificateRule] +type accessApplicationPolicyNewResponseIncludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessCertificateRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRule] +type accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRule] +type accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRule] +type accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRule] +type accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRule] +type accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRule] +type accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRule] +type accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRule] +type accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyNewResponseIncludeAccessCountryRule struct { + Geo AccessApplicationPolicyNewResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessCountryRule] +type accessApplicationPolicyNewResponseIncludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessCountryRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessCountryRuleGeo] +type accessApplicationPolicyNewResponseIncludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRule] +type accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRule] +type accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyNewResponseInclude() { +} + +type AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyNewResponseRequireAccessEmailRule], +// [AccessApplicationPolicyNewResponseRequireAccessEmailListRule], +// [AccessApplicationPolicyNewResponseRequireAccessDomainRule], +// [AccessApplicationPolicyNewResponseRequireAccessEveryoneRule], +// [AccessApplicationPolicyNewResponseRequireAccessIPRule], +// [AccessApplicationPolicyNewResponseRequireAccessIPListRule], +// [AccessApplicationPolicyNewResponseRequireAccessCertificateRule], +// [AccessApplicationPolicyNewResponseRequireAccessAccessGroupRule], +// [AccessApplicationPolicyNewResponseRequireAccessAzureGroupRule], +// [AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewResponseRequireAccessOktaGroupRule], +// [AccessApplicationPolicyNewResponseRequireAccessSamlGroupRule], +// [AccessApplicationPolicyNewResponseRequireAccessServiceTokenRule], +// [AccessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewResponseRequireAccessCountryRule], +// [AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyNewResponseRequireAccessDevicePostureRule]. +type AccessApplicationPolicyNewResponseRequire interface { + implementsAccessApplicationPolicyNewResponseRequire() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyNewResponseRequire)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyNewResponseRequireAccessEmailRule struct { + Email AccessApplicationPolicyNewResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyNewResponseRequireAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessEmailRule] +type accessApplicationPolicyNewResponseRequireAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessEmailRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyNewResponseRequireAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessEmailRuleEmail] +type accessApplicationPolicyNewResponseRequireAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewResponseRequireAccessEmailListRule struct { + EmailList AccessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyNewResponseRequireAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessEmailListRule] +type accessApplicationPolicyNewResponseRequireAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessEmailListRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailList] +type accessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewResponseRequireAccessDomainRule struct { + EmailDomain AccessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyNewResponseRequireAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessDomainRule] +type accessApplicationPolicyNewResponseRequireAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessDomainRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomain] +type accessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyNewResponseRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyNewResponseRequireAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessEveryoneRule] +type accessApplicationPolicyNewResponseRequireAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessEveryoneRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewResponseRequireAccessIPRule struct { + IP AccessApplicationPolicyNewResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyNewResponseRequireAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyNewResponseRequireAccessIPRule] +type accessApplicationPolicyNewResponseRequireAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessIPRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyNewResponseRequireAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessIPRuleIP] +type accessApplicationPolicyNewResponseRequireAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewResponseRequireAccessIPListRule struct { + IPList AccessApplicationPolicyNewResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyNewResponseRequireAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessIPListRule] +type accessApplicationPolicyNewResponseRequireAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessIPListRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseRequireAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessIPListRuleIPList] +type accessApplicationPolicyNewResponseRequireAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyNewResponseRequireAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessCertificateRule] +type accessApplicationPolicyNewResponseRequireAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessCertificateRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewResponseRequireAccessAccessGroupRule struct { + Group AccessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAccessGroupRule] +type accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessAccessGroupRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroup] +type accessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewResponseRequireAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAzureGroupRule] +type accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessAzureGroupRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRule] +type accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRule] +type accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewResponseRequireAccessOktaGroupRule struct { + Okta AccessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessOktaGroupRule] +type accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessOktaGroupRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOkta] +type accessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewResponseRequireAccessSamlGroupRule struct { + Saml AccessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessSamlGroupRule] +type accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessSamlGroupRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSaml] +type accessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessServiceTokenRule] +type accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessServiceTokenRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRule] +type accessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRule] +type accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyNewResponseRequireAccessCountryRule struct { + Geo AccessApplicationPolicyNewResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyNewResponseRequireAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessCountryRule] +type accessApplicationPolicyNewResponseRequireAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessCountryRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyNewResponseRequireAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessCountryRuleGeo] +type accessApplicationPolicyNewResponseRequireAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRule] +type accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessDevicePostureRule] +type accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyNewResponseRequireAccessDevicePostureRule) implementsAccessApplicationPolicyNewResponseRequire() { +} + +type AccessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyListResponse struct { + // UUID + ID string `json:"id"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups []AccessApplicationPolicyListResponseApprovalGroup `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired bool `json:"approval_required"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The action Access will take if a user matches this policy. + Decision AccessApplicationPolicyListResponseDecision `json:"decision"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude []AccessApplicationPolicyListResponseExclude `json:"exclude"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include []AccessApplicationPolicyListResponseInclude `json:"include"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired bool `json:"isolation_required"` + // The name of the Access policy. + Name string `json:"name"` + // The order of execution for this policy. Must be unique for each policy. + Precedence int64 `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt string `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired bool `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require []AccessApplicationPolicyListResponseRequire `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration string `json:"session_duration"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationPolicyListResponseJSON `json:"-"` +} + +// accessApplicationPolicyListResponseJSON contains the JSON metadata for the +// struct [AccessApplicationPolicyListResponse] +type accessApplicationPolicyListResponseJSON struct { + ID apijson.Field + ApprovalGroups apijson.Field + ApprovalRequired apijson.Field + CreatedAt apijson.Field + Decision apijson.Field + Exclude apijson.Field + Include apijson.Field + IsolationRequired apijson.Field + Name apijson.Field + Precedence apijson.Field + PurposeJustificationPrompt apijson.Field + PurposeJustificationRequired apijson.Field + Require apijson.Field + SessionDuration apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyListResponseApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded float64 `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses []interface{} `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid string `json:"email_list_uuid"` + JSON accessApplicationPolicyListResponseApprovalGroupJSON `json:"-"` +} + +// accessApplicationPolicyListResponseApprovalGroupJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyListResponseApprovalGroup] +type accessApplicationPolicyListResponseApprovalGroupJSON struct { + ApprovalsNeeded apijson.Field + EmailAddresses apijson.Field + EmailListUuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyListResponseDecision string + +const ( + AccessApplicationPolicyListResponseDecisionAllow AccessApplicationPolicyListResponseDecision = "allow" + AccessApplicationPolicyListResponseDecisionDeny AccessApplicationPolicyListResponseDecision = "deny" + AccessApplicationPolicyListResponseDecisionNonIdentity AccessApplicationPolicyListResponseDecision = "non_identity" + AccessApplicationPolicyListResponseDecisionBypass AccessApplicationPolicyListResponseDecision = "bypass" +) + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyListResponseExcludeAccessEmailRule], +// [AccessApplicationPolicyListResponseExcludeAccessEmailListRule], +// [AccessApplicationPolicyListResponseExcludeAccessDomainRule], +// [AccessApplicationPolicyListResponseExcludeAccessEveryoneRule], +// [AccessApplicationPolicyListResponseExcludeAccessIPRule], +// [AccessApplicationPolicyListResponseExcludeAccessIPListRule], +// [AccessApplicationPolicyListResponseExcludeAccessCertificateRule], +// [AccessApplicationPolicyListResponseExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyListResponseExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyListResponseExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyListResponseExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyListResponseExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyListResponseExcludeAccessCountryRule], +// [AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyListResponseExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyListResponseExclude interface { + implementsAccessApplicationPolicyListResponseExclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyListResponseExclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyListResponseExcludeAccessEmailRule struct { + Email AccessApplicationPolicyListResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyListResponseExcludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessEmailRule] +type accessApplicationPolicyListResponseExcludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessEmailRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyListResponseExcludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessEmailRuleEmail] +type accessApplicationPolicyListResponseExcludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyListResponseExcludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyListResponseExcludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessEmailListRule] +type accessApplicationPolicyListResponseExcludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessEmailListRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailList] +type accessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyListResponseExcludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyListResponseExcludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessDomainRule] +type accessApplicationPolicyListResponseExcludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessDomainRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyListResponseExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyListResponseExcludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessEveryoneRule] +type accessApplicationPolicyListResponseExcludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessEveryoneRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyListResponseExcludeAccessIPRule struct { + IP AccessApplicationPolicyListResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyListResponseExcludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyListResponseExcludeAccessIPRule] +type accessApplicationPolicyListResponseExcludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessIPRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyListResponseExcludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessIPRuleIP] +type accessApplicationPolicyListResponseExcludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyListResponseExcludeAccessIPListRule struct { + IPList AccessApplicationPolicyListResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyListResponseExcludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessIPListRule] +type accessApplicationPolicyListResponseExcludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessIPListRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseExcludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessIPListRuleIPList] +type accessApplicationPolicyListResponseExcludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyListResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyListResponseExcludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessCertificateRule] +type accessApplicationPolicyListResponseExcludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessCertificateRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyListResponseExcludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAccessGroupRule] +type accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyListResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAzureGroupRule] +type accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRule] +type accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRule] +type accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyListResponseExcludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessOktaGroupRule] +type accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyListResponseExcludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessSamlGroupRule] +type accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyListResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessServiceTokenRule] +type accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRule] +type accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyListResponseExcludeAccessCountryRule struct { + Geo AccessApplicationPolicyListResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyListResponseExcludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessCountryRule] +type accessApplicationPolicyListResponseExcludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessCountryRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyListResponseExcludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessCountryRuleGeo] +type accessApplicationPolicyListResponseExcludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRule] +type accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyListResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessDevicePostureRule] +type accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyListResponseExclude() { +} + +type AccessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyListResponseIncludeAccessEmailRule], +// [AccessApplicationPolicyListResponseIncludeAccessEmailListRule], +// [AccessApplicationPolicyListResponseIncludeAccessDomainRule], +// [AccessApplicationPolicyListResponseIncludeAccessEveryoneRule], +// [AccessApplicationPolicyListResponseIncludeAccessIPRule], +// [AccessApplicationPolicyListResponseIncludeAccessIPListRule], +// [AccessApplicationPolicyListResponseIncludeAccessCertificateRule], +// [AccessApplicationPolicyListResponseIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyListResponseIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyListResponseIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyListResponseIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyListResponseIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyListResponseIncludeAccessCountryRule], +// [AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyListResponseIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyListResponseInclude interface { + implementsAccessApplicationPolicyListResponseInclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyListResponseInclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyListResponseIncludeAccessEmailRule struct { + Email AccessApplicationPolicyListResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyListResponseIncludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessEmailRule] +type accessApplicationPolicyListResponseIncludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessEmailRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyListResponseIncludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessEmailRuleEmail] +type accessApplicationPolicyListResponseIncludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyListResponseIncludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyListResponseIncludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessEmailListRule] +type accessApplicationPolicyListResponseIncludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessEmailListRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailList] +type accessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyListResponseIncludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyListResponseIncludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessDomainRule] +type accessApplicationPolicyListResponseIncludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessDomainRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyListResponseIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyListResponseIncludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessEveryoneRule] +type accessApplicationPolicyListResponseIncludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessEveryoneRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyListResponseIncludeAccessIPRule struct { + IP AccessApplicationPolicyListResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyListResponseIncludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyListResponseIncludeAccessIPRule] +type accessApplicationPolicyListResponseIncludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessIPRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyListResponseIncludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessIPRuleIP] +type accessApplicationPolicyListResponseIncludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyListResponseIncludeAccessIPListRule struct { + IPList AccessApplicationPolicyListResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyListResponseIncludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessIPListRule] +type accessApplicationPolicyListResponseIncludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessIPListRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseIncludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessIPListRuleIPList] +type accessApplicationPolicyListResponseIncludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyListResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyListResponseIncludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessCertificateRule] +type accessApplicationPolicyListResponseIncludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessCertificateRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyListResponseIncludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAccessGroupRule] +type accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyListResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAzureGroupRule] +type accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRule] +type accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRule] +type accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyListResponseIncludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessOktaGroupRule] +type accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyListResponseIncludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessSamlGroupRule] +type accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyListResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessServiceTokenRule] +type accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRule] +type accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyListResponseIncludeAccessCountryRule struct { + Geo AccessApplicationPolicyListResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyListResponseIncludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessCountryRule] +type accessApplicationPolicyListResponseIncludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessCountryRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyListResponseIncludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessCountryRuleGeo] +type accessApplicationPolicyListResponseIncludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRule] +type accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyListResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessDevicePostureRule] +type accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyListResponseInclude() { +} + +type AccessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyListResponseRequireAccessEmailRule], +// [AccessApplicationPolicyListResponseRequireAccessEmailListRule], +// [AccessApplicationPolicyListResponseRequireAccessDomainRule], +// [AccessApplicationPolicyListResponseRequireAccessEveryoneRule], +// [AccessApplicationPolicyListResponseRequireAccessIPRule], +// [AccessApplicationPolicyListResponseRequireAccessIPListRule], +// [AccessApplicationPolicyListResponseRequireAccessCertificateRule], +// [AccessApplicationPolicyListResponseRequireAccessAccessGroupRule], +// [AccessApplicationPolicyListResponseRequireAccessAzureGroupRule], +// [AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyListResponseRequireAccessOktaGroupRule], +// [AccessApplicationPolicyListResponseRequireAccessSamlGroupRule], +// [AccessApplicationPolicyListResponseRequireAccessServiceTokenRule], +// [AccessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyListResponseRequireAccessCountryRule], +// [AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyListResponseRequireAccessDevicePostureRule]. +type AccessApplicationPolicyListResponseRequire interface { + implementsAccessApplicationPolicyListResponseRequire() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyListResponseRequire)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyListResponseRequireAccessEmailRule struct { + Email AccessApplicationPolicyListResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyListResponseRequireAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessEmailRule] +type accessApplicationPolicyListResponseRequireAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessEmailRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyListResponseRequireAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessEmailRuleEmail] +type accessApplicationPolicyListResponseRequireAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyListResponseRequireAccessEmailListRule struct { + EmailList AccessApplicationPolicyListResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyListResponseRequireAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessEmailListRule] +type accessApplicationPolicyListResponseRequireAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessEmailListRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessEmailListRuleEmailList] +type accessApplicationPolicyListResponseRequireAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyListResponseRequireAccessDomainRule struct { + EmailDomain AccessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyListResponseRequireAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessDomainRule] +type accessApplicationPolicyListResponseRequireAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessDomainRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomain] +type accessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyListResponseRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyListResponseRequireAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessEveryoneRule] +type accessApplicationPolicyListResponseRequireAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessEveryoneRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyListResponseRequireAccessIPRule struct { + IP AccessApplicationPolicyListResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyListResponseRequireAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyListResponseRequireAccessIPRule] +type accessApplicationPolicyListResponseRequireAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessIPRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyListResponseRequireAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessIPRuleIP] +type accessApplicationPolicyListResponseRequireAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyListResponseRequireAccessIPListRule struct { + IPList AccessApplicationPolicyListResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyListResponseRequireAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessIPListRule] +type accessApplicationPolicyListResponseRequireAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessIPListRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseRequireAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessIPListRuleIPList] +type accessApplicationPolicyListResponseRequireAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyListResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyListResponseRequireAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessCertificateRule] +type accessApplicationPolicyListResponseRequireAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessCertificateRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyListResponseRequireAccessAccessGroupRule struct { + Group AccessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyListResponseRequireAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAccessGroupRule] +type accessApplicationPolicyListResponseRequireAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessAccessGroupRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroup] +type accessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyListResponseRequireAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyListResponseRequireAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAzureGroupRule] +type accessApplicationPolicyListResponseRequireAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessAzureGroupRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRule] +type accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRule] +type accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyListResponseRequireAccessOktaGroupRule struct { + Okta AccessApplicationPolicyListResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyListResponseRequireAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessOktaGroupRule] +type accessApplicationPolicyListResponseRequireAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessOktaGroupRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyListResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessOktaGroupRuleOkta] +type accessApplicationPolicyListResponseRequireAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyListResponseRequireAccessSamlGroupRule struct { + Saml AccessApplicationPolicyListResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyListResponseRequireAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessSamlGroupRule] +type accessApplicationPolicyListResponseRequireAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessSamlGroupRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyListResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessSamlGroupRuleSaml] +type accessApplicationPolicyListResponseRequireAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyListResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyListResponseRequireAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessServiceTokenRule] +type accessApplicationPolicyListResponseRequireAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessServiceTokenRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRule] +type accessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRule] +type accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyListResponseRequireAccessCountryRule struct { + Geo AccessApplicationPolicyListResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyListResponseRequireAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessCountryRule] +type accessApplicationPolicyListResponseRequireAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessCountryRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyListResponseRequireAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessCountryRuleGeo] +type accessApplicationPolicyListResponseRequireAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRule] +type accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyListResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyListResponseRequireAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessDevicePostureRule] +type accessApplicationPolicyListResponseRequireAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyListResponseRequireAccessDevicePostureRule) implementsAccessApplicationPolicyListResponseRequire() { +} + +type AccessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyDeleteResponse struct { + // UUID + ID string `json:"id"` + JSON accessApplicationPolicyDeleteResponseJSON `json:"-"` +} + +// accessApplicationPolicyDeleteResponseJSON contains the JSON metadata for the +// struct [AccessApplicationPolicyDeleteResponse] +type accessApplicationPolicyDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyGetResponse struct { + // UUID + ID string `json:"id"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups []AccessApplicationPolicyGetResponseApprovalGroup `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired bool `json:"approval_required"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The action Access will take if a user matches this policy. + Decision AccessApplicationPolicyGetResponseDecision `json:"decision"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude []AccessApplicationPolicyGetResponseExclude `json:"exclude"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include []AccessApplicationPolicyGetResponseInclude `json:"include"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired bool `json:"isolation_required"` + // The name of the Access policy. + Name string `json:"name"` + // The order of execution for this policy. Must be unique for each policy. + Precedence int64 `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt string `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired bool `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require []AccessApplicationPolicyGetResponseRequire `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration string `json:"session_duration"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationPolicyGetResponseJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseJSON contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponse] +type accessApplicationPolicyGetResponseJSON struct { + ID apijson.Field + ApprovalGroups apijson.Field + ApprovalRequired apijson.Field + CreatedAt apijson.Field + Decision apijson.Field + Exclude apijson.Field + Include apijson.Field + IsolationRequired apijson.Field + Name apijson.Field + Precedence apijson.Field + PurposeJustificationPrompt apijson.Field + PurposeJustificationRequired apijson.Field + Require apijson.Field + SessionDuration apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyGetResponseApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded float64 `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses []interface{} `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid string `json:"email_list_uuid"` + JSON accessApplicationPolicyGetResponseApprovalGroupJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseApprovalGroupJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyGetResponseApprovalGroup] +type accessApplicationPolicyGetResponseApprovalGroupJSON struct { + ApprovalsNeeded apijson.Field + EmailAddresses apijson.Field + EmailListUuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyGetResponseDecision string + +const ( + AccessApplicationPolicyGetResponseDecisionAllow AccessApplicationPolicyGetResponseDecision = "allow" + AccessApplicationPolicyGetResponseDecisionDeny AccessApplicationPolicyGetResponseDecision = "deny" + AccessApplicationPolicyGetResponseDecisionNonIdentity AccessApplicationPolicyGetResponseDecision = "non_identity" + AccessApplicationPolicyGetResponseDecisionBypass AccessApplicationPolicyGetResponseDecision = "bypass" +) + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyGetResponseExcludeAccessEmailRule], +// [AccessApplicationPolicyGetResponseExcludeAccessEmailListRule], +// [AccessApplicationPolicyGetResponseExcludeAccessDomainRule], +// [AccessApplicationPolicyGetResponseExcludeAccessEveryoneRule], +// [AccessApplicationPolicyGetResponseExcludeAccessIPRule], +// [AccessApplicationPolicyGetResponseExcludeAccessIPListRule], +// [AccessApplicationPolicyGetResponseExcludeAccessCertificateRule], +// [AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyGetResponseExcludeAccessCountryRule], +// [AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyGetResponseExclude interface { + implementsAccessApplicationPolicyGetResponseExclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyGetResponseExclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyGetResponseExcludeAccessEmailRule struct { + Email AccessApplicationPolicyGetResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessEmailRule] +type accessApplicationPolicyGetResponseExcludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessEmailRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyGetResponseExcludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessEmailRuleEmail] +type accessApplicationPolicyGetResponseExcludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyGetResponseExcludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessEmailListRule] +type accessApplicationPolicyGetResponseExcludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessEmailListRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailList] +type accessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyGetResponseExcludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessDomainRule] +type accessApplicationPolicyGetResponseExcludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessDomainRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyGetResponseExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessEveryoneRule] +type accessApplicationPolicyGetResponseExcludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessEveryoneRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyGetResponseExcludeAccessIPRule struct { + IP AccessApplicationPolicyGetResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyGetResponseExcludeAccessIPRule] +type accessApplicationPolicyGetResponseExcludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessIPRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessIPRuleIP] +type accessApplicationPolicyGetResponseExcludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyGetResponseExcludeAccessIPListRule struct { + IPList AccessApplicationPolicyGetResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessIPListRule] +type accessApplicationPolicyGetResponseExcludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessIPListRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessIPListRuleIPList] +type accessApplicationPolicyGetResponseExcludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyGetResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessCertificateRule] +type accessApplicationPolicyGetResponseExcludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessCertificateRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRule] +type accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRule] +type accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRule] +type accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRule] +type accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRule] +type accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRule] +type accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRule] +type accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRule] +type accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyGetResponseExcludeAccessCountryRule struct { + Geo AccessApplicationPolicyGetResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessCountryRule] +type accessApplicationPolicyGetResponseExcludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessCountryRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessCountryRuleGeo] +type accessApplicationPolicyGetResponseExcludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRule] +type accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRule] +type accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyGetResponseExclude() { +} + +type AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyGetResponseIncludeAccessEmailRule], +// [AccessApplicationPolicyGetResponseIncludeAccessEmailListRule], +// [AccessApplicationPolicyGetResponseIncludeAccessDomainRule], +// [AccessApplicationPolicyGetResponseIncludeAccessEveryoneRule], +// [AccessApplicationPolicyGetResponseIncludeAccessIPRule], +// [AccessApplicationPolicyGetResponseIncludeAccessIPListRule], +// [AccessApplicationPolicyGetResponseIncludeAccessCertificateRule], +// [AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyGetResponseIncludeAccessCountryRule], +// [AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyGetResponseInclude interface { + implementsAccessApplicationPolicyGetResponseInclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyGetResponseInclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyGetResponseIncludeAccessEmailRule struct { + Email AccessApplicationPolicyGetResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessEmailRule] +type accessApplicationPolicyGetResponseIncludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessEmailRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyGetResponseIncludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessEmailRuleEmail] +type accessApplicationPolicyGetResponseIncludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyGetResponseIncludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessEmailListRule] +type accessApplicationPolicyGetResponseIncludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessEmailListRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailList] +type accessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyGetResponseIncludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessDomainRule] +type accessApplicationPolicyGetResponseIncludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessDomainRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyGetResponseIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessEveryoneRule] +type accessApplicationPolicyGetResponseIncludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessEveryoneRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyGetResponseIncludeAccessIPRule struct { + IP AccessApplicationPolicyGetResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyGetResponseIncludeAccessIPRule] +type accessApplicationPolicyGetResponseIncludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessIPRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessIPRuleIP] +type accessApplicationPolicyGetResponseIncludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyGetResponseIncludeAccessIPListRule struct { + IPList AccessApplicationPolicyGetResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessIPListRule] +type accessApplicationPolicyGetResponseIncludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessIPListRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessIPListRuleIPList] +type accessApplicationPolicyGetResponseIncludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyGetResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessCertificateRule] +type accessApplicationPolicyGetResponseIncludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessCertificateRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRule] +type accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRule] +type accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRule] +type accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRule] +type accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRule] +type accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRule] +type accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRule] +type accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRule] +type accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyGetResponseIncludeAccessCountryRule struct { + Geo AccessApplicationPolicyGetResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessCountryRule] +type accessApplicationPolicyGetResponseIncludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessCountryRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessCountryRuleGeo] +type accessApplicationPolicyGetResponseIncludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRule] +type accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRule] +type accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyGetResponseInclude() { +} + +type AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessApplicationPolicyGetResponseRequireAccessEmailRule], +// [AccessApplicationPolicyGetResponseRequireAccessEmailListRule], +// [AccessApplicationPolicyGetResponseRequireAccessDomainRule], +// [AccessApplicationPolicyGetResponseRequireAccessEveryoneRule], +// [AccessApplicationPolicyGetResponseRequireAccessIPRule], +// [AccessApplicationPolicyGetResponseRequireAccessIPListRule], +// [AccessApplicationPolicyGetResponseRequireAccessCertificateRule], +// [AccessApplicationPolicyGetResponseRequireAccessAccessGroupRule], +// [AccessApplicationPolicyGetResponseRequireAccessAzureGroupRule], +// [AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyGetResponseRequireAccessOktaGroupRule], +// [AccessApplicationPolicyGetResponseRequireAccessSamlGroupRule], +// [AccessApplicationPolicyGetResponseRequireAccessServiceTokenRule], +// [AccessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyGetResponseRequireAccessCountryRule], +// [AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyGetResponseRequireAccessDevicePostureRule]. +type AccessApplicationPolicyGetResponseRequire interface { + implementsAccessApplicationPolicyGetResponseRequire() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyGetResponseRequire)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyGetResponseRequireAccessEmailRule struct { + Email AccessApplicationPolicyGetResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyGetResponseRequireAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessEmailRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessEmailRule] +type accessApplicationPolicyGetResponseRequireAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessEmailRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyGetResponseRequireAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessEmailRuleEmailJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessEmailRuleEmail] +type accessApplicationPolicyGetResponseRequireAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyGetResponseRequireAccessEmailListRule struct { + EmailList AccessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyGetResponseRequireAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessEmailListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessEmailListRule] +type accessApplicationPolicyGetResponseRequireAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessEmailListRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailList] +type accessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyGetResponseRequireAccessDomainRule struct { + EmailDomain AccessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyGetResponseRequireAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessDomainRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessDomainRule] +type accessApplicationPolicyGetResponseRequireAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessDomainRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomain] +type accessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyGetResponseRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyGetResponseRequireAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessEveryoneRule] +type accessApplicationPolicyGetResponseRequireAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessEveryoneRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyGetResponseRequireAccessIPRule struct { + IP AccessApplicationPolicyGetResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyGetResponseRequireAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessIPRuleJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyGetResponseRequireAccessIPRule] +type accessApplicationPolicyGetResponseRequireAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessIPRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyGetResponseRequireAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessIPRuleIPJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessIPRuleIP] +type accessApplicationPolicyGetResponseRequireAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyGetResponseRequireAccessIPListRule struct { + IPList AccessApplicationPolicyGetResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyGetResponseRequireAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessIPListRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessIPListRule] +type accessApplicationPolicyGetResponseRequireAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessIPListRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseRequireAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessIPListRuleIPListJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessIPListRuleIPList] +type accessApplicationPolicyGetResponseRequireAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyGetResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyGetResponseRequireAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessCertificateRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessCertificateRule] +type accessApplicationPolicyGetResponseRequireAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessCertificateRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyGetResponseRequireAccessAccessGroupRule struct { + Group AccessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAccessGroupRule] +type accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessAccessGroupRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroup] +type accessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyGetResponseRequireAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAzureGroupRule] +type accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessAzureGroupRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRule] +type accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRule] +type accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyGetResponseRequireAccessOktaGroupRule struct { + Okta AccessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessOktaGroupRule] +type accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessOktaGroupRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOkta] +type accessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyGetResponseRequireAccessSamlGroupRule struct { + Saml AccessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessSamlGroupRule] +type accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessSamlGroupRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSaml] +type accessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyGetResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessServiceTokenRule] +type accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessServiceTokenRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRule] +type accessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRule] +type accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyGetResponseRequireAccessCountryRule struct { + Geo AccessApplicationPolicyGetResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyGetResponseRequireAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessCountryRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessCountryRule] +type accessApplicationPolicyGetResponseRequireAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessCountryRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyGetResponseRequireAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessCountryRuleGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessCountryRuleGeo] +type accessApplicationPolicyGetResponseRequireAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRule] +type accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyGetResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessDevicePostureRule] +type accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyGetResponseRequireAccessDevicePostureRule) implementsAccessApplicationPolicyGetResponseRequire() { +} + +type AccessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyReplaceResponse struct { + // UUID + ID string `json:"id"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups []AccessApplicationPolicyReplaceResponseApprovalGroup `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired bool `json:"approval_required"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The action Access will take if a user matches this policy. + Decision AccessApplicationPolicyReplaceResponseDecision `json:"decision"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude []AccessApplicationPolicyReplaceResponseExclude `json:"exclude"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include []AccessApplicationPolicyReplaceResponseInclude `json:"include"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired bool `json:"isolation_required"` + // The name of the Access policy. + Name string `json:"name"` + // The order of execution for this policy. Must be unique for each policy. + Precedence int64 `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt string `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired bool `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require []AccessApplicationPolicyReplaceResponseRequire `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration string `json:"session_duration"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessApplicationPolicyReplaceResponseJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseJSON contains the JSON metadata for the +// struct [AccessApplicationPolicyReplaceResponse] +type accessApplicationPolicyReplaceResponseJSON struct { + ID apijson.Field + ApprovalGroups apijson.Field + ApprovalRequired apijson.Field + CreatedAt apijson.Field + Decision apijson.Field + Exclude apijson.Field + Include apijson.Field + IsolationRequired apijson.Field + Name apijson.Field + Precedence apijson.Field + PurposeJustificationPrompt apijson.Field + PurposeJustificationRequired apijson.Field + Require apijson.Field + SessionDuration apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyReplaceResponseApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded float64 `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses []interface{} `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid string `json:"email_list_uuid"` + JSON accessApplicationPolicyReplaceResponseApprovalGroupJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseApprovalGroupJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyReplaceResponseApprovalGroup] +type accessApplicationPolicyReplaceResponseApprovalGroupJSON struct { + ApprovalsNeeded apijson.Field + EmailAddresses apijson.Field + EmailListUuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyReplaceResponseDecision string + +const ( + AccessApplicationPolicyReplaceResponseDecisionAllow AccessApplicationPolicyReplaceResponseDecision = "allow" + AccessApplicationPolicyReplaceResponseDecisionDeny AccessApplicationPolicyReplaceResponseDecision = "deny" + AccessApplicationPolicyReplaceResponseDecisionNonIdentity AccessApplicationPolicyReplaceResponseDecision = "non_identity" + AccessApplicationPolicyReplaceResponseDecisionBypass AccessApplicationPolicyReplaceResponseDecision = "bypass" +) + +// Matches a specific email. +// +// Union satisfied by +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessDomainRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessEveryoneRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPListRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessCertificateRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessCountryRule], +// [AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceResponseExclude interface { + implementsAccessApplicationPolicyReplaceResponseExclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyReplaceResponseExclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceResponseExcludeAccessEmailRule struct { + Email AccessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailRule] +type accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessEmailRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmailJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmail] +type accessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRule] +type accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailList] +type accessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceResponseExcludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessDomainRule] +type accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessDomainRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceResponseExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessEveryoneRule] +type accessApplicationPolicyReplaceResponseExcludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessEveryoneRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceResponseExcludeAccessIPRule struct { + IP AccessApplicationPolicyReplaceResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessIPRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPRule] +type accessApplicationPolicyReplaceResponseExcludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessIPRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessIPRuleIPJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPRuleIP] +type accessApplicationPolicyReplaceResponseExcludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceResponseExcludeAccessIPListRule struct { + IPList AccessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPListRule] +type accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessIPListRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPList] +type accessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessCertificateRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessCertificateRule] +type accessApplicationPolicyReplaceResponseExcludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessCertificateRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRule] +type accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRule] +type accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRule] +type accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRule] +type accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRule] +type accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOktaJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRule] +type accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSamlJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRule] +type accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRule] +type accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceResponseExcludeAccessCountryRule struct { + Geo AccessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessCountryRule] +type accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessCountryRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeoJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeo] +type accessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRule] +type accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRule] +type accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceResponseExclude() { +} + +type AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessDomainRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessEveryoneRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPListRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessCertificateRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessCountryRule], +// [AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceResponseInclude interface { + implementsAccessApplicationPolicyReplaceResponseInclude() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyReplaceResponseInclude)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceResponseIncludeAccessEmailRule struct { + Email AccessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailRule] +type accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessEmailRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmailJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmail] +type accessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRule struct { + EmailList AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRule] +type accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailList] +type accessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceResponseIncludeAccessDomainRule struct { + EmailDomain AccessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessDomainRule] +type accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessDomainRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomain] +type accessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceResponseIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessEveryoneRule] +type accessApplicationPolicyReplaceResponseIncludeAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessEveryoneRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceResponseIncludeAccessIPRule struct { + IP AccessApplicationPolicyReplaceResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessIPRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPRule] +type accessApplicationPolicyReplaceResponseIncludeAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessIPRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessIPRuleIPJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPRuleIP] +type accessApplicationPolicyReplaceResponseIncludeAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceResponseIncludeAccessIPListRule struct { + IPList AccessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPListRule] +type accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessIPListRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPList] +type accessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessCertificateRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessCertificateRule] +type accessApplicationPolicyReplaceResponseIncludeAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessCertificateRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRule struct { + Group AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRule] +type accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroup] +type accessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRule] +type accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRule] +type accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRule] +type accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRule struct { + Okta AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRule] +type accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOktaJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOkta] +type accessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRule struct { + Saml AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRule] +type accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSamlJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSaml] +type accessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRule] +type accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRule] +type accessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRule] +type accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceResponseIncludeAccessCountryRule struct { + Geo AccessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessCountryRule] +type accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessCountryRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeoJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeo] +type accessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRule] +type accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRule] +type accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceResponseInclude() { +} + +type AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailListRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessDomainRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessEveryoneRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessIPRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessIPListRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessCertificateRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessCountryRule], +// [AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRule] or +// [AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceResponseRequire interface { + implementsAccessApplicationPolicyReplaceResponseRequire() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessApplicationPolicyReplaceResponseRequire)(nil)).Elem(), "") +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceResponseRequireAccessEmailRule struct { + Email AccessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessEmailRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessEmailRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailRule] +type accessApplicationPolicyReplaceResponseRequireAccessEmailRuleJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessEmailRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmail struct { + // The email of the user. + Email string `json:"email,required" format:"email"` + JSON accessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmailJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmailJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmail] +type accessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmailJSON struct { + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceResponseRequireAccessEmailListRule struct { + EmailList AccessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailListRule] +type accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleJSON struct { + EmailList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessEmailListRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailListJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailList] +type accessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceResponseRequireAccessDomainRule struct { + EmailDomain AccessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessDomainRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessDomainRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessDomainRule] +type accessApplicationPolicyReplaceResponseRequireAccessDomainRuleJSON struct { + EmailDomain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessDomainRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain string `json:"domain,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomainJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomain] +type accessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomainJSON struct { + Domain apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceResponseRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone interface{} `json:"everyone,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessEveryoneRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessEveryoneRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessEveryoneRule] +type accessApplicationPolicyReplaceResponseRequireAccessEveryoneRuleJSON struct { + Everyone apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessEveryoneRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceResponseRequireAccessIPRule struct { + IP AccessApplicationPolicyReplaceResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessIPRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessIPRuleJSON contains the JSON +// metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessIPRule] +type accessApplicationPolicyReplaceResponseRequireAccessIPRuleJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessIPRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP string `json:"ip,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessIPRuleIPJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessIPRuleIPJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessIPRuleIP] +type accessApplicationPolicyReplaceResponseRequireAccessIPRuleIPJSON struct { + IP apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceResponseRequireAccessIPListRule struct { + IPList AccessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessIPListRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessIPListRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessIPListRule] +type accessApplicationPolicyReplaceResponseRequireAccessIPListRuleJSON struct { + IPList apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessIPListRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPListJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPListJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPList] +type accessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPListJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessCertificateRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessCertificateRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessCertificateRule] +type accessApplicationPolicyReplaceResponseRequireAccessCertificateRuleJSON struct { + Certificate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessCertificateRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRule struct { + Group AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRule] +type accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleJSON struct { + Group apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID string `json:"id,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroupJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroup] +type accessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroupJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRule struct { + AzureAd AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRule] +type accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleJSON struct { + AzureAd apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID string `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID string `json:"connection_id,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAd] +type accessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON struct { + ID apijson.Field + ConnectionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRule] +type accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleJSON struct { + GitHubOrganization apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID string `json:"connection_id,required"` + // The name of the organization. + Name string `json:"name,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { + ConnectionID apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRule] +type accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleJSON struct { + Gsuite apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Google Workspace group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuite] +type accessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRule struct { + Okta AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRule] +type accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleJSON struct { + Okta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID string `json:"connection_id,required"` + // The email of the Okta group. + Email string `json:"email,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOktaJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOkta] +type accessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOktaJSON struct { + ConnectionID apijson.Field + Email apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRule struct { + Saml AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRule] +type accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleJSON struct { + Saml apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName string `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue string `json:"attribute_value,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSamlJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSaml] +type accessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field + AttributeValue apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRule] +type accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleJSON struct { + ServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID string `json:"token_id,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceToken] +type accessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { + TokenID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRule] +type accessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON struct { + AnyValidServiceToken apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRule] +type accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleJSON struct { + ExternalEvaluation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL string `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL string `json:"keys_url,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { + EvaluateURL apijson.Field + KeysURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceResponseRequireAccessCountryRule struct { + Geo AccessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessCountryRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessCountryRuleJSON contains the +// JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessCountryRule] +type accessApplicationPolicyReplaceResponseRequireAccessCountryRuleJSON struct { + Geo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessCountryRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode string `json:"country_code,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeoJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeoJSON contains +// the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeo] +type accessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeoJSON struct { + CountryCode apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRule] +type accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod string `json:"auth_method,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { + AuthMethod apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRule] +type accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleJSON struct { + DevicePosture apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceResponseRequire() { +} + +type AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePosture] +type accessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyNewParams struct { + // The action Access will take if a user matches this policy. + Decision param.Field[AccessApplicationPolicyNewParamsDecision] `json:"decision,required"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include param.Field[[]AccessApplicationPolicyNewParamsInclude] `json:"include,required"` + // The name of the Access policy. + Name param.Field[string] `json:"name,required"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups param.Field[[]AccessApplicationPolicyNewParamsApprovalGroup] `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired param.Field[bool] `json:"approval_required"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude param.Field[[]AccessApplicationPolicyNewParamsExclude] `json:"exclude"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired param.Field[bool] `json:"isolation_required"` + // The order of execution for this policy. Must be unique for each policy. + Precedence param.Field[int64] `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require param.Field[[]AccessApplicationPolicyNewParamsRequire] `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration param.Field[string] `json:"session_duration"` +} + +func (r AccessApplicationPolicyNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyNewParamsDecision string + +const ( + AccessApplicationPolicyNewParamsDecisionAllow AccessApplicationPolicyNewParamsDecision = "allow" + AccessApplicationPolicyNewParamsDecisionDeny AccessApplicationPolicyNewParamsDecision = "deny" + AccessApplicationPolicyNewParamsDecisionNonIdentity AccessApplicationPolicyNewParamsDecision = "non_identity" + AccessApplicationPolicyNewParamsDecisionBypass AccessApplicationPolicyNewParamsDecision = "bypass" +) + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyNewParamsIncludeAccessEmailRule], +// [AccessApplicationPolicyNewParamsIncludeAccessEmailListRule], +// [AccessApplicationPolicyNewParamsIncludeAccessDomainRule], +// [AccessApplicationPolicyNewParamsIncludeAccessEveryoneRule], +// [AccessApplicationPolicyNewParamsIncludeAccessIPRule], +// [AccessApplicationPolicyNewParamsIncludeAccessIPListRule], +// [AccessApplicationPolicyNewParamsIncludeAccessCertificateRule], +// [AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyNewParamsIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewParamsIncludeAccessCountryRule], +// [AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRule], +// [AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyNewParamsInclude interface { + implementsAccessApplicationPolicyNewParamsInclude() +} + +// Matches a specific email. +type AccessApplicationPolicyNewParamsIncludeAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewParamsIncludeAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyNewParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailListRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewParamsIncludeAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyNewParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDomainRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyNewParamsIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessEveryoneRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewParamsIncludeAccessIPRule struct { + IP param.Field[AccessApplicationPolicyNewParamsIncludeAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewParamsIncludeAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyNewParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPListRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewParamsIncludeAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessCertificateRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewParamsIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyNewParamsIncludeAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyNewParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessCountryRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyNewParamsInclude() { +} + +type AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyNewParamsApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses param.Field[[]interface{}] `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid param.Field[string] `json:"email_list_uuid"` +} + +func (r AccessApplicationPolicyNewParamsApprovalGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyNewParamsExcludeAccessEmailRule], +// [AccessApplicationPolicyNewParamsExcludeAccessEmailListRule], +// [AccessApplicationPolicyNewParamsExcludeAccessDomainRule], +// [AccessApplicationPolicyNewParamsExcludeAccessEveryoneRule], +// [AccessApplicationPolicyNewParamsExcludeAccessIPRule], +// [AccessApplicationPolicyNewParamsExcludeAccessIPListRule], +// [AccessApplicationPolicyNewParamsExcludeAccessCertificateRule], +// [AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyNewParamsExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewParamsExcludeAccessCountryRule], +// [AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRule], +// [AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyNewParamsExclude interface { + implementsAccessApplicationPolicyNewParamsExclude() +} + +// Matches a specific email. +type AccessApplicationPolicyNewParamsExcludeAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewParamsExcludeAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyNewParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailListRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewParamsExcludeAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyNewParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDomainRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyNewParamsExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessEveryoneRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewParamsExcludeAccessIPRule struct { + IP param.Field[AccessApplicationPolicyNewParamsExcludeAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewParamsExcludeAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyNewParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPListRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewParamsExcludeAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessCertificateRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewParamsExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyNewParamsExcludeAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyNewParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessCountryRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyNewParamsExclude() { +} + +type AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyNewParamsRequireAccessEmailRule], +// [AccessApplicationPolicyNewParamsRequireAccessEmailListRule], +// [AccessApplicationPolicyNewParamsRequireAccessDomainRule], +// [AccessApplicationPolicyNewParamsRequireAccessEveryoneRule], +// [AccessApplicationPolicyNewParamsRequireAccessIPRule], +// [AccessApplicationPolicyNewParamsRequireAccessIPListRule], +// [AccessApplicationPolicyNewParamsRequireAccessCertificateRule], +// [AccessApplicationPolicyNewParamsRequireAccessAccessGroupRule], +// [AccessApplicationPolicyNewParamsRequireAccessAzureGroupRule], +// [AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyNewParamsRequireAccessOktaGroupRule], +// [AccessApplicationPolicyNewParamsRequireAccessSamlGroupRule], +// [AccessApplicationPolicyNewParamsRequireAccessServiceTokenRule], +// [AccessApplicationPolicyNewParamsRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyNewParamsRequireAccessCountryRule], +// [AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRule], +// [AccessApplicationPolicyNewParamsRequireAccessDevicePostureRule]. +type AccessApplicationPolicyNewParamsRequire interface { + implementsAccessApplicationPolicyNewParamsRequire() +} + +// Matches a specific email. +type AccessApplicationPolicyNewParamsRequireAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyNewParamsRequireAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyNewParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailListRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyNewParamsRequireAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyNewParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDomainRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyNewParamsRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessEveryoneRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyNewParamsRequireAccessIPRule struct { + IP param.Field[AccessApplicationPolicyNewParamsRequireAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyNewParamsRequireAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyNewParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPListRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyNewParamsRequireAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessCertificateRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyNewParamsRequireAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyNewParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAccessGroupRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyNewParamsRequireAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyNewParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAzureGroupRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyNewParamsRequireAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyNewParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessOktaGroupRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyNewParamsRequireAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyNewParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessSamlGroupRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyNewParamsRequireAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyNewParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessServiceTokenRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyNewParamsRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyNewParamsRequireAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyNewParamsRequireAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessCountryRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyNewParamsRequireAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDevicePostureRule) implementsAccessApplicationPolicyNewParamsRequire() { +} + +type AccessApplicationPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessApplicationPolicyNewResponseEnvelope struct { + Errors []AccessApplicationPolicyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationPolicyNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationPolicyNewResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationPolicyNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationPolicyNewResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessApplicationPolicyNewResponseEnvelope] +type accessApplicationPolicyNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyNewResponseEnvelopeErrors] +type accessApplicationPolicyNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationPolicyNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyNewResponseEnvelopeMessages] +type accessApplicationPolicyNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationPolicyNewResponseEnvelopeSuccess bool + +const ( + AccessApplicationPolicyNewResponseEnvelopeSuccessTrue AccessApplicationPolicyNewResponseEnvelopeSuccess = true +) + +type AccessApplicationPolicyListResponseEnvelope struct { + Errors []AccessApplicationPolicyListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationPolicyListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessApplicationPolicyListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AccessApplicationPolicyListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessApplicationPolicyListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessApplicationPolicyListResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationPolicyListResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessApplicationPolicyListResponseEnvelope] +type accessApplicationPolicyListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyListResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationPolicyListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyListResponseEnvelopeErrors] +type accessApplicationPolicyListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyListResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationPolicyListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyListResponseEnvelopeMessages] +type accessApplicationPolicyListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationPolicyListResponseEnvelopeSuccess bool + +const ( + AccessApplicationPolicyListResponseEnvelopeSuccessTrue AccessApplicationPolicyListResponseEnvelopeSuccess = true +) + +type AccessApplicationPolicyListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessApplicationPolicyListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessApplicationPolicyListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyListResponseEnvelopeResultInfo] +type accessApplicationPolicyListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyDeleteResponseEnvelope struct { + Errors []AccessApplicationPolicyDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationPolicyDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationPolicyDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationPolicyDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationPolicyDeleteResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationPolicyDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessApplicationPolicyDeleteResponseEnvelope] +type accessApplicationPolicyDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationPolicyDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyDeleteResponseEnvelopeErrors] +type accessApplicationPolicyDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationPolicyDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyDeleteResponseEnvelopeMessages] +type accessApplicationPolicyDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationPolicyDeleteResponseEnvelopeSuccess bool + +const ( + AccessApplicationPolicyDeleteResponseEnvelopeSuccessTrue AccessApplicationPolicyDeleteResponseEnvelopeSuccess = true +) + +type AccessApplicationPolicyGetResponseEnvelope struct { + Errors []AccessApplicationPolicyGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationPolicyGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationPolicyGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationPolicyGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationPolicyGetResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessApplicationPolicyGetResponseEnvelope] +type accessApplicationPolicyGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyGetResponseEnvelopeErrors] +type accessApplicationPolicyGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationPolicyGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyGetResponseEnvelopeMessages] +type accessApplicationPolicyGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationPolicyGetResponseEnvelopeSuccess bool + +const ( + AccessApplicationPolicyGetResponseEnvelopeSuccessTrue AccessApplicationPolicyGetResponseEnvelopeSuccess = true +) + +type AccessApplicationPolicyReplaceParams struct { + // The action Access will take if a user matches this policy. + Decision param.Field[AccessApplicationPolicyReplaceParamsDecision] `json:"decision,required"` + // Rules evaluated with an OR logical operator. A user needs to meet only one of + // the Include rules. + Include param.Field[[]AccessApplicationPolicyReplaceParamsInclude] `json:"include,required"` + // The name of the Access policy. + Name param.Field[string] `json:"name,required"` + // Administrators who can approve a temporary authentication request. + ApprovalGroups param.Field[[]AccessApplicationPolicyReplaceParamsApprovalGroup] `json:"approval_groups"` + // Requires the user to request access from an administrator at the start of each + // session. + ApprovalRequired param.Field[bool] `json:"approval_required"` + // Rules evaluated with a NOT logical operator. To match the policy, a user cannot + // meet any of the Exclude rules. + Exclude param.Field[[]AccessApplicationPolicyReplaceParamsExclude] `json:"exclude"` + // Require this application to be served in an isolated browser for users matching + // this policy. 'Client Web Isolation' must be on for the account in order to use + // this feature. + IsolationRequired param.Field[bool] `json:"isolation_required"` + // The order of execution for this policy. Must be unique for each policy. + Precedence param.Field[int64] `json:"precedence"` + // A custom message that will appear on the purpose justification screen. + PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"` + // Require users to enter a justification when they log in to the application. + PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"` + // Rules evaluated with an AND logical operator. To match the policy, a user must + // meet all of the Require rules. + Require param.Field[[]AccessApplicationPolicyReplaceParamsRequire] `json:"require"` + // The amount of time that tokens issued for the application will be valid. Must be + // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + // m, h. + SessionDuration param.Field[string] `json:"session_duration"` +} + +func (r AccessApplicationPolicyReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The action Access will take if a user matches this policy. +type AccessApplicationPolicyReplaceParamsDecision string + +const ( + AccessApplicationPolicyReplaceParamsDecisionAllow AccessApplicationPolicyReplaceParamsDecision = "allow" + AccessApplicationPolicyReplaceParamsDecisionDeny AccessApplicationPolicyReplaceParamsDecision = "deny" + AccessApplicationPolicyReplaceParamsDecisionNonIdentity AccessApplicationPolicyReplaceParamsDecision = "non_identity" + AccessApplicationPolicyReplaceParamsDecisionBypass AccessApplicationPolicyReplaceParamsDecision = "bypass" +) + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessDomainRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessEveryoneRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessIPRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessIPListRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessCertificateRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessCountryRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRule], +// [AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceParamsInclude interface { + implementsAccessApplicationPolicyReplaceParamsInclude() +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceParamsIncludeAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDomainRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceParamsIncludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessEveryoneRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceParamsIncludeAccessIPRule struct { + IP param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceParamsIncludeAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPListRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceParamsIncludeAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessCertificateRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceParamsIncludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceParamsIncludeAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessCountryRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceParamsInclude() { +} + +type AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyReplaceParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// A group of email addresses that can approve a temporary authentication request. +type AccessApplicationPolicyReplaceParamsApprovalGroup struct { + // The number of approvals needed to obtain access. + ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"` + // A list of emails that can approve the access request. + EmailAddresses param.Field[[]interface{}] `json:"email_addresses"` + // The UUID of an re-usable email list. + EmailListUuid param.Field[string] `json:"email_list_uuid"` +} + +func (r AccessApplicationPolicyReplaceParamsApprovalGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessDomainRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessEveryoneRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessIPRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessIPListRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessCertificateRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessCountryRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRule], +// [AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceParamsExclude interface { + implementsAccessApplicationPolicyReplaceParamsExclude() +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceParamsExcludeAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDomainRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceParamsExcludeAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessEveryoneRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceParamsExcludeAccessIPRule struct { + IP param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceParamsExcludeAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPListRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceParamsExcludeAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessCertificateRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceParamsExcludeAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceParamsExcludeAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessCountryRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceParamsExclude() { +} + +type AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyReplaceParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific email. +// +// Satisfied by [AccessApplicationPolicyReplaceParamsRequireAccessEmailRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessEmailListRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessDomainRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessEveryoneRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessIPRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessIPListRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessCertificateRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessAnyValidServiceTokenRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessCountryRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRule], +// [AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRule]. +type AccessApplicationPolicyReplaceParamsRequire interface { + implementsAccessApplicationPolicyReplaceParamsRequire() +} + +// Matches a specific email. +type AccessApplicationPolicyReplaceParamsRequireAccessEmailRule struct { + Email param.Field[AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail struct { + // The email of the user. + Email param.Field[string] `json:"email,required" format:"email"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an email address from a list. +type AccessApplicationPolicyReplaceParamsRequireAccessEmailListRule struct { + EmailList param.Field[AccessApplicationPolicyReplaceParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailListRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessEmailListRuleEmailList struct { + // The ID of a previously created email list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Match an entire email domain. +type AccessApplicationPolicyReplaceParamsRequireAccessDomainRule struct { + EmailDomain param.Field[AccessApplicationPolicyReplaceParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDomainRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessDomainRuleEmailDomain struct { + // The email domain to match. + Domain param.Field[string] `json:"domain,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches everyone. +type AccessApplicationPolicyReplaceParamsRequireAccessEveryoneRule struct { + // An empty object which matches on all users. + Everyone param.Field[interface{}] `json:"everyone,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessEveryoneRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +// Matches an IP address block. +type AccessApplicationPolicyReplaceParamsRequireAccessIPRule struct { + IP param.Field[AccessApplicationPolicyReplaceParamsRequireAccessIPRuleIP] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessIPRuleIP struct { + // An IPv4 or IPv6 CIDR block. + IP param.Field[string] `json:"ip,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an IP address from a list. +type AccessApplicationPolicyReplaceParamsRequireAccessIPListRule struct { + IPList param.Field[AccessApplicationPolicyReplaceParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPListRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessIPListRuleIPList struct { + // The ID of a previously created IP list. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid client certificate. +type AccessApplicationPolicyReplaceParamsRequireAccessCertificateRule struct { + Certificate param.Field[interface{}] `json:"certificate,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessCertificateRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +// Matches an Access group. +type AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRule struct { + Group param.Field[AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRuleGroup struct { + // The ID of a previously created Access group. + ID param.Field[string] `json:"id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Azure group. Requires an Azure identity provider. +type AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRule struct { + AzureAd param.Field[AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRuleAzureAd struct { + // The ID of an Azure group. + ID param.Field[string] `json:"id,required"` + // The ID of your Azure identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a Github organization. Requires a Github identity provider. +type AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { + // The ID of your Github identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The name of the organization. + Name param.Field[string] `json:"name,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a group in Google Workspace. Requires a Google Workspace identity +// provider. +type AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRuleGsuite struct { + // The ID of your Google Workspace identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Google Workspace group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches an Okta group. Requires an Okta identity provider. +type AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRule struct { + Okta param.Field[AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRuleOkta struct { + // The ID of your Okta identity provider. + ConnectionID param.Field[string] `json:"connection_id,required"` + // The email of the Okta group. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a SAML group. Requires a SAML identity provider. +type AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRule struct { + Saml param.Field[AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRuleSaml struct { + // The name of the SAML attribute. + AttributeName param.Field[string] `json:"attribute_name,required"` + // The SAML attribute value to look for. + AttributeValue param.Field[string] `json:"attribute_value,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific Access Service Token +type AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRule struct { + ServiceToken param.Field[AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRuleServiceToken struct { + // The ID of a Service Token. + TokenID param.Field[string] `json:"token_id,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches any valid Access Service Token +type AccessApplicationPolicyReplaceParamsRequireAccessAnyValidServiceTokenRule struct { + // An empty object which matches on all service tokens. + AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAnyValidServiceTokenRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +// Create Allow or Block policies which evaluate the user based on custom criteria. +type AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { + // The API endpoint containing your business logic. + EvaluateURL param.Field[string] `json:"evaluate_url,required"` + // The API endpoint containing the key that Access uses to verify that the response + // came from your API. + KeysURL param.Field[string] `json:"keys_url,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Matches a specific country +type AccessApplicationPolicyReplaceParamsRequireAccessCountryRule struct { + Geo param.Field[AccessApplicationPolicyReplaceParamsRequireAccessCountryRuleGeo] `json:"geo,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessCountryRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessCountryRuleGeo struct { + // The country code that should be matched. + CountryCode param.Field[string] `json:"country_code,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforce different MFA options +type AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { + // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + AuthMethod param.Field[string] `json:"auth_method,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enforces a device posture rule has run successfully +type AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRule struct { + DevicePosture param.Field[AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRule) implementsAccessApplicationPolicyReplaceParamsRequire() { +} + +type AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessApplicationPolicyReplaceParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessApplicationPolicyReplaceResponseEnvelope struct { + Errors []AccessApplicationPolicyReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationPolicyReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationPolicyReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationPolicyReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationPolicyReplaceResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [AccessApplicationPolicyReplaceResponseEnvelope] +type accessApplicationPolicyReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyReplaceResponseEnvelopeErrors] +type accessApplicationPolicyReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationPolicyReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationPolicyReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationPolicyReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessApplicationPolicyReplaceResponseEnvelopeMessages] +type accessApplicationPolicyReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationPolicyReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationPolicyReplaceResponseEnvelopeSuccess bool + +const ( + AccessApplicationPolicyReplaceResponseEnvelopeSuccessTrue AccessApplicationPolicyReplaceResponseEnvelopeSuccess = true +) diff --git a/accessapplicationpolicy_test.go b/accessapplicationpolicy_test.go new file mode 100644 index 00000000000..7cf76fbeadd --- /dev/null +++ b/accessapplicationpolicy_test.go @@ -0,0 +1,288 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare_test + +import ( + "context" + "errors" + "os" + "testing" + + "github.com/cloudflare/cloudflare-sdk-go" + "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +func TestAccessApplicationPolicyNewWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Policies.New( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessApplicationPolicyNewParams{ + Decision: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsDecisionAllow), + Include: cloudflare.F([]cloudflare.AccessApplicationPolicyNewParamsInclude{cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + Name: cloudflare.F("Allow devs"), + ApprovalGroups: cloudflare.F([]cloudflare.AccessApplicationPolicyNewParamsApprovalGroup{{ + ApprovalsNeeded: cloudflare.F(1.000000), + EmailAddresses: cloudflare.F([]interface{}{"test1@cloudflare.com", "test2@cloudflare.com"}), + EmailListUuid: cloudflare.F("string"), + }, { + ApprovalsNeeded: cloudflare.F(3.000000), + EmailAddresses: cloudflare.F([]interface{}{"test@cloudflare.com", "test2@cloudflare.com"}), + EmailListUuid: cloudflare.F("597147a1-976b-4ef2-9af0-81d5d007fc34"), + }}), + ApprovalRequired: cloudflare.F(true), + Exclude: cloudflare.F([]cloudflare.AccessApplicationPolicyNewParamsExclude{cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + IsolationRequired: cloudflare.F(false), + Precedence: cloudflare.F(int64(0)), + PurposeJustificationPrompt: cloudflare.F("Please enter a justification for entering this protected domain."), + PurposeJustificationRequired: cloudflare.F(true), + Require: cloudflare.F([]cloudflare.AccessApplicationPolicyNewParamsRequire{cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyNewParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + SessionDuration: cloudflare.F("24h"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessApplicationPolicyList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Policies.List( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessApplicationPolicyDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Policies.Delete( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessApplicationPolicyGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Policies.Get( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessApplicationPolicyReplaceWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Applications.Policies.Replace( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessApplicationPolicyReplaceParams{ + Decision: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsDecisionAllow), + Include: cloudflare.F([]cloudflare.AccessApplicationPolicyReplaceParamsInclude{cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + Name: cloudflare.F("Allow devs"), + ApprovalGroups: cloudflare.F([]cloudflare.AccessApplicationPolicyReplaceParamsApprovalGroup{{ + ApprovalsNeeded: cloudflare.F(1.000000), + EmailAddresses: cloudflare.F([]interface{}{"test1@cloudflare.com", "test2@cloudflare.com"}), + EmailListUuid: cloudflare.F("string"), + }, { + ApprovalsNeeded: cloudflare.F(3.000000), + EmailAddresses: cloudflare.F([]interface{}{"test@cloudflare.com", "test2@cloudflare.com"}), + EmailListUuid: cloudflare.F("597147a1-976b-4ef2-9af0-81d5d007fc34"), + }}), + ApprovalRequired: cloudflare.F(true), + Exclude: cloudflare.F([]cloudflare.AccessApplicationPolicyReplaceParamsExclude{cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + IsolationRequired: cloudflare.F(false), + Precedence: cloudflare.F(int64(0)), + PurposeJustificationPrompt: cloudflare.F("Please enter a justification for entering this protected domain."), + PurposeJustificationRequired: cloudflare.F(true), + Require: cloudflare.F([]cloudflare.AccessApplicationPolicyReplaceParamsRequire{cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessApplicationPolicyReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + SessionDuration: cloudflare.F("24h"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/accessapplicationuserpolicycheck.go b/accessapplicationuserpolicycheck.go new file mode 100644 index 00000000000..52ecb983afa --- /dev/null +++ b/accessapplicationuserpolicycheck.go @@ -0,0 +1,226 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// AccessApplicationUserPolicyCheckService contains methods and other services that +// help with interacting with the cloudflare API. Note, unlike clients, this +// service does not read variables from the environment automatically. You should +// not instantiate this service directly, and instead use the +// [NewAccessApplicationUserPolicyCheckService] method instead. +type AccessApplicationUserPolicyCheckService struct { + Options []option.RequestOption +} + +// NewAccessApplicationUserPolicyCheckService generates a new service that applies +// the given options to each request. These options are applied after the parent +// client's options (if there is one), and before any request-specific options. +func NewAccessApplicationUserPolicyCheckService(opts ...option.RequestOption) (r *AccessApplicationUserPolicyCheckService) { + r = &AccessApplicationUserPolicyCheckService{} + r.Options = opts + return +} + +// Tests if a specific user has permission to access an application. +func (r *AccessApplicationUserPolicyCheckService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessApplicationUserPolicyCheckListParamsAppID, opts ...option.RequestOption) (res *AccessApplicationUserPolicyCheckListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessApplicationUserPolicyCheckListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/apps/%v/user_policy_checks", accountOrZone, accountOrZoneID, appID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type AccessApplicationUserPolicyCheckListResponse struct { + AppState AccessApplicationUserPolicyCheckListResponseAppState `json:"app_state"` + UserIdentity AccessApplicationUserPolicyCheckListResponseUserIdentity `json:"user_identity"` + JSON accessApplicationUserPolicyCheckListResponseJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseJSON contains the JSON metadata for +// the struct [AccessApplicationUserPolicyCheckListResponse] +type accessApplicationUserPolicyCheckListResponseJSON struct { + AppState apijson.Field + UserIdentity apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationUserPolicyCheckListResponseAppState struct { + // UUID + AppUid string `json:"app_uid"` + Aud string `json:"aud"` + Hostname string `json:"hostname"` + Name string `json:"name"` + Policies []interface{} `json:"policies"` + Status string `json:"status"` + JSON accessApplicationUserPolicyCheckListResponseAppStateJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseAppStateJSON contains the JSON +// metadata for the struct [AccessApplicationUserPolicyCheckListResponseAppState] +type accessApplicationUserPolicyCheckListResponseAppStateJSON struct { + AppUid apijson.Field + Aud apijson.Field + Hostname apijson.Field + Name apijson.Field + Policies apijson.Field + Status apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseAppState) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationUserPolicyCheckListResponseUserIdentity struct { + ID string `json:"id"` + AccountID string `json:"account_id"` + DeviceSessions interface{} `json:"device_sessions"` + Email string `json:"email"` + Geo AccessApplicationUserPolicyCheckListResponseUserIdentityGeo `json:"geo"` + Iat int64 `json:"iat"` + IsGateway bool `json:"is_gateway"` + IsWarp bool `json:"is_warp"` + Name string `json:"name"` + // UUID + UserUuid string `json:"user_uuid"` + Version int64 `json:"version"` + JSON accessApplicationUserPolicyCheckListResponseUserIdentityJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseUserIdentityJSON contains the JSON +// metadata for the struct +// [AccessApplicationUserPolicyCheckListResponseUserIdentity] +type accessApplicationUserPolicyCheckListResponseUserIdentityJSON struct { + ID apijson.Field + AccountID apijson.Field + DeviceSessions apijson.Field + Email apijson.Field + Geo apijson.Field + Iat apijson.Field + IsGateway apijson.Field + IsWarp apijson.Field + Name apijson.Field + UserUuid apijson.Field + Version apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseUserIdentity) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationUserPolicyCheckListResponseUserIdentityGeo struct { + Country string `json:"country"` + JSON accessApplicationUserPolicyCheckListResponseUserIdentityGeoJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseUserIdentityGeoJSON contains the +// JSON metadata for the struct +// [AccessApplicationUserPolicyCheckListResponseUserIdentityGeo] +type accessApplicationUserPolicyCheckListResponseUserIdentityGeoJSON struct { + Country apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseUserIdentityGeo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Identifier +// +// Satisfied by [shared.UnionString], [shared.UnionString]. +type AccessApplicationUserPolicyCheckListParamsAppID interface { + ImplementsAccessApplicationUserPolicyCheckListParamsAppID() +} + +type AccessApplicationUserPolicyCheckListResponseEnvelope struct { + Errors []AccessApplicationUserPolicyCheckListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessApplicationUserPolicyCheckListResponseEnvelopeMessages `json:"messages,required"` + Result AccessApplicationUserPolicyCheckListResponse `json:"result,required"` + // Whether the API call was successful + Success AccessApplicationUserPolicyCheckListResponseEnvelopeSuccess `json:"success,required"` + JSON accessApplicationUserPolicyCheckListResponseEnvelopeJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseEnvelopeJSON contains the JSON +// metadata for the struct [AccessApplicationUserPolicyCheckListResponseEnvelope] +type accessApplicationUserPolicyCheckListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationUserPolicyCheckListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationUserPolicyCheckListResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AccessApplicationUserPolicyCheckListResponseEnvelopeErrors] +type accessApplicationUserPolicyCheckListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessApplicationUserPolicyCheckListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessApplicationUserPolicyCheckListResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessApplicationUserPolicyCheckListResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [AccessApplicationUserPolicyCheckListResponseEnvelopeMessages] +type accessApplicationUserPolicyCheckListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessApplicationUserPolicyCheckListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessApplicationUserPolicyCheckListResponseEnvelopeSuccess bool + +const ( + AccessApplicationUserPolicyCheckListResponseEnvelopeSuccessTrue AccessApplicationUserPolicyCheckListResponseEnvelopeSuccess = true +) diff --git a/accessapprevoketoken_test.go b/accessapplicationuserpolicycheck_test.go similarity index 87% rename from accessapprevoketoken_test.go rename to accessapplicationuserpolicycheck_test.go index 8aacb8b02ad..cad99ca23a8 100644 --- a/accessapprevoketoken_test.go +++ b/accessapplicationuserpolicycheck_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessAppRevokeTokenAccessApplicationsRevokeServiceTokens(t *testing.T) { +func TestAccessApplicationUserPolicyCheckList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,7 +30,7 @@ func TestAccessAppRevokeTokenAccessApplicationsRevokeServiceTokens(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.RevokeTokens.AccessApplicationsRevokeServiceTokens( + _, err := client.Access.Applications.UserPolicyChecks.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/accessapppolicy.go b/accessapppolicy.go deleted file mode 100644 index c47e7f50396..00000000000 --- a/accessapppolicy.go +++ /dev/null @@ -1,16481 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "reflect" - "time" - - "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/option" -) - -// AccessAppPolicyService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAccessAppPolicyService] method -// instead. -type AccessAppPolicyService struct { - Options []option.RequestOption -} - -// NewAccessAppPolicyService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAccessAppPolicyService(opts ...option.RequestOption) (r *AccessAppPolicyService) { - r = &AccessAppPolicyService{} - r.Options = opts - return -} - -// Create a new Access policy for an application. -func (r *AccessAppPolicyService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessAppPolicyNewParams, opts ...option.RequestOption) (res *AccessAppPolicyNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyNewResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Update a configured Access policy. -func (r *AccessAppPolicyService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, body AccessAppPolicyUpdateParams, opts ...option.RequestOption) (res *AccessAppPolicyUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Delete an Access policy. -func (r *AccessAppPolicyService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, opts ...option.RequestOption) (res *AccessAppPolicyDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyDeleteResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Create a new Access policy for an application. -func (r *AccessAppPolicyService) AccessPoliciesNewAnAccessPolicy(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessAppPolicyAccessPoliciesNewAnAccessPolicyParams, opts ...option.RequestOption) (res *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists Access policies configured for an application. -func (r *AccessAppPolicyService) AccessPoliciesListAccessPolicies(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *[]AccessAppPolicyAccessPoliciesListAccessPoliciesResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches a single Access policy. -func (r *AccessAppPolicyService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, opts ...option.RequestOption) (res *AccessAppPolicyGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppPolicyGetResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%s/policies/%s", accountOrZone, accountOrZoneID, uuid1, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessAppPolicyNewResponse struct { - // UUID - ID string `json:"id"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups []AccessAppPolicyNewResponseApprovalGroup `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired bool `json:"approval_required"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The action Access will take if a user matches this policy. - Decision AccessAppPolicyNewResponseDecision `json:"decision"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude []AccessAppPolicyNewResponseExclude `json:"exclude"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include []AccessAppPolicyNewResponseInclude `json:"include"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired bool `json:"isolation_required"` - // The name of the Access policy. - Name string `json:"name"` - // The order of execution for this policy. Must be unique for each policy. - Precedence int64 `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt string `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired bool `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require []AccessAppPolicyNewResponseRequire `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration string `json:"session_duration"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppPolicyNewResponseJSON `json:"-"` -} - -// accessAppPolicyNewResponseJSON contains the JSON metadata for the struct -// [AccessAppPolicyNewResponse] -type accessAppPolicyNewResponseJSON struct { - ID apijson.Field - ApprovalGroups apijson.Field - ApprovalRequired apijson.Field - CreatedAt apijson.Field - Decision apijson.Field - Exclude apijson.Field - Include apijson.Field - IsolationRequired apijson.Field - Name apijson.Field - Precedence apijson.Field - PurposeJustificationPrompt apijson.Field - PurposeJustificationRequired apijson.Field - Require apijson.Field - SessionDuration apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyNewResponseApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded float64 `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses []interface{} `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid string `json:"email_list_uuid"` - JSON accessAppPolicyNewResponseApprovalGroupJSON `json:"-"` -} - -// accessAppPolicyNewResponseApprovalGroupJSON contains the JSON metadata for the -// struct [AccessAppPolicyNewResponseApprovalGroup] -type accessAppPolicyNewResponseApprovalGroupJSON struct { - ApprovalsNeeded apijson.Field - EmailAddresses apijson.Field - EmailListUuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyNewResponseDecision string - -const ( - AccessAppPolicyNewResponseDecisionAllow AccessAppPolicyNewResponseDecision = "allow" - AccessAppPolicyNewResponseDecisionDeny AccessAppPolicyNewResponseDecision = "deny" - AccessAppPolicyNewResponseDecisionNonIdentity AccessAppPolicyNewResponseDecision = "non_identity" - AccessAppPolicyNewResponseDecisionBypass AccessAppPolicyNewResponseDecision = "bypass" -) - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyNewResponseExcludeAccessEmailRule], -// [AccessAppPolicyNewResponseExcludeAccessEmailListRule], -// [AccessAppPolicyNewResponseExcludeAccessDomainRule], -// [AccessAppPolicyNewResponseExcludeAccessEveryoneRule], -// [AccessAppPolicyNewResponseExcludeAccessIPRule], -// [AccessAppPolicyNewResponseExcludeAccessIPListRule], -// [AccessAppPolicyNewResponseExcludeAccessCertificateRule], -// [AccessAppPolicyNewResponseExcludeAccessAccessGroupRule], -// [AccessAppPolicyNewResponseExcludeAccessAzureGroupRule], -// [AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyNewResponseExcludeAccessOktaGroupRule], -// [AccessAppPolicyNewResponseExcludeAccessSamlGroupRule], -// [AccessAppPolicyNewResponseExcludeAccessServiceTokenRule], -// [AccessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyNewResponseExcludeAccessCountryRule], -// [AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyNewResponseExcludeAccessDevicePostureRule]. -type AccessAppPolicyNewResponseExclude interface { - implementsAccessAppPolicyNewResponseExclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyNewResponseExclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyNewResponseExcludeAccessEmailRule struct { - Email AccessAppPolicyNewResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyNewResponseExcludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseExcludeAccessEmailRule] -type accessAppPolicyNewResponseExcludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessEmailRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyNewResponseExcludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessEmailRuleEmail] -type accessAppPolicyNewResponseExcludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewResponseExcludeAccessEmailListRule struct { - EmailList AccessAppPolicyNewResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyNewResponseExcludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessEmailListRule] -type accessAppPolicyNewResponseExcludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessEmailListRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessEmailListRuleEmailList] -type accessAppPolicyNewResponseExcludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyNewResponseExcludeAccessDomainRule struct { - EmailDomain AccessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyNewResponseExcludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseExcludeAccessDomainRule] -type accessAppPolicyNewResponseExcludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessDomainRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomain] -type accessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyNewResponseExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyNewResponseExcludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessEveryoneRule] -type accessAppPolicyNewResponseExcludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessEveryoneRule) implementsAccessAppPolicyNewResponseExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyNewResponseExcludeAccessIPRule struct { - IP AccessAppPolicyNewResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyNewResponseExcludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyNewResponseExcludeAccessIPRule] -type accessAppPolicyNewResponseExcludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessIPRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyNewResponseExcludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseExcludeAccessIPRuleIP] -type accessAppPolicyNewResponseExcludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewResponseExcludeAccessIPListRule struct { - IPList AccessAppPolicyNewResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyNewResponseExcludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseExcludeAccessIPListRule] -type accessAppPolicyNewResponseExcludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessIPListRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseExcludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessIPListRuleIPList] -type accessAppPolicyNewResponseExcludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyNewResponseExcludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessCertificateRule] -type accessAppPolicyNewResponseExcludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessCertificateRule) implementsAccessAppPolicyNewResponseExclude() { -} - -// Matches an Access group. -type AccessAppPolicyNewResponseExcludeAccessAccessGroupRule struct { - Group AccessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyNewResponseExcludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessAccessGroupRule] -type accessAppPolicyNewResponseExcludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessAccessGroupRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroup] -type accessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyNewResponseExcludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessAzureGroupRule] -type accessAppPolicyNewResponseExcludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessAzureGroupRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRule] -type accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRule] -type accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewResponseExcludeAccessOktaGroupRule struct { - Okta AccessAppPolicyNewResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyNewResponseExcludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessOktaGroupRule] -type accessAppPolicyNewResponseExcludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessOktaGroupRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessOktaGroupRuleOkta] -type accessAppPolicyNewResponseExcludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewResponseExcludeAccessSamlGroupRule struct { - Saml AccessAppPolicyNewResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyNewResponseExcludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessSamlGroupRule] -type accessAppPolicyNewResponseExcludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessSamlGroupRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessSamlGroupRuleSaml] -type accessAppPolicyNewResponseExcludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyNewResponseExcludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessServiceTokenRule] -type accessAppPolicyNewResponseExcludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessServiceTokenRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRule] -type accessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewResponseExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRule] -type accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyNewResponseExcludeAccessCountryRule struct { - Geo AccessAppPolicyNewResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyNewResponseExcludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessCountryRule] -type accessAppPolicyNewResponseExcludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessCountryRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyNewResponseExcludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseExcludeAccessCountryRuleGeo] -type accessAppPolicyNewResponseExcludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRule] -type accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyNewResponseExcludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessDevicePostureRule] -type accessAppPolicyNewResponseExcludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseExcludeAccessDevicePostureRule) implementsAccessAppPolicyNewResponseExclude() { -} - -type AccessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyNewResponseIncludeAccessEmailRule], -// [AccessAppPolicyNewResponseIncludeAccessEmailListRule], -// [AccessAppPolicyNewResponseIncludeAccessDomainRule], -// [AccessAppPolicyNewResponseIncludeAccessEveryoneRule], -// [AccessAppPolicyNewResponseIncludeAccessIPRule], -// [AccessAppPolicyNewResponseIncludeAccessIPListRule], -// [AccessAppPolicyNewResponseIncludeAccessCertificateRule], -// [AccessAppPolicyNewResponseIncludeAccessAccessGroupRule], -// [AccessAppPolicyNewResponseIncludeAccessAzureGroupRule], -// [AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyNewResponseIncludeAccessOktaGroupRule], -// [AccessAppPolicyNewResponseIncludeAccessSamlGroupRule], -// [AccessAppPolicyNewResponseIncludeAccessServiceTokenRule], -// [AccessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyNewResponseIncludeAccessCountryRule], -// [AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyNewResponseIncludeAccessDevicePostureRule]. -type AccessAppPolicyNewResponseInclude interface { - implementsAccessAppPolicyNewResponseInclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyNewResponseInclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyNewResponseIncludeAccessEmailRule struct { - Email AccessAppPolicyNewResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyNewResponseIncludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseIncludeAccessEmailRule] -type accessAppPolicyNewResponseIncludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessEmailRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyNewResponseIncludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessEmailRuleEmail] -type accessAppPolicyNewResponseIncludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewResponseIncludeAccessEmailListRule struct { - EmailList AccessAppPolicyNewResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyNewResponseIncludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessEmailListRule] -type accessAppPolicyNewResponseIncludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessEmailListRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessEmailListRuleEmailList] -type accessAppPolicyNewResponseIncludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyNewResponseIncludeAccessDomainRule struct { - EmailDomain AccessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyNewResponseIncludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseIncludeAccessDomainRule] -type accessAppPolicyNewResponseIncludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessDomainRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomain] -type accessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyNewResponseIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyNewResponseIncludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessEveryoneRule] -type accessAppPolicyNewResponseIncludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessEveryoneRule) implementsAccessAppPolicyNewResponseInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyNewResponseIncludeAccessIPRule struct { - IP AccessAppPolicyNewResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyNewResponseIncludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyNewResponseIncludeAccessIPRule] -type accessAppPolicyNewResponseIncludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessIPRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyNewResponseIncludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseIncludeAccessIPRuleIP] -type accessAppPolicyNewResponseIncludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewResponseIncludeAccessIPListRule struct { - IPList AccessAppPolicyNewResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyNewResponseIncludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseIncludeAccessIPListRule] -type accessAppPolicyNewResponseIncludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessIPListRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseIncludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessIPListRuleIPList] -type accessAppPolicyNewResponseIncludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyNewResponseIncludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessCertificateRule] -type accessAppPolicyNewResponseIncludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessCertificateRule) implementsAccessAppPolicyNewResponseInclude() { -} - -// Matches an Access group. -type AccessAppPolicyNewResponseIncludeAccessAccessGroupRule struct { - Group AccessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyNewResponseIncludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessAccessGroupRule] -type accessAppPolicyNewResponseIncludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessAccessGroupRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroup] -type accessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyNewResponseIncludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessAzureGroupRule] -type accessAppPolicyNewResponseIncludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessAzureGroupRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRule] -type accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRule] -type accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewResponseIncludeAccessOktaGroupRule struct { - Okta AccessAppPolicyNewResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyNewResponseIncludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessOktaGroupRule] -type accessAppPolicyNewResponseIncludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessOktaGroupRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessOktaGroupRuleOkta] -type accessAppPolicyNewResponseIncludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewResponseIncludeAccessSamlGroupRule struct { - Saml AccessAppPolicyNewResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyNewResponseIncludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessSamlGroupRule] -type accessAppPolicyNewResponseIncludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessSamlGroupRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessSamlGroupRuleSaml] -type accessAppPolicyNewResponseIncludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyNewResponseIncludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessServiceTokenRule] -type accessAppPolicyNewResponseIncludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessServiceTokenRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRule] -type accessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewResponseInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRule] -type accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyNewResponseIncludeAccessCountryRule struct { - Geo AccessAppPolicyNewResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyNewResponseIncludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessCountryRule] -type accessAppPolicyNewResponseIncludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessCountryRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyNewResponseIncludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseIncludeAccessCountryRuleGeo] -type accessAppPolicyNewResponseIncludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRule] -type accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyNewResponseIncludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessDevicePostureRule] -type accessAppPolicyNewResponseIncludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseIncludeAccessDevicePostureRule) implementsAccessAppPolicyNewResponseInclude() { -} - -type AccessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyNewResponseRequireAccessEmailRule], -// [AccessAppPolicyNewResponseRequireAccessEmailListRule], -// [AccessAppPolicyNewResponseRequireAccessDomainRule], -// [AccessAppPolicyNewResponseRequireAccessEveryoneRule], -// [AccessAppPolicyNewResponseRequireAccessIPRule], -// [AccessAppPolicyNewResponseRequireAccessIPListRule], -// [AccessAppPolicyNewResponseRequireAccessCertificateRule], -// [AccessAppPolicyNewResponseRequireAccessAccessGroupRule], -// [AccessAppPolicyNewResponseRequireAccessAzureGroupRule], -// [AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyNewResponseRequireAccessGsuiteGroupRule], -// [AccessAppPolicyNewResponseRequireAccessOktaGroupRule], -// [AccessAppPolicyNewResponseRequireAccessSamlGroupRule], -// [AccessAppPolicyNewResponseRequireAccessServiceTokenRule], -// [AccessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewResponseRequireAccessExternalEvaluationRule], -// [AccessAppPolicyNewResponseRequireAccessCountryRule], -// [AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRule] or -// [AccessAppPolicyNewResponseRequireAccessDevicePostureRule]. -type AccessAppPolicyNewResponseRequire interface { - implementsAccessAppPolicyNewResponseRequire() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyNewResponseRequire)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyNewResponseRequireAccessEmailRule struct { - Email AccessAppPolicyNewResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyNewResponseRequireAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseRequireAccessEmailRule] -type accessAppPolicyNewResponseRequireAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessEmailRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyNewResponseRequireAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessEmailRuleEmail] -type accessAppPolicyNewResponseRequireAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewResponseRequireAccessEmailListRule struct { - EmailList AccessAppPolicyNewResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyNewResponseRequireAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessEmailListRule] -type accessAppPolicyNewResponseRequireAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessEmailListRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessEmailListRuleEmailList] -type accessAppPolicyNewResponseRequireAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyNewResponseRequireAccessDomainRule struct { - EmailDomain AccessAppPolicyNewResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyNewResponseRequireAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseRequireAccessDomainRule] -type accessAppPolicyNewResponseRequireAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessDomainRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessDomainRuleEmailDomain] -type accessAppPolicyNewResponseRequireAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyNewResponseRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyNewResponseRequireAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessEveryoneRule] -type accessAppPolicyNewResponseRequireAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessEveryoneRule) implementsAccessAppPolicyNewResponseRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyNewResponseRequireAccessIPRule struct { - IP AccessAppPolicyNewResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyNewResponseRequireAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyNewResponseRequireAccessIPRule] -type accessAppPolicyNewResponseRequireAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessIPRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyNewResponseRequireAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseRequireAccessIPRuleIP] -type accessAppPolicyNewResponseRequireAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewResponseRequireAccessIPListRule struct { - IPList AccessAppPolicyNewResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyNewResponseRequireAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyNewResponseRequireAccessIPListRule] -type accessAppPolicyNewResponseRequireAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessIPListRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseRequireAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessIPListRuleIPList] -type accessAppPolicyNewResponseRequireAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyNewResponseRequireAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessCertificateRule] -type accessAppPolicyNewResponseRequireAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessCertificateRule) implementsAccessAppPolicyNewResponseRequire() { -} - -// Matches an Access group. -type AccessAppPolicyNewResponseRequireAccessAccessGroupRule struct { - Group AccessAppPolicyNewResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyNewResponseRequireAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessAccessGroupRule] -type accessAppPolicyNewResponseRequireAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessAccessGroupRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessAccessGroupRuleGroup] -type accessAppPolicyNewResponseRequireAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewResponseRequireAccessAzureGroupRule struct { - AzureAd AccessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyNewResponseRequireAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessAzureGroupRule] -type accessAppPolicyNewResponseRequireAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessAzureGroupRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAd] -type accessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRule] -type accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessGsuiteGroupRule] -type accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessGsuiteGroupRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite] -type accessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewResponseRequireAccessOktaGroupRule struct { - Okta AccessAppPolicyNewResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyNewResponseRequireAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessOktaGroupRule] -type accessAppPolicyNewResponseRequireAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessOktaGroupRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessOktaGroupRuleOkta] -type accessAppPolicyNewResponseRequireAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewResponseRequireAccessSamlGroupRule struct { - Saml AccessAppPolicyNewResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyNewResponseRequireAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessSamlGroupRule] -type accessAppPolicyNewResponseRequireAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessSamlGroupRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessSamlGroupRuleSaml] -type accessAppPolicyNewResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyNewResponseRequireAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessServiceTokenRule] -type accessAppPolicyNewResponseRequireAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessServiceTokenRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceToken] -type accessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRule] -type accessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewResponseRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessExternalEvaluationRule] -type accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessExternalEvaluationRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyNewResponseRequireAccessCountryRule struct { - Geo AccessAppPolicyNewResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyNewResponseRequireAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessCountryRule] -type accessAppPolicyNewResponseRequireAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessCountryRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyNewResponseRequireAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyNewResponseRequireAccessCountryRuleGeo] -type accessAppPolicyNewResponseRequireAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRule] -type accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyNewResponseRequireAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessDevicePostureRule] -type accessAppPolicyNewResponseRequireAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyNewResponseRequireAccessDevicePostureRule) implementsAccessAppPolicyNewResponseRequire() { -} - -type AccessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture] -type accessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyUpdateResponse struct { - // UUID - ID string `json:"id"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups []AccessAppPolicyUpdateResponseApprovalGroup `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired bool `json:"approval_required"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The action Access will take if a user matches this policy. - Decision AccessAppPolicyUpdateResponseDecision `json:"decision"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude []AccessAppPolicyUpdateResponseExclude `json:"exclude"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include []AccessAppPolicyUpdateResponseInclude `json:"include"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired bool `json:"isolation_required"` - // The name of the Access policy. - Name string `json:"name"` - // The order of execution for this policy. Must be unique for each policy. - Precedence int64 `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt string `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired bool `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require []AccessAppPolicyUpdateResponseRequire `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration string `json:"session_duration"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppPolicyUpdateResponseJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseJSON contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponse] -type accessAppPolicyUpdateResponseJSON struct { - ID apijson.Field - ApprovalGroups apijson.Field - ApprovalRequired apijson.Field - CreatedAt apijson.Field - Decision apijson.Field - Exclude apijson.Field - Include apijson.Field - IsolationRequired apijson.Field - Name apijson.Field - Precedence apijson.Field - PurposeJustificationPrompt apijson.Field - PurposeJustificationRequired apijson.Field - Require apijson.Field - SessionDuration apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyUpdateResponseApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded float64 `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses []interface{} `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid string `json:"email_list_uuid"` - JSON accessAppPolicyUpdateResponseApprovalGroupJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseApprovalGroupJSON contains the JSON metadata for -// the struct [AccessAppPolicyUpdateResponseApprovalGroup] -type accessAppPolicyUpdateResponseApprovalGroupJSON struct { - ApprovalsNeeded apijson.Field - EmailAddresses apijson.Field - EmailListUuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyUpdateResponseDecision string - -const ( - AccessAppPolicyUpdateResponseDecisionAllow AccessAppPolicyUpdateResponseDecision = "allow" - AccessAppPolicyUpdateResponseDecisionDeny AccessAppPolicyUpdateResponseDecision = "deny" - AccessAppPolicyUpdateResponseDecisionNonIdentity AccessAppPolicyUpdateResponseDecision = "non_identity" - AccessAppPolicyUpdateResponseDecisionBypass AccessAppPolicyUpdateResponseDecision = "bypass" -) - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyUpdateResponseExcludeAccessEmailRule], -// [AccessAppPolicyUpdateResponseExcludeAccessEmailListRule], -// [AccessAppPolicyUpdateResponseExcludeAccessDomainRule], -// [AccessAppPolicyUpdateResponseExcludeAccessEveryoneRule], -// [AccessAppPolicyUpdateResponseExcludeAccessIPRule], -// [AccessAppPolicyUpdateResponseExcludeAccessIPListRule], -// [AccessAppPolicyUpdateResponseExcludeAccessCertificateRule], -// [AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRule], -// [AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRule], -// [AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRule], -// [AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRule], -// [AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRule], -// [AccessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateResponseExcludeAccessCountryRule], -// [AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRule]. -type AccessAppPolicyUpdateResponseExclude interface { - implementsAccessAppPolicyUpdateResponseExclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyUpdateResponseExclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyUpdateResponseExcludeAccessEmailRule struct { - Email AccessAppPolicyUpdateResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessEmailRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessEmailRule] -type accessAppPolicyUpdateResponseExcludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessEmailRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyUpdateResponseExcludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessEmailRuleEmail] -type accessAppPolicyUpdateResponseExcludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateResponseExcludeAccessEmailListRule struct { - EmailList AccessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessEmailListRule] -type accessAppPolicyUpdateResponseExcludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessEmailListRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailListJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailList] -type accessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateResponseExcludeAccessDomainRule struct { - EmailDomain AccessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessDomainRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessDomainRule] -type accessAppPolicyUpdateResponseExcludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessDomainRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomain] -type accessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyUpdateResponseExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessEveryoneRule] -type accessAppPolicyUpdateResponseExcludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessEveryoneRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateResponseExcludeAccessIPRule struct { - IP AccessAppPolicyUpdateResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessIPRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyUpdateResponseExcludeAccessIPRule] -type accessAppPolicyUpdateResponseExcludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessIPRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessIPRuleIPJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessIPRuleIP] -type accessAppPolicyUpdateResponseExcludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateResponseExcludeAccessIPListRule struct { - IPList AccessAppPolicyUpdateResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessIPListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessIPListRule] -type accessAppPolicyUpdateResponseExcludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessIPListRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessIPListRuleIPList] -type accessAppPolicyUpdateResponseExcludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessCertificateRule] -type accessAppPolicyUpdateResponseExcludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessCertificateRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRule struct { - Group AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRule] -type accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroup] -type accessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRule] -type accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRule] -type accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRule] -type accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRule struct { - Okta AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRule] -type accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOktaJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOkta] -type accessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRule struct { - Saml AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRule] -type accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSamlJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSaml] -type accessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRule] -type accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRule] -type accessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRule] -type accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyUpdateResponseExcludeAccessCountryRule struct { - Geo AccessAppPolicyUpdateResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseExcludeAccessCountryRule] -type accessAppPolicyUpdateResponseExcludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessCountryRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessCountryRuleGeo] -type accessAppPolicyUpdateResponseExcludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRule] -type accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRule] -type accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRule) implementsAccessAppPolicyUpdateResponseExclude() { -} - -type AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyUpdateResponseIncludeAccessEmailRule], -// [AccessAppPolicyUpdateResponseIncludeAccessEmailListRule], -// [AccessAppPolicyUpdateResponseIncludeAccessDomainRule], -// [AccessAppPolicyUpdateResponseIncludeAccessEveryoneRule], -// [AccessAppPolicyUpdateResponseIncludeAccessIPRule], -// [AccessAppPolicyUpdateResponseIncludeAccessIPListRule], -// [AccessAppPolicyUpdateResponseIncludeAccessCertificateRule], -// [AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRule], -// [AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRule], -// [AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRule], -// [AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRule], -// [AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRule], -// [AccessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateResponseIncludeAccessCountryRule], -// [AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRule]. -type AccessAppPolicyUpdateResponseInclude interface { - implementsAccessAppPolicyUpdateResponseInclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyUpdateResponseInclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyUpdateResponseIncludeAccessEmailRule struct { - Email AccessAppPolicyUpdateResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessEmailRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessEmailRule] -type accessAppPolicyUpdateResponseIncludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessEmailRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyUpdateResponseIncludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessEmailRuleEmail] -type accessAppPolicyUpdateResponseIncludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateResponseIncludeAccessEmailListRule struct { - EmailList AccessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessEmailListRule] -type accessAppPolicyUpdateResponseIncludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessEmailListRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailListJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailList] -type accessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateResponseIncludeAccessDomainRule struct { - EmailDomain AccessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessDomainRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessDomainRule] -type accessAppPolicyUpdateResponseIncludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessDomainRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomain] -type accessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyUpdateResponseIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessEveryoneRule] -type accessAppPolicyUpdateResponseIncludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessEveryoneRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateResponseIncludeAccessIPRule struct { - IP AccessAppPolicyUpdateResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessIPRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyUpdateResponseIncludeAccessIPRule] -type accessAppPolicyUpdateResponseIncludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessIPRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessIPRuleIPJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessIPRuleIP] -type accessAppPolicyUpdateResponseIncludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateResponseIncludeAccessIPListRule struct { - IPList AccessAppPolicyUpdateResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessIPListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessIPListRule] -type accessAppPolicyUpdateResponseIncludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessIPListRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessIPListRuleIPList] -type accessAppPolicyUpdateResponseIncludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessCertificateRule] -type accessAppPolicyUpdateResponseIncludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessCertificateRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRule struct { - Group AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRule] -type accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroup] -type accessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRule] -type accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRule] -type accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRule] -type accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRule struct { - Okta AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRule] -type accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOktaJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOkta] -type accessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRule struct { - Saml AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRule] -type accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSamlJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSaml] -type accessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRule] -type accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRule] -type accessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRule] -type accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyUpdateResponseIncludeAccessCountryRule struct { - Geo AccessAppPolicyUpdateResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseIncludeAccessCountryRule] -type accessAppPolicyUpdateResponseIncludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessCountryRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessCountryRuleGeo] -type accessAppPolicyUpdateResponseIncludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRule] -type accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRule] -type accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRule) implementsAccessAppPolicyUpdateResponseInclude() { -} - -type AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyUpdateResponseRequireAccessEmailRule], -// [AccessAppPolicyUpdateResponseRequireAccessEmailListRule], -// [AccessAppPolicyUpdateResponseRequireAccessDomainRule], -// [AccessAppPolicyUpdateResponseRequireAccessEveryoneRule], -// [AccessAppPolicyUpdateResponseRequireAccessIPRule], -// [AccessAppPolicyUpdateResponseRequireAccessIPListRule], -// [AccessAppPolicyUpdateResponseRequireAccessCertificateRule], -// [AccessAppPolicyUpdateResponseRequireAccessAccessGroupRule], -// [AccessAppPolicyUpdateResponseRequireAccessAzureGroupRule], -// [AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateResponseRequireAccessOktaGroupRule], -// [AccessAppPolicyUpdateResponseRequireAccessSamlGroupRule], -// [AccessAppPolicyUpdateResponseRequireAccessServiceTokenRule], -// [AccessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateResponseRequireAccessCountryRule], -// [AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRule] or -// [AccessAppPolicyUpdateResponseRequireAccessDevicePostureRule]. -type AccessAppPolicyUpdateResponseRequire interface { - implementsAccessAppPolicyUpdateResponseRequire() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyUpdateResponseRequire)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyUpdateResponseRequireAccessEmailRule struct { - Email AccessAppPolicyUpdateResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyUpdateResponseRequireAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessEmailRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessEmailRule] -type accessAppPolicyUpdateResponseRequireAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessEmailRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyUpdateResponseRequireAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessEmailRuleEmail] -type accessAppPolicyUpdateResponseRequireAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateResponseRequireAccessEmailListRule struct { - EmailList AccessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyUpdateResponseRequireAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessEmailListRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessEmailListRule] -type accessAppPolicyUpdateResponseRequireAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessEmailListRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailListJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailList] -type accessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateResponseRequireAccessDomainRule struct { - EmailDomain AccessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyUpdateResponseRequireAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessDomainRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessDomainRule] -type accessAppPolicyUpdateResponseRequireAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessDomainRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomain] -type accessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyUpdateResponseRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyUpdateResponseRequireAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessEveryoneRule] -type accessAppPolicyUpdateResponseRequireAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessEveryoneRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateResponseRequireAccessIPRule struct { - IP AccessAppPolicyUpdateResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyUpdateResponseRequireAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessIPRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyUpdateResponseRequireAccessIPRule] -type accessAppPolicyUpdateResponseRequireAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessIPRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyUpdateResponseRequireAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessIPRuleIPJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessIPRuleIP] -type accessAppPolicyUpdateResponseRequireAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateResponseRequireAccessIPListRule struct { - IPList AccessAppPolicyUpdateResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyUpdateResponseRequireAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessIPListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessIPListRule] -type accessAppPolicyUpdateResponseRequireAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessIPListRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseRequireAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessIPListRuleIPList] -type accessAppPolicyUpdateResponseRequireAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyUpdateResponseRequireAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessCertificateRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessCertificateRule] -type accessAppPolicyUpdateResponseRequireAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessCertificateRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateResponseRequireAccessAccessGroupRule struct { - Group AccessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAccessGroupRule] -type accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessAccessGroupRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroup] -type accessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateResponseRequireAccessAzureGroupRule struct { - AzureAd AccessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAzureGroupRule] -type accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessAzureGroupRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAd] -type accessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRule] -type accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRule] -type accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuite] -type accessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateResponseRequireAccessOktaGroupRule struct { - Okta AccessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessOktaGroupRule] -type accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessOktaGroupRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOktaJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOkta] -type accessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateResponseRequireAccessSamlGroupRule struct { - Saml AccessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessSamlGroupRule] -type accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessSamlGroupRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSamlJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSaml] -type accessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessServiceTokenRule] -type accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessServiceTokenRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceToken] -type accessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRule] -type accessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRule] -type accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyUpdateResponseRequireAccessCountryRule struct { - Geo AccessAppPolicyUpdateResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyUpdateResponseRequireAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyUpdateResponseRequireAccessCountryRule] -type accessAppPolicyUpdateResponseRequireAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessCountryRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyUpdateResponseRequireAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessCountryRuleGeo] -type accessAppPolicyUpdateResponseRequireAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRule] -type accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessDevicePostureRule] -type accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyUpdateResponseRequireAccessDevicePostureRule) implementsAccessAppPolicyUpdateResponseRequire() { -} - -type AccessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePosture] -type accessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyDeleteResponse struct { - // UUID - ID string `json:"id"` - JSON accessAppPolicyDeleteResponseJSON `json:"-"` -} - -// accessAppPolicyDeleteResponseJSON contains the JSON metadata for the struct -// [AccessAppPolicyDeleteResponse] -type accessAppPolicyDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse struct { - // UUID - ID string `json:"id"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroup `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired bool `json:"approval_required"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The action Access will take if a user matches this policy. - Decision AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision `json:"decision"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude `json:"exclude"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude `json:"include"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired bool `json:"isolation_required"` - // The name of the Access policy. - Name string `json:"name"` - // The order of execution for this policy. Must be unique for each policy. - Precedence int64 `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt string `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired bool `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration string `json:"session_duration"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseJSON contains the JSON -// metadata for the struct [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseJSON struct { - ID apijson.Field - ApprovalGroups apijson.Field - ApprovalRequired apijson.Field - CreatedAt apijson.Field - Decision apijson.Field - Exclude apijson.Field - Include apijson.Field - IsolationRequired apijson.Field - Name apijson.Field - Precedence apijson.Field - PurposeJustificationPrompt apijson.Field - PurposeJustificationRequired apijson.Field - Require apijson.Field - SessionDuration apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded float64 `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses []interface{} `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid string `json:"email_list_uuid"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroupJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroup] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroupJSON struct { - ApprovalsNeeded apijson.Field - EmailAddresses apijson.Field - EmailListUuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision string - -const ( - AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecisionAllow AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision = "allow" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecisionDeny AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision = "deny" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecisionNonIdentity AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision = "non_identity" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecisionBypass AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseDecision = "bypass" -) - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIP] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIP] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIP] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponse struct { - // UUID - ID string `json:"id"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroup `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired bool `json:"approval_required"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The action Access will take if a user matches this policy. - Decision AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision `json:"decision"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude `json:"exclude"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude `json:"include"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired bool `json:"isolation_required"` - // The name of the Access policy. - Name string `json:"name"` - // The order of execution for this policy. Must be unique for each policy. - Precedence int64 `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt string `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired bool `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration string `json:"session_duration"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponse] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseJSON struct { - ID apijson.Field - ApprovalGroups apijson.Field - ApprovalRequired apijson.Field - CreatedAt apijson.Field - Decision apijson.Field - Exclude apijson.Field - Include apijson.Field - IsolationRequired apijson.Field - Name apijson.Field - Precedence apijson.Field - PurposeJustificationPrompt apijson.Field - PurposeJustificationRequired apijson.Field - Require apijson.Field - SessionDuration apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded float64 `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses []interface{} `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid string `json:"email_list_uuid"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroup] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroupJSON struct { - ApprovalsNeeded apijson.Field - EmailAddresses apijson.Field - EmailListUuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision string - -const ( - AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecisionAllow AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision = "allow" - AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecisionDeny AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision = "deny" - AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecisionNonIdentity AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision = "non_identity" - AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecisionBypass AccessAppPolicyAccessPoliciesListAccessPoliciesResponseDecision = "bypass" -) - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude interface { - implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIP] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseExclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude interface { - implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIP] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseInclude() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRule], -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRule] -// or -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire interface { - implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRule struct { - Email AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmail] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRule struct { - EmailList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRule struct { - EmailDomain AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomain] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRule struct { - IP AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIP] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRule struct { - IPList AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPList] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRule struct { - Group AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroup] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRule struct { - AzureAd AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAd] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuite] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRule struct { - Okta AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOkta] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRule struct { - Saml AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSaml] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceToken] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRule struct { - Geo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeo] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRule] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequire() { -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePosture] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyGetResponse struct { - // UUID - ID string `json:"id"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups []AccessAppPolicyGetResponseApprovalGroup `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired bool `json:"approval_required"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The action Access will take if a user matches this policy. - Decision AccessAppPolicyGetResponseDecision `json:"decision"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude []AccessAppPolicyGetResponseExclude `json:"exclude"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include []AccessAppPolicyGetResponseInclude `json:"include"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired bool `json:"isolation_required"` - // The name of the Access policy. - Name string `json:"name"` - // The order of execution for this policy. Must be unique for each policy. - Precedence int64 `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt string `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired bool `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require []AccessAppPolicyGetResponseRequire `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration string `json:"session_duration"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessAppPolicyGetResponseJSON `json:"-"` -} - -// accessAppPolicyGetResponseJSON contains the JSON metadata for the struct -// [AccessAppPolicyGetResponse] -type accessAppPolicyGetResponseJSON struct { - ID apijson.Field - ApprovalGroups apijson.Field - ApprovalRequired apijson.Field - CreatedAt apijson.Field - Decision apijson.Field - Exclude apijson.Field - Include apijson.Field - IsolationRequired apijson.Field - Name apijson.Field - Precedence apijson.Field - PurposeJustificationPrompt apijson.Field - PurposeJustificationRequired apijson.Field - Require apijson.Field - SessionDuration apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyGetResponseApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded float64 `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses []interface{} `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid string `json:"email_list_uuid"` - JSON accessAppPolicyGetResponseApprovalGroupJSON `json:"-"` -} - -// accessAppPolicyGetResponseApprovalGroupJSON contains the JSON metadata for the -// struct [AccessAppPolicyGetResponseApprovalGroup] -type accessAppPolicyGetResponseApprovalGroupJSON struct { - ApprovalsNeeded apijson.Field - EmailAddresses apijson.Field - EmailListUuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseApprovalGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyGetResponseDecision string - -const ( - AccessAppPolicyGetResponseDecisionAllow AccessAppPolicyGetResponseDecision = "allow" - AccessAppPolicyGetResponseDecisionDeny AccessAppPolicyGetResponseDecision = "deny" - AccessAppPolicyGetResponseDecisionNonIdentity AccessAppPolicyGetResponseDecision = "non_identity" - AccessAppPolicyGetResponseDecisionBypass AccessAppPolicyGetResponseDecision = "bypass" -) - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyGetResponseExcludeAccessEmailRule], -// [AccessAppPolicyGetResponseExcludeAccessEmailListRule], -// [AccessAppPolicyGetResponseExcludeAccessDomainRule], -// [AccessAppPolicyGetResponseExcludeAccessEveryoneRule], -// [AccessAppPolicyGetResponseExcludeAccessIPRule], -// [AccessAppPolicyGetResponseExcludeAccessIPListRule], -// [AccessAppPolicyGetResponseExcludeAccessCertificateRule], -// [AccessAppPolicyGetResponseExcludeAccessAccessGroupRule], -// [AccessAppPolicyGetResponseExcludeAccessAzureGroupRule], -// [AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyGetResponseExcludeAccessOktaGroupRule], -// [AccessAppPolicyGetResponseExcludeAccessSamlGroupRule], -// [AccessAppPolicyGetResponseExcludeAccessServiceTokenRule], -// [AccessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyGetResponseExcludeAccessCountryRule], -// [AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyGetResponseExcludeAccessDevicePostureRule]. -type AccessAppPolicyGetResponseExclude interface { - implementsAccessAppPolicyGetResponseExclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyGetResponseExclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyGetResponseExcludeAccessEmailRule struct { - Email AccessAppPolicyGetResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyGetResponseExcludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseExcludeAccessEmailRule] -type accessAppPolicyGetResponseExcludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessEmailRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyGetResponseExcludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessEmailRuleEmail] -type accessAppPolicyGetResponseExcludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyGetResponseExcludeAccessEmailListRule struct { - EmailList AccessAppPolicyGetResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyGetResponseExcludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessEmailListRule] -type accessAppPolicyGetResponseExcludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessEmailListRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessEmailListRuleEmailList] -type accessAppPolicyGetResponseExcludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyGetResponseExcludeAccessDomainRule struct { - EmailDomain AccessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyGetResponseExcludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseExcludeAccessDomainRule] -type accessAppPolicyGetResponseExcludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessDomainRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomain] -type accessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyGetResponseExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyGetResponseExcludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessEveryoneRule] -type accessAppPolicyGetResponseExcludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessEveryoneRule) implementsAccessAppPolicyGetResponseExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyGetResponseExcludeAccessIPRule struct { - IP AccessAppPolicyGetResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyGetResponseExcludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyGetResponseExcludeAccessIPRule] -type accessAppPolicyGetResponseExcludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessIPRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyGetResponseExcludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseExcludeAccessIPRuleIP] -type accessAppPolicyGetResponseExcludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyGetResponseExcludeAccessIPListRule struct { - IPList AccessAppPolicyGetResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyGetResponseExcludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseExcludeAccessIPListRule] -type accessAppPolicyGetResponseExcludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessIPListRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseExcludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessIPListRuleIPList] -type accessAppPolicyGetResponseExcludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyGetResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyGetResponseExcludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessCertificateRule] -type accessAppPolicyGetResponseExcludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessCertificateRule) implementsAccessAppPolicyGetResponseExclude() { -} - -// Matches an Access group. -type AccessAppPolicyGetResponseExcludeAccessAccessGroupRule struct { - Group AccessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyGetResponseExcludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessAccessGroupRule] -type accessAppPolicyGetResponseExcludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessAccessGroupRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroup] -type accessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyGetResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyGetResponseExcludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessAzureGroupRule] -type accessAppPolicyGetResponseExcludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessAzureGroupRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRule] -type accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRule] -type accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyGetResponseExcludeAccessOktaGroupRule struct { - Okta AccessAppPolicyGetResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyGetResponseExcludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessOktaGroupRule] -type accessAppPolicyGetResponseExcludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessOktaGroupRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessOktaGroupRuleOkta] -type accessAppPolicyGetResponseExcludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyGetResponseExcludeAccessSamlGroupRule struct { - Saml AccessAppPolicyGetResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyGetResponseExcludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessSamlGroupRule] -type accessAppPolicyGetResponseExcludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessSamlGroupRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessSamlGroupRuleSaml] -type accessAppPolicyGetResponseExcludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyGetResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyGetResponseExcludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessServiceTokenRule] -type accessAppPolicyGetResponseExcludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessServiceTokenRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRule] -type accessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyGetResponseExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRule] -type accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyGetResponseExcludeAccessCountryRule struct { - Geo AccessAppPolicyGetResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyGetResponseExcludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessCountryRule] -type accessAppPolicyGetResponseExcludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessCountryRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyGetResponseExcludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseExcludeAccessCountryRuleGeo] -type accessAppPolicyGetResponseExcludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRule] -type accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyGetResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyGetResponseExcludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessDevicePostureRule] -type accessAppPolicyGetResponseExcludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseExcludeAccessDevicePostureRule) implementsAccessAppPolicyGetResponseExclude() { -} - -type AccessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyGetResponseIncludeAccessEmailRule], -// [AccessAppPolicyGetResponseIncludeAccessEmailListRule], -// [AccessAppPolicyGetResponseIncludeAccessDomainRule], -// [AccessAppPolicyGetResponseIncludeAccessEveryoneRule], -// [AccessAppPolicyGetResponseIncludeAccessIPRule], -// [AccessAppPolicyGetResponseIncludeAccessIPListRule], -// [AccessAppPolicyGetResponseIncludeAccessCertificateRule], -// [AccessAppPolicyGetResponseIncludeAccessAccessGroupRule], -// [AccessAppPolicyGetResponseIncludeAccessAzureGroupRule], -// [AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyGetResponseIncludeAccessOktaGroupRule], -// [AccessAppPolicyGetResponseIncludeAccessSamlGroupRule], -// [AccessAppPolicyGetResponseIncludeAccessServiceTokenRule], -// [AccessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyGetResponseIncludeAccessCountryRule], -// [AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRule] or -// [AccessAppPolicyGetResponseIncludeAccessDevicePostureRule]. -type AccessAppPolicyGetResponseInclude interface { - implementsAccessAppPolicyGetResponseInclude() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyGetResponseInclude)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyGetResponseIncludeAccessEmailRule struct { - Email AccessAppPolicyGetResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyGetResponseIncludeAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseIncludeAccessEmailRule] -type accessAppPolicyGetResponseIncludeAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessEmailRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyGetResponseIncludeAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessEmailRuleEmail] -type accessAppPolicyGetResponseIncludeAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyGetResponseIncludeAccessEmailListRule struct { - EmailList AccessAppPolicyGetResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyGetResponseIncludeAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessEmailListRule] -type accessAppPolicyGetResponseIncludeAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessEmailListRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessEmailListRuleEmailList] -type accessAppPolicyGetResponseIncludeAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyGetResponseIncludeAccessDomainRule struct { - EmailDomain AccessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyGetResponseIncludeAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseIncludeAccessDomainRule] -type accessAppPolicyGetResponseIncludeAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessDomainRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomain] -type accessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyGetResponseIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyGetResponseIncludeAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessEveryoneRule] -type accessAppPolicyGetResponseIncludeAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessEveryoneRule) implementsAccessAppPolicyGetResponseInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyGetResponseIncludeAccessIPRule struct { - IP AccessAppPolicyGetResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyGetResponseIncludeAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyGetResponseIncludeAccessIPRule] -type accessAppPolicyGetResponseIncludeAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessIPRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyGetResponseIncludeAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseIncludeAccessIPRuleIP] -type accessAppPolicyGetResponseIncludeAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyGetResponseIncludeAccessIPListRule struct { - IPList AccessAppPolicyGetResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyGetResponseIncludeAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseIncludeAccessIPListRule] -type accessAppPolicyGetResponseIncludeAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessIPListRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseIncludeAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessIPListRuleIPList] -type accessAppPolicyGetResponseIncludeAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyGetResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyGetResponseIncludeAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessCertificateRule] -type accessAppPolicyGetResponseIncludeAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessCertificateRule) implementsAccessAppPolicyGetResponseInclude() { -} - -// Matches an Access group. -type AccessAppPolicyGetResponseIncludeAccessAccessGroupRule struct { - Group AccessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyGetResponseIncludeAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessAccessGroupRule] -type accessAppPolicyGetResponseIncludeAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessAccessGroupRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroup] -type accessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyGetResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyGetResponseIncludeAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessAzureGroupRule] -type accessAppPolicyGetResponseIncludeAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessAzureGroupRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd] -type accessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRule] -type accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRule] -type accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyGetResponseIncludeAccessOktaGroupRule struct { - Okta AccessAppPolicyGetResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyGetResponseIncludeAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessOktaGroupRule] -type accessAppPolicyGetResponseIncludeAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessOktaGroupRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessOktaGroupRuleOkta] -type accessAppPolicyGetResponseIncludeAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyGetResponseIncludeAccessSamlGroupRule struct { - Saml AccessAppPolicyGetResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyGetResponseIncludeAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessSamlGroupRule] -type accessAppPolicyGetResponseIncludeAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessSamlGroupRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessSamlGroupRuleSaml] -type accessAppPolicyGetResponseIncludeAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyGetResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyGetResponseIncludeAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessServiceTokenRule] -type accessAppPolicyGetResponseIncludeAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessServiceTokenRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken] -type accessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRule] -type accessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyGetResponseInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRule] -type accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyGetResponseIncludeAccessCountryRule struct { - Geo AccessAppPolicyGetResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyGetResponseIncludeAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessCountryRule] -type accessAppPolicyGetResponseIncludeAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessCountryRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyGetResponseIncludeAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseIncludeAccessCountryRuleGeo] -type accessAppPolicyGetResponseIncludeAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRule] -type accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyGetResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyGetResponseIncludeAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessDevicePostureRule] -type accessAppPolicyGetResponseIncludeAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseIncludeAccessDevicePostureRule) implementsAccessAppPolicyGetResponseInclude() { -} - -type AccessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessAppPolicyGetResponseRequireAccessEmailRule], -// [AccessAppPolicyGetResponseRequireAccessEmailListRule], -// [AccessAppPolicyGetResponseRequireAccessDomainRule], -// [AccessAppPolicyGetResponseRequireAccessEveryoneRule], -// [AccessAppPolicyGetResponseRequireAccessIPRule], -// [AccessAppPolicyGetResponseRequireAccessIPListRule], -// [AccessAppPolicyGetResponseRequireAccessCertificateRule], -// [AccessAppPolicyGetResponseRequireAccessAccessGroupRule], -// [AccessAppPolicyGetResponseRequireAccessAzureGroupRule], -// [AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyGetResponseRequireAccessGsuiteGroupRule], -// [AccessAppPolicyGetResponseRequireAccessOktaGroupRule], -// [AccessAppPolicyGetResponseRequireAccessSamlGroupRule], -// [AccessAppPolicyGetResponseRequireAccessServiceTokenRule], -// [AccessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyGetResponseRequireAccessExternalEvaluationRule], -// [AccessAppPolicyGetResponseRequireAccessCountryRule], -// [AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRule] or -// [AccessAppPolicyGetResponseRequireAccessDevicePostureRule]. -type AccessAppPolicyGetResponseRequire interface { - implementsAccessAppPolicyGetResponseRequire() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessAppPolicyGetResponseRequire)(nil)).Elem(), "") -} - -// Matches a specific email. -type AccessAppPolicyGetResponseRequireAccessEmailRule struct { - Email AccessAppPolicyGetResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessAppPolicyGetResponseRequireAccessEmailRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseRequireAccessEmailRule] -type accessAppPolicyGetResponseRequireAccessEmailRuleJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessEmailRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessEmailRuleEmail struct { - // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessAppPolicyGetResponseRequireAccessEmailRuleEmailJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessEmailRuleEmail] -type accessAppPolicyGetResponseRequireAccessEmailRuleEmailJSON struct { - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an email address from a list. -type AccessAppPolicyGetResponseRequireAccessEmailListRule struct { - EmailList AccessAppPolicyGetResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessAppPolicyGetResponseRequireAccessEmailListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessEmailListRule] -type accessAppPolicyGetResponseRequireAccessEmailListRuleJSON struct { - EmailList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessEmailListRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessEmailListRuleEmailList] -type accessAppPolicyGetResponseRequireAccessEmailListRuleEmailListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Match an entire email domain. -type AccessAppPolicyGetResponseRequireAccessDomainRule struct { - EmailDomain AccessAppPolicyGetResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessAppPolicyGetResponseRequireAccessDomainRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseRequireAccessDomainRule] -type accessAppPolicyGetResponseRequireAccessDomainRuleJSON struct { - EmailDomain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessDomainRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain string `json:"domain,required"` - JSON accessAppPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessDomainRuleEmailDomain] -type accessAppPolicyGetResponseRequireAccessDomainRuleEmailDomainJSON struct { - Domain apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches everyone. -type AccessAppPolicyGetResponseRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessAppPolicyGetResponseRequireAccessEveryoneRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessEveryoneRule] -type accessAppPolicyGetResponseRequireAccessEveryoneRuleJSON struct { - Everyone apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessEveryoneRule) implementsAccessAppPolicyGetResponseRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyGetResponseRequireAccessIPRule struct { - IP AccessAppPolicyGetResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessAppPolicyGetResponseRequireAccessIPRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessAppPolicyGetResponseRequireAccessIPRule] -type accessAppPolicyGetResponseRequireAccessIPRuleJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessIPRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessAppPolicyGetResponseRequireAccessIPRuleIPJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseRequireAccessIPRuleIP] -type accessAppPolicyGetResponseRequireAccessIPRuleIPJSON struct { - IP apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an IP address from a list. -type AccessAppPolicyGetResponseRequireAccessIPListRule struct { - IPList AccessAppPolicyGetResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessAppPolicyGetResponseRequireAccessIPListRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessAppPolicyGetResponseRequireAccessIPListRule] -type accessAppPolicyGetResponseRequireAccessIPListRuleJSON struct { - IPList apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessIPListRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseRequireAccessIPListRuleIPListJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessIPListRuleIPList] -type accessAppPolicyGetResponseRequireAccessIPListRuleIPListJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid client certificate. -type AccessAppPolicyGetResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessAppPolicyGetResponseRequireAccessCertificateRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessCertificateRule] -type accessAppPolicyGetResponseRequireAccessCertificateRuleJSON struct { - Certificate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessCertificateRule) implementsAccessAppPolicyGetResponseRequire() { -} - -// Matches an Access group. -type AccessAppPolicyGetResponseRequireAccessAccessGroupRule struct { - Group AccessAppPolicyGetResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessAppPolicyGetResponseRequireAccessAccessGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessAccessGroupRule] -type accessAppPolicyGetResponseRequireAccessAccessGroupRuleJSON struct { - Group apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessAccessGroupRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessAppPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessAccessGroupRuleGroup] -type accessAppPolicyGetResponseRequireAccessAccessGroupRuleGroupJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyGetResponseRequireAccessAzureGroupRule struct { - AzureAd AccessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessAppPolicyGetResponseRequireAccessAzureGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessAzureGroupRule] -type accessAppPolicyGetResponseRequireAccessAzureGroupRuleJSON struct { - AzureAd apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessAzureGroupRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID string `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAd] -type accessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAdJSON struct { - ID apijson.Field - ConnectionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRule] -type accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleJSON struct { - GitHubOrganization apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID string `json:"connection_id,required"` - // The name of the organization. - Name string `json:"name,required"` - JSON accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { - ConnectionID apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyGetResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessGsuiteGroupRule] -type accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleJSON struct { - Gsuite apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessGsuiteGroupRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite] -type accessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyGetResponseRequireAccessOktaGroupRule struct { - Okta AccessAppPolicyGetResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessAppPolicyGetResponseRequireAccessOktaGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessOktaGroupRule] -type accessAppPolicyGetResponseRequireAccessOktaGroupRuleJSON struct { - Okta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessOktaGroupRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID string `json:"connection_id,required"` - // The email of the Okta group. - Email string `json:"email,required"` - JSON accessAppPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessOktaGroupRuleOkta] -type accessAppPolicyGetResponseRequireAccessOktaGroupRuleOktaJSON struct { - ConnectionID apijson.Field - Email apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyGetResponseRequireAccessSamlGroupRule struct { - Saml AccessAppPolicyGetResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessAppPolicyGetResponseRequireAccessSamlGroupRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessSamlGroupRule] -type accessAppPolicyGetResponseRequireAccessSamlGroupRuleJSON struct { - Saml apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessSamlGroupRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName string `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessAppPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessSamlGroupRuleSaml] -type accessAppPolicyGetResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field - AttributeValue apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyGetResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessAppPolicyGetResponseRequireAccessServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessServiceTokenRule] -type accessAppPolicyGetResponseRequireAccessServiceTokenRuleJSON struct { - ServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessServiceTokenRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceToken] -type accessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { - TokenID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRule] -type accessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRuleJSON struct { - AnyValidServiceToken apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyGetResponseRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyGetResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessExternalEvaluationRule] -type accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleJSON struct { - ExternalEvaluation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessExternalEvaluationRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL string `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { - EvaluateURL apijson.Field - KeysURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific country -type AccessAppPolicyGetResponseRequireAccessCountryRule struct { - Geo AccessAppPolicyGetResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessAppPolicyGetResponseRequireAccessCountryRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessCountryRule] -type accessAppPolicyGetResponseRequireAccessCountryRuleJSON struct { - Geo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessCountryRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessAppPolicyGetResponseRequireAccessCountryRuleGeoJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessAppPolicyGetResponseRequireAccessCountryRuleGeo] -type accessAppPolicyGetResponseRequireAccessCountryRuleGeoJSON struct { - CountryCode apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforce different MFA options -type AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRule] -type accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { - AuthMethod apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyGetResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessAppPolicyGetResponseRequireAccessDevicePostureRuleJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessDevicePostureRule] -type accessAppPolicyGetResponseRequireAccessDevicePostureRuleJSON struct { - DevicePosture apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessAppPolicyGetResponseRequireAccessDevicePostureRule) implementsAccessAppPolicyGetResponseRequire() { -} - -type AccessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture] -type accessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyNewParams struct { - // The action Access will take if a user matches this policy. - Decision param.Field[AccessAppPolicyNewParamsDecision] `json:"decision,required"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include param.Field[[]AccessAppPolicyNewParamsInclude] `json:"include,required"` - // The name of the Access policy. - Name param.Field[string] `json:"name,required"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups param.Field[[]AccessAppPolicyNewParamsApprovalGroup] `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired param.Field[bool] `json:"approval_required"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude param.Field[[]AccessAppPolicyNewParamsExclude] `json:"exclude"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired param.Field[bool] `json:"isolation_required"` - // The order of execution for this policy. Must be unique for each policy. - Precedence param.Field[int64] `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require param.Field[[]AccessAppPolicyNewParamsRequire] `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration param.Field[string] `json:"session_duration"` -} - -func (r AccessAppPolicyNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyNewParamsDecision string - -const ( - AccessAppPolicyNewParamsDecisionAllow AccessAppPolicyNewParamsDecision = "allow" - AccessAppPolicyNewParamsDecisionDeny AccessAppPolicyNewParamsDecision = "deny" - AccessAppPolicyNewParamsDecisionNonIdentity AccessAppPolicyNewParamsDecision = "non_identity" - AccessAppPolicyNewParamsDecisionBypass AccessAppPolicyNewParamsDecision = "bypass" -) - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyNewParamsIncludeAccessEmailRule], -// [AccessAppPolicyNewParamsIncludeAccessEmailListRule], -// [AccessAppPolicyNewParamsIncludeAccessDomainRule], -// [AccessAppPolicyNewParamsIncludeAccessEveryoneRule], -// [AccessAppPolicyNewParamsIncludeAccessIPRule], -// [AccessAppPolicyNewParamsIncludeAccessIPListRule], -// [AccessAppPolicyNewParamsIncludeAccessCertificateRule], -// [AccessAppPolicyNewParamsIncludeAccessAccessGroupRule], -// [AccessAppPolicyNewParamsIncludeAccessAzureGroupRule], -// [AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyNewParamsIncludeAccessOktaGroupRule], -// [AccessAppPolicyNewParamsIncludeAccessSamlGroupRule], -// [AccessAppPolicyNewParamsIncludeAccessServiceTokenRule], -// [AccessAppPolicyNewParamsIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyNewParamsIncludeAccessCountryRule], -// [AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRule], -// [AccessAppPolicyNewParamsIncludeAccessDevicePostureRule]. -type AccessAppPolicyNewParamsInclude interface { - implementsAccessAppPolicyNewParamsInclude() -} - -// Matches a specific email. -type AccessAppPolicyNewParamsIncludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailRule) implementsAccessAppPolicyNewParamsInclude() {} - -type AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewParamsIncludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyNewParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailListRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyNewParamsIncludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyNewParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessDomainRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyNewParamsIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessEveryoneRule) implementsAccessAppPolicyNewParamsInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyNewParamsIncludeAccessIPRule struct { - IP param.Field[AccessAppPolicyNewParamsIncludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPRule) implementsAccessAppPolicyNewParamsInclude() {} - -type AccessAppPolicyNewParamsIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewParamsIncludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyNewParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPListRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewParamsIncludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessCertificateRule) implementsAccessAppPolicyNewParamsInclude() { -} - -// Matches an Access group. -type AccessAppPolicyNewParamsIncludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyNewParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessAccessGroupRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewParamsIncludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessAzureGroupRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewParamsIncludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyNewParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessOktaGroupRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewParamsIncludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyNewParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessSamlGroupRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewParamsIncludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessServiceTokenRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewParamsIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewParamsInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyNewParamsIncludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyNewParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessCountryRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewParamsIncludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsIncludeAccessDevicePostureRule) implementsAccessAppPolicyNewParamsInclude() { -} - -type AccessAppPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyNewParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyNewParamsApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses param.Field[[]interface{}] `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid param.Field[string] `json:"email_list_uuid"` -} - -func (r AccessAppPolicyNewParamsApprovalGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyNewParamsExcludeAccessEmailRule], -// [AccessAppPolicyNewParamsExcludeAccessEmailListRule], -// [AccessAppPolicyNewParamsExcludeAccessDomainRule], -// [AccessAppPolicyNewParamsExcludeAccessEveryoneRule], -// [AccessAppPolicyNewParamsExcludeAccessIPRule], -// [AccessAppPolicyNewParamsExcludeAccessIPListRule], -// [AccessAppPolicyNewParamsExcludeAccessCertificateRule], -// [AccessAppPolicyNewParamsExcludeAccessAccessGroupRule], -// [AccessAppPolicyNewParamsExcludeAccessAzureGroupRule], -// [AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyNewParamsExcludeAccessOktaGroupRule], -// [AccessAppPolicyNewParamsExcludeAccessSamlGroupRule], -// [AccessAppPolicyNewParamsExcludeAccessServiceTokenRule], -// [AccessAppPolicyNewParamsExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyNewParamsExcludeAccessCountryRule], -// [AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRule], -// [AccessAppPolicyNewParamsExcludeAccessDevicePostureRule]. -type AccessAppPolicyNewParamsExclude interface { - implementsAccessAppPolicyNewParamsExclude() -} - -// Matches a specific email. -type AccessAppPolicyNewParamsExcludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailRule) implementsAccessAppPolicyNewParamsExclude() {} - -type AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewParamsExcludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyNewParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailListRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyNewParamsExcludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyNewParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessDomainRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyNewParamsExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessEveryoneRule) implementsAccessAppPolicyNewParamsExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyNewParamsExcludeAccessIPRule struct { - IP param.Field[AccessAppPolicyNewParamsExcludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPRule) implementsAccessAppPolicyNewParamsExclude() {} - -type AccessAppPolicyNewParamsExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewParamsExcludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyNewParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPListRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewParamsExcludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessCertificateRule) implementsAccessAppPolicyNewParamsExclude() { -} - -// Matches an Access group. -type AccessAppPolicyNewParamsExcludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyNewParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessAccessGroupRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewParamsExcludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessAzureGroupRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewParamsExcludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyNewParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessOktaGroupRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewParamsExcludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyNewParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessSamlGroupRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewParamsExcludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessServiceTokenRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewParamsExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewParamsExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyNewParamsExcludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyNewParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessCountryRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewParamsExcludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsExcludeAccessDevicePostureRule) implementsAccessAppPolicyNewParamsExclude() { -} - -type AccessAppPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyNewParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyNewParamsRequireAccessEmailRule], -// [AccessAppPolicyNewParamsRequireAccessEmailListRule], -// [AccessAppPolicyNewParamsRequireAccessDomainRule], -// [AccessAppPolicyNewParamsRequireAccessEveryoneRule], -// [AccessAppPolicyNewParamsRequireAccessIPRule], -// [AccessAppPolicyNewParamsRequireAccessIPListRule], -// [AccessAppPolicyNewParamsRequireAccessCertificateRule], -// [AccessAppPolicyNewParamsRequireAccessAccessGroupRule], -// [AccessAppPolicyNewParamsRequireAccessAzureGroupRule], -// [AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyNewParamsRequireAccessGsuiteGroupRule], -// [AccessAppPolicyNewParamsRequireAccessOktaGroupRule], -// [AccessAppPolicyNewParamsRequireAccessSamlGroupRule], -// [AccessAppPolicyNewParamsRequireAccessServiceTokenRule], -// [AccessAppPolicyNewParamsRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyNewParamsRequireAccessExternalEvaluationRule], -// [AccessAppPolicyNewParamsRequireAccessCountryRule], -// [AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRule], -// [AccessAppPolicyNewParamsRequireAccessDevicePostureRule]. -type AccessAppPolicyNewParamsRequire interface { - implementsAccessAppPolicyNewParamsRequire() -} - -// Matches a specific email. -type AccessAppPolicyNewParamsRequireAccessEmailRule struct { - Email param.Field[AccessAppPolicyNewParamsRequireAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailRule) implementsAccessAppPolicyNewParamsRequire() {} - -type AccessAppPolicyNewParamsRequireAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyNewParamsRequireAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyNewParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailListRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyNewParamsRequireAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyNewParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessDomainRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyNewParamsRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessEveryoneRule) implementsAccessAppPolicyNewParamsRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyNewParamsRequireAccessIPRule struct { - IP param.Field[AccessAppPolicyNewParamsRequireAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessIPRule) implementsAccessAppPolicyNewParamsRequire() {} - -type AccessAppPolicyNewParamsRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyNewParamsRequireAccessIPListRule struct { - IPList param.Field[AccessAppPolicyNewParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessIPListRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyNewParamsRequireAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessCertificateRule) implementsAccessAppPolicyNewParamsRequire() { -} - -// Matches an Access group. -type AccessAppPolicyNewParamsRequireAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyNewParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessAccessGroupRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyNewParamsRequireAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyNewParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessAzureGroupRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyNewParamsRequireAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessGsuiteGroupRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyNewParamsRequireAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyNewParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessOktaGroupRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyNewParamsRequireAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyNewParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessSamlGroupRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyNewParamsRequireAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyNewParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessServiceTokenRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyNewParamsRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyNewParamsRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyNewParamsRequireAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessExternalEvaluationRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyNewParamsRequireAccessCountryRule struct { - Geo param.Field[AccessAppPolicyNewParamsRequireAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessCountryRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyNewParamsRequireAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyNewParamsRequireAccessDevicePostureRule) implementsAccessAppPolicyNewParamsRequire() { -} - -type AccessAppPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyNewParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessAppPolicyNewResponseEnvelope struct { - Errors []AccessAppPolicyNewResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppPolicyNewResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppPolicyNewResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppPolicyNewResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppPolicyNewResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppPolicyNewResponseEnvelope] -type accessAppPolicyNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyNewResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppPolicyNewResponseEnvelopeErrors] -type accessAppPolicyNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyNewResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyNewResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessAppPolicyNewResponseEnvelopeMessages] -type accessAppPolicyNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppPolicyNewResponseEnvelopeSuccess bool - -const ( - AccessAppPolicyNewResponseEnvelopeSuccessTrue AccessAppPolicyNewResponseEnvelopeSuccess = true -) - -type AccessAppPolicyUpdateParams struct { - // The action Access will take if a user matches this policy. - Decision param.Field[AccessAppPolicyUpdateParamsDecision] `json:"decision,required"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include param.Field[[]AccessAppPolicyUpdateParamsInclude] `json:"include,required"` - // The name of the Access policy. - Name param.Field[string] `json:"name,required"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups param.Field[[]AccessAppPolicyUpdateParamsApprovalGroup] `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired param.Field[bool] `json:"approval_required"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude param.Field[[]AccessAppPolicyUpdateParamsExclude] `json:"exclude"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired param.Field[bool] `json:"isolation_required"` - // The order of execution for this policy. Must be unique for each policy. - Precedence param.Field[int64] `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require param.Field[[]AccessAppPolicyUpdateParamsRequire] `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration param.Field[string] `json:"session_duration"` -} - -func (r AccessAppPolicyUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyUpdateParamsDecision string - -const ( - AccessAppPolicyUpdateParamsDecisionAllow AccessAppPolicyUpdateParamsDecision = "allow" - AccessAppPolicyUpdateParamsDecisionDeny AccessAppPolicyUpdateParamsDecision = "deny" - AccessAppPolicyUpdateParamsDecisionNonIdentity AccessAppPolicyUpdateParamsDecision = "non_identity" - AccessAppPolicyUpdateParamsDecisionBypass AccessAppPolicyUpdateParamsDecision = "bypass" -) - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyUpdateParamsIncludeAccessEmailRule], -// [AccessAppPolicyUpdateParamsIncludeAccessEmailListRule], -// [AccessAppPolicyUpdateParamsIncludeAccessDomainRule], -// [AccessAppPolicyUpdateParamsIncludeAccessEveryoneRule], -// [AccessAppPolicyUpdateParamsIncludeAccessIPRule], -// [AccessAppPolicyUpdateParamsIncludeAccessIPListRule], -// [AccessAppPolicyUpdateParamsIncludeAccessCertificateRule], -// [AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRule], -// [AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRule], -// [AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRule], -// [AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRule], -// [AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRule], -// [AccessAppPolicyUpdateParamsIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateParamsIncludeAccessCountryRule], -// [AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRule], -// [AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRule]. -type AccessAppPolicyUpdateParamsInclude interface { - implementsAccessAppPolicyUpdateParamsInclude() -} - -// Matches a specific email. -type AccessAppPolicyUpdateParamsIncludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateParamsIncludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyUpdateParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailListRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateParamsIncludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyUpdateParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDomainRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyUpdateParamsIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessEveryoneRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateParamsIncludeAccessIPRule struct { - IP param.Field[AccessAppPolicyUpdateParamsIncludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateParamsIncludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyUpdateParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPListRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateParamsIncludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessCertificateRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateParamsIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyUpdateParamsIncludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyUpdateParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessCountryRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRule) implementsAccessAppPolicyUpdateParamsInclude() { -} - -type AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyUpdateParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyUpdateParamsApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses param.Field[[]interface{}] `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid param.Field[string] `json:"email_list_uuid"` -} - -func (r AccessAppPolicyUpdateParamsApprovalGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyUpdateParamsExcludeAccessEmailRule], -// [AccessAppPolicyUpdateParamsExcludeAccessEmailListRule], -// [AccessAppPolicyUpdateParamsExcludeAccessDomainRule], -// [AccessAppPolicyUpdateParamsExcludeAccessEveryoneRule], -// [AccessAppPolicyUpdateParamsExcludeAccessIPRule], -// [AccessAppPolicyUpdateParamsExcludeAccessIPListRule], -// [AccessAppPolicyUpdateParamsExcludeAccessCertificateRule], -// [AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRule], -// [AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRule], -// [AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRule], -// [AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRule], -// [AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRule], -// [AccessAppPolicyUpdateParamsExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateParamsExcludeAccessCountryRule], -// [AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRule], -// [AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRule]. -type AccessAppPolicyUpdateParamsExclude interface { - implementsAccessAppPolicyUpdateParamsExclude() -} - -// Matches a specific email. -type AccessAppPolicyUpdateParamsExcludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateParamsExcludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyUpdateParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailListRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateParamsExcludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyUpdateParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDomainRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyUpdateParamsExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessEveryoneRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateParamsExcludeAccessIPRule struct { - IP param.Field[AccessAppPolicyUpdateParamsExcludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateParamsExcludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyUpdateParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPListRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateParamsExcludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessCertificateRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateParamsExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyUpdateParamsExcludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyUpdateParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessCountryRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRule) implementsAccessAppPolicyUpdateParamsExclude() { -} - -type AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyUpdateParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by [AccessAppPolicyUpdateParamsRequireAccessEmailRule], -// [AccessAppPolicyUpdateParamsRequireAccessEmailListRule], -// [AccessAppPolicyUpdateParamsRequireAccessDomainRule], -// [AccessAppPolicyUpdateParamsRequireAccessEveryoneRule], -// [AccessAppPolicyUpdateParamsRequireAccessIPRule], -// [AccessAppPolicyUpdateParamsRequireAccessIPListRule], -// [AccessAppPolicyUpdateParamsRequireAccessCertificateRule], -// [AccessAppPolicyUpdateParamsRequireAccessAccessGroupRule], -// [AccessAppPolicyUpdateParamsRequireAccessAzureGroupRule], -// [AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRule], -// [AccessAppPolicyUpdateParamsRequireAccessOktaGroupRule], -// [AccessAppPolicyUpdateParamsRequireAccessSamlGroupRule], -// [AccessAppPolicyUpdateParamsRequireAccessServiceTokenRule], -// [AccessAppPolicyUpdateParamsRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRule], -// [AccessAppPolicyUpdateParamsRequireAccessCountryRule], -// [AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRule], -// [AccessAppPolicyUpdateParamsRequireAccessDevicePostureRule]. -type AccessAppPolicyUpdateParamsRequire interface { - implementsAccessAppPolicyUpdateParamsRequire() -} - -// Matches a specific email. -type AccessAppPolicyUpdateParamsRequireAccessEmailRule struct { - Email param.Field[AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyUpdateParamsRequireAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyUpdateParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailListRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyUpdateParamsRequireAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyUpdateParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDomainRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyUpdateParamsRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessEveryoneRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyUpdateParamsRequireAccessIPRule struct { - IP param.Field[AccessAppPolicyUpdateParamsRequireAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyUpdateParamsRequireAccessIPListRule struct { - IPList param.Field[AccessAppPolicyUpdateParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPListRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyUpdateParamsRequireAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessCertificateRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -// Matches an Access group. -type AccessAppPolicyUpdateParamsRequireAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyUpdateParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAccessGroupRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyUpdateParamsRequireAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyUpdateParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAzureGroupRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyUpdateParamsRequireAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyUpdateParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessOktaGroupRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyUpdateParamsRequireAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyUpdateParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessSamlGroupRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyUpdateParamsRequireAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyUpdateParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessServiceTokenRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyUpdateParamsRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyUpdateParamsRequireAccessCountryRule struct { - Geo param.Field[AccessAppPolicyUpdateParamsRequireAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessCountryRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyUpdateParamsRequireAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyUpdateParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDevicePostureRule) implementsAccessAppPolicyUpdateParamsRequire() { -} - -type AccessAppPolicyUpdateParamsRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyUpdateParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessAppPolicyUpdateResponseEnvelope struct { - 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,required"` - JSON accessAppPolicyUpdateResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessAppPolicyUpdateResponseEnvelope] -type accessAppPolicyUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessAppPolicyUpdateResponseEnvelopeErrors] -type accessAppPolicyUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessAppPolicyUpdateResponseEnvelopeMessages] -type accessAppPolicyUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppPolicyUpdateResponseEnvelopeSuccess bool - -const ( - AccessAppPolicyUpdateResponseEnvelopeSuccessTrue AccessAppPolicyUpdateResponseEnvelopeSuccess = true -) - -type AccessAppPolicyDeleteResponseEnvelope struct { - 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,required"` - JSON accessAppPolicyDeleteResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessAppPolicyDeleteResponseEnvelope] -type accessAppPolicyDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessAppPolicyDeleteResponseEnvelopeErrors] -type accessAppPolicyDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessAppPolicyDeleteResponseEnvelopeMessages] -type accessAppPolicyDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppPolicyDeleteResponseEnvelopeSuccess bool - -const ( - AccessAppPolicyDeleteResponseEnvelopeSuccessTrue AccessAppPolicyDeleteResponseEnvelopeSuccess = true -) - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParams struct { - // The action Access will take if a user matches this policy. - Decision param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision] `json:"decision,required"` - // Rules evaluated with an OR logical operator. A user needs to meet only one of - // the Include rules. - Include param.Field[[]AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude] `json:"include,required"` - // The name of the Access policy. - Name param.Field[string] `json:"name,required"` - // Administrators who can approve a temporary authentication request. - ApprovalGroups param.Field[[]AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsApprovalGroup] `json:"approval_groups"` - // Requires the user to request access from an administrator at the start of each - // session. - ApprovalRequired param.Field[bool] `json:"approval_required"` - // Rules evaluated with a NOT logical operator. To match the policy, a user cannot - // meet any of the Exclude rules. - Exclude param.Field[[]AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude] `json:"exclude"` - // Require this application to be served in an isolated browser for users matching - // this policy. 'Client Web Isolation' must be on for the account in order to use - // this feature. - IsolationRequired param.Field[bool] `json:"isolation_required"` - // The order of execution for this policy. Must be unique for each policy. - Precedence param.Field[int64] `json:"precedence"` - // A custom message that will appear on the purpose justification screen. - PurposeJustificationPrompt param.Field[string] `json:"purpose_justification_prompt"` - // Require users to enter a justification when they log in to the application. - PurposeJustificationRequired param.Field[bool] `json:"purpose_justification_required"` - // Rules evaluated with an AND logical operator. To match the policy, a user must - // meet all of the Require rules. - Require param.Field[[]AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire] `json:"require"` - // The amount of time that tokens issued for the application will be valid. Must be - // in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - // m, h. - SessionDuration param.Field[string] `json:"session_duration"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The action Access will take if a user matches this policy. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision string - -const ( - AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecisionAllow AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision = "allow" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecisionDeny AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision = "deny" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecisionNonIdentity AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision = "non_identity" - AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecisionBypass AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecision = "bypass" -) - -// Matches a specific email. -// -// Satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRule struct { - IP param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A group of email addresses that can approve a temporary authentication request. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsApprovalGroup struct { - // The number of approvals needed to obtain access. - ApprovalsNeeded param.Field[float64] `json:"approvals_needed,required"` - // A list of emails that can approve the access request. - EmailAddresses param.Field[[]interface{}] `json:"email_addresses"` - // The UUID of an re-usable email list. - EmailListUuid param.Field[string] `json:"email_list_uuid"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsApprovalGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule struct { - Email param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRule struct { - IP param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRule struct { - IPList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRule struct { - Geo param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific email. -// -// Satisfied by -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEveryoneRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCertificateRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAnyValidServiceTokenRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRule], -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRule]. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire interface { - implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() -} - -// Matches a specific email. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule struct { - Email param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail struct { - // The email of the user. - Email param.Field[string] `json:"email,required" format:"email"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an email address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRule struct { - EmailList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRuleEmailList struct { - // The ID of a previously created email list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Match an entire email domain. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRule struct { - EmailDomain param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRuleEmailDomain struct { - // The email domain to match. - Domain param.Field[string] `json:"domain,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches everyone. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEveryoneRule struct { - // An empty object which matches on all users. - Everyone param.Field[interface{}] `json:"everyone,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEveryoneRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -// Matches an IP address block. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRule struct { - IP param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRuleIP] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRuleIP struct { - // An IPv4 or IPv6 CIDR block. - IP param.Field[string] `json:"ip,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an IP address from a list. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRule struct { - IPList param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRuleIPList struct { - // The ID of a previously created IP list. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid client certificate. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCertificateRule struct { - Certificate param.Field[interface{}] `json:"certificate,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCertificateRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -// Matches an Access group. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRule struct { - Group param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRuleGroup struct { - // The ID of a previously created Access group. - ID param.Field[string] `json:"id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Azure group. Requires an Azure identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRule struct { - AzureAd param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRuleAzureAd struct { - // The ID of an Azure group. - ID param.Field[string] `json:"id,required"` - // The ID of your Azure identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a Github organization. Requires a Github identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { - // The ID of your Github identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The name of the organization. - Name param.Field[string] `json:"name,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a group in Google Workspace. Requires a Google Workspace identity -// provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRuleGsuite struct { - // The ID of your Google Workspace identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Google Workspace group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches an Okta group. Requires an Okta identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRule struct { - Okta param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRuleOkta struct { - // The ID of your Okta identity provider. - ConnectionID param.Field[string] `json:"connection_id,required"` - // The email of the Okta group. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a SAML group. Requires a SAML identity provider. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRule struct { - Saml param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRuleSaml struct { - // The name of the SAML attribute. - AttributeName param.Field[string] `json:"attribute_name,required"` - // The SAML attribute value to look for. - AttributeValue param.Field[string] `json:"attribute_value,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRule struct { - ServiceToken param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRuleServiceToken struct { - // The ID of a Service Token. - TokenID param.Field[string] `json:"token_id,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches any valid Access Service Token -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAnyValidServiceTokenRule struct { - // An empty object which matches on all service tokens. - AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAnyValidServiceTokenRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -// Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { - // The API endpoint containing your business logic. - EvaluateURL param.Field[string] `json:"evaluate_url,required"` - // The API endpoint containing the key that Access uses to verify that the response - // came from your API. - KeysURL param.Field[string] `json:"keys_url,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Matches a specific country -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRule struct { - Geo param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRuleGeo] `json:"geo,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRuleGeo struct { - // The country code that should be matched. - CountryCode param.Field[string] `json:"country_code,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforce different MFA options -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { - // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod param.Field[string] `json:"auth_method,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enforces a device posture rule has run successfully -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRule struct { - DevicePosture param.Field[AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRule) implementsAccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire() { -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` -} - -func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelope struct { - 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,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelope] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrors] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessages] -type accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeSuccess bool - -const ( - AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeSuccessTrue AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeSuccess = true -) - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelope struct { - 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,required"` - ResultInfo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo `json:"result_info"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelope] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrors] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - 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"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo] -type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyGetResponseEnvelope struct { - 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,required"` - JSON accessAppPolicyGetResponseEnvelopeJSON `json:"-"` -} - -// accessAppPolicyGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessAppPolicyGetResponseEnvelope] -type accessAppPolicyGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppPolicyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessAppPolicyGetResponseEnvelopeErrors] -type accessAppPolicyGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppPolicyGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppPolicyGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppPolicyGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessAppPolicyGetResponseEnvelopeMessages] -type accessAppPolicyGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppPolicyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppPolicyGetResponseEnvelopeSuccess bool - -const ( - AccessAppPolicyGetResponseEnvelopeSuccessTrue AccessAppPolicyGetResponseEnvelopeSuccess = true -) diff --git a/accessapppolicy_test.go b/accessapppolicy_test.go deleted file mode 100644 index acca78cac16..00000000000 --- a/accessapppolicy_test.go +++ /dev/null @@ -1,377 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAccessAppPolicyNewWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.New( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessAppPolicyNewParams{ - Decision: cloudflare.F(cloudflare.AccessAppPolicyNewParamsDecisionAllow), - Include: cloudflare.F([]cloudflare.AccessAppPolicyNewParamsInclude{cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - Name: cloudflare.F("Allow devs"), - ApprovalGroups: cloudflare.F([]cloudflare.AccessAppPolicyNewParamsApprovalGroup{{ - ApprovalsNeeded: cloudflare.F(1.000000), - EmailAddresses: cloudflare.F([]interface{}{"test1@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("string"), - }, { - ApprovalsNeeded: cloudflare.F(3.000000), - EmailAddresses: cloudflare.F([]interface{}{"test@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("597147a1-976b-4ef2-9af0-81d5d007fc34"), - }}), - ApprovalRequired: cloudflare.F(true), - Exclude: cloudflare.F([]cloudflare.AccessAppPolicyNewParamsExclude{cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - IsolationRequired: cloudflare.F(false), - Precedence: cloudflare.F(int64(0)), - PurposeJustificationPrompt: cloudflare.F("Please enter a justification for entering this protected domain."), - PurposeJustificationRequired: cloudflare.F(true), - Require: cloudflare.F([]cloudflare.AccessAppPolicyNewParamsRequire{cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyNewParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - SessionDuration: cloudflare.F("24h"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestAccessAppPolicyUpdateWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.Update( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessAppPolicyUpdateParams{ - Decision: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsDecisionAllow), - Include: cloudflare.F([]cloudflare.AccessAppPolicyUpdateParamsInclude{cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - Name: cloudflare.F("Allow devs"), - ApprovalGroups: cloudflare.F([]cloudflare.AccessAppPolicyUpdateParamsApprovalGroup{{ - ApprovalsNeeded: cloudflare.F(1.000000), - EmailAddresses: cloudflare.F([]interface{}{"test1@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("string"), - }, { - ApprovalsNeeded: cloudflare.F(3.000000), - EmailAddresses: cloudflare.F([]interface{}{"test@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("597147a1-976b-4ef2-9af0-81d5d007fc34"), - }}), - ApprovalRequired: cloudflare.F(true), - Exclude: cloudflare.F([]cloudflare.AccessAppPolicyUpdateParamsExclude{cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - IsolationRequired: cloudflare.F(false), - Precedence: cloudflare.F(int64(0)), - PurposeJustificationPrompt: cloudflare.F("Please enter a justification for entering this protected domain."), - PurposeJustificationRequired: cloudflare.F(true), - Require: cloudflare.F([]cloudflare.AccessAppPolicyUpdateParamsRequire{cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyUpdateParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - SessionDuration: cloudflare.F("24h"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestAccessAppPolicyDelete(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.Delete( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestAccessAppPolicyAccessPoliciesNewAnAccessPolicyWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.AccessPoliciesNewAnAccessPolicy( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParams{ - Decision: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsDecisionAllow), - Include: cloudflare.F([]cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsInclude{cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - Name: cloudflare.F("Allow devs"), - ApprovalGroups: cloudflare.F([]cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsApprovalGroup{{ - ApprovalsNeeded: cloudflare.F(1.000000), - EmailAddresses: cloudflare.F([]interface{}{"test1@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("string"), - }, { - ApprovalsNeeded: cloudflare.F(3.000000), - EmailAddresses: cloudflare.F([]interface{}{"test@cloudflare.com", "test2@cloudflare.com"}), - EmailListUuid: cloudflare.F("597147a1-976b-4ef2-9af0-81d5d007fc34"), - }}), - ApprovalRequired: cloudflare.F(true), - Exclude: cloudflare.F([]cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExclude{cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - IsolationRequired: cloudflare.F(false), - Precedence: cloudflare.F(int64(0)), - PurposeJustificationPrompt: cloudflare.F("Please enter a justification for entering this protected domain."), - PurposeJustificationRequired: cloudflare.F(true), - Require: cloudflare.F([]cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequire{cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - SessionDuration: cloudflare.F("24h"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestAccessAppPolicyAccessPoliciesListAccessPolicies(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.AccessPoliciesListAccessPolicies( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestAccessAppPolicyGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Apps.Policies.Get( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/accessapprevoketoken.go b/accessapprevoketoken.go deleted file mode 100644 index 6fdd1f83aff..00000000000 --- a/accessapprevoketoken.go +++ /dev/null @@ -1,80 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// AccessAppRevokeTokenService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAccessAppRevokeTokenService] -// method instead. -type AccessAppRevokeTokenService struct { - Options []option.RequestOption -} - -// NewAccessAppRevokeTokenService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewAccessAppRevokeTokenService(opts ...option.RequestOption) (r *AccessAppRevokeTokenService) { - r = &AccessAppRevokeTokenService{} - r.Options = opts - return -} - -// Revokes all tokens issued for an application. -func (r *AccessAppRevokeTokenService) AccessApplicationsRevokeServiceTokens(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensParamsAppID, opts ...option.RequestOption) (res *AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%v/revoke_tokens", accountOrZone, accountOrZoneID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponse = interface{} - -// Identifier -// -// Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensParamsAppID interface { - ImplementsAccessAppRevokeTokenAccessApplicationsRevokeServiceTokensParamsAppID() -} - -type AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelope struct { - Result AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponse `json:"result,nullable"` - Success AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccess `json:"success"` - JSON accessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeJSON `json:"-"` -} - -// accessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelope] -type accessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccess bool - -const ( - AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccessTrue AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccess = true - AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccessFalse AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponseEnvelopeSuccess = false -) diff --git a/accessappuserpolicycheck.go b/accessappuserpolicycheck.go deleted file mode 100644 index c5892dc5c64..00000000000 --- a/accessappuserpolicycheck.go +++ /dev/null @@ -1,229 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// AccessAppUserPolicyCheckService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewAccessAppUserPolicyCheckService] method instead. -type AccessAppUserPolicyCheckService struct { - Options []option.RequestOption -} - -// NewAccessAppUserPolicyCheckService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewAccessAppUserPolicyCheckService(opts ...option.RequestOption) (r *AccessAppUserPolicyCheckService) { - r = &AccessAppUserPolicyCheckService{} - r.Options = opts - return -} - -// Tests if a specific user has permission to access an application. -func (r *AccessAppUserPolicyCheckService) AccessApplicationsTestAccessPolicies(ctx context.Context, accountOrZone string, accountOrZoneID string, appID AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesParamsAppID, opts ...option.RequestOption) (res *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelope - path := fmt.Sprintf("%s/%s/access/apps/%v/user_policy_checks", accountOrZone, accountOrZoneID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse struct { - AppState AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppState `json:"app_state"` - UserIdentity AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentity `json:"user_identity"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseJSON struct { - AppState apijson.Field - UserIdentity apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppState struct { - // UUID - AppUid string `json:"app_uid"` - Aud string `json:"aud"` - Hostname string `json:"hostname"` - Name string `json:"name"` - Policies []interface{} `json:"policies"` - Status string `json:"status"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppStateJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppStateJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppState] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppStateJSON struct { - AppUid apijson.Field - Aud apijson.Field - Hostname apijson.Field - Name apijson.Field - Policies apijson.Field - Status apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseAppState) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentity struct { - ID string `json:"id"` - AccountID string `json:"account_id"` - DeviceSessions interface{} `json:"device_sessions"` - Email string `json:"email"` - Geo AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeo `json:"geo"` - Iat int64 `json:"iat"` - IsGateway bool `json:"is_gateway"` - IsWarp bool `json:"is_warp"` - Name string `json:"name"` - // UUID - UserUuid string `json:"user_uuid"` - Version int64 `json:"version"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentity] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityJSON struct { - ID apijson.Field - AccountID apijson.Field - DeviceSessions apijson.Field - Email apijson.Field - Geo apijson.Field - Iat apijson.Field - IsGateway apijson.Field - IsWarp apijson.Field - Name apijson.Field - UserUuid apijson.Field - Version apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentity) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeo struct { - Country string `json:"country"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeoJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeoJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeo] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeoJSON struct { - Country apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseUserIdentityGeo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Identifier -// -// Satisfied by [shared.UnionString], [shared.UnionString]. -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesParamsAppID interface { - ImplementsAccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesParamsAppID() -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelope struct { - Errors []AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessages `json:"messages,required"` - Result AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse `json:"result,required"` - // Whether the API call was successful - Success AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeSuccess `json:"success,required"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelope] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrors] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessages] -type accessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeSuccess bool - -const ( - AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeSuccessTrue AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponseEnvelopeSuccess = true -) diff --git a/accessbookmark.go b/accessbookmark.go index 28de471d9a7..1a0a4373a47 100644 --- a/accessbookmark.go +++ b/accessbookmark.go @@ -31,12 +31,12 @@ func NewAccessBookmarkService(opts ...option.RequestOption) (r *AccessBookmarkSe return } -// Updates a configured Bookmark application. -func (r *AccessBookmarkService) Update(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *AccessBookmarkUpdateResponse, err error) { +// Lists Bookmark applications. +func (r *AccessBookmarkService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]AccessBookmarkListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessBookmarkUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/access/bookmarks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + var env AccessBookmarkListResponseEnvelope + path := fmt.Sprintf("accounts/%v/access/bookmarks", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -57,11 +57,11 @@ func (r *AccessBookmarkService) Delete(ctx context.Context, identifier interface return } -// Lists Bookmark applications. -func (r *AccessBookmarkService) AccessBookmarkApplicationsDeprecatedListBookmarkApplications(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse, err error) { +// Fetches a single Bookmark application. +func (r *AccessBookmarkService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *AccessBookmarkGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelope - path := fmt.Sprintf("accounts/%v/access/bookmarks", identifier) + var env AccessBookmarkGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/access/bookmarks/%s", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -70,12 +70,12 @@ func (r *AccessBookmarkService) AccessBookmarkApplicationsDeprecatedListBookmark return } -// Fetches a single Bookmark application. -func (r *AccessBookmarkService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *AccessBookmarkGetResponse, err error) { +// Updates a configured Bookmark application. +func (r *AccessBookmarkService) Replace(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *AccessBookmarkReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessBookmarkGetResponseEnvelope + var env AccessBookmarkReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/access/bookmarks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return } @@ -83,7 +83,7 @@ func (r *AccessBookmarkService) Get(ctx context.Context, identifier interface{}, return } -type AccessBookmarkUpdateResponse struct { +type AccessBookmarkListResponse struct { // The unique identifier for the Bookmark application. ID interface{} `json:"id"` // Displays the application in the App Launcher. @@ -94,14 +94,14 @@ type AccessBookmarkUpdateResponse struct { // The image URL for the logo shown in the App Launcher dashboard. LogoURL string `json:"logo_url"` // The name of the Bookmark application. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessBookmarkUpdateResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessBookmarkListResponseJSON `json:"-"` } -// accessBookmarkUpdateResponseJSON contains the JSON metadata for the struct -// [AccessBookmarkUpdateResponse] -type accessBookmarkUpdateResponseJSON struct { +// accessBookmarkListResponseJSON contains the JSON metadata for the struct +// [AccessBookmarkListResponse] +type accessBookmarkListResponseJSON struct { ID apijson.Field AppLauncherVisible apijson.Field CreatedAt apijson.Field @@ -113,7 +113,7 @@ type accessBookmarkUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -135,7 +135,7 @@ func (r *AccessBookmarkDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse struct { +type AccessBookmarkGetResponse struct { // The unique identifier for the Bookmark application. ID interface{} `json:"id"` // Displays the application in the App Launcher. @@ -146,15 +146,14 @@ type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsR // The image URL for the logo shown in the App Launcher dashboard. LogoURL string `json:"logo_url"` // The name of the Bookmark application. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessBookmarkGetResponseJSON `json:"-"` } -// accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseJSON -// contains the JSON metadata for the struct -// [AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse] -type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseJSON struct { +// accessBookmarkGetResponseJSON contains the JSON metadata for the struct +// [AccessBookmarkGetResponse] +type accessBookmarkGetResponseJSON struct { ID apijson.Field AppLauncherVisible apijson.Field CreatedAt apijson.Field @@ -166,11 +165,11 @@ type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsR ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkGetResponse struct { +type AccessBookmarkReplaceResponse struct { // The unique identifier for the Bookmark application. ID interface{} `json:"id"` // Displays the application in the App Launcher. @@ -181,14 +180,14 @@ type AccessBookmarkGetResponse struct { // The image URL for the logo shown in the App Launcher dashboard. LogoURL string `json:"logo_url"` // The name of the Bookmark application. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessBookmarkGetResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessBookmarkReplaceResponseJSON `json:"-"` } -// accessBookmarkGetResponseJSON contains the JSON metadata for the struct -// [AccessBookmarkGetResponse] -type accessBookmarkGetResponseJSON struct { +// accessBookmarkReplaceResponseJSON contains the JSON metadata for the struct +// [AccessBookmarkReplaceResponse] +type accessBookmarkReplaceResponseJSON struct { ID apijson.Field AppLauncherVisible apijson.Field CreatedAt apijson.Field @@ -200,79 +199,108 @@ type accessBookmarkGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkUpdateResponseEnvelope struct { - Errors []AccessBookmarkUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessBookmarkUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessBookmarkUpdateResponse `json:"result,required"` +type AccessBookmarkListResponseEnvelope struct { + Errors []AccessBookmarkListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessBookmarkListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessBookmarkListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessBookmarkUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessBookmarkUpdateResponseEnvelopeJSON `json:"-"` + Success AccessBookmarkListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessBookmarkListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessBookmarkListResponseEnvelopeJSON `json:"-"` } -// accessBookmarkUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessBookmarkUpdateResponseEnvelope] -type accessBookmarkUpdateResponseEnvelopeJSON struct { +// accessBookmarkListResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessBookmarkListResponseEnvelope] +type accessBookmarkListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessBookmarkListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkListResponseEnvelopeErrorsJSON `json:"-"` } -// accessBookmarkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessBookmarkUpdateResponseEnvelopeErrors] -type accessBookmarkUpdateResponseEnvelopeErrorsJSON struct { +// accessBookmarkListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessBookmarkListResponseEnvelopeErrors] +type accessBookmarkListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessBookmarkListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkListResponseEnvelopeMessagesJSON `json:"-"` } -// accessBookmarkUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessBookmarkUpdateResponseEnvelopeMessages] -type accessBookmarkUpdateResponseEnvelopeMessagesJSON struct { +// accessBookmarkListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessBookmarkListResponseEnvelopeMessages] +type accessBookmarkListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessBookmarkUpdateResponseEnvelopeSuccess bool +type AccessBookmarkListResponseEnvelopeSuccess bool const ( - AccessBookmarkUpdateResponseEnvelopeSuccessTrue AccessBookmarkUpdateResponseEnvelopeSuccess = true + AccessBookmarkListResponseEnvelopeSuccessTrue AccessBookmarkListResponseEnvelopeSuccess = true ) +type AccessBookmarkListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessBookmarkListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessBookmarkListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [AccessBookmarkListResponseEnvelopeResultInfo] +type accessBookmarkListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessBookmarkListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AccessBookmarkDeleteResponseEnvelope struct { Errors []AccessBookmarkDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessBookmarkDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -342,120 +370,87 @@ const ( AccessBookmarkDeleteResponseEnvelopeSuccessTrue AccessBookmarkDeleteResponseEnvelopeSuccess = true ) -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelope struct { - Errors []AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessages `json:"messages,required"` - Result []AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse `json:"result,required,nullable"` +type AccessBookmarkGetResponseEnvelope struct { + Errors []AccessBookmarkGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessBookmarkGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessBookmarkGetResponse `json:"result,required"` // Whether the API call was successful - Success AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfo `json:"result_info"` - JSON accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeJSON `json:"-"` + Success AccessBookmarkGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessBookmarkGetResponseEnvelopeJSON `json:"-"` } -// accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelope] -type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeJSON struct { +// accessBookmarkGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessBookmarkGetResponseEnvelope] +type accessBookmarkGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrorsJSON `json:"-"` +type AccessBookmarkGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkGetResponseEnvelopeErrorsJSON `json:"-"` } -// accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrors] -type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrorsJSON struct { +// accessBookmarkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessBookmarkGetResponseEnvelopeErrors] +type accessBookmarkGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessagesJSON `json:"-"` +type AccessBookmarkGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkGetResponseEnvelopeMessagesJSON `json:"-"` } -// accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessages] -type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessagesJSON struct { +// accessBookmarkGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessBookmarkGetResponseEnvelopeMessages] +type accessBookmarkGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeSuccess bool +type AccessBookmarkGetResponseEnvelopeSuccess bool const ( - AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeSuccessTrue AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeSuccess = true + AccessBookmarkGetResponseEnvelopeSuccessTrue AccessBookmarkGetResponseEnvelopeSuccess = true ) -type AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfo] -type accessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessBookmarkGetResponseEnvelope struct { - Errors []AccessBookmarkGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessBookmarkGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessBookmarkGetResponse `json:"result,required"` +type AccessBookmarkReplaceResponseEnvelope struct { + Errors []AccessBookmarkReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessBookmarkReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessBookmarkReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessBookmarkGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessBookmarkGetResponseEnvelopeJSON `json:"-"` + Success AccessBookmarkReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessBookmarkReplaceResponseEnvelopeJSON `json:"-"` } -// accessBookmarkGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessBookmarkGetResponseEnvelope] -type accessBookmarkGetResponseEnvelopeJSON struct { +// accessBookmarkReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessBookmarkReplaceResponseEnvelope] +type accessBookmarkReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -464,51 +459,51 @@ type accessBookmarkGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkGetResponseEnvelopeErrorsJSON `json:"-"` +type AccessBookmarkReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessBookmarkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessBookmarkGetResponseEnvelopeErrors] -type accessBookmarkGetResponseEnvelopeErrorsJSON struct { +// accessBookmarkReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessBookmarkReplaceResponseEnvelopeErrors] +type accessBookmarkReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessBookmarkGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessBookmarkGetResponseEnvelopeMessagesJSON `json:"-"` +type AccessBookmarkReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessBookmarkReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessBookmarkGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessBookmarkGetResponseEnvelopeMessages] -type accessBookmarkGetResponseEnvelopeMessagesJSON struct { +// accessBookmarkReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessBookmarkReplaceResponseEnvelopeMessages] +type accessBookmarkReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessBookmarkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessBookmarkReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessBookmarkGetResponseEnvelopeSuccess bool +type AccessBookmarkReplaceResponseEnvelopeSuccess bool const ( - AccessBookmarkGetResponseEnvelopeSuccessTrue AccessBookmarkGetResponseEnvelopeSuccess = true + AccessBookmarkReplaceResponseEnvelopeSuccessTrue AccessBookmarkReplaceResponseEnvelopeSuccess = true ) diff --git a/accessbookmark_test.go b/accessbookmark_test.go index 015d37fb458..674413ccb42 100644 --- a/accessbookmark_test.go +++ b/accessbookmark_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessBookmarkUpdate(t *testing.T) { +func TestAccessBookmarkList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,7 @@ func TestAccessBookmarkUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Bookmarks.Update( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Access.Bookmarks.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -73,7 +69,7 @@ func TestAccessBookmarkDelete(t *testing.T) { } } -func TestAccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplications(t *testing.T) { +func TestAccessBookmarkGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,7 +85,11 @@ func TestAccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicati option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Bookmarks.AccessBookmarkApplicationsDeprecatedListBookmarkApplications(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Access.Bookmarks.Get( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -99,7 +99,7 @@ func TestAccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicati } } -func TestAccessBookmarkGet(t *testing.T) { +func TestAccessBookmarkReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -115,7 +115,7 @@ func TestAccessBookmarkGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Bookmarks.Get( + _, err := client.Access.Bookmarks.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/accesscertificate.go b/accesscertificate.go index 56e16b7bc86..908167d94bc 100644 --- a/accesscertificate.go +++ b/accesscertificate.go @@ -34,12 +34,12 @@ func NewAccessCertificateService(opts ...option.RequestOption) (r *AccessCertifi return } -// Updates a configured mTLS certificate. -func (r *AccessCertificateService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessCertificateUpdateParams, opts ...option.RequestOption) (res *AccessCertificateUpdateResponse, err error) { +// Adds a new mTLS root certificate to Access. +func (r *AccessCertificateService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessCertificateNewParams, opts ...option.RequestOption) (res *AccessCertificateNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/certificates/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AccessCertificateNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/certificates", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *AccessCertificateService) Update(ctx context.Context, accountOrZone str return } -// Deletes an mTLS certificate. -func (r *AccessCertificateService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessCertificateDeleteResponse, err error) { +// Lists all mTLS root certificates. +func (r *AccessCertificateService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessCertificateListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateDeleteResponseEnvelope - path := fmt.Sprintf("%s/%s/access/certificates/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env AccessCertificateListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/certificates", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -60,12 +60,12 @@ func (r *AccessCertificateService) Delete(ctx context.Context, accountOrZone str return } -// Adds a new mTLS root certificate to Access. -func (r *AccessCertificateService) AccessMTLSAuthenticationAddAnMTLSCertificate(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateParams, opts ...option.RequestOption) (res *AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse, err error) { +// Deletes an mTLS certificate. +func (r *AccessCertificateService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessCertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/certificates", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AccessCertificateDeleteResponseEnvelope + path := fmt.Sprintf("%s/%s/access/certificates/%s", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -73,11 +73,11 @@ func (r *AccessCertificateService) AccessMTLSAuthenticationAddAnMTLSCertificate( return } -// Lists all mTLS root certificates. -func (r *AccessCertificateService) AccessMTLSAuthenticationListMTLSCertificates(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse, err error) { +// Fetches a single mTLS certificate. +func (r *AccessCertificateService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessCertificateGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelope - path := fmt.Sprintf("%s/%s/access/certificates", accountOrZone, accountOrZoneID) + var env AccessCertificateGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/certificates/%s", accountOrZone, accountOrZoneID, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -86,12 +86,12 @@ func (r *AccessCertificateService) AccessMTLSAuthenticationListMTLSCertificates( return } -// Fetches a single mTLS certificate. -func (r *AccessCertificateService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessCertificateGetResponse, err error) { +// Updates a configured mTLS certificate. +func (r *AccessCertificateService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessCertificateReplaceParams, opts ...option.RequestOption) (res *AccessCertificateReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateGetResponseEnvelope + var env AccessCertificateReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/certificates/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -99,7 +99,7 @@ func (r *AccessCertificateService) Get(ctx context.Context, accountOrZone string return } -type AccessCertificateUpdateResponse struct { +type AccessCertificateNewResponse struct { // The ID of the application that will use this certificate. ID interface{} `json:"id"` // The hostnames of the applications that will use this certificate. @@ -109,14 +109,14 @@ type AccessCertificateUpdateResponse struct { // The MD5 fingerprint of the certificate. Fingerprint string `json:"fingerprint"` // The name of the certificate. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessCertificateUpdateResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessCertificateNewResponseJSON `json:"-"` } -// accessCertificateUpdateResponseJSON contains the JSON metadata for the struct -// [AccessCertificateUpdateResponse] -type accessCertificateUpdateResponseJSON struct { +// accessCertificateNewResponseJSON contains the JSON metadata for the struct +// [AccessCertificateNewResponse] +type accessCertificateNewResponseJSON struct { ID apijson.Field AssociatedHostnames apijson.Field CreatedAt apijson.Field @@ -128,29 +128,11 @@ type accessCertificateUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateDeleteResponse struct { - // UUID - ID string `json:"id"` - JSON accessCertificateDeleteResponseJSON `json:"-"` -} - -// accessCertificateDeleteResponseJSON contains the JSON metadata for the struct -// [AccessCertificateDeleteResponse] -type accessCertificateDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse struct { +type AccessCertificateListResponse struct { // The ID of the application that will use this certificate. ID interface{} `json:"id"` // The hostnames of the applications that will use this certificate. @@ -160,15 +142,14 @@ type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse struc // The MD5 fingerprint of the certificate. Fingerprint string `json:"fingerprint"` // The name of the certificate. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessCertificateListResponseJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse] -type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseJSON struct { +// accessCertificateListResponseJSON contains the JSON metadata for the struct +// [AccessCertificateListResponse] +type accessCertificateListResponseJSON struct { ID apijson.Field AssociatedHostnames apijson.Field CreatedAt apijson.Field @@ -180,11 +161,29 @@ type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseJSON s ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessCertificateDeleteResponse struct { + // UUID + ID string `json:"id"` + JSON accessCertificateDeleteResponseJSON `json:"-"` +} + +// accessCertificateDeleteResponseJSON contains the JSON metadata for the struct +// [AccessCertificateDeleteResponse] +type accessCertificateDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse struct { +type AccessCertificateGetResponse struct { // The ID of the application that will use this certificate. ID interface{} `json:"id"` // The hostnames of the applications that will use this certificate. @@ -194,15 +193,14 @@ type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse struc // The MD5 fingerprint of the certificate. Fingerprint string `json:"fingerprint"` // The name of the certificate. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessCertificateGetResponseJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse] -type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseJSON struct { +// accessCertificateGetResponseJSON contains the JSON metadata for the struct +// [AccessCertificateGetResponse] +type accessCertificateGetResponseJSON struct { ID apijson.Field AssociatedHostnames apijson.Field CreatedAt apijson.Field @@ -214,11 +212,11 @@ type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseJSON s ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateGetResponse struct { +type AccessCertificateReplaceResponse struct { // The ID of the application that will use this certificate. ID interface{} `json:"id"` // The hostnames of the applications that will use this certificate. @@ -228,14 +226,14 @@ type AccessCertificateGetResponse struct { // The MD5 fingerprint of the certificate. Fingerprint string `json:"fingerprint"` // The name of the certificate. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessCertificateGetResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessCertificateReplaceResponseJSON `json:"-"` } -// accessCertificateGetResponseJSON contains the JSON metadata for the struct -// [AccessCertificateGetResponse] -type accessCertificateGetResponseJSON struct { +// accessCertificateReplaceResponseJSON contains the JSON metadata for the struct +// [AccessCertificateReplaceResponse] +type accessCertificateReplaceResponseJSON struct { ID apijson.Field AssociatedHostnames apijson.Field CreatedAt apijson.Field @@ -247,33 +245,35 @@ type accessCertificateGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateUpdateParams struct { - // The hostnames of the applications that will use this certificate. - AssociatedHostnames param.Field[[]string] `json:"associated_hostnames,required"` +type AccessCertificateNewParams struct { + // The certificate content. + Certificate param.Field[string] `json:"certificate,required"` // The name of the certificate. - Name param.Field[string] `json:"name"` + Name param.Field[string] `json:"name,required"` + // The hostnames of the applications that will use this certificate. + AssociatedHostnames param.Field[[]string] `json:"associated_hostnames"` } -func (r AccessCertificateUpdateParams) MarshalJSON() (data []byte, err error) { +func (r AccessCertificateNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessCertificateUpdateResponseEnvelope struct { - Errors []AccessCertificateUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessCertificateUpdateResponse `json:"result,required"` +type AccessCertificateNewResponseEnvelope struct { + Errors []AccessCertificateNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessCertificateNewResponse `json:"result,required"` // Whether the API call was successful - Success AccessCertificateUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessCertificateUpdateResponseEnvelopeJSON `json:"-"` + Success AccessCertificateNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessCertificateNewResponseEnvelopeJSON `json:"-"` } -// accessCertificateUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessCertificateUpdateResponseEnvelope] -type accessCertificateUpdateResponseEnvelopeJSON struct { +// accessCertificateNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCertificateNewResponseEnvelope] +type accessCertificateNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -282,150 +282,165 @@ type accessCertificateUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateNewResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessCertificateUpdateResponseEnvelopeErrors] -type accessCertificateUpdateResponseEnvelopeErrorsJSON struct { +// accessCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessCertificateNewResponseEnvelopeErrors] +type accessCertificateNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateNewResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AccessCertificateUpdateResponseEnvelopeMessages] -type accessCertificateUpdateResponseEnvelopeMessagesJSON struct { +// accessCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessCertificateNewResponseEnvelopeMessages] +type accessCertificateNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateUpdateResponseEnvelopeSuccess bool +type AccessCertificateNewResponseEnvelopeSuccess bool const ( - AccessCertificateUpdateResponseEnvelopeSuccessTrue AccessCertificateUpdateResponseEnvelopeSuccess = true + AccessCertificateNewResponseEnvelopeSuccessTrue AccessCertificateNewResponseEnvelopeSuccess = true ) -type AccessCertificateDeleteResponseEnvelope struct { - Errors []AccessCertificateDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AccessCertificateDeleteResponse `json:"result,required"` +type AccessCertificateListResponseEnvelope struct { + Errors []AccessCertificateListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessCertificateListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessCertificateDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON accessCertificateDeleteResponseEnvelopeJSON `json:"-"` + Success AccessCertificateListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessCertificateListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessCertificateListResponseEnvelopeJSON `json:"-"` } -// accessCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessCertificateDeleteResponseEnvelope] -type accessCertificateDeleteResponseEnvelopeJSON struct { +// accessCertificateListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCertificateListResponseEnvelope] +type accessCertificateListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateListResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessCertificateDeleteResponseEnvelopeErrors] -type accessCertificateDeleteResponseEnvelopeErrorsJSON struct { +// accessCertificateListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessCertificateListResponseEnvelopeErrors] +type accessCertificateListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateListResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AccessCertificateDeleteResponseEnvelopeMessages] -type accessCertificateDeleteResponseEnvelopeMessagesJSON struct { +// accessCertificateListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessCertificateListResponseEnvelopeMessages] +type accessCertificateListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateDeleteResponseEnvelopeSuccess bool +type AccessCertificateListResponseEnvelopeSuccess bool const ( - AccessCertificateDeleteResponseEnvelopeSuccessTrue AccessCertificateDeleteResponseEnvelopeSuccess = true + AccessCertificateListResponseEnvelopeSuccessTrue AccessCertificateListResponseEnvelopeSuccess = true ) -type AccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateParams struct { - // The certificate content. - Certificate param.Field[string] `json:"certificate,required"` - // The name of the certificate. - Name param.Field[string] `json:"name,required"` - // The hostnames of the applications that will use this certificate. - AssociatedHostnames param.Field[[]string] `json:"associated_hostnames"` +type AccessCertificateListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessCertificateListResponseEnvelopeResultInfoJSON `json:"-"` } -func (r AccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accessCertificateListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AccessCertificateListResponseEnvelopeResultInfo] +type accessCertificateListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelope struct { - Errors []AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessages `json:"messages,required"` - Result AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse `json:"result,required"` +type AccessCertificateDeleteResponseEnvelope struct { + Errors []AccessCertificateDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AccessCertificateDeleteResponse `json:"result,required"` // Whether the API call was successful - Success AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeSuccess `json:"success,required"` - JSON accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeJSON `json:"-"` + Success AccessCertificateDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON accessCertificateDeleteResponseEnvelopeJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelope] -type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeJSON struct { +// accessCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCertificateDeleteResponseEnvelope] +type accessCertificateDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -434,171 +449,147 @@ type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelo ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrors] -type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrorsJSON struct { +// accessCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessCertificateDeleteResponseEnvelopeErrors] +type accessCertificateDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessages] -type accessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessagesJSON struct { +// accessCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessCertificateDeleteResponseEnvelopeMessages] +type accessCertificateDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeSuccess bool +type AccessCertificateDeleteResponseEnvelopeSuccess bool const ( - AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeSuccessTrue AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponseEnvelopeSuccess = true + AccessCertificateDeleteResponseEnvelopeSuccessTrue AccessCertificateDeleteResponseEnvelopeSuccess = true ) -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelope struct { - Errors []AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessages `json:"messages,required"` - Result []AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse `json:"result,required,nullable"` +type AccessCertificateGetResponseEnvelope struct { + Errors []AccessCertificateGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessCertificateGetResponse `json:"result,required"` // Whether the API call was successful - Success AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfo `json:"result_info"` - JSON accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeJSON `json:"-"` + Success AccessCertificateGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessCertificateGetResponseEnvelopeJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelope] -type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeJSON struct { +// accessCertificateGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCertificateGetResponseEnvelope] +type accessCertificateGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateGetResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrors] -type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrorsJSON struct { +// accessCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessCertificateGetResponseEnvelopeErrors] +type accessCertificateGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateGetResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessages] -type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessagesJSON struct { +// accessCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessCertificateGetResponseEnvelopeMessages] +type accessCertificateGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeSuccess bool +type AccessCertificateGetResponseEnvelopeSuccess bool const ( - AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeSuccessTrue AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeSuccess = true + AccessCertificateGetResponseEnvelopeSuccessTrue AccessCertificateGetResponseEnvelopeSuccess = true ) -type AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfo] -type accessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field +type AccessCertificateReplaceParams struct { + // The hostnames of the applications that will use this certificate. + AssociatedHostnames param.Field[[]string] `json:"associated_hostnames,required"` + // The name of the certificate. + Name param.Field[string] `json:"name"` } -func (r *AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r AccessCertificateReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type AccessCertificateGetResponseEnvelope struct { - Errors []AccessCertificateGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessCertificateGetResponse `json:"result,required"` +type AccessCertificateReplaceResponseEnvelope struct { + Errors []AccessCertificateReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessCertificateReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessCertificateGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessCertificateGetResponseEnvelopeJSON `json:"-"` + Success AccessCertificateReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessCertificateReplaceResponseEnvelopeJSON `json:"-"` } -// accessCertificateGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessCertificateGetResponseEnvelope] -type accessCertificateGetResponseEnvelopeJSON struct { +// accessCertificateReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCertificateReplaceResponseEnvelope] +type accessCertificateReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -607,51 +598,51 @@ type accessCertificateGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateGetResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessCertificateGetResponseEnvelopeErrors] -type accessCertificateGetResponseEnvelopeErrorsJSON struct { +// accessCertificateReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessCertificateReplaceResponseEnvelopeErrors] +type accessCertificateReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateGetResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccessCertificateGetResponseEnvelopeMessages] -type accessCertificateGetResponseEnvelopeMessagesJSON struct { +// accessCertificateReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessCertificateReplaceResponseEnvelopeMessages] +type accessCertificateReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateGetResponseEnvelopeSuccess bool +type AccessCertificateReplaceResponseEnvelopeSuccess bool const ( - AccessCertificateGetResponseEnvelopeSuccessTrue AccessCertificateGetResponseEnvelopeSuccess = true + AccessCertificateReplaceResponseEnvelopeSuccessTrue AccessCertificateReplaceResponseEnvelopeSuccess = true ) diff --git a/accesscertificate_test.go b/accesscertificate_test.go index 48bc570cb64..8af140541c4 100644 --- a/accesscertificate_test.go +++ b/accesscertificate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessCertificateUpdateWithOptionalParams(t *testing.T) { +func TestAccessCertificateNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,14 @@ func TestAccessCertificateUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.Update( + _, err := client.Access.Certificates.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessCertificateUpdateParams{ - AssociatedHostnames: cloudflare.F([]string{"admin.example.com", "admin.example.com", "admin.example.com"}), + cloudflare.AccessCertificateNewParams{ + Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----"), Name: cloudflare.F("Allow devs"), + AssociatedHostnames: cloudflare.F([]string{"admin.example.com", "admin.example.com", "admin.example.com"}), }, ) if err != nil { @@ -48,7 +48,7 @@ func TestAccessCertificateUpdateWithOptionalParams(t *testing.T) { } } -func TestAccessCertificateDelete(t *testing.T) { +func TestAccessCertificateList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,11 +64,10 @@ func TestAccessCertificateDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.Delete( + _, err := client.Access.Certificates.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -79,7 +78,7 @@ func TestAccessCertificateDelete(t *testing.T) { } } -func TestAccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateWithOptionalParams(t *testing.T) { +func TestAccessCertificateDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -95,15 +94,11 @@ func TestAccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateWithOption option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.AccessMTLSAuthenticationAddAnMTLSCertificate( + _, err := client.Access.Certificates.Delete( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateParams{ - Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----"), - Name: cloudflare.F("Allow devs"), - AssociatedHostnames: cloudflare.F([]string{"admin.example.com", "admin.example.com", "admin.example.com"}), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -114,7 +109,7 @@ func TestAccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateWithOption } } -func TestAccessCertificateAccessMTLSAuthenticationListMTLSCertificates(t *testing.T) { +func TestAccessCertificateGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -130,10 +125,11 @@ func TestAccessCertificateAccessMTLSAuthenticationListMTLSCertificates(t *testin option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.AccessMTLSAuthenticationListMTLSCertificates( + _, err := client.Access.Certificates.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -144,7 +140,7 @@ func TestAccessCertificateAccessMTLSAuthenticationListMTLSCertificates(t *testin } } -func TestAccessCertificateGet(t *testing.T) { +func TestAccessCertificateReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -160,11 +156,15 @@ func TestAccessCertificateGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.Get( + _, err := client.Access.Certificates.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessCertificateReplaceParams{ + AssociatedHostnames: cloudflare.F([]string{"admin.example.com", "admin.example.com", "admin.example.com"}), + Name: cloudflare.F("Allow devs"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/accesscertificatesetting.go b/accesscertificatesetting.go index e6ce972840c..2ad01fa8644 100644 --- a/accesscertificatesetting.go +++ b/accesscertificatesetting.go @@ -31,12 +31,12 @@ func NewAccessCertificateSettingService(opts ...option.RequestOption) (r *Access return } -// Updates an mTLS certificate's hostname settings. -func (r *AccessCertificateSettingService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessCertificateSettingUpdateParams, opts ...option.RequestOption) (res *[]AccessCertificateSettingUpdateResponse, err error) { +// List all mTLS hostname settings for this account or zone. +func (r *AccessCertificateSettingService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessCertificateSettingListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateSettingUpdateResponseEnvelope + var env AccessCertificateSettingListResponseEnvelope path := fmt.Sprintf("%s/%s/access/certificates/settings", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *AccessCertificateSettingService) Update(ctx context.Context, accountOrZ return } -// List all mTLS hostname settings for this account or zone. -func (r *AccessCertificateSettingService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessCertificateSettingListResponse, err error) { +// Updates an mTLS certificate's hostname settings. +func (r *AccessCertificateSettingService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessCertificateSettingReplaceParams, opts ...option.RequestOption) (res *[]AccessCertificateSettingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessCertificateSettingListResponseEnvelope + var env AccessCertificateSettingReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/certificates/settings", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -57,7 +57,7 @@ func (r *AccessCertificateSettingService) List(ctx context.Context, accountOrZon return } -type AccessCertificateSettingUpdateResponse struct { +type AccessCertificateSettingListResponse struct { // Request client certificates for this hostname in China. Can only be set to true // if this zone is china network enabled. ChinaNetwork bool `json:"china_network,required"` @@ -66,13 +66,13 @@ type AccessCertificateSettingUpdateResponse struct { // allow logging on the origin. ClientCertificateForwarding bool `json:"client_certificate_forwarding,required"` // The hostname that these settings apply to. - Hostname string `json:"hostname,required"` - JSON accessCertificateSettingUpdateResponseJSON `json:"-"` + Hostname string `json:"hostname,required"` + JSON accessCertificateSettingListResponseJSON `json:"-"` } -// accessCertificateSettingUpdateResponseJSON contains the JSON metadata for the -// struct [AccessCertificateSettingUpdateResponse] -type accessCertificateSettingUpdateResponseJSON struct { +// accessCertificateSettingListResponseJSON contains the JSON metadata for the +// struct [AccessCertificateSettingListResponse] +type accessCertificateSettingListResponseJSON struct { ChinaNetwork apijson.Field ClientCertificateForwarding apijson.Field Hostname apijson.Field @@ -80,11 +80,11 @@ type accessCertificateSettingUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingListResponse struct { +type AccessCertificateSettingReplaceResponse struct { // Request client certificates for this hostname in China. Can only be set to true // if this zone is china network enabled. ChinaNetwork bool `json:"china_network,required"` @@ -93,13 +93,13 @@ type AccessCertificateSettingListResponse struct { // allow logging on the origin. ClientCertificateForwarding bool `json:"client_certificate_forwarding,required"` // The hostname that these settings apply to. - Hostname string `json:"hostname,required"` - JSON accessCertificateSettingListResponseJSON `json:"-"` + Hostname string `json:"hostname,required"` + JSON accessCertificateSettingReplaceResponseJSON `json:"-"` } -// accessCertificateSettingListResponseJSON contains the JSON metadata for the -// struct [AccessCertificateSettingListResponse] -type accessCertificateSettingListResponseJSON struct { +// accessCertificateSettingReplaceResponseJSON contains the JSON metadata for the +// struct [AccessCertificateSettingReplaceResponse] +type accessCertificateSettingReplaceResponseJSON struct { ChinaNetwork apijson.Field ClientCertificateForwarding apijson.Field Hostname apijson.Field @@ -107,47 +107,23 @@ type accessCertificateSettingListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingUpdateParams struct { - Settings param.Field[[]AccessCertificateSettingUpdateParamsSetting] `json:"settings,required"` -} - -func (r AccessCertificateSettingUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessCertificateSettingUpdateParamsSetting struct { - // Request client certificates for this hostname in China. Can only be set to true - // if this zone is china network enabled. - ChinaNetwork param.Field[bool] `json:"china_network,required"` - // Client Certificate Forwarding is a feature that takes the client cert provided - // by the eyeball to the edge, and forwards it to the origin as a HTTP header to - // allow logging on the origin. - ClientCertificateForwarding param.Field[bool] `json:"client_certificate_forwarding,required"` - // The hostname that these settings apply to. - Hostname param.Field[string] `json:"hostname,required"` -} - -func (r AccessCertificateSettingUpdateParamsSetting) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessCertificateSettingUpdateResponseEnvelope struct { - Errors []AccessCertificateSettingUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateSettingUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []AccessCertificateSettingUpdateResponse `json:"result,required,nullable"` +type AccessCertificateSettingListResponseEnvelope struct { + Errors []AccessCertificateSettingListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateSettingListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessCertificateSettingListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessCertificateSettingUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessCertificateSettingUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON accessCertificateSettingUpdateResponseEnvelopeJSON `json:"-"` + Success AccessCertificateSettingListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessCertificateSettingListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessCertificateSettingListResponseEnvelopeJSON `json:"-"` } -// accessCertificateSettingUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [AccessCertificateSettingUpdateResponseEnvelope] -type accessCertificateSettingUpdateResponseEnvelopeJSON struct { +// accessCertificateSettingListResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessCertificateSettingListResponseEnvelope] +type accessCertificateSettingListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -157,56 +133,56 @@ type accessCertificateSettingUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateSettingUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateSettingListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateSettingListResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateSettingUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AccessCertificateSettingUpdateResponseEnvelopeErrors] -type accessCertificateSettingUpdateResponseEnvelopeErrorsJSON struct { +// accessCertificateSettingListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessCertificateSettingListResponseEnvelopeErrors] +type accessCertificateSettingListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateSettingUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateSettingListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateSettingListResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateSettingUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AccessCertificateSettingUpdateResponseEnvelopeMessages] -type accessCertificateSettingUpdateResponseEnvelopeMessagesJSON struct { +// accessCertificateSettingListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessCertificateSettingListResponseEnvelopeMessages] +type accessCertificateSettingListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateSettingUpdateResponseEnvelopeSuccess bool +type AccessCertificateSettingListResponseEnvelopeSuccess bool const ( - AccessCertificateSettingUpdateResponseEnvelopeSuccessTrue AccessCertificateSettingUpdateResponseEnvelopeSuccess = true + AccessCertificateSettingListResponseEnvelopeSuccessTrue AccessCertificateSettingListResponseEnvelopeSuccess = true ) -type AccessCertificateSettingUpdateResponseEnvelopeResultInfo struct { +type AccessCertificateSettingListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -214,14 +190,13 @@ type AccessCertificateSettingUpdateResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessCertificateSettingUpdateResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON accessCertificateSettingListResponseEnvelopeResultInfoJSON `json:"-"` } -// accessCertificateSettingUpdateResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct -// [AccessCertificateSettingUpdateResponseEnvelopeResultInfo] -type accessCertificateSettingUpdateResponseEnvelopeResultInfoJSON struct { +// accessCertificateSettingListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AccessCertificateSettingListResponseEnvelopeResultInfo] +type accessCertificateSettingListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -230,23 +205,47 @@ type accessCertificateSettingUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingListResponseEnvelope struct { - Errors []AccessCertificateSettingListResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCertificateSettingListResponseEnvelopeMessages `json:"messages,required"` - Result []AccessCertificateSettingListResponse `json:"result,required,nullable"` +type AccessCertificateSettingReplaceParams struct { + Settings param.Field[[]AccessCertificateSettingReplaceParamsSetting] `json:"settings,required"` +} + +func (r AccessCertificateSettingReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessCertificateSettingReplaceParamsSetting struct { + // Request client certificates for this hostname in China. Can only be set to true + // if this zone is china network enabled. + ChinaNetwork param.Field[bool] `json:"china_network,required"` + // Client Certificate Forwarding is a feature that takes the client cert provided + // by the eyeball to the edge, and forwards it to the origin as a HTTP header to + // allow logging on the origin. + ClientCertificateForwarding param.Field[bool] `json:"client_certificate_forwarding,required"` + // The hostname that these settings apply to. + Hostname param.Field[string] `json:"hostname,required"` +} + +func (r AccessCertificateSettingReplaceParamsSetting) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessCertificateSettingReplaceResponseEnvelope struct { + Errors []AccessCertificateSettingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCertificateSettingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []AccessCertificateSettingReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessCertificateSettingListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessCertificateSettingListResponseEnvelopeResultInfo `json:"result_info"` - JSON accessCertificateSettingListResponseEnvelopeJSON `json:"-"` + Success AccessCertificateSettingReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessCertificateSettingReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON accessCertificateSettingReplaceResponseEnvelopeJSON `json:"-"` } -// accessCertificateSettingListResponseEnvelopeJSON contains the JSON metadata for -// the struct [AccessCertificateSettingListResponseEnvelope] -type accessCertificateSettingListResponseEnvelopeJSON struct { +// accessCertificateSettingReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [AccessCertificateSettingReplaceResponseEnvelope] +type accessCertificateSettingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -256,56 +255,57 @@ type accessCertificateSettingListResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateSettingListResponseEnvelopeErrorsJSON `json:"-"` +type AccessCertificateSettingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateSettingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessCertificateSettingListResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AccessCertificateSettingListResponseEnvelopeErrors] -type accessCertificateSettingListResponseEnvelopeErrorsJSON struct { +// accessCertificateSettingReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessCertificateSettingReplaceResponseEnvelopeErrors] +type accessCertificateSettingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessCertificateSettingListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCertificateSettingListResponseEnvelopeMessagesJSON `json:"-"` +type AccessCertificateSettingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCertificateSettingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessCertificateSettingListResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AccessCertificateSettingListResponseEnvelopeMessages] -type accessCertificateSettingListResponseEnvelopeMessagesJSON struct { +// accessCertificateSettingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AccessCertificateSettingReplaceResponseEnvelopeMessages] +type accessCertificateSettingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessCertificateSettingListResponseEnvelopeSuccess bool +type AccessCertificateSettingReplaceResponseEnvelopeSuccess bool const ( - AccessCertificateSettingListResponseEnvelopeSuccessTrue AccessCertificateSettingListResponseEnvelopeSuccess = true + AccessCertificateSettingReplaceResponseEnvelopeSuccessTrue AccessCertificateSettingReplaceResponseEnvelopeSuccess = true ) -type AccessCertificateSettingListResponseEnvelopeResultInfo struct { +type AccessCertificateSettingReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -313,13 +313,14 @@ type AccessCertificateSettingListResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessCertificateSettingListResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON accessCertificateSettingReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// accessCertificateSettingListResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AccessCertificateSettingListResponseEnvelopeResultInfo] -type accessCertificateSettingListResponseEnvelopeResultInfoJSON struct { +// accessCertificateSettingReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct +// [AccessCertificateSettingReplaceResponseEnvelopeResultInfo] +type accessCertificateSettingReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -328,6 +329,6 @@ type accessCertificateSettingListResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessCertificateSettingListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessCertificateSettingReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/accesscertificatesetting_test.go b/accesscertificatesetting_test.go index 2ed0d5b3ad2..be350c4acc9 100644 --- a/accesscertificatesetting_test.go +++ b/accesscertificatesetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessCertificateSettingUpdate(t *testing.T) { +func TestAccessCertificateSettingList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,25 +29,10 @@ func TestAccessCertificateSettingUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.Settings.Update( + _, err := client.Access.Certificates.Settings.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessCertificateSettingUpdateParams{ - Settings: cloudflare.F([]cloudflare.AccessCertificateSettingUpdateParamsSetting{{ - ChinaNetwork: cloudflare.F(false), - ClientCertificateForwarding: cloudflare.F(true), - Hostname: cloudflare.F("admin.example.com"), - }, { - ChinaNetwork: cloudflare.F(false), - ClientCertificateForwarding: cloudflare.F(true), - Hostname: cloudflare.F("admin.example.com"), - }, { - ChinaNetwork: cloudflare.F(false), - ClientCertificateForwarding: cloudflare.F(true), - Hostname: cloudflare.F("admin.example.com"), - }}), - }, ) if err != nil { var apierr *cloudflare.Error @@ -58,7 +43,7 @@ func TestAccessCertificateSettingUpdate(t *testing.T) { } } -func TestAccessCertificateSettingList(t *testing.T) { +func TestAccessCertificateSettingReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -74,10 +59,25 @@ func TestAccessCertificateSettingList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Certificates.Settings.List( + _, err := client.Access.Certificates.Settings.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.AccessCertificateSettingReplaceParams{ + Settings: cloudflare.F([]cloudflare.AccessCertificateSettingReplaceParamsSetting{{ + ChinaNetwork: cloudflare.F(false), + ClientCertificateForwarding: cloudflare.F(true), + Hostname: cloudflare.F("admin.example.com"), + }, { + ChinaNetwork: cloudflare.F(false), + ClientCertificateForwarding: cloudflare.F(true), + Hostname: cloudflare.F("admin.example.com"), + }, { + ChinaNetwork: cloudflare.F(false), + ClientCertificateForwarding: cloudflare.F(true), + Hostname: cloudflare.F("admin.example.com"), + }}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/accesscustompage.go b/accesscustompage.go index 841eecb2c3d..69021972ae0 100644 --- a/accesscustompage.go +++ b/accesscustompage.go @@ -45,19 +45,6 @@ func (r *AccessCustomPageService) New(ctx context.Context, identifier string, bo return } -// Update a custom page -func (r *AccessCustomPageService) Update(ctx context.Context, identifier string, uuid string, body AccessCustomPageUpdateParams, opts ...option.RequestOption) (res *AccessCustomPageUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessCustomPageUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/access/custom_pages/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List custom pages func (r *AccessCustomPageService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *[]AccessCustomPageListResponse, err error) { opts = append(r.Options[:], opts...) @@ -97,6 +84,19 @@ func (r *AccessCustomPageService) Get(ctx context.Context, identifier string, uu return } +// Update a custom page +func (r *AccessCustomPageService) Replace(ctx context.Context, identifier string, uuid string, body AccessCustomPageReplaceParams, opts ...option.RequestOption) (res *AccessCustomPageReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessCustomPageReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/custom_pages/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type AccessCustomPageNewResponse struct { // Custom page name. Name string `json:"name,required"` @@ -136,45 +136,6 @@ const ( AccessCustomPageNewResponseTypeForbidden AccessCustomPageNewResponseType = "forbidden" ) -type AccessCustomPageUpdateResponse struct { - // Custom page name. - Name string `json:"name,required"` - // Custom page type. - Type AccessCustomPageUpdateResponseType `json:"type,required"` - // Number of apps the custom page is assigned to. - AppCount int64 `json:"app_count"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // UUID - Uid string `json:"uid"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessCustomPageUpdateResponseJSON `json:"-"` -} - -// accessCustomPageUpdateResponseJSON contains the JSON metadata for the struct -// [AccessCustomPageUpdateResponse] -type accessCustomPageUpdateResponseJSON struct { - Name apijson.Field - Type apijson.Field - AppCount apijson.Field - CreatedAt apijson.Field - Uid apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessCustomPageUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Custom page type. -type AccessCustomPageUpdateResponseType string - -const ( - AccessCustomPageUpdateResponseTypeIdentityDenied AccessCustomPageUpdateResponseType = "identity_denied" - AccessCustomPageUpdateResponseTypeForbidden AccessCustomPageUpdateResponseType = "forbidden" -) - type AccessCustomPageListResponse struct { // Custom page name. Name string `json:"name,required"` @@ -274,6 +235,45 @@ const ( AccessCustomPageGetResponseTypeForbidden AccessCustomPageGetResponseType = "forbidden" ) +type AccessCustomPageReplaceResponse struct { + // Custom page name. + Name string `json:"name,required"` + // Custom page type. + Type AccessCustomPageReplaceResponseType `json:"type,required"` + // Number of apps the custom page is assigned to. + AppCount int64 `json:"app_count"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // UUID + Uid string `json:"uid"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessCustomPageReplaceResponseJSON `json:"-"` +} + +// accessCustomPageReplaceResponseJSON contains the JSON metadata for the struct +// [AccessCustomPageReplaceResponse] +type accessCustomPageReplaceResponseJSON struct { + Name apijson.Field + Type apijson.Field + AppCount apijson.Field + CreatedAt apijson.Field + Uid apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCustomPageReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Custom page type. +type AccessCustomPageReplaceResponseType string + +const ( + AccessCustomPageReplaceResponseTypeIdentityDenied AccessCustomPageReplaceResponseType = "identity_denied" + AccessCustomPageReplaceResponseTypeForbidden AccessCustomPageReplaceResponseType = "forbidden" +) + type AccessCustomPageNewParams struct { // Custom page HTML. CustomHTML param.Field[string] `json:"custom_html,required"` @@ -366,98 +366,6 @@ const ( AccessCustomPageNewResponseEnvelopeSuccessTrue AccessCustomPageNewResponseEnvelopeSuccess = true ) -type AccessCustomPageUpdateParams struct { - // Custom page HTML. - CustomHTML param.Field[string] `json:"custom_html,required"` - // Custom page name. - Name param.Field[string] `json:"name,required"` - // Custom page type. - Type param.Field[AccessCustomPageUpdateParamsType] `json:"type,required"` - // Number of apps the custom page is assigned to. - AppCount param.Field[int64] `json:"app_count"` -} - -func (r AccessCustomPageUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Custom page type. -type AccessCustomPageUpdateParamsType string - -const ( - AccessCustomPageUpdateParamsTypeIdentityDenied AccessCustomPageUpdateParamsType = "identity_denied" - AccessCustomPageUpdateParamsTypeForbidden AccessCustomPageUpdateParamsType = "forbidden" -) - -type AccessCustomPageUpdateResponseEnvelope struct { - Errors []AccessCustomPageUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessCustomPageUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessCustomPageUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success AccessCustomPageUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessCustomPageUpdateResponseEnvelopeJSON `json:"-"` -} - -// accessCustomPageUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessCustomPageUpdateResponseEnvelope] -type accessCustomPageUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessCustomPageUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessCustomPageUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCustomPageUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessCustomPageUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AccessCustomPageUpdateResponseEnvelopeErrors] -type accessCustomPageUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessCustomPageUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessCustomPageUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessCustomPageUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessCustomPageUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AccessCustomPageUpdateResponseEnvelopeMessages] -type accessCustomPageUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessCustomPageUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessCustomPageUpdateResponseEnvelopeSuccess bool - -const ( - AccessCustomPageUpdateResponseEnvelopeSuccessTrue AccessCustomPageUpdateResponseEnvelopeSuccess = true -) - type AccessCustomPageListResponseEnvelope struct { Errors []AccessCustomPageListResponseEnvelopeErrors `json:"errors,required"` Messages []AccessCustomPageListResponseEnvelopeMessages `json:"messages,required"` @@ -693,3 +601,95 @@ type AccessCustomPageGetResponseEnvelopeSuccess bool const ( AccessCustomPageGetResponseEnvelopeSuccessTrue AccessCustomPageGetResponseEnvelopeSuccess = true ) + +type AccessCustomPageReplaceParams struct { + // Custom page HTML. + CustomHTML param.Field[string] `json:"custom_html,required"` + // Custom page name. + Name param.Field[string] `json:"name,required"` + // Custom page type. + Type param.Field[AccessCustomPageReplaceParamsType] `json:"type,required"` + // Number of apps the custom page is assigned to. + AppCount param.Field[int64] `json:"app_count"` +} + +func (r AccessCustomPageReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Custom page type. +type AccessCustomPageReplaceParamsType string + +const ( + AccessCustomPageReplaceParamsTypeIdentityDenied AccessCustomPageReplaceParamsType = "identity_denied" + AccessCustomPageReplaceParamsTypeForbidden AccessCustomPageReplaceParamsType = "forbidden" +) + +type AccessCustomPageReplaceResponseEnvelope struct { + Errors []AccessCustomPageReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessCustomPageReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessCustomPageReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success AccessCustomPageReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessCustomPageReplaceResponseEnvelopeJSON `json:"-"` +} + +// accessCustomPageReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessCustomPageReplaceResponseEnvelope] +type accessCustomPageReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCustomPageReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessCustomPageReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCustomPageReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessCustomPageReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessCustomPageReplaceResponseEnvelopeErrors] +type accessCustomPageReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCustomPageReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessCustomPageReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessCustomPageReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessCustomPageReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessCustomPageReplaceResponseEnvelopeMessages] +type accessCustomPageReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessCustomPageReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessCustomPageReplaceResponseEnvelopeSuccess bool + +const ( + AccessCustomPageReplaceResponseEnvelopeSuccessTrue AccessCustomPageReplaceResponseEnvelopeSuccess = true +) diff --git a/accesscustompage_test.go b/accesscustompage_test.go index 17ee3390771..d505e0bffdf 100644 --- a/accesscustompage_test.go +++ b/accesscustompage_test.go @@ -48,7 +48,7 @@ func TestAccessCustomPageNewWithOptionalParams(t *testing.T) { } } -func TestAccessCustomPageUpdateWithOptionalParams(t *testing.T) { +func TestAccessCustomPageList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,17 +64,7 @@ func TestAccessCustomPageUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.CustomPages.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessCustomPageUpdateParams{ - CustomHTML: cloudflare.F("

Access Denied

"), - Name: cloudflare.F("string"), - Type: cloudflare.F(cloudflare.AccessCustomPageUpdateParamsTypeIdentityDenied), - AppCount: cloudflare.F(int64(0)), - }, - ) + _, err := client.Access.CustomPages.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -84,7 +74,7 @@ func TestAccessCustomPageUpdateWithOptionalParams(t *testing.T) { } } -func TestAccessCustomPageList(t *testing.T) { +func TestAccessCustomPageDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -100,7 +90,11 @@ func TestAccessCustomPageList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.CustomPages.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Access.CustomPages.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -110,7 +104,7 @@ func TestAccessCustomPageList(t *testing.T) { } } -func TestAccessCustomPageDelete(t *testing.T) { +func TestAccessCustomPageGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,7 +120,7 @@ func TestAccessCustomPageDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.CustomPages.Delete( + _, err := client.Access.CustomPages.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -140,7 +134,7 @@ func TestAccessCustomPageDelete(t *testing.T) { } } -func TestAccessCustomPageGet(t *testing.T) { +func TestAccessCustomPageReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -156,10 +150,16 @@ func TestAccessCustomPageGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.CustomPages.Get( + _, err := client.Access.CustomPages.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessCustomPageReplaceParams{ + CustomHTML: cloudflare.F("

Access Denied

"), + Name: cloudflare.F("string"), + Type: cloudflare.F(cloudflare.AccessCustomPageReplaceParamsTypeIdentityDenied), + AppCount: cloudflare.F(int64(0)), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/accessgroup.go b/accessgroup.go index a8ca1e89629..964210ae0f4 100644 --- a/accessgroup.go +++ b/accessgroup.go @@ -33,12 +33,12 @@ func NewAccessGroupService(opts ...option.RequestOption) (r *AccessGroupService) return } -// Updates a configured Access group. -func (r *AccessGroupService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessGroupUpdateParams, opts ...option.RequestOption) (res *AccessGroupUpdateResponse, err error) { +// Creates a new Access group. +func (r *AccessGroupService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessGroupNewParams, opts ...option.RequestOption) (res *AccessGroupNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessGroupUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/groups/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AccessGroupNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/groups", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -46,12 +46,12 @@ func (r *AccessGroupService) Update(ctx context.Context, accountOrZone string, a return } -// Deletes an Access group. -func (r *AccessGroupService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessGroupDeleteResponse, err error) { +// Lists all Access groups. +func (r *AccessGroupService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessGroupListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessGroupDeleteResponseEnvelope - path := fmt.Sprintf("%s/%s/access/groups/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env AccessGroupListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/groups", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -59,12 +59,12 @@ func (r *AccessGroupService) Delete(ctx context.Context, accountOrZone string, a return } -// Creates a new Access group. -func (r *AccessGroupService) AccessGroupsNewAnAccessGroup(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessGroupAccessGroupsNewAnAccessGroupParams, opts ...option.RequestOption) (res *AccessGroupAccessGroupsNewAnAccessGroupResponse, err error) { +// Deletes an Access group. +func (r *AccessGroupService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessGroupDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelope - path := fmt.Sprintf("%s/%s/access/groups", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AccessGroupDeleteResponseEnvelope + path := fmt.Sprintf("%s/%s/access/groups/%s", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -72,11 +72,11 @@ func (r *AccessGroupService) AccessGroupsNewAnAccessGroup(ctx context.Context, a return } -// Lists all Access groups. -func (r *AccessGroupService) AccessGroupsListAccessGroups(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessGroupAccessGroupsListAccessGroupsResponse, err error) { +// Fetches a single Access group. +func (r *AccessGroupService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessGroupGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessGroupAccessGroupsListAccessGroupsResponseEnvelope - path := fmt.Sprintf("%s/%s/access/groups", accountOrZone, accountOrZoneID) + var env AccessGroupGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/groups/%s", accountOrZone, accountOrZoneID, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -85,12 +85,12 @@ func (r *AccessGroupService) AccessGroupsListAccessGroups(ctx context.Context, a return } -// Fetches a single Access group. -func (r *AccessGroupService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessGroupGetResponse, err error) { +// Updates a configured Access group. +func (r *AccessGroupService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessGroupReplaceParams, opts ...option.RequestOption) (res *AccessGroupReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessGroupGetResponseEnvelope + var env AccessGroupReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/groups/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -98,31 +98,31 @@ func (r *AccessGroupService) Get(ctx context.Context, accountOrZone string, acco return } -type AccessGroupUpdateResponse struct { +type AccessGroupNewResponse struct { // UUID ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude []AccessGroupUpdateResponseExclude `json:"exclude"` + Exclude []AccessGroupNewResponseExclude `json:"exclude"` // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include []AccessGroupUpdateResponseInclude `json:"include"` + Include []AccessGroupNewResponseInclude `json:"include"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - IsDefault []AccessGroupUpdateResponseIsDefault `json:"is_default"` + IsDefault []AccessGroupNewResponseIsDefault `json:"is_default"` // The name of the Access group. Name string `json:"name"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require []AccessGroupUpdateResponseRequire `json:"require"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessGroupUpdateResponseJSON `json:"-"` + Require []AccessGroupNewResponseRequire `json:"require"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessGroupNewResponseJSON `json:"-"` } -// accessGroupUpdateResponseJSON contains the JSON metadata for the struct -// [AccessGroupUpdateResponse] -type accessGroupUpdateResponseJSON struct { +// accessGroupNewResponseJSON contains the JSON metadata for the struct +// [AccessGroupNewResponse] +type accessGroupNewResponseJSON struct { ID apijson.Field CreatedAt apijson.Field Exclude apijson.Field @@ -135,3075 +135,3014 @@ type accessGroupUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupUpdateResponseExcludeAccessEmailRule], -// [AccessGroupUpdateResponseExcludeAccessEmailListRule], -// [AccessGroupUpdateResponseExcludeAccessDomainRule], -// [AccessGroupUpdateResponseExcludeAccessEveryoneRule], -// [AccessGroupUpdateResponseExcludeAccessIPRule], -// [AccessGroupUpdateResponseExcludeAccessIPListRule], -// [AccessGroupUpdateResponseExcludeAccessCertificateRule], -// [AccessGroupUpdateResponseExcludeAccessAccessGroupRule], -// [AccessGroupUpdateResponseExcludeAccessAzureGroupRule], -// [AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRule], -// [AccessGroupUpdateResponseExcludeAccessGsuiteGroupRule], -// [AccessGroupUpdateResponseExcludeAccessOktaGroupRule], -// [AccessGroupUpdateResponseExcludeAccessSamlGroupRule], -// [AccessGroupUpdateResponseExcludeAccessServiceTokenRule], -// [AccessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateResponseExcludeAccessExternalEvaluationRule], -// [AccessGroupUpdateResponseExcludeAccessCountryRule], -// [AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRule] or -// [AccessGroupUpdateResponseExcludeAccessDevicePostureRule]. -type AccessGroupUpdateResponseExclude interface { - implementsAccessGroupUpdateResponseExclude() +// Union satisfied by [AccessGroupNewResponseExcludeAccessEmailRule], +// [AccessGroupNewResponseExcludeAccessEmailListRule], +// [AccessGroupNewResponseExcludeAccessDomainRule], +// [AccessGroupNewResponseExcludeAccessEveryoneRule], +// [AccessGroupNewResponseExcludeAccessIPRule], +// [AccessGroupNewResponseExcludeAccessIPListRule], +// [AccessGroupNewResponseExcludeAccessCertificateRule], +// [AccessGroupNewResponseExcludeAccessAccessGroupRule], +// [AccessGroupNewResponseExcludeAccessAzureGroupRule], +// [AccessGroupNewResponseExcludeAccessGitHubOrganizationRule], +// [AccessGroupNewResponseExcludeAccessGsuiteGroupRule], +// [AccessGroupNewResponseExcludeAccessOktaGroupRule], +// [AccessGroupNewResponseExcludeAccessSamlGroupRule], +// [AccessGroupNewResponseExcludeAccessServiceTokenRule], +// [AccessGroupNewResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupNewResponseExcludeAccessExternalEvaluationRule], +// [AccessGroupNewResponseExcludeAccessCountryRule], +// [AccessGroupNewResponseExcludeAccessAuthenticationMethodRule] or +// [AccessGroupNewResponseExcludeAccessDevicePostureRule]. +type AccessGroupNewResponseExclude interface { + implementsAccessGroupNewResponseExclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupUpdateResponseExclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupNewResponseExclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupUpdateResponseExcludeAccessEmailRule struct { - Email AccessGroupUpdateResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupUpdateResponseExcludeAccessEmailRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessEmailRule struct { + Email AccessGroupNewResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupNewResponseExcludeAccessEmailRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseExcludeAccessEmailRule] -type accessGroupUpdateResponseExcludeAccessEmailRuleJSON struct { +// accessGroupNewResponseExcludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseExcludeAccessEmailRule] +type accessGroupNewResponseExcludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessEmailRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessEmailRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessEmailRuleEmail struct { +type AccessGroupNewResponseExcludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupUpdateResponseExcludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupNewResponseExcludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessEmailRuleEmail] -type accessGroupUpdateResponseExcludeAccessEmailRuleEmailJSON struct { +// accessGroupNewResponseExcludeAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessEmailRuleEmail] +type accessGroupNewResponseExcludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupUpdateResponseExcludeAccessEmailListRule struct { - EmailList AccessGroupUpdateResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupUpdateResponseExcludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessEmailListRule struct { + EmailList AccessGroupNewResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupNewResponseExcludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessEmailListRule] -type accessGroupUpdateResponseExcludeAccessEmailListRuleJSON struct { +// accessGroupNewResponseExcludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessEmailListRule] +type accessGroupNewResponseExcludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessEmailListRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessEmailListRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessEmailListRuleEmailList struct { +type AccessGroupNewResponseExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessEmailListRuleEmailList] -type accessGroupUpdateResponseExcludeAccessEmailListRuleEmailListJSON struct { +// accessGroupNewResponseExcludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessEmailListRuleEmailList] +type accessGroupNewResponseExcludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupUpdateResponseExcludeAccessDomainRule struct { - EmailDomain AccessGroupUpdateResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupUpdateResponseExcludeAccessDomainRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessDomainRule struct { + EmailDomain AccessGroupNewResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupNewResponseExcludeAccessDomainRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseExcludeAccessDomainRule] -type accessGroupUpdateResponseExcludeAccessDomainRuleJSON struct { +// accessGroupNewResponseExcludeAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseExcludeAccessDomainRule] +type accessGroupNewResponseExcludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessDomainRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessDomainRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupNewResponseExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupUpdateResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupNewResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessDomainRuleEmailDomain] -type accessGroupUpdateResponseExcludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupNewResponseExcludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessDomainRuleEmailDomain] +type accessGroupNewResponseExcludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupUpdateResponseExcludeAccessEveryoneRule struct { +type AccessGroupNewResponseExcludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupUpdateResponseExcludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupNewResponseExcludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessEveryoneRule] -type accessGroupUpdateResponseExcludeAccessEveryoneRuleJSON struct { +// accessGroupNewResponseExcludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessEveryoneRule] +type accessGroupNewResponseExcludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessEveryoneRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessEveryoneRule) implementsAccessGroupNewResponseExclude() {} // Matches an IP address block. -type AccessGroupUpdateResponseExcludeAccessIPRule struct { - IP AccessGroupUpdateResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupUpdateResponseExcludeAccessIPRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessIPRule struct { + IP AccessGroupNewResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupNewResponseExcludeAccessIPRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessGroupUpdateResponseExcludeAccessIPRule] -type accessGroupUpdateResponseExcludeAccessIPRuleJSON struct { +// accessGroupNewResponseExcludeAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupNewResponseExcludeAccessIPRule] +type accessGroupNewResponseExcludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessIPRule) implementsAccessGroupUpdateResponseExclude() {} +func (r AccessGroupNewResponseExcludeAccessIPRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessIPRuleIP struct { +type AccessGroupNewResponseExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupUpdateResponseExcludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupNewResponseExcludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseExcludeAccessIPRuleIP] -type accessGroupUpdateResponseExcludeAccessIPRuleIPJSON struct { +// accessGroupNewResponseExcludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseExcludeAccessIPRuleIP] +type accessGroupNewResponseExcludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupUpdateResponseExcludeAccessIPListRule struct { - IPList AccessGroupUpdateResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupUpdateResponseExcludeAccessIPListRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessIPListRule struct { + IPList AccessGroupNewResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupNewResponseExcludeAccessIPListRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseExcludeAccessIPListRule] -type accessGroupUpdateResponseExcludeAccessIPListRuleJSON struct { +// accessGroupNewResponseExcludeAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseExcludeAccessIPListRule] +type accessGroupNewResponseExcludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessIPListRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessIPListRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessIPListRuleIPList struct { +type AccessGroupNewResponseExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseExcludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseExcludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessIPListRuleIPList] -type accessGroupUpdateResponseExcludeAccessIPListRuleIPListJSON struct { +// accessGroupNewResponseExcludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessIPListRuleIPList] +type accessGroupNewResponseExcludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupUpdateResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupUpdateResponseExcludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupNewResponseExcludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessCertificateRule] -type accessGroupUpdateResponseExcludeAccessCertificateRuleJSON struct { +// accessGroupNewResponseExcludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessCertificateRule] +type accessGroupNewResponseExcludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessCertificateRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessCertificateRule) implementsAccessGroupNewResponseExclude() { } // Matches an Access group. -type AccessGroupUpdateResponseExcludeAccessAccessGroupRule struct { - Group AccessGroupUpdateResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupUpdateResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessAccessGroupRule struct { + Group AccessGroupNewResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupNewResponseExcludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessAccessGroupRule] -type accessGroupUpdateResponseExcludeAccessAccessGroupRuleJSON struct { +// accessGroupNewResponseExcludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessAccessGroupRule] +type accessGroupNewResponseExcludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessAccessGroupRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessAccessGroupRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupNewResponseExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAccessGroupRuleGroupJSON contains the JSON +// accessGroupNewResponseExcludeAccessAccessGroupRuleGroupJSON contains the JSON // metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessAccessGroupRuleGroup] -type accessGroupUpdateResponseExcludeAccessAccessGroupRuleGroupJSON struct { +// [AccessGroupNewResponseExcludeAccessAccessGroupRuleGroup] +type accessGroupNewResponseExcludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupUpdateResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessGroupNewResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupNewResponseExcludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessAzureGroupRule] -type accessGroupUpdateResponseExcludeAccessAzureGroupRuleJSON struct { +// accessGroupNewResponseExcludeAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessAzureGroupRule] +type accessGroupNewResponseExcludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessAzureGroupRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessAzureGroupRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewResponseExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupNewResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAd] -type accessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupNewResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessAzureGroupRuleAzureAd] +type accessGroupNewResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupNewResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRule] -type accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupNewResponseExcludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessGitHubOrganizationRule] +type accessGroupNewResponseExcludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupNewResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessGsuiteGroupRule] -type accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleJSON struct { +// accessGroupNewResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessGsuiteGroupRule] +type accessGroupNewResponseExcludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateResponseExcludeAccessOktaGroupRule struct { - Okta AccessGroupUpdateResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupUpdateResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessOktaGroupRule struct { + Okta AccessGroupNewResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupNewResponseExcludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessOktaGroupRule] -type accessGroupUpdateResponseExcludeAccessOktaGroupRuleJSON struct { +// accessGroupNewResponseExcludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessOktaGroupRule] +type accessGroupNewResponseExcludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessOktaGroupRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessOktaGroupRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupNewResponseExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessOktaGroupRuleOkta] -type accessGroupUpdateResponseExcludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupNewResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessOktaGroupRuleOkta] +type accessGroupNewResponseExcludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateResponseExcludeAccessSamlGroupRule struct { - Saml AccessGroupUpdateResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupUpdateResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessSamlGroupRule struct { + Saml AccessGroupNewResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupNewResponseExcludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessSamlGroupRule] -type accessGroupUpdateResponseExcludeAccessSamlGroupRuleJSON struct { +// accessGroupNewResponseExcludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessSamlGroupRule] +type accessGroupNewResponseExcludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessSamlGroupRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessSamlGroupRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupNewResponseExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupUpdateResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupNewResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessSamlGroupRuleSaml] -type accessGroupUpdateResponseExcludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupNewResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessSamlGroupRuleSaml] +type accessGroupNewResponseExcludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupUpdateResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupUpdateResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessGroupNewResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupNewResponseExcludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessServiceTokenRule] -type accessGroupUpdateResponseExcludeAccessServiceTokenRuleJSON struct { +// accessGroupNewResponseExcludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessServiceTokenRule] +type accessGroupNewResponseExcludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessServiceTokenRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessServiceTokenRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewResponseExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceToken] -type accessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupNewResponseExcludeAccessServiceTokenRuleServiceToken] +type accessGroupNewResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupNewResponseExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupNewResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupNewResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRule] -type accessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupNewResponseExcludeAccessAnyValidServiceTokenRule] +type accessGroupNewResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupNewResponseExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupNewResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessExternalEvaluationRule] -type accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleJSON struct { +// accessGroupNewResponseExcludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseExcludeAccessExternalEvaluationRule] +type accessGroupNewResponseExcludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupUpdateResponseExcludeAccessCountryRule struct { - Geo AccessGroupUpdateResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupUpdateResponseExcludeAccessCountryRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessCountryRule struct { + Geo AccessGroupNewResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupNewResponseExcludeAccessCountryRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseExcludeAccessCountryRule] -type accessGroupUpdateResponseExcludeAccessCountryRuleJSON struct { +// accessGroupNewResponseExcludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessCountryRule] +type accessGroupNewResponseExcludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessCountryRule) implementsAccessGroupUpdateResponseExclude() { -} +func (r AccessGroupNewResponseExcludeAccessCountryRule) implementsAccessGroupNewResponseExclude() {} -type AccessGroupUpdateResponseExcludeAccessCountryRuleGeo struct { +type AccessGroupNewResponseExcludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupUpdateResponseExcludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupNewResponseExcludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseExcludeAccessCountryRuleGeo] -type accessGroupUpdateResponseExcludeAccessCountryRuleGeoJSON struct { +// accessGroupNewResponseExcludeAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseExcludeAccessCountryRuleGeo] +type accessGroupNewResponseExcludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupNewResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleJSON contains the +// accessGroupNewResponseExcludeAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRule] -type accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupNewResponseExcludeAccessAuthenticationMethodRule] +type accessGroupNewResponseExcludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupUpdateResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupNewResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessGroupNewResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupNewResponseExcludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessDevicePostureRule] -type accessGroupUpdateResponseExcludeAccessDevicePostureRuleJSON struct { +// accessGroupNewResponseExcludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseExcludeAccessDevicePostureRule] +type accessGroupNewResponseExcludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseExcludeAccessDevicePostureRule) implementsAccessGroupUpdateResponseExclude() { +func (r AccessGroupNewResponseExcludeAccessDevicePostureRule) implementsAccessGroupNewResponseExclude() { } -type AccessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewResponseExcludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupNewResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessGroupNewResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupUpdateResponseIncludeAccessEmailRule], -// [AccessGroupUpdateResponseIncludeAccessEmailListRule], -// [AccessGroupUpdateResponseIncludeAccessDomainRule], -// [AccessGroupUpdateResponseIncludeAccessEveryoneRule], -// [AccessGroupUpdateResponseIncludeAccessIPRule], -// [AccessGroupUpdateResponseIncludeAccessIPListRule], -// [AccessGroupUpdateResponseIncludeAccessCertificateRule], -// [AccessGroupUpdateResponseIncludeAccessAccessGroupRule], -// [AccessGroupUpdateResponseIncludeAccessAzureGroupRule], -// [AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRule], -// [AccessGroupUpdateResponseIncludeAccessGsuiteGroupRule], -// [AccessGroupUpdateResponseIncludeAccessOktaGroupRule], -// [AccessGroupUpdateResponseIncludeAccessSamlGroupRule], -// [AccessGroupUpdateResponseIncludeAccessServiceTokenRule], -// [AccessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateResponseIncludeAccessExternalEvaluationRule], -// [AccessGroupUpdateResponseIncludeAccessCountryRule], -// [AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRule] or -// [AccessGroupUpdateResponseIncludeAccessDevicePostureRule]. -type AccessGroupUpdateResponseInclude interface { - implementsAccessGroupUpdateResponseInclude() +// Union satisfied by [AccessGroupNewResponseIncludeAccessEmailRule], +// [AccessGroupNewResponseIncludeAccessEmailListRule], +// [AccessGroupNewResponseIncludeAccessDomainRule], +// [AccessGroupNewResponseIncludeAccessEveryoneRule], +// [AccessGroupNewResponseIncludeAccessIPRule], +// [AccessGroupNewResponseIncludeAccessIPListRule], +// [AccessGroupNewResponseIncludeAccessCertificateRule], +// [AccessGroupNewResponseIncludeAccessAccessGroupRule], +// [AccessGroupNewResponseIncludeAccessAzureGroupRule], +// [AccessGroupNewResponseIncludeAccessGitHubOrganizationRule], +// [AccessGroupNewResponseIncludeAccessGsuiteGroupRule], +// [AccessGroupNewResponseIncludeAccessOktaGroupRule], +// [AccessGroupNewResponseIncludeAccessSamlGroupRule], +// [AccessGroupNewResponseIncludeAccessServiceTokenRule], +// [AccessGroupNewResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupNewResponseIncludeAccessExternalEvaluationRule], +// [AccessGroupNewResponseIncludeAccessCountryRule], +// [AccessGroupNewResponseIncludeAccessAuthenticationMethodRule] or +// [AccessGroupNewResponseIncludeAccessDevicePostureRule]. +type AccessGroupNewResponseInclude interface { + implementsAccessGroupNewResponseInclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupUpdateResponseInclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupNewResponseInclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupUpdateResponseIncludeAccessEmailRule struct { - Email AccessGroupUpdateResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupUpdateResponseIncludeAccessEmailRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessEmailRule struct { + Email AccessGroupNewResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupNewResponseIncludeAccessEmailRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIncludeAccessEmailRule] -type accessGroupUpdateResponseIncludeAccessEmailRuleJSON struct { +// accessGroupNewResponseIncludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIncludeAccessEmailRule] +type accessGroupNewResponseIncludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessEmailRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessEmailRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessEmailRuleEmail struct { +type AccessGroupNewResponseIncludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupUpdateResponseIncludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupNewResponseIncludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessEmailRuleEmail] -type accessGroupUpdateResponseIncludeAccessEmailRuleEmailJSON struct { +// accessGroupNewResponseIncludeAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessEmailRuleEmail] +type accessGroupNewResponseIncludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupUpdateResponseIncludeAccessEmailListRule struct { - EmailList AccessGroupUpdateResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupUpdateResponseIncludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessEmailListRule struct { + EmailList AccessGroupNewResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupNewResponseIncludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessEmailListRule] -type accessGroupUpdateResponseIncludeAccessEmailListRuleJSON struct { +// accessGroupNewResponseIncludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessEmailListRule] +type accessGroupNewResponseIncludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessEmailListRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessEmailListRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessEmailListRuleEmailList struct { +type AccessGroupNewResponseIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessEmailListRuleEmailList] -type accessGroupUpdateResponseIncludeAccessEmailListRuleEmailListJSON struct { +// accessGroupNewResponseIncludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessEmailListRuleEmailList] +type accessGroupNewResponseIncludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupUpdateResponseIncludeAccessDomainRule struct { - EmailDomain AccessGroupUpdateResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupUpdateResponseIncludeAccessDomainRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessDomainRule struct { + EmailDomain AccessGroupNewResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupNewResponseIncludeAccessDomainRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIncludeAccessDomainRule] -type accessGroupUpdateResponseIncludeAccessDomainRuleJSON struct { +// accessGroupNewResponseIncludeAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIncludeAccessDomainRule] +type accessGroupNewResponseIncludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessDomainRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessDomainRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupNewResponseIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupUpdateResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupNewResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessDomainRuleEmailDomain] -type accessGroupUpdateResponseIncludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupNewResponseIncludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessDomainRuleEmailDomain] +type accessGroupNewResponseIncludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupUpdateResponseIncludeAccessEveryoneRule struct { +type AccessGroupNewResponseIncludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupUpdateResponseIncludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupNewResponseIncludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessEveryoneRule] -type accessGroupUpdateResponseIncludeAccessEveryoneRuleJSON struct { +// accessGroupNewResponseIncludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessEveryoneRule] +type accessGroupNewResponseIncludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessEveryoneRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessEveryoneRule) implementsAccessGroupNewResponseInclude() {} // Matches an IP address block. -type AccessGroupUpdateResponseIncludeAccessIPRule struct { - IP AccessGroupUpdateResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupUpdateResponseIncludeAccessIPRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessIPRule struct { + IP AccessGroupNewResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupNewResponseIncludeAccessIPRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessGroupUpdateResponseIncludeAccessIPRule] -type accessGroupUpdateResponseIncludeAccessIPRuleJSON struct { +// accessGroupNewResponseIncludeAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupNewResponseIncludeAccessIPRule] +type accessGroupNewResponseIncludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessIPRule) implementsAccessGroupUpdateResponseInclude() {} +func (r AccessGroupNewResponseIncludeAccessIPRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessIPRuleIP struct { +type AccessGroupNewResponseIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupUpdateResponseIncludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupNewResponseIncludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIncludeAccessIPRuleIP] -type accessGroupUpdateResponseIncludeAccessIPRuleIPJSON struct { +// accessGroupNewResponseIncludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIncludeAccessIPRuleIP] +type accessGroupNewResponseIncludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupUpdateResponseIncludeAccessIPListRule struct { - IPList AccessGroupUpdateResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupUpdateResponseIncludeAccessIPListRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessIPListRule struct { + IPList AccessGroupNewResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupNewResponseIncludeAccessIPListRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIncludeAccessIPListRule] -type accessGroupUpdateResponseIncludeAccessIPListRuleJSON struct { +// accessGroupNewResponseIncludeAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIncludeAccessIPListRule] +type accessGroupNewResponseIncludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessIPListRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessIPListRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessIPListRuleIPList struct { +type AccessGroupNewResponseIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIncludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIncludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessIPListRuleIPList] -type accessGroupUpdateResponseIncludeAccessIPListRuleIPListJSON struct { +// accessGroupNewResponseIncludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessIPListRuleIPList] +type accessGroupNewResponseIncludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupUpdateResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupUpdateResponseIncludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupNewResponseIncludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessCertificateRule] -type accessGroupUpdateResponseIncludeAccessCertificateRuleJSON struct { +// accessGroupNewResponseIncludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessCertificateRule] +type accessGroupNewResponseIncludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessCertificateRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessCertificateRule) implementsAccessGroupNewResponseInclude() { } // Matches an Access group. -type AccessGroupUpdateResponseIncludeAccessAccessGroupRule struct { - Group AccessGroupUpdateResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupUpdateResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessAccessGroupRule struct { + Group AccessGroupNewResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupNewResponseIncludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessAccessGroupRule] -type accessGroupUpdateResponseIncludeAccessAccessGroupRuleJSON struct { +// accessGroupNewResponseIncludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessAccessGroupRule] +type accessGroupNewResponseIncludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessAccessGroupRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessAccessGroupRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupNewResponseIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAccessGroupRuleGroupJSON contains the JSON +// accessGroupNewResponseIncludeAccessAccessGroupRuleGroupJSON contains the JSON // metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessAccessGroupRuleGroup] -type accessGroupUpdateResponseIncludeAccessAccessGroupRuleGroupJSON struct { +// [AccessGroupNewResponseIncludeAccessAccessGroupRuleGroup] +type accessGroupNewResponseIncludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupUpdateResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessGroupNewResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupNewResponseIncludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessAzureGroupRule] -type accessGroupUpdateResponseIncludeAccessAzureGroupRuleJSON struct { +// accessGroupNewResponseIncludeAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessAzureGroupRule] +type accessGroupNewResponseIncludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessAzureGroupRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessAzureGroupRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewResponseIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupNewResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAd] -type accessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupNewResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessAzureGroupRuleAzureAd] +type accessGroupNewResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupNewResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRule] -type accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupNewResponseIncludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessGitHubOrganizationRule] +type accessGroupNewResponseIncludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupNewResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessGsuiteGroupRule] -type accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleJSON struct { +// accessGroupNewResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessGsuiteGroupRule] +type accessGroupNewResponseIncludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateResponseIncludeAccessOktaGroupRule struct { - Okta AccessGroupUpdateResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupUpdateResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessOktaGroupRule struct { + Okta AccessGroupNewResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupNewResponseIncludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessOktaGroupRule] -type accessGroupUpdateResponseIncludeAccessOktaGroupRuleJSON struct { +// accessGroupNewResponseIncludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessOktaGroupRule] +type accessGroupNewResponseIncludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessOktaGroupRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessOktaGroupRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupNewResponseIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessOktaGroupRuleOkta] -type accessGroupUpdateResponseIncludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupNewResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessOktaGroupRuleOkta] +type accessGroupNewResponseIncludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateResponseIncludeAccessSamlGroupRule struct { - Saml AccessGroupUpdateResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupUpdateResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessSamlGroupRule struct { + Saml AccessGroupNewResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupNewResponseIncludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessSamlGroupRule] -type accessGroupUpdateResponseIncludeAccessSamlGroupRuleJSON struct { +// accessGroupNewResponseIncludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessSamlGroupRule] +type accessGroupNewResponseIncludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessSamlGroupRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessSamlGroupRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupNewResponseIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupUpdateResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupNewResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessSamlGroupRuleSaml] -type accessGroupUpdateResponseIncludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupNewResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessSamlGroupRuleSaml] +type accessGroupNewResponseIncludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupUpdateResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupUpdateResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessGroupNewResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupNewResponseIncludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessServiceTokenRule] -type accessGroupUpdateResponseIncludeAccessServiceTokenRuleJSON struct { +// accessGroupNewResponseIncludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessServiceTokenRule] +type accessGroupNewResponseIncludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessServiceTokenRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessServiceTokenRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewResponseIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceToken] -type accessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupNewResponseIncludeAccessServiceTokenRuleServiceToken] +type accessGroupNewResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupNewResponseIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupNewResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupNewResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRule] -type accessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupNewResponseIncludeAccessAnyValidServiceTokenRule] +type accessGroupNewResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupNewResponseInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupNewResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessExternalEvaluationRule] -type accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleJSON struct { +// accessGroupNewResponseIncludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIncludeAccessExternalEvaluationRule] +type accessGroupNewResponseIncludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupUpdateResponseIncludeAccessCountryRule struct { - Geo AccessGroupUpdateResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupUpdateResponseIncludeAccessCountryRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessCountryRule struct { + Geo AccessGroupNewResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupNewResponseIncludeAccessCountryRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIncludeAccessCountryRule] -type accessGroupUpdateResponseIncludeAccessCountryRuleJSON struct { +// accessGroupNewResponseIncludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessCountryRule] +type accessGroupNewResponseIncludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessCountryRule) implementsAccessGroupUpdateResponseInclude() { -} +func (r AccessGroupNewResponseIncludeAccessCountryRule) implementsAccessGroupNewResponseInclude() {} -type AccessGroupUpdateResponseIncludeAccessCountryRuleGeo struct { +type AccessGroupNewResponseIncludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupUpdateResponseIncludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupNewResponseIncludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIncludeAccessCountryRuleGeo] -type accessGroupUpdateResponseIncludeAccessCountryRuleGeoJSON struct { +// accessGroupNewResponseIncludeAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIncludeAccessCountryRuleGeo] +type accessGroupNewResponseIncludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupNewResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleJSON contains the +// accessGroupNewResponseIncludeAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRule] -type accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupNewResponseIncludeAccessAuthenticationMethodRule] +type accessGroupNewResponseIncludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupUpdateResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupNewResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessGroupNewResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupNewResponseIncludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessDevicePostureRule] -type accessGroupUpdateResponseIncludeAccessDevicePostureRuleJSON struct { +// accessGroupNewResponseIncludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIncludeAccessDevicePostureRule] +type accessGroupNewResponseIncludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIncludeAccessDevicePostureRule) implementsAccessGroupUpdateResponseInclude() { +func (r AccessGroupNewResponseIncludeAccessDevicePostureRule) implementsAccessGroupNewResponseInclude() { } -type AccessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewResponseIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupNewResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessGroupNewResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupUpdateResponseIsDefaultAccessEmailRule], -// [AccessGroupUpdateResponseIsDefaultAccessEmailListRule], -// [AccessGroupUpdateResponseIsDefaultAccessDomainRule], -// [AccessGroupUpdateResponseIsDefaultAccessEveryoneRule], -// [AccessGroupUpdateResponseIsDefaultAccessIPRule], -// [AccessGroupUpdateResponseIsDefaultAccessIPListRule], -// [AccessGroupUpdateResponseIsDefaultAccessCertificateRule], -// [AccessGroupUpdateResponseIsDefaultAccessAccessGroupRule], -// [AccessGroupUpdateResponseIsDefaultAccessAzureGroupRule], -// [AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRule], -// [AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRule], -// [AccessGroupUpdateResponseIsDefaultAccessOktaGroupRule], -// [AccessGroupUpdateResponseIsDefaultAccessSamlGroupRule], -// [AccessGroupUpdateResponseIsDefaultAccessServiceTokenRule], -// [AccessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRule], -// [AccessGroupUpdateResponseIsDefaultAccessCountryRule], -// [AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRule] or -// [AccessGroupUpdateResponseIsDefaultAccessDevicePostureRule]. -type AccessGroupUpdateResponseIsDefault interface { - implementsAccessGroupUpdateResponseIsDefault() +// Union satisfied by [AccessGroupNewResponseIsDefaultAccessEmailRule], +// [AccessGroupNewResponseIsDefaultAccessEmailListRule], +// [AccessGroupNewResponseIsDefaultAccessDomainRule], +// [AccessGroupNewResponseIsDefaultAccessEveryoneRule], +// [AccessGroupNewResponseIsDefaultAccessIPRule], +// [AccessGroupNewResponseIsDefaultAccessIPListRule], +// [AccessGroupNewResponseIsDefaultAccessCertificateRule], +// [AccessGroupNewResponseIsDefaultAccessAccessGroupRule], +// [AccessGroupNewResponseIsDefaultAccessAzureGroupRule], +// [AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRule], +// [AccessGroupNewResponseIsDefaultAccessGsuiteGroupRule], +// [AccessGroupNewResponseIsDefaultAccessOktaGroupRule], +// [AccessGroupNewResponseIsDefaultAccessSamlGroupRule], +// [AccessGroupNewResponseIsDefaultAccessServiceTokenRule], +// [AccessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRule], +// [AccessGroupNewResponseIsDefaultAccessExternalEvaluationRule], +// [AccessGroupNewResponseIsDefaultAccessCountryRule], +// [AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRule] or +// [AccessGroupNewResponseIsDefaultAccessDevicePostureRule]. +type AccessGroupNewResponseIsDefault interface { + implementsAccessGroupNewResponseIsDefault() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupUpdateResponseIsDefault)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupNewResponseIsDefault)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupUpdateResponseIsDefaultAccessEmailRule struct { - Email AccessGroupUpdateResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupUpdateResponseIsDefaultAccessEmailRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessEmailRule struct { + Email AccessGroupNewResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupNewResponseIsDefaultAccessEmailRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIsDefaultAccessEmailRule] -type accessGroupUpdateResponseIsDefaultAccessEmailRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIsDefaultAccessEmailRule] +type accessGroupNewResponseIsDefaultAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessEmailRule) implementsAccessGroupUpdateResponseIsDefault() { -} +func (r AccessGroupNewResponseIsDefaultAccessEmailRule) implementsAccessGroupNewResponseIsDefault() {} -type AccessGroupUpdateResponseIsDefaultAccessEmailRuleEmail struct { +type AccessGroupNewResponseIsDefaultAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupUpdateResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupNewResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessEmailRuleEmail] -type accessGroupUpdateResponseIsDefaultAccessEmailRuleEmailJSON struct { +// accessGroupNewResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessEmailRuleEmail] +type accessGroupNewResponseIsDefaultAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupUpdateResponseIsDefaultAccessEmailListRule struct { - EmailList AccessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupUpdateResponseIsDefaultAccessEmailListRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessEmailListRule struct { + EmailList AccessGroupNewResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupNewResponseIsDefaultAccessEmailListRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessEmailListRule] -type accessGroupUpdateResponseIsDefaultAccessEmailListRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessEmailListRule] +type accessGroupNewResponseIsDefaultAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessEmailListRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessEmailListRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailList struct { +type AccessGroupNewResponseIsDefaultAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailListJSON contains the +// accessGroupNewResponseIsDefaultAccessEmailListRuleEmailListJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailList] -type accessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailListJSON struct { +// [AccessGroupNewResponseIsDefaultAccessEmailListRuleEmailList] +type accessGroupNewResponseIsDefaultAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupUpdateResponseIsDefaultAccessDomainRule struct { - EmailDomain AccessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupUpdateResponseIsDefaultAccessDomainRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessDomainRule struct { + EmailDomain AccessGroupNewResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupNewResponseIsDefaultAccessDomainRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessDomainRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessDomainRule] -type accessGroupUpdateResponseIsDefaultAccessDomainRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIsDefaultAccessDomainRule] +type accessGroupNewResponseIsDefaultAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessDomainRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessDomainRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomain struct { +type AccessGroupNewResponseIsDefaultAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupNewResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomain] -type accessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { +// accessGroupNewResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessDomainRuleEmailDomain] +type accessGroupNewResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupUpdateResponseIsDefaultAccessEveryoneRule struct { +type AccessGroupNewResponseIsDefaultAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupUpdateResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupNewResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessEveryoneRule] -type accessGroupUpdateResponseIsDefaultAccessEveryoneRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIsDefaultAccessEveryoneRule] +type accessGroupNewResponseIsDefaultAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessEveryoneRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessEveryoneRule) implementsAccessGroupNewResponseIsDefault() { } // Matches an IP address block. -type AccessGroupUpdateResponseIsDefaultAccessIPRule struct { - IP AccessGroupUpdateResponseIsDefaultAccessIPRuleIP `json:"ip,required"` - JSON accessGroupUpdateResponseIsDefaultAccessIPRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessIPRule struct { + IP AccessGroupNewResponseIsDefaultAccessIPRuleIP `json:"ip,required"` + JSON accessGroupNewResponseIsDefaultAccessIPRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessIPRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIsDefaultAccessIPRule] -type accessGroupUpdateResponseIsDefaultAccessIPRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIsDefaultAccessIPRule] +type accessGroupNewResponseIsDefaultAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessIPRule) implementsAccessGroupUpdateResponseIsDefault() { -} +func (r AccessGroupNewResponseIsDefaultAccessIPRule) implementsAccessGroupNewResponseIsDefault() {} -type AccessGroupUpdateResponseIsDefaultAccessIPRuleIP struct { +type AccessGroupNewResponseIsDefaultAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupUpdateResponseIsDefaultAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupNewResponseIsDefaultAccessIPRuleIPJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseIsDefaultAccessIPRuleIP] -type accessGroupUpdateResponseIsDefaultAccessIPRuleIPJSON struct { +// accessGroupNewResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseIsDefaultAccessIPRuleIP] +type accessGroupNewResponseIsDefaultAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupUpdateResponseIsDefaultAccessIPListRule struct { - IPList AccessGroupUpdateResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupUpdateResponseIsDefaultAccessIPListRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessIPListRule struct { + IPList AccessGroupNewResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupNewResponseIsDefaultAccessIPListRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessIPListRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessIPListRule] -type accessGroupUpdateResponseIsDefaultAccessIPListRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIsDefaultAccessIPListRule] +type accessGroupNewResponseIsDefaultAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessIPListRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessIPListRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessIPListRuleIPList struct { +type AccessGroupNewResponseIsDefaultAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessIPListRuleIPList] -type accessGroupUpdateResponseIsDefaultAccessIPListRuleIPListJSON struct { +// accessGroupNewResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessIPListRuleIPList] +type accessGroupNewResponseIsDefaultAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupUpdateResponseIsDefaultAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupUpdateResponseIsDefaultAccessCertificateRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupNewResponseIsDefaultAccessCertificateRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessCertificateRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessCertificateRule] -type accessGroupUpdateResponseIsDefaultAccessCertificateRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessCertificateRule] +type accessGroupNewResponseIsDefaultAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessCertificateRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessCertificateRule) implementsAccessGroupNewResponseIsDefault() { } // Matches an Access group. -type AccessGroupUpdateResponseIsDefaultAccessAccessGroupRule struct { - Group AccessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessAccessGroupRule struct { + Group AccessGroupNewResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupNewResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAccessGroupRule] -type accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessAccessGroupRule] +type accessGroupNewResponseIsDefaultAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroup struct { +type AccessGroupNewResponseIsDefaultAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroup] -type accessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { +// accessGroupNewResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessAccessGroupRuleGroup] +type accessGroupNewResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateResponseIsDefaultAccessAzureGroupRule struct { - AzureAd AccessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessAzureGroupRule struct { + AzureAd AccessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupNewResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessAzureGroupRule] -type accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessAzureGroupRule] +type accessGroupNewResponseIsDefaultAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAd] -type accessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAd] +type accessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the +// accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRule] -type accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { +// [AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRule] +type accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRule struct { - Gsuite AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessGsuiteGroupRule struct { + Gsuite AccessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRule] -type accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessGsuiteGroupRule] +type accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuite] -type accessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuite] +type accessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateResponseIsDefaultAccessOktaGroupRule struct { - Okta AccessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessOktaGroupRule struct { + Okta AccessGroupNewResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupNewResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessOktaGroupRule] -type accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessOktaGroupRule] +type accessGroupNewResponseIsDefaultAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOkta struct { +type AccessGroupNewResponseIsDefaultAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOkta] -type accessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { +// accessGroupNewResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessOktaGroupRuleOkta] +type accessGroupNewResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateResponseIsDefaultAccessSamlGroupRule struct { - Saml AccessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessSamlGroupRule struct { + Saml AccessGroupNewResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupNewResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessSamlGroupRule] -type accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessSamlGroupRule] +type accessGroupNewResponseIsDefaultAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSaml struct { +type AccessGroupNewResponseIsDefaultAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupNewResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSaml] -type accessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { +// accessGroupNewResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessSamlGroupRuleSaml] +type accessGroupNewResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupUpdateResponseIsDefaultAccessServiceTokenRule struct { - ServiceToken AccessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessServiceTokenRule struct { + ServiceToken AccessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupNewResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessServiceTokenRule] -type accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessServiceTokenRule] +type accessGroupNewResponseIsDefaultAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceToken] -type accessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceToken] +type accessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRule struct { +type AccessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRule] -type accessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRule] +type accessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupNewResponseIsDefault() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleJSON contains the +// accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRule] -type accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleJSON struct { +// [AccessGroupNewResponseIsDefaultAccessExternalEvaluationRule] +type accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupUpdateResponseIsDefaultAccessCountryRule struct { - Geo AccessGroupUpdateResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupUpdateResponseIsDefaultAccessCountryRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessCountryRule struct { + Geo AccessGroupNewResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupNewResponseIsDefaultAccessCountryRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessCountryRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessCountryRule] -type accessGroupUpdateResponseIsDefaultAccessCountryRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseIsDefaultAccessCountryRule] +type accessGroupNewResponseIsDefaultAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessCountryRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessCountryRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessCountryRuleGeo struct { +type AccessGroupNewResponseIsDefaultAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupUpdateResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupNewResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseIsDefaultAccessCountryRuleGeo] -type accessGroupUpdateResponseIsDefaultAccessCountryRuleGeoJSON struct { +// accessGroupNewResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessCountryRuleGeo] +type accessGroupNewResponseIsDefaultAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRule] -type accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRule] +type accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] -type accessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] +type accessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateResponseIsDefaultAccessDevicePostureRule struct { - DevicePosture AccessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupNewResponseIsDefaultAccessDevicePostureRule struct { + DevicePosture AccessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupNewResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessDevicePostureRule] -type accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleJSON struct { +// accessGroupNewResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseIsDefaultAccessDevicePostureRule] +type accessGroupNewResponseIsDefaultAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupUpdateResponseIsDefault() { +func (r AccessGroupNewResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupNewResponseIsDefault() { } -type AccessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePosture] -type accessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePosture] +type accessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupUpdateResponseRequireAccessEmailRule], -// [AccessGroupUpdateResponseRequireAccessEmailListRule], -// [AccessGroupUpdateResponseRequireAccessDomainRule], -// [AccessGroupUpdateResponseRequireAccessEveryoneRule], -// [AccessGroupUpdateResponseRequireAccessIPRule], -// [AccessGroupUpdateResponseRequireAccessIPListRule], -// [AccessGroupUpdateResponseRequireAccessCertificateRule], -// [AccessGroupUpdateResponseRequireAccessAccessGroupRule], -// [AccessGroupUpdateResponseRequireAccessAzureGroupRule], -// [AccessGroupUpdateResponseRequireAccessGitHubOrganizationRule], -// [AccessGroupUpdateResponseRequireAccessGsuiteGroupRule], -// [AccessGroupUpdateResponseRequireAccessOktaGroupRule], -// [AccessGroupUpdateResponseRequireAccessSamlGroupRule], -// [AccessGroupUpdateResponseRequireAccessServiceTokenRule], -// [AccessGroupUpdateResponseRequireAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateResponseRequireAccessExternalEvaluationRule], -// [AccessGroupUpdateResponseRequireAccessCountryRule], -// [AccessGroupUpdateResponseRequireAccessAuthenticationMethodRule] or -// [AccessGroupUpdateResponseRequireAccessDevicePostureRule]. -type AccessGroupUpdateResponseRequire interface { - implementsAccessGroupUpdateResponseRequire() +// Union satisfied by [AccessGroupNewResponseRequireAccessEmailRule], +// [AccessGroupNewResponseRequireAccessEmailListRule], +// [AccessGroupNewResponseRequireAccessDomainRule], +// [AccessGroupNewResponseRequireAccessEveryoneRule], +// [AccessGroupNewResponseRequireAccessIPRule], +// [AccessGroupNewResponseRequireAccessIPListRule], +// [AccessGroupNewResponseRequireAccessCertificateRule], +// [AccessGroupNewResponseRequireAccessAccessGroupRule], +// [AccessGroupNewResponseRequireAccessAzureGroupRule], +// [AccessGroupNewResponseRequireAccessGitHubOrganizationRule], +// [AccessGroupNewResponseRequireAccessGsuiteGroupRule], +// [AccessGroupNewResponseRequireAccessOktaGroupRule], +// [AccessGroupNewResponseRequireAccessSamlGroupRule], +// [AccessGroupNewResponseRequireAccessServiceTokenRule], +// [AccessGroupNewResponseRequireAccessAnyValidServiceTokenRule], +// [AccessGroupNewResponseRequireAccessExternalEvaluationRule], +// [AccessGroupNewResponseRequireAccessCountryRule], +// [AccessGroupNewResponseRequireAccessAuthenticationMethodRule] or +// [AccessGroupNewResponseRequireAccessDevicePostureRule]. +type AccessGroupNewResponseRequire interface { + implementsAccessGroupNewResponseRequire() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupUpdateResponseRequire)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupNewResponseRequire)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupUpdateResponseRequireAccessEmailRule struct { - Email AccessGroupUpdateResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupUpdateResponseRequireAccessEmailRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessEmailRule struct { + Email AccessGroupNewResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupNewResponseRequireAccessEmailRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseRequireAccessEmailRule] -type accessGroupUpdateResponseRequireAccessEmailRuleJSON struct { +// accessGroupNewResponseRequireAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseRequireAccessEmailRule] +type accessGroupNewResponseRequireAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessEmailRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessEmailRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessEmailRuleEmail struct { +type AccessGroupNewResponseRequireAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupUpdateResponseRequireAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupNewResponseRequireAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessEmailRuleEmail] -type accessGroupUpdateResponseRequireAccessEmailRuleEmailJSON struct { +// accessGroupNewResponseRequireAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessEmailRuleEmail] +type accessGroupNewResponseRequireAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupUpdateResponseRequireAccessEmailListRule struct { - EmailList AccessGroupUpdateResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupUpdateResponseRequireAccessEmailListRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessEmailListRule struct { + EmailList AccessGroupNewResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupNewResponseRequireAccessEmailListRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessEmailListRule] -type accessGroupUpdateResponseRequireAccessEmailListRuleJSON struct { +// accessGroupNewResponseRequireAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessEmailListRule] +type accessGroupNewResponseRequireAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessEmailListRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessEmailListRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessEmailListRuleEmailList struct { +type AccessGroupNewResponseRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessEmailListRuleEmailListJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessEmailListRuleEmailList] -type accessGroupUpdateResponseRequireAccessEmailListRuleEmailListJSON struct { +// accessGroupNewResponseRequireAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessEmailListRuleEmailList] +type accessGroupNewResponseRequireAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupUpdateResponseRequireAccessDomainRule struct { - EmailDomain AccessGroupUpdateResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupUpdateResponseRequireAccessDomainRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessDomainRule struct { + EmailDomain AccessGroupNewResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupNewResponseRequireAccessDomainRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseRequireAccessDomainRule] -type accessGroupUpdateResponseRequireAccessDomainRuleJSON struct { +// accessGroupNewResponseRequireAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseRequireAccessDomainRule] +type accessGroupNewResponseRequireAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessDomainRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessDomainRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessDomainRuleEmailDomain struct { +type AccessGroupNewResponseRequireAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupUpdateResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupNewResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessDomainRuleEmailDomainJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessDomainRuleEmailDomain] -type accessGroupUpdateResponseRequireAccessDomainRuleEmailDomainJSON struct { +// accessGroupNewResponseRequireAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessDomainRuleEmailDomain] +type accessGroupNewResponseRequireAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupUpdateResponseRequireAccessEveryoneRule struct { +type AccessGroupNewResponseRequireAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupUpdateResponseRequireAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupNewResponseRequireAccessEveryoneRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessEveryoneRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessEveryoneRule] -type accessGroupUpdateResponseRequireAccessEveryoneRuleJSON struct { +// accessGroupNewResponseRequireAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessEveryoneRule] +type accessGroupNewResponseRequireAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessEveryoneRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessEveryoneRule) implementsAccessGroupNewResponseRequire() {} // Matches an IP address block. -type AccessGroupUpdateResponseRequireAccessIPRule struct { - IP AccessGroupUpdateResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessGroupUpdateResponseRequireAccessIPRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessIPRule struct { + IP AccessGroupNewResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessGroupNewResponseRequireAccessIPRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessGroupUpdateResponseRequireAccessIPRule] -type accessGroupUpdateResponseRequireAccessIPRuleJSON struct { +// accessGroupNewResponseRequireAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupNewResponseRequireAccessIPRule] +type accessGroupNewResponseRequireAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessIPRule) implementsAccessGroupUpdateResponseRequire() {} +func (r AccessGroupNewResponseRequireAccessIPRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessIPRuleIP struct { +type AccessGroupNewResponseRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupUpdateResponseRequireAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupNewResponseRequireAccessIPRuleIPJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessIPRuleIPJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseRequireAccessIPRuleIP] -type accessGroupUpdateResponseRequireAccessIPRuleIPJSON struct { +// accessGroupNewResponseRequireAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseRequireAccessIPRuleIP] +type accessGroupNewResponseRequireAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupUpdateResponseRequireAccessIPListRule struct { - IPList AccessGroupUpdateResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupUpdateResponseRequireAccessIPListRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessIPListRule struct { + IPList AccessGroupNewResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupNewResponseRequireAccessIPListRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseRequireAccessIPListRule] -type accessGroupUpdateResponseRequireAccessIPListRuleJSON struct { +// accessGroupNewResponseRequireAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupNewResponseRequireAccessIPListRule] +type accessGroupNewResponseRequireAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessIPListRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessIPListRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessIPListRuleIPList struct { +type AccessGroupNewResponseRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseRequireAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseRequireAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessIPListRuleIPList] -type accessGroupUpdateResponseRequireAccessIPListRuleIPListJSON struct { +// accessGroupNewResponseRequireAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessIPListRuleIPList] +type accessGroupNewResponseRequireAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupUpdateResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupUpdateResponseRequireAccessCertificateRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupNewResponseRequireAccessCertificateRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessCertificateRule] -type accessGroupUpdateResponseRequireAccessCertificateRuleJSON struct { +// accessGroupNewResponseRequireAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessCertificateRule] +type accessGroupNewResponseRequireAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessCertificateRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessCertificateRule) implementsAccessGroupNewResponseRequire() { } // Matches an Access group. -type AccessGroupUpdateResponseRequireAccessAccessGroupRule struct { - Group AccessGroupUpdateResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupUpdateResponseRequireAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessAccessGroupRule struct { + Group AccessGroupNewResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupNewResponseRequireAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessAccessGroupRule] -type accessGroupUpdateResponseRequireAccessAccessGroupRuleJSON struct { +// accessGroupNewResponseRequireAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessAccessGroupRule] +type accessGroupNewResponseRequireAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessAccessGroupRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessAccessGroupRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessAccessGroupRuleGroup struct { +type AccessGroupNewResponseRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupUpdateResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupNewResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAccessGroupRuleGroupJSON contains the JSON +// accessGroupNewResponseRequireAccessAccessGroupRuleGroupJSON contains the JSON // metadata for the struct -// [AccessGroupUpdateResponseRequireAccessAccessGroupRuleGroup] -type accessGroupUpdateResponseRequireAccessAccessGroupRuleGroupJSON struct { +// [AccessGroupNewResponseRequireAccessAccessGroupRuleGroup] +type accessGroupNewResponseRequireAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateResponseRequireAccessAzureGroupRule struct { - AzureAd AccessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupUpdateResponseRequireAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessAzureGroupRule struct { + AzureAd AccessGroupNewResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupNewResponseRequireAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessAzureGroupRule] -type accessGroupUpdateResponseRequireAccessAzureGroupRuleJSON struct { +// accessGroupNewResponseRequireAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessAzureGroupRule] +type accessGroupNewResponseRequireAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessAzureGroupRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessAzureGroupRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewResponseRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupNewResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAd] -type accessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupNewResponseRequireAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessAzureGroupRuleAzureAd] +type accessGroupNewResponseRequireAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupNewResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessGitHubOrganizationRule] -type accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleJSON struct { +// accessGroupNewResponseRequireAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessGitHubOrganizationRule] +type accessGroupNewResponseRequireAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupUpdateResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessGroupNewResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupNewResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessGsuiteGroupRule] -type accessGroupUpdateResponseRequireAccessGsuiteGroupRuleJSON struct { +// accessGroupNewResponseRequireAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessGsuiteGroupRule] +type accessGroupNewResponseRequireAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessGsuiteGroupRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessGsuiteGroupRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewResponseRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuite] -type accessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessGsuiteGroupRuleGsuite] +type accessGroupNewResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateResponseRequireAccessOktaGroupRule struct { - Okta AccessGroupUpdateResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupUpdateResponseRequireAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessOktaGroupRule struct { + Okta AccessGroupNewResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupNewResponseRequireAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessOktaGroupRule] -type accessGroupUpdateResponseRequireAccessOktaGroupRuleJSON struct { +// accessGroupNewResponseRequireAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessOktaGroupRule] +type accessGroupNewResponseRequireAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessOktaGroupRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessOktaGroupRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessOktaGroupRuleOkta struct { +type AccessGroupNewResponseRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupUpdateResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupNewResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseRequireAccessOktaGroupRuleOkta] -type accessGroupUpdateResponseRequireAccessOktaGroupRuleOktaJSON struct { +// accessGroupNewResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessOktaGroupRuleOkta] +type accessGroupNewResponseRequireAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateResponseRequireAccessSamlGroupRule struct { - Saml AccessGroupUpdateResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupUpdateResponseRequireAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessSamlGroupRule struct { + Saml AccessGroupNewResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupNewResponseRequireAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessSamlGroupRule] -type accessGroupUpdateResponseRequireAccessSamlGroupRuleJSON struct { +// accessGroupNewResponseRequireAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessSamlGroupRule] +type accessGroupNewResponseRequireAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessSamlGroupRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessSamlGroupRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessSamlGroupRuleSaml struct { +type AccessGroupNewResponseRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupUpdateResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupNewResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseRequireAccessSamlGroupRuleSaml] -type accessGroupUpdateResponseRequireAccessSamlGroupRuleSamlJSON struct { +// accessGroupNewResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessSamlGroupRuleSaml] +type accessGroupNewResponseRequireAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupUpdateResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessGroupUpdateResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupUpdateResponseRequireAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessGroupNewResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupNewResponseRequireAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessServiceTokenRule] -type accessGroupUpdateResponseRequireAccessServiceTokenRuleJSON struct { +// accessGroupNewResponseRequireAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessServiceTokenRule] +type accessGroupNewResponseRequireAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessServiceTokenRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessServiceTokenRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewResponseRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupNewResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessServiceTokenRuleServiceToken] -type accessGroupUpdateResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupNewResponseRequireAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupNewResponseRequireAccessServiceTokenRuleServiceToken] +type accessGroupNewResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupUpdateResponseRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupNewResponseRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupNewResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupNewResponseRequireAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessAnyValidServiceTokenRule] -type accessGroupUpdateResponseRequireAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupNewResponseRequireAccessAnyValidServiceTokenRule] +type accessGroupNewResponseRequireAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupNewResponseRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupUpdateResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupNewResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessExternalEvaluationRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessExternalEvaluationRule] -type accessGroupUpdateResponseRequireAccessExternalEvaluationRuleJSON struct { +// accessGroupNewResponseRequireAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupNewResponseRequireAccessExternalEvaluationRule] +type accessGroupNewResponseRequireAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessExternalEvaluationRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessExternalEvaluationRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupUpdateResponseRequireAccessCountryRule struct { - Geo AccessGroupUpdateResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupUpdateResponseRequireAccessCountryRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessCountryRule struct { + Geo AccessGroupNewResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupNewResponseRequireAccessCountryRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupUpdateResponseRequireAccessCountryRule] -type accessGroupUpdateResponseRequireAccessCountryRuleJSON struct { +// accessGroupNewResponseRequireAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessCountryRule] +type accessGroupNewResponseRequireAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessCountryRule) implementsAccessGroupUpdateResponseRequire() { -} +func (r AccessGroupNewResponseRequireAccessCountryRule) implementsAccessGroupNewResponseRequire() {} -type AccessGroupUpdateResponseRequireAccessCountryRuleGeo struct { +type AccessGroupNewResponseRequireAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupUpdateResponseRequireAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupNewResponseRequireAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessGroupUpdateResponseRequireAccessCountryRuleGeo] -type accessGroupUpdateResponseRequireAccessCountryRuleGeoJSON struct { +// accessGroupNewResponseRequireAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupNewResponseRequireAccessCountryRuleGeo] +type accessGroupNewResponseRequireAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupUpdateResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupNewResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleJSON contains the +// accessGroupNewResponseRequireAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessAuthenticationMethodRule] -type accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupNewResponseRequireAccessAuthenticationMethodRule] +type accessGroupNewResponseRequireAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupUpdateResponseRequireAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupNewResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessGroupNewResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupNewResponseRequireAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupUpdateResponseRequireAccessDevicePostureRule] -type accessGroupUpdateResponseRequireAccessDevicePostureRuleJSON struct { +// accessGroupNewResponseRequireAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupNewResponseRequireAccessDevicePostureRule] +type accessGroupNewResponseRequireAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateResponseRequireAccessDevicePostureRule) implementsAccessGroupUpdateResponseRequire() { +func (r AccessGroupNewResponseRequireAccessDevicePostureRule) implementsAccessGroupNewResponseRequire() { } -type AccessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewResponseRequireAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupNewResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePosture] -type accessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupNewResponseRequireAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupNewResponseRequireAccessDevicePostureRuleDevicePosture] +type accessGroupNewResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupDeleteResponse struct { - // UUID - ID string `json:"id"` - JSON accessGroupDeleteResponseJSON `json:"-"` -} - -// accessGroupDeleteResponseJSON contains the JSON metadata for the struct -// [AccessGroupDeleteResponse] -type accessGroupDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupNewResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupAccessGroupsNewAnAccessGroupResponse struct { +type AccessGroupListResponse struct { // UUID ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude []AccessGroupAccessGroupsNewAnAccessGroupResponseExclude `json:"exclude"` + Exclude []AccessGroupListResponseExclude `json:"exclude"` // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include []AccessGroupAccessGroupsNewAnAccessGroupResponseInclude `json:"include"` + Include []AccessGroupListResponseInclude `json:"include"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - IsDefault []AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault `json:"is_default"` + IsDefault []AccessGroupListResponseIsDefault `json:"is_default"` // The name of the Access group. Name string `json:"name"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require []AccessGroupAccessGroupsNewAnAccessGroupResponseRequire `json:"require"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseJSON `json:"-"` + Require []AccessGroupListResponseRequire `json:"require"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessGroupListResponseJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseJSON contains the JSON metadata -// for the struct [AccessGroupAccessGroupsNewAnAccessGroupResponse] -type accessGroupAccessGroupsNewAnAccessGroupResponseJSON struct { +// accessGroupListResponseJSON contains the JSON metadata for the struct +// [AccessGroupListResponse] +type accessGroupListResponseJSON struct { ID apijson.Field CreatedAt apijson.Field Exclude apijson.Field @@ -3216,3135 +3155,3048 @@ type accessGroupAccessGroupsNewAnAccessGroupResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExclude interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() +// Union satisfied by [AccessGroupListResponseExcludeAccessEmailRule], +// [AccessGroupListResponseExcludeAccessEmailListRule], +// [AccessGroupListResponseExcludeAccessDomainRule], +// [AccessGroupListResponseExcludeAccessEveryoneRule], +// [AccessGroupListResponseExcludeAccessIPRule], +// [AccessGroupListResponseExcludeAccessIPListRule], +// [AccessGroupListResponseExcludeAccessCertificateRule], +// [AccessGroupListResponseExcludeAccessAccessGroupRule], +// [AccessGroupListResponseExcludeAccessAzureGroupRule], +// [AccessGroupListResponseExcludeAccessGitHubOrganizationRule], +// [AccessGroupListResponseExcludeAccessGsuiteGroupRule], +// [AccessGroupListResponseExcludeAccessOktaGroupRule], +// [AccessGroupListResponseExcludeAccessSamlGroupRule], +// [AccessGroupListResponseExcludeAccessServiceTokenRule], +// [AccessGroupListResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupListResponseExcludeAccessExternalEvaluationRule], +// [AccessGroupListResponseExcludeAccessCountryRule], +// [AccessGroupListResponseExcludeAccessAuthenticationMethodRule] or +// [AccessGroupListResponseExcludeAccessDevicePostureRule]. +type AccessGroupListResponseExclude interface { + implementsAccessGroupListResponseExclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsNewAnAccessGroupResponseExclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupListResponseExclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRule struct { - Email AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessEmailRule struct { + Email AccessGroupListResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupListResponseExcludeAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleJSON struct { +// accessGroupListResponseExcludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseExcludeAccessEmailRule] +type accessGroupListResponseExcludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { -} +func (r AccessGroupListResponseExcludeAccessEmailRule) implementsAccessGroupListResponseExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmail struct { +type AccessGroupListResponseExcludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupListResponseExcludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmail] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmailJSON struct { +// accessGroupListResponseExcludeAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessEmailRuleEmail] +type accessGroupListResponseExcludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessEmailListRule struct { + EmailList AccessGroupListResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupListResponseExcludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleJSON struct { +// accessGroupListResponseExcludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessEmailListRule] +type accessGroupListResponseExcludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessEmailListRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailList struct { +type AccessGroupListResponseExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailList] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailListJSON struct { +// accessGroupListResponseExcludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessEmailListRuleEmailList] +type accessGroupListResponseExcludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessDomainRule struct { + EmailDomain AccessGroupListResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupListResponseExcludeAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleJSON struct { +// accessGroupListResponseExcludeAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessDomainRule] +type accessGroupListResponseExcludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { -} +func (r AccessGroupListResponseExcludeAccessDomainRule) implementsAccessGroupListResponseExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupListResponseExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupListResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupListResponseExcludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessDomainRuleEmailDomain] +type accessGroupListResponseExcludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRule struct { +type AccessGroupListResponseExcludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupListResponseExcludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRuleJSON struct { +// accessGroupListResponseExcludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessEveryoneRule] +type accessGroupListResponseExcludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessEveryoneRule) implementsAccessGroupListResponseExclude() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRule struct { - IP AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessIPRule struct { + IP AccessGroupListResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupListResponseExcludeAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleJSON struct { +// accessGroupListResponseExcludeAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseExcludeAccessIPRule] +type accessGroupListResponseExcludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { -} +func (r AccessGroupListResponseExcludeAccessIPRule) implementsAccessGroupListResponseExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIP struct { +type AccessGroupListResponseExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupListResponseExcludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIP] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIPJSON struct { +// accessGroupListResponseExcludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupListResponseExcludeAccessIPRuleIP] +type accessGroupListResponseExcludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRule struct { - IPList AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessIPListRule struct { + IPList AccessGroupListResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupListResponseExcludeAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleJSON struct { +// accessGroupListResponseExcludeAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessIPListRule] +type accessGroupListResponseExcludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { -} +func (r AccessGroupListResponseExcludeAccessIPListRule) implementsAccessGroupListResponseExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPList struct { +type AccessGroupListResponseExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseExcludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPList] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPListJSON struct { +// accessGroupListResponseExcludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessIPListRuleIPList] +type accessGroupListResponseExcludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupListResponseExcludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRuleJSON struct { +// accessGroupListResponseExcludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessCertificateRule] +type accessGroupListResponseExcludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessCertificateRule) implementsAccessGroupListResponseExclude() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessAccessGroupRule struct { + Group AccessGroupListResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupListResponseExcludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleJSON struct { +// accessGroupListResponseExcludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessAccessGroupRule] +type accessGroupListResponseExcludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessAccessGroupRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupListResponseExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupListResponseExcludeAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessAccessGroupRuleGroup] +type accessGroupListResponseExcludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessGroupListResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupListResponseExcludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleJSON struct { +// accessGroupListResponseExcludeAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessAzureGroupRule] +type accessGroupListResponseExcludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessAzureGroupRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupListResponseExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupListResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupListResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessAzureGroupRuleAzureAd] +type accessGroupListResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupListResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupListResponseExcludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessGitHubOrganizationRule] +type accessGroupListResponseExcludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupListResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupListResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleJSON struct { +// accessGroupListResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessGsuiteGroupRule] +type accessGroupListResponseExcludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupListResponseExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessGroupListResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessOktaGroupRule struct { + Okta AccessGroupListResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupListResponseExcludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleJSON struct { +// accessGroupListResponseExcludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessOktaGroupRule] +type accessGroupListResponseExcludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessOktaGroupRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupListResponseExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupListResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessOktaGroupRuleOkta] +type accessGroupListResponseExcludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessSamlGroupRule struct { + Saml AccessGroupListResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupListResponseExcludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleJSON struct { +// accessGroupListResponseExcludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessSamlGroupRule] +type accessGroupListResponseExcludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessSamlGroupRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupListResponseExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupListResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupListResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessSamlGroupRuleSaml] +type accessGroupListResponseExcludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessGroupListResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupListResponseExcludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleJSON struct { +// accessGroupListResponseExcludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessServiceTokenRule] +type accessGroupListResponseExcludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessServiceTokenRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupListResponseExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupListResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupListResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseExcludeAccessServiceTokenRuleServiceToken] +type accessGroupListResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupListResponseExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupListResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupListResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseExcludeAccessAnyValidServiceTokenRule] +type accessGroupListResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupListResponseExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupListResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleJSON struct { +// accessGroupListResponseExcludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseExcludeAccessExternalEvaluationRule] +type accessGroupListResponseExcludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRule struct { - Geo AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessCountryRule struct { + Geo AccessGroupListResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupListResponseExcludeAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleJSON struct { +// accessGroupListResponseExcludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseExcludeAccessCountryRule] +type accessGroupListResponseExcludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { -} +func (r AccessGroupListResponseExcludeAccessCountryRule) implementsAccessGroupListResponseExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeo struct { +type AccessGroupListResponseExcludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupListResponseExcludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeo] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeoJSON struct { +// accessGroupListResponseExcludeAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessCountryRuleGeo] +type accessGroupListResponseExcludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupListResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleJSON struct { +// accessGroupListResponseExcludeAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseExcludeAccessAuthenticationMethodRule] +type accessGroupListResponseExcludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupListResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessGroupListResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupListResponseExcludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleJSON struct { +// accessGroupListResponseExcludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseExcludeAccessDevicePostureRule] +type accessGroupListResponseExcludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseExclude() { +func (r AccessGroupListResponseExcludeAccessDevicePostureRule) implementsAccessGroupListResponseExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupListResponseExcludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupListResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupListResponseExcludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessGroupListResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupResponseInclude interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() +// Union satisfied by [AccessGroupListResponseIncludeAccessEmailRule], +// [AccessGroupListResponseIncludeAccessEmailListRule], +// [AccessGroupListResponseIncludeAccessDomainRule], +// [AccessGroupListResponseIncludeAccessEveryoneRule], +// [AccessGroupListResponseIncludeAccessIPRule], +// [AccessGroupListResponseIncludeAccessIPListRule], +// [AccessGroupListResponseIncludeAccessCertificateRule], +// [AccessGroupListResponseIncludeAccessAccessGroupRule], +// [AccessGroupListResponseIncludeAccessAzureGroupRule], +// [AccessGroupListResponseIncludeAccessGitHubOrganizationRule], +// [AccessGroupListResponseIncludeAccessGsuiteGroupRule], +// [AccessGroupListResponseIncludeAccessOktaGroupRule], +// [AccessGroupListResponseIncludeAccessSamlGroupRule], +// [AccessGroupListResponseIncludeAccessServiceTokenRule], +// [AccessGroupListResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupListResponseIncludeAccessExternalEvaluationRule], +// [AccessGroupListResponseIncludeAccessCountryRule], +// [AccessGroupListResponseIncludeAccessAuthenticationMethodRule] or +// [AccessGroupListResponseIncludeAccessDevicePostureRule]. +type AccessGroupListResponseInclude interface { + implementsAccessGroupListResponseInclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsNewAnAccessGroupResponseInclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupListResponseInclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRule struct { - Email AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessEmailRule struct { + Email AccessGroupListResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupListResponseIncludeAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleJSON struct { +// accessGroupListResponseIncludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseIncludeAccessEmailRule] +type accessGroupListResponseIncludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { -} +func (r AccessGroupListResponseIncludeAccessEmailRule) implementsAccessGroupListResponseInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmail struct { +type AccessGroupListResponseIncludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupListResponseIncludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmail] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmailJSON struct { +// accessGroupListResponseIncludeAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessEmailRuleEmail] +type accessGroupListResponseIncludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessEmailListRule struct { + EmailList AccessGroupListResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupListResponseIncludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleJSON struct { +// accessGroupListResponseIncludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessEmailListRule] +type accessGroupListResponseIncludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessEmailListRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailList struct { +type AccessGroupListResponseIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailList] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailListJSON struct { +// accessGroupListResponseIncludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessEmailListRuleEmailList] +type accessGroupListResponseIncludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessDomainRule struct { + EmailDomain AccessGroupListResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupListResponseIncludeAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleJSON struct { +// accessGroupListResponseIncludeAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessDomainRule] +type accessGroupListResponseIncludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { -} +func (r AccessGroupListResponseIncludeAccessDomainRule) implementsAccessGroupListResponseInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupListResponseIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupListResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupListResponseIncludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessDomainRuleEmailDomain] +type accessGroupListResponseIncludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRule struct { +type AccessGroupListResponseIncludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupListResponseIncludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRuleJSON struct { +// accessGroupListResponseIncludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessEveryoneRule] +type accessGroupListResponseIncludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessEveryoneRule) implementsAccessGroupListResponseInclude() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRule struct { - IP AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessIPRule struct { + IP AccessGroupListResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupListResponseIncludeAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleJSON struct { +// accessGroupListResponseIncludeAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseIncludeAccessIPRule] +type accessGroupListResponseIncludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { -} +func (r AccessGroupListResponseIncludeAccessIPRule) implementsAccessGroupListResponseInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIP struct { +type AccessGroupListResponseIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupListResponseIncludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIP] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIPJSON struct { +// accessGroupListResponseIncludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupListResponseIncludeAccessIPRuleIP] +type accessGroupListResponseIncludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRule struct { - IPList AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessIPListRule struct { + IPList AccessGroupListResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupListResponseIncludeAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleJSON struct { +// accessGroupListResponseIncludeAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessIPListRule] +type accessGroupListResponseIncludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { -} +func (r AccessGroupListResponseIncludeAccessIPListRule) implementsAccessGroupListResponseInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPList struct { +type AccessGroupListResponseIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIncludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPList] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPListJSON struct { +// accessGroupListResponseIncludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessIPListRuleIPList] +type accessGroupListResponseIncludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupListResponseIncludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRuleJSON struct { +// accessGroupListResponseIncludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessCertificateRule] +type accessGroupListResponseIncludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessCertificateRule) implementsAccessGroupListResponseInclude() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessAccessGroupRule struct { + Group AccessGroupListResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupListResponseIncludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleJSON struct { +// accessGroupListResponseIncludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessAccessGroupRule] +type accessGroupListResponseIncludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessAccessGroupRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupListResponseIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupListResponseIncludeAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessAccessGroupRuleGroup] +type accessGroupListResponseIncludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessGroupListResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupListResponseIncludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleJSON struct { +// accessGroupListResponseIncludeAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessAzureGroupRule] +type accessGroupListResponseIncludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessAzureGroupRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupListResponseIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupListResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupListResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessAzureGroupRuleAzureAd] +type accessGroupListResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupListResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupListResponseIncludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessGitHubOrganizationRule] +type accessGroupListResponseIncludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupListResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupListResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleJSON struct { +// accessGroupListResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessGsuiteGroupRule] +type accessGroupListResponseIncludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupListResponseIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessGroupListResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessOktaGroupRule struct { + Okta AccessGroupListResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupListResponseIncludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleJSON struct { +// accessGroupListResponseIncludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessOktaGroupRule] +type accessGroupListResponseIncludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessOktaGroupRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupListResponseIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupListResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessOktaGroupRuleOkta] +type accessGroupListResponseIncludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessSamlGroupRule struct { + Saml AccessGroupListResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupListResponseIncludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleJSON struct { +// accessGroupListResponseIncludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessSamlGroupRule] +type accessGroupListResponseIncludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessSamlGroupRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupListResponseIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupListResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupListResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessSamlGroupRuleSaml] +type accessGroupListResponseIncludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessGroupListResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupListResponseIncludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleJSON struct { +// accessGroupListResponseIncludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessServiceTokenRule] +type accessGroupListResponseIncludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessServiceTokenRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupListResponseIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupListResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupListResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseIncludeAccessServiceTokenRuleServiceToken] +type accessGroupListResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupListResponseIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupListResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupListResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIncludeAccessAnyValidServiceTokenRule] +type accessGroupListResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupListResponseInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupListResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleJSON struct { +// accessGroupListResponseIncludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIncludeAccessExternalEvaluationRule] +type accessGroupListResponseIncludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRule struct { - Geo AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessCountryRule struct { + Geo AccessGroupListResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupListResponseIncludeAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleJSON struct { +// accessGroupListResponseIncludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIncludeAccessCountryRule] +type accessGroupListResponseIncludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { -} +func (r AccessGroupListResponseIncludeAccessCountryRule) implementsAccessGroupListResponseInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeo struct { +type AccessGroupListResponseIncludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupListResponseIncludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeo] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeoJSON struct { +// accessGroupListResponseIncludeAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessCountryRuleGeo] +type accessGroupListResponseIncludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupListResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleJSON struct { +// accessGroupListResponseIncludeAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIncludeAccessAuthenticationMethodRule] +type accessGroupListResponseIncludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupListResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessGroupListResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupListResponseIncludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleJSON struct { +// accessGroupListResponseIncludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIncludeAccessDevicePostureRule] +type accessGroupListResponseIncludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseInclude() { +func (r AccessGroupListResponseIncludeAccessDevicePostureRule) implementsAccessGroupListResponseInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupListResponseIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupListResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupListResponseIncludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessGroupListResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() +// Union satisfied by [AccessGroupListResponseIsDefaultAccessEmailRule], +// [AccessGroupListResponseIsDefaultAccessEmailListRule], +// [AccessGroupListResponseIsDefaultAccessDomainRule], +// [AccessGroupListResponseIsDefaultAccessEveryoneRule], +// [AccessGroupListResponseIsDefaultAccessIPRule], +// [AccessGroupListResponseIsDefaultAccessIPListRule], +// [AccessGroupListResponseIsDefaultAccessCertificateRule], +// [AccessGroupListResponseIsDefaultAccessAccessGroupRule], +// [AccessGroupListResponseIsDefaultAccessAzureGroupRule], +// [AccessGroupListResponseIsDefaultAccessGitHubOrganizationRule], +// [AccessGroupListResponseIsDefaultAccessGsuiteGroupRule], +// [AccessGroupListResponseIsDefaultAccessOktaGroupRule], +// [AccessGroupListResponseIsDefaultAccessSamlGroupRule], +// [AccessGroupListResponseIsDefaultAccessServiceTokenRule], +// [AccessGroupListResponseIsDefaultAccessAnyValidServiceTokenRule], +// [AccessGroupListResponseIsDefaultAccessExternalEvaluationRule], +// [AccessGroupListResponseIsDefaultAccessCountryRule], +// [AccessGroupListResponseIsDefaultAccessAuthenticationMethodRule] or +// [AccessGroupListResponseIsDefaultAccessDevicePostureRule]. +type AccessGroupListResponseIsDefault interface { + implementsAccessGroupListResponseIsDefault() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupListResponseIsDefault)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRule struct { - Email AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessEmailRule struct { + Email AccessGroupListResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupListResponseIsDefaultAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleJSON struct { +// accessGroupListResponseIsDefaultAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIsDefaultAccessEmailRule] +type accessGroupListResponseIsDefaultAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessEmailRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmail struct { +type AccessGroupListResponseIsDefaultAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupListResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmail] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmailJSON struct { +// accessGroupListResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessEmailRuleEmail] +type accessGroupListResponseIsDefaultAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessEmailListRule struct { + EmailList AccessGroupListResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupListResponseIsDefaultAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleJSON struct { +// accessGroupListResponseIsDefaultAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessEmailListRule] +type accessGroupListResponseIsDefaultAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessEmailListRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailList struct { +type AccessGroupListResponseIsDefaultAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailList] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailListJSON struct { +// accessGroupListResponseIsDefaultAccessEmailListRuleEmailListJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessEmailListRuleEmailList] +type accessGroupListResponseIsDefaultAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessDomainRule struct { + EmailDomain AccessGroupListResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupListResponseIsDefaultAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleJSON struct { +// accessGroupListResponseIsDefaultAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIsDefaultAccessDomainRule] +type accessGroupListResponseIsDefaultAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessDomainRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomain struct { +type AccessGroupListResponseIsDefaultAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupListResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { +// accessGroupListResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessDomainRuleEmailDomain] +type accessGroupListResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRule struct { +type AccessGroupListResponseIsDefaultAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupListResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRuleJSON struct { +// accessGroupListResponseIsDefaultAccessEveryoneRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessEveryoneRule] +type accessGroupListResponseIsDefaultAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessEveryoneRule) implementsAccessGroupListResponseIsDefault() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRule struct { - IP AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessIPRule struct { + IP AccessGroupListResponseIsDefaultAccessIPRuleIP `json:"ip,required"` + JSON accessGroupListResponseIsDefaultAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleJSON struct { +// accessGroupListResponseIsDefaultAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseIsDefaultAccessIPRule] +type accessGroupListResponseIsDefaultAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { -} +func (r AccessGroupListResponseIsDefaultAccessIPRule) implementsAccessGroupListResponseIsDefault() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIP struct { +type AccessGroupListResponseIsDefaultAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupListResponseIsDefaultAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIP] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIPJSON struct { +// accessGroupListResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIsDefaultAccessIPRuleIP] +type accessGroupListResponseIsDefaultAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRule struct { - IPList AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessIPListRule struct { + IPList AccessGroupListResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupListResponseIsDefaultAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleJSON struct { +// accessGroupListResponseIsDefaultAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIsDefaultAccessIPListRule] +type accessGroupListResponseIsDefaultAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessIPListRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPList struct { +type AccessGroupListResponseIsDefaultAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPList] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPListJSON struct { +// accessGroupListResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessIPListRuleIPList] +type accessGroupListResponseIsDefaultAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupListResponseIsDefaultAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRuleJSON struct { +// accessGroupListResponseIsDefaultAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessCertificateRule] +type accessGroupListResponseIsDefaultAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessCertificateRule) implementsAccessGroupListResponseIsDefault() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessAccessGroupRule struct { + Group AccessGroupListResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupListResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleJSON struct { +// accessGroupListResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessAccessGroupRule] +type accessGroupListResponseIsDefaultAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroup struct { +type AccessGroupListResponseIsDefaultAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { +// accessGroupListResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIsDefaultAccessAccessGroupRuleGroup] +type accessGroupListResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessAzureGroupRule struct { + AzureAd AccessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupListResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleJSON struct { +// accessGroupListResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessAzureGroupRule] +type accessGroupListResponseIsDefaultAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAd struct { +type AccessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAd] +type accessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { +// accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessGitHubOrganizationRule] +type accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessGsuiteGroupRule struct { + Gsuite AccessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupListResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleJSON struct { +// accessGroupListResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessGsuiteGroupRule] +type accessGroupListResponseIsDefaultAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { +type AccessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuite] +type accessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessOktaGroupRule struct { + Okta AccessGroupListResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupListResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleJSON struct { +// accessGroupListResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessOktaGroupRule] +type accessGroupListResponseIsDefaultAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOkta struct { +type AccessGroupListResponseIsDefaultAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { +// accessGroupListResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIsDefaultAccessOktaGroupRuleOkta] +type accessGroupListResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessSamlGroupRule struct { + Saml AccessGroupListResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupListResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleJSON struct { +// accessGroupListResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessSamlGroupRule] +type accessGroupListResponseIsDefaultAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSaml struct { +type AccessGroupListResponseIsDefaultAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupListResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { +// accessGroupListResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIsDefaultAccessSamlGroupRuleSaml] +type accessGroupListResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessServiceTokenRule struct { + ServiceToken AccessGroupListResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupListResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleJSON struct { +// accessGroupListResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessServiceTokenRule] +type accessGroupListResponseIsDefaultAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceToken struct { +type AccessGroupListResponseIsDefaultAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupListResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupListResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessServiceTokenRuleServiceToken] +type accessGroupListResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRule struct { +type AccessGroupListResponseIsDefaultAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupListResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupListResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessAnyValidServiceTokenRule] +type accessGroupListResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupListResponseIsDefault() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupListResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleJSON struct { +// accessGroupListResponseIsDefaultAccessExternalEvaluationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessExternalEvaluationRule] +type accessGroupListResponseIsDefaultAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRule struct { - Geo AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessCountryRule struct { + Geo AccessGroupListResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupListResponseIsDefaultAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleJSON struct { +// accessGroupListResponseIsDefaultAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseIsDefaultAccessCountryRule] +type accessGroupListResponseIsDefaultAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessCountryRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeo struct { +type AccessGroupListResponseIsDefaultAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupListResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeo] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeoJSON struct { +// accessGroupListResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupListResponseIsDefaultAccessCountryRuleGeo] +type accessGroupListResponseIsDefaultAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { +// accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseIsDefaultAccessAuthenticationMethodRule] +type accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] +type accessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupListResponseIsDefaultAccessDevicePostureRule struct { + DevicePosture AccessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupListResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleJSON struct { +// accessGroupListResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseIsDefaultAccessDevicePostureRule] +type accessGroupListResponseIsDefaultAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseIsDefault() { +func (r AccessGroupListResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupListResponseIsDefault() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { +type AccessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON +// accessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { +// [AccessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePosture] +type accessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequire interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() +// Union satisfied by [AccessGroupListResponseRequireAccessEmailRule], +// [AccessGroupListResponseRequireAccessEmailListRule], +// [AccessGroupListResponseRequireAccessDomainRule], +// [AccessGroupListResponseRequireAccessEveryoneRule], +// [AccessGroupListResponseRequireAccessIPRule], +// [AccessGroupListResponseRequireAccessIPListRule], +// [AccessGroupListResponseRequireAccessCertificateRule], +// [AccessGroupListResponseRequireAccessAccessGroupRule], +// [AccessGroupListResponseRequireAccessAzureGroupRule], +// [AccessGroupListResponseRequireAccessGitHubOrganizationRule], +// [AccessGroupListResponseRequireAccessGsuiteGroupRule], +// [AccessGroupListResponseRequireAccessOktaGroupRule], +// [AccessGroupListResponseRequireAccessSamlGroupRule], +// [AccessGroupListResponseRequireAccessServiceTokenRule], +// [AccessGroupListResponseRequireAccessAnyValidServiceTokenRule], +// [AccessGroupListResponseRequireAccessExternalEvaluationRule], +// [AccessGroupListResponseRequireAccessCountryRule], +// [AccessGroupListResponseRequireAccessAuthenticationMethodRule] or +// [AccessGroupListResponseRequireAccessDevicePostureRule]. +type AccessGroupListResponseRequire interface { + implementsAccessGroupListResponseRequire() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsNewAnAccessGroupResponseRequire)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupListResponseRequire)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRule struct { - Email AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessEmailRule struct { + Email AccessGroupListResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupListResponseRequireAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleJSON struct { +// accessGroupListResponseRequireAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseRequireAccessEmailRule] +type accessGroupListResponseRequireAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { -} +func (r AccessGroupListResponseRequireAccessEmailRule) implementsAccessGroupListResponseRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmail struct { +type AccessGroupListResponseRequireAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupListResponseRequireAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmail] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmailJSON struct { +// accessGroupListResponseRequireAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessEmailRuleEmail] +type accessGroupListResponseRequireAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessEmailListRule struct { + EmailList AccessGroupListResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupListResponseRequireAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleJSON struct { +// accessGroupListResponseRequireAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessEmailListRule] +type accessGroupListResponseRequireAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessEmailListRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailList struct { +type AccessGroupListResponseRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailList] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailListJSON struct { +// accessGroupListResponseRequireAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessEmailListRuleEmailList] +type accessGroupListResponseRequireAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessDomainRule struct { + EmailDomain AccessGroupListResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupListResponseRequireAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleJSON struct { +// accessGroupListResponseRequireAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessDomainRule] +type accessGroupListResponseRequireAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { -} +func (r AccessGroupListResponseRequireAccessDomainRule) implementsAccessGroupListResponseRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomain struct { +type AccessGroupListResponseRequireAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupListResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomainJSON struct { +// accessGroupListResponseRequireAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessDomainRuleEmailDomain] +type accessGroupListResponseRequireAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRule struct { +type AccessGroupListResponseRequireAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupListResponseRequireAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRuleJSON struct { +// accessGroupListResponseRequireAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessEveryoneRule] +type accessGroupListResponseRequireAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessEveryoneRule) implementsAccessGroupListResponseRequire() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRule struct { - IP AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessIPRule struct { + IP AccessGroupListResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessGroupListResponseRequireAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleJSON struct { +// accessGroupListResponseRequireAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupListResponseRequireAccessIPRule] +type accessGroupListResponseRequireAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { -} +func (r AccessGroupListResponseRequireAccessIPRule) implementsAccessGroupListResponseRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIP struct { +type AccessGroupListResponseRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupListResponseRequireAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIP] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIPJSON struct { +// accessGroupListResponseRequireAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupListResponseRequireAccessIPRuleIP] +type accessGroupListResponseRequireAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRule struct { - IPList AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessIPListRule struct { + IPList AccessGroupListResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupListResponseRequireAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleJSON struct { +// accessGroupListResponseRequireAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessIPListRule] +type accessGroupListResponseRequireAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { -} +func (r AccessGroupListResponseRequireAccessIPListRule) implementsAccessGroupListResponseRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPList struct { +type AccessGroupListResponseRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseRequireAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPList] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPListJSON struct { +// accessGroupListResponseRequireAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessIPListRuleIPList] +type accessGroupListResponseRequireAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupListResponseRequireAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRuleJSON struct { +// accessGroupListResponseRequireAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessCertificateRule] +type accessGroupListResponseRequireAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessCertificateRule) implementsAccessGroupListResponseRequire() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessAccessGroupRule struct { + Group AccessGroupListResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupListResponseRequireAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleJSON struct { +// accessGroupListResponseRequireAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessAccessGroupRule] +type accessGroupListResponseRequireAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessAccessGroupRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroup struct { +type AccessGroupListResponseRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupListResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroupJSON struct { +// accessGroupListResponseRequireAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessAccessGroupRuleGroup] +type accessGroupListResponseRequireAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessAzureGroupRule struct { + AzureAd AccessGroupListResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupListResponseRequireAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleJSON struct { +// accessGroupListResponseRequireAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessAzureGroupRule] +type accessGroupListResponseRequireAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessAzureGroupRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupListResponseRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupListResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupListResponseRequireAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessAzureGroupRuleAzureAd] +type accessGroupListResponseRequireAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupListResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleJSON struct { +// accessGroupListResponseRequireAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessGitHubOrganizationRule] +type accessGroupListResponseRequireAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessGroupListResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupListResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleJSON struct { +// accessGroupListResponseRequireAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessGsuiteGroupRule] +type accessGroupListResponseRequireAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessGsuiteGroupRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupListResponseRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupListResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessGsuiteGroupRuleGsuite] +type accessGroupListResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessOktaGroupRule struct { + Okta AccessGroupListResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupListResponseRequireAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleJSON struct { +// accessGroupListResponseRequireAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessOktaGroupRule] +type accessGroupListResponseRequireAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessOktaGroupRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOkta struct { +type AccessGroupListResponseRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupListResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOktaJSON struct { +// accessGroupListResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessOktaGroupRuleOkta] +type accessGroupListResponseRequireAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessSamlGroupRule struct { + Saml AccessGroupListResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupListResponseRequireAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleJSON struct { +// accessGroupListResponseRequireAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessSamlGroupRule] +type accessGroupListResponseRequireAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessSamlGroupRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSaml struct { +type AccessGroupListResponseRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupListResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSamlJSON struct { +// accessGroupListResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessSamlGroupRuleSaml] +type accessGroupListResponseRequireAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessGroupListResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupListResponseRequireAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleJSON struct { +// accessGroupListResponseRequireAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessServiceTokenRule] +type accessGroupListResponseRequireAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessServiceTokenRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupListResponseRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupListResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupListResponseRequireAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseRequireAccessServiceTokenRuleServiceToken] +type accessGroupListResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupListResponseRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupListResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupListResponseRequireAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseRequireAccessAnyValidServiceTokenRule] +type accessGroupListResponseRequireAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupListResponseRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupListResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleJSON struct { +// accessGroupListResponseRequireAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupListResponseRequireAccessExternalEvaluationRule] +type accessGroupListResponseRequireAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessExternalEvaluationRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRule struct { - Geo AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessCountryRule struct { + Geo AccessGroupListResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupListResponseRequireAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleJSON struct { +// accessGroupListResponseRequireAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupListResponseRequireAccessCountryRule] +type accessGroupListResponseRequireAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { -} +func (r AccessGroupListResponseRequireAccessCountryRule) implementsAccessGroupListResponseRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeo struct { +type AccessGroupListResponseRequireAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupListResponseRequireAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeo] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeoJSON struct { +// accessGroupListResponseRequireAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessCountryRuleGeo] +type accessGroupListResponseRequireAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupListResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleJSON struct { +// accessGroupListResponseRequireAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupListResponseRequireAccessAuthenticationMethodRule] +type accessGroupListResponseRequireAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupListResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessGroupListResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupListResponseRequireAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRule] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleJSON struct { +// accessGroupListResponseRequireAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupListResponseRequireAccessDevicePostureRule] +type accessGroupListResponseRequireAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupResponseRequire() { +func (r AccessGroupListResponseRequireAccessDevicePostureRule) implementsAccessGroupListResponseRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePosture struct { +type AccessGroupListResponseRequireAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupListResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupListResponseRequireAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupListResponseRequireAccessDevicePostureRuleDevicePosture] +type accessGroupListResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessGroupDeleteResponse struct { + // UUID + ID string `json:"id"` + JSON accessGroupDeleteResponseJSON `json:"-"` +} + +// accessGroupDeleteResponseJSON contains the JSON metadata for the struct +// [AccessGroupDeleteResponse] +type accessGroupDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupAccessGroupsListAccessGroupsResponse struct { +type AccessGroupGetResponse struct { // UUID ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude []AccessGroupAccessGroupsListAccessGroupsResponseExclude `json:"exclude"` + Exclude []AccessGroupGetResponseExclude `json:"exclude"` // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include []AccessGroupAccessGroupsListAccessGroupsResponseInclude `json:"include"` + Include []AccessGroupGetResponseInclude `json:"include"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - IsDefault []AccessGroupAccessGroupsListAccessGroupsResponseIsDefault `json:"is_default"` + IsDefault []AccessGroupGetResponseIsDefault `json:"is_default"` // The name of the Access group. Name string `json:"name"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require []AccessGroupAccessGroupsListAccessGroupsResponseRequire `json:"require"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessGroupAccessGroupsListAccessGroupsResponseJSON `json:"-"` + Require []AccessGroupGetResponseRequire `json:"require"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessGroupGetResponseJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseJSON contains the JSON metadata -// for the struct [AccessGroupAccessGroupsListAccessGroupsResponse] -type accessGroupAccessGroupsListAccessGroupsResponseJSON struct { +// accessGroupGetResponseJSON contains the JSON metadata for the struct +// [AccessGroupGetResponse] +type accessGroupGetResponseJSON struct { ID apijson.Field CreatedAt apijson.Field Exclude apijson.Field @@ -6357,3135 +6209,3014 @@ type accessGroupAccessGroupsListAccessGroupsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsListAccessGroupsResponseExclude interface { - implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() +// Union satisfied by [AccessGroupGetResponseExcludeAccessEmailRule], +// [AccessGroupGetResponseExcludeAccessEmailListRule], +// [AccessGroupGetResponseExcludeAccessDomainRule], +// [AccessGroupGetResponseExcludeAccessEveryoneRule], +// [AccessGroupGetResponseExcludeAccessIPRule], +// [AccessGroupGetResponseExcludeAccessIPListRule], +// [AccessGroupGetResponseExcludeAccessCertificateRule], +// [AccessGroupGetResponseExcludeAccessAccessGroupRule], +// [AccessGroupGetResponseExcludeAccessAzureGroupRule], +// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRule], +// [AccessGroupGetResponseExcludeAccessGsuiteGroupRule], +// [AccessGroupGetResponseExcludeAccessOktaGroupRule], +// [AccessGroupGetResponseExcludeAccessSamlGroupRule], +// [AccessGroupGetResponseExcludeAccessServiceTokenRule], +// [AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupGetResponseExcludeAccessExternalEvaluationRule], +// [AccessGroupGetResponseExcludeAccessCountryRule], +// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRule] or +// [AccessGroupGetResponseExcludeAccessDevicePostureRule]. +type AccessGroupGetResponseExclude interface { + implementsAccessGroupGetResponseExclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsListAccessGroupsResponseExclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseExclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRule struct { - Email AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessEmailRule struct { + Email AccessGroupGetResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupGetResponseExcludeAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleJSON struct { +// accessGroupGetResponseExcludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseExcludeAccessEmailRule] +type accessGroupGetResponseExcludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessEmailRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmail struct { +type AccessGroupGetResponseExcludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupGetResponseExcludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmail] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmailJSON struct { +// accessGroupGetResponseExcludeAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessEmailRuleEmail] +type accessGroupGetResponseExcludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessEmailListRule struct { + EmailList AccessGroupGetResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupGetResponseExcludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleJSON struct { +// accessGroupGetResponseExcludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessEmailListRule] +type accessGroupGetResponseExcludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessEmailListRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailList struct { +type AccessGroupGetResponseExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailList] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailListJSON struct { +// accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessEmailListRuleEmailList] +type accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessDomainRule struct { + EmailDomain AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupGetResponseExcludeAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleJSON struct { +// accessGroupGetResponseExcludeAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseExcludeAccessDomainRule] +type accessGroupGetResponseExcludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessDomainRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain] +type accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRule struct { +type AccessGroupGetResponseExcludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupGetResponseExcludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRuleJSON struct { +// accessGroupGetResponseExcludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessEveryoneRule] +type accessGroupGetResponseExcludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessEveryoneRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessEveryoneRule) implementsAccessGroupGetResponseExclude() {} // Matches an IP address block. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRule struct { - IP AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessIPRule struct { + IP AccessGroupGetResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupGetResponseExcludeAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleJSON struct { +// accessGroupGetResponseExcludeAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupGetResponseExcludeAccessIPRule] +type accessGroupGetResponseExcludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessIPRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIP struct { +type AccessGroupGetResponseExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupGetResponseExcludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIP] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIPJSON struct { +// accessGroupGetResponseExcludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseExcludeAccessIPRuleIP] +type accessGroupGetResponseExcludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRule struct { - IPList AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessIPListRule struct { + IPList AccessGroupGetResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupGetResponseExcludeAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleJSON struct { +// accessGroupGetResponseExcludeAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseExcludeAccessIPListRule] +type accessGroupGetResponseExcludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessIPListRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPList struct { +type AccessGroupGetResponseExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseExcludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPList] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPListJSON struct { +// accessGroupGetResponseExcludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessIPListRuleIPList] +type accessGroupGetResponseExcludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupGetResponseExcludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRuleJSON struct { +// accessGroupGetResponseExcludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessCertificateRule] +type accessGroupGetResponseExcludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCertificateRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessCertificateRule) implementsAccessGroupGetResponseExclude() { } // Matches an Access group. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessAccessGroupRule struct { + Group AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupGetResponseExcludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleJSON struct { +// accessGroupGetResponseExcludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessAccessGroupRule] +type accessGroupGetResponseExcludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessAccessGroupRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup] +type accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupGetResponseExcludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleJSON struct { +// accessGroupGetResponseExcludeAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessAzureGroupRule] +type accessGroupGetResponseExcludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessAzureGroupRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd] +type accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRule] +type accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleJSON struct { +// accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessGsuiteGroupRule] +type accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessOktaGroupRule struct { + Okta AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupGetResponseExcludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleJSON struct { +// accessGroupGetResponseExcludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessOktaGroupRule] +type accessGroupGetResponseExcludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessOktaGroupRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta] +type accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessSamlGroupRule struct { + Saml AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupGetResponseExcludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleJSON struct { +// accessGroupGetResponseExcludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessSamlGroupRule] +type accessGroupGetResponseExcludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessSamlGroupRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml] +type accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupGetResponseExcludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleJSON struct { +// accessGroupGetResponseExcludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessServiceTokenRule] +type accessGroupGetResponseExcludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessServiceTokenRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken] +type accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule] +type accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleJSON struct { +// accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseExcludeAccessExternalEvaluationRule] +type accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRule struct { - Geo AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessCountryRule struct { + Geo AccessGroupGetResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupGetResponseExcludeAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleJSON struct { +// accessGroupGetResponseExcludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessCountryRule] +type accessGroupGetResponseExcludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { -} +func (r AccessGroupGetResponseExcludeAccessCountryRule) implementsAccessGroupGetResponseExclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeo struct { +type AccessGroupGetResponseExcludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupGetResponseExcludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeo] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeoJSON struct { +// accessGroupGetResponseExcludeAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseExcludeAccessCountryRuleGeo] +type accessGroupGetResponseExcludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleJSON struct { +// accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRule] +type accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupGetResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupGetResponseExcludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRule] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleJSON struct { +// accessGroupGetResponseExcludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseExcludeAccessDevicePostureRule] +type accessGroupGetResponseExcludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseExclude() { +func (r AccessGroupGetResponseExcludeAccessDevicePostureRule) implementsAccessGroupGetResponseExclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsListAccessGroupsResponseInclude interface { - implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() +// Union satisfied by [AccessGroupGetResponseIncludeAccessEmailRule], +// [AccessGroupGetResponseIncludeAccessEmailListRule], +// [AccessGroupGetResponseIncludeAccessDomainRule], +// [AccessGroupGetResponseIncludeAccessEveryoneRule], +// [AccessGroupGetResponseIncludeAccessIPRule], +// [AccessGroupGetResponseIncludeAccessIPListRule], +// [AccessGroupGetResponseIncludeAccessCertificateRule], +// [AccessGroupGetResponseIncludeAccessAccessGroupRule], +// [AccessGroupGetResponseIncludeAccessAzureGroupRule], +// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRule], +// [AccessGroupGetResponseIncludeAccessGsuiteGroupRule], +// [AccessGroupGetResponseIncludeAccessOktaGroupRule], +// [AccessGroupGetResponseIncludeAccessSamlGroupRule], +// [AccessGroupGetResponseIncludeAccessServiceTokenRule], +// [AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupGetResponseIncludeAccessExternalEvaluationRule], +// [AccessGroupGetResponseIncludeAccessCountryRule], +// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRule] or +// [AccessGroupGetResponseIncludeAccessDevicePostureRule]. +type AccessGroupGetResponseInclude interface { + implementsAccessGroupGetResponseInclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsListAccessGroupsResponseInclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseInclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRule struct { - Email AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessEmailRule struct { + Email AccessGroupGetResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupGetResponseIncludeAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleJSON struct { +// accessGroupGetResponseIncludeAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIncludeAccessEmailRule] +type accessGroupGetResponseIncludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessEmailRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmail struct { +type AccessGroupGetResponseIncludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupGetResponseIncludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmail] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmailJSON struct { +// accessGroupGetResponseIncludeAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessEmailRuleEmail] +type accessGroupGetResponseIncludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessEmailListRule struct { + EmailList AccessGroupGetResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupGetResponseIncludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleJSON struct { +// accessGroupGetResponseIncludeAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessEmailListRule] +type accessGroupGetResponseIncludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessEmailListRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailList struct { +type AccessGroupGetResponseIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailList] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailListJSON struct { +// accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessEmailListRuleEmailList] +type accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessDomainRule struct { + EmailDomain AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupGetResponseIncludeAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleJSON struct { +// accessGroupGetResponseIncludeAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIncludeAccessDomainRule] +type accessGroupGetResponseIncludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessDomainRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain] +type accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRule struct { +type AccessGroupGetResponseIncludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupGetResponseIncludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRuleJSON struct { +// accessGroupGetResponseIncludeAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessEveryoneRule] +type accessGroupGetResponseIncludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessEveryoneRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessEveryoneRule) implementsAccessGroupGetResponseInclude() {} // Matches an IP address block. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRule struct { - IP AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessIPRule struct { + IP AccessGroupGetResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupGetResponseIncludeAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleJSON struct { +// accessGroupGetResponseIncludeAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupGetResponseIncludeAccessIPRule] +type accessGroupGetResponseIncludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessIPRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIP struct { +type AccessGroupGetResponseIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupGetResponseIncludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIP] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIPJSON struct { +// accessGroupGetResponseIncludeAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIncludeAccessIPRuleIP] +type accessGroupGetResponseIncludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRule struct { - IPList AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessIPListRule struct { + IPList AccessGroupGetResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupGetResponseIncludeAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleJSON struct { +// accessGroupGetResponseIncludeAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIncludeAccessIPListRule] +type accessGroupGetResponseIncludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessIPListRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPList struct { +type AccessGroupGetResponseIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseIncludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPList] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPListJSON struct { +// accessGroupGetResponseIncludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessIPListRuleIPList] +type accessGroupGetResponseIncludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupGetResponseIncludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRuleJSON struct { +// accessGroupGetResponseIncludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessCertificateRule] +type accessGroupGetResponseIncludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCertificateRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessCertificateRule) implementsAccessGroupGetResponseInclude() { } // Matches an Access group. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessAccessGroupRule struct { + Group AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupGetResponseIncludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleJSON struct { +// accessGroupGetResponseIncludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessAccessGroupRule] +type accessGroupGetResponseIncludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessAccessGroupRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` -} + ID string `json:"id,required"` + JSON accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` +} -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup] +type accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupGetResponseIncludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleJSON struct { +// accessGroupGetResponseIncludeAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessAzureGroupRule] +type accessGroupGetResponseIncludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessAzureGroupRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd] +type accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRule] +type accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleJSON struct { +// accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessGsuiteGroupRule] +type accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessOktaGroupRule struct { + Okta AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupGetResponseIncludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleJSON struct { +// accessGroupGetResponseIncludeAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessOktaGroupRule] +type accessGroupGetResponseIncludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessOktaGroupRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta] +type accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessSamlGroupRule struct { + Saml AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupGetResponseIncludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleJSON struct { +// accessGroupGetResponseIncludeAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessSamlGroupRule] +type accessGroupGetResponseIncludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessSamlGroupRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml] +type accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupGetResponseIncludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleJSON struct { +// accessGroupGetResponseIncludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessServiceTokenRule] +type accessGroupGetResponseIncludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessServiceTokenRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken] +type accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule] +type accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleJSON struct { +// accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIncludeAccessExternalEvaluationRule] +type accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRule struct { - Geo AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessCountryRule struct { + Geo AccessGroupGetResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupGetResponseIncludeAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleJSON struct { +// accessGroupGetResponseIncludeAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessCountryRule] +type accessGroupGetResponseIncludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { -} +func (r AccessGroupGetResponseIncludeAccessCountryRule) implementsAccessGroupGetResponseInclude() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeo struct { +type AccessGroupGetResponseIncludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupGetResponseIncludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeo] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeoJSON struct { +// accessGroupGetResponseIncludeAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIncludeAccessCountryRuleGeo] +type accessGroupGetResponseIncludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleJSON struct { +// accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRule] +type accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupGetResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupGetResponseIncludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRule] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleJSON struct { +// accessGroupGetResponseIncludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIncludeAccessDevicePostureRule] +type accessGroupGetResponseIncludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseInclude() { +func (r AccessGroupGetResponseIncludeAccessDevicePostureRule) implementsAccessGroupGetResponseInclude() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRule]. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefault interface { - implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() +// Union satisfied by [AccessGroupGetResponseIsDefaultAccessEmailRule], +// [AccessGroupGetResponseIsDefaultAccessEmailListRule], +// [AccessGroupGetResponseIsDefaultAccessDomainRule], +// [AccessGroupGetResponseIsDefaultAccessEveryoneRule], +// [AccessGroupGetResponseIsDefaultAccessIPRule], +// [AccessGroupGetResponseIsDefaultAccessIPListRule], +// [AccessGroupGetResponseIsDefaultAccessCertificateRule], +// [AccessGroupGetResponseIsDefaultAccessAccessGroupRule], +// [AccessGroupGetResponseIsDefaultAccessAzureGroupRule], +// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule], +// [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule], +// [AccessGroupGetResponseIsDefaultAccessOktaGroupRule], +// [AccessGroupGetResponseIsDefaultAccessSamlGroupRule], +// [AccessGroupGetResponseIsDefaultAccessServiceTokenRule], +// [AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule], +// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule], +// [AccessGroupGetResponseIsDefaultAccessCountryRule], +// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule] or +// [AccessGroupGetResponseIsDefaultAccessDevicePostureRule]. +type AccessGroupGetResponseIsDefault interface { + implementsAccessGroupGetResponseIsDefault() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsListAccessGroupsResponseIsDefault)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseIsDefault)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRule struct { - Email AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessEmailRule struct { + Email AccessGroupGetResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupGetResponseIsDefaultAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIsDefaultAccessEmailRule] +type accessGroupGetResponseIsDefaultAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { -} +func (r AccessGroupGetResponseIsDefaultAccessEmailRule) implementsAccessGroupGetResponseIsDefault() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmail struct { +type AccessGroupGetResponseIsDefaultAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmail] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmailJSON struct { +// accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessEmailRuleEmail] +type accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessEmailListRule struct { + EmailList AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupGetResponseIsDefaultAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessEmailListRule] +type accessGroupGetResponseIsDefaultAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessEmailListRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailList struct { +type AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailList] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailListJSON struct { +// accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList] +type accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleJSON `json:"-"` -} - -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleJSON struct { +type AccessGroupGetResponseIsDefaultAccessDomainRule struct { + EmailDomain AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupGetResponseIsDefaultAccessDomainRuleJSON `json:"-"` +} + +// accessGroupGetResponseIsDefaultAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIsDefaultAccessDomainRule] +type accessGroupGetResponseIsDefaultAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessDomainRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomain struct { +type AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { +// accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain] +type accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRule struct { +type AccessGroupGetResponseIsDefaultAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIsDefaultAccessEveryoneRule] +type accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessEveryoneRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessEveryoneRule) implementsAccessGroupGetResponseIsDefault() { } // Matches an IP address block. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRule struct { - IP AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessIPRule struct { + IP AccessGroupGetResponseIsDefaultAccessIPRuleIP `json:"ip,required"` + JSON accessGroupGetResponseIsDefaultAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIsDefaultAccessIPRule] +type accessGroupGetResponseIsDefaultAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { -} +func (r AccessGroupGetResponseIsDefaultAccessIPRule) implementsAccessGroupGetResponseIsDefault() {} -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIP struct { +type AccessGroupGetResponseIsDefaultAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupGetResponseIsDefaultAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIP] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIPJSON struct { +// accessGroupGetResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseIsDefaultAccessIPRuleIP] +type accessGroupGetResponseIsDefaultAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRule struct { - IPList AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessIPListRule struct { + IPList AccessGroupGetResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupGetResponseIsDefaultAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIsDefaultAccessIPListRule] +type accessGroupGetResponseIsDefaultAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessIPListRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPList struct { +type AccessGroupGetResponseIsDefaultAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPList] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPListJSON struct { +// accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessIPListRuleIPList] +type accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupGetResponseIsDefaultAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessCertificateRule] +type accessGroupGetResponseIsDefaultAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCertificateRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessCertificateRule) implementsAccessGroupGetResponseIsDefault() { } // Matches an Access group. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessAccessGroupRule struct { + Group AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessAccessGroupRule] +type accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroup struct { +type AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { +// accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup] +type accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessAzureGroupRule struct { + AzureAd AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessAzureGroupRule] +type accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAd struct { +type AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd] +type accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule] +type accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule struct { + Gsuite AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule] +type accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { +type AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite] +type accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessOktaGroupRule struct { + Okta AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessOktaGroupRule] +type accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOkta struct { +type AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { +// accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta] +type accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessSamlGroupRule struct { + Saml AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessSamlGroupRule] +type accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSaml struct { +type AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { +// accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml] +type accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessServiceTokenRule struct { + ServiceToken AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessServiceTokenRule] +type accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceToken struct { +type AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken] +type accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRule struct { +type AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule] +type accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseIsDefault() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule] +type accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRule struct { - Geo AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessCountryRule struct { + Geo AccessGroupGetResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupGetResponseIsDefaultAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseIsDefaultAccessCountryRule] +type accessGroupGetResponseIsDefaultAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessCountryRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeo struct { +type AccessGroupGetResponseIsDefaultAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeo] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeoJSON struct { +// accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessCountryRuleGeo] +type accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule] +type accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] +type accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupGetResponseIsDefaultAccessDevicePostureRule struct { + DevicePosture AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRule] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleJSON struct { +// accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseIsDefaultAccessDevicePostureRule] +type accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseIsDefault() { +func (r AccessGroupGetResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupGetResponseIsDefault() { } -type AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { +type AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture] +type accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRule], -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRule] -// or -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRule]. -type AccessGroupAccessGroupsListAccessGroupsResponseRequire interface { - implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() +// Union satisfied by [AccessGroupGetResponseRequireAccessEmailRule], +// [AccessGroupGetResponseRequireAccessEmailListRule], +// [AccessGroupGetResponseRequireAccessDomainRule], +// [AccessGroupGetResponseRequireAccessEveryoneRule], +// [AccessGroupGetResponseRequireAccessIPRule], +// [AccessGroupGetResponseRequireAccessIPListRule], +// [AccessGroupGetResponseRequireAccessCertificateRule], +// [AccessGroupGetResponseRequireAccessAccessGroupRule], +// [AccessGroupGetResponseRequireAccessAzureGroupRule], +// [AccessGroupGetResponseRequireAccessGitHubOrganizationRule], +// [AccessGroupGetResponseRequireAccessGsuiteGroupRule], +// [AccessGroupGetResponseRequireAccessOktaGroupRule], +// [AccessGroupGetResponseRequireAccessSamlGroupRule], +// [AccessGroupGetResponseRequireAccessServiceTokenRule], +// [AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule], +// [AccessGroupGetResponseRequireAccessExternalEvaluationRule], +// [AccessGroupGetResponseRequireAccessCountryRule], +// [AccessGroupGetResponseRequireAccessAuthenticationMethodRule] or +// [AccessGroupGetResponseRequireAccessDevicePostureRule]. +type AccessGroupGetResponseRequire interface { + implementsAccessGroupGetResponseRequire() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupAccessGroupsListAccessGroupsResponseRequire)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseRequire)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRule struct { - Email AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessEmailRule struct { + Email AccessGroupGetResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupGetResponseRequireAccessEmailRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleJSON struct { +// accessGroupGetResponseRequireAccessEmailRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseRequireAccessEmailRule] +type accessGroupGetResponseRequireAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessEmailRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmail struct { +type AccessGroupGetResponseRequireAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupGetResponseRequireAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmailJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmail] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmailJSON struct { +// accessGroupGetResponseRequireAccessEmailRuleEmailJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessEmailRuleEmail] +type accessGroupGetResponseRequireAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRule struct { - EmailList AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessEmailListRule struct { + EmailList AccessGroupGetResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupGetResponseRequireAccessEmailListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleJSON struct { +// accessGroupGetResponseRequireAccessEmailListRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessEmailListRule] +type accessGroupGetResponseRequireAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessEmailListRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailList struct { +type AccessGroupGetResponseRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailList] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailListJSON struct { +// accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessEmailListRuleEmailList] +type accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRule struct { - EmailDomain AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessDomainRule struct { + EmailDomain AccessGroupGetResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupGetResponseRequireAccessDomainRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleJSON struct { +// accessGroupGetResponseRequireAccessDomainRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseRequireAccessDomainRule] +type accessGroupGetResponseRequireAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessDomainRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomain struct { +type AccessGroupGetResponseRequireAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomainJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomain] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomainJSON struct { +// accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessDomainRuleEmailDomain] +type accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRule struct { +type AccessGroupGetResponseRequireAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupGetResponseRequireAccessEveryoneRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRuleJSON struct { +// accessGroupGetResponseRequireAccessEveryoneRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessEveryoneRule] +type accessGroupGetResponseRequireAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessEveryoneRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessEveryoneRule) implementsAccessGroupGetResponseRequire() {} // Matches an IP address block. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRule struct { - IP AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessIPRule struct { + IP AccessGroupGetResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessGroupGetResponseRequireAccessIPRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleJSON struct { +// accessGroupGetResponseRequireAccessIPRuleJSON contains the JSON metadata for the +// struct [AccessGroupGetResponseRequireAccessIPRule] +type accessGroupGetResponseRequireAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessIPRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIP struct { +type AccessGroupGetResponseRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupGetResponseRequireAccessIPRuleIPJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIPJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIP] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIPJSON struct { +// accessGroupGetResponseRequireAccessIPRuleIPJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseRequireAccessIPRuleIP] +type accessGroupGetResponseRequireAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRule struct { - IPList AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessIPListRule struct { + IPList AccessGroupGetResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupGetResponseRequireAccessIPListRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleJSON struct { +// accessGroupGetResponseRequireAccessIPListRuleJSON contains the JSON metadata for +// the struct [AccessGroupGetResponseRequireAccessIPListRule] +type accessGroupGetResponseRequireAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessIPListRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPList struct { +type AccessGroupGetResponseRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseRequireAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPListJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPList] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPListJSON struct { +// accessGroupGetResponseRequireAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessIPListRuleIPList] +type accessGroupGetResponseRequireAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupGetResponseRequireAccessCertificateRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRuleJSON struct { +// accessGroupGetResponseRequireAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessCertificateRule] +type accessGroupGetResponseRequireAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCertificateRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessCertificateRule) implementsAccessGroupGetResponseRequire() { } // Matches an Access group. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRule struct { - Group AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessAccessGroupRule struct { + Group AccessGroupGetResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupGetResponseRequireAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleJSON struct { +// accessGroupGetResponseRequireAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessAccessGroupRule] +type accessGroupGetResponseRequireAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessAccessGroupRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroup struct { +type AccessGroupGetResponseRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroupJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroup] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroupJSON struct { +// accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessAccessGroupRuleGroup] +type accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRule struct { - AzureAd AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessAzureGroupRule struct { + AzureAd AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupGetResponseRequireAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleJSON struct { +// accessGroupGetResponseRequireAccessAzureGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessAzureGroupRule] +type accessGroupGetResponseRequireAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessAzureGroupRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAdJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAd] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd] +type accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleJSON struct { +// accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessGitHubOrganizationRule] +type accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleJSON struct { +// accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessGsuiteGroupRule] +type accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessGsuiteGroupRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuiteJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuite] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite] +type accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRule struct { - Okta AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessOktaGroupRule struct { + Okta AccessGroupGetResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupGetResponseRequireAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleJSON struct { +// accessGroupGetResponseRequireAccessOktaGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessOktaGroupRule] +type accessGroupGetResponseRequireAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessOktaGroupRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOkta struct { +type AccessGroupGetResponseRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOktaJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOkta] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOktaJSON struct { +// accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessOktaGroupRuleOkta] +type accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRule struct { - Saml AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessSamlGroupRule struct { + Saml AccessGroupGetResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupGetResponseRequireAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleJSON struct { +// accessGroupGetResponseRequireAccessSamlGroupRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessSamlGroupRule] +type accessGroupGetResponseRequireAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessSamlGroupRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSaml struct { +type AccessGroupGetResponseRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSamlJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSaml] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSamlJSON struct { - AttributeName apijson.Field +// accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessSamlGroupRuleSaml] +type accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON struct { + AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupGetResponseRequireAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleJSON struct { +// accessGroupGetResponseRequireAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessServiceTokenRule] +type accessGroupGetResponseRequireAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessServiceTokenRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceTokenJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceToken] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken] +type accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule] +type accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleJSON struct { +// accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupGetResponseRequireAccessExternalEvaluationRule] +type accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessExternalEvaluationRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRule struct { - Geo AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessCountryRule struct { + Geo AccessGroupGetResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupGetResponseRequireAccessCountryRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleJSON struct { +// accessGroupGetResponseRequireAccessCountryRuleJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessCountryRule] +type accessGroupGetResponseRequireAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { -} +func (r AccessGroupGetResponseRequireAccessCountryRule) implementsAccessGroupGetResponseRequire() {} -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeo struct { +type AccessGroupGetResponseRequireAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupGetResponseRequireAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeoJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeo] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeoJSON struct { +// accessGroupGetResponseRequireAccessCountryRuleGeoJSON contains the JSON metadata +// for the struct [AccessGroupGetResponseRequireAccessCountryRuleGeo] +type accessGroupGetResponseRequireAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleJSON struct { +// accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupGetResponseRequireAccessAuthenticationMethodRule] +type accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupGetResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupGetResponseRequireAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRule] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleJSON struct { +// accessGroupGetResponseRequireAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct [AccessGroupGetResponseRequireAccessDevicePostureRule] +type accessGroupGetResponseRequireAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRule) implementsAccessGroupAccessGroupsListAccessGroupsResponseRequire() { +func (r AccessGroupGetResponseRequireAccessDevicePostureRule) implementsAccessGroupGetResponseRequire() { } -type AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePosture struct { +type AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePostureJSON -// contains the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePosture] -type accessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON contains +// the JSON metadata for the struct +// [AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture] +type accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupAccessGroupsListAccessGroupsResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupGetResponse struct { +type AccessGroupReplaceResponse struct { // UUID ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude []AccessGroupGetResponseExclude `json:"exclude"` + Exclude []AccessGroupReplaceResponseExclude `json:"exclude"` // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include []AccessGroupGetResponseInclude `json:"include"` + Include []AccessGroupReplaceResponseInclude `json:"include"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - IsDefault []AccessGroupGetResponseIsDefault `json:"is_default"` + IsDefault []AccessGroupReplaceResponseIsDefault `json:"is_default"` // The name of the Access group. Name string `json:"name"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require []AccessGroupGetResponseRequire `json:"require"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessGroupGetResponseJSON `json:"-"` + Require []AccessGroupReplaceResponseRequire `json:"require"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessGroupReplaceResponseJSON `json:"-"` } -// accessGroupGetResponseJSON contains the JSON metadata for the struct -// [AccessGroupGetResponse] -type accessGroupGetResponseJSON struct { +// accessGroupReplaceResponseJSON contains the JSON metadata for the struct +// [AccessGroupReplaceResponse] +type accessGroupReplaceResponseJSON struct { ID apijson.Field CreatedAt apijson.Field Exclude apijson.Field @@ -9498,3344 +9229,3390 @@ type accessGroupGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupGetResponseExcludeAccessEmailRule], -// [AccessGroupGetResponseExcludeAccessEmailListRule], -// [AccessGroupGetResponseExcludeAccessDomainRule], -// [AccessGroupGetResponseExcludeAccessEveryoneRule], -// [AccessGroupGetResponseExcludeAccessIPRule], -// [AccessGroupGetResponseExcludeAccessIPListRule], -// [AccessGroupGetResponseExcludeAccessCertificateRule], -// [AccessGroupGetResponseExcludeAccessAccessGroupRule], -// [AccessGroupGetResponseExcludeAccessAzureGroupRule], -// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRule], -// [AccessGroupGetResponseExcludeAccessGsuiteGroupRule], -// [AccessGroupGetResponseExcludeAccessOktaGroupRule], -// [AccessGroupGetResponseExcludeAccessSamlGroupRule], -// [AccessGroupGetResponseExcludeAccessServiceTokenRule], -// [AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupGetResponseExcludeAccessExternalEvaluationRule], -// [AccessGroupGetResponseExcludeAccessCountryRule], -// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRule] or -// [AccessGroupGetResponseExcludeAccessDevicePostureRule]. -type AccessGroupGetResponseExclude interface { - implementsAccessGroupGetResponseExclude() +// Union satisfied by [AccessGroupReplaceResponseExcludeAccessEmailRule], +// [AccessGroupReplaceResponseExcludeAccessEmailListRule], +// [AccessGroupReplaceResponseExcludeAccessDomainRule], +// [AccessGroupReplaceResponseExcludeAccessEveryoneRule], +// [AccessGroupReplaceResponseExcludeAccessIPRule], +// [AccessGroupReplaceResponseExcludeAccessIPListRule], +// [AccessGroupReplaceResponseExcludeAccessCertificateRule], +// [AccessGroupReplaceResponseExcludeAccessAccessGroupRule], +// [AccessGroupReplaceResponseExcludeAccessAzureGroupRule], +// [AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRule], +// [AccessGroupReplaceResponseExcludeAccessGsuiteGroupRule], +// [AccessGroupReplaceResponseExcludeAccessOktaGroupRule], +// [AccessGroupReplaceResponseExcludeAccessSamlGroupRule], +// [AccessGroupReplaceResponseExcludeAccessServiceTokenRule], +// [AccessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceResponseExcludeAccessExternalEvaluationRule], +// [AccessGroupReplaceResponseExcludeAccessCountryRule], +// [AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRule] or +// [AccessGroupReplaceResponseExcludeAccessDevicePostureRule]. +type AccessGroupReplaceResponseExclude interface { + implementsAccessGroupReplaceResponseExclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseExclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupReplaceResponseExclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupGetResponseExcludeAccessEmailRule struct { - Email AccessGroupGetResponseExcludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupGetResponseExcludeAccessEmailRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessEmailRule struct { + Email AccessGroupReplaceResponseExcludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupReplaceResponseExcludeAccessEmailRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessEmailRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseExcludeAccessEmailRule] -type accessGroupGetResponseExcludeAccessEmailRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseExcludeAccessEmailRule] +type accessGroupReplaceResponseExcludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessEmailRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessEmailRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessEmailRuleEmail struct { +type AccessGroupReplaceResponseExcludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupGetResponseExcludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupReplaceResponseExcludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessEmailRuleEmailJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessEmailRuleEmail] -type accessGroupGetResponseExcludeAccessEmailRuleEmailJSON struct { +// accessGroupReplaceResponseExcludeAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessEmailRuleEmail] +type accessGroupReplaceResponseExcludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupGetResponseExcludeAccessEmailListRule struct { - EmailList AccessGroupGetResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupGetResponseExcludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessEmailListRule struct { + EmailList AccessGroupReplaceResponseExcludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupReplaceResponseExcludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessEmailListRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessEmailListRule] -type accessGroupGetResponseExcludeAccessEmailListRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessEmailListRule] +type accessGroupReplaceResponseExcludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessEmailListRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessEmailListRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessEmailListRuleEmailList struct { +type AccessGroupReplaceResponseExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseExcludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessEmailListRuleEmailList] -type accessGroupGetResponseExcludeAccessEmailListRuleEmailListJSON struct { +// accessGroupReplaceResponseExcludeAccessEmailListRuleEmailListJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessEmailListRuleEmailList] +type accessGroupReplaceResponseExcludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupGetResponseExcludeAccessDomainRule struct { - EmailDomain AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupGetResponseExcludeAccessDomainRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessDomainRule struct { + EmailDomain AccessGroupReplaceResponseExcludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupReplaceResponseExcludeAccessDomainRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessDomainRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseExcludeAccessDomainRule] -type accessGroupGetResponseExcludeAccessDomainRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseExcludeAccessDomainRule] +type accessGroupReplaceResponseExcludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessDomainRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessDomainRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceResponseExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupReplaceResponseExcludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain] -type accessGroupGetResponseExcludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupReplaceResponseExcludeAccessDomainRuleEmailDomainJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessDomainRuleEmailDomain] +type accessGroupReplaceResponseExcludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupGetResponseExcludeAccessEveryoneRule struct { +type AccessGroupReplaceResponseExcludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupGetResponseExcludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupReplaceResponseExcludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessEveryoneRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessEveryoneRule] -type accessGroupGetResponseExcludeAccessEveryoneRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessEveryoneRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessEveryoneRule] +type accessGroupReplaceResponseExcludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessEveryoneRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessEveryoneRule) implementsAccessGroupReplaceResponseExclude() { +} // Matches an IP address block. -type AccessGroupGetResponseExcludeAccessIPRule struct { - IP AccessGroupGetResponseExcludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupGetResponseExcludeAccessIPRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessIPRule struct { + IP AccessGroupReplaceResponseExcludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupReplaceResponseExcludeAccessIPRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessIPRuleJSON contains the JSON metadata for the -// struct [AccessGroupGetResponseExcludeAccessIPRule] -type accessGroupGetResponseExcludeAccessIPRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupReplaceResponseExcludeAccessIPRule] +type accessGroupReplaceResponseExcludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessIPRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessIPRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessIPRuleIP struct { +type AccessGroupReplaceResponseExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupGetResponseExcludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupReplaceResponseExcludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessIPRuleIPJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseExcludeAccessIPRuleIP] -type accessGroupGetResponseExcludeAccessIPRuleIPJSON struct { +// accessGroupReplaceResponseExcludeAccessIPRuleIPJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseExcludeAccessIPRuleIP] +type accessGroupReplaceResponseExcludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupGetResponseExcludeAccessIPListRule struct { - IPList AccessGroupGetResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupGetResponseExcludeAccessIPListRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessIPListRule struct { + IPList AccessGroupReplaceResponseExcludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupReplaceResponseExcludeAccessIPListRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessIPListRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseExcludeAccessIPListRule] -type accessGroupGetResponseExcludeAccessIPListRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseExcludeAccessIPListRule] +type accessGroupReplaceResponseExcludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessIPListRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessIPListRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessIPListRuleIPList struct { +type AccessGroupReplaceResponseExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupGetResponseExcludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseExcludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessIPListRuleIPList] -type accessGroupGetResponseExcludeAccessIPListRuleIPListJSON struct { +// accessGroupReplaceResponseExcludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessIPListRuleIPList] +type accessGroupReplaceResponseExcludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupGetResponseExcludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupGetResponseExcludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupReplaceResponseExcludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessCertificateRule] -type accessGroupGetResponseExcludeAccessCertificateRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessCertificateRule] +type accessGroupReplaceResponseExcludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessCertificateRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessCertificateRule) implementsAccessGroupReplaceResponseExclude() { } // Matches an Access group. -type AccessGroupGetResponseExcludeAccessAccessGroupRule struct { - Group AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupGetResponseExcludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessAccessGroupRule struct { + Group AccessGroupReplaceResponseExcludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupReplaceResponseExcludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessAccessGroupRule] -type accessGroupGetResponseExcludeAccessAccessGroupRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessAccessGroupRule] +type accessGroupReplaceResponseExcludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessAccessGroupRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessAccessGroupRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceResponseExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseExcludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup] -type accessGroupGetResponseExcludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupReplaceResponseExcludeAccessAccessGroupRuleGroupJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessAccessGroupRuleGroup] +type accessGroupReplaceResponseExcludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupGetResponseExcludeAccessAzureGroupRule struct { - AzureAd AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupGetResponseExcludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessAzureGroupRule struct { + AzureAd AccessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupReplaceResponseExcludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAzureGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessAzureGroupRule] -type accessGroupGetResponseExcludeAccessAzureGroupRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessAzureGroupRule] +type accessGroupReplaceResponseExcludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessAzureGroupRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessAzureGroupRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd] -type accessGroupGetResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAd] +type accessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupGetResponseExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRule] -type accessGroupGetResponseExcludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRule] +type accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupGetResponseExcludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessGsuiteGroupRule] -type accessGroupGetResponseExcludeAccessGsuiteGroupRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessGsuiteGroupRule] +type accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessGsuiteGroupRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite] -type accessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuite] +type accessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupGetResponseExcludeAccessOktaGroupRule struct { - Okta AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupGetResponseExcludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessOktaGroupRule struct { + Okta AccessGroupReplaceResponseExcludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupReplaceResponseExcludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessOktaGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessOktaGroupRule] -type accessGroupGetResponseExcludeAccessOktaGroupRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessOktaGroupRule] +type accessGroupReplaceResponseExcludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessOktaGroupRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessOktaGroupRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceResponseExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseExcludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta] -type accessGroupGetResponseExcludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupReplaceResponseExcludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessOktaGroupRuleOkta] +type accessGroupReplaceResponseExcludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupGetResponseExcludeAccessSamlGroupRule struct { - Saml AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupGetResponseExcludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessSamlGroupRule struct { + Saml AccessGroupReplaceResponseExcludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupReplaceResponseExcludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessSamlGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessSamlGroupRule] -type accessGroupGetResponseExcludeAccessSamlGroupRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessSamlGroupRule] +type accessGroupReplaceResponseExcludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessSamlGroupRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessSamlGroupRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceResponseExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupReplaceResponseExcludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml] -type accessGroupGetResponseExcludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupReplaceResponseExcludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessSamlGroupRuleSaml] +type accessGroupReplaceResponseExcludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupGetResponseExcludeAccessServiceTokenRule struct { - ServiceToken AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupGetResponseExcludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessServiceTokenRule struct { + ServiceToken AccessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupReplaceResponseExcludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessServiceTokenRule] -type accessGroupGetResponseExcludeAccessServiceTokenRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessServiceTokenRule] +type accessGroupReplaceResponseExcludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessServiceTokenRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessServiceTokenRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains the -// JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken] -type accessGroupGetResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceToken] +type accessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule] -type accessGroupGetResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRule] +type accessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceResponseExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupGetResponseExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseExcludeAccessExternalEvaluationRule] -type accessGroupGetResponseExcludeAccessExternalEvaluationRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessExternalEvaluationRule] +type accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessExternalEvaluationRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupGetResponseExcludeAccessCountryRule struct { - Geo AccessGroupGetResponseExcludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupGetResponseExcludeAccessCountryRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessCountryRule struct { + Geo AccessGroupReplaceResponseExcludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupReplaceResponseExcludeAccessCountryRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessCountryRule] -type accessGroupGetResponseExcludeAccessCountryRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessCountryRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessCountryRule] +type accessGroupReplaceResponseExcludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessCountryRule) implementsAccessGroupGetResponseExclude() {} +func (r AccessGroupReplaceResponseExcludeAccessCountryRule) implementsAccessGroupReplaceResponseExclude() { +} -type AccessGroupGetResponseExcludeAccessCountryRuleGeo struct { +type AccessGroupReplaceResponseExcludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupGetResponseExcludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupReplaceResponseExcludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessCountryRuleGeoJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseExcludeAccessCountryRuleGeo] -type accessGroupGetResponseExcludeAccessCountryRuleGeoJSON struct { +// accessGroupReplaceResponseExcludeAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseExcludeAccessCountryRuleGeo] +type accessGroupReplaceResponseExcludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupGetResponseExcludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON contains the +// accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRule] -type accessGroupGetResponseExcludeAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRule] +type accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupGetResponseExclude() { +func (r AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRule) implementsAccessGroupReplaceResponseExclude() { } -type AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseExcludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupGetResponseExcludeAccessDevicePostureRule struct { - DevicePosture AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupGetResponseExcludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupReplaceResponseExcludeAccessDevicePostureRule struct { + DevicePosture AccessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupReplaceResponseExcludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupGetResponseExcludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseExcludeAccessDevicePostureRule] -type accessGroupGetResponseExcludeAccessDevicePostureRuleJSON struct { +// accessGroupReplaceResponseExcludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessDevicePostureRule] +type accessGroupReplaceResponseExcludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessGroupGetResponseExcludeAccessDevicePostureRule) implementsAccessGroupGetResponseExclude() { -} - -type AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` -} - -// accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON contains -// the JSON metadata for the struct -// [AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture] -type accessGroupGetResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { - IntegrationUid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupGetResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Matches a specific email. -// -// Union satisfied by [AccessGroupGetResponseIncludeAccessEmailRule], -// [AccessGroupGetResponseIncludeAccessEmailListRule], -// [AccessGroupGetResponseIncludeAccessDomainRule], -// [AccessGroupGetResponseIncludeAccessEveryoneRule], -// [AccessGroupGetResponseIncludeAccessIPRule], -// [AccessGroupGetResponseIncludeAccessIPListRule], -// [AccessGroupGetResponseIncludeAccessCertificateRule], -// [AccessGroupGetResponseIncludeAccessAccessGroupRule], -// [AccessGroupGetResponseIncludeAccessAzureGroupRule], -// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRule], -// [AccessGroupGetResponseIncludeAccessGsuiteGroupRule], -// [AccessGroupGetResponseIncludeAccessOktaGroupRule], -// [AccessGroupGetResponseIncludeAccessSamlGroupRule], -// [AccessGroupGetResponseIncludeAccessServiceTokenRule], -// [AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupGetResponseIncludeAccessExternalEvaluationRule], -// [AccessGroupGetResponseIncludeAccessCountryRule], -// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRule] or -// [AccessGroupGetResponseIncludeAccessDevicePostureRule]. -type AccessGroupGetResponseInclude interface { - implementsAccessGroupGetResponseInclude() +func (r *AccessGroupReplaceResponseExcludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessGroupReplaceResponseExcludeAccessDevicePostureRule) implementsAccessGroupReplaceResponseExclude() { +} + +type AccessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` +} + +// accessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePosture] +type accessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePostureJSON struct { + IntegrationUid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupReplaceResponseExcludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Matches a specific email. +// +// Union satisfied by [AccessGroupReplaceResponseIncludeAccessEmailRule], +// [AccessGroupReplaceResponseIncludeAccessEmailListRule], +// [AccessGroupReplaceResponseIncludeAccessDomainRule], +// [AccessGroupReplaceResponseIncludeAccessEveryoneRule], +// [AccessGroupReplaceResponseIncludeAccessIPRule], +// [AccessGroupReplaceResponseIncludeAccessIPListRule], +// [AccessGroupReplaceResponseIncludeAccessCertificateRule], +// [AccessGroupReplaceResponseIncludeAccessAccessGroupRule], +// [AccessGroupReplaceResponseIncludeAccessAzureGroupRule], +// [AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRule], +// [AccessGroupReplaceResponseIncludeAccessGsuiteGroupRule], +// [AccessGroupReplaceResponseIncludeAccessOktaGroupRule], +// [AccessGroupReplaceResponseIncludeAccessSamlGroupRule], +// [AccessGroupReplaceResponseIncludeAccessServiceTokenRule], +// [AccessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceResponseIncludeAccessExternalEvaluationRule], +// [AccessGroupReplaceResponseIncludeAccessCountryRule], +// [AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRule] or +// [AccessGroupReplaceResponseIncludeAccessDevicePostureRule]. +type AccessGroupReplaceResponseInclude interface { + implementsAccessGroupReplaceResponseInclude() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseInclude)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupReplaceResponseInclude)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupGetResponseIncludeAccessEmailRule struct { - Email AccessGroupGetResponseIncludeAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupGetResponseIncludeAccessEmailRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessEmailRule struct { + Email AccessGroupReplaceResponseIncludeAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupReplaceResponseIncludeAccessEmailRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessEmailRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIncludeAccessEmailRule] -type accessGroupGetResponseIncludeAccessEmailRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIncludeAccessEmailRule] +type accessGroupReplaceResponseIncludeAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessEmailRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessEmailRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessEmailRuleEmail struct { +type AccessGroupReplaceResponseIncludeAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupGetResponseIncludeAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupReplaceResponseIncludeAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessEmailRuleEmailJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessEmailRuleEmail] -type accessGroupGetResponseIncludeAccessEmailRuleEmailJSON struct { +// accessGroupReplaceResponseIncludeAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessEmailRuleEmail] +type accessGroupReplaceResponseIncludeAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupGetResponseIncludeAccessEmailListRule struct { - EmailList AccessGroupGetResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupGetResponseIncludeAccessEmailListRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessEmailListRule struct { + EmailList AccessGroupReplaceResponseIncludeAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupReplaceResponseIncludeAccessEmailListRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessEmailListRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessEmailListRule] -type accessGroupGetResponseIncludeAccessEmailListRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessEmailListRule] +type accessGroupReplaceResponseIncludeAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessEmailListRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessEmailListRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessEmailListRuleEmailList struct { +type AccessGroupReplaceResponseIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIncludeAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessEmailListRuleEmailList] -type accessGroupGetResponseIncludeAccessEmailListRuleEmailListJSON struct { +// accessGroupReplaceResponseIncludeAccessEmailListRuleEmailListJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessEmailListRuleEmailList] +type accessGroupReplaceResponseIncludeAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupGetResponseIncludeAccessDomainRule struct { - EmailDomain AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupGetResponseIncludeAccessDomainRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessDomainRule struct { + EmailDomain AccessGroupReplaceResponseIncludeAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupReplaceResponseIncludeAccessDomainRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessDomainRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIncludeAccessDomainRule] -type accessGroupGetResponseIncludeAccessDomainRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIncludeAccessDomainRule] +type accessGroupReplaceResponseIncludeAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessDomainRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessDomainRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceResponseIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupReplaceResponseIncludeAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain] -type accessGroupGetResponseIncludeAccessDomainRuleEmailDomainJSON struct { +// accessGroupReplaceResponseIncludeAccessDomainRuleEmailDomainJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessDomainRuleEmailDomain] +type accessGroupReplaceResponseIncludeAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupGetResponseIncludeAccessEveryoneRule struct { +type AccessGroupReplaceResponseIncludeAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupGetResponseIncludeAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupReplaceResponseIncludeAccessEveryoneRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessEveryoneRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessEveryoneRule] -type accessGroupGetResponseIncludeAccessEveryoneRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessEveryoneRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessEveryoneRule] +type accessGroupReplaceResponseIncludeAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessEveryoneRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessEveryoneRule) implementsAccessGroupReplaceResponseInclude() { +} // Matches an IP address block. -type AccessGroupGetResponseIncludeAccessIPRule struct { - IP AccessGroupGetResponseIncludeAccessIPRuleIP `json:"ip,required"` - JSON accessGroupGetResponseIncludeAccessIPRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessIPRule struct { + IP AccessGroupReplaceResponseIncludeAccessIPRuleIP `json:"ip,required"` + JSON accessGroupReplaceResponseIncludeAccessIPRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessIPRuleJSON contains the JSON metadata for the -// struct [AccessGroupGetResponseIncludeAccessIPRule] -type accessGroupGetResponseIncludeAccessIPRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupReplaceResponseIncludeAccessIPRule] +type accessGroupReplaceResponseIncludeAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessIPRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessIPRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessIPRuleIP struct { +type AccessGroupReplaceResponseIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupGetResponseIncludeAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupReplaceResponseIncludeAccessIPRuleIPJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessIPRuleIPJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIncludeAccessIPRuleIP] -type accessGroupGetResponseIncludeAccessIPRuleIPJSON struct { +// accessGroupReplaceResponseIncludeAccessIPRuleIPJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIncludeAccessIPRuleIP] +type accessGroupReplaceResponseIncludeAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupGetResponseIncludeAccessIPListRule struct { - IPList AccessGroupGetResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupGetResponseIncludeAccessIPListRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessIPListRule struct { + IPList AccessGroupReplaceResponseIncludeAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupReplaceResponseIncludeAccessIPListRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessIPListRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIncludeAccessIPListRule] -type accessGroupGetResponseIncludeAccessIPListRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIncludeAccessIPListRule] +type accessGroupReplaceResponseIncludeAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessIPListRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessIPListRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessIPListRuleIPList struct { +type AccessGroupReplaceResponseIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupGetResponseIncludeAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIncludeAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessIPListRuleIPList] -type accessGroupGetResponseIncludeAccessIPListRuleIPListJSON struct { +// accessGroupReplaceResponseIncludeAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessIPListRuleIPList] +type accessGroupReplaceResponseIncludeAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupGetResponseIncludeAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupGetResponseIncludeAccessCertificateRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupReplaceResponseIncludeAccessCertificateRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessCertificateRule] -type accessGroupGetResponseIncludeAccessCertificateRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessCertificateRule] +type accessGroupReplaceResponseIncludeAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessCertificateRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessCertificateRule) implementsAccessGroupReplaceResponseInclude() { } // Matches an Access group. -type AccessGroupGetResponseIncludeAccessAccessGroupRule struct { - Group AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupGetResponseIncludeAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessAccessGroupRule struct { + Group AccessGroupReplaceResponseIncludeAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupReplaceResponseIncludeAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessAccessGroupRule] -type accessGroupGetResponseIncludeAccessAccessGroupRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessAccessGroupRule] +type accessGroupReplaceResponseIncludeAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessAccessGroupRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessAccessGroupRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceResponseIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIncludeAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup] -type accessGroupGetResponseIncludeAccessAccessGroupRuleGroupJSON struct { +// accessGroupReplaceResponseIncludeAccessAccessGroupRuleGroupJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessAccessGroupRuleGroup] +type accessGroupReplaceResponseIncludeAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupGetResponseIncludeAccessAzureGroupRule struct { - AzureAd AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupGetResponseIncludeAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessAzureGroupRule struct { + AzureAd AccessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupReplaceResponseIncludeAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAzureGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessAzureGroupRule] -type accessGroupGetResponseIncludeAccessAzureGroupRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessAzureGroupRule] +type accessGroupReplaceResponseIncludeAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessAzureGroupRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessAzureGroupRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd] -type accessGroupGetResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAd] +type accessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupGetResponseIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRule] -type accessGroupGetResponseIncludeAccessGitHubOrganizationRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRule] +type accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupGetResponseIncludeAccessGsuiteGroupRule struct { - Gsuite AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessGsuiteGroupRule struct { + Gsuite AccessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessGsuiteGroupRule] -type accessGroupGetResponseIncludeAccessGsuiteGroupRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessGsuiteGroupRule] +type accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessGsuiteGroupRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite] -type accessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuite] +type accessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupGetResponseIncludeAccessOktaGroupRule struct { - Okta AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupGetResponseIncludeAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessOktaGroupRule struct { + Okta AccessGroupReplaceResponseIncludeAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupReplaceResponseIncludeAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessOktaGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessOktaGroupRule] -type accessGroupGetResponseIncludeAccessOktaGroupRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessOktaGroupRule] +type accessGroupReplaceResponseIncludeAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessOktaGroupRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessOktaGroupRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceResponseIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseIncludeAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta] -type accessGroupGetResponseIncludeAccessOktaGroupRuleOktaJSON struct { +// accessGroupReplaceResponseIncludeAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessOktaGroupRuleOkta] +type accessGroupReplaceResponseIncludeAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupGetResponseIncludeAccessSamlGroupRule struct { - Saml AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupGetResponseIncludeAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessSamlGroupRule struct { + Saml AccessGroupReplaceResponseIncludeAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupReplaceResponseIncludeAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessSamlGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessSamlGroupRule] -type accessGroupGetResponseIncludeAccessSamlGroupRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessSamlGroupRule] +type accessGroupReplaceResponseIncludeAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessSamlGroupRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessSamlGroupRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceResponseIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupReplaceResponseIncludeAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml] -type accessGroupGetResponseIncludeAccessSamlGroupRuleSamlJSON struct { +// accessGroupReplaceResponseIncludeAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessSamlGroupRuleSaml] +type accessGroupReplaceResponseIncludeAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupGetResponseIncludeAccessServiceTokenRule struct { - ServiceToken AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupGetResponseIncludeAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessServiceTokenRule struct { + ServiceToken AccessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupReplaceResponseIncludeAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessServiceTokenRule] -type accessGroupGetResponseIncludeAccessServiceTokenRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessServiceTokenRule] +type accessGroupReplaceResponseIncludeAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessServiceTokenRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessServiceTokenRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains the -// JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken] -type accessGroupGetResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceToken] +type accessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule] -type accessGroupGetResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRule] +type accessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceResponseInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupGetResponseIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIncludeAccessExternalEvaluationRule] -type accessGroupGetResponseIncludeAccessExternalEvaluationRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessExternalEvaluationRule] +type accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessExternalEvaluationRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupGetResponseIncludeAccessCountryRule struct { - Geo AccessGroupGetResponseIncludeAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupGetResponseIncludeAccessCountryRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessCountryRule struct { + Geo AccessGroupReplaceResponseIncludeAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupReplaceResponseIncludeAccessCountryRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessCountryRule] -type accessGroupGetResponseIncludeAccessCountryRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessCountryRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessCountryRule] +type accessGroupReplaceResponseIncludeAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessCountryRule) implementsAccessGroupGetResponseInclude() {} +func (r AccessGroupReplaceResponseIncludeAccessCountryRule) implementsAccessGroupReplaceResponseInclude() { +} -type AccessGroupGetResponseIncludeAccessCountryRuleGeo struct { +type AccessGroupReplaceResponseIncludeAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupGetResponseIncludeAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupReplaceResponseIncludeAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessCountryRuleGeoJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIncludeAccessCountryRuleGeo] -type accessGroupGetResponseIncludeAccessCountryRuleGeoJSON struct { +// accessGroupReplaceResponseIncludeAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIncludeAccessCountryRuleGeo] +type accessGroupReplaceResponseIncludeAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupGetResponseIncludeAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON contains the +// accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRule] -type accessGroupGetResponseIncludeAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRule] +type accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod] -type accessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod] +type accessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupGetResponseIncludeAccessDevicePostureRule struct { - DevicePosture AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupGetResponseIncludeAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupReplaceResponseIncludeAccessDevicePostureRule struct { + DevicePosture AccessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupReplaceResponseIncludeAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIncludeAccessDevicePostureRule] -type accessGroupGetResponseIncludeAccessDevicePostureRuleJSON struct { +// accessGroupReplaceResponseIncludeAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessDevicePostureRule] +type accessGroupReplaceResponseIncludeAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIncludeAccessDevicePostureRule) implementsAccessGroupGetResponseInclude() { +func (r AccessGroupReplaceResponseIncludeAccessDevicePostureRule) implementsAccessGroupReplaceResponseInclude() { } -type AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON contains -// the JSON metadata for the struct -// [AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture] -type accessGroupGetResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePosture] +type accessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIncludeAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupGetResponseIsDefaultAccessEmailRule], -// [AccessGroupGetResponseIsDefaultAccessEmailListRule], -// [AccessGroupGetResponseIsDefaultAccessDomainRule], -// [AccessGroupGetResponseIsDefaultAccessEveryoneRule], -// [AccessGroupGetResponseIsDefaultAccessIPRule], -// [AccessGroupGetResponseIsDefaultAccessIPListRule], -// [AccessGroupGetResponseIsDefaultAccessCertificateRule], -// [AccessGroupGetResponseIsDefaultAccessAccessGroupRule], -// [AccessGroupGetResponseIsDefaultAccessAzureGroupRule], -// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule], -// [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule], -// [AccessGroupGetResponseIsDefaultAccessOktaGroupRule], -// [AccessGroupGetResponseIsDefaultAccessSamlGroupRule], -// [AccessGroupGetResponseIsDefaultAccessServiceTokenRule], -// [AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule], -// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule], -// [AccessGroupGetResponseIsDefaultAccessCountryRule], -// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule] or -// [AccessGroupGetResponseIsDefaultAccessDevicePostureRule]. -type AccessGroupGetResponseIsDefault interface { - implementsAccessGroupGetResponseIsDefault() +// Union satisfied by [AccessGroupReplaceResponseIsDefaultAccessEmailRule], +// [AccessGroupReplaceResponseIsDefaultAccessEmailListRule], +// [AccessGroupReplaceResponseIsDefaultAccessDomainRule], +// [AccessGroupReplaceResponseIsDefaultAccessEveryoneRule], +// [AccessGroupReplaceResponseIsDefaultAccessIPRule], +// [AccessGroupReplaceResponseIsDefaultAccessIPListRule], +// [AccessGroupReplaceResponseIsDefaultAccessCertificateRule], +// [AccessGroupReplaceResponseIsDefaultAccessAccessGroupRule], +// [AccessGroupReplaceResponseIsDefaultAccessAzureGroupRule], +// [AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRule], +// [AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRule], +// [AccessGroupReplaceResponseIsDefaultAccessOktaGroupRule], +// [AccessGroupReplaceResponseIsDefaultAccessSamlGroupRule], +// [AccessGroupReplaceResponseIsDefaultAccessServiceTokenRule], +// [AccessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRule], +// [AccessGroupReplaceResponseIsDefaultAccessCountryRule], +// [AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRule] or +// [AccessGroupReplaceResponseIsDefaultAccessDevicePostureRule]. +type AccessGroupReplaceResponseIsDefault interface { + implementsAccessGroupReplaceResponseIsDefault() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseIsDefault)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupReplaceResponseIsDefault)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupGetResponseIsDefaultAccessEmailRule struct { - Email AccessGroupGetResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupGetResponseIsDefaultAccessEmailRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessEmailRule struct { + Email AccessGroupReplaceResponseIsDefaultAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupReplaceResponseIsDefaultAccessEmailRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessEmailRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIsDefaultAccessEmailRule] -type accessGroupGetResponseIsDefaultAccessEmailRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessEmailRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessEmailRule] +type accessGroupReplaceResponseIsDefaultAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessEmailRule) implementsAccessGroupGetResponseIsDefault() {} +func (r AccessGroupReplaceResponseIsDefaultAccessEmailRule) implementsAccessGroupReplaceResponseIsDefault() { +} -type AccessGroupGetResponseIsDefaultAccessEmailRuleEmail struct { +type AccessGroupReplaceResponseIsDefaultAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupReplaceResponseIsDefaultAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessEmailRuleEmail] -type accessGroupGetResponseIsDefaultAccessEmailRuleEmailJSON struct { +// accessGroupReplaceResponseIsDefaultAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessEmailRuleEmail] +type accessGroupReplaceResponseIsDefaultAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupGetResponseIsDefaultAccessEmailListRule struct { - EmailList AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupGetResponseIsDefaultAccessEmailListRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessEmailListRule struct { + EmailList AccessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupReplaceResponseIsDefaultAccessEmailListRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessEmailListRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessEmailListRule] -type accessGroupGetResponseIsDefaultAccessEmailListRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessEmailListRule] +type accessGroupReplaceResponseIsDefaultAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessEmailListRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessEmailListRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList struct { +type AccessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON contains the +// accessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailListJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList] -type accessGroupGetResponseIsDefaultAccessEmailListRuleEmailListJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailList] +type accessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupGetResponseIsDefaultAccessDomainRule struct { - EmailDomain AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupGetResponseIsDefaultAccessDomainRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessDomainRule struct { + EmailDomain AccessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupReplaceResponseIsDefaultAccessDomainRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessDomainRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIsDefaultAccessDomainRule] -type accessGroupGetResponseIsDefaultAccessDomainRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessDomainRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessDomainRule] +type accessGroupReplaceResponseIsDefaultAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessDomainRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessDomainRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain] -type accessGroupGetResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { +// accessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomainJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomain] +type accessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupGetResponseIsDefaultAccessEveryoneRule struct { +type AccessGroupReplaceResponseIsDefaultAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupReplaceResponseIsDefaultAccessEveryoneRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIsDefaultAccessEveryoneRule] -type accessGroupGetResponseIsDefaultAccessEveryoneRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessEveryoneRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessEveryoneRule] +type accessGroupReplaceResponseIsDefaultAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessEveryoneRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessEveryoneRule) implementsAccessGroupReplaceResponseIsDefault() { } // Matches an IP address block. -type AccessGroupGetResponseIsDefaultAccessIPRule struct { - IP AccessGroupGetResponseIsDefaultAccessIPRuleIP `json:"ip,required"` - JSON accessGroupGetResponseIsDefaultAccessIPRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessIPRule struct { + IP AccessGroupReplaceResponseIsDefaultAccessIPRuleIP `json:"ip,required"` + JSON accessGroupReplaceResponseIsDefaultAccessIPRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessIPRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIsDefaultAccessIPRule] -type accessGroupGetResponseIsDefaultAccessIPRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessIPRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIsDefaultAccessIPRule] +type accessGroupReplaceResponseIsDefaultAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessIPRule) implementsAccessGroupGetResponseIsDefault() {} +func (r AccessGroupReplaceResponseIsDefaultAccessIPRule) implementsAccessGroupReplaceResponseIsDefault() { +} -type AccessGroupGetResponseIsDefaultAccessIPRuleIP struct { +type AccessGroupReplaceResponseIsDefaultAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupGetResponseIsDefaultAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupReplaceResponseIsDefaultAccessIPRuleIPJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseIsDefaultAccessIPRuleIP] -type accessGroupGetResponseIsDefaultAccessIPRuleIPJSON struct { +// accessGroupReplaceResponseIsDefaultAccessIPRuleIPJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseIsDefaultAccessIPRuleIP] +type accessGroupReplaceResponseIsDefaultAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupGetResponseIsDefaultAccessIPListRule struct { - IPList AccessGroupGetResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupGetResponseIsDefaultAccessIPListRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessIPListRule struct { + IPList AccessGroupReplaceResponseIsDefaultAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupReplaceResponseIsDefaultAccessIPListRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessIPListRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIsDefaultAccessIPListRule] -type accessGroupGetResponseIsDefaultAccessIPListRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessIPListRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessIPListRule] +type accessGroupReplaceResponseIsDefaultAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessIPListRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessIPListRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessIPListRuleIPList struct { +type AccessGroupReplaceResponseIsDefaultAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIsDefaultAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessIPListRuleIPList] -type accessGroupGetResponseIsDefaultAccessIPListRuleIPListJSON struct { +// accessGroupReplaceResponseIsDefaultAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessIPListRuleIPList] +type accessGroupReplaceResponseIsDefaultAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupGetResponseIsDefaultAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupGetResponseIsDefaultAccessCertificateRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupReplaceResponseIsDefaultAccessCertificateRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessCertificateRule] -type accessGroupGetResponseIsDefaultAccessCertificateRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessCertificateRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessCertificateRule] +type accessGroupReplaceResponseIsDefaultAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessCertificateRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessCertificateRule) implementsAccessGroupReplaceResponseIsDefault() { } // Matches an Access group. -type AccessGroupGetResponseIsDefaultAccessAccessGroupRule struct { - Group AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessAccessGroupRule struct { + Group AccessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessAccessGroupRule] -type accessGroupGetResponseIsDefaultAccessAccessGroupRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAccessGroupRule] +type accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessAccessGroupRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup] -type accessGroupGetResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroupJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroup] +type accessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupGetResponseIsDefaultAccessAzureGroupRule struct { - AzureAd AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessAzureGroupRule struct { + AzureAd AccessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessAzureGroupRule] -type accessGroupGetResponseIsDefaultAccessAzureGroupRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAzureGroupRule] +type accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessAzureGroupRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd] -type accessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAdJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAd] +type accessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the +// accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule] -type accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRule] +type accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule struct { - Gsuite AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRule struct { + Gsuite AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule] -type accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRule] +type accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite] -type accessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuite] +type accessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupGetResponseIsDefaultAccessOktaGroupRule struct { - Okta AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessOktaGroupRule struct { + Okta AccessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessOktaGroupRule] -type accessGroupGetResponseIsDefaultAccessOktaGroupRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessOktaGroupRule] +type accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessOktaGroupRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta] -type accessGroupGetResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { +// accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOkta] +type accessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupGetResponseIsDefaultAccessSamlGroupRule struct { - Saml AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessSamlGroupRule struct { + Saml AccessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessSamlGroupRule] -type accessGroupGetResponseIsDefaultAccessSamlGroupRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessSamlGroupRule] +type accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessSamlGroupRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml] -type accessGroupGetResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { +// accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSaml] +type accessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupGetResponseIsDefaultAccessServiceTokenRule struct { - ServiceToken AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessServiceTokenRule struct { + ServiceToken AccessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessServiceTokenRule] -type accessGroupGetResponseIsDefaultAccessServiceTokenRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessServiceTokenRule] +type accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessServiceTokenRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON contains -// the JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken] -type accessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON +// contains the JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceToken] +type accessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule] -type accessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRuleJSON contains +// the JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRule] +type accessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceResponseIsDefault() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON contains the +// accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule] -type accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRule] +type accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupGetResponseIsDefaultAccessCountryRule struct { - Geo AccessGroupGetResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupGetResponseIsDefaultAccessCountryRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessCountryRule struct { + Geo AccessGroupReplaceResponseIsDefaultAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupReplaceResponseIsDefaultAccessCountryRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseIsDefaultAccessCountryRule] -type accessGroupGetResponseIsDefaultAccessCountryRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessCountryRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseIsDefaultAccessCountryRule] +type accessGroupReplaceResponseIsDefaultAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessCountryRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessCountryRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessCountryRuleGeo struct { +type AccessGroupReplaceResponseIsDefaultAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupReplaceResponseIsDefaultAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessCountryRuleGeo] -type accessGroupGetResponseIsDefaultAccessCountryRuleGeoJSON struct { +// accessGroupReplaceResponseIsDefaultAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessCountryRuleGeo] +type accessGroupReplaceResponseIsDefaultAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON contains the -// JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule] -type accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleJSON contains +// the JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRule] +type accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] -type accessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod] +type accessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupGetResponseIsDefaultAccessDevicePostureRule struct { - DevicePosture AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupReplaceResponseIsDefaultAccessDevicePostureRule struct { + DevicePosture AccessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseIsDefaultAccessDevicePostureRule] -type accessGroupGetResponseIsDefaultAccessDevicePostureRuleJSON struct { +// accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessDevicePostureRule] +type accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupGetResponseIsDefault() { +func (r AccessGroupReplaceResponseIsDefaultAccessDevicePostureRule) implementsAccessGroupReplaceResponseIsDefault() { } -type AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON contains -// the JSON metadata for the struct -// [AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture] -type accessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePosture] +type accessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseIsDefaultAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific email. // -// Union satisfied by [AccessGroupGetResponseRequireAccessEmailRule], -// [AccessGroupGetResponseRequireAccessEmailListRule], -// [AccessGroupGetResponseRequireAccessDomainRule], -// [AccessGroupGetResponseRequireAccessEveryoneRule], -// [AccessGroupGetResponseRequireAccessIPRule], -// [AccessGroupGetResponseRequireAccessIPListRule], -// [AccessGroupGetResponseRequireAccessCertificateRule], -// [AccessGroupGetResponseRequireAccessAccessGroupRule], -// [AccessGroupGetResponseRequireAccessAzureGroupRule], -// [AccessGroupGetResponseRequireAccessGitHubOrganizationRule], -// [AccessGroupGetResponseRequireAccessGsuiteGroupRule], -// [AccessGroupGetResponseRequireAccessOktaGroupRule], -// [AccessGroupGetResponseRequireAccessSamlGroupRule], -// [AccessGroupGetResponseRequireAccessServiceTokenRule], -// [AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule], -// [AccessGroupGetResponseRequireAccessExternalEvaluationRule], -// [AccessGroupGetResponseRequireAccessCountryRule], -// [AccessGroupGetResponseRequireAccessAuthenticationMethodRule] or -// [AccessGroupGetResponseRequireAccessDevicePostureRule]. -type AccessGroupGetResponseRequire interface { - implementsAccessGroupGetResponseRequire() +// Union satisfied by [AccessGroupReplaceResponseRequireAccessEmailRule], +// [AccessGroupReplaceResponseRequireAccessEmailListRule], +// [AccessGroupReplaceResponseRequireAccessDomainRule], +// [AccessGroupReplaceResponseRequireAccessEveryoneRule], +// [AccessGroupReplaceResponseRequireAccessIPRule], +// [AccessGroupReplaceResponseRequireAccessIPListRule], +// [AccessGroupReplaceResponseRequireAccessCertificateRule], +// [AccessGroupReplaceResponseRequireAccessAccessGroupRule], +// [AccessGroupReplaceResponseRequireAccessAzureGroupRule], +// [AccessGroupReplaceResponseRequireAccessGitHubOrganizationRule], +// [AccessGroupReplaceResponseRequireAccessGsuiteGroupRule], +// [AccessGroupReplaceResponseRequireAccessOktaGroupRule], +// [AccessGroupReplaceResponseRequireAccessSamlGroupRule], +// [AccessGroupReplaceResponseRequireAccessServiceTokenRule], +// [AccessGroupReplaceResponseRequireAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceResponseRequireAccessExternalEvaluationRule], +// [AccessGroupReplaceResponseRequireAccessCountryRule], +// [AccessGroupReplaceResponseRequireAccessAuthenticationMethodRule] or +// [AccessGroupReplaceResponseRequireAccessDevicePostureRule]. +type AccessGroupReplaceResponseRequire interface { + implementsAccessGroupReplaceResponseRequire() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessGroupGetResponseRequire)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessGroupReplaceResponseRequire)(nil)).Elem(), "") } // Matches a specific email. -type AccessGroupGetResponseRequireAccessEmailRule struct { - Email AccessGroupGetResponseRequireAccessEmailRuleEmail `json:"email,required"` - JSON accessGroupGetResponseRequireAccessEmailRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessEmailRule struct { + Email AccessGroupReplaceResponseRequireAccessEmailRuleEmail `json:"email,required"` + JSON accessGroupReplaceResponseRequireAccessEmailRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessEmailRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseRequireAccessEmailRule] -type accessGroupGetResponseRequireAccessEmailRuleJSON struct { +// accessGroupReplaceResponseRequireAccessEmailRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseRequireAccessEmailRule] +type accessGroupReplaceResponseRequireAccessEmailRuleJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessEmailRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessEmailRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessEmailRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessEmailRuleEmail struct { +type AccessGroupReplaceResponseRequireAccessEmailRuleEmail struct { // The email of the user. - Email string `json:"email,required" format:"email"` - JSON accessGroupGetResponseRequireAccessEmailRuleEmailJSON `json:"-"` + Email string `json:"email,required" format:"email"` + JSON accessGroupReplaceResponseRequireAccessEmailRuleEmailJSON `json:"-"` } -// accessGroupGetResponseRequireAccessEmailRuleEmailJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessEmailRuleEmail] -type accessGroupGetResponseRequireAccessEmailRuleEmailJSON struct { +// accessGroupReplaceResponseRequireAccessEmailRuleEmailJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessEmailRuleEmail] +type accessGroupReplaceResponseRequireAccessEmailRuleEmailJSON struct { Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessEmailRuleEmail) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an email address from a list. -type AccessGroupGetResponseRequireAccessEmailListRule struct { - EmailList AccessGroupGetResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` - JSON accessGroupGetResponseRequireAccessEmailListRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessEmailListRule struct { + EmailList AccessGroupReplaceResponseRequireAccessEmailListRuleEmailList `json:"email_list,required"` + JSON accessGroupReplaceResponseRequireAccessEmailListRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessEmailListRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessEmailListRule] -type accessGroupGetResponseRequireAccessEmailListRuleJSON struct { +// accessGroupReplaceResponseRequireAccessEmailListRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessEmailListRule] +type accessGroupReplaceResponseRequireAccessEmailListRuleJSON struct { EmailList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessEmailListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessEmailListRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessEmailListRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessEmailListRuleEmailList struct { +type AccessGroupReplaceResponseRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. - ID string `json:"id,required"` - JSON accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseRequireAccessEmailListRuleEmailListJSON `json:"-"` } -// accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessEmailListRuleEmailList] -type accessGroupGetResponseRequireAccessEmailListRuleEmailListJSON struct { +// accessGroupReplaceResponseRequireAccessEmailListRuleEmailListJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessEmailListRuleEmailList] +type accessGroupReplaceResponseRequireAccessEmailListRuleEmailListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessEmailListRuleEmailList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Match an entire email domain. -type AccessGroupGetResponseRequireAccessDomainRule struct { - EmailDomain AccessGroupGetResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` - JSON accessGroupGetResponseRequireAccessDomainRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessDomainRule struct { + EmailDomain AccessGroupReplaceResponseRequireAccessDomainRuleEmailDomain `json:"email_domain,required"` + JSON accessGroupReplaceResponseRequireAccessDomainRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessDomainRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseRequireAccessDomainRule] -type accessGroupGetResponseRequireAccessDomainRuleJSON struct { +// accessGroupReplaceResponseRequireAccessDomainRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseRequireAccessDomainRule] +type accessGroupReplaceResponseRequireAccessDomainRuleJSON struct { EmailDomain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessDomainRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessDomainRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessDomainRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceResponseRequireAccessDomainRuleEmailDomain struct { // The email domain to match. - Domain string `json:"domain,required"` - JSON accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` + Domain string `json:"domain,required"` + JSON accessGroupReplaceResponseRequireAccessDomainRuleEmailDomainJSON `json:"-"` } -// accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessDomainRuleEmailDomain] -type accessGroupGetResponseRequireAccessDomainRuleEmailDomainJSON struct { +// accessGroupReplaceResponseRequireAccessDomainRuleEmailDomainJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessDomainRuleEmailDomain] +type accessGroupReplaceResponseRequireAccessDomainRuleEmailDomainJSON struct { Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessDomainRuleEmailDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches everyone. -type AccessGroupGetResponseRequireAccessEveryoneRule struct { +type AccessGroupReplaceResponseRequireAccessEveryoneRule struct { // An empty object which matches on all users. - Everyone interface{} `json:"everyone,required"` - JSON accessGroupGetResponseRequireAccessEveryoneRuleJSON `json:"-"` + Everyone interface{} `json:"everyone,required"` + JSON accessGroupReplaceResponseRequireAccessEveryoneRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessEveryoneRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessEveryoneRule] -type accessGroupGetResponseRequireAccessEveryoneRuleJSON struct { +// accessGroupReplaceResponseRequireAccessEveryoneRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessEveryoneRule] +type accessGroupReplaceResponseRequireAccessEveryoneRuleJSON struct { Everyone apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessEveryoneRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessEveryoneRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessEveryoneRule) implementsAccessGroupReplaceResponseRequire() { +} // Matches an IP address block. -type AccessGroupGetResponseRequireAccessIPRule struct { - IP AccessGroupGetResponseRequireAccessIPRuleIP `json:"ip,required"` - JSON accessGroupGetResponseRequireAccessIPRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessIPRule struct { + IP AccessGroupReplaceResponseRequireAccessIPRuleIP `json:"ip,required"` + JSON accessGroupReplaceResponseRequireAccessIPRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessIPRuleJSON contains the JSON metadata for the -// struct [AccessGroupGetResponseRequireAccessIPRule] -type accessGroupGetResponseRequireAccessIPRuleJSON struct { +// accessGroupReplaceResponseRequireAccessIPRuleJSON contains the JSON metadata for +// the struct [AccessGroupReplaceResponseRequireAccessIPRule] +type accessGroupReplaceResponseRequireAccessIPRuleJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessIPRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessIPRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessIPRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessIPRuleIP struct { +type AccessGroupReplaceResponseRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. - IP string `json:"ip,required"` - JSON accessGroupGetResponseRequireAccessIPRuleIPJSON `json:"-"` + IP string `json:"ip,required"` + JSON accessGroupReplaceResponseRequireAccessIPRuleIPJSON `json:"-"` } -// accessGroupGetResponseRequireAccessIPRuleIPJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseRequireAccessIPRuleIP] -type accessGroupGetResponseRequireAccessIPRuleIPJSON struct { +// accessGroupReplaceResponseRequireAccessIPRuleIPJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseRequireAccessIPRuleIP] +type accessGroupReplaceResponseRequireAccessIPRuleIPJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessIPRuleIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an IP address from a list. -type AccessGroupGetResponseRequireAccessIPListRule struct { - IPList AccessGroupGetResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` - JSON accessGroupGetResponseRequireAccessIPListRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessIPListRule struct { + IPList AccessGroupReplaceResponseRequireAccessIPListRuleIPList `json:"ip_list,required"` + JSON accessGroupReplaceResponseRequireAccessIPListRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessIPListRuleJSON contains the JSON metadata for -// the struct [AccessGroupGetResponseRequireAccessIPListRule] -type accessGroupGetResponseRequireAccessIPListRuleJSON struct { +// accessGroupReplaceResponseRequireAccessIPListRuleJSON contains the JSON metadata +// for the struct [AccessGroupReplaceResponseRequireAccessIPListRule] +type accessGroupReplaceResponseRequireAccessIPListRuleJSON struct { IPList apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessIPListRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessIPListRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessIPListRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessIPListRuleIPList struct { +type AccessGroupReplaceResponseRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. - ID string `json:"id,required"` - JSON accessGroupGetResponseRequireAccessIPListRuleIPListJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseRequireAccessIPListRuleIPListJSON `json:"-"` } -// accessGroupGetResponseRequireAccessIPListRuleIPListJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessIPListRuleIPList] -type accessGroupGetResponseRequireAccessIPListRuleIPListJSON struct { +// accessGroupReplaceResponseRequireAccessIPListRuleIPListJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseRequireAccessIPListRuleIPList] +type accessGroupReplaceResponseRequireAccessIPListRuleIPListJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessIPListRuleIPList) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid client certificate. -type AccessGroupGetResponseRequireAccessCertificateRule struct { - Certificate interface{} `json:"certificate,required"` - JSON accessGroupGetResponseRequireAccessCertificateRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessCertificateRule struct { + Certificate interface{} `json:"certificate,required"` + JSON accessGroupReplaceResponseRequireAccessCertificateRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessCertificateRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessCertificateRule] -type accessGroupGetResponseRequireAccessCertificateRuleJSON struct { +// accessGroupReplaceResponseRequireAccessCertificateRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessCertificateRule] +type accessGroupReplaceResponseRequireAccessCertificateRuleJSON struct { Certificate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessCertificateRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessCertificateRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessCertificateRule) implementsAccessGroupReplaceResponseRequire() { } // Matches an Access group. -type AccessGroupGetResponseRequireAccessAccessGroupRule struct { - Group AccessGroupGetResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` - JSON accessGroupGetResponseRequireAccessAccessGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessAccessGroupRule struct { + Group AccessGroupReplaceResponseRequireAccessAccessGroupRuleGroup `json:"group,required"` + JSON accessGroupReplaceResponseRequireAccessAccessGroupRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAccessGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessAccessGroupRule] -type accessGroupGetResponseRequireAccessAccessGroupRuleJSON struct { +// accessGroupReplaceResponseRequireAccessAccessGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessAccessGroupRule] +type accessGroupReplaceResponseRequireAccessAccessGroupRuleJSON struct { Group apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAccessGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessAccessGroupRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessAccessGroupRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceResponseRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. - ID string `json:"id,required"` - JSON accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` + ID string `json:"id,required"` + JSON accessGroupReplaceResponseRequireAccessAccessGroupRuleGroupJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessAccessGroupRuleGroup] -type accessGroupGetResponseRequireAccessAccessGroupRuleGroupJSON struct { +// accessGroupReplaceResponseRequireAccessAccessGroupRuleGroupJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessAccessGroupRuleGroup] +type accessGroupReplaceResponseRequireAccessAccessGroupRuleGroupJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAccessGroupRuleGroup) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupGetResponseRequireAccessAzureGroupRule struct { - AzureAd AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` - JSON accessGroupGetResponseRequireAccessAzureGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessAzureGroupRule struct { + AzureAd AccessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAd `json:"azureAD,required"` + JSON accessGroupReplaceResponseRequireAccessAzureGroupRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAzureGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessAzureGroupRule] -type accessGroupGetResponseRequireAccessAzureGroupRuleJSON struct { +// accessGroupReplaceResponseRequireAccessAzureGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessAzureGroupRule] +type accessGroupReplaceResponseRequireAccessAzureGroupRuleJSON struct { AzureAd apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAzureGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessAzureGroupRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessAzureGroupRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID string `json:"id,required"` // The ID of your Azure identity provider. - ConnectionID string `json:"connection_id,required"` - JSON accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON accessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd] -type accessGroupGetResponseRequireAccessAzureGroupRuleAzureAdJSON struct { +// accessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAd] +type accessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAdJSON struct { ID apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAzureGroupRuleAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupGetResponseRequireAccessGitHubOrganizationRule struct { - GitHubOrganization AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` - JSON accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessGitHubOrganizationRule struct { + GitHubOrganization AccessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization `json:"github-organization,required"` + JSON accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessGitHubOrganizationRule] -type accessGroupGetResponseRequireAccessGitHubOrganizationRuleJSON struct { +// accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessGitHubOrganizationRule] +type accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleJSON struct { GitHubOrganization apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessGitHubOrganizationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessGitHubOrganizationRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID string `json:"connection_id,required"` // The name of the organization. - Name string `json:"name,required"` - JSON accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` + Name string `json:"name,required"` + JSON accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON `json:"-"` } -// accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON +// accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] -type accessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { +// [AccessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization] +type accessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganizationJSON struct { ConnectionID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessGitHubOrganizationRuleGitHubOrganization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupGetResponseRequireAccessGsuiteGroupRule struct { - Gsuite AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` - JSON accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessGsuiteGroupRule struct { + Gsuite AccessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuite `json:"gsuite,required"` + JSON accessGroupReplaceResponseRequireAccessGsuiteGroupRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessGsuiteGroupRule] -type accessGroupGetResponseRequireAccessGsuiteGroupRuleJSON struct { +// accessGroupReplaceResponseRequireAccessGsuiteGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessGsuiteGroupRule] +type accessGroupReplaceResponseRequireAccessGsuiteGroupRuleJSON struct { Gsuite apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessGsuiteGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessGsuiteGroupRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessGsuiteGroupRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Google Workspace group. - Email string `json:"email,required"` - JSON accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON `json:"-"` } -// accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite] -type accessGroupGetResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { +// accessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuite] +type accessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuiteJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessGsuiteGroupRuleGsuite) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupGetResponseRequireAccessOktaGroupRule struct { - Okta AccessGroupGetResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` - JSON accessGroupGetResponseRequireAccessOktaGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessOktaGroupRule struct { + Okta AccessGroupReplaceResponseRequireAccessOktaGroupRuleOkta `json:"okta,required"` + JSON accessGroupReplaceResponseRequireAccessOktaGroupRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessOktaGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessOktaGroupRule] -type accessGroupGetResponseRequireAccessOktaGroupRuleJSON struct { +// accessGroupReplaceResponseRequireAccessOktaGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessOktaGroupRule] +type accessGroupReplaceResponseRequireAccessOktaGroupRuleJSON struct { Okta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessOktaGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessOktaGroupRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessOktaGroupRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceResponseRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID string `json:"connection_id,required"` // The email of the Okta group. - Email string `json:"email,required"` - JSON accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` + Email string `json:"email,required"` + JSON accessGroupReplaceResponseRequireAccessOktaGroupRuleOktaJSON `json:"-"` } -// accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessOktaGroupRuleOkta] -type accessGroupGetResponseRequireAccessOktaGroupRuleOktaJSON struct { +// accessGroupReplaceResponseRequireAccessOktaGroupRuleOktaJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseRequireAccessOktaGroupRuleOkta] +type accessGroupReplaceResponseRequireAccessOktaGroupRuleOktaJSON struct { ConnectionID apijson.Field Email apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessOktaGroupRuleOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupGetResponseRequireAccessSamlGroupRule struct { - Saml AccessGroupGetResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` - JSON accessGroupGetResponseRequireAccessSamlGroupRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessSamlGroupRule struct { + Saml AccessGroupReplaceResponseRequireAccessSamlGroupRuleSaml `json:"saml,required"` + JSON accessGroupReplaceResponseRequireAccessSamlGroupRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessSamlGroupRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessSamlGroupRule] -type accessGroupGetResponseRequireAccessSamlGroupRuleJSON struct { +// accessGroupReplaceResponseRequireAccessSamlGroupRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessSamlGroupRule] +type accessGroupReplaceResponseRequireAccessSamlGroupRuleJSON struct { Saml apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessSamlGroupRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessSamlGroupRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessSamlGroupRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceResponseRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName string `json:"attribute_name,required"` // The SAML attribute value to look for. - AttributeValue string `json:"attribute_value,required"` - JSON accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` + AttributeValue string `json:"attribute_value,required"` + JSON accessGroupReplaceResponseRequireAccessSamlGroupRuleSamlJSON `json:"-"` } -// accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessSamlGroupRuleSaml] -type accessGroupGetResponseRequireAccessSamlGroupRuleSamlJSON struct { +// accessGroupReplaceResponseRequireAccessSamlGroupRuleSamlJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseRequireAccessSamlGroupRuleSaml] +type accessGroupReplaceResponseRequireAccessSamlGroupRuleSamlJSON struct { AttributeName apijson.Field AttributeValue apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessSamlGroupRuleSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific Access Service Token -type AccessGroupGetResponseRequireAccessServiceTokenRule struct { - ServiceToken AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` - JSON accessGroupGetResponseRequireAccessServiceTokenRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessServiceTokenRule struct { + ServiceToken AccessGroupReplaceResponseRequireAccessServiceTokenRuleServiceToken `json:"service_token,required"` + JSON accessGroupReplaceResponseRequireAccessServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessServiceTokenRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessServiceTokenRule] -type accessGroupGetResponseRequireAccessServiceTokenRuleJSON struct { +// accessGroupReplaceResponseRequireAccessServiceTokenRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseRequireAccessServiceTokenRule] +type accessGroupReplaceResponseRequireAccessServiceTokenRuleJSON struct { ServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessServiceTokenRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessServiceTokenRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceResponseRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. - TokenID string `json:"token_id,required"` - JSON accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` + TokenID string `json:"token_id,required"` + JSON accessGroupReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON `json:"-"` } -// accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON contains the -// JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken] -type accessGroupGetResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { +// accessGroupReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON contains +// the JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessServiceTokenRuleServiceToken] +type accessGroupReplaceResponseRequireAccessServiceTokenRuleServiceTokenJSON struct { TokenID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessServiceTokenRuleServiceToken) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches any valid Access Service Token -type AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceResponseRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. - AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` - JSON accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` + AnyValidServiceToken interface{} `json:"any_valid_service_token,required"` + JSON accessGroupReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON contains the +// accessGroupReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule] -type accessGroupGetResponseRequireAccessAnyValidServiceTokenRuleJSON struct { +// [AccessGroupReplaceResponseRequireAccessAnyValidServiceTokenRule] +type accessGroupReplaceResponseRequireAccessAnyValidServiceTokenRuleJSON struct { AnyValidServiceToken apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAnyValidServiceTokenRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceResponseRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupGetResponseRequireAccessExternalEvaluationRule struct { - ExternalEvaluation AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` - JSON accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessExternalEvaluationRule struct { + ExternalEvaluation AccessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation `json:"external_evaluation,required"` + JSON accessGroupReplaceResponseRequireAccessExternalEvaluationRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON contains the JSON -// metadata for the struct -// [AccessGroupGetResponseRequireAccessExternalEvaluationRule] -type accessGroupGetResponseRequireAccessExternalEvaluationRuleJSON struct { +// accessGroupReplaceResponseRequireAccessExternalEvaluationRuleJSON contains the +// JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessExternalEvaluationRule] +type accessGroupReplaceResponseRequireAccessExternalEvaluationRuleJSON struct { ExternalEvaluation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessExternalEvaluationRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessExternalEvaluationRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessExternalEvaluationRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL string `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response // came from your API. - KeysURL string `json:"keys_url,required"` - JSON accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` + KeysURL string `json:"keys_url,required"` + JSON accessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON `json:"-"` } -// accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON +// accessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation] -type accessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { +// [AccessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation] +type accessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluationJSON struct { EvaluateURL apijson.Field KeysURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessExternalEvaluationRuleExternalEvaluation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Matches a specific country -type AccessGroupGetResponseRequireAccessCountryRule struct { - Geo AccessGroupGetResponseRequireAccessCountryRuleGeo `json:"geo,required"` - JSON accessGroupGetResponseRequireAccessCountryRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessCountryRule struct { + Geo AccessGroupReplaceResponseRequireAccessCountryRuleGeo `json:"geo,required"` + JSON accessGroupReplaceResponseRequireAccessCountryRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessCountryRuleJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessCountryRule] -type accessGroupGetResponseRequireAccessCountryRuleJSON struct { +// accessGroupReplaceResponseRequireAccessCountryRuleJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessCountryRule] +type accessGroupReplaceResponseRequireAccessCountryRuleJSON struct { Geo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessCountryRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessCountryRule) implementsAccessGroupGetResponseRequire() {} +func (r AccessGroupReplaceResponseRequireAccessCountryRule) implementsAccessGroupReplaceResponseRequire() { +} -type AccessGroupGetResponseRequireAccessCountryRuleGeo struct { +type AccessGroupReplaceResponseRequireAccessCountryRuleGeo struct { // The country code that should be matched. - CountryCode string `json:"country_code,required"` - JSON accessGroupGetResponseRequireAccessCountryRuleGeoJSON `json:"-"` + CountryCode string `json:"country_code,required"` + JSON accessGroupReplaceResponseRequireAccessCountryRuleGeoJSON `json:"-"` } -// accessGroupGetResponseRequireAccessCountryRuleGeoJSON contains the JSON metadata -// for the struct [AccessGroupGetResponseRequireAccessCountryRuleGeo] -type accessGroupGetResponseRequireAccessCountryRuleGeoJSON struct { +// accessGroupReplaceResponseRequireAccessCountryRuleGeoJSON contains the JSON +// metadata for the struct [AccessGroupReplaceResponseRequireAccessCountryRuleGeo] +type accessGroupReplaceResponseRequireAccessCountryRuleGeoJSON struct { CountryCode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessCountryRuleGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforce different MFA options -type AccessGroupGetResponseRequireAccessAuthenticationMethodRule struct { - AuthMethod AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` - JSON accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessAuthenticationMethodRule struct { + AuthMethod AccessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod `json:"auth_method,required"` + JSON accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON contains the +// accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleJSON contains the // JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessAuthenticationMethodRule] -type accessGroupGetResponseRequireAccessAuthenticationMethodRuleJSON struct { +// [AccessGroupReplaceResponseRequireAccessAuthenticationMethodRule] +type accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAuthenticationMethodRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessAuthenticationMethodRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - AuthMethod string `json:"auth_method,required"` - JSON accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` + AuthMethod string `json:"auth_method,required"` + JSON accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON `json:"-"` } -// accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON +// accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON // contains the JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod] -type accessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { +// [AccessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod] +type accessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethodJSON struct { AuthMethod apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessAuthenticationMethodRuleAuthMethod) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enforces a device posture rule has run successfully -type AccessGroupGetResponseRequireAccessDevicePostureRule struct { - DevicePosture AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` - JSON accessGroupGetResponseRequireAccessDevicePostureRuleJSON `json:"-"` +type AccessGroupReplaceResponseRequireAccessDevicePostureRule struct { + DevicePosture AccessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePosture `json:"device_posture,required"` + JSON accessGroupReplaceResponseRequireAccessDevicePostureRuleJSON `json:"-"` } -// accessGroupGetResponseRequireAccessDevicePostureRuleJSON contains the JSON -// metadata for the struct [AccessGroupGetResponseRequireAccessDevicePostureRule] -type accessGroupGetResponseRequireAccessDevicePostureRuleJSON struct { +// accessGroupReplaceResponseRequireAccessDevicePostureRuleJSON contains the JSON +// metadata for the struct +// [AccessGroupReplaceResponseRequireAccessDevicePostureRule] +type accessGroupReplaceResponseRequireAccessDevicePostureRuleJSON struct { DevicePosture apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessDevicePostureRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupGetResponseRequireAccessDevicePostureRule) implementsAccessGroupGetResponseRequire() { +func (r AccessGroupReplaceResponseRequireAccessDevicePostureRule) implementsAccessGroupReplaceResponseRequire() { } -type AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. - IntegrationUid string `json:"integration_uid,required"` - JSON accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` + IntegrationUid string `json:"integration_uid,required"` + JSON accessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON `json:"-"` } -// accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON contains -// the JSON metadata for the struct -// [AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture] -type accessGroupGetResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { +// accessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON +// contains the JSON metadata for the struct +// [AccessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePosture] +type accessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePostureJSON struct { IntegrationUid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseRequireAccessDevicePostureRuleDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupUpdateParams struct { +type AccessGroupNewParams struct { // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include param.Field[[]AccessGroupUpdateParamsInclude] `json:"include,required"` + Include param.Field[[]AccessGroupNewParamsInclude] `json:"include,required"` // The name of the Access group. Name param.Field[string] `json:"name,required"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude param.Field[[]AccessGroupUpdateParamsExclude] `json:"exclude"` + Exclude param.Field[[]AccessGroupNewParamsExclude] `json:"exclude"` // Whether this is the default group IsDefault param.Field[bool] `json:"is_default"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require param.Field[[]AccessGroupUpdateParamsRequire] `json:"require"` + Require param.Field[[]AccessGroupNewParamsRequire] `json:"require"` } -func (r AccessGroupUpdateParams) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by [AccessGroupUpdateParamsIncludeAccessEmailRule], -// [AccessGroupUpdateParamsIncludeAccessEmailListRule], -// [AccessGroupUpdateParamsIncludeAccessDomainRule], -// [AccessGroupUpdateParamsIncludeAccessEveryoneRule], -// [AccessGroupUpdateParamsIncludeAccessIPRule], -// [AccessGroupUpdateParamsIncludeAccessIPListRule], -// [AccessGroupUpdateParamsIncludeAccessCertificateRule], -// [AccessGroupUpdateParamsIncludeAccessAccessGroupRule], -// [AccessGroupUpdateParamsIncludeAccessAzureGroupRule], -// [AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRule], -// [AccessGroupUpdateParamsIncludeAccessGsuiteGroupRule], -// [AccessGroupUpdateParamsIncludeAccessOktaGroupRule], -// [AccessGroupUpdateParamsIncludeAccessSamlGroupRule], -// [AccessGroupUpdateParamsIncludeAccessServiceTokenRule], -// [AccessGroupUpdateParamsIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateParamsIncludeAccessExternalEvaluationRule], -// [AccessGroupUpdateParamsIncludeAccessCountryRule], -// [AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRule], -// [AccessGroupUpdateParamsIncludeAccessDevicePostureRule]. -type AccessGroupUpdateParamsInclude interface { - implementsAccessGroupUpdateParamsInclude() +// Satisfied by [AccessGroupNewParamsIncludeAccessEmailRule], +// [AccessGroupNewParamsIncludeAccessEmailListRule], +// [AccessGroupNewParamsIncludeAccessDomainRule], +// [AccessGroupNewParamsIncludeAccessEveryoneRule], +// [AccessGroupNewParamsIncludeAccessIPRule], +// [AccessGroupNewParamsIncludeAccessIPListRule], +// [AccessGroupNewParamsIncludeAccessCertificateRule], +// [AccessGroupNewParamsIncludeAccessAccessGroupRule], +// [AccessGroupNewParamsIncludeAccessAzureGroupRule], +// [AccessGroupNewParamsIncludeAccessGitHubOrganizationRule], +// [AccessGroupNewParamsIncludeAccessGsuiteGroupRule], +// [AccessGroupNewParamsIncludeAccessOktaGroupRule], +// [AccessGroupNewParamsIncludeAccessSamlGroupRule], +// [AccessGroupNewParamsIncludeAccessServiceTokenRule], +// [AccessGroupNewParamsIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupNewParamsIncludeAccessExternalEvaluationRule], +// [AccessGroupNewParamsIncludeAccessCountryRule], +// [AccessGroupNewParamsIncludeAccessAuthenticationMethodRule], +// [AccessGroupNewParamsIncludeAccessDevicePostureRule]. +type AccessGroupNewParamsInclude interface { + implementsAccessGroupNewParamsInclude() } // Matches a specific email. -type AccessGroupUpdateParamsIncludeAccessEmailRule struct { - Email param.Field[AccessGroupUpdateParamsIncludeAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupNewParamsIncludeAccessEmailRule struct { + Email param.Field[AccessGroupNewParamsIncludeAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupUpdateParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessEmailRule) implementsAccessGroupUpdateParamsInclude() {} +func (r AccessGroupNewParamsIncludeAccessEmailRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessEmailRuleEmail struct { +type AccessGroupNewParamsIncludeAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupUpdateParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupUpdateParamsIncludeAccessEmailListRule struct { - EmailList param.Field[AccessGroupUpdateParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupNewParamsIncludeAccessEmailListRule struct { + EmailList param.Field[AccessGroupNewParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupUpdateParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessEmailListRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessEmailListRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessEmailListRuleEmailList struct { +type AccessGroupNewParamsIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupUpdateParamsIncludeAccessDomainRule struct { - EmailDomain param.Field[AccessGroupUpdateParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupNewParamsIncludeAccessDomainRule struct { + EmailDomain param.Field[AccessGroupNewParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupUpdateParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessDomainRule) implementsAccessGroupUpdateParamsInclude() {} +func (r AccessGroupNewParamsIncludeAccessDomainRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupNewParamsIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupUpdateParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupUpdateParamsIncludeAccessEveryoneRule struct { +type AccessGroupNewParamsIncludeAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupUpdateParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessEveryoneRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessEveryoneRule) implementsAccessGroupNewParamsInclude() {} // Matches an IP address block. -type AccessGroupUpdateParamsIncludeAccessIPRule struct { - IP param.Field[AccessGroupUpdateParamsIncludeAccessIPRuleIP] `json:"ip,required"` +type AccessGroupNewParamsIncludeAccessIPRule struct { + IP param.Field[AccessGroupNewParamsIncludeAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupUpdateParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessIPRule) implementsAccessGroupUpdateParamsInclude() {} +func (r AccessGroupNewParamsIncludeAccessIPRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessIPRuleIP struct { +type AccessGroupNewParamsIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupUpdateParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupUpdateParamsIncludeAccessIPListRule struct { - IPList param.Field[AccessGroupUpdateParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupNewParamsIncludeAccessIPListRule struct { + IPList param.Field[AccessGroupNewParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupUpdateParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessIPListRule) implementsAccessGroupUpdateParamsInclude() {} +func (r AccessGroupNewParamsIncludeAccessIPListRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessIPListRuleIPList struct { +type AccessGroupNewParamsIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupUpdateParamsIncludeAccessCertificateRule struct { +type AccessGroupNewParamsIncludeAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupUpdateParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessCertificateRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessCertificateRule) implementsAccessGroupNewParamsInclude() {} // Matches an Access group. -type AccessGroupUpdateParamsIncludeAccessAccessGroupRule struct { - Group param.Field[AccessGroupUpdateParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupNewParamsIncludeAccessAccessGroupRule struct { + Group param.Field[AccessGroupNewParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessAccessGroupRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessAccessGroupRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupNewParamsIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateParamsIncludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupUpdateParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupNewParamsIncludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupNewParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessAzureGroupRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessAzureGroupRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewParamsIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupNewParamsIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRule) implementsAccessGroupUpdateParamsInclude() { +func (r AccessGroupNewParamsIncludeAccessGitHubOrganizationRule) implementsAccessGroupNewParamsInclude() { } -type AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupUpdateParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateParamsIncludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupUpdateParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupNewParamsIncludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupNewParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupUpdateParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessGsuiteGroupRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessGsuiteGroupRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewParamsIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateParamsIncludeAccessOktaGroupRule struct { - Okta param.Field[AccessGroupUpdateParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupNewParamsIncludeAccessOktaGroupRule struct { + Okta param.Field[AccessGroupNewParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupUpdateParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessOktaGroupRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessOktaGroupRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupNewParamsIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateParamsIncludeAccessSamlGroupRule struct { - Saml param.Field[AccessGroupUpdateParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupNewParamsIncludeAccessSamlGroupRule struct { + Saml param.Field[AccessGroupNewParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupUpdateParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessSamlGroupRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessSamlGroupRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupNewParamsIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupUpdateParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupUpdateParamsIncludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupUpdateParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupNewParamsIncludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupNewParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupUpdateParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessServiceTokenRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessServiceTokenRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewParamsIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupUpdateParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupUpdateParamsIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupNewParamsIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateParamsInclude() { +func (r AccessGroupNewParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupNewParamsInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateParamsIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupNewParamsIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupUpdateParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessExternalEvaluationRule) implementsAccessGroupUpdateParamsInclude() { +func (r AccessGroupNewParamsIncludeAccessExternalEvaluationRule) implementsAccessGroupNewParamsInclude() { } -type AccessGroupUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -12843,407 +12620,397 @@ type AccessGroupUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupUpdateParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupUpdateParamsIncludeAccessCountryRule struct { - Geo param.Field[AccessGroupUpdateParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupNewParamsIncludeAccessCountryRule struct { + Geo param.Field[AccessGroupNewParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupUpdateParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessCountryRule) implementsAccessGroupUpdateParamsInclude() {} +func (r AccessGroupNewParamsIncludeAccessCountryRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessCountryRuleGeo struct { +type AccessGroupNewParamsIncludeAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupUpdateParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupNewParamsIncludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRule) implementsAccessGroupUpdateParamsInclude() { +func (r AccessGroupNewParamsIncludeAccessAuthenticationMethodRule) implementsAccessGroupNewParamsInclude() { } -type AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateParamsIncludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupUpdateParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupNewParamsIncludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupNewParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` } -func (r AccessGroupUpdateParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsIncludeAccessDevicePostureRule) implementsAccessGroupUpdateParamsInclude() { -} +func (r AccessGroupNewParamsIncludeAccessDevicePostureRule) implementsAccessGroupNewParamsInclude() {} -type AccessGroupUpdateParamsIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewParamsIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. IntegrationUid param.Field[string] `json:"integration_uid,required"` } -func (r AccessGroupUpdateParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by [AccessGroupUpdateParamsExcludeAccessEmailRule], -// [AccessGroupUpdateParamsExcludeAccessEmailListRule], -// [AccessGroupUpdateParamsExcludeAccessDomainRule], -// [AccessGroupUpdateParamsExcludeAccessEveryoneRule], -// [AccessGroupUpdateParamsExcludeAccessIPRule], -// [AccessGroupUpdateParamsExcludeAccessIPListRule], -// [AccessGroupUpdateParamsExcludeAccessCertificateRule], -// [AccessGroupUpdateParamsExcludeAccessAccessGroupRule], -// [AccessGroupUpdateParamsExcludeAccessAzureGroupRule], -// [AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRule], -// [AccessGroupUpdateParamsExcludeAccessGsuiteGroupRule], -// [AccessGroupUpdateParamsExcludeAccessOktaGroupRule], -// [AccessGroupUpdateParamsExcludeAccessSamlGroupRule], -// [AccessGroupUpdateParamsExcludeAccessServiceTokenRule], -// [AccessGroupUpdateParamsExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateParamsExcludeAccessExternalEvaluationRule], -// [AccessGroupUpdateParamsExcludeAccessCountryRule], -// [AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRule], -// [AccessGroupUpdateParamsExcludeAccessDevicePostureRule]. -type AccessGroupUpdateParamsExclude interface { - implementsAccessGroupUpdateParamsExclude() +// Satisfied by [AccessGroupNewParamsExcludeAccessEmailRule], +// [AccessGroupNewParamsExcludeAccessEmailListRule], +// [AccessGroupNewParamsExcludeAccessDomainRule], +// [AccessGroupNewParamsExcludeAccessEveryoneRule], +// [AccessGroupNewParamsExcludeAccessIPRule], +// [AccessGroupNewParamsExcludeAccessIPListRule], +// [AccessGroupNewParamsExcludeAccessCertificateRule], +// [AccessGroupNewParamsExcludeAccessAccessGroupRule], +// [AccessGroupNewParamsExcludeAccessAzureGroupRule], +// [AccessGroupNewParamsExcludeAccessGitHubOrganizationRule], +// [AccessGroupNewParamsExcludeAccessGsuiteGroupRule], +// [AccessGroupNewParamsExcludeAccessOktaGroupRule], +// [AccessGroupNewParamsExcludeAccessSamlGroupRule], +// [AccessGroupNewParamsExcludeAccessServiceTokenRule], +// [AccessGroupNewParamsExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupNewParamsExcludeAccessExternalEvaluationRule], +// [AccessGroupNewParamsExcludeAccessCountryRule], +// [AccessGroupNewParamsExcludeAccessAuthenticationMethodRule], +// [AccessGroupNewParamsExcludeAccessDevicePostureRule]. +type AccessGroupNewParamsExclude interface { + implementsAccessGroupNewParamsExclude() } // Matches a specific email. -type AccessGroupUpdateParamsExcludeAccessEmailRule struct { - Email param.Field[AccessGroupUpdateParamsExcludeAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupNewParamsExcludeAccessEmailRule struct { + Email param.Field[AccessGroupNewParamsExcludeAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupUpdateParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessEmailRule) implementsAccessGroupUpdateParamsExclude() {} +func (r AccessGroupNewParamsExcludeAccessEmailRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessEmailRuleEmail struct { +type AccessGroupNewParamsExcludeAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupUpdateParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupUpdateParamsExcludeAccessEmailListRule struct { - EmailList param.Field[AccessGroupUpdateParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupNewParamsExcludeAccessEmailListRule struct { + EmailList param.Field[AccessGroupNewParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupUpdateParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessEmailListRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessEmailListRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessEmailListRuleEmailList struct { +type AccessGroupNewParamsExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupUpdateParamsExcludeAccessDomainRule struct { - EmailDomain param.Field[AccessGroupUpdateParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupNewParamsExcludeAccessDomainRule struct { + EmailDomain param.Field[AccessGroupNewParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupUpdateParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessDomainRule) implementsAccessGroupUpdateParamsExclude() {} +func (r AccessGroupNewParamsExcludeAccessDomainRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupNewParamsExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupUpdateParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupUpdateParamsExcludeAccessEveryoneRule struct { +type AccessGroupNewParamsExcludeAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupUpdateParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessEveryoneRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessEveryoneRule) implementsAccessGroupNewParamsExclude() {} // Matches an IP address block. -type AccessGroupUpdateParamsExcludeAccessIPRule struct { - IP param.Field[AccessGroupUpdateParamsExcludeAccessIPRuleIP] `json:"ip,required"` +type AccessGroupNewParamsExcludeAccessIPRule struct { + IP param.Field[AccessGroupNewParamsExcludeAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupUpdateParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessIPRule) implementsAccessGroupUpdateParamsExclude() {} +func (r AccessGroupNewParamsExcludeAccessIPRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessIPRuleIP struct { +type AccessGroupNewParamsExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupUpdateParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupUpdateParamsExcludeAccessIPListRule struct { - IPList param.Field[AccessGroupUpdateParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupNewParamsExcludeAccessIPListRule struct { + IPList param.Field[AccessGroupNewParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupUpdateParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessIPListRule) implementsAccessGroupUpdateParamsExclude() {} +func (r AccessGroupNewParamsExcludeAccessIPListRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessIPListRuleIPList struct { +type AccessGroupNewParamsExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupUpdateParamsExcludeAccessCertificateRule struct { +type AccessGroupNewParamsExcludeAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupUpdateParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessCertificateRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessCertificateRule) implementsAccessGroupNewParamsExclude() {} // Matches an Access group. -type AccessGroupUpdateParamsExcludeAccessAccessGroupRule struct { - Group param.Field[AccessGroupUpdateParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupNewParamsExcludeAccessAccessGroupRule struct { + Group param.Field[AccessGroupNewParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessAccessGroupRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessAccessGroupRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupNewParamsExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateParamsExcludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupUpdateParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupNewParamsExcludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupNewParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessAzureGroupRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessAzureGroupRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewParamsExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupNewParamsExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRule) implementsAccessGroupUpdateParamsExclude() { +func (r AccessGroupNewParamsExcludeAccessGitHubOrganizationRule) implementsAccessGroupNewParamsExclude() { } -type AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupUpdateParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateParamsExcludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupUpdateParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupNewParamsExcludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupNewParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupUpdateParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessGsuiteGroupRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessGsuiteGroupRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewParamsExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateParamsExcludeAccessOktaGroupRule struct { - Okta param.Field[AccessGroupUpdateParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupNewParamsExcludeAccessOktaGroupRule struct { + Okta param.Field[AccessGroupNewParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupUpdateParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessOktaGroupRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessOktaGroupRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupNewParamsExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateParamsExcludeAccessSamlGroupRule struct { - Saml param.Field[AccessGroupUpdateParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupNewParamsExcludeAccessSamlGroupRule struct { + Saml param.Field[AccessGroupNewParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupUpdateParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessSamlGroupRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessSamlGroupRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupNewParamsExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupUpdateParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupUpdateParamsExcludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupUpdateParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupNewParamsExcludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupNewParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupUpdateParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessServiceTokenRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessServiceTokenRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewParamsExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupUpdateParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupUpdateParamsExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupNewParamsExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateParamsExclude() { +func (r AccessGroupNewParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupNewParamsExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateParamsExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupNewParamsExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupUpdateParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessExternalEvaluationRule) implementsAccessGroupUpdateParamsExclude() { +func (r AccessGroupNewParamsExcludeAccessExternalEvaluationRule) implementsAccessGroupNewParamsExclude() { } -type AccessGroupUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -13251,407 +13018,397 @@ type AccessGroupUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupUpdateParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupUpdateParamsExcludeAccessCountryRule struct { - Geo param.Field[AccessGroupUpdateParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupNewParamsExcludeAccessCountryRule struct { + Geo param.Field[AccessGroupNewParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupUpdateParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessCountryRule) implementsAccessGroupUpdateParamsExclude() {} +func (r AccessGroupNewParamsExcludeAccessCountryRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessCountryRuleGeo struct { +type AccessGroupNewParamsExcludeAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupUpdateParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupNewParamsExcludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRule) implementsAccessGroupUpdateParamsExclude() { +func (r AccessGroupNewParamsExcludeAccessAuthenticationMethodRule) implementsAccessGroupNewParamsExclude() { } -type AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateParamsExcludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupUpdateParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupNewParamsExcludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupNewParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` } -func (r AccessGroupUpdateParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsExcludeAccessDevicePostureRule) implementsAccessGroupUpdateParamsExclude() { -} +func (r AccessGroupNewParamsExcludeAccessDevicePostureRule) implementsAccessGroupNewParamsExclude() {} -type AccessGroupUpdateParamsExcludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupNewParamsExcludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. IntegrationUid param.Field[string] `json:"integration_uid,required"` } -func (r AccessGroupUpdateParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by [AccessGroupUpdateParamsRequireAccessEmailRule], -// [AccessGroupUpdateParamsRequireAccessEmailListRule], -// [AccessGroupUpdateParamsRequireAccessDomainRule], -// [AccessGroupUpdateParamsRequireAccessEveryoneRule], -// [AccessGroupUpdateParamsRequireAccessIPRule], -// [AccessGroupUpdateParamsRequireAccessIPListRule], -// [AccessGroupUpdateParamsRequireAccessCertificateRule], -// [AccessGroupUpdateParamsRequireAccessAccessGroupRule], -// [AccessGroupUpdateParamsRequireAccessAzureGroupRule], -// [AccessGroupUpdateParamsRequireAccessGitHubOrganizationRule], -// [AccessGroupUpdateParamsRequireAccessGsuiteGroupRule], -// [AccessGroupUpdateParamsRequireAccessOktaGroupRule], -// [AccessGroupUpdateParamsRequireAccessSamlGroupRule], -// [AccessGroupUpdateParamsRequireAccessServiceTokenRule], -// [AccessGroupUpdateParamsRequireAccessAnyValidServiceTokenRule], -// [AccessGroupUpdateParamsRequireAccessExternalEvaluationRule], -// [AccessGroupUpdateParamsRequireAccessCountryRule], -// [AccessGroupUpdateParamsRequireAccessAuthenticationMethodRule], -// [AccessGroupUpdateParamsRequireAccessDevicePostureRule]. -type AccessGroupUpdateParamsRequire interface { - implementsAccessGroupUpdateParamsRequire() +// Satisfied by [AccessGroupNewParamsRequireAccessEmailRule], +// [AccessGroupNewParamsRequireAccessEmailListRule], +// [AccessGroupNewParamsRequireAccessDomainRule], +// [AccessGroupNewParamsRequireAccessEveryoneRule], +// [AccessGroupNewParamsRequireAccessIPRule], +// [AccessGroupNewParamsRequireAccessIPListRule], +// [AccessGroupNewParamsRequireAccessCertificateRule], +// [AccessGroupNewParamsRequireAccessAccessGroupRule], +// [AccessGroupNewParamsRequireAccessAzureGroupRule], +// [AccessGroupNewParamsRequireAccessGitHubOrganizationRule], +// [AccessGroupNewParamsRequireAccessGsuiteGroupRule], +// [AccessGroupNewParamsRequireAccessOktaGroupRule], +// [AccessGroupNewParamsRequireAccessSamlGroupRule], +// [AccessGroupNewParamsRequireAccessServiceTokenRule], +// [AccessGroupNewParamsRequireAccessAnyValidServiceTokenRule], +// [AccessGroupNewParamsRequireAccessExternalEvaluationRule], +// [AccessGroupNewParamsRequireAccessCountryRule], +// [AccessGroupNewParamsRequireAccessAuthenticationMethodRule], +// [AccessGroupNewParamsRequireAccessDevicePostureRule]. +type AccessGroupNewParamsRequire interface { + implementsAccessGroupNewParamsRequire() } // Matches a specific email. -type AccessGroupUpdateParamsRequireAccessEmailRule struct { - Email param.Field[AccessGroupUpdateParamsRequireAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupNewParamsRequireAccessEmailRule struct { + Email param.Field[AccessGroupNewParamsRequireAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupUpdateParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessEmailRule) implementsAccessGroupUpdateParamsRequire() {} +func (r AccessGroupNewParamsRequireAccessEmailRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessEmailRuleEmail struct { +type AccessGroupNewParamsRequireAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupUpdateParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupUpdateParamsRequireAccessEmailListRule struct { - EmailList param.Field[AccessGroupUpdateParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupNewParamsRequireAccessEmailListRule struct { + EmailList param.Field[AccessGroupNewParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupUpdateParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessEmailListRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessEmailListRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessEmailListRuleEmailList struct { +type AccessGroupNewParamsRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupUpdateParamsRequireAccessDomainRule struct { - EmailDomain param.Field[AccessGroupUpdateParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupNewParamsRequireAccessDomainRule struct { + EmailDomain param.Field[AccessGroupNewParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupUpdateParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessDomainRule) implementsAccessGroupUpdateParamsRequire() {} +func (r AccessGroupNewParamsRequireAccessDomainRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessDomainRuleEmailDomain struct { +type AccessGroupNewParamsRequireAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupUpdateParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupUpdateParamsRequireAccessEveryoneRule struct { +type AccessGroupNewParamsRequireAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupUpdateParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessEveryoneRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessEveryoneRule) implementsAccessGroupNewParamsRequire() {} // Matches an IP address block. -type AccessGroupUpdateParamsRequireAccessIPRule struct { - IP param.Field[AccessGroupUpdateParamsRequireAccessIPRuleIP] `json:"ip,required"` +type AccessGroupNewParamsRequireAccessIPRule struct { + IP param.Field[AccessGroupNewParamsRequireAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupUpdateParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessIPRule) implementsAccessGroupUpdateParamsRequire() {} +func (r AccessGroupNewParamsRequireAccessIPRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessIPRuleIP struct { +type AccessGroupNewParamsRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupUpdateParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupUpdateParamsRequireAccessIPListRule struct { - IPList param.Field[AccessGroupUpdateParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupNewParamsRequireAccessIPListRule struct { + IPList param.Field[AccessGroupNewParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupUpdateParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessIPListRule) implementsAccessGroupUpdateParamsRequire() {} +func (r AccessGroupNewParamsRequireAccessIPListRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessIPListRuleIPList struct { +type AccessGroupNewParamsRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupUpdateParamsRequireAccessCertificateRule struct { +type AccessGroupNewParamsRequireAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupUpdateParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessCertificateRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessCertificateRule) implementsAccessGroupNewParamsRequire() {} // Matches an Access group. -type AccessGroupUpdateParamsRequireAccessAccessGroupRule struct { - Group param.Field[AccessGroupUpdateParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupNewParamsRequireAccessAccessGroupRule struct { + Group param.Field[AccessGroupNewParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupUpdateParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessAccessGroupRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessAccessGroupRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessAccessGroupRuleGroup struct { +type AccessGroupNewParamsRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupUpdateParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupUpdateParamsRequireAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupUpdateParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupNewParamsRequireAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupNewParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupUpdateParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessAzureGroupRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessAzureGroupRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupNewParamsRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupUpdateParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupUpdateParamsRequireAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupNewParamsRequireAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupUpdateParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessGitHubOrganizationRule) implementsAccessGroupUpdateParamsRequire() { +func (r AccessGroupNewParamsRequireAccessGitHubOrganizationRule) implementsAccessGroupNewParamsRequire() { } -type AccessGroupUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupUpdateParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupUpdateParamsRequireAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupUpdateParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupNewParamsRequireAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupNewParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupUpdateParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessGsuiteGroupRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessGsuiteGroupRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupNewParamsRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupUpdateParamsRequireAccessOktaGroupRule struct { - Okta param.Field[AccessGroupUpdateParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupNewParamsRequireAccessOktaGroupRule struct { + Okta param.Field[AccessGroupNewParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupUpdateParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessOktaGroupRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessOktaGroupRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessOktaGroupRuleOkta struct { +type AccessGroupNewParamsRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupUpdateParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupUpdateParamsRequireAccessSamlGroupRule struct { - Saml param.Field[AccessGroupUpdateParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupNewParamsRequireAccessSamlGroupRule struct { + Saml param.Field[AccessGroupNewParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupUpdateParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessSamlGroupRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessSamlGroupRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessSamlGroupRuleSaml struct { +type AccessGroupNewParamsRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupUpdateParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupUpdateParamsRequireAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupUpdateParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupNewParamsRequireAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupNewParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupUpdateParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessServiceTokenRule) implementsAccessGroupUpdateParamsRequire() { -} +func (r AccessGroupNewParamsRequireAccessServiceTokenRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupNewParamsRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupUpdateParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupUpdateParamsRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupNewParamsRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupUpdateParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessAnyValidServiceTokenRule) implementsAccessGroupUpdateParamsRequire() { +func (r AccessGroupNewParamsRequireAccessAnyValidServiceTokenRule) implementsAccessGroupNewParamsRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupUpdateParamsRequireAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupNewParamsRequireAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupUpdateParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessExternalEvaluationRule) implementsAccessGroupUpdateParamsRequire() { +func (r AccessGroupNewParamsRequireAccessExternalEvaluationRule) implementsAccessGroupNewParamsRequire() { } -type AccessGroupUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -13659,141 +13416,238 @@ type AccessGroupUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupUpdateParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupUpdateParamsRequireAccessCountryRule struct { - Geo param.Field[AccessGroupUpdateParamsRequireAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupNewParamsRequireAccessCountryRule struct { + Geo param.Field[AccessGroupNewParamsRequireAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupUpdateParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessCountryRule) implementsAccessGroupUpdateParamsRequire() {} +func (r AccessGroupNewParamsRequireAccessCountryRule) implementsAccessGroupNewParamsRequire() {} -type AccessGroupUpdateParamsRequireAccessCountryRuleGeo struct { +type AccessGroupNewParamsRequireAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupUpdateParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupUpdateParamsRequireAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupNewParamsRequireAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupNewParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupUpdateParamsRequireAccessAuthenticationMethodRule) implementsAccessGroupUpdateParamsRequire() { +func (r AccessGroupNewParamsRequireAccessAuthenticationMethodRule) implementsAccessGroupNewParamsRequire() { } -type AccessGroupUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupNewParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupUpdateParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupNewParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupUpdateParamsRequireAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupUpdateParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupNewParamsRequireAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupNewParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +} + +func (r AccessGroupNewParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r AccessGroupNewParamsRequireAccessDevicePostureRule) implementsAccessGroupNewParamsRequire() {} + +type AccessGroupNewParamsRequireAccessDevicePostureRuleDevicePosture struct { + // The ID of a device posture integration. + IntegrationUid param.Field[string] `json:"integration_uid,required"` +} + +func (r AccessGroupNewParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessGroupNewResponseEnvelope struct { + Errors []AccessGroupNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessGroupNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessGroupNewResponse `json:"result,required"` + // Whether the API call was successful + Success AccessGroupNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessGroupNewResponseEnvelopeJSON `json:"-"` +} + +// accessGroupNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessGroupNewResponseEnvelope] +type accessGroupNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessGroupNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessGroupNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessGroupNewResponseEnvelopeErrors] +type accessGroupNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccessGroupNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupNewResponseEnvelopeMessagesJSON `json:"-"` } -func (r AccessGroupUpdateParamsRequireAccessDevicePostureRule) implementsAccessGroupUpdateParamsRequire() { +// accessGroupNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessGroupNewResponseEnvelopeMessages] +type accessGroupNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccessGroupUpdateParamsRequireAccessDevicePostureRuleDevicePosture struct { - // The ID of a device posture integration. - IntegrationUid param.Field[string] `json:"integration_uid,required"` +func (r *AccessGroupNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccessGroupUpdateParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} +// Whether the API call was successful +type AccessGroupNewResponseEnvelopeSuccess bool + +const ( + AccessGroupNewResponseEnvelopeSuccessTrue AccessGroupNewResponseEnvelopeSuccess = true +) -type AccessGroupUpdateResponseEnvelope struct { - Errors []AccessGroupUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessGroupUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessGroupUpdateResponse `json:"result,required"` +type AccessGroupListResponseEnvelope struct { + Errors []AccessGroupListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessGroupListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessGroupListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessGroupUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessGroupUpdateResponseEnvelopeJSON `json:"-"` + Success AccessGroupListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessGroupListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessGroupListResponseEnvelopeJSON `json:"-"` } -// accessGroupUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessGroupUpdateResponseEnvelope] -type accessGroupUpdateResponseEnvelopeJSON struct { +// accessGroupListResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessGroupListResponseEnvelope] +type accessGroupListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessGroupListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupListResponseEnvelopeErrorsJSON `json:"-"` } -// accessGroupUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessGroupUpdateResponseEnvelopeErrors] -type accessGroupUpdateResponseEnvelopeErrorsJSON struct { +// accessGroupListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessGroupListResponseEnvelopeErrors] +type accessGroupListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessGroupListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupListResponseEnvelopeMessagesJSON `json:"-"` } -// accessGroupUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessGroupUpdateResponseEnvelopeMessages] -type accessGroupUpdateResponseEnvelopeMessagesJSON struct { +// accessGroupListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessGroupListResponseEnvelopeMessages] +type accessGroupListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessGroupUpdateResponseEnvelopeSuccess bool +type AccessGroupListResponseEnvelopeSuccess bool const ( - AccessGroupUpdateResponseEnvelopeSuccessTrue AccessGroupUpdateResponseEnvelopeSuccess = true + AccessGroupListResponseEnvelopeSuccessTrue AccessGroupListResponseEnvelopeSuccess = true ) +type AccessGroupListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessGroupListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessGroupListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [AccessGroupListResponseEnvelopeResultInfo] +type accessGroupListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AccessGroupDeleteResponseEnvelope struct { Errors []AccessGroupDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessGroupDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -13863,366 +13717,432 @@ const ( AccessGroupDeleteResponseEnvelopeSuccessTrue AccessGroupDeleteResponseEnvelopeSuccess = true ) -type AccessGroupAccessGroupsNewAnAccessGroupParams struct { +type AccessGroupGetResponseEnvelope struct { + Errors []AccessGroupGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessGroupGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessGroupGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessGroupGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessGroupGetResponseEnvelopeJSON `json:"-"` +} + +// accessGroupGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessGroupGetResponseEnvelope] +type accessGroupGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessGroupGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessGroupGetResponseEnvelopeErrors] +type accessGroupGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessGroupGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessGroupGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessGroupGetResponseEnvelopeMessages] +type accessGroupGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessGroupGetResponseEnvelopeSuccess bool + +const ( + AccessGroupGetResponseEnvelopeSuccessTrue AccessGroupGetResponseEnvelopeSuccess = true +) + +type AccessGroupReplaceParams struct { // Rules evaluated with an OR logical operator. A user needs to meet only one of // the Include rules. - Include param.Field[[]AccessGroupAccessGroupsNewAnAccessGroupParamsInclude] `json:"include,required"` + Include param.Field[[]AccessGroupReplaceParamsInclude] `json:"include,required"` // The name of the Access group. Name param.Field[string] `json:"name,required"` // Rules evaluated with a NOT logical operator. To match a policy, a user cannot // meet any of the Exclude rules. - Exclude param.Field[[]AccessGroupAccessGroupsNewAnAccessGroupParamsExclude] `json:"exclude"` + Exclude param.Field[[]AccessGroupReplaceParamsExclude] `json:"exclude"` // Whether this is the default group IsDefault param.Field[bool] `json:"is_default"` // Rules evaluated with an AND logical operator. To match a policy, a user must // meet all of the Require rules. - Require param.Field[[]AccessGroupAccessGroupsNewAnAccessGroupParamsRequire] `json:"require"` + Require param.Field[[]AccessGroupReplaceParamsRequire] `json:"require"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParams) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupParamsInclude interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() +// Satisfied by [AccessGroupReplaceParamsIncludeAccessEmailRule], +// [AccessGroupReplaceParamsIncludeAccessEmailListRule], +// [AccessGroupReplaceParamsIncludeAccessDomainRule], +// [AccessGroupReplaceParamsIncludeAccessEveryoneRule], +// [AccessGroupReplaceParamsIncludeAccessIPRule], +// [AccessGroupReplaceParamsIncludeAccessIPListRule], +// [AccessGroupReplaceParamsIncludeAccessCertificateRule], +// [AccessGroupReplaceParamsIncludeAccessAccessGroupRule], +// [AccessGroupReplaceParamsIncludeAccessAzureGroupRule], +// [AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRule], +// [AccessGroupReplaceParamsIncludeAccessGsuiteGroupRule], +// [AccessGroupReplaceParamsIncludeAccessOktaGroupRule], +// [AccessGroupReplaceParamsIncludeAccessSamlGroupRule], +// [AccessGroupReplaceParamsIncludeAccessServiceTokenRule], +// [AccessGroupReplaceParamsIncludeAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceParamsIncludeAccessExternalEvaluationRule], +// [AccessGroupReplaceParamsIncludeAccessCountryRule], +// [AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRule], +// [AccessGroupReplaceParamsIncludeAccessDevicePostureRule]. +type AccessGroupReplaceParamsInclude interface { + implementsAccessGroupReplaceParamsInclude() } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule struct { - Email param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupReplaceParamsIncludeAccessEmailRule struct { + Email param.Field[AccessGroupReplaceParamsIncludeAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { -} +func (r AccessGroupReplaceParamsIncludeAccessEmailRule) implementsAccessGroupReplaceParamsInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail struct { +type AccessGroupReplaceParamsIncludeAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRule struct { - EmailList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupReplaceParamsIncludeAccessEmailListRule struct { + EmailList param.Field[AccessGroupReplaceParamsIncludeAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessEmailListRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRuleEmailList struct { +type AccessGroupReplaceParamsIncludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRule struct { - EmailDomain param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupReplaceParamsIncludeAccessDomainRule struct { + EmailDomain param.Field[AccessGroupReplaceParamsIncludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessDomainRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceParamsIncludeAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEveryoneRule struct { +type AccessGroupReplaceParamsIncludeAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessEveryoneRule) implementsAccessGroupReplaceParamsInclude() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRule struct { - IP param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRuleIP] `json:"ip,required"` +type AccessGroupReplaceParamsIncludeAccessIPRule struct { + IP param.Field[AccessGroupReplaceParamsIncludeAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { -} +func (r AccessGroupReplaceParamsIncludeAccessIPRule) implementsAccessGroupReplaceParamsInclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRuleIP struct { +type AccessGroupReplaceParamsIncludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRule struct { - IPList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupReplaceParamsIncludeAccessIPListRule struct { + IPList param.Field[AccessGroupReplaceParamsIncludeAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessIPListRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRuleIPList struct { +type AccessGroupReplaceParamsIncludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCertificateRule struct { +type AccessGroupReplaceParamsIncludeAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessCertificateRule) implementsAccessGroupReplaceParamsInclude() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRule struct { - Group param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupReplaceParamsIncludeAccessAccessGroupRule struct { + Group param.Field[AccessGroupReplaceParamsIncludeAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessAccessGroupRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceParamsIncludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupReplaceParamsIncludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupReplaceParamsIncludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessAzureGroupRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceParamsIncludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupReplaceParamsIncludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupReplaceParamsIncludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessGsuiteGroupRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceParamsIncludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRule struct { - Okta param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupReplaceParamsIncludeAccessOktaGroupRule struct { + Okta param.Field[AccessGroupReplaceParamsIncludeAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessOktaGroupRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceParamsIncludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRule struct { - Saml param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupReplaceParamsIncludeAccessSamlGroupRule struct { + Saml param.Field[AccessGroupReplaceParamsIncludeAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessSamlGroupRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceParamsIncludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupReplaceParamsIncludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupReplaceParamsIncludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessServiceTokenRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceParamsIncludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceParamsIncludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceParamsInclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupReplaceParamsIncludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessExternalEvaluationRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -14230,413 +14150,410 @@ type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRule struct { - Geo param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupReplaceParamsIncludeAccessCountryRule struct { + Geo param.Field[AccessGroupReplaceParamsIncludeAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessCountryRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRuleGeo struct { +type AccessGroupReplaceParamsIncludeAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupReplaceParamsIncludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupReplaceParamsIncludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsInclude() { +func (r AccessGroupReplaceParamsIncludeAccessDevicePostureRule) implementsAccessGroupReplaceParamsInclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceParamsIncludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. IntegrationUid param.Field[string] `json:"integration_uid,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsIncludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExclude interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() +// Satisfied by [AccessGroupReplaceParamsExcludeAccessEmailRule], +// [AccessGroupReplaceParamsExcludeAccessEmailListRule], +// [AccessGroupReplaceParamsExcludeAccessDomainRule], +// [AccessGroupReplaceParamsExcludeAccessEveryoneRule], +// [AccessGroupReplaceParamsExcludeAccessIPRule], +// [AccessGroupReplaceParamsExcludeAccessIPListRule], +// [AccessGroupReplaceParamsExcludeAccessCertificateRule], +// [AccessGroupReplaceParamsExcludeAccessAccessGroupRule], +// [AccessGroupReplaceParamsExcludeAccessAzureGroupRule], +// [AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRule], +// [AccessGroupReplaceParamsExcludeAccessGsuiteGroupRule], +// [AccessGroupReplaceParamsExcludeAccessOktaGroupRule], +// [AccessGroupReplaceParamsExcludeAccessSamlGroupRule], +// [AccessGroupReplaceParamsExcludeAccessServiceTokenRule], +// [AccessGroupReplaceParamsExcludeAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceParamsExcludeAccessExternalEvaluationRule], +// [AccessGroupReplaceParamsExcludeAccessCountryRule], +// [AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRule], +// [AccessGroupReplaceParamsExcludeAccessDevicePostureRule]. +type AccessGroupReplaceParamsExclude interface { + implementsAccessGroupReplaceParamsExclude() } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule struct { - Email param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupReplaceParamsExcludeAccessEmailRule struct { + Email param.Field[AccessGroupReplaceParamsExcludeAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { -} +func (r AccessGroupReplaceParamsExcludeAccessEmailRule) implementsAccessGroupReplaceParamsExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail struct { +type AccessGroupReplaceParamsExcludeAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRule struct { - EmailList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupReplaceParamsExcludeAccessEmailListRule struct { + EmailList param.Field[AccessGroupReplaceParamsExcludeAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessEmailListRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRuleEmailList struct { +type AccessGroupReplaceParamsExcludeAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRule struct { - EmailDomain param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupReplaceParamsExcludeAccessDomainRule struct { + EmailDomain param.Field[AccessGroupReplaceParamsExcludeAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessDomainRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceParamsExcludeAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEveryoneRule struct { +type AccessGroupReplaceParamsExcludeAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessEveryoneRule) implementsAccessGroupReplaceParamsExclude() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRule struct { - IP param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRuleIP] `json:"ip,required"` +type AccessGroupReplaceParamsExcludeAccessIPRule struct { + IP param.Field[AccessGroupReplaceParamsExcludeAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { -} +func (r AccessGroupReplaceParamsExcludeAccessIPRule) implementsAccessGroupReplaceParamsExclude() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRuleIP struct { +type AccessGroupReplaceParamsExcludeAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRule struct { - IPList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupReplaceParamsExcludeAccessIPListRule struct { + IPList param.Field[AccessGroupReplaceParamsExcludeAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessIPListRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRuleIPList struct { +type AccessGroupReplaceParamsExcludeAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCertificateRule struct { +type AccessGroupReplaceParamsExcludeAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessCertificateRule) implementsAccessGroupReplaceParamsExclude() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRule struct { - Group param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupReplaceParamsExcludeAccessAccessGroupRule struct { + Group param.Field[AccessGroupReplaceParamsExcludeAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessAccessGroupRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceParamsExcludeAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupReplaceParamsExcludeAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupReplaceParamsExcludeAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessAzureGroupRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceParamsExcludeAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupReplaceParamsExcludeAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupReplaceParamsExcludeAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessGsuiteGroupRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceParamsExcludeAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRule struct { - Okta param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupReplaceParamsExcludeAccessOktaGroupRule struct { + Okta param.Field[AccessGroupReplaceParamsExcludeAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessOktaGroupRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceParamsExcludeAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRule struct { - Saml param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupReplaceParamsExcludeAccessSamlGroupRule struct { + Saml param.Field[AccessGroupReplaceParamsExcludeAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessSamlGroupRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceParamsExcludeAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupReplaceParamsExcludeAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupReplaceParamsExcludeAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessServiceTokenRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceParamsExcludeAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceParamsExcludeAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceParamsExclude() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupReplaceParamsExcludeAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessExternalEvaluationRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -14644,413 +14561,410 @@ type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRule struct { - Geo param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupReplaceParamsExcludeAccessCountryRule struct { + Geo param.Field[AccessGroupReplaceParamsExcludeAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessCountryRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRuleGeo struct { +type AccessGroupReplaceParamsExcludeAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupReplaceParamsExcludeAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupReplaceParamsExcludeAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsExclude() { +func (r AccessGroupReplaceParamsExcludeAccessDevicePostureRule) implementsAccessGroupReplaceParamsExclude() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceParamsExcludeAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. IntegrationUid param.Field[string] `json:"integration_uid,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsExcludeAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific email. // -// Satisfied by -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEveryoneRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCertificateRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAnyValidServiceTokenRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRule], -// [AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRule]. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequire interface { - implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() +// Satisfied by [AccessGroupReplaceParamsRequireAccessEmailRule], +// [AccessGroupReplaceParamsRequireAccessEmailListRule], +// [AccessGroupReplaceParamsRequireAccessDomainRule], +// [AccessGroupReplaceParamsRequireAccessEveryoneRule], +// [AccessGroupReplaceParamsRequireAccessIPRule], +// [AccessGroupReplaceParamsRequireAccessIPListRule], +// [AccessGroupReplaceParamsRequireAccessCertificateRule], +// [AccessGroupReplaceParamsRequireAccessAccessGroupRule], +// [AccessGroupReplaceParamsRequireAccessAzureGroupRule], +// [AccessGroupReplaceParamsRequireAccessGitHubOrganizationRule], +// [AccessGroupReplaceParamsRequireAccessGsuiteGroupRule], +// [AccessGroupReplaceParamsRequireAccessOktaGroupRule], +// [AccessGroupReplaceParamsRequireAccessSamlGroupRule], +// [AccessGroupReplaceParamsRequireAccessServiceTokenRule], +// [AccessGroupReplaceParamsRequireAccessAnyValidServiceTokenRule], +// [AccessGroupReplaceParamsRequireAccessExternalEvaluationRule], +// [AccessGroupReplaceParamsRequireAccessCountryRule], +// [AccessGroupReplaceParamsRequireAccessAuthenticationMethodRule], +// [AccessGroupReplaceParamsRequireAccessDevicePostureRule]. +type AccessGroupReplaceParamsRequire interface { + implementsAccessGroupReplaceParamsRequire() } // Matches a specific email. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule struct { - Email param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail] `json:"email,required"` +type AccessGroupReplaceParamsRequireAccessEmailRule struct { + Email param.Field[AccessGroupReplaceParamsRequireAccessEmailRuleEmail] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessEmailRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { -} +func (r AccessGroupReplaceParamsRequireAccessEmailRule) implementsAccessGroupReplaceParamsRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail struct { +type AccessGroupReplaceParamsRequireAccessEmailRuleEmail struct { // The email of the user. Email param.Field[string] `json:"email,required" format:"email"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessEmailRuleEmail) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an email address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRule struct { - EmailList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` +type AccessGroupReplaceParamsRequireAccessEmailListRule struct { + EmailList param.Field[AccessGroupReplaceParamsRequireAccessEmailListRuleEmailList] `json:"email_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessEmailListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessEmailListRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRuleEmailList struct { +type AccessGroupReplaceParamsRequireAccessEmailListRuleEmailList struct { // The ID of a previously created email list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessEmailListRuleEmailList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Match an entire email domain. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRule struct { - EmailDomain param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` +type AccessGroupReplaceParamsRequireAccessDomainRule struct { + EmailDomain param.Field[AccessGroupReplaceParamsRequireAccessDomainRuleEmailDomain] `json:"email_domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessDomainRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessDomainRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRuleEmailDomain struct { +type AccessGroupReplaceParamsRequireAccessDomainRuleEmailDomain struct { // The email domain to match. Domain param.Field[string] `json:"domain,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessDomainRuleEmailDomain) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches everyone. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEveryoneRule struct { +type AccessGroupReplaceParamsRequireAccessEveryoneRule struct { // An empty object which matches on all users. Everyone param.Field[interface{}] `json:"everyone,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessEveryoneRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEveryoneRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessEveryoneRule) implementsAccessGroupReplaceParamsRequire() { } // Matches an IP address block. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRule struct { - IP param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRuleIP] `json:"ip,required"` +type AccessGroupReplaceParamsRequireAccessIPRule struct { + IP param.Field[AccessGroupReplaceParamsRequireAccessIPRuleIP] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessIPRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { -} +func (r AccessGroupReplaceParamsRequireAccessIPRule) implementsAccessGroupReplaceParamsRequire() {} -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRuleIP struct { +type AccessGroupReplaceParamsRequireAccessIPRuleIP struct { // An IPv4 or IPv6 CIDR block. IP param.Field[string] `json:"ip,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessIPRuleIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an IP address from a list. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRule struct { - IPList param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` +type AccessGroupReplaceParamsRequireAccessIPListRule struct { + IPList param.Field[AccessGroupReplaceParamsRequireAccessIPListRuleIPList] `json:"ip_list,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessIPListRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessIPListRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRuleIPList struct { +type AccessGroupReplaceParamsRequireAccessIPListRuleIPList struct { // The ID of a previously created IP list. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessIPListRuleIPList) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid client certificate. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCertificateRule struct { +type AccessGroupReplaceParamsRequireAccessCertificateRule struct { Certificate param.Field[interface{}] `json:"certificate,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessCertificateRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCertificateRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessCertificateRule) implementsAccessGroupReplaceParamsRequire() { } // Matches an Access group. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRule struct { - Group param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` +type AccessGroupReplaceParamsRequireAccessAccessGroupRule struct { + Group param.Field[AccessGroupReplaceParamsRequireAccessAccessGroupRuleGroup] `json:"group,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAccessGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessAccessGroupRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRuleGroup struct { +type AccessGroupReplaceParamsRequireAccessAccessGroupRuleGroup struct { // The ID of a previously created Access group. ID param.Field[string] `json:"id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAccessGroupRuleGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Azure group. Requires an Azure identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRule struct { - AzureAd param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` +type AccessGroupReplaceParamsRequireAccessAzureGroupRule struct { + AzureAd param.Field[AccessGroupReplaceParamsRequireAccessAzureGroupRuleAzureAd] `json:"azureAD,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAzureGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessAzureGroupRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRuleAzureAd struct { +type AccessGroupReplaceParamsRequireAccessAzureGroupRuleAzureAd struct { // The ID of an Azure group. ID param.Field[string] `json:"id,required"` // The ID of your Azure identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAzureGroupRuleAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a Github organization. Requires a Github identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRule struct { - GitHubOrganization param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` +type AccessGroupReplaceParamsRequireAccessGitHubOrganizationRule struct { + GitHubOrganization param.Field[AccessGroupReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization] `json:"github-organization,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessGitHubOrganizationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessGitHubOrganizationRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { +type AccessGroupReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization struct { // The ID of your Github identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The name of the organization. Name param.Field[string] `json:"name,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessGitHubOrganizationRuleGitHubOrganization) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a group in Google Workspace. Requires a Google Workspace identity // provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRule struct { - Gsuite param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` +type AccessGroupReplaceParamsRequireAccessGsuiteGroupRule struct { + Gsuite param.Field[AccessGroupReplaceParamsRequireAccessGsuiteGroupRuleGsuite] `json:"gsuite,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessGsuiteGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessGsuiteGroupRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRuleGsuite struct { +type AccessGroupReplaceParamsRequireAccessGsuiteGroupRuleGsuite struct { // The ID of your Google Workspace identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Google Workspace group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessGsuiteGroupRuleGsuite) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches an Okta group. Requires an Okta identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRule struct { - Okta param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` +type AccessGroupReplaceParamsRequireAccessOktaGroupRule struct { + Okta param.Field[AccessGroupReplaceParamsRequireAccessOktaGroupRuleOkta] `json:"okta,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessOktaGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessOktaGroupRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRuleOkta struct { +type AccessGroupReplaceParamsRequireAccessOktaGroupRuleOkta struct { // The ID of your Okta identity provider. ConnectionID param.Field[string] `json:"connection_id,required"` // The email of the Okta group. Email param.Field[string] `json:"email,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessOktaGroupRuleOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a SAML group. Requires a SAML identity provider. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRule struct { - Saml param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` +type AccessGroupReplaceParamsRequireAccessSamlGroupRule struct { + Saml param.Field[AccessGroupReplaceParamsRequireAccessSamlGroupRuleSaml] `json:"saml,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessSamlGroupRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessSamlGroupRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRuleSaml struct { +type AccessGroupReplaceParamsRequireAccessSamlGroupRuleSaml struct { // The name of the SAML attribute. AttributeName param.Field[string] `json:"attribute_name,required"` // The SAML attribute value to look for. AttributeValue param.Field[string] `json:"attribute_value,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessSamlGroupRuleSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRule struct { - ServiceToken param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` +type AccessGroupReplaceParamsRequireAccessServiceTokenRule struct { + ServiceToken param.Field[AccessGroupReplaceParamsRequireAccessServiceTokenRuleServiceToken] `json:"service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessServiceTokenRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRuleServiceToken struct { +type AccessGroupReplaceParamsRequireAccessServiceTokenRuleServiceToken struct { // The ID of a Service Token. TokenID param.Field[string] `json:"token_id,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessServiceTokenRuleServiceToken) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches any valid Access Service Token -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAnyValidServiceTokenRule struct { +type AccessGroupReplaceParamsRequireAccessAnyValidServiceTokenRule struct { // An empty object which matches on all service tokens. AnyValidServiceToken param.Field[interface{}] `json:"any_valid_service_token,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAnyValidServiceTokenRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAnyValidServiceTokenRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessAnyValidServiceTokenRule) implementsAccessGroupReplaceParamsRequire() { } // Create Allow or Block policies which evaluate the user based on custom criteria. -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRule struct { - ExternalEvaluation param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` +type AccessGroupReplaceParamsRequireAccessExternalEvaluationRule struct { + ExternalEvaluation param.Field[AccessGroupReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation] `json:"external_evaluation,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessExternalEvaluationRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessExternalEvaluationRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { +type AccessGroupReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation struct { // The API endpoint containing your business logic. EvaluateURL param.Field[string] `json:"evaluate_url,required"` // The API endpoint containing the key that Access uses to verify that the response @@ -15058,259 +14972,85 @@ type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluatio KeysURL param.Field[string] `json:"keys_url,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessExternalEvaluationRuleExternalEvaluation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Matches a specific country -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRule struct { - Geo param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRuleGeo] `json:"geo,required"` +type AccessGroupReplaceParamsRequireAccessCountryRule struct { + Geo param.Field[AccessGroupReplaceParamsRequireAccessCountryRuleGeo] `json:"geo,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessCountryRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessCountryRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRuleGeo struct { +type AccessGroupReplaceParamsRequireAccessCountryRuleGeo struct { // The country code that should be matched. CountryCode param.Field[string] `json:"country_code,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessCountryRuleGeo) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforce different MFA options -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRule struct { - AuthMethod param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` +type AccessGroupReplaceParamsRequireAccessAuthenticationMethodRule struct { + AuthMethod param.Field[AccessGroupReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAuthenticationMethodRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessAuthenticationMethodRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { +type AccessGroupReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod struct { // The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. AuthMethod param.Field[string] `json:"auth_method,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessAuthenticationMethodRuleAuthMethod) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enforces a device posture rule has run successfully -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRule struct { - DevicePosture param.Field[AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` +type AccessGroupReplaceParamsRequireAccessDevicePostureRule struct { + DevicePosture param.Field[AccessGroupReplaceParamsRequireAccessDevicePostureRuleDevicePosture] `json:"device_posture,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessDevicePostureRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRule) implementsAccessGroupAccessGroupsNewAnAccessGroupParamsRequire() { +func (r AccessGroupReplaceParamsRequireAccessDevicePostureRule) implementsAccessGroupReplaceParamsRequire() { } -type AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRuleDevicePosture struct { +type AccessGroupReplaceParamsRequireAccessDevicePostureRuleDevicePosture struct { // The ID of a device posture integration. IntegrationUid param.Field[string] `json:"integration_uid,required"` } -func (r AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { +func (r AccessGroupReplaceParamsRequireAccessDevicePostureRuleDevicePosture) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelope struct { - Errors []AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessages `json:"messages,required"` - Result AccessGroupAccessGroupsNewAnAccessGroupResponse `json:"result,required"` - // Whether the API call was successful - Success AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeSuccess `json:"success,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeJSON `json:"-"` -} - -// accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelope] -type accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrors] -type accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessages] -type accessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeSuccess bool - -const ( - AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeSuccessTrue AccessGroupAccessGroupsNewAnAccessGroupResponseEnvelopeSuccess = true -) - -type AccessGroupAccessGroupsListAccessGroupsResponseEnvelope struct { - Errors []AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessages `json:"messages,required"` - Result []AccessGroupAccessGroupsListAccessGroupsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfo `json:"result_info"` - JSON accessGroupAccessGroupsListAccessGroupsResponseEnvelopeJSON `json:"-"` -} - -// accessGroupAccessGroupsListAccessGroupsResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseEnvelope] -type accessGroupAccessGroupsListAccessGroupsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsListAccessGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrors] -type accessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessages] -type accessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeSuccess bool - -const ( - AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeSuccessTrue AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeSuccess = true -) - -type AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfo] -type accessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessGroupAccessGroupsListAccessGroupsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessGroupGetResponseEnvelope struct { - Errors []AccessGroupGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessGroupGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessGroupGetResponse `json:"result,required"` +type AccessGroupReplaceResponseEnvelope struct { + Errors []AccessGroupReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessGroupReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessGroupReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessGroupGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessGroupGetResponseEnvelopeJSON `json:"-"` + Success AccessGroupReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessGroupReplaceResponseEnvelopeJSON `json:"-"` } -// accessGroupGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccessGroupGetResponseEnvelope] -type accessGroupGetResponseEnvelopeJSON struct { +// accessGroupReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessGroupReplaceResponseEnvelope] +type accessGroupReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -15319,51 +15059,51 @@ type accessGroupGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupGetResponseEnvelopeErrorsJSON `json:"-"` +type AccessGroupReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccessGroupGetResponseEnvelopeErrors] -type accessGroupGetResponseEnvelopeErrorsJSON struct { +// accessGroupReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessGroupReplaceResponseEnvelopeErrors] +type accessGroupReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessGroupGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessGroupGetResponseEnvelopeMessagesJSON `json:"-"` +type AccessGroupReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessGroupReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessGroupGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccessGroupGetResponseEnvelopeMessages] -type accessGroupGetResponseEnvelopeMessagesJSON struct { +// accessGroupReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessGroupReplaceResponseEnvelopeMessages] +type accessGroupReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessGroupReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessGroupGetResponseEnvelopeSuccess bool +type AccessGroupReplaceResponseEnvelopeSuccess bool const ( - AccessGroupGetResponseEnvelopeSuccessTrue AccessGroupGetResponseEnvelopeSuccess = true + AccessGroupReplaceResponseEnvelopeSuccessTrue AccessGroupReplaceResponseEnvelopeSuccess = true ) diff --git a/accessgroup_test.go b/accessgroup_test.go index e8bc0d929b6..b8da45ba73a 100644 --- a/accessgroup_test.go +++ b/accessgroup_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessGroupUpdateWithOptionalParams(t *testing.T) { +func TestAccessGroupNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,50 +29,49 @@ func TestAccessGroupUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Groups.Update( + _, err := client.Access.Groups.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessGroupUpdateParams{ - Include: cloudflare.F([]cloudflare.AccessGroupUpdateParamsInclude{cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRuleEmail{ + cloudflare.AccessGroupNewParams{ + Include: cloudflare.F([]cloudflare.AccessGroupNewParamsInclude{cloudflare.AccessGroupNewParamsIncludeAccessEmailRule(cloudflare.AccessGroupNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsIncludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsIncludeAccessEmailRule(cloudflare.AccessGroupNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsIncludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsIncludeAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsIncludeAccessEmailRule(cloudflare.AccessGroupNewParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsIncludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), })}), Name: cloudflare.F("Allow devs"), - Exclude: cloudflare.F([]cloudflare.AccessGroupUpdateParamsExclude{cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRuleEmail{ + Exclude: cloudflare.F([]cloudflare.AccessGroupNewParamsExclude{cloudflare.AccessGroupNewParamsExcludeAccessEmailRule(cloudflare.AccessGroupNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsExcludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsExcludeAccessEmailRule(cloudflare.AccessGroupNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsExcludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsExcludeAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsExcludeAccessEmailRule(cloudflare.AccessGroupNewParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsExcludeAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), })}), IsDefault: cloudflare.F(true), - Require: cloudflare.F([]cloudflare.AccessGroupUpdateParamsRequire{cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRuleEmail{ + Require: cloudflare.F([]cloudflare.AccessGroupNewParamsRequire{cloudflare.AccessGroupNewParamsRequireAccessEmailRule(cloudflare.AccessGroupNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsRequireAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsRequireAccessEmailRule(cloudflare.AccessGroupNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsRequireAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), - }), cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupUpdateParamsRequireAccessEmailRuleEmail{ + }), cloudflare.AccessGroupNewParamsRequireAccessEmailRule(cloudflare.AccessGroupNewParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupNewParamsRequireAccessEmailRuleEmail{ Email: cloudflare.F("test@example.com"), }), })}), @@ -87,7 +86,7 @@ func TestAccessGroupUpdateWithOptionalParams(t *testing.T) { } } -func TestAccessGroupDelete(t *testing.T) { +func TestAccessGroupList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -103,11 +102,10 @@ func TestAccessGroupDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Groups.Delete( + _, err := client.Access.Groups.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -118,7 +116,7 @@ func TestAccessGroupDelete(t *testing.T) { } } -func TestAccessGroupAccessGroupsNewAnAccessGroupWithOptionalParams(t *testing.T) { +func TestAccessGroupDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -134,53 +132,11 @@ func TestAccessGroupAccessGroupsNewAnAccessGroupWithOptionalParams(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Groups.AccessGroupsNewAnAccessGroup( + _, err := client.Access.Groups.Delete( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParams{ - Include: cloudflare.F([]cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsInclude{cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsIncludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - Name: cloudflare.F("Allow devs"), - Exclude: cloudflare.F([]cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExclude{cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsExcludeAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - IsDefault: cloudflare.F(true), - Require: cloudflare.F([]cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequire{cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - }), cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRule{ - Email: cloudflare.F(cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParamsRequireAccessEmailRuleEmail{ - Email: cloudflare.F("test@example.com"), - }), - })}), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -191,7 +147,7 @@ func TestAccessGroupAccessGroupsNewAnAccessGroupWithOptionalParams(t *testing.T) } } -func TestAccessGroupAccessGroupsListAccessGroups(t *testing.T) { +func TestAccessGroupGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -207,10 +163,11 @@ func TestAccessGroupAccessGroupsListAccessGroups(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Groups.AccessGroupsListAccessGroups( + _, err := client.Access.Groups.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -221,7 +178,7 @@ func TestAccessGroupAccessGroupsListAccessGroups(t *testing.T) { } } -func TestAccessGroupGet(t *testing.T) { +func TestAccessGroupReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -237,11 +194,54 @@ func TestAccessGroupGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Groups.Get( + _, err := client.Access.Groups.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessGroupReplaceParams{ + Include: cloudflare.F([]cloudflare.AccessGroupReplaceParamsInclude{cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsIncludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + Name: cloudflare.F("Allow devs"), + Exclude: cloudflare.F([]cloudflare.AccessGroupReplaceParamsExclude{cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsExcludeAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + IsDefault: cloudflare.F(true), + Require: cloudflare.F([]cloudflare.AccessGroupReplaceParamsRequire{cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + }), cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRule{ + Email: cloudflare.F(cloudflare.AccessGroupReplaceParamsRequireAccessEmailRuleEmail{ + Email: cloudflare.F("test@example.com"), + }), + })}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/accessidentityprovider.go b/accessidentityprovider.go index 4bf2ad8f4ac..d2ab5f12729 100644 --- a/accessidentityprovider.go +++ b/accessidentityprovider.go @@ -32,12 +32,12 @@ func NewAccessIdentityProviderService(opts ...option.RequestOption) (r *AccessId return } -// Updates a configured identity provider. -func (r *AccessIdentityProviderService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessIdentityProviderUpdateParams, opts ...option.RequestOption) (res *AccessIdentityProviderUpdateResponse, err error) { +// Adds a new identity provider to Access. +func (r *AccessIdentityProviderService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessIdentityProviderNewParams, opts ...option.RequestOption) (res *AccessIdentityProviderNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessIdentityProviderUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/identity_providers/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AccessIdentityProviderNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/identity_providers", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *AccessIdentityProviderService) Update(ctx context.Context, accountOrZon return } -// Deletes an identity provider from Access. -func (r *AccessIdentityProviderService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessIdentityProviderDeleteResponse, err error) { +// Lists all configured identity providers. +func (r *AccessIdentityProviderService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessIdentityProviderListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessIdentityProviderDeleteResponseEnvelope - path := fmt.Sprintf("%s/%s/access/identity_providers/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env AccessIdentityProviderListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/identity_providers", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,12 +58,12 @@ func (r *AccessIdentityProviderService) Delete(ctx context.Context, accountOrZon return } -// Adds a new identity provider to Access. -func (r *AccessIdentityProviderService) AccessIdentityProvidersAddAnAccessIdentityProvider(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams, opts ...option.RequestOption) (res *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse, err error) { +// Deletes an identity provider from Access. +func (r *AccessIdentityProviderService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessIdentityProviderDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelope - path := fmt.Sprintf("%s/%s/access/identity_providers", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AccessIdentityProviderDeleteResponseEnvelope + path := fmt.Sprintf("%s/%s/access/identity_providers/%s", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -71,11 +71,11 @@ func (r *AccessIdentityProviderService) AccessIdentityProvidersAddAnAccessIdenti return } -// Lists all configured identity providers. -func (r *AccessIdentityProviderService) AccessIdentityProvidersListAccessIdentityProviders(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse, err error) { +// Fetches a configured identity provider. +func (r *AccessIdentityProviderService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessIdentityProviderGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelope - path := fmt.Sprintf("%s/%s/access/identity_providers", accountOrZone, accountOrZoneID) + var env AccessIdentityProviderGetResponseEnvelope + path := fmt.Sprintf("%s/%s/access/identity_providers/%s", accountOrZone, accountOrZoneID, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -84,12 +84,12 @@ func (r *AccessIdentityProviderService) AccessIdentityProvidersListAccessIdentit return } -// Fetches a configured identity provider. -func (r *AccessIdentityProviderService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, opts ...option.RequestOption) (res *AccessIdentityProviderGetResponse, err error) { +// Updates a configured identity provider. +func (r *AccessIdentityProviderService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessIdentityProviderReplaceParams, opts ...option.RequestOption) (res *AccessIdentityProviderReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessIdentityProviderGetResponseEnvelope + var env AccessIdentityProviderReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/identity_providers/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -97,50 +97,50 @@ func (r *AccessIdentityProviderService) Get(ctx context.Context, accountOrZone s return } -// Union satisfied by [AccessIdentityProviderUpdateResponseAccessAzureAd], -// [AccessIdentityProviderUpdateResponseAccessCentrify], -// [AccessIdentityProviderUpdateResponseAccessFacebook], -// [AccessIdentityProviderUpdateResponseAccessGitHub], -// [AccessIdentityProviderUpdateResponseAccessGoogle], -// [AccessIdentityProviderUpdateResponseAccessGoogleApps], -// [AccessIdentityProviderUpdateResponseAccessLinkedin], -// [AccessIdentityProviderUpdateResponseAccessOidc], -// [AccessIdentityProviderUpdateResponseAccessOkta], -// [AccessIdentityProviderUpdateResponseAccessOnelogin], -// [AccessIdentityProviderUpdateResponseAccessPingone], -// [AccessIdentityProviderUpdateResponseAccessSaml], -// [AccessIdentityProviderUpdateResponseAccessYandex] or -// [AccessIdentityProviderUpdateResponseAccessOnetimepin]. -type AccessIdentityProviderUpdateResponse interface { - implementsAccessIdentityProviderUpdateResponse() +// Union satisfied by [AccessIdentityProviderNewResponseAccessAzureAd], +// [AccessIdentityProviderNewResponseAccessCentrify], +// [AccessIdentityProviderNewResponseAccessFacebook], +// [AccessIdentityProviderNewResponseAccessGitHub], +// [AccessIdentityProviderNewResponseAccessGoogle], +// [AccessIdentityProviderNewResponseAccessGoogleApps], +// [AccessIdentityProviderNewResponseAccessLinkedin], +// [AccessIdentityProviderNewResponseAccessOidc], +// [AccessIdentityProviderNewResponseAccessOkta], +// [AccessIdentityProviderNewResponseAccessOnelogin], +// [AccessIdentityProviderNewResponseAccessPingone], +// [AccessIdentityProviderNewResponseAccessSaml], +// [AccessIdentityProviderNewResponseAccessYandex] or +// [AccessIdentityProviderNewResponseAccessOnetimepin]. +type AccessIdentityProviderNewResponse interface { + implementsAccessIdentityProviderNewResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderUpdateResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderNewResponse)(nil)).Elem(), "") } -type AccessIdentityProviderUpdateResponseAccessAzureAd struct { +type AccessIdentityProviderNewResponseAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessAzureAdConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessAzureAdConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessAzureAdType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessAzureAdType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessAzureAdScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessAzureAdJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessAzureAdScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessAzureAdJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessAzureAdJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessAzureAd] -type accessIdentityProviderUpdateResponseAccessAzureAdJSON struct { +// accessIdentityProviderNewResponseAccessAzureAdJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessAzureAd] +type accessIdentityProviderNewResponseAccessAzureAdJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -150,17 +150,17 @@ type accessIdentityProviderUpdateResponseAccessAzureAdJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessAzureAd) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessAzureAd) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessAzureAdConfig struct { +type AccessIdentityProviderNewResponseAccessAzureAdConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -174,14 +174,13 @@ type AccessIdentityProviderUpdateResponseAccessAzureAdConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Should Cloudflare try to load groups from your account - SupportGroups bool `json:"support_groups"` - JSON accessIdentityProviderUpdateResponseAccessAzureAdConfigJSON `json:"-"` + SupportGroups bool `json:"support_groups"` + JSON accessIdentityProviderNewResponseAccessAzureAdConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessAzureAdConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessAzureAdConfig] -type accessIdentityProviderUpdateResponseAccessAzureAdConfigJSON struct { +// accessIdentityProviderNewResponseAccessAzureAdConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessAzureAdConfig] +type accessIdentityProviderNewResponseAccessAzureAdConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -193,35 +192,35 @@ type accessIdentityProviderUpdateResponseAccessAzureAdConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessAzureAdType string +type AccessIdentityProviderNewResponseAccessAzureAdType string const ( - AccessIdentityProviderUpdateResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderUpdateResponseAccessAzureAdType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeAzureAd AccessIdentityProviderUpdateResponseAccessAzureAdType = "azureAD" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeSaml AccessIdentityProviderUpdateResponseAccessAzureAdType = "saml" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeCentrify AccessIdentityProviderUpdateResponseAccessAzureAdType = "centrify" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeFacebook AccessIdentityProviderUpdateResponseAccessAzureAdType = "facebook" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeGitHub AccessIdentityProviderUpdateResponseAccessAzureAdType = "github" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderUpdateResponseAccessAzureAdType = "google-apps" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeGoogle AccessIdentityProviderUpdateResponseAccessAzureAdType = "google" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeLinkedin AccessIdentityProviderUpdateResponseAccessAzureAdType = "linkedin" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeOidc AccessIdentityProviderUpdateResponseAccessAzureAdType = "oidc" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeOkta AccessIdentityProviderUpdateResponseAccessAzureAdType = "okta" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeOnelogin AccessIdentityProviderUpdateResponseAccessAzureAdType = "onelogin" - AccessIdentityProviderUpdateResponseAccessAzureAdTypePingone AccessIdentityProviderUpdateResponseAccessAzureAdType = "pingone" - AccessIdentityProviderUpdateResponseAccessAzureAdTypeYandex AccessIdentityProviderUpdateResponseAccessAzureAdType = "yandex" + AccessIdentityProviderNewResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderNewResponseAccessAzureAdType = "onetimepin" + AccessIdentityProviderNewResponseAccessAzureAdTypeAzureAd AccessIdentityProviderNewResponseAccessAzureAdType = "azureAD" + AccessIdentityProviderNewResponseAccessAzureAdTypeSaml AccessIdentityProviderNewResponseAccessAzureAdType = "saml" + AccessIdentityProviderNewResponseAccessAzureAdTypeCentrify AccessIdentityProviderNewResponseAccessAzureAdType = "centrify" + AccessIdentityProviderNewResponseAccessAzureAdTypeFacebook AccessIdentityProviderNewResponseAccessAzureAdType = "facebook" + AccessIdentityProviderNewResponseAccessAzureAdTypeGitHub AccessIdentityProviderNewResponseAccessAzureAdType = "github" + AccessIdentityProviderNewResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderNewResponseAccessAzureAdType = "google-apps" + AccessIdentityProviderNewResponseAccessAzureAdTypeGoogle AccessIdentityProviderNewResponseAccessAzureAdType = "google" + AccessIdentityProviderNewResponseAccessAzureAdTypeLinkedin AccessIdentityProviderNewResponseAccessAzureAdType = "linkedin" + AccessIdentityProviderNewResponseAccessAzureAdTypeOidc AccessIdentityProviderNewResponseAccessAzureAdType = "oidc" + AccessIdentityProviderNewResponseAccessAzureAdTypeOkta AccessIdentityProviderNewResponseAccessAzureAdType = "okta" + AccessIdentityProviderNewResponseAccessAzureAdTypeOnelogin AccessIdentityProviderNewResponseAccessAzureAdType = "onelogin" + AccessIdentityProviderNewResponseAccessAzureAdTypePingone AccessIdentityProviderNewResponseAccessAzureAdType = "pingone" + AccessIdentityProviderNewResponseAccessAzureAdTypeYandex AccessIdentityProviderNewResponseAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessAzureAdScimConfig struct { +type AccessIdentityProviderNewResponseAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -238,14 +237,14 @@ type AccessIdentityProviderUpdateResponseAccessAzureAdScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessAzureAdScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessAzureAdScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessAzureAdScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessAzureAdScimConfig] -type accessIdentityProviderUpdateResponseAccessAzureAdScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessAzureAdScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessAzureAdScimConfig] +type accessIdentityProviderNewResponseAccessAzureAdScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -255,32 +254,32 @@ type accessIdentityProviderUpdateResponseAccessAzureAdScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessCentrify struct { +type AccessIdentityProviderNewResponseAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessCentrifyConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessCentrifyConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessCentrifyType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessCentrifyType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessCentrifyScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessCentrifyJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessCentrifyScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessCentrifyJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessCentrifyJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessCentrify] -type accessIdentityProviderUpdateResponseAccessCentrifyJSON struct { +// accessIdentityProviderNewResponseAccessCentrifyJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessCentrify] +type accessIdentityProviderNewResponseAccessCentrifyJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -290,17 +289,17 @@ type accessIdentityProviderUpdateResponseAccessCentrifyJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessCentrify) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessCentrify) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessCentrifyConfig struct { +type AccessIdentityProviderNewResponseAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount string `json:"centrify_account"` // Your centrify app id @@ -312,14 +311,13 @@ type AccessIdentityProviderUpdateResponseAccessCentrifyConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderUpdateResponseAccessCentrifyConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderNewResponseAccessCentrifyConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessCentrifyConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessCentrifyConfig] -type accessIdentityProviderUpdateResponseAccessCentrifyConfigJSON struct { +// accessIdentityProviderNewResponseAccessCentrifyConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessCentrifyConfig] +type accessIdentityProviderNewResponseAccessCentrifyConfigJSON struct { CentrifyAccount apijson.Field CentrifyAppID apijson.Field Claims apijson.Field @@ -330,35 +328,35 @@ type accessIdentityProviderUpdateResponseAccessCentrifyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessCentrifyType string +type AccessIdentityProviderNewResponseAccessCentrifyType string const ( - AccessIdentityProviderUpdateResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderUpdateResponseAccessCentrifyType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeAzureAd AccessIdentityProviderUpdateResponseAccessCentrifyType = "azureAD" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeSaml AccessIdentityProviderUpdateResponseAccessCentrifyType = "saml" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeCentrify AccessIdentityProviderUpdateResponseAccessCentrifyType = "centrify" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeFacebook AccessIdentityProviderUpdateResponseAccessCentrifyType = "facebook" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeGitHub AccessIdentityProviderUpdateResponseAccessCentrifyType = "github" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderUpdateResponseAccessCentrifyType = "google-apps" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeGoogle AccessIdentityProviderUpdateResponseAccessCentrifyType = "google" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeLinkedin AccessIdentityProviderUpdateResponseAccessCentrifyType = "linkedin" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeOidc AccessIdentityProviderUpdateResponseAccessCentrifyType = "oidc" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeOkta AccessIdentityProviderUpdateResponseAccessCentrifyType = "okta" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeOnelogin AccessIdentityProviderUpdateResponseAccessCentrifyType = "onelogin" - AccessIdentityProviderUpdateResponseAccessCentrifyTypePingone AccessIdentityProviderUpdateResponseAccessCentrifyType = "pingone" - AccessIdentityProviderUpdateResponseAccessCentrifyTypeYandex AccessIdentityProviderUpdateResponseAccessCentrifyType = "yandex" + AccessIdentityProviderNewResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderNewResponseAccessCentrifyType = "onetimepin" + AccessIdentityProviderNewResponseAccessCentrifyTypeAzureAd AccessIdentityProviderNewResponseAccessCentrifyType = "azureAD" + AccessIdentityProviderNewResponseAccessCentrifyTypeSaml AccessIdentityProviderNewResponseAccessCentrifyType = "saml" + AccessIdentityProviderNewResponseAccessCentrifyTypeCentrify AccessIdentityProviderNewResponseAccessCentrifyType = "centrify" + AccessIdentityProviderNewResponseAccessCentrifyTypeFacebook AccessIdentityProviderNewResponseAccessCentrifyType = "facebook" + AccessIdentityProviderNewResponseAccessCentrifyTypeGitHub AccessIdentityProviderNewResponseAccessCentrifyType = "github" + AccessIdentityProviderNewResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderNewResponseAccessCentrifyType = "google-apps" + AccessIdentityProviderNewResponseAccessCentrifyTypeGoogle AccessIdentityProviderNewResponseAccessCentrifyType = "google" + AccessIdentityProviderNewResponseAccessCentrifyTypeLinkedin AccessIdentityProviderNewResponseAccessCentrifyType = "linkedin" + AccessIdentityProviderNewResponseAccessCentrifyTypeOidc AccessIdentityProviderNewResponseAccessCentrifyType = "oidc" + AccessIdentityProviderNewResponseAccessCentrifyTypeOkta AccessIdentityProviderNewResponseAccessCentrifyType = "okta" + AccessIdentityProviderNewResponseAccessCentrifyTypeOnelogin AccessIdentityProviderNewResponseAccessCentrifyType = "onelogin" + AccessIdentityProviderNewResponseAccessCentrifyTypePingone AccessIdentityProviderNewResponseAccessCentrifyType = "pingone" + AccessIdentityProviderNewResponseAccessCentrifyTypeYandex AccessIdentityProviderNewResponseAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessCentrifyScimConfig struct { +type AccessIdentityProviderNewResponseAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -375,14 +373,14 @@ type AccessIdentityProviderUpdateResponseAccessCentrifyScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessCentrifyScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessCentrifyScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessCentrifyScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessCentrifyScimConfig] -type accessIdentityProviderUpdateResponseAccessCentrifyScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessCentrifyScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessCentrifyScimConfig] +type accessIdentityProviderNewResponseAccessCentrifyScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -392,32 +390,32 @@ type accessIdentityProviderUpdateResponseAccessCentrifyScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessFacebook struct { +type AccessIdentityProviderNewResponseAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessFacebookConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessFacebookConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessFacebookType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessFacebookType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessFacebookScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessFacebookJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessFacebookScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessFacebookJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessFacebookJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessFacebook] -type accessIdentityProviderUpdateResponseAccessFacebookJSON struct { +// accessIdentityProviderNewResponseAccessFacebookJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessFacebook] +type accessIdentityProviderNewResponseAccessFacebookJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -427,63 +425,62 @@ type accessIdentityProviderUpdateResponseAccessFacebookJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessFacebook) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessFacebook) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessFacebookConfig struct { +type AccessIdentityProviderNewResponseAccessFacebookConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderUpdateResponseAccessFacebookConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderNewResponseAccessFacebookConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessFacebookConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessFacebookConfig] -type accessIdentityProviderUpdateResponseAccessFacebookConfigJSON struct { +// accessIdentityProviderNewResponseAccessFacebookConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessFacebookConfig] +type accessIdentityProviderNewResponseAccessFacebookConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessFacebookType string +type AccessIdentityProviderNewResponseAccessFacebookType string const ( - AccessIdentityProviderUpdateResponseAccessFacebookTypeOnetimepin AccessIdentityProviderUpdateResponseAccessFacebookType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessFacebookTypeAzureAd AccessIdentityProviderUpdateResponseAccessFacebookType = "azureAD" - AccessIdentityProviderUpdateResponseAccessFacebookTypeSaml AccessIdentityProviderUpdateResponseAccessFacebookType = "saml" - AccessIdentityProviderUpdateResponseAccessFacebookTypeCentrify AccessIdentityProviderUpdateResponseAccessFacebookType = "centrify" - AccessIdentityProviderUpdateResponseAccessFacebookTypeFacebook AccessIdentityProviderUpdateResponseAccessFacebookType = "facebook" - AccessIdentityProviderUpdateResponseAccessFacebookTypeGitHub AccessIdentityProviderUpdateResponseAccessFacebookType = "github" - AccessIdentityProviderUpdateResponseAccessFacebookTypeGoogleApps AccessIdentityProviderUpdateResponseAccessFacebookType = "google-apps" - AccessIdentityProviderUpdateResponseAccessFacebookTypeGoogle AccessIdentityProviderUpdateResponseAccessFacebookType = "google" - AccessIdentityProviderUpdateResponseAccessFacebookTypeLinkedin AccessIdentityProviderUpdateResponseAccessFacebookType = "linkedin" - AccessIdentityProviderUpdateResponseAccessFacebookTypeOidc AccessIdentityProviderUpdateResponseAccessFacebookType = "oidc" - AccessIdentityProviderUpdateResponseAccessFacebookTypeOkta AccessIdentityProviderUpdateResponseAccessFacebookType = "okta" - AccessIdentityProviderUpdateResponseAccessFacebookTypeOnelogin AccessIdentityProviderUpdateResponseAccessFacebookType = "onelogin" - AccessIdentityProviderUpdateResponseAccessFacebookTypePingone AccessIdentityProviderUpdateResponseAccessFacebookType = "pingone" - AccessIdentityProviderUpdateResponseAccessFacebookTypeYandex AccessIdentityProviderUpdateResponseAccessFacebookType = "yandex" + AccessIdentityProviderNewResponseAccessFacebookTypeOnetimepin AccessIdentityProviderNewResponseAccessFacebookType = "onetimepin" + AccessIdentityProviderNewResponseAccessFacebookTypeAzureAd AccessIdentityProviderNewResponseAccessFacebookType = "azureAD" + AccessIdentityProviderNewResponseAccessFacebookTypeSaml AccessIdentityProviderNewResponseAccessFacebookType = "saml" + AccessIdentityProviderNewResponseAccessFacebookTypeCentrify AccessIdentityProviderNewResponseAccessFacebookType = "centrify" + AccessIdentityProviderNewResponseAccessFacebookTypeFacebook AccessIdentityProviderNewResponseAccessFacebookType = "facebook" + AccessIdentityProviderNewResponseAccessFacebookTypeGitHub AccessIdentityProviderNewResponseAccessFacebookType = "github" + AccessIdentityProviderNewResponseAccessFacebookTypeGoogleApps AccessIdentityProviderNewResponseAccessFacebookType = "google-apps" + AccessIdentityProviderNewResponseAccessFacebookTypeGoogle AccessIdentityProviderNewResponseAccessFacebookType = "google" + AccessIdentityProviderNewResponseAccessFacebookTypeLinkedin AccessIdentityProviderNewResponseAccessFacebookType = "linkedin" + AccessIdentityProviderNewResponseAccessFacebookTypeOidc AccessIdentityProviderNewResponseAccessFacebookType = "oidc" + AccessIdentityProviderNewResponseAccessFacebookTypeOkta AccessIdentityProviderNewResponseAccessFacebookType = "okta" + AccessIdentityProviderNewResponseAccessFacebookTypeOnelogin AccessIdentityProviderNewResponseAccessFacebookType = "onelogin" + AccessIdentityProviderNewResponseAccessFacebookTypePingone AccessIdentityProviderNewResponseAccessFacebookType = "pingone" + AccessIdentityProviderNewResponseAccessFacebookTypeYandex AccessIdentityProviderNewResponseAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessFacebookScimConfig struct { +type AccessIdentityProviderNewResponseAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -500,14 +497,14 @@ type AccessIdentityProviderUpdateResponseAccessFacebookScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessFacebookScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessFacebookScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessFacebookScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessFacebookScimConfig] -type accessIdentityProviderUpdateResponseAccessFacebookScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessFacebookScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessFacebookScimConfig] +type accessIdentityProviderNewResponseAccessFacebookScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -517,32 +514,32 @@ type accessIdentityProviderUpdateResponseAccessFacebookScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessGitHub struct { +type AccessIdentityProviderNewResponseAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessGitHubConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessGitHubConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessGitHubType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessGitHubType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessGitHubScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessGitHubJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessGitHubScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessGitHubJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGitHubJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessGitHub] -type accessIdentityProviderUpdateResponseAccessGitHubJSON struct { +// accessIdentityProviderNewResponseAccessGitHubJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessGitHub] +type accessIdentityProviderNewResponseAccessGitHubJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -552,62 +549,62 @@ type accessIdentityProviderUpdateResponseAccessGitHubJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessGitHub) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessGitHub) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGitHubConfig struct { +type AccessIdentityProviderNewResponseAccessGitHubConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderUpdateResponseAccessGitHubConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderNewResponseAccessGitHubConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGitHubConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessGitHubConfig] -type accessIdentityProviderUpdateResponseAccessGitHubConfigJSON struct { +// accessIdentityProviderNewResponseAccessGitHubConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessGitHubConfig] +type accessIdentityProviderNewResponseAccessGitHubConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGitHubType string +type AccessIdentityProviderNewResponseAccessGitHubType string const ( - AccessIdentityProviderUpdateResponseAccessGitHubTypeOnetimepin AccessIdentityProviderUpdateResponseAccessGitHubType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessGitHubTypeAzureAd AccessIdentityProviderUpdateResponseAccessGitHubType = "azureAD" - AccessIdentityProviderUpdateResponseAccessGitHubTypeSaml AccessIdentityProviderUpdateResponseAccessGitHubType = "saml" - AccessIdentityProviderUpdateResponseAccessGitHubTypeCentrify AccessIdentityProviderUpdateResponseAccessGitHubType = "centrify" - AccessIdentityProviderUpdateResponseAccessGitHubTypeFacebook AccessIdentityProviderUpdateResponseAccessGitHubType = "facebook" - AccessIdentityProviderUpdateResponseAccessGitHubTypeGitHub AccessIdentityProviderUpdateResponseAccessGitHubType = "github" - AccessIdentityProviderUpdateResponseAccessGitHubTypeGoogleApps AccessIdentityProviderUpdateResponseAccessGitHubType = "google-apps" - AccessIdentityProviderUpdateResponseAccessGitHubTypeGoogle AccessIdentityProviderUpdateResponseAccessGitHubType = "google" - AccessIdentityProviderUpdateResponseAccessGitHubTypeLinkedin AccessIdentityProviderUpdateResponseAccessGitHubType = "linkedin" - AccessIdentityProviderUpdateResponseAccessGitHubTypeOidc AccessIdentityProviderUpdateResponseAccessGitHubType = "oidc" - AccessIdentityProviderUpdateResponseAccessGitHubTypeOkta AccessIdentityProviderUpdateResponseAccessGitHubType = "okta" - AccessIdentityProviderUpdateResponseAccessGitHubTypeOnelogin AccessIdentityProviderUpdateResponseAccessGitHubType = "onelogin" - AccessIdentityProviderUpdateResponseAccessGitHubTypePingone AccessIdentityProviderUpdateResponseAccessGitHubType = "pingone" - AccessIdentityProviderUpdateResponseAccessGitHubTypeYandex AccessIdentityProviderUpdateResponseAccessGitHubType = "yandex" + AccessIdentityProviderNewResponseAccessGitHubTypeOnetimepin AccessIdentityProviderNewResponseAccessGitHubType = "onetimepin" + AccessIdentityProviderNewResponseAccessGitHubTypeAzureAd AccessIdentityProviderNewResponseAccessGitHubType = "azureAD" + AccessIdentityProviderNewResponseAccessGitHubTypeSaml AccessIdentityProviderNewResponseAccessGitHubType = "saml" + AccessIdentityProviderNewResponseAccessGitHubTypeCentrify AccessIdentityProviderNewResponseAccessGitHubType = "centrify" + AccessIdentityProviderNewResponseAccessGitHubTypeFacebook AccessIdentityProviderNewResponseAccessGitHubType = "facebook" + AccessIdentityProviderNewResponseAccessGitHubTypeGitHub AccessIdentityProviderNewResponseAccessGitHubType = "github" + AccessIdentityProviderNewResponseAccessGitHubTypeGoogleApps AccessIdentityProviderNewResponseAccessGitHubType = "google-apps" + AccessIdentityProviderNewResponseAccessGitHubTypeGoogle AccessIdentityProviderNewResponseAccessGitHubType = "google" + AccessIdentityProviderNewResponseAccessGitHubTypeLinkedin AccessIdentityProviderNewResponseAccessGitHubType = "linkedin" + AccessIdentityProviderNewResponseAccessGitHubTypeOidc AccessIdentityProviderNewResponseAccessGitHubType = "oidc" + AccessIdentityProviderNewResponseAccessGitHubTypeOkta AccessIdentityProviderNewResponseAccessGitHubType = "okta" + AccessIdentityProviderNewResponseAccessGitHubTypeOnelogin AccessIdentityProviderNewResponseAccessGitHubType = "onelogin" + AccessIdentityProviderNewResponseAccessGitHubTypePingone AccessIdentityProviderNewResponseAccessGitHubType = "pingone" + AccessIdentityProviderNewResponseAccessGitHubTypeYandex AccessIdentityProviderNewResponseAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessGitHubScimConfig struct { +type AccessIdentityProviderNewResponseAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -624,14 +621,14 @@ type AccessIdentityProviderUpdateResponseAccessGitHubScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessGitHubScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessGitHubScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGitHubScimConfigJSON contains the JSON +// accessIdentityProviderNewResponseAccessGitHubScimConfigJSON contains the JSON // metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessGitHubScimConfig] -type accessIdentityProviderUpdateResponseAccessGitHubScimConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessGitHubScimConfig] +type accessIdentityProviderNewResponseAccessGitHubScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -641,32 +638,32 @@ type accessIdentityProviderUpdateResponseAccessGitHubScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessGoogle struct { +type AccessIdentityProviderNewResponseAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessGoogleConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessGoogleConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessGoogleType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessGoogleType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessGoogleScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessGoogleJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessGoogleScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessGoogleJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessGoogle] -type accessIdentityProviderUpdateResponseAccessGoogleJSON struct { +// accessIdentityProviderNewResponseAccessGoogleJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessGoogle] +type accessIdentityProviderNewResponseAccessGoogleJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -676,17 +673,17 @@ type accessIdentityProviderUpdateResponseAccessGoogleJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessGoogle) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessGoogle) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGoogleConfig struct { +type AccessIdentityProviderNewResponseAccessGoogleConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -694,13 +691,13 @@ type AccessIdentityProviderUpdateResponseAccessGoogleConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderUpdateResponseAccessGoogleConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderNewResponseAccessGoogleConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessGoogleConfig] -type accessIdentityProviderUpdateResponseAccessGoogleConfigJSON struct { +// accessIdentityProviderNewResponseAccessGoogleConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessGoogleConfig] +type accessIdentityProviderNewResponseAccessGoogleConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -709,35 +706,35 @@ type accessIdentityProviderUpdateResponseAccessGoogleConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGoogleType string +type AccessIdentityProviderNewResponseAccessGoogleType string const ( - AccessIdentityProviderUpdateResponseAccessGoogleTypeOnetimepin AccessIdentityProviderUpdateResponseAccessGoogleType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessGoogleTypeAzureAd AccessIdentityProviderUpdateResponseAccessGoogleType = "azureAD" - AccessIdentityProviderUpdateResponseAccessGoogleTypeSaml AccessIdentityProviderUpdateResponseAccessGoogleType = "saml" - AccessIdentityProviderUpdateResponseAccessGoogleTypeCentrify AccessIdentityProviderUpdateResponseAccessGoogleType = "centrify" - AccessIdentityProviderUpdateResponseAccessGoogleTypeFacebook AccessIdentityProviderUpdateResponseAccessGoogleType = "facebook" - AccessIdentityProviderUpdateResponseAccessGoogleTypeGitHub AccessIdentityProviderUpdateResponseAccessGoogleType = "github" - AccessIdentityProviderUpdateResponseAccessGoogleTypeGoogleApps AccessIdentityProviderUpdateResponseAccessGoogleType = "google-apps" - AccessIdentityProviderUpdateResponseAccessGoogleTypeGoogle AccessIdentityProviderUpdateResponseAccessGoogleType = "google" - AccessIdentityProviderUpdateResponseAccessGoogleTypeLinkedin AccessIdentityProviderUpdateResponseAccessGoogleType = "linkedin" - AccessIdentityProviderUpdateResponseAccessGoogleTypeOidc AccessIdentityProviderUpdateResponseAccessGoogleType = "oidc" - AccessIdentityProviderUpdateResponseAccessGoogleTypeOkta AccessIdentityProviderUpdateResponseAccessGoogleType = "okta" - AccessIdentityProviderUpdateResponseAccessGoogleTypeOnelogin AccessIdentityProviderUpdateResponseAccessGoogleType = "onelogin" - AccessIdentityProviderUpdateResponseAccessGoogleTypePingone AccessIdentityProviderUpdateResponseAccessGoogleType = "pingone" - AccessIdentityProviderUpdateResponseAccessGoogleTypeYandex AccessIdentityProviderUpdateResponseAccessGoogleType = "yandex" + AccessIdentityProviderNewResponseAccessGoogleTypeOnetimepin AccessIdentityProviderNewResponseAccessGoogleType = "onetimepin" + AccessIdentityProviderNewResponseAccessGoogleTypeAzureAd AccessIdentityProviderNewResponseAccessGoogleType = "azureAD" + AccessIdentityProviderNewResponseAccessGoogleTypeSaml AccessIdentityProviderNewResponseAccessGoogleType = "saml" + AccessIdentityProviderNewResponseAccessGoogleTypeCentrify AccessIdentityProviderNewResponseAccessGoogleType = "centrify" + AccessIdentityProviderNewResponseAccessGoogleTypeFacebook AccessIdentityProviderNewResponseAccessGoogleType = "facebook" + AccessIdentityProviderNewResponseAccessGoogleTypeGitHub AccessIdentityProviderNewResponseAccessGoogleType = "github" + AccessIdentityProviderNewResponseAccessGoogleTypeGoogleApps AccessIdentityProviderNewResponseAccessGoogleType = "google-apps" + AccessIdentityProviderNewResponseAccessGoogleTypeGoogle AccessIdentityProviderNewResponseAccessGoogleType = "google" + AccessIdentityProviderNewResponseAccessGoogleTypeLinkedin AccessIdentityProviderNewResponseAccessGoogleType = "linkedin" + AccessIdentityProviderNewResponseAccessGoogleTypeOidc AccessIdentityProviderNewResponseAccessGoogleType = "oidc" + AccessIdentityProviderNewResponseAccessGoogleTypeOkta AccessIdentityProviderNewResponseAccessGoogleType = "okta" + AccessIdentityProviderNewResponseAccessGoogleTypeOnelogin AccessIdentityProviderNewResponseAccessGoogleType = "onelogin" + AccessIdentityProviderNewResponseAccessGoogleTypePingone AccessIdentityProviderNewResponseAccessGoogleType = "pingone" + AccessIdentityProviderNewResponseAccessGoogleTypeYandex AccessIdentityProviderNewResponseAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessGoogleScimConfig struct { +type AccessIdentityProviderNewResponseAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -754,14 +751,14 @@ type AccessIdentityProviderUpdateResponseAccessGoogleScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessGoogleScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessGoogleScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleScimConfigJSON contains the JSON +// accessIdentityProviderNewResponseAccessGoogleScimConfigJSON contains the JSON // metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessGoogleScimConfig] -type accessIdentityProviderUpdateResponseAccessGoogleScimConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessGoogleScimConfig] +type accessIdentityProviderNewResponseAccessGoogleScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -771,32 +768,32 @@ type accessIdentityProviderUpdateResponseAccessGoogleScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessGoogleApps struct { +type AccessIdentityProviderNewResponseAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessGoogleAppsConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessGoogleAppsConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessGoogleAppsType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessGoogleAppsType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessGoogleAppsScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessGoogleAppsJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessGoogleAppsScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessGoogleAppsJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleAppsJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessGoogleApps] -type accessIdentityProviderUpdateResponseAccessGoogleAppsJSON struct { +// accessIdentityProviderNewResponseAccessGoogleAppsJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessGoogleApps] +type accessIdentityProviderNewResponseAccessGoogleAppsJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -806,17 +803,17 @@ type accessIdentityProviderUpdateResponseAccessGoogleAppsJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessGoogleApps) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessGoogleApps) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGoogleAppsConfig struct { +type AccessIdentityProviderNewResponseAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain string `json:"apps_domain"` // Custom claims @@ -826,14 +823,14 @@ type AccessIdentityProviderUpdateResponseAccessGoogleAppsConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderUpdateResponseAccessGoogleAppsConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderNewResponseAccessGoogleAppsConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleAppsConfigJSON contains the JSON +// accessIdentityProviderNewResponseAccessGoogleAppsConfigJSON contains the JSON // metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessGoogleAppsConfig] -type accessIdentityProviderUpdateResponseAccessGoogleAppsConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessGoogleAppsConfig] +type accessIdentityProviderNewResponseAccessGoogleAppsConfigJSON struct { AppsDomain apijson.Field Claims apijson.Field ClientID apijson.Field @@ -843,35 +840,35 @@ type accessIdentityProviderUpdateResponseAccessGoogleAppsConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessGoogleAppsType string +type AccessIdentityProviderNewResponseAccessGoogleAppsType string const ( - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "azureAD" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeSaml AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "saml" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "centrify" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "facebook" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "github" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "google-apps" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "google" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "linkedin" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeOidc AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "oidc" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeOkta AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "okta" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "onelogin" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypePingone AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "pingone" - AccessIdentityProviderUpdateResponseAccessGoogleAppsTypeYandex AccessIdentityProviderUpdateResponseAccessGoogleAppsType = "yandex" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderNewResponseAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderNewResponseAccessGoogleAppsType = "azureAD" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeSaml AccessIdentityProviderNewResponseAccessGoogleAppsType = "saml" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderNewResponseAccessGoogleAppsType = "centrify" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderNewResponseAccessGoogleAppsType = "facebook" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderNewResponseAccessGoogleAppsType = "github" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderNewResponseAccessGoogleAppsType = "google-apps" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderNewResponseAccessGoogleAppsType = "google" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderNewResponseAccessGoogleAppsType = "linkedin" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeOidc AccessIdentityProviderNewResponseAccessGoogleAppsType = "oidc" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeOkta AccessIdentityProviderNewResponseAccessGoogleAppsType = "okta" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderNewResponseAccessGoogleAppsType = "onelogin" + AccessIdentityProviderNewResponseAccessGoogleAppsTypePingone AccessIdentityProviderNewResponseAccessGoogleAppsType = "pingone" + AccessIdentityProviderNewResponseAccessGoogleAppsTypeYandex AccessIdentityProviderNewResponseAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderNewResponseAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -888,14 +885,14 @@ type AccessIdentityProviderUpdateResponseAccessGoogleAppsScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessGoogleAppsScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessGoogleAppsScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessGoogleAppsScimConfigJSON contains the +// accessIdentityProviderNewResponseAccessGoogleAppsScimConfigJSON contains the // JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessGoogleAppsScimConfig] -type accessIdentityProviderUpdateResponseAccessGoogleAppsScimConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessGoogleAppsScimConfig] +type accessIdentityProviderNewResponseAccessGoogleAppsScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -905,32 +902,32 @@ type accessIdentityProviderUpdateResponseAccessGoogleAppsScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessLinkedin struct { +type AccessIdentityProviderNewResponseAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessLinkedinConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessLinkedinConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessLinkedinType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessLinkedinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessLinkedinScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessLinkedinJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessLinkedinScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessLinkedinJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessLinkedinJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessLinkedin] -type accessIdentityProviderUpdateResponseAccessLinkedinJSON struct { +// accessIdentityProviderNewResponseAccessLinkedinJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessLinkedin] +type accessIdentityProviderNewResponseAccessLinkedinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -940,63 +937,62 @@ type accessIdentityProviderUpdateResponseAccessLinkedinJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessLinkedin) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessLinkedin) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessLinkedinConfig struct { +type AccessIdentityProviderNewResponseAccessLinkedinConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderUpdateResponseAccessLinkedinConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderNewResponseAccessLinkedinConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessLinkedinConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessLinkedinConfig] -type accessIdentityProviderUpdateResponseAccessLinkedinConfigJSON struct { +// accessIdentityProviderNewResponseAccessLinkedinConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessLinkedinConfig] +type accessIdentityProviderNewResponseAccessLinkedinConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessLinkedinType string +type AccessIdentityProviderNewResponseAccessLinkedinType string const ( - AccessIdentityProviderUpdateResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderUpdateResponseAccessLinkedinType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeAzureAd AccessIdentityProviderUpdateResponseAccessLinkedinType = "azureAD" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeSaml AccessIdentityProviderUpdateResponseAccessLinkedinType = "saml" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeCentrify AccessIdentityProviderUpdateResponseAccessLinkedinType = "centrify" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeFacebook AccessIdentityProviderUpdateResponseAccessLinkedinType = "facebook" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeGitHub AccessIdentityProviderUpdateResponseAccessLinkedinType = "github" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderUpdateResponseAccessLinkedinType = "google-apps" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeGoogle AccessIdentityProviderUpdateResponseAccessLinkedinType = "google" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeLinkedin AccessIdentityProviderUpdateResponseAccessLinkedinType = "linkedin" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeOidc AccessIdentityProviderUpdateResponseAccessLinkedinType = "oidc" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeOkta AccessIdentityProviderUpdateResponseAccessLinkedinType = "okta" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeOnelogin AccessIdentityProviderUpdateResponseAccessLinkedinType = "onelogin" - AccessIdentityProviderUpdateResponseAccessLinkedinTypePingone AccessIdentityProviderUpdateResponseAccessLinkedinType = "pingone" - AccessIdentityProviderUpdateResponseAccessLinkedinTypeYandex AccessIdentityProviderUpdateResponseAccessLinkedinType = "yandex" + AccessIdentityProviderNewResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderNewResponseAccessLinkedinType = "onetimepin" + AccessIdentityProviderNewResponseAccessLinkedinTypeAzureAd AccessIdentityProviderNewResponseAccessLinkedinType = "azureAD" + AccessIdentityProviderNewResponseAccessLinkedinTypeSaml AccessIdentityProviderNewResponseAccessLinkedinType = "saml" + AccessIdentityProviderNewResponseAccessLinkedinTypeCentrify AccessIdentityProviderNewResponseAccessLinkedinType = "centrify" + AccessIdentityProviderNewResponseAccessLinkedinTypeFacebook AccessIdentityProviderNewResponseAccessLinkedinType = "facebook" + AccessIdentityProviderNewResponseAccessLinkedinTypeGitHub AccessIdentityProviderNewResponseAccessLinkedinType = "github" + AccessIdentityProviderNewResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderNewResponseAccessLinkedinType = "google-apps" + AccessIdentityProviderNewResponseAccessLinkedinTypeGoogle AccessIdentityProviderNewResponseAccessLinkedinType = "google" + AccessIdentityProviderNewResponseAccessLinkedinTypeLinkedin AccessIdentityProviderNewResponseAccessLinkedinType = "linkedin" + AccessIdentityProviderNewResponseAccessLinkedinTypeOidc AccessIdentityProviderNewResponseAccessLinkedinType = "oidc" + AccessIdentityProviderNewResponseAccessLinkedinTypeOkta AccessIdentityProviderNewResponseAccessLinkedinType = "okta" + AccessIdentityProviderNewResponseAccessLinkedinTypeOnelogin AccessIdentityProviderNewResponseAccessLinkedinType = "onelogin" + AccessIdentityProviderNewResponseAccessLinkedinTypePingone AccessIdentityProviderNewResponseAccessLinkedinType = "pingone" + AccessIdentityProviderNewResponseAccessLinkedinTypeYandex AccessIdentityProviderNewResponseAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessLinkedinScimConfig struct { +type AccessIdentityProviderNewResponseAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1013,14 +1009,14 @@ type AccessIdentityProviderUpdateResponseAccessLinkedinScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessLinkedinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessLinkedinScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessLinkedinScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessLinkedinScimConfig] -type accessIdentityProviderUpdateResponseAccessLinkedinScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessLinkedinScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessLinkedinScimConfig] +type accessIdentityProviderNewResponseAccessLinkedinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1030,32 +1026,32 @@ type accessIdentityProviderUpdateResponseAccessLinkedinScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessOidc struct { +type AccessIdentityProviderNewResponseAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessOidcConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessOidcConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessOidcType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessOidcType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessOidcScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessOidcJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessOidcScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessOidcJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOidcJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessOidc] -type accessIdentityProviderUpdateResponseAccessOidcJSON struct { +// accessIdentityProviderNewResponseAccessOidcJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessOidc] +type accessIdentityProviderNewResponseAccessOidcJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1065,17 +1061,16 @@ type accessIdentityProviderUpdateResponseAccessOidcJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessOidc) implementsAccessIdentityProviderUpdateResponse() { -} +func (r AccessIdentityProviderNewResponseAccessOidc) implementsAccessIdentityProviderNewResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOidcConfig struct { +type AccessIdentityProviderNewResponseAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL string `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -1091,13 +1086,13 @@ type AccessIdentityProviderUpdateResponseAccessOidcConfig struct { // OAuth scopes Scopes []string `json:"scopes"` // The token_endpoint URL of your IdP - TokenURL string `json:"token_url"` - JSON accessIdentityProviderUpdateResponseAccessOidcConfigJSON `json:"-"` + TokenURL string `json:"token_url"` + JSON accessIdentityProviderNewResponseAccessOidcConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOidcConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessOidcConfig] -type accessIdentityProviderUpdateResponseAccessOidcConfigJSON struct { +// accessIdentityProviderNewResponseAccessOidcConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessOidcConfig] +type accessIdentityProviderNewResponseAccessOidcConfigJSON struct { AuthURL apijson.Field CertsURL apijson.Field Claims apijson.Field @@ -1110,35 +1105,35 @@ type accessIdentityProviderUpdateResponseAccessOidcConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOidcType string +type AccessIdentityProviderNewResponseAccessOidcType string const ( - AccessIdentityProviderUpdateResponseAccessOidcTypeOnetimepin AccessIdentityProviderUpdateResponseAccessOidcType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessOidcTypeAzureAd AccessIdentityProviderUpdateResponseAccessOidcType = "azureAD" - AccessIdentityProviderUpdateResponseAccessOidcTypeSaml AccessIdentityProviderUpdateResponseAccessOidcType = "saml" - AccessIdentityProviderUpdateResponseAccessOidcTypeCentrify AccessIdentityProviderUpdateResponseAccessOidcType = "centrify" - AccessIdentityProviderUpdateResponseAccessOidcTypeFacebook AccessIdentityProviderUpdateResponseAccessOidcType = "facebook" - AccessIdentityProviderUpdateResponseAccessOidcTypeGitHub AccessIdentityProviderUpdateResponseAccessOidcType = "github" - AccessIdentityProviderUpdateResponseAccessOidcTypeGoogleApps AccessIdentityProviderUpdateResponseAccessOidcType = "google-apps" - AccessIdentityProviderUpdateResponseAccessOidcTypeGoogle AccessIdentityProviderUpdateResponseAccessOidcType = "google" - AccessIdentityProviderUpdateResponseAccessOidcTypeLinkedin AccessIdentityProviderUpdateResponseAccessOidcType = "linkedin" - AccessIdentityProviderUpdateResponseAccessOidcTypeOidc AccessIdentityProviderUpdateResponseAccessOidcType = "oidc" - AccessIdentityProviderUpdateResponseAccessOidcTypeOkta AccessIdentityProviderUpdateResponseAccessOidcType = "okta" - AccessIdentityProviderUpdateResponseAccessOidcTypeOnelogin AccessIdentityProviderUpdateResponseAccessOidcType = "onelogin" - AccessIdentityProviderUpdateResponseAccessOidcTypePingone AccessIdentityProviderUpdateResponseAccessOidcType = "pingone" - AccessIdentityProviderUpdateResponseAccessOidcTypeYandex AccessIdentityProviderUpdateResponseAccessOidcType = "yandex" + AccessIdentityProviderNewResponseAccessOidcTypeOnetimepin AccessIdentityProviderNewResponseAccessOidcType = "onetimepin" + AccessIdentityProviderNewResponseAccessOidcTypeAzureAd AccessIdentityProviderNewResponseAccessOidcType = "azureAD" + AccessIdentityProviderNewResponseAccessOidcTypeSaml AccessIdentityProviderNewResponseAccessOidcType = "saml" + AccessIdentityProviderNewResponseAccessOidcTypeCentrify AccessIdentityProviderNewResponseAccessOidcType = "centrify" + AccessIdentityProviderNewResponseAccessOidcTypeFacebook AccessIdentityProviderNewResponseAccessOidcType = "facebook" + AccessIdentityProviderNewResponseAccessOidcTypeGitHub AccessIdentityProviderNewResponseAccessOidcType = "github" + AccessIdentityProviderNewResponseAccessOidcTypeGoogleApps AccessIdentityProviderNewResponseAccessOidcType = "google-apps" + AccessIdentityProviderNewResponseAccessOidcTypeGoogle AccessIdentityProviderNewResponseAccessOidcType = "google" + AccessIdentityProviderNewResponseAccessOidcTypeLinkedin AccessIdentityProviderNewResponseAccessOidcType = "linkedin" + AccessIdentityProviderNewResponseAccessOidcTypeOidc AccessIdentityProviderNewResponseAccessOidcType = "oidc" + AccessIdentityProviderNewResponseAccessOidcTypeOkta AccessIdentityProviderNewResponseAccessOidcType = "okta" + AccessIdentityProviderNewResponseAccessOidcTypeOnelogin AccessIdentityProviderNewResponseAccessOidcType = "onelogin" + AccessIdentityProviderNewResponseAccessOidcTypePingone AccessIdentityProviderNewResponseAccessOidcType = "pingone" + AccessIdentityProviderNewResponseAccessOidcTypeYandex AccessIdentityProviderNewResponseAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessOidcScimConfig struct { +type AccessIdentityProviderNewResponseAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1155,14 +1150,13 @@ type AccessIdentityProviderUpdateResponseAccessOidcScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessOidcScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessOidcScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOidcScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessOidcScimConfig] -type accessIdentityProviderUpdateResponseAccessOidcScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessOidcScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessOidcScimConfig] +type accessIdentityProviderNewResponseAccessOidcScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1172,32 +1166,32 @@ type accessIdentityProviderUpdateResponseAccessOidcScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessOkta struct { +type AccessIdentityProviderNewResponseAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessOktaConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessOktaConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessOktaType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessOktaType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessOktaScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessOktaJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessOktaScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessOktaJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOktaJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessOkta] -type accessIdentityProviderUpdateResponseAccessOktaJSON struct { +// accessIdentityProviderNewResponseAccessOktaJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessOkta] +type accessIdentityProviderNewResponseAccessOktaJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1207,17 +1201,16 @@ type accessIdentityProviderUpdateResponseAccessOktaJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessOkta) implementsAccessIdentityProviderUpdateResponse() { -} +func (r AccessIdentityProviderNewResponseAccessOkta) implementsAccessIdentityProviderNewResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOktaConfig struct { +type AccessIdentityProviderNewResponseAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID string `json:"authorization_server_id"` // Custom claims @@ -1229,13 +1222,13 @@ type AccessIdentityProviderUpdateResponseAccessOktaConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your okta account url - OktaAccount string `json:"okta_account"` - JSON accessIdentityProviderUpdateResponseAccessOktaConfigJSON `json:"-"` + OktaAccount string `json:"okta_account"` + JSON accessIdentityProviderNewResponseAccessOktaConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOktaConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessOktaConfig] -type accessIdentityProviderUpdateResponseAccessOktaConfigJSON struct { +// accessIdentityProviderNewResponseAccessOktaConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessOktaConfig] +type accessIdentityProviderNewResponseAccessOktaConfigJSON struct { AuthorizationServerID apijson.Field Claims apijson.Field ClientID apijson.Field @@ -1246,35 +1239,35 @@ type accessIdentityProviderUpdateResponseAccessOktaConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOktaType string +type AccessIdentityProviderNewResponseAccessOktaType string const ( - AccessIdentityProviderUpdateResponseAccessOktaTypeOnetimepin AccessIdentityProviderUpdateResponseAccessOktaType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessOktaTypeAzureAd AccessIdentityProviderUpdateResponseAccessOktaType = "azureAD" - AccessIdentityProviderUpdateResponseAccessOktaTypeSaml AccessIdentityProviderUpdateResponseAccessOktaType = "saml" - AccessIdentityProviderUpdateResponseAccessOktaTypeCentrify AccessIdentityProviderUpdateResponseAccessOktaType = "centrify" - AccessIdentityProviderUpdateResponseAccessOktaTypeFacebook AccessIdentityProviderUpdateResponseAccessOktaType = "facebook" - AccessIdentityProviderUpdateResponseAccessOktaTypeGitHub AccessIdentityProviderUpdateResponseAccessOktaType = "github" - AccessIdentityProviderUpdateResponseAccessOktaTypeGoogleApps AccessIdentityProviderUpdateResponseAccessOktaType = "google-apps" - AccessIdentityProviderUpdateResponseAccessOktaTypeGoogle AccessIdentityProviderUpdateResponseAccessOktaType = "google" - AccessIdentityProviderUpdateResponseAccessOktaTypeLinkedin AccessIdentityProviderUpdateResponseAccessOktaType = "linkedin" - AccessIdentityProviderUpdateResponseAccessOktaTypeOidc AccessIdentityProviderUpdateResponseAccessOktaType = "oidc" - AccessIdentityProviderUpdateResponseAccessOktaTypeOkta AccessIdentityProviderUpdateResponseAccessOktaType = "okta" - AccessIdentityProviderUpdateResponseAccessOktaTypeOnelogin AccessIdentityProviderUpdateResponseAccessOktaType = "onelogin" - AccessIdentityProviderUpdateResponseAccessOktaTypePingone AccessIdentityProviderUpdateResponseAccessOktaType = "pingone" - AccessIdentityProviderUpdateResponseAccessOktaTypeYandex AccessIdentityProviderUpdateResponseAccessOktaType = "yandex" + AccessIdentityProviderNewResponseAccessOktaTypeOnetimepin AccessIdentityProviderNewResponseAccessOktaType = "onetimepin" + AccessIdentityProviderNewResponseAccessOktaTypeAzureAd AccessIdentityProviderNewResponseAccessOktaType = "azureAD" + AccessIdentityProviderNewResponseAccessOktaTypeSaml AccessIdentityProviderNewResponseAccessOktaType = "saml" + AccessIdentityProviderNewResponseAccessOktaTypeCentrify AccessIdentityProviderNewResponseAccessOktaType = "centrify" + AccessIdentityProviderNewResponseAccessOktaTypeFacebook AccessIdentityProviderNewResponseAccessOktaType = "facebook" + AccessIdentityProviderNewResponseAccessOktaTypeGitHub AccessIdentityProviderNewResponseAccessOktaType = "github" + AccessIdentityProviderNewResponseAccessOktaTypeGoogleApps AccessIdentityProviderNewResponseAccessOktaType = "google-apps" + AccessIdentityProviderNewResponseAccessOktaTypeGoogle AccessIdentityProviderNewResponseAccessOktaType = "google" + AccessIdentityProviderNewResponseAccessOktaTypeLinkedin AccessIdentityProviderNewResponseAccessOktaType = "linkedin" + AccessIdentityProviderNewResponseAccessOktaTypeOidc AccessIdentityProviderNewResponseAccessOktaType = "oidc" + AccessIdentityProviderNewResponseAccessOktaTypeOkta AccessIdentityProviderNewResponseAccessOktaType = "okta" + AccessIdentityProviderNewResponseAccessOktaTypeOnelogin AccessIdentityProviderNewResponseAccessOktaType = "onelogin" + AccessIdentityProviderNewResponseAccessOktaTypePingone AccessIdentityProviderNewResponseAccessOktaType = "pingone" + AccessIdentityProviderNewResponseAccessOktaTypeYandex AccessIdentityProviderNewResponseAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessOktaScimConfig struct { +type AccessIdentityProviderNewResponseAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1291,14 +1284,13 @@ type AccessIdentityProviderUpdateResponseAccessOktaScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessOktaScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessOktaScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOktaScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessOktaScimConfig] -type accessIdentityProviderUpdateResponseAccessOktaScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessOktaScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessOktaScimConfig] +type accessIdentityProviderNewResponseAccessOktaScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1308,32 +1300,32 @@ type accessIdentityProviderUpdateResponseAccessOktaScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessOnelogin struct { +type AccessIdentityProviderNewResponseAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessOneloginConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessOneloginConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessOneloginType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessOneloginType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessOneloginScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessOneloginJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessOneloginScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessOneloginJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOneloginJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessOnelogin] -type accessIdentityProviderUpdateResponseAccessOneloginJSON struct { +// accessIdentityProviderNewResponseAccessOneloginJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessOnelogin] +type accessIdentityProviderNewResponseAccessOneloginJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1343,17 +1335,17 @@ type accessIdentityProviderUpdateResponseAccessOneloginJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessOnelogin) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessOnelogin) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOneloginConfig struct { +type AccessIdentityProviderNewResponseAccessOneloginConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -1363,14 +1355,13 @@ type AccessIdentityProviderUpdateResponseAccessOneloginConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your OneLogin account url - OneloginAccount string `json:"onelogin_account"` - JSON accessIdentityProviderUpdateResponseAccessOneloginConfigJSON `json:"-"` + OneloginAccount string `json:"onelogin_account"` + JSON accessIdentityProviderNewResponseAccessOneloginConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOneloginConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessOneloginConfig] -type accessIdentityProviderUpdateResponseAccessOneloginConfigJSON struct { +// accessIdentityProviderNewResponseAccessOneloginConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessOneloginConfig] +type accessIdentityProviderNewResponseAccessOneloginConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -1380,35 +1371,35 @@ type accessIdentityProviderUpdateResponseAccessOneloginConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOneloginType string +type AccessIdentityProviderNewResponseAccessOneloginType string const ( - AccessIdentityProviderUpdateResponseAccessOneloginTypeOnetimepin AccessIdentityProviderUpdateResponseAccessOneloginType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessOneloginTypeAzureAd AccessIdentityProviderUpdateResponseAccessOneloginType = "azureAD" - AccessIdentityProviderUpdateResponseAccessOneloginTypeSaml AccessIdentityProviderUpdateResponseAccessOneloginType = "saml" - AccessIdentityProviderUpdateResponseAccessOneloginTypeCentrify AccessIdentityProviderUpdateResponseAccessOneloginType = "centrify" - AccessIdentityProviderUpdateResponseAccessOneloginTypeFacebook AccessIdentityProviderUpdateResponseAccessOneloginType = "facebook" - AccessIdentityProviderUpdateResponseAccessOneloginTypeGitHub AccessIdentityProviderUpdateResponseAccessOneloginType = "github" - AccessIdentityProviderUpdateResponseAccessOneloginTypeGoogleApps AccessIdentityProviderUpdateResponseAccessOneloginType = "google-apps" - AccessIdentityProviderUpdateResponseAccessOneloginTypeGoogle AccessIdentityProviderUpdateResponseAccessOneloginType = "google" - AccessIdentityProviderUpdateResponseAccessOneloginTypeLinkedin AccessIdentityProviderUpdateResponseAccessOneloginType = "linkedin" - AccessIdentityProviderUpdateResponseAccessOneloginTypeOidc AccessIdentityProviderUpdateResponseAccessOneloginType = "oidc" - AccessIdentityProviderUpdateResponseAccessOneloginTypeOkta AccessIdentityProviderUpdateResponseAccessOneloginType = "okta" - AccessIdentityProviderUpdateResponseAccessOneloginTypeOnelogin AccessIdentityProviderUpdateResponseAccessOneloginType = "onelogin" - AccessIdentityProviderUpdateResponseAccessOneloginTypePingone AccessIdentityProviderUpdateResponseAccessOneloginType = "pingone" - AccessIdentityProviderUpdateResponseAccessOneloginTypeYandex AccessIdentityProviderUpdateResponseAccessOneloginType = "yandex" + AccessIdentityProviderNewResponseAccessOneloginTypeOnetimepin AccessIdentityProviderNewResponseAccessOneloginType = "onetimepin" + AccessIdentityProviderNewResponseAccessOneloginTypeAzureAd AccessIdentityProviderNewResponseAccessOneloginType = "azureAD" + AccessIdentityProviderNewResponseAccessOneloginTypeSaml AccessIdentityProviderNewResponseAccessOneloginType = "saml" + AccessIdentityProviderNewResponseAccessOneloginTypeCentrify AccessIdentityProviderNewResponseAccessOneloginType = "centrify" + AccessIdentityProviderNewResponseAccessOneloginTypeFacebook AccessIdentityProviderNewResponseAccessOneloginType = "facebook" + AccessIdentityProviderNewResponseAccessOneloginTypeGitHub AccessIdentityProviderNewResponseAccessOneloginType = "github" + AccessIdentityProviderNewResponseAccessOneloginTypeGoogleApps AccessIdentityProviderNewResponseAccessOneloginType = "google-apps" + AccessIdentityProviderNewResponseAccessOneloginTypeGoogle AccessIdentityProviderNewResponseAccessOneloginType = "google" + AccessIdentityProviderNewResponseAccessOneloginTypeLinkedin AccessIdentityProviderNewResponseAccessOneloginType = "linkedin" + AccessIdentityProviderNewResponseAccessOneloginTypeOidc AccessIdentityProviderNewResponseAccessOneloginType = "oidc" + AccessIdentityProviderNewResponseAccessOneloginTypeOkta AccessIdentityProviderNewResponseAccessOneloginType = "okta" + AccessIdentityProviderNewResponseAccessOneloginTypeOnelogin AccessIdentityProviderNewResponseAccessOneloginType = "onelogin" + AccessIdentityProviderNewResponseAccessOneloginTypePingone AccessIdentityProviderNewResponseAccessOneloginType = "pingone" + AccessIdentityProviderNewResponseAccessOneloginTypeYandex AccessIdentityProviderNewResponseAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessOneloginScimConfig struct { +type AccessIdentityProviderNewResponseAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1425,14 +1416,14 @@ type AccessIdentityProviderUpdateResponseAccessOneloginScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessOneloginScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessOneloginScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOneloginScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessOneloginScimConfig] -type accessIdentityProviderUpdateResponseAccessOneloginScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessOneloginScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessOneloginScimConfig] +type accessIdentityProviderNewResponseAccessOneloginScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1442,32 +1433,32 @@ type accessIdentityProviderUpdateResponseAccessOneloginScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessPingone struct { +type AccessIdentityProviderNewResponseAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessPingoneConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessPingoneConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessPingoneType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessPingoneType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessPingoneScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessPingoneJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessPingoneScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessPingoneJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessPingoneJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessPingone] -type accessIdentityProviderUpdateResponseAccessPingoneJSON struct { +// accessIdentityProviderNewResponseAccessPingoneJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessPingone] +type accessIdentityProviderNewResponseAccessPingoneJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1477,17 +1468,17 @@ type accessIdentityProviderUpdateResponseAccessPingoneJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessPingone) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessPingone) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessPingoneConfig struct { +type AccessIdentityProviderNewResponseAccessPingoneConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -1497,14 +1488,13 @@ type AccessIdentityProviderUpdateResponseAccessPingoneConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your PingOne environment identifier - PingEnvID string `json:"ping_env_id"` - JSON accessIdentityProviderUpdateResponseAccessPingoneConfigJSON `json:"-"` + PingEnvID string `json:"ping_env_id"` + JSON accessIdentityProviderNewResponseAccessPingoneConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessPingoneConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessPingoneConfig] -type accessIdentityProviderUpdateResponseAccessPingoneConfigJSON struct { +// accessIdentityProviderNewResponseAccessPingoneConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessPingoneConfig] +type accessIdentityProviderNewResponseAccessPingoneConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -1514,35 +1504,35 @@ type accessIdentityProviderUpdateResponseAccessPingoneConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessPingoneType string +type AccessIdentityProviderNewResponseAccessPingoneType string const ( - AccessIdentityProviderUpdateResponseAccessPingoneTypeOnetimepin AccessIdentityProviderUpdateResponseAccessPingoneType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessPingoneTypeAzureAd AccessIdentityProviderUpdateResponseAccessPingoneType = "azureAD" - AccessIdentityProviderUpdateResponseAccessPingoneTypeSaml AccessIdentityProviderUpdateResponseAccessPingoneType = "saml" - AccessIdentityProviderUpdateResponseAccessPingoneTypeCentrify AccessIdentityProviderUpdateResponseAccessPingoneType = "centrify" - AccessIdentityProviderUpdateResponseAccessPingoneTypeFacebook AccessIdentityProviderUpdateResponseAccessPingoneType = "facebook" - AccessIdentityProviderUpdateResponseAccessPingoneTypeGitHub AccessIdentityProviderUpdateResponseAccessPingoneType = "github" - AccessIdentityProviderUpdateResponseAccessPingoneTypeGoogleApps AccessIdentityProviderUpdateResponseAccessPingoneType = "google-apps" - AccessIdentityProviderUpdateResponseAccessPingoneTypeGoogle AccessIdentityProviderUpdateResponseAccessPingoneType = "google" - AccessIdentityProviderUpdateResponseAccessPingoneTypeLinkedin AccessIdentityProviderUpdateResponseAccessPingoneType = "linkedin" - AccessIdentityProviderUpdateResponseAccessPingoneTypeOidc AccessIdentityProviderUpdateResponseAccessPingoneType = "oidc" - AccessIdentityProviderUpdateResponseAccessPingoneTypeOkta AccessIdentityProviderUpdateResponseAccessPingoneType = "okta" - AccessIdentityProviderUpdateResponseAccessPingoneTypeOnelogin AccessIdentityProviderUpdateResponseAccessPingoneType = "onelogin" - AccessIdentityProviderUpdateResponseAccessPingoneTypePingone AccessIdentityProviderUpdateResponseAccessPingoneType = "pingone" - AccessIdentityProviderUpdateResponseAccessPingoneTypeYandex AccessIdentityProviderUpdateResponseAccessPingoneType = "yandex" + AccessIdentityProviderNewResponseAccessPingoneTypeOnetimepin AccessIdentityProviderNewResponseAccessPingoneType = "onetimepin" + AccessIdentityProviderNewResponseAccessPingoneTypeAzureAd AccessIdentityProviderNewResponseAccessPingoneType = "azureAD" + AccessIdentityProviderNewResponseAccessPingoneTypeSaml AccessIdentityProviderNewResponseAccessPingoneType = "saml" + AccessIdentityProviderNewResponseAccessPingoneTypeCentrify AccessIdentityProviderNewResponseAccessPingoneType = "centrify" + AccessIdentityProviderNewResponseAccessPingoneTypeFacebook AccessIdentityProviderNewResponseAccessPingoneType = "facebook" + AccessIdentityProviderNewResponseAccessPingoneTypeGitHub AccessIdentityProviderNewResponseAccessPingoneType = "github" + AccessIdentityProviderNewResponseAccessPingoneTypeGoogleApps AccessIdentityProviderNewResponseAccessPingoneType = "google-apps" + AccessIdentityProviderNewResponseAccessPingoneTypeGoogle AccessIdentityProviderNewResponseAccessPingoneType = "google" + AccessIdentityProviderNewResponseAccessPingoneTypeLinkedin AccessIdentityProviderNewResponseAccessPingoneType = "linkedin" + AccessIdentityProviderNewResponseAccessPingoneTypeOidc AccessIdentityProviderNewResponseAccessPingoneType = "oidc" + AccessIdentityProviderNewResponseAccessPingoneTypeOkta AccessIdentityProviderNewResponseAccessPingoneType = "okta" + AccessIdentityProviderNewResponseAccessPingoneTypeOnelogin AccessIdentityProviderNewResponseAccessPingoneType = "onelogin" + AccessIdentityProviderNewResponseAccessPingoneTypePingone AccessIdentityProviderNewResponseAccessPingoneType = "pingone" + AccessIdentityProviderNewResponseAccessPingoneTypeYandex AccessIdentityProviderNewResponseAccessPingoneType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessPingoneScimConfig struct { +type AccessIdentityProviderNewResponseAccessPingoneScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1559,14 +1549,14 @@ type AccessIdentityProviderUpdateResponseAccessPingoneScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessPingoneScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessPingoneScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessPingoneScimConfigJSON contains the -// JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessPingoneScimConfig] -type accessIdentityProviderUpdateResponseAccessPingoneScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessPingoneScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderNewResponseAccessPingoneScimConfig] +type accessIdentityProviderNewResponseAccessPingoneScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1576,32 +1566,32 @@ type accessIdentityProviderUpdateResponseAccessPingoneScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessSaml struct { +type AccessIdentityProviderNewResponseAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessSamlConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessSamlConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessSamlType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessSamlType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessSamlScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessSamlJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessSamlScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessSamlJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessSamlJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessSaml] -type accessIdentityProviderUpdateResponseAccessSamlJSON struct { +// accessIdentityProviderNewResponseAccessSamlJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessSaml] +type accessIdentityProviderNewResponseAccessSamlJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1611,17 +1601,16 @@ type accessIdentityProviderUpdateResponseAccessSamlJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessSaml) implementsAccessIdentityProviderUpdateResponse() { -} +func (r AccessIdentityProviderNewResponseAccessSaml) implementsAccessIdentityProviderNewResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessSamlConfig struct { +type AccessIdentityProviderNewResponseAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes []string `json:"attributes"` @@ -1629,7 +1618,7 @@ type AccessIdentityProviderUpdateResponseAccessSamlConfig struct { EmailAttributeName string `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes []AccessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` + HeaderAttributes []AccessIdentityProviderNewResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -1638,13 +1627,13 @@ type AccessIdentityProviderUpdateResponseAccessSamlConfig struct { // signature, use the public key from the Access certs endpoints. SignRequest bool `json:"sign_request"` // URL to send the SAML authentication requests to - SSOTargetURL string `json:"sso_target_url"` - JSON accessIdentityProviderUpdateResponseAccessSamlConfigJSON `json:"-"` + SSOTargetURL string `json:"sso_target_url"` + JSON accessIdentityProviderNewResponseAccessSamlConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessSamlConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessSamlConfig] -type accessIdentityProviderUpdateResponseAccessSamlConfigJSON struct { +// accessIdentityProviderNewResponseAccessSamlConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessSamlConfig] +type accessIdentityProviderNewResponseAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field @@ -1656,57 +1645,57 @@ type accessIdentityProviderUpdateResponseAccessSamlConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderNewResponseAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName string `json:"attribute_name"` // header that will be added on the request to the origin - HeaderName string `json:"header_name"` - JSON accessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` + HeaderName string `json:"header_name"` + JSON accessIdentityProviderNewResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttributeJSON contains +// accessIdentityProviderNewResponseAccessSamlConfigHeaderAttributeJSON contains // the JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttribute] -type accessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttributeJSON struct { +// [AccessIdentityProviderNewResponseAccessSamlConfigHeaderAttribute] +type accessIdentityProviderNewResponseAccessSamlConfigHeaderAttributeJSON struct { AttributeName apijson.Field HeaderName apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessSamlType string +type AccessIdentityProviderNewResponseAccessSamlType string const ( - AccessIdentityProviderUpdateResponseAccessSamlTypeOnetimepin AccessIdentityProviderUpdateResponseAccessSamlType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessSamlTypeAzureAd AccessIdentityProviderUpdateResponseAccessSamlType = "azureAD" - AccessIdentityProviderUpdateResponseAccessSamlTypeSaml AccessIdentityProviderUpdateResponseAccessSamlType = "saml" - AccessIdentityProviderUpdateResponseAccessSamlTypeCentrify AccessIdentityProviderUpdateResponseAccessSamlType = "centrify" - AccessIdentityProviderUpdateResponseAccessSamlTypeFacebook AccessIdentityProviderUpdateResponseAccessSamlType = "facebook" - AccessIdentityProviderUpdateResponseAccessSamlTypeGitHub AccessIdentityProviderUpdateResponseAccessSamlType = "github" - AccessIdentityProviderUpdateResponseAccessSamlTypeGoogleApps AccessIdentityProviderUpdateResponseAccessSamlType = "google-apps" - AccessIdentityProviderUpdateResponseAccessSamlTypeGoogle AccessIdentityProviderUpdateResponseAccessSamlType = "google" - AccessIdentityProviderUpdateResponseAccessSamlTypeLinkedin AccessIdentityProviderUpdateResponseAccessSamlType = "linkedin" - AccessIdentityProviderUpdateResponseAccessSamlTypeOidc AccessIdentityProviderUpdateResponseAccessSamlType = "oidc" - AccessIdentityProviderUpdateResponseAccessSamlTypeOkta AccessIdentityProviderUpdateResponseAccessSamlType = "okta" - AccessIdentityProviderUpdateResponseAccessSamlTypeOnelogin AccessIdentityProviderUpdateResponseAccessSamlType = "onelogin" - AccessIdentityProviderUpdateResponseAccessSamlTypePingone AccessIdentityProviderUpdateResponseAccessSamlType = "pingone" - AccessIdentityProviderUpdateResponseAccessSamlTypeYandex AccessIdentityProviderUpdateResponseAccessSamlType = "yandex" + AccessIdentityProviderNewResponseAccessSamlTypeOnetimepin AccessIdentityProviderNewResponseAccessSamlType = "onetimepin" + AccessIdentityProviderNewResponseAccessSamlTypeAzureAd AccessIdentityProviderNewResponseAccessSamlType = "azureAD" + AccessIdentityProviderNewResponseAccessSamlTypeSaml AccessIdentityProviderNewResponseAccessSamlType = "saml" + AccessIdentityProviderNewResponseAccessSamlTypeCentrify AccessIdentityProviderNewResponseAccessSamlType = "centrify" + AccessIdentityProviderNewResponseAccessSamlTypeFacebook AccessIdentityProviderNewResponseAccessSamlType = "facebook" + AccessIdentityProviderNewResponseAccessSamlTypeGitHub AccessIdentityProviderNewResponseAccessSamlType = "github" + AccessIdentityProviderNewResponseAccessSamlTypeGoogleApps AccessIdentityProviderNewResponseAccessSamlType = "google-apps" + AccessIdentityProviderNewResponseAccessSamlTypeGoogle AccessIdentityProviderNewResponseAccessSamlType = "google" + AccessIdentityProviderNewResponseAccessSamlTypeLinkedin AccessIdentityProviderNewResponseAccessSamlType = "linkedin" + AccessIdentityProviderNewResponseAccessSamlTypeOidc AccessIdentityProviderNewResponseAccessSamlType = "oidc" + AccessIdentityProviderNewResponseAccessSamlTypeOkta AccessIdentityProviderNewResponseAccessSamlType = "okta" + AccessIdentityProviderNewResponseAccessSamlTypeOnelogin AccessIdentityProviderNewResponseAccessSamlType = "onelogin" + AccessIdentityProviderNewResponseAccessSamlTypePingone AccessIdentityProviderNewResponseAccessSamlType = "pingone" + AccessIdentityProviderNewResponseAccessSamlTypeYandex AccessIdentityProviderNewResponseAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessSamlScimConfig struct { +type AccessIdentityProviderNewResponseAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1723,14 +1712,13 @@ type AccessIdentityProviderUpdateResponseAccessSamlScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessSamlScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessSamlScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessSamlScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessSamlScimConfig] -type accessIdentityProviderUpdateResponseAccessSamlScimConfigJSON struct { +// accessIdentityProviderNewResponseAccessSamlScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessSamlScimConfig] +type accessIdentityProviderNewResponseAccessSamlScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1740,32 +1728,32 @@ type accessIdentityProviderUpdateResponseAccessSamlScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessYandex struct { +type AccessIdentityProviderNewResponseAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderUpdateResponseAccessYandexConfig `json:"config,required"` + Config AccessIdentityProviderNewResponseAccessYandexConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessYandexType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessYandexType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessYandexScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessYandexJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessYandexScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessYandexJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessYandexJSON contains the JSON metadata -// for the struct [AccessIdentityProviderUpdateResponseAccessYandex] -type accessIdentityProviderUpdateResponseAccessYandexJSON struct { +// accessIdentityProviderNewResponseAccessYandexJSON contains the JSON metadata for +// the struct [AccessIdentityProviderNewResponseAccessYandex] +type accessIdentityProviderNewResponseAccessYandexJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1775,62 +1763,62 @@ type accessIdentityProviderUpdateResponseAccessYandexJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessYandex) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessYandex) implementsAccessIdentityProviderNewResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessYandexConfig struct { +type AccessIdentityProviderNewResponseAccessYandexConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderUpdateResponseAccessYandexConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderNewResponseAccessYandexConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessYandexConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessYandexConfig] -type accessIdentityProviderUpdateResponseAccessYandexConfigJSON struct { +// accessIdentityProviderNewResponseAccessYandexConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderNewResponseAccessYandexConfig] +type accessIdentityProviderNewResponseAccessYandexConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessYandexType string +type AccessIdentityProviderNewResponseAccessYandexType string const ( - AccessIdentityProviderUpdateResponseAccessYandexTypeOnetimepin AccessIdentityProviderUpdateResponseAccessYandexType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessYandexTypeAzureAd AccessIdentityProviderUpdateResponseAccessYandexType = "azureAD" - AccessIdentityProviderUpdateResponseAccessYandexTypeSaml AccessIdentityProviderUpdateResponseAccessYandexType = "saml" - AccessIdentityProviderUpdateResponseAccessYandexTypeCentrify AccessIdentityProviderUpdateResponseAccessYandexType = "centrify" - AccessIdentityProviderUpdateResponseAccessYandexTypeFacebook AccessIdentityProviderUpdateResponseAccessYandexType = "facebook" - AccessIdentityProviderUpdateResponseAccessYandexTypeGitHub AccessIdentityProviderUpdateResponseAccessYandexType = "github" - AccessIdentityProviderUpdateResponseAccessYandexTypeGoogleApps AccessIdentityProviderUpdateResponseAccessYandexType = "google-apps" - AccessIdentityProviderUpdateResponseAccessYandexTypeGoogle AccessIdentityProviderUpdateResponseAccessYandexType = "google" - AccessIdentityProviderUpdateResponseAccessYandexTypeLinkedin AccessIdentityProviderUpdateResponseAccessYandexType = "linkedin" - AccessIdentityProviderUpdateResponseAccessYandexTypeOidc AccessIdentityProviderUpdateResponseAccessYandexType = "oidc" - AccessIdentityProviderUpdateResponseAccessYandexTypeOkta AccessIdentityProviderUpdateResponseAccessYandexType = "okta" - AccessIdentityProviderUpdateResponseAccessYandexTypeOnelogin AccessIdentityProviderUpdateResponseAccessYandexType = "onelogin" - AccessIdentityProviderUpdateResponseAccessYandexTypePingone AccessIdentityProviderUpdateResponseAccessYandexType = "pingone" - AccessIdentityProviderUpdateResponseAccessYandexTypeYandex AccessIdentityProviderUpdateResponseAccessYandexType = "yandex" + AccessIdentityProviderNewResponseAccessYandexTypeOnetimepin AccessIdentityProviderNewResponseAccessYandexType = "onetimepin" + AccessIdentityProviderNewResponseAccessYandexTypeAzureAd AccessIdentityProviderNewResponseAccessYandexType = "azureAD" + AccessIdentityProviderNewResponseAccessYandexTypeSaml AccessIdentityProviderNewResponseAccessYandexType = "saml" + AccessIdentityProviderNewResponseAccessYandexTypeCentrify AccessIdentityProviderNewResponseAccessYandexType = "centrify" + AccessIdentityProviderNewResponseAccessYandexTypeFacebook AccessIdentityProviderNewResponseAccessYandexType = "facebook" + AccessIdentityProviderNewResponseAccessYandexTypeGitHub AccessIdentityProviderNewResponseAccessYandexType = "github" + AccessIdentityProviderNewResponseAccessYandexTypeGoogleApps AccessIdentityProviderNewResponseAccessYandexType = "google-apps" + AccessIdentityProviderNewResponseAccessYandexTypeGoogle AccessIdentityProviderNewResponseAccessYandexType = "google" + AccessIdentityProviderNewResponseAccessYandexTypeLinkedin AccessIdentityProviderNewResponseAccessYandexType = "linkedin" + AccessIdentityProviderNewResponseAccessYandexTypeOidc AccessIdentityProviderNewResponseAccessYandexType = "oidc" + AccessIdentityProviderNewResponseAccessYandexTypeOkta AccessIdentityProviderNewResponseAccessYandexType = "okta" + AccessIdentityProviderNewResponseAccessYandexTypeOnelogin AccessIdentityProviderNewResponseAccessYandexType = "onelogin" + AccessIdentityProviderNewResponseAccessYandexTypePingone AccessIdentityProviderNewResponseAccessYandexType = "pingone" + AccessIdentityProviderNewResponseAccessYandexTypeYandex AccessIdentityProviderNewResponseAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessYandexScimConfig struct { +type AccessIdentityProviderNewResponseAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1847,14 +1835,14 @@ type AccessIdentityProviderUpdateResponseAccessYandexScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessYandexScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessYandexScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessYandexScimConfigJSON contains the JSON +// accessIdentityProviderNewResponseAccessYandexScimConfigJSON contains the JSON // metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessYandexScimConfig] -type accessIdentityProviderUpdateResponseAccessYandexScimConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessYandexScimConfig] +type accessIdentityProviderNewResponseAccessYandexScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1864,11 +1852,11 @@ type accessIdentityProviderUpdateResponseAccessYandexScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseAccessOnetimepin struct { +type AccessIdentityProviderNewResponseAccessOnetimepin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). @@ -1878,18 +1866,18 @@ type AccessIdentityProviderUpdateResponseAccessOnetimepin struct { // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderUpdateResponseAccessOnetimepinType `json:"type,required"` + Type AccessIdentityProviderNewResponseAccessOnetimepinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderUpdateResponseAccessOnetimepinScimConfig `json:"scim_config"` - JSON accessIdentityProviderUpdateResponseAccessOnetimepinJSON `json:"-"` + ScimConfig AccessIdentityProviderNewResponseAccessOnetimepinScimConfig `json:"scim_config"` + JSON accessIdentityProviderNewResponseAccessOnetimepinJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOnetimepinJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseAccessOnetimepin] -type accessIdentityProviderUpdateResponseAccessOnetimepinJSON struct { +// accessIdentityProviderNewResponseAccessOnetimepinJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseAccessOnetimepin] +type accessIdentityProviderNewResponseAccessOnetimepinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -1899,38 +1887,38 @@ type accessIdentityProviderUpdateResponseAccessOnetimepinJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderUpdateResponseAccessOnetimepin) implementsAccessIdentityProviderUpdateResponse() { +func (r AccessIdentityProviderNewResponseAccessOnetimepin) implementsAccessIdentityProviderNewResponse() { } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateResponseAccessOnetimepinType string +type AccessIdentityProviderNewResponseAccessOnetimepinType string const ( - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderUpdateResponseAccessOnetimepinType = "onetimepin" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderUpdateResponseAccessOnetimepinType = "azureAD" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeSaml AccessIdentityProviderUpdateResponseAccessOnetimepinType = "saml" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeCentrify AccessIdentityProviderUpdateResponseAccessOnetimepinType = "centrify" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeFacebook AccessIdentityProviderUpdateResponseAccessOnetimepinType = "facebook" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeGitHub AccessIdentityProviderUpdateResponseAccessOnetimepinType = "github" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderUpdateResponseAccessOnetimepinType = "google-apps" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeGoogle AccessIdentityProviderUpdateResponseAccessOnetimepinType = "google" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderUpdateResponseAccessOnetimepinType = "linkedin" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeOidc AccessIdentityProviderUpdateResponseAccessOnetimepinType = "oidc" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeOkta AccessIdentityProviderUpdateResponseAccessOnetimepinType = "okta" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderUpdateResponseAccessOnetimepinType = "onelogin" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypePingone AccessIdentityProviderUpdateResponseAccessOnetimepinType = "pingone" - AccessIdentityProviderUpdateResponseAccessOnetimepinTypeYandex AccessIdentityProviderUpdateResponseAccessOnetimepinType = "yandex" + AccessIdentityProviderNewResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderNewResponseAccessOnetimepinType = "onetimepin" + AccessIdentityProviderNewResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderNewResponseAccessOnetimepinType = "azureAD" + AccessIdentityProviderNewResponseAccessOnetimepinTypeSaml AccessIdentityProviderNewResponseAccessOnetimepinType = "saml" + AccessIdentityProviderNewResponseAccessOnetimepinTypeCentrify AccessIdentityProviderNewResponseAccessOnetimepinType = "centrify" + AccessIdentityProviderNewResponseAccessOnetimepinTypeFacebook AccessIdentityProviderNewResponseAccessOnetimepinType = "facebook" + AccessIdentityProviderNewResponseAccessOnetimepinTypeGitHub AccessIdentityProviderNewResponseAccessOnetimepinType = "github" + AccessIdentityProviderNewResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderNewResponseAccessOnetimepinType = "google-apps" + AccessIdentityProviderNewResponseAccessOnetimepinTypeGoogle AccessIdentityProviderNewResponseAccessOnetimepinType = "google" + AccessIdentityProviderNewResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderNewResponseAccessOnetimepinType = "linkedin" + AccessIdentityProviderNewResponseAccessOnetimepinTypeOidc AccessIdentityProviderNewResponseAccessOnetimepinType = "oidc" + AccessIdentityProviderNewResponseAccessOnetimepinTypeOkta AccessIdentityProviderNewResponseAccessOnetimepinType = "okta" + AccessIdentityProviderNewResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderNewResponseAccessOnetimepinType = "onelogin" + AccessIdentityProviderNewResponseAccessOnetimepinTypePingone AccessIdentityProviderNewResponseAccessOnetimepinType = "pingone" + AccessIdentityProviderNewResponseAccessOnetimepinTypeYandex AccessIdentityProviderNewResponseAccessOnetimepinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateResponseAccessOnetimepinScimConfig struct { +type AccessIdentityProviderNewResponseAccessOnetimepinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -1947,14 +1935,14 @@ type AccessIdentityProviderUpdateResponseAccessOnetimepinScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderUpdateResponseAccessOnetimepinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderNewResponseAccessOnetimepinScimConfigJSON `json:"-"` } -// accessIdentityProviderUpdateResponseAccessOnetimepinScimConfigJSON contains the +// accessIdentityProviderNewResponseAccessOnetimepinScimConfigJSON contains the // JSON metadata for the struct -// [AccessIdentityProviderUpdateResponseAccessOnetimepinScimConfig] -type accessIdentityProviderUpdateResponseAccessOnetimepinScimConfigJSON struct { +// [AccessIdentityProviderNewResponseAccessOnetimepinScimConfig] +type accessIdentityProviderNewResponseAccessOnetimepinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -1964,75 +1952,53 @@ type accessIdentityProviderUpdateResponseAccessOnetimepinScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderDeleteResponse struct { - // UUID - ID string `json:"id"` - JSON accessIdentityProviderDeleteResponseJSON `json:"-"` -} - -// accessIdentityProviderDeleteResponseJSON contains the JSON metadata for the -// struct [AccessIdentityProviderDeleteResponse] -type accessIdentityProviderDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderNewResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAd], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrify], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebook], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHub], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogle], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleApps], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedin], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidc], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOkta], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnelogin], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingone], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSaml], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandex] -// or -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepin]. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse interface { - implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() +// Union satisfied by [AccessIdentityProviderListResponseAccessAzureAd], +// [AccessIdentityProviderListResponseAccessCentrify], +// [AccessIdentityProviderListResponseAccessFacebook], +// [AccessIdentityProviderListResponseAccessGitHub], +// [AccessIdentityProviderListResponseAccessGoogle], +// [AccessIdentityProviderListResponseAccessGoogleApps], +// [AccessIdentityProviderListResponseAccessLinkedin], +// [AccessIdentityProviderListResponseAccessOidc], +// [AccessIdentityProviderListResponseAccessOkta], +// [AccessIdentityProviderListResponseAccessOnelogin], +// [AccessIdentityProviderListResponseAccessPingone], +// [AccessIdentityProviderListResponseAccessSaml] or +// [AccessIdentityProviderListResponseAccessYandex]. +type AccessIdentityProviderListResponse interface { + implementsAccessIdentityProviderListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderListResponse)(nil)).Elem(), "") } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAd struct { +type AccessIdentityProviderListResponseAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessAzureAdConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessAzureAdType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessAzureAdScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessAzureAdJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAd] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdJSON struct { +// accessIdentityProviderListResponseAccessAzureAdJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessAzureAd] +type accessIdentityProviderListResponseAccessAzureAdJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2042,17 +2008,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAd) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessAzureAd) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfig struct { +type AccessIdentityProviderListResponseAccessAzureAdConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -2066,14 +2032,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Should Cloudflare try to load groups from your account - SupportGroups bool `json:"support_groups"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfigJSON `json:"-"` + SupportGroups bool `json:"support_groups"` + JSON accessIdentityProviderListResponseAccessAzureAdConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfigJSON struct { +// accessIdentityProviderListResponseAccessAzureAdConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessAzureAdConfig] +type accessIdentityProviderListResponseAccessAzureAdConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -2085,35 +2050,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType string +type AccessIdentityProviderListResponseAccessAzureAdType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdType = "yandex" + AccessIdentityProviderListResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderListResponseAccessAzureAdType = "onetimepin" + AccessIdentityProviderListResponseAccessAzureAdTypeAzureAd AccessIdentityProviderListResponseAccessAzureAdType = "azureAD" + AccessIdentityProviderListResponseAccessAzureAdTypeSaml AccessIdentityProviderListResponseAccessAzureAdType = "saml" + AccessIdentityProviderListResponseAccessAzureAdTypeCentrify AccessIdentityProviderListResponseAccessAzureAdType = "centrify" + AccessIdentityProviderListResponseAccessAzureAdTypeFacebook AccessIdentityProviderListResponseAccessAzureAdType = "facebook" + AccessIdentityProviderListResponseAccessAzureAdTypeGitHub AccessIdentityProviderListResponseAccessAzureAdType = "github" + AccessIdentityProviderListResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderListResponseAccessAzureAdType = "google-apps" + AccessIdentityProviderListResponseAccessAzureAdTypeGoogle AccessIdentityProviderListResponseAccessAzureAdType = "google" + AccessIdentityProviderListResponseAccessAzureAdTypeLinkedin AccessIdentityProviderListResponseAccessAzureAdType = "linkedin" + AccessIdentityProviderListResponseAccessAzureAdTypeOidc AccessIdentityProviderListResponseAccessAzureAdType = "oidc" + AccessIdentityProviderListResponseAccessAzureAdTypeOkta AccessIdentityProviderListResponseAccessAzureAdType = "okta" + AccessIdentityProviderListResponseAccessAzureAdTypeOnelogin AccessIdentityProviderListResponseAccessAzureAdType = "onelogin" + AccessIdentityProviderListResponseAccessAzureAdTypePingone AccessIdentityProviderListResponseAccessAzureAdType = "pingone" + AccessIdentityProviderListResponseAccessAzureAdTypeYandex AccessIdentityProviderListResponseAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfig struct { +type AccessIdentityProviderListResponseAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2130,14 +2095,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessAzureAdScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfigJSON struct { +// accessIdentityProviderListResponseAccessAzureAdScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessAzureAdScimConfig] +type accessIdentityProviderListResponseAccessAzureAdScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2147,33 +2112,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrify struct { +type AccessIdentityProviderListResponseAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessCentrifyConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessCentrifyType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessCentrifyScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessCentrifyJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrify] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyJSON struct { +// accessIdentityProviderListResponseAccessCentrifyJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessCentrify] +type accessIdentityProviderListResponseAccessCentrifyJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2183,17 +2147,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrify) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessCentrify) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfig struct { +type AccessIdentityProviderListResponseAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount string `json:"centrify_account"` // Your centrify app id @@ -2205,14 +2169,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderListResponseAccessCentrifyConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfigJSON struct { +// accessIdentityProviderListResponseAccessCentrifyConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessCentrifyConfig] +type accessIdentityProviderListResponseAccessCentrifyConfigJSON struct { CentrifyAccount apijson.Field CentrifyAppID apijson.Field Claims apijson.Field @@ -2223,35 +2186,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType string +type AccessIdentityProviderListResponseAccessCentrifyType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyType = "yandex" + AccessIdentityProviderListResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderListResponseAccessCentrifyType = "onetimepin" + AccessIdentityProviderListResponseAccessCentrifyTypeAzureAd AccessIdentityProviderListResponseAccessCentrifyType = "azureAD" + AccessIdentityProviderListResponseAccessCentrifyTypeSaml AccessIdentityProviderListResponseAccessCentrifyType = "saml" + AccessIdentityProviderListResponseAccessCentrifyTypeCentrify AccessIdentityProviderListResponseAccessCentrifyType = "centrify" + AccessIdentityProviderListResponseAccessCentrifyTypeFacebook AccessIdentityProviderListResponseAccessCentrifyType = "facebook" + AccessIdentityProviderListResponseAccessCentrifyTypeGitHub AccessIdentityProviderListResponseAccessCentrifyType = "github" + AccessIdentityProviderListResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderListResponseAccessCentrifyType = "google-apps" + AccessIdentityProviderListResponseAccessCentrifyTypeGoogle AccessIdentityProviderListResponseAccessCentrifyType = "google" + AccessIdentityProviderListResponseAccessCentrifyTypeLinkedin AccessIdentityProviderListResponseAccessCentrifyType = "linkedin" + AccessIdentityProviderListResponseAccessCentrifyTypeOidc AccessIdentityProviderListResponseAccessCentrifyType = "oidc" + AccessIdentityProviderListResponseAccessCentrifyTypeOkta AccessIdentityProviderListResponseAccessCentrifyType = "okta" + AccessIdentityProviderListResponseAccessCentrifyTypeOnelogin AccessIdentityProviderListResponseAccessCentrifyType = "onelogin" + AccessIdentityProviderListResponseAccessCentrifyTypePingone AccessIdentityProviderListResponseAccessCentrifyType = "pingone" + AccessIdentityProviderListResponseAccessCentrifyTypeYandex AccessIdentityProviderListResponseAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfig struct { +type AccessIdentityProviderListResponseAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2268,14 +2231,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessCentrifyScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfigJSON struct { +// accessIdentityProviderListResponseAccessCentrifyScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessCentrifyScimConfig] +type accessIdentityProviderListResponseAccessCentrifyScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2285,33 +2248,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebook struct { +type AccessIdentityProviderListResponseAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessFacebookConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessFacebookType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessFacebookScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessFacebookJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebook] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookJSON struct { +// accessIdentityProviderListResponseAccessFacebookJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessFacebook] +type accessIdentityProviderListResponseAccessFacebookJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2321,63 +2283,62 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebook) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessFacebook) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfig struct { +type AccessIdentityProviderListResponseAccessFacebookConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderListResponseAccessFacebookConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfigJSON struct { +// accessIdentityProviderListResponseAccessFacebookConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessFacebookConfig] +type accessIdentityProviderListResponseAccessFacebookConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType string +type AccessIdentityProviderListResponseAccessFacebookType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookType = "yandex" + AccessIdentityProviderListResponseAccessFacebookTypeOnetimepin AccessIdentityProviderListResponseAccessFacebookType = "onetimepin" + AccessIdentityProviderListResponseAccessFacebookTypeAzureAd AccessIdentityProviderListResponseAccessFacebookType = "azureAD" + AccessIdentityProviderListResponseAccessFacebookTypeSaml AccessIdentityProviderListResponseAccessFacebookType = "saml" + AccessIdentityProviderListResponseAccessFacebookTypeCentrify AccessIdentityProviderListResponseAccessFacebookType = "centrify" + AccessIdentityProviderListResponseAccessFacebookTypeFacebook AccessIdentityProviderListResponseAccessFacebookType = "facebook" + AccessIdentityProviderListResponseAccessFacebookTypeGitHub AccessIdentityProviderListResponseAccessFacebookType = "github" + AccessIdentityProviderListResponseAccessFacebookTypeGoogleApps AccessIdentityProviderListResponseAccessFacebookType = "google-apps" + AccessIdentityProviderListResponseAccessFacebookTypeGoogle AccessIdentityProviderListResponseAccessFacebookType = "google" + AccessIdentityProviderListResponseAccessFacebookTypeLinkedin AccessIdentityProviderListResponseAccessFacebookType = "linkedin" + AccessIdentityProviderListResponseAccessFacebookTypeOidc AccessIdentityProviderListResponseAccessFacebookType = "oidc" + AccessIdentityProviderListResponseAccessFacebookTypeOkta AccessIdentityProviderListResponseAccessFacebookType = "okta" + AccessIdentityProviderListResponseAccessFacebookTypeOnelogin AccessIdentityProviderListResponseAccessFacebookType = "onelogin" + AccessIdentityProviderListResponseAccessFacebookTypePingone AccessIdentityProviderListResponseAccessFacebookType = "pingone" + AccessIdentityProviderListResponseAccessFacebookTypeYandex AccessIdentityProviderListResponseAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfig struct { +type AccessIdentityProviderListResponseAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2394,14 +2355,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessFacebookScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfigJSON struct { +// accessIdentityProviderListResponseAccessFacebookScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessFacebookScimConfig] +type accessIdentityProviderListResponseAccessFacebookScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2411,33 +2372,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHub struct { +type AccessIdentityProviderListResponseAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessGitHubConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessGitHubType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessGitHubScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessGitHubJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHub] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubJSON struct { +// accessIdentityProviderListResponseAccessGitHubJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessGitHub] +type accessIdentityProviderListResponseAccessGitHubJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2447,63 +2407,62 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHub) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessGitHub) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfig struct { +type AccessIdentityProviderListResponseAccessGitHubConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderListResponseAccessGitHubConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfigJSON struct { +// accessIdentityProviderListResponseAccessGitHubConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessGitHubConfig] +type accessIdentityProviderListResponseAccessGitHubConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType string +type AccessIdentityProviderListResponseAccessGitHubType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubType = "yandex" + AccessIdentityProviderListResponseAccessGitHubTypeOnetimepin AccessIdentityProviderListResponseAccessGitHubType = "onetimepin" + AccessIdentityProviderListResponseAccessGitHubTypeAzureAd AccessIdentityProviderListResponseAccessGitHubType = "azureAD" + AccessIdentityProviderListResponseAccessGitHubTypeSaml AccessIdentityProviderListResponseAccessGitHubType = "saml" + AccessIdentityProviderListResponseAccessGitHubTypeCentrify AccessIdentityProviderListResponseAccessGitHubType = "centrify" + AccessIdentityProviderListResponseAccessGitHubTypeFacebook AccessIdentityProviderListResponseAccessGitHubType = "facebook" + AccessIdentityProviderListResponseAccessGitHubTypeGitHub AccessIdentityProviderListResponseAccessGitHubType = "github" + AccessIdentityProviderListResponseAccessGitHubTypeGoogleApps AccessIdentityProviderListResponseAccessGitHubType = "google-apps" + AccessIdentityProviderListResponseAccessGitHubTypeGoogle AccessIdentityProviderListResponseAccessGitHubType = "google" + AccessIdentityProviderListResponseAccessGitHubTypeLinkedin AccessIdentityProviderListResponseAccessGitHubType = "linkedin" + AccessIdentityProviderListResponseAccessGitHubTypeOidc AccessIdentityProviderListResponseAccessGitHubType = "oidc" + AccessIdentityProviderListResponseAccessGitHubTypeOkta AccessIdentityProviderListResponseAccessGitHubType = "okta" + AccessIdentityProviderListResponseAccessGitHubTypeOnelogin AccessIdentityProviderListResponseAccessGitHubType = "onelogin" + AccessIdentityProviderListResponseAccessGitHubTypePingone AccessIdentityProviderListResponseAccessGitHubType = "pingone" + AccessIdentityProviderListResponseAccessGitHubTypeYandex AccessIdentityProviderListResponseAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfig struct { +type AccessIdentityProviderListResponseAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2520,14 +2479,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessGitHubScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfigJSON struct { +// accessIdentityProviderListResponseAccessGitHubScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessGitHubScimConfig] +type accessIdentityProviderListResponseAccessGitHubScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2537,33 +2496,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogle struct { +type AccessIdentityProviderListResponseAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessGoogleConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessGoogleType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessGoogleScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessGoogleJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogle] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleJSON struct { +// accessIdentityProviderListResponseAccessGoogleJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessGoogle] +type accessIdentityProviderListResponseAccessGoogleJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2573,17 +2531,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogle) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessGoogle) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfig struct { +type AccessIdentityProviderListResponseAccessGoogleConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -2591,14 +2549,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderListResponseAccessGoogleConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfigJSON struct { +// accessIdentityProviderListResponseAccessGoogleConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessGoogleConfig] +type accessIdentityProviderListResponseAccessGoogleConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -2607,35 +2564,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType string +type AccessIdentityProviderListResponseAccessGoogleType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleType = "yandex" + AccessIdentityProviderListResponseAccessGoogleTypeOnetimepin AccessIdentityProviderListResponseAccessGoogleType = "onetimepin" + AccessIdentityProviderListResponseAccessGoogleTypeAzureAd AccessIdentityProviderListResponseAccessGoogleType = "azureAD" + AccessIdentityProviderListResponseAccessGoogleTypeSaml AccessIdentityProviderListResponseAccessGoogleType = "saml" + AccessIdentityProviderListResponseAccessGoogleTypeCentrify AccessIdentityProviderListResponseAccessGoogleType = "centrify" + AccessIdentityProviderListResponseAccessGoogleTypeFacebook AccessIdentityProviderListResponseAccessGoogleType = "facebook" + AccessIdentityProviderListResponseAccessGoogleTypeGitHub AccessIdentityProviderListResponseAccessGoogleType = "github" + AccessIdentityProviderListResponseAccessGoogleTypeGoogleApps AccessIdentityProviderListResponseAccessGoogleType = "google-apps" + AccessIdentityProviderListResponseAccessGoogleTypeGoogle AccessIdentityProviderListResponseAccessGoogleType = "google" + AccessIdentityProviderListResponseAccessGoogleTypeLinkedin AccessIdentityProviderListResponseAccessGoogleType = "linkedin" + AccessIdentityProviderListResponseAccessGoogleTypeOidc AccessIdentityProviderListResponseAccessGoogleType = "oidc" + AccessIdentityProviderListResponseAccessGoogleTypeOkta AccessIdentityProviderListResponseAccessGoogleType = "okta" + AccessIdentityProviderListResponseAccessGoogleTypeOnelogin AccessIdentityProviderListResponseAccessGoogleType = "onelogin" + AccessIdentityProviderListResponseAccessGoogleTypePingone AccessIdentityProviderListResponseAccessGoogleType = "pingone" + AccessIdentityProviderListResponseAccessGoogleTypeYandex AccessIdentityProviderListResponseAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfig struct { +type AccessIdentityProviderListResponseAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2652,14 +2609,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessGoogleScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfigJSON struct { +// accessIdentityProviderListResponseAccessGoogleScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessGoogleScimConfig] +type accessIdentityProviderListResponseAccessGoogleScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2669,33 +2626,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleApps struct { +type AccessIdentityProviderListResponseAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessGoogleAppsConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessGoogleAppsType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessGoogleAppsScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessGoogleAppsJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleApps] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsJSON struct { +// accessIdentityProviderListResponseAccessGoogleAppsJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessGoogleApps] +type accessIdentityProviderListResponseAccessGoogleAppsJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2705,17 +2661,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleApps) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessGoogleApps) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfig struct { +type AccessIdentityProviderListResponseAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain string `json:"apps_domain"` // Custom claims @@ -2725,14 +2681,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderListResponseAccessGoogleAppsConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfigJSON struct { +// accessIdentityProviderListResponseAccessGoogleAppsConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessGoogleAppsConfig] +type accessIdentityProviderListResponseAccessGoogleAppsConfigJSON struct { AppsDomain apijson.Field Claims apijson.Field ClientID apijson.Field @@ -2742,35 +2698,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType string +type AccessIdentityProviderListResponseAccessGoogleAppsType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsType = "yandex" + AccessIdentityProviderListResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderListResponseAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderListResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderListResponseAccessGoogleAppsType = "azureAD" + AccessIdentityProviderListResponseAccessGoogleAppsTypeSaml AccessIdentityProviderListResponseAccessGoogleAppsType = "saml" + AccessIdentityProviderListResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderListResponseAccessGoogleAppsType = "centrify" + AccessIdentityProviderListResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderListResponseAccessGoogleAppsType = "facebook" + AccessIdentityProviderListResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderListResponseAccessGoogleAppsType = "github" + AccessIdentityProviderListResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderListResponseAccessGoogleAppsType = "google-apps" + AccessIdentityProviderListResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderListResponseAccessGoogleAppsType = "google" + AccessIdentityProviderListResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderListResponseAccessGoogleAppsType = "linkedin" + AccessIdentityProviderListResponseAccessGoogleAppsTypeOidc AccessIdentityProviderListResponseAccessGoogleAppsType = "oidc" + AccessIdentityProviderListResponseAccessGoogleAppsTypeOkta AccessIdentityProviderListResponseAccessGoogleAppsType = "okta" + AccessIdentityProviderListResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderListResponseAccessGoogleAppsType = "onelogin" + AccessIdentityProviderListResponseAccessGoogleAppsTypePingone AccessIdentityProviderListResponseAccessGoogleAppsType = "pingone" + AccessIdentityProviderListResponseAccessGoogleAppsTypeYandex AccessIdentityProviderListResponseAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderListResponseAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2787,14 +2743,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessGoogleAppsScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfigJSON struct { +// accessIdentityProviderListResponseAccessGoogleAppsScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderListResponseAccessGoogleAppsScimConfig] +type accessIdentityProviderListResponseAccessGoogleAppsScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2804,33 +2760,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedin struct { +type AccessIdentityProviderListResponseAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessLinkedinConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessLinkedinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessLinkedinScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessLinkedinJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedin] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinJSON struct { +// accessIdentityProviderListResponseAccessLinkedinJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessLinkedin] +type accessIdentityProviderListResponseAccessLinkedinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2840,63 +2795,62 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedin) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessLinkedin) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfig struct { +type AccessIdentityProviderListResponseAccessLinkedinConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderListResponseAccessLinkedinConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfigJSON struct { +// accessIdentityProviderListResponseAccessLinkedinConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessLinkedinConfig] +type accessIdentityProviderListResponseAccessLinkedinConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType string +type AccessIdentityProviderListResponseAccessLinkedinType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinType = "yandex" + AccessIdentityProviderListResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderListResponseAccessLinkedinType = "onetimepin" + AccessIdentityProviderListResponseAccessLinkedinTypeAzureAd AccessIdentityProviderListResponseAccessLinkedinType = "azureAD" + AccessIdentityProviderListResponseAccessLinkedinTypeSaml AccessIdentityProviderListResponseAccessLinkedinType = "saml" + AccessIdentityProviderListResponseAccessLinkedinTypeCentrify AccessIdentityProviderListResponseAccessLinkedinType = "centrify" + AccessIdentityProviderListResponseAccessLinkedinTypeFacebook AccessIdentityProviderListResponseAccessLinkedinType = "facebook" + AccessIdentityProviderListResponseAccessLinkedinTypeGitHub AccessIdentityProviderListResponseAccessLinkedinType = "github" + AccessIdentityProviderListResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderListResponseAccessLinkedinType = "google-apps" + AccessIdentityProviderListResponseAccessLinkedinTypeGoogle AccessIdentityProviderListResponseAccessLinkedinType = "google" + AccessIdentityProviderListResponseAccessLinkedinTypeLinkedin AccessIdentityProviderListResponseAccessLinkedinType = "linkedin" + AccessIdentityProviderListResponseAccessLinkedinTypeOidc AccessIdentityProviderListResponseAccessLinkedinType = "oidc" + AccessIdentityProviderListResponseAccessLinkedinTypeOkta AccessIdentityProviderListResponseAccessLinkedinType = "okta" + AccessIdentityProviderListResponseAccessLinkedinTypeOnelogin AccessIdentityProviderListResponseAccessLinkedinType = "onelogin" + AccessIdentityProviderListResponseAccessLinkedinTypePingone AccessIdentityProviderListResponseAccessLinkedinType = "pingone" + AccessIdentityProviderListResponseAccessLinkedinTypeYandex AccessIdentityProviderListResponseAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfig struct { +type AccessIdentityProviderListResponseAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -2913,14 +2867,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessLinkedinScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfigJSON struct { +// accessIdentityProviderListResponseAccessLinkedinScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessLinkedinScimConfig] +type accessIdentityProviderListResponseAccessLinkedinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -2930,33 +2884,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidc struct { +type AccessIdentityProviderListResponseAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessOidcConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessOidcType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessOidcScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessOidcJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidc] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcJSON struct { +// accessIdentityProviderListResponseAccessOidcJSON contains the JSON metadata for +// the struct [AccessIdentityProviderListResponseAccessOidc] +type accessIdentityProviderListResponseAccessOidcJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -2966,17 +2919,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidc) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessOidc) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfig struct { +type AccessIdentityProviderListResponseAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL string `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -2992,14 +2945,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // OAuth scopes Scopes []string `json:"scopes"` // The token_endpoint URL of your IdP - TokenURL string `json:"token_url"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfigJSON `json:"-"` + TokenURL string `json:"token_url"` + JSON accessIdentityProviderListResponseAccessOidcConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfigJSON struct { +// accessIdentityProviderListResponseAccessOidcConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessOidcConfig] +type accessIdentityProviderListResponseAccessOidcConfigJSON struct { AuthURL apijson.Field CertsURL apijson.Field Claims apijson.Field @@ -3012,35 +2964,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType string +type AccessIdentityProviderListResponseAccessOidcType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcType = "yandex" + AccessIdentityProviderListResponseAccessOidcTypeOnetimepin AccessIdentityProviderListResponseAccessOidcType = "onetimepin" + AccessIdentityProviderListResponseAccessOidcTypeAzureAd AccessIdentityProviderListResponseAccessOidcType = "azureAD" + AccessIdentityProviderListResponseAccessOidcTypeSaml AccessIdentityProviderListResponseAccessOidcType = "saml" + AccessIdentityProviderListResponseAccessOidcTypeCentrify AccessIdentityProviderListResponseAccessOidcType = "centrify" + AccessIdentityProviderListResponseAccessOidcTypeFacebook AccessIdentityProviderListResponseAccessOidcType = "facebook" + AccessIdentityProviderListResponseAccessOidcTypeGitHub AccessIdentityProviderListResponseAccessOidcType = "github" + AccessIdentityProviderListResponseAccessOidcTypeGoogleApps AccessIdentityProviderListResponseAccessOidcType = "google-apps" + AccessIdentityProviderListResponseAccessOidcTypeGoogle AccessIdentityProviderListResponseAccessOidcType = "google" + AccessIdentityProviderListResponseAccessOidcTypeLinkedin AccessIdentityProviderListResponseAccessOidcType = "linkedin" + AccessIdentityProviderListResponseAccessOidcTypeOidc AccessIdentityProviderListResponseAccessOidcType = "oidc" + AccessIdentityProviderListResponseAccessOidcTypeOkta AccessIdentityProviderListResponseAccessOidcType = "okta" + AccessIdentityProviderListResponseAccessOidcTypeOnelogin AccessIdentityProviderListResponseAccessOidcType = "onelogin" + AccessIdentityProviderListResponseAccessOidcTypePingone AccessIdentityProviderListResponseAccessOidcType = "pingone" + AccessIdentityProviderListResponseAccessOidcTypeYandex AccessIdentityProviderListResponseAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfig struct { +type AccessIdentityProviderListResponseAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3057,14 +3009,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessOidcScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfigJSON struct { +// accessIdentityProviderListResponseAccessOidcScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessOidcScimConfig] +type accessIdentityProviderListResponseAccessOidcScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3074,33 +3025,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOkta struct { +type AccessIdentityProviderListResponseAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessOktaConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessOktaType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessOktaScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessOktaJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOkta] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaJSON struct { +// accessIdentityProviderListResponseAccessOktaJSON contains the JSON metadata for +// the struct [AccessIdentityProviderListResponseAccessOkta] +type accessIdentityProviderListResponseAccessOktaJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3110,17 +3060,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOkta) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessOkta) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfig struct { +type AccessIdentityProviderListResponseAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID string `json:"authorization_server_id"` // Custom claims @@ -3132,14 +3082,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your okta account url - OktaAccount string `json:"okta_account"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfigJSON `json:"-"` + OktaAccount string `json:"okta_account"` + JSON accessIdentityProviderListResponseAccessOktaConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfigJSON struct { +// accessIdentityProviderListResponseAccessOktaConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessOktaConfig] +type accessIdentityProviderListResponseAccessOktaConfigJSON struct { AuthorizationServerID apijson.Field Claims apijson.Field ClientID apijson.Field @@ -3150,35 +3099,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType string +type AccessIdentityProviderListResponseAccessOktaType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaType = "yandex" + AccessIdentityProviderListResponseAccessOktaTypeOnetimepin AccessIdentityProviderListResponseAccessOktaType = "onetimepin" + AccessIdentityProviderListResponseAccessOktaTypeAzureAd AccessIdentityProviderListResponseAccessOktaType = "azureAD" + AccessIdentityProviderListResponseAccessOktaTypeSaml AccessIdentityProviderListResponseAccessOktaType = "saml" + AccessIdentityProviderListResponseAccessOktaTypeCentrify AccessIdentityProviderListResponseAccessOktaType = "centrify" + AccessIdentityProviderListResponseAccessOktaTypeFacebook AccessIdentityProviderListResponseAccessOktaType = "facebook" + AccessIdentityProviderListResponseAccessOktaTypeGitHub AccessIdentityProviderListResponseAccessOktaType = "github" + AccessIdentityProviderListResponseAccessOktaTypeGoogleApps AccessIdentityProviderListResponseAccessOktaType = "google-apps" + AccessIdentityProviderListResponseAccessOktaTypeGoogle AccessIdentityProviderListResponseAccessOktaType = "google" + AccessIdentityProviderListResponseAccessOktaTypeLinkedin AccessIdentityProviderListResponseAccessOktaType = "linkedin" + AccessIdentityProviderListResponseAccessOktaTypeOidc AccessIdentityProviderListResponseAccessOktaType = "oidc" + AccessIdentityProviderListResponseAccessOktaTypeOkta AccessIdentityProviderListResponseAccessOktaType = "okta" + AccessIdentityProviderListResponseAccessOktaTypeOnelogin AccessIdentityProviderListResponseAccessOktaType = "onelogin" + AccessIdentityProviderListResponseAccessOktaTypePingone AccessIdentityProviderListResponseAccessOktaType = "pingone" + AccessIdentityProviderListResponseAccessOktaTypeYandex AccessIdentityProviderListResponseAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfig struct { +type AccessIdentityProviderListResponseAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3195,14 +3144,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessOktaScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfigJSON struct { +// accessIdentityProviderListResponseAccessOktaScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessOktaScimConfig] +type accessIdentityProviderListResponseAccessOktaScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3212,33 +3160,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnelogin struct { +type AccessIdentityProviderListResponseAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessOneloginConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessOneloginType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessOneloginScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessOneloginJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnelogin] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginJSON struct { +// accessIdentityProviderListResponseAccessOneloginJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessOnelogin] +type accessIdentityProviderListResponseAccessOneloginJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3248,17 +3195,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnelogin) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessOnelogin) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfig struct { +type AccessIdentityProviderListResponseAccessOneloginConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -3268,14 +3215,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your OneLogin account url - OneloginAccount string `json:"onelogin_account"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfigJSON `json:"-"` + OneloginAccount string `json:"onelogin_account"` + JSON accessIdentityProviderListResponseAccessOneloginConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfigJSON struct { +// accessIdentityProviderListResponseAccessOneloginConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessOneloginConfig] +type accessIdentityProviderListResponseAccessOneloginConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -3285,35 +3231,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType string +type AccessIdentityProviderListResponseAccessOneloginType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginType = "yandex" + AccessIdentityProviderListResponseAccessOneloginTypeOnetimepin AccessIdentityProviderListResponseAccessOneloginType = "onetimepin" + AccessIdentityProviderListResponseAccessOneloginTypeAzureAd AccessIdentityProviderListResponseAccessOneloginType = "azureAD" + AccessIdentityProviderListResponseAccessOneloginTypeSaml AccessIdentityProviderListResponseAccessOneloginType = "saml" + AccessIdentityProviderListResponseAccessOneloginTypeCentrify AccessIdentityProviderListResponseAccessOneloginType = "centrify" + AccessIdentityProviderListResponseAccessOneloginTypeFacebook AccessIdentityProviderListResponseAccessOneloginType = "facebook" + AccessIdentityProviderListResponseAccessOneloginTypeGitHub AccessIdentityProviderListResponseAccessOneloginType = "github" + AccessIdentityProviderListResponseAccessOneloginTypeGoogleApps AccessIdentityProviderListResponseAccessOneloginType = "google-apps" + AccessIdentityProviderListResponseAccessOneloginTypeGoogle AccessIdentityProviderListResponseAccessOneloginType = "google" + AccessIdentityProviderListResponseAccessOneloginTypeLinkedin AccessIdentityProviderListResponseAccessOneloginType = "linkedin" + AccessIdentityProviderListResponseAccessOneloginTypeOidc AccessIdentityProviderListResponseAccessOneloginType = "oidc" + AccessIdentityProviderListResponseAccessOneloginTypeOkta AccessIdentityProviderListResponseAccessOneloginType = "okta" + AccessIdentityProviderListResponseAccessOneloginTypeOnelogin AccessIdentityProviderListResponseAccessOneloginType = "onelogin" + AccessIdentityProviderListResponseAccessOneloginTypePingone AccessIdentityProviderListResponseAccessOneloginType = "pingone" + AccessIdentityProviderListResponseAccessOneloginTypeYandex AccessIdentityProviderListResponseAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfig struct { +type AccessIdentityProviderListResponseAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3330,14 +3276,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessOneloginScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfigJSON struct { +// accessIdentityProviderListResponseAccessOneloginScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessOneloginScimConfig] +type accessIdentityProviderListResponseAccessOneloginScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3347,33 +3293,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingone struct { +type AccessIdentityProviderListResponseAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessPingoneConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessPingoneType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessPingoneScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessPingoneJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingone] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneJSON struct { +// accessIdentityProviderListResponseAccessPingoneJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessPingone] +type accessIdentityProviderListResponseAccessPingoneJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3383,17 +3328,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingone) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessPingone) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfig struct { +type AccessIdentityProviderListResponseAccessPingoneConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -3403,14 +3348,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your PingOne environment identifier - PingEnvID string `json:"ping_env_id"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfigJSON `json:"-"` + PingEnvID string `json:"ping_env_id"` + JSON accessIdentityProviderListResponseAccessPingoneConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfigJSON struct { +// accessIdentityProviderListResponseAccessPingoneConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessPingoneConfig] +type accessIdentityProviderListResponseAccessPingoneConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -3420,35 +3364,35 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType string +type AccessIdentityProviderListResponseAccessPingoneType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneType = "yandex" + AccessIdentityProviderListResponseAccessPingoneTypeOnetimepin AccessIdentityProviderListResponseAccessPingoneType = "onetimepin" + AccessIdentityProviderListResponseAccessPingoneTypeAzureAd AccessIdentityProviderListResponseAccessPingoneType = "azureAD" + AccessIdentityProviderListResponseAccessPingoneTypeSaml AccessIdentityProviderListResponseAccessPingoneType = "saml" + AccessIdentityProviderListResponseAccessPingoneTypeCentrify AccessIdentityProviderListResponseAccessPingoneType = "centrify" + AccessIdentityProviderListResponseAccessPingoneTypeFacebook AccessIdentityProviderListResponseAccessPingoneType = "facebook" + AccessIdentityProviderListResponseAccessPingoneTypeGitHub AccessIdentityProviderListResponseAccessPingoneType = "github" + AccessIdentityProviderListResponseAccessPingoneTypeGoogleApps AccessIdentityProviderListResponseAccessPingoneType = "google-apps" + AccessIdentityProviderListResponseAccessPingoneTypeGoogle AccessIdentityProviderListResponseAccessPingoneType = "google" + AccessIdentityProviderListResponseAccessPingoneTypeLinkedin AccessIdentityProviderListResponseAccessPingoneType = "linkedin" + AccessIdentityProviderListResponseAccessPingoneTypeOidc AccessIdentityProviderListResponseAccessPingoneType = "oidc" + AccessIdentityProviderListResponseAccessPingoneTypeOkta AccessIdentityProviderListResponseAccessPingoneType = "okta" + AccessIdentityProviderListResponseAccessPingoneTypeOnelogin AccessIdentityProviderListResponseAccessPingoneType = "onelogin" + AccessIdentityProviderListResponseAccessPingoneTypePingone AccessIdentityProviderListResponseAccessPingoneType = "pingone" + AccessIdentityProviderListResponseAccessPingoneTypeYandex AccessIdentityProviderListResponseAccessPingoneType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfig struct { +type AccessIdentityProviderListResponseAccessPingoneScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3465,14 +3409,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessPingoneScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfigJSON struct { +// accessIdentityProviderListResponseAccessPingoneScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessPingoneScimConfig] +type accessIdentityProviderListResponseAccessPingoneScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3482,33 +3426,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSaml struct { +type AccessIdentityProviderListResponseAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessSamlConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessSamlType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessSamlScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessSamlJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSaml] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlJSON struct { +// accessIdentityProviderListResponseAccessSamlJSON contains the JSON metadata for +// the struct [AccessIdentityProviderListResponseAccessSaml] +type accessIdentityProviderListResponseAccessSamlJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3518,17 +3461,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSaml) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessSaml) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfig struct { +type AccessIdentityProviderListResponseAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes []string `json:"attributes"` @@ -3536,7 +3479,7 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes EmailAttributeName string `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes []AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` + HeaderAttributes []AccessIdentityProviderListResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -3545,14 +3488,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes // signature, use the public key from the Access certs endpoints. SignRequest bool `json:"sign_request"` // URL to send the SAML authentication requests to - SSOTargetURL string `json:"sso_target_url"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigJSON `json:"-"` + SSOTargetURL string `json:"sso_target_url"` + JSON accessIdentityProviderListResponseAccessSamlConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigJSON struct { +// accessIdentityProviderListResponseAccessSamlConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessSamlConfig] +type accessIdentityProviderListResponseAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field @@ -3564,57 +3506,57 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderListResponseAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName string `json:"attribute_name"` // header that will be added on the request to the origin - HeaderName string `json:"header_name"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` + HeaderName string `json:"header_name"` + JSON accessIdentityProviderListResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttributeJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttribute] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttributeJSON struct { +// accessIdentityProviderListResponseAccessSamlConfigHeaderAttributeJSON contains +// the JSON metadata for the struct +// [AccessIdentityProviderListResponseAccessSamlConfigHeaderAttribute] +type accessIdentityProviderListResponseAccessSamlConfigHeaderAttributeJSON struct { AttributeName apijson.Field HeaderName apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType string +type AccessIdentityProviderListResponseAccessSamlType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlType = "yandex" + AccessIdentityProviderListResponseAccessSamlTypeOnetimepin AccessIdentityProviderListResponseAccessSamlType = "onetimepin" + AccessIdentityProviderListResponseAccessSamlTypeAzureAd AccessIdentityProviderListResponseAccessSamlType = "azureAD" + AccessIdentityProviderListResponseAccessSamlTypeSaml AccessIdentityProviderListResponseAccessSamlType = "saml" + AccessIdentityProviderListResponseAccessSamlTypeCentrify AccessIdentityProviderListResponseAccessSamlType = "centrify" + AccessIdentityProviderListResponseAccessSamlTypeFacebook AccessIdentityProviderListResponseAccessSamlType = "facebook" + AccessIdentityProviderListResponseAccessSamlTypeGitHub AccessIdentityProviderListResponseAccessSamlType = "github" + AccessIdentityProviderListResponseAccessSamlTypeGoogleApps AccessIdentityProviderListResponseAccessSamlType = "google-apps" + AccessIdentityProviderListResponseAccessSamlTypeGoogle AccessIdentityProviderListResponseAccessSamlType = "google" + AccessIdentityProviderListResponseAccessSamlTypeLinkedin AccessIdentityProviderListResponseAccessSamlType = "linkedin" + AccessIdentityProviderListResponseAccessSamlTypeOidc AccessIdentityProviderListResponseAccessSamlType = "oidc" + AccessIdentityProviderListResponseAccessSamlTypeOkta AccessIdentityProviderListResponseAccessSamlType = "okta" + AccessIdentityProviderListResponseAccessSamlTypeOnelogin AccessIdentityProviderListResponseAccessSamlType = "onelogin" + AccessIdentityProviderListResponseAccessSamlTypePingone AccessIdentityProviderListResponseAccessSamlType = "pingone" + AccessIdentityProviderListResponseAccessSamlTypeYandex AccessIdentityProviderListResponseAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfig struct { +type AccessIdentityProviderListResponseAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3631,14 +3573,13 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessSamlScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfigJSON struct { +// accessIdentityProviderListResponseAccessSamlScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessSamlScimConfig] +type accessIdentityProviderListResponseAccessSamlScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3648,33 +3589,32 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandex struct { +type AccessIdentityProviderListResponseAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfig `json:"config,required"` + Config AccessIdentityProviderListResponseAccessYandexConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType `json:"type,required"` + Type AccessIdentityProviderListResponseAccessYandexType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexJSON `json:"-"` + ScimConfig AccessIdentityProviderListResponseAccessYandexScimConfig `json:"scim_config"` + JSON accessIdentityProviderListResponseAccessYandexJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandex] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexJSON struct { +// accessIdentityProviderListResponseAccessYandexJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseAccessYandex] +type accessIdentityProviderListResponseAccessYandexJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3684,63 +3624,62 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandex) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderListResponseAccessYandex) implementsAccessIdentityProviderListResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfig struct { +type AccessIdentityProviderListResponseAccessYandexConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderListResponseAccessYandexConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfigJSON struct { +// accessIdentityProviderListResponseAccessYandexConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseAccessYandexConfig] +type accessIdentityProviderListResponseAccessYandexConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType string +type AccessIdentityProviderListResponseAccessYandexType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexType = "yandex" + AccessIdentityProviderListResponseAccessYandexTypeOnetimepin AccessIdentityProviderListResponseAccessYandexType = "onetimepin" + AccessIdentityProviderListResponseAccessYandexTypeAzureAd AccessIdentityProviderListResponseAccessYandexType = "azureAD" + AccessIdentityProviderListResponseAccessYandexTypeSaml AccessIdentityProviderListResponseAccessYandexType = "saml" + AccessIdentityProviderListResponseAccessYandexTypeCentrify AccessIdentityProviderListResponseAccessYandexType = "centrify" + AccessIdentityProviderListResponseAccessYandexTypeFacebook AccessIdentityProviderListResponseAccessYandexType = "facebook" + AccessIdentityProviderListResponseAccessYandexTypeGitHub AccessIdentityProviderListResponseAccessYandexType = "github" + AccessIdentityProviderListResponseAccessYandexTypeGoogleApps AccessIdentityProviderListResponseAccessYandexType = "google-apps" + AccessIdentityProviderListResponseAccessYandexTypeGoogle AccessIdentityProviderListResponseAccessYandexType = "google" + AccessIdentityProviderListResponseAccessYandexTypeLinkedin AccessIdentityProviderListResponseAccessYandexType = "linkedin" + AccessIdentityProviderListResponseAccessYandexTypeOidc AccessIdentityProviderListResponseAccessYandexType = "oidc" + AccessIdentityProviderListResponseAccessYandexTypeOkta AccessIdentityProviderListResponseAccessYandexType = "okta" + AccessIdentityProviderListResponseAccessYandexTypeOnelogin AccessIdentityProviderListResponseAccessYandexType = "onelogin" + AccessIdentityProviderListResponseAccessYandexTypePingone AccessIdentityProviderListResponseAccessYandexType = "pingone" + AccessIdentityProviderListResponseAccessYandexTypeYandex AccessIdentityProviderListResponseAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfig struct { +type AccessIdentityProviderListResponseAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -3757,14 +3696,14 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderListResponseAccessYandexScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfigJSON struct { +// accessIdentityProviderListResponseAccessYandexScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderListResponseAccessYandexScimConfig] +type accessIdentityProviderListResponseAccessYandexScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -3774,33 +3713,72 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessIdentityProviderDeleteResponse struct { + // UUID + ID string `json:"id"` + JSON accessIdentityProviderDeleteResponseJSON `json:"-"` +} + +// accessIdentityProviderDeleteResponseJSON contains the JSON metadata for the +// struct [AccessIdentityProviderDeleteResponse] +type accessIdentityProviderDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepin struct { +// Union satisfied by [AccessIdentityProviderGetResponseAccessAzureAd], +// [AccessIdentityProviderGetResponseAccessCentrify], +// [AccessIdentityProviderGetResponseAccessFacebook], +// [AccessIdentityProviderGetResponseAccessGitHub], +// [AccessIdentityProviderGetResponseAccessGoogle], +// [AccessIdentityProviderGetResponseAccessGoogleApps], +// [AccessIdentityProviderGetResponseAccessLinkedin], +// [AccessIdentityProviderGetResponseAccessOidc], +// [AccessIdentityProviderGetResponseAccessOkta], +// [AccessIdentityProviderGetResponseAccessOnelogin], +// [AccessIdentityProviderGetResponseAccessPingone], +// [AccessIdentityProviderGetResponseAccessSaml], +// [AccessIdentityProviderGetResponseAccessYandex] or +// [AccessIdentityProviderGetResponseAccessOnetimepin]. +type AccessIdentityProviderGetResponse interface { + implementsAccessIdentityProviderGetResponse() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderGetResponse)(nil)).Elem(), "") +} + +type AccessIdentityProviderGetResponseAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config interface{} `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessAzureAdConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessAzureAdType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessAzureAdScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessAzureAdJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepin] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinJSON struct { +// accessIdentityProviderGetResponseAccessAzureAdJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessAzureAd] +type accessIdentityProviderGetResponseAccessAzureAdJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -3810,141 +3788,17 @@ type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepin) implementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse() { +func (r AccessIdentityProviderGetResponseAccessAzureAd) implementsAccessIdentityProviderGetResponse() { } -// The type of identity provider. To determine the value for a specific provider, -// refer to our +// The configuration parameters for the identity provider. To view the required +// parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType string - -const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinType = "yandex" -) - -// The configuration settings for enabling a System for Cross-Domain Identity -// Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfig struct { - // A flag to enable or disable SCIM for the identity provider. - Enabled bool `json:"enabled"` - // A flag to revoke a user's session in Access and force a reauthentication on the - // user's Gateway session when they have been added or removed from a group in the - // Identity Provider. - GroupMemberDeprovision bool `json:"group_member_deprovision"` - // A flag to remove a user's seat in Zero Trust when they have been deprovisioned - // in the Identity Provider. This cannot be enabled unless user_deprovision is also - // enabled. - SeatDeprovision bool `json:"seat_deprovision"` - // A read-only token generated when the SCIM integration is enabled for the first - // time. It is redacted on subsequent requests. If you lose this you will need to - // refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - Secret string `json:"secret"` - // A flag to enable revoking a user's session in Access and Gateway when they have - // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfigJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfig] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfigJSON struct { - Enabled apijson.Field - GroupMemberDeprovision apijson.Field - SeatDeprovision apijson.Field - Secret apijson.Field - UserDeprovision apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAd], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrify], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebook], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHub], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogle], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleApps], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedin], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidc], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOkta], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOnelogin], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingone], -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSaml] -// or -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandex]. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse interface { - implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse)(nil)).Elem(), "") -} - -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAd struct { - // The configuration parameters for the identity provider. To view the required - // parameters for a specific provider, refer to our - // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfig `json:"config,required"` - // The name of the identity provider, shown to users on the login page. - Name string `json:"name,required"` - // The type of identity provider. To determine the value for a specific provider, - // refer to our - // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType `json:"type,required"` - // UUID - ID string `json:"id"` - // The configuration settings for enabling a System for Cross-Domain Identity - // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAd] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdJSON struct { - Config apijson.Field - Name apijson.Field - Type apijson.Field - ID apijson.Field - ScimConfig apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAd) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { -} - -// The configuration parameters for the identity provider. To view the required -// parameters for a specific provider, refer to our -// [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfig struct { +type AccessIdentityProviderGetResponseAccessAzureAdConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -3958,14 +3812,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Should Cloudflare try to load groups from your account - SupportGroups bool `json:"support_groups"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfigJSON `json:"-"` + SupportGroups bool `json:"support_groups"` + JSON accessIdentityProviderGetResponseAccessAzureAdConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfigJSON struct { +// accessIdentityProviderGetResponseAccessAzureAdConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessAzureAdConfig] +type accessIdentityProviderGetResponseAccessAzureAdConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -3977,35 +3830,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType string +type AccessIdentityProviderGetResponseAccessAzureAdType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdType = "yandex" + AccessIdentityProviderGetResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderGetResponseAccessAzureAdType = "onetimepin" + AccessIdentityProviderGetResponseAccessAzureAdTypeAzureAd AccessIdentityProviderGetResponseAccessAzureAdType = "azureAD" + AccessIdentityProviderGetResponseAccessAzureAdTypeSaml AccessIdentityProviderGetResponseAccessAzureAdType = "saml" + AccessIdentityProviderGetResponseAccessAzureAdTypeCentrify AccessIdentityProviderGetResponseAccessAzureAdType = "centrify" + AccessIdentityProviderGetResponseAccessAzureAdTypeFacebook AccessIdentityProviderGetResponseAccessAzureAdType = "facebook" + AccessIdentityProviderGetResponseAccessAzureAdTypeGitHub AccessIdentityProviderGetResponseAccessAzureAdType = "github" + AccessIdentityProviderGetResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderGetResponseAccessAzureAdType = "google-apps" + AccessIdentityProviderGetResponseAccessAzureAdTypeGoogle AccessIdentityProviderGetResponseAccessAzureAdType = "google" + AccessIdentityProviderGetResponseAccessAzureAdTypeLinkedin AccessIdentityProviderGetResponseAccessAzureAdType = "linkedin" + AccessIdentityProviderGetResponseAccessAzureAdTypeOidc AccessIdentityProviderGetResponseAccessAzureAdType = "oidc" + AccessIdentityProviderGetResponseAccessAzureAdTypeOkta AccessIdentityProviderGetResponseAccessAzureAdType = "okta" + AccessIdentityProviderGetResponseAccessAzureAdTypeOnelogin AccessIdentityProviderGetResponseAccessAzureAdType = "onelogin" + AccessIdentityProviderGetResponseAccessAzureAdTypePingone AccessIdentityProviderGetResponseAccessAzureAdType = "pingone" + AccessIdentityProviderGetResponseAccessAzureAdTypeYandex AccessIdentityProviderGetResponseAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfig struct { +type AccessIdentityProviderGetResponseAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4022,14 +3875,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessAzureAdScimConfig] +type accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4039,33 +3892,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrify struct { +type AccessIdentityProviderGetResponseAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessCentrifyConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessCentrifyType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessCentrifyScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessCentrifyJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrify] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyJSON struct { +// accessIdentityProviderGetResponseAccessCentrifyJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessCentrify] +type accessIdentityProviderGetResponseAccessCentrifyJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4075,17 +3927,17 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrify) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessCentrify) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfig struct { +type AccessIdentityProviderGetResponseAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount string `json:"centrify_account"` // Your centrify app id @@ -4097,14 +3949,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderGetResponseAccessCentrifyConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfigJSON struct { +// accessIdentityProviderGetResponseAccessCentrifyConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessCentrifyConfig] +type accessIdentityProviderGetResponseAccessCentrifyConfigJSON struct { CentrifyAccount apijson.Field CentrifyAppID apijson.Field Claims apijson.Field @@ -4115,35 +3966,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType string +type AccessIdentityProviderGetResponseAccessCentrifyType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyType = "yandex" + AccessIdentityProviderGetResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderGetResponseAccessCentrifyType = "onetimepin" + AccessIdentityProviderGetResponseAccessCentrifyTypeAzureAd AccessIdentityProviderGetResponseAccessCentrifyType = "azureAD" + AccessIdentityProviderGetResponseAccessCentrifyTypeSaml AccessIdentityProviderGetResponseAccessCentrifyType = "saml" + AccessIdentityProviderGetResponseAccessCentrifyTypeCentrify AccessIdentityProviderGetResponseAccessCentrifyType = "centrify" + AccessIdentityProviderGetResponseAccessCentrifyTypeFacebook AccessIdentityProviderGetResponseAccessCentrifyType = "facebook" + AccessIdentityProviderGetResponseAccessCentrifyTypeGitHub AccessIdentityProviderGetResponseAccessCentrifyType = "github" + AccessIdentityProviderGetResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderGetResponseAccessCentrifyType = "google-apps" + AccessIdentityProviderGetResponseAccessCentrifyTypeGoogle AccessIdentityProviderGetResponseAccessCentrifyType = "google" + AccessIdentityProviderGetResponseAccessCentrifyTypeLinkedin AccessIdentityProviderGetResponseAccessCentrifyType = "linkedin" + AccessIdentityProviderGetResponseAccessCentrifyTypeOidc AccessIdentityProviderGetResponseAccessCentrifyType = "oidc" + AccessIdentityProviderGetResponseAccessCentrifyTypeOkta AccessIdentityProviderGetResponseAccessCentrifyType = "okta" + AccessIdentityProviderGetResponseAccessCentrifyTypeOnelogin AccessIdentityProviderGetResponseAccessCentrifyType = "onelogin" + AccessIdentityProviderGetResponseAccessCentrifyTypePingone AccessIdentityProviderGetResponseAccessCentrifyType = "pingone" + AccessIdentityProviderGetResponseAccessCentrifyTypeYandex AccessIdentityProviderGetResponseAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfig struct { +type AccessIdentityProviderGetResponseAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4160,14 +4011,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessCentrifyScimConfig] +type accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4177,33 +4028,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebook struct { +type AccessIdentityProviderGetResponseAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessFacebookConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessFacebookType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessFacebookScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessFacebookJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebook] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookJSON struct { +// accessIdentityProviderGetResponseAccessFacebookJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessFacebook] +type accessIdentityProviderGetResponseAccessFacebookJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4213,63 +4063,62 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebook) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessFacebook) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfig struct { +type AccessIdentityProviderGetResponseAccessFacebookConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderGetResponseAccessFacebookConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfigJSON struct { +// accessIdentityProviderGetResponseAccessFacebookConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessFacebookConfig] +type accessIdentityProviderGetResponseAccessFacebookConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType string +type AccessIdentityProviderGetResponseAccessFacebookType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookType = "yandex" + AccessIdentityProviderGetResponseAccessFacebookTypeOnetimepin AccessIdentityProviderGetResponseAccessFacebookType = "onetimepin" + AccessIdentityProviderGetResponseAccessFacebookTypeAzureAd AccessIdentityProviderGetResponseAccessFacebookType = "azureAD" + AccessIdentityProviderGetResponseAccessFacebookTypeSaml AccessIdentityProviderGetResponseAccessFacebookType = "saml" + AccessIdentityProviderGetResponseAccessFacebookTypeCentrify AccessIdentityProviderGetResponseAccessFacebookType = "centrify" + AccessIdentityProviderGetResponseAccessFacebookTypeFacebook AccessIdentityProviderGetResponseAccessFacebookType = "facebook" + AccessIdentityProviderGetResponseAccessFacebookTypeGitHub AccessIdentityProviderGetResponseAccessFacebookType = "github" + AccessIdentityProviderGetResponseAccessFacebookTypeGoogleApps AccessIdentityProviderGetResponseAccessFacebookType = "google-apps" + AccessIdentityProviderGetResponseAccessFacebookTypeGoogle AccessIdentityProviderGetResponseAccessFacebookType = "google" + AccessIdentityProviderGetResponseAccessFacebookTypeLinkedin AccessIdentityProviderGetResponseAccessFacebookType = "linkedin" + AccessIdentityProviderGetResponseAccessFacebookTypeOidc AccessIdentityProviderGetResponseAccessFacebookType = "oidc" + AccessIdentityProviderGetResponseAccessFacebookTypeOkta AccessIdentityProviderGetResponseAccessFacebookType = "okta" + AccessIdentityProviderGetResponseAccessFacebookTypeOnelogin AccessIdentityProviderGetResponseAccessFacebookType = "onelogin" + AccessIdentityProviderGetResponseAccessFacebookTypePingone AccessIdentityProviderGetResponseAccessFacebookType = "pingone" + AccessIdentityProviderGetResponseAccessFacebookTypeYandex AccessIdentityProviderGetResponseAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfig struct { +type AccessIdentityProviderGetResponseAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4286,14 +4135,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessFacebookScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessFacebookScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessFacebookScimConfig] +type accessIdentityProviderGetResponseAccessFacebookScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4303,33 +4152,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHub struct { +type AccessIdentityProviderGetResponseAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessGitHubConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessGitHubType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessGitHubScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessGitHubJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHub] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubJSON struct { +// accessIdentityProviderGetResponseAccessGitHubJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessGitHub] +type accessIdentityProviderGetResponseAccessGitHubJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4339,63 +4187,62 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHub) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessGitHub) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfig struct { +type AccessIdentityProviderGetResponseAccessGitHubConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderGetResponseAccessGitHubConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfigJSON struct { +// accessIdentityProviderGetResponseAccessGitHubConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessGitHubConfig] +type accessIdentityProviderGetResponseAccessGitHubConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType string +type AccessIdentityProviderGetResponseAccessGitHubType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubType = "yandex" + AccessIdentityProviderGetResponseAccessGitHubTypeOnetimepin AccessIdentityProviderGetResponseAccessGitHubType = "onetimepin" + AccessIdentityProviderGetResponseAccessGitHubTypeAzureAd AccessIdentityProviderGetResponseAccessGitHubType = "azureAD" + AccessIdentityProviderGetResponseAccessGitHubTypeSaml AccessIdentityProviderGetResponseAccessGitHubType = "saml" + AccessIdentityProviderGetResponseAccessGitHubTypeCentrify AccessIdentityProviderGetResponseAccessGitHubType = "centrify" + AccessIdentityProviderGetResponseAccessGitHubTypeFacebook AccessIdentityProviderGetResponseAccessGitHubType = "facebook" + AccessIdentityProviderGetResponseAccessGitHubTypeGitHub AccessIdentityProviderGetResponseAccessGitHubType = "github" + AccessIdentityProviderGetResponseAccessGitHubTypeGoogleApps AccessIdentityProviderGetResponseAccessGitHubType = "google-apps" + AccessIdentityProviderGetResponseAccessGitHubTypeGoogle AccessIdentityProviderGetResponseAccessGitHubType = "google" + AccessIdentityProviderGetResponseAccessGitHubTypeLinkedin AccessIdentityProviderGetResponseAccessGitHubType = "linkedin" + AccessIdentityProviderGetResponseAccessGitHubTypeOidc AccessIdentityProviderGetResponseAccessGitHubType = "oidc" + AccessIdentityProviderGetResponseAccessGitHubTypeOkta AccessIdentityProviderGetResponseAccessGitHubType = "okta" + AccessIdentityProviderGetResponseAccessGitHubTypeOnelogin AccessIdentityProviderGetResponseAccessGitHubType = "onelogin" + AccessIdentityProviderGetResponseAccessGitHubTypePingone AccessIdentityProviderGetResponseAccessGitHubType = "pingone" + AccessIdentityProviderGetResponseAccessGitHubTypeYandex AccessIdentityProviderGetResponseAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfig struct { +type AccessIdentityProviderGetResponseAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4412,14 +4259,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessGitHubScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessGitHubScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessGitHubScimConfig] +type accessIdentityProviderGetResponseAccessGitHubScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4429,33 +4276,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogle struct { +type AccessIdentityProviderGetResponseAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessGoogleConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessGoogleType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessGoogleScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessGoogleJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogle] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleJSON struct { +// accessIdentityProviderGetResponseAccessGoogleJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessGoogle] +type accessIdentityProviderGetResponseAccessGoogleJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4465,17 +4311,17 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogle) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessGoogle) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfig struct { +type AccessIdentityProviderGetResponseAccessGoogleConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -4483,14 +4329,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderGetResponseAccessGoogleConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfigJSON struct { +// accessIdentityProviderGetResponseAccessGoogleConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessGoogleConfig] +type accessIdentityProviderGetResponseAccessGoogleConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -4499,35 +4344,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType string +type AccessIdentityProviderGetResponseAccessGoogleType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleType = "yandex" + AccessIdentityProviderGetResponseAccessGoogleTypeOnetimepin AccessIdentityProviderGetResponseAccessGoogleType = "onetimepin" + AccessIdentityProviderGetResponseAccessGoogleTypeAzureAd AccessIdentityProviderGetResponseAccessGoogleType = "azureAD" + AccessIdentityProviderGetResponseAccessGoogleTypeSaml AccessIdentityProviderGetResponseAccessGoogleType = "saml" + AccessIdentityProviderGetResponseAccessGoogleTypeCentrify AccessIdentityProviderGetResponseAccessGoogleType = "centrify" + AccessIdentityProviderGetResponseAccessGoogleTypeFacebook AccessIdentityProviderGetResponseAccessGoogleType = "facebook" + AccessIdentityProviderGetResponseAccessGoogleTypeGitHub AccessIdentityProviderGetResponseAccessGoogleType = "github" + AccessIdentityProviderGetResponseAccessGoogleTypeGoogleApps AccessIdentityProviderGetResponseAccessGoogleType = "google-apps" + AccessIdentityProviderGetResponseAccessGoogleTypeGoogle AccessIdentityProviderGetResponseAccessGoogleType = "google" + AccessIdentityProviderGetResponseAccessGoogleTypeLinkedin AccessIdentityProviderGetResponseAccessGoogleType = "linkedin" + AccessIdentityProviderGetResponseAccessGoogleTypeOidc AccessIdentityProviderGetResponseAccessGoogleType = "oidc" + AccessIdentityProviderGetResponseAccessGoogleTypeOkta AccessIdentityProviderGetResponseAccessGoogleType = "okta" + AccessIdentityProviderGetResponseAccessGoogleTypeOnelogin AccessIdentityProviderGetResponseAccessGoogleType = "onelogin" + AccessIdentityProviderGetResponseAccessGoogleTypePingone AccessIdentityProviderGetResponseAccessGoogleType = "pingone" + AccessIdentityProviderGetResponseAccessGoogleTypeYandex AccessIdentityProviderGetResponseAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfig struct { +type AccessIdentityProviderGetResponseAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4544,14 +4389,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessGoogleScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessGoogleScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessGoogleScimConfig] +type accessIdentityProviderGetResponseAccessGoogleScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4561,33 +4406,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleApps struct { +type AccessIdentityProviderGetResponseAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessGoogleAppsConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessGoogleAppsType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessGoogleAppsJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleApps] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsJSON struct { +// accessIdentityProviderGetResponseAccessGoogleAppsJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessGoogleApps] +type accessIdentityProviderGetResponseAccessGoogleAppsJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4597,17 +4441,17 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleApps) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessGoogleApps) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfig struct { +type AccessIdentityProviderGetResponseAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain string `json:"apps_domain"` // Custom claims @@ -4617,14 +4461,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfigJSON struct { +// accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessGoogleAppsConfig] +type accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON struct { AppsDomain apijson.Field Claims apijson.Field ClientID apijson.Field @@ -4634,35 +4478,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType string +type AccessIdentityProviderGetResponseAccessGoogleAppsType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsType = "yandex" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderGetResponseAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderGetResponseAccessGoogleAppsType = "azureAD" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeSaml AccessIdentityProviderGetResponseAccessGoogleAppsType = "saml" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderGetResponseAccessGoogleAppsType = "centrify" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderGetResponseAccessGoogleAppsType = "facebook" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderGetResponseAccessGoogleAppsType = "github" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderGetResponseAccessGoogleAppsType = "google-apps" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderGetResponseAccessGoogleAppsType = "google" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderGetResponseAccessGoogleAppsType = "linkedin" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeOidc AccessIdentityProviderGetResponseAccessGoogleAppsType = "oidc" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeOkta AccessIdentityProviderGetResponseAccessGoogleAppsType = "okta" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderGetResponseAccessGoogleAppsType = "onelogin" + AccessIdentityProviderGetResponseAccessGoogleAppsTypePingone AccessIdentityProviderGetResponseAccessGoogleAppsType = "pingone" + AccessIdentityProviderGetResponseAccessGoogleAppsTypeYandex AccessIdentityProviderGetResponseAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4679,14 +4523,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig] +type accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4696,33 +4540,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedin struct { +type AccessIdentityProviderGetResponseAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessLinkedinConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessLinkedinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessLinkedinScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessLinkedinJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedin] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinJSON struct { +// accessIdentityProviderGetResponseAccessLinkedinJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessLinkedin] +type accessIdentityProviderGetResponseAccessLinkedinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4732,63 +4575,62 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedin) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessLinkedin) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfig struct { +type AccessIdentityProviderGetResponseAccessLinkedinConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderGetResponseAccessLinkedinConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfigJSON struct { +// accessIdentityProviderGetResponseAccessLinkedinConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessLinkedinConfig] +type accessIdentityProviderGetResponseAccessLinkedinConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType string +type AccessIdentityProviderGetResponseAccessLinkedinType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinType = "yandex" + AccessIdentityProviderGetResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderGetResponseAccessLinkedinType = "onetimepin" + AccessIdentityProviderGetResponseAccessLinkedinTypeAzureAd AccessIdentityProviderGetResponseAccessLinkedinType = "azureAD" + AccessIdentityProviderGetResponseAccessLinkedinTypeSaml AccessIdentityProviderGetResponseAccessLinkedinType = "saml" + AccessIdentityProviderGetResponseAccessLinkedinTypeCentrify AccessIdentityProviderGetResponseAccessLinkedinType = "centrify" + AccessIdentityProviderGetResponseAccessLinkedinTypeFacebook AccessIdentityProviderGetResponseAccessLinkedinType = "facebook" + AccessIdentityProviderGetResponseAccessLinkedinTypeGitHub AccessIdentityProviderGetResponseAccessLinkedinType = "github" + AccessIdentityProviderGetResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderGetResponseAccessLinkedinType = "google-apps" + AccessIdentityProviderGetResponseAccessLinkedinTypeGoogle AccessIdentityProviderGetResponseAccessLinkedinType = "google" + AccessIdentityProviderGetResponseAccessLinkedinTypeLinkedin AccessIdentityProviderGetResponseAccessLinkedinType = "linkedin" + AccessIdentityProviderGetResponseAccessLinkedinTypeOidc AccessIdentityProviderGetResponseAccessLinkedinType = "oidc" + AccessIdentityProviderGetResponseAccessLinkedinTypeOkta AccessIdentityProviderGetResponseAccessLinkedinType = "okta" + AccessIdentityProviderGetResponseAccessLinkedinTypeOnelogin AccessIdentityProviderGetResponseAccessLinkedinType = "onelogin" + AccessIdentityProviderGetResponseAccessLinkedinTypePingone AccessIdentityProviderGetResponseAccessLinkedinType = "pingone" + AccessIdentityProviderGetResponseAccessLinkedinTypeYandex AccessIdentityProviderGetResponseAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfig struct { +type AccessIdentityProviderGetResponseAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4805,14 +4647,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessLinkedinScimConfig] +type accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4822,33 +4664,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidc struct { +type AccessIdentityProviderGetResponseAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessOidcConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessOidcType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessOidcScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessOidcJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidc] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcJSON struct { +// accessIdentityProviderGetResponseAccessOidcJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessOidc] +type accessIdentityProviderGetResponseAccessOidcJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -4858,17 +4699,16 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidc) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { -} +func (r AccessIdentityProviderGetResponseAccessOidc) implementsAccessIdentityProviderGetResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfig struct { +type AccessIdentityProviderGetResponseAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL string `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -4884,14 +4724,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // OAuth scopes Scopes []string `json:"scopes"` // The token_endpoint URL of your IdP - TokenURL string `json:"token_url"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfigJSON `json:"-"` + TokenURL string `json:"token_url"` + JSON accessIdentityProviderGetResponseAccessOidcConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfigJSON struct { +// accessIdentityProviderGetResponseAccessOidcConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessOidcConfig] +type accessIdentityProviderGetResponseAccessOidcConfigJSON struct { AuthURL apijson.Field CertsURL apijson.Field Claims apijson.Field @@ -4904,35 +4743,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType string +type AccessIdentityProviderGetResponseAccessOidcType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcType = "yandex" + AccessIdentityProviderGetResponseAccessOidcTypeOnetimepin AccessIdentityProviderGetResponseAccessOidcType = "onetimepin" + AccessIdentityProviderGetResponseAccessOidcTypeAzureAd AccessIdentityProviderGetResponseAccessOidcType = "azureAD" + AccessIdentityProviderGetResponseAccessOidcTypeSaml AccessIdentityProviderGetResponseAccessOidcType = "saml" + AccessIdentityProviderGetResponseAccessOidcTypeCentrify AccessIdentityProviderGetResponseAccessOidcType = "centrify" + AccessIdentityProviderGetResponseAccessOidcTypeFacebook AccessIdentityProviderGetResponseAccessOidcType = "facebook" + AccessIdentityProviderGetResponseAccessOidcTypeGitHub AccessIdentityProviderGetResponseAccessOidcType = "github" + AccessIdentityProviderGetResponseAccessOidcTypeGoogleApps AccessIdentityProviderGetResponseAccessOidcType = "google-apps" + AccessIdentityProviderGetResponseAccessOidcTypeGoogle AccessIdentityProviderGetResponseAccessOidcType = "google" + AccessIdentityProviderGetResponseAccessOidcTypeLinkedin AccessIdentityProviderGetResponseAccessOidcType = "linkedin" + AccessIdentityProviderGetResponseAccessOidcTypeOidc AccessIdentityProviderGetResponseAccessOidcType = "oidc" + AccessIdentityProviderGetResponseAccessOidcTypeOkta AccessIdentityProviderGetResponseAccessOidcType = "okta" + AccessIdentityProviderGetResponseAccessOidcTypeOnelogin AccessIdentityProviderGetResponseAccessOidcType = "onelogin" + AccessIdentityProviderGetResponseAccessOidcTypePingone AccessIdentityProviderGetResponseAccessOidcType = "pingone" + AccessIdentityProviderGetResponseAccessOidcTypeYandex AccessIdentityProviderGetResponseAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfig struct { +type AccessIdentityProviderGetResponseAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -4949,14 +4788,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessOidcScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessOidcScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessOidcScimConfig] +type accessIdentityProviderGetResponseAccessOidcScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -4966,33 +4804,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOkta struct { +type AccessIdentityProviderGetResponseAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessOktaConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessOktaType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessOktaScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessOktaJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOkta] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaJSON struct { +// accessIdentityProviderGetResponseAccessOktaJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessOkta] +type accessIdentityProviderGetResponseAccessOktaJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5002,17 +4839,16 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOkta) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { -} +func (r AccessIdentityProviderGetResponseAccessOkta) implementsAccessIdentityProviderGetResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfig struct { +type AccessIdentityProviderGetResponseAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID string `json:"authorization_server_id"` // Custom claims @@ -5024,14 +4860,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your okta account url - OktaAccount string `json:"okta_account"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfigJSON `json:"-"` + OktaAccount string `json:"okta_account"` + JSON accessIdentityProviderGetResponseAccessOktaConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfigJSON struct { +// accessIdentityProviderGetResponseAccessOktaConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessOktaConfig] +type accessIdentityProviderGetResponseAccessOktaConfigJSON struct { AuthorizationServerID apijson.Field Claims apijson.Field ClientID apijson.Field @@ -5042,35 +4877,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType string +type AccessIdentityProviderGetResponseAccessOktaType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaType = "yandex" + AccessIdentityProviderGetResponseAccessOktaTypeOnetimepin AccessIdentityProviderGetResponseAccessOktaType = "onetimepin" + AccessIdentityProviderGetResponseAccessOktaTypeAzureAd AccessIdentityProviderGetResponseAccessOktaType = "azureAD" + AccessIdentityProviderGetResponseAccessOktaTypeSaml AccessIdentityProviderGetResponseAccessOktaType = "saml" + AccessIdentityProviderGetResponseAccessOktaTypeCentrify AccessIdentityProviderGetResponseAccessOktaType = "centrify" + AccessIdentityProviderGetResponseAccessOktaTypeFacebook AccessIdentityProviderGetResponseAccessOktaType = "facebook" + AccessIdentityProviderGetResponseAccessOktaTypeGitHub AccessIdentityProviderGetResponseAccessOktaType = "github" + AccessIdentityProviderGetResponseAccessOktaTypeGoogleApps AccessIdentityProviderGetResponseAccessOktaType = "google-apps" + AccessIdentityProviderGetResponseAccessOktaTypeGoogle AccessIdentityProviderGetResponseAccessOktaType = "google" + AccessIdentityProviderGetResponseAccessOktaTypeLinkedin AccessIdentityProviderGetResponseAccessOktaType = "linkedin" + AccessIdentityProviderGetResponseAccessOktaTypeOidc AccessIdentityProviderGetResponseAccessOktaType = "oidc" + AccessIdentityProviderGetResponseAccessOktaTypeOkta AccessIdentityProviderGetResponseAccessOktaType = "okta" + AccessIdentityProviderGetResponseAccessOktaTypeOnelogin AccessIdentityProviderGetResponseAccessOktaType = "onelogin" + AccessIdentityProviderGetResponseAccessOktaTypePingone AccessIdentityProviderGetResponseAccessOktaType = "pingone" + AccessIdentityProviderGetResponseAccessOktaTypeYandex AccessIdentityProviderGetResponseAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfig struct { +type AccessIdentityProviderGetResponseAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5087,14 +4922,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessOktaScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessOktaScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessOktaScimConfig] +type accessIdentityProviderGetResponseAccessOktaScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5104,33 +4938,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOnelogin struct { +type AccessIdentityProviderGetResponseAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessOneloginConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessOneloginType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessOneloginScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessOneloginJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOnelogin] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginJSON struct { +// accessIdentityProviderGetResponseAccessOneloginJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessOnelogin] +type accessIdentityProviderGetResponseAccessOneloginJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5140,17 +4973,17 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOnelogin) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessOnelogin) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfig struct { +type AccessIdentityProviderGetResponseAccessOneloginConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -5160,14 +4993,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your OneLogin account url - OneloginAccount string `json:"onelogin_account"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfigJSON `json:"-"` + OneloginAccount string `json:"onelogin_account"` + JSON accessIdentityProviderGetResponseAccessOneloginConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfigJSON struct { +// accessIdentityProviderGetResponseAccessOneloginConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessOneloginConfig] +type accessIdentityProviderGetResponseAccessOneloginConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -5177,35 +5009,35 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType string +type AccessIdentityProviderGetResponseAccessOneloginType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginType = "yandex" + AccessIdentityProviderGetResponseAccessOneloginTypeOnetimepin AccessIdentityProviderGetResponseAccessOneloginType = "onetimepin" + AccessIdentityProviderGetResponseAccessOneloginTypeAzureAd AccessIdentityProviderGetResponseAccessOneloginType = "azureAD" + AccessIdentityProviderGetResponseAccessOneloginTypeSaml AccessIdentityProviderGetResponseAccessOneloginType = "saml" + AccessIdentityProviderGetResponseAccessOneloginTypeCentrify AccessIdentityProviderGetResponseAccessOneloginType = "centrify" + AccessIdentityProviderGetResponseAccessOneloginTypeFacebook AccessIdentityProviderGetResponseAccessOneloginType = "facebook" + AccessIdentityProviderGetResponseAccessOneloginTypeGitHub AccessIdentityProviderGetResponseAccessOneloginType = "github" + AccessIdentityProviderGetResponseAccessOneloginTypeGoogleApps AccessIdentityProviderGetResponseAccessOneloginType = "google-apps" + AccessIdentityProviderGetResponseAccessOneloginTypeGoogle AccessIdentityProviderGetResponseAccessOneloginType = "google" + AccessIdentityProviderGetResponseAccessOneloginTypeLinkedin AccessIdentityProviderGetResponseAccessOneloginType = "linkedin" + AccessIdentityProviderGetResponseAccessOneloginTypeOidc AccessIdentityProviderGetResponseAccessOneloginType = "oidc" + AccessIdentityProviderGetResponseAccessOneloginTypeOkta AccessIdentityProviderGetResponseAccessOneloginType = "okta" + AccessIdentityProviderGetResponseAccessOneloginTypeOnelogin AccessIdentityProviderGetResponseAccessOneloginType = "onelogin" + AccessIdentityProviderGetResponseAccessOneloginTypePingone AccessIdentityProviderGetResponseAccessOneloginType = "pingone" + AccessIdentityProviderGetResponseAccessOneloginTypeYandex AccessIdentityProviderGetResponseAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfig struct { +type AccessIdentityProviderGetResponseAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5222,14 +5054,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessOneloginScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessOneloginScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessOneloginScimConfig] +type accessIdentityProviderGetResponseAccessOneloginScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5239,33 +5071,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingone struct { +type AccessIdentityProviderGetResponseAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessPingoneConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessPingoneType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessPingoneScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessPingoneJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingone] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneJSON struct { +// accessIdentityProviderGetResponseAccessPingoneJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessPingone] +type accessIdentityProviderGetResponseAccessPingoneJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5275,17 +5106,17 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingone) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessPingone) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfig struct { +type AccessIdentityProviderGetResponseAccessPingoneConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -5295,14 +5126,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your PingOne environment identifier - PingEnvID string `json:"ping_env_id"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfigJSON `json:"-"` + PingEnvID string `json:"ping_env_id"` + JSON accessIdentityProviderGetResponseAccessPingoneConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfigJSON struct { +// accessIdentityProviderGetResponseAccessPingoneConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessPingoneConfig] +type accessIdentityProviderGetResponseAccessPingoneConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -5312,43 +5142,43 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType string +type AccessIdentityProviderGetResponseAccessPingoneType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneType = "yandex" -) - -// The configuration settings for enabling a System for Cross-Domain Identity -// Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfig struct { - // A flag to enable or disable SCIM for the identity provider. - Enabled bool `json:"enabled"` - // A flag to revoke a user's session in Access and force a reauthentication on the - // user's Gateway session when they have been added or removed from a group in the - // Identity Provider. - GroupMemberDeprovision bool `json:"group_member_deprovision"` - // A flag to remove a user's seat in Zero Trust when they have been deprovisioned - // in the Identity Provider. This cannot be enabled unless user_deprovision is also + AccessIdentityProviderGetResponseAccessPingoneTypeOnetimepin AccessIdentityProviderGetResponseAccessPingoneType = "onetimepin" + AccessIdentityProviderGetResponseAccessPingoneTypeAzureAd AccessIdentityProviderGetResponseAccessPingoneType = "azureAD" + AccessIdentityProviderGetResponseAccessPingoneTypeSaml AccessIdentityProviderGetResponseAccessPingoneType = "saml" + AccessIdentityProviderGetResponseAccessPingoneTypeCentrify AccessIdentityProviderGetResponseAccessPingoneType = "centrify" + AccessIdentityProviderGetResponseAccessPingoneTypeFacebook AccessIdentityProviderGetResponseAccessPingoneType = "facebook" + AccessIdentityProviderGetResponseAccessPingoneTypeGitHub AccessIdentityProviderGetResponseAccessPingoneType = "github" + AccessIdentityProviderGetResponseAccessPingoneTypeGoogleApps AccessIdentityProviderGetResponseAccessPingoneType = "google-apps" + AccessIdentityProviderGetResponseAccessPingoneTypeGoogle AccessIdentityProviderGetResponseAccessPingoneType = "google" + AccessIdentityProviderGetResponseAccessPingoneTypeLinkedin AccessIdentityProviderGetResponseAccessPingoneType = "linkedin" + AccessIdentityProviderGetResponseAccessPingoneTypeOidc AccessIdentityProviderGetResponseAccessPingoneType = "oidc" + AccessIdentityProviderGetResponseAccessPingoneTypeOkta AccessIdentityProviderGetResponseAccessPingoneType = "okta" + AccessIdentityProviderGetResponseAccessPingoneTypeOnelogin AccessIdentityProviderGetResponseAccessPingoneType = "onelogin" + AccessIdentityProviderGetResponseAccessPingoneTypePingone AccessIdentityProviderGetResponseAccessPingoneType = "pingone" + AccessIdentityProviderGetResponseAccessPingoneTypeYandex AccessIdentityProviderGetResponseAccessPingoneType = "yandex" +) + +// The configuration settings for enabling a System for Cross-Domain Identity +// Management (SCIM) with the identity provider. +type AccessIdentityProviderGetResponseAccessPingoneScimConfig struct { + // A flag to enable or disable SCIM for the identity provider. + Enabled bool `json:"enabled"` + // A flag to revoke a user's session in Access and force a reauthentication on the + // user's Gateway session when they have been added or removed from a group in the + // Identity Provider. + GroupMemberDeprovision bool `json:"group_member_deprovision"` + // A flag to remove a user's seat in Zero Trust when they have been deprovisioned + // in the Identity Provider. This cannot be enabled unless user_deprovision is also // enabled. SeatDeprovision bool `json:"seat_deprovision"` // A read-only token generated when the SCIM integration is enabled for the first @@ -5357,14 +5187,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessPingoneScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessPingoneScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessPingoneScimConfig] +type accessIdentityProviderGetResponseAccessPingoneScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5374,33 +5204,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSaml struct { +type AccessIdentityProviderGetResponseAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessSamlConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessSamlType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessSamlScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessSamlJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSaml] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlJSON struct { +// accessIdentityProviderGetResponseAccessSamlJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessSaml] +type accessIdentityProviderGetResponseAccessSamlJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5410,17 +5239,16 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSaml) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { -} +func (r AccessIdentityProviderGetResponseAccessSaml) implementsAccessIdentityProviderGetResponse() {} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfig struct { +type AccessIdentityProviderGetResponseAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes []string `json:"attributes"` @@ -5428,7 +5256,7 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes EmailAttributeName string `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes []AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` + HeaderAttributes []AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -5437,14 +5265,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes // signature, use the public key from the Access certs endpoints. SignRequest bool `json:"sign_request"` // URL to send the SAML authentication requests to - SSOTargetURL string `json:"sso_target_url"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigJSON `json:"-"` + SSOTargetURL string `json:"sso_target_url"` + JSON accessIdentityProviderGetResponseAccessSamlConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigJSON struct { +// accessIdentityProviderGetResponseAccessSamlConfigJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessSamlConfig] +type accessIdentityProviderGetResponseAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field @@ -5456,57 +5283,57 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName string `json:"attribute_name"` // header that will be added on the request to the origin - HeaderName string `json:"header_name"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` + HeaderName string `json:"header_name"` + JSON accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttributeJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttribute] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttributeJSON struct { +// accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON contains +// the JSON metadata for the struct +// [AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute] +type accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON struct { AttributeName apijson.Field HeaderName apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType string +type AccessIdentityProviderGetResponseAccessSamlType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlType = "yandex" + AccessIdentityProviderGetResponseAccessSamlTypeOnetimepin AccessIdentityProviderGetResponseAccessSamlType = "onetimepin" + AccessIdentityProviderGetResponseAccessSamlTypeAzureAd AccessIdentityProviderGetResponseAccessSamlType = "azureAD" + AccessIdentityProviderGetResponseAccessSamlTypeSaml AccessIdentityProviderGetResponseAccessSamlType = "saml" + AccessIdentityProviderGetResponseAccessSamlTypeCentrify AccessIdentityProviderGetResponseAccessSamlType = "centrify" + AccessIdentityProviderGetResponseAccessSamlTypeFacebook AccessIdentityProviderGetResponseAccessSamlType = "facebook" + AccessIdentityProviderGetResponseAccessSamlTypeGitHub AccessIdentityProviderGetResponseAccessSamlType = "github" + AccessIdentityProviderGetResponseAccessSamlTypeGoogleApps AccessIdentityProviderGetResponseAccessSamlType = "google-apps" + AccessIdentityProviderGetResponseAccessSamlTypeGoogle AccessIdentityProviderGetResponseAccessSamlType = "google" + AccessIdentityProviderGetResponseAccessSamlTypeLinkedin AccessIdentityProviderGetResponseAccessSamlType = "linkedin" + AccessIdentityProviderGetResponseAccessSamlTypeOidc AccessIdentityProviderGetResponseAccessSamlType = "oidc" + AccessIdentityProviderGetResponseAccessSamlTypeOkta AccessIdentityProviderGetResponseAccessSamlType = "okta" + AccessIdentityProviderGetResponseAccessSamlTypeOnelogin AccessIdentityProviderGetResponseAccessSamlType = "onelogin" + AccessIdentityProviderGetResponseAccessSamlTypePingone AccessIdentityProviderGetResponseAccessSamlType = "pingone" + AccessIdentityProviderGetResponseAccessSamlTypeYandex AccessIdentityProviderGetResponseAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfig struct { +type AccessIdentityProviderGetResponseAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5523,14 +5350,13 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessSamlScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessSamlScimConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessSamlScimConfig] +type accessIdentityProviderGetResponseAccessSamlScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5540,33 +5366,32 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandex struct { +type AccessIdentityProviderGetResponseAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfig `json:"config,required"` + Config AccessIdentityProviderGetResponseAccessYandexConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType `json:"type,required"` + Type AccessIdentityProviderGetResponseAccessYandexType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfig `json:"scim_config"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexJSON `json:"-"` + ScimConfig AccessIdentityProviderGetResponseAccessYandexScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessYandexJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandex] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexJSON struct { +// accessIdentityProviderGetResponseAccessYandexJSON contains the JSON metadata for +// the struct [AccessIdentityProviderGetResponseAccessYandex] +type accessIdentityProviderGetResponseAccessYandexJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5576,63 +5401,62 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandex) implementsAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse() { +func (r AccessIdentityProviderGetResponseAccessYandex) implementsAccessIdentityProviderGetResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfig struct { +type AccessIdentityProviderGetResponseAccessYandexConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderGetResponseAccessYandexConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfigJSON struct { +// accessIdentityProviderGetResponseAccessYandexConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderGetResponseAccessYandexConfig] +type accessIdentityProviderGetResponseAccessYandexConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType string +type AccessIdentityProviderGetResponseAccessYandexType string const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeAzureAd AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeSaml AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "saml" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeCentrify AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "centrify" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeFacebook AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "facebook" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeGitHub AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "github" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeGoogle AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "google" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeLinkedin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeOidc AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "oidc" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeOkta AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "okta" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeOnelogin AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypePingone AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "pingone" - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexTypeYandex AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexType = "yandex" + AccessIdentityProviderGetResponseAccessYandexTypeOnetimepin AccessIdentityProviderGetResponseAccessYandexType = "onetimepin" + AccessIdentityProviderGetResponseAccessYandexTypeAzureAd AccessIdentityProviderGetResponseAccessYandexType = "azureAD" + AccessIdentityProviderGetResponseAccessYandexTypeSaml AccessIdentityProviderGetResponseAccessYandexType = "saml" + AccessIdentityProviderGetResponseAccessYandexTypeCentrify AccessIdentityProviderGetResponseAccessYandexType = "centrify" + AccessIdentityProviderGetResponseAccessYandexTypeFacebook AccessIdentityProviderGetResponseAccessYandexType = "facebook" + AccessIdentityProviderGetResponseAccessYandexTypeGitHub AccessIdentityProviderGetResponseAccessYandexType = "github" + AccessIdentityProviderGetResponseAccessYandexTypeGoogleApps AccessIdentityProviderGetResponseAccessYandexType = "google-apps" + AccessIdentityProviderGetResponseAccessYandexTypeGoogle AccessIdentityProviderGetResponseAccessYandexType = "google" + AccessIdentityProviderGetResponseAccessYandexTypeLinkedin AccessIdentityProviderGetResponseAccessYandexType = "linkedin" + AccessIdentityProviderGetResponseAccessYandexTypeOidc AccessIdentityProviderGetResponseAccessYandexType = "oidc" + AccessIdentityProviderGetResponseAccessYandexTypeOkta AccessIdentityProviderGetResponseAccessYandexType = "okta" + AccessIdentityProviderGetResponseAccessYandexTypeOnelogin AccessIdentityProviderGetResponseAccessYandexType = "onelogin" + AccessIdentityProviderGetResponseAccessYandexTypePingone AccessIdentityProviderGetResponseAccessYandexType = "pingone" + AccessIdentityProviderGetResponseAccessYandexTypeYandex AccessIdentityProviderGetResponseAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfig struct { +type AccessIdentityProviderGetResponseAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5649,14 +5473,14 @@ type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessYandexScimConfigJSON `json:"-"` } -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfigJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfig] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfigJSON struct { +// accessIdentityProviderGetResponseAccessYandexScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderGetResponseAccessYandexScimConfig] +type accessIdentityProviderGetResponseAccessYandexScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5666,54 +5490,154 @@ type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersRes ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderGetResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [AccessIdentityProviderGetResponseAccessAzureAd], -// [AccessIdentityProviderGetResponseAccessCentrify], -// [AccessIdentityProviderGetResponseAccessFacebook], -// [AccessIdentityProviderGetResponseAccessGitHub], -// [AccessIdentityProviderGetResponseAccessGoogle], -// [AccessIdentityProviderGetResponseAccessGoogleApps], -// [AccessIdentityProviderGetResponseAccessLinkedin], -// [AccessIdentityProviderGetResponseAccessOidc], -// [AccessIdentityProviderGetResponseAccessOkta], -// [AccessIdentityProviderGetResponseAccessOnelogin], -// [AccessIdentityProviderGetResponseAccessPingone], -// [AccessIdentityProviderGetResponseAccessSaml], -// [AccessIdentityProviderGetResponseAccessYandex] or -// [AccessIdentityProviderGetResponseAccessOnetimepin]. -type AccessIdentityProviderGetResponse interface { - implementsAccessIdentityProviderGetResponse() +type AccessIdentityProviderGetResponseAccessOnetimepin struct { + // The configuration parameters for the identity provider. To view the required + // parameters for a specific provider, refer to our + // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + Config interface{} `json:"config,required"` + // The name of the identity provider, shown to users on the login page. + Name string `json:"name,required"` + // The type of identity provider. To determine the value for a specific provider, + // refer to our + // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + Type AccessIdentityProviderGetResponseAccessOnetimepinType `json:"type,required"` + // UUID + ID string `json:"id"` + // The configuration settings for enabling a System for Cross-Domain Identity + // Management (SCIM) with the identity provider. + ScimConfig AccessIdentityProviderGetResponseAccessOnetimepinScimConfig `json:"scim_config"` + JSON accessIdentityProviderGetResponseAccessOnetimepinJSON `json:"-"` +} + +// accessIdentityProviderGetResponseAccessOnetimepinJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseAccessOnetimepin] +type accessIdentityProviderGetResponseAccessOnetimepinJSON struct { + Config apijson.Field + Name apijson.Field + Type apijson.Field + ID apijson.Field + ScimConfig apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderGetResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r AccessIdentityProviderGetResponseAccessOnetimepin) implementsAccessIdentityProviderGetResponse() { +} + +// The type of identity provider. To determine the value for a specific provider, +// refer to our +// [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). +type AccessIdentityProviderGetResponseAccessOnetimepinType string + +const ( + AccessIdentityProviderGetResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderGetResponseAccessOnetimepinType = "onetimepin" + AccessIdentityProviderGetResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderGetResponseAccessOnetimepinType = "azureAD" + AccessIdentityProviderGetResponseAccessOnetimepinTypeSaml AccessIdentityProviderGetResponseAccessOnetimepinType = "saml" + AccessIdentityProviderGetResponseAccessOnetimepinTypeCentrify AccessIdentityProviderGetResponseAccessOnetimepinType = "centrify" + AccessIdentityProviderGetResponseAccessOnetimepinTypeFacebook AccessIdentityProviderGetResponseAccessOnetimepinType = "facebook" + AccessIdentityProviderGetResponseAccessOnetimepinTypeGitHub AccessIdentityProviderGetResponseAccessOnetimepinType = "github" + AccessIdentityProviderGetResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderGetResponseAccessOnetimepinType = "google-apps" + AccessIdentityProviderGetResponseAccessOnetimepinTypeGoogle AccessIdentityProviderGetResponseAccessOnetimepinType = "google" + AccessIdentityProviderGetResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderGetResponseAccessOnetimepinType = "linkedin" + AccessIdentityProviderGetResponseAccessOnetimepinTypeOidc AccessIdentityProviderGetResponseAccessOnetimepinType = "oidc" + AccessIdentityProviderGetResponseAccessOnetimepinTypeOkta AccessIdentityProviderGetResponseAccessOnetimepinType = "okta" + AccessIdentityProviderGetResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderGetResponseAccessOnetimepinType = "onelogin" + AccessIdentityProviderGetResponseAccessOnetimepinTypePingone AccessIdentityProviderGetResponseAccessOnetimepinType = "pingone" + AccessIdentityProviderGetResponseAccessOnetimepinTypeYandex AccessIdentityProviderGetResponseAccessOnetimepinType = "yandex" +) + +// The configuration settings for enabling a System for Cross-Domain Identity +// Management (SCIM) with the identity provider. +type AccessIdentityProviderGetResponseAccessOnetimepinScimConfig struct { + // A flag to enable or disable SCIM for the identity provider. + Enabled bool `json:"enabled"` + // A flag to revoke a user's session in Access and force a reauthentication on the + // user's Gateway session when they have been added or removed from a group in the + // Identity Provider. + GroupMemberDeprovision bool `json:"group_member_deprovision"` + // A flag to remove a user's seat in Zero Trust when they have been deprovisioned + // in the Identity Provider. This cannot be enabled unless user_deprovision is also + // enabled. + SeatDeprovision bool `json:"seat_deprovision"` + // A read-only token generated when the SCIM integration is enabled for the first + // time. It is redacted on subsequent requests. If you lose this you will need to + // refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + Secret string `json:"secret"` + // A flag to enable revoking a user's session in Access and Gateway when they have + // been deprovisioned in the Identity Provider. + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON `json:"-"` +} + +// accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderGetResponseAccessOnetimepinScimConfig] +type accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON struct { + Enabled apijson.Field + GroupMemberDeprovision apijson.Field + SeatDeprovision apijson.Field + Secret apijson.Field + UserDeprovision apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderGetResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [AccessIdentityProviderReplaceResponseAccessAzureAd], +// [AccessIdentityProviderReplaceResponseAccessCentrify], +// [AccessIdentityProviderReplaceResponseAccessFacebook], +// [AccessIdentityProviderReplaceResponseAccessGitHub], +// [AccessIdentityProviderReplaceResponseAccessGoogle], +// [AccessIdentityProviderReplaceResponseAccessGoogleApps], +// [AccessIdentityProviderReplaceResponseAccessLinkedin], +// [AccessIdentityProviderReplaceResponseAccessOidc], +// [AccessIdentityProviderReplaceResponseAccessOkta], +// [AccessIdentityProviderReplaceResponseAccessOnelogin], +// [AccessIdentityProviderReplaceResponseAccessPingone], +// [AccessIdentityProviderReplaceResponseAccessSaml], +// [AccessIdentityProviderReplaceResponseAccessYandex] or +// [AccessIdentityProviderReplaceResponseAccessOnetimepin]. +type AccessIdentityProviderReplaceResponse interface { + implementsAccessIdentityProviderReplaceResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderGetResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*AccessIdentityProviderReplaceResponse)(nil)).Elem(), "") } -type AccessIdentityProviderGetResponseAccessAzureAd struct { +type AccessIdentityProviderReplaceResponseAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessAzureAdConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessAzureAdConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessAzureAdType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessAzureAdType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessAzureAdScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessAzureAdJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessAzureAdScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessAzureAdJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessAzureAdJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessAzureAd] -type accessIdentityProviderGetResponseAccessAzureAdJSON struct { +// accessIdentityProviderReplaceResponseAccessAzureAdJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessAzureAd] +type accessIdentityProviderReplaceResponseAccessAzureAdJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5723,17 +5647,17 @@ type accessIdentityProviderGetResponseAccessAzureAdJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessAzureAd) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessAzureAd) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessAzureAd) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessAzureAdConfig struct { +type AccessIdentityProviderReplaceResponseAccessAzureAdConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -5747,13 +5671,14 @@ type AccessIdentityProviderGetResponseAccessAzureAdConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Should Cloudflare try to load groups from your account - SupportGroups bool `json:"support_groups"` - JSON accessIdentityProviderGetResponseAccessAzureAdConfigJSON `json:"-"` + SupportGroups bool `json:"support_groups"` + JSON accessIdentityProviderReplaceResponseAccessAzureAdConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessAzureAdConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessAzureAdConfig] -type accessIdentityProviderGetResponseAccessAzureAdConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessAzureAdConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessAzureAdConfig] +type accessIdentityProviderReplaceResponseAccessAzureAdConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -5765,35 +5690,35 @@ type accessIdentityProviderGetResponseAccessAzureAdConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessAzureAdConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessAzureAdType string +type AccessIdentityProviderReplaceResponseAccessAzureAdType string const ( - AccessIdentityProviderGetResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderGetResponseAccessAzureAdType = "onetimepin" - AccessIdentityProviderGetResponseAccessAzureAdTypeAzureAd AccessIdentityProviderGetResponseAccessAzureAdType = "azureAD" - AccessIdentityProviderGetResponseAccessAzureAdTypeSaml AccessIdentityProviderGetResponseAccessAzureAdType = "saml" - AccessIdentityProviderGetResponseAccessAzureAdTypeCentrify AccessIdentityProviderGetResponseAccessAzureAdType = "centrify" - AccessIdentityProviderGetResponseAccessAzureAdTypeFacebook AccessIdentityProviderGetResponseAccessAzureAdType = "facebook" - AccessIdentityProviderGetResponseAccessAzureAdTypeGitHub AccessIdentityProviderGetResponseAccessAzureAdType = "github" - AccessIdentityProviderGetResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderGetResponseAccessAzureAdType = "google-apps" - AccessIdentityProviderGetResponseAccessAzureAdTypeGoogle AccessIdentityProviderGetResponseAccessAzureAdType = "google" - AccessIdentityProviderGetResponseAccessAzureAdTypeLinkedin AccessIdentityProviderGetResponseAccessAzureAdType = "linkedin" - AccessIdentityProviderGetResponseAccessAzureAdTypeOidc AccessIdentityProviderGetResponseAccessAzureAdType = "oidc" - AccessIdentityProviderGetResponseAccessAzureAdTypeOkta AccessIdentityProviderGetResponseAccessAzureAdType = "okta" - AccessIdentityProviderGetResponseAccessAzureAdTypeOnelogin AccessIdentityProviderGetResponseAccessAzureAdType = "onelogin" - AccessIdentityProviderGetResponseAccessAzureAdTypePingone AccessIdentityProviderGetResponseAccessAzureAdType = "pingone" - AccessIdentityProviderGetResponseAccessAzureAdTypeYandex AccessIdentityProviderGetResponseAccessAzureAdType = "yandex" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeOnetimepin AccessIdentityProviderReplaceResponseAccessAzureAdType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeAzureAd AccessIdentityProviderReplaceResponseAccessAzureAdType = "azureAD" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeSaml AccessIdentityProviderReplaceResponseAccessAzureAdType = "saml" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeCentrify AccessIdentityProviderReplaceResponseAccessAzureAdType = "centrify" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeFacebook AccessIdentityProviderReplaceResponseAccessAzureAdType = "facebook" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeGitHub AccessIdentityProviderReplaceResponseAccessAzureAdType = "github" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeGoogleApps AccessIdentityProviderReplaceResponseAccessAzureAdType = "google-apps" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeGoogle AccessIdentityProviderReplaceResponseAccessAzureAdType = "google" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeLinkedin AccessIdentityProviderReplaceResponseAccessAzureAdType = "linkedin" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeOidc AccessIdentityProviderReplaceResponseAccessAzureAdType = "oidc" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeOkta AccessIdentityProviderReplaceResponseAccessAzureAdType = "okta" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeOnelogin AccessIdentityProviderReplaceResponseAccessAzureAdType = "onelogin" + AccessIdentityProviderReplaceResponseAccessAzureAdTypePingone AccessIdentityProviderReplaceResponseAccessAzureAdType = "pingone" + AccessIdentityProviderReplaceResponseAccessAzureAdTypeYandex AccessIdentityProviderReplaceResponseAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessAzureAdScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5810,14 +5735,14 @@ type AccessIdentityProviderGetResponseAccessAzureAdScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessAzureAdScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessAzureAdScimConfig] -type accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessAzureAdScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessAzureAdScimConfig] +type accessIdentityProviderReplaceResponseAccessAzureAdScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5827,32 +5752,32 @@ type accessIdentityProviderGetResponseAccessAzureAdScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessAzureAdScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessCentrify struct { +type AccessIdentityProviderReplaceResponseAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessCentrifyConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessCentrifyConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessCentrifyType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessCentrifyType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessCentrifyScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessCentrifyJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessCentrifyScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessCentrifyJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessCentrifyJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessCentrify] -type accessIdentityProviderGetResponseAccessCentrifyJSON struct { +// accessIdentityProviderReplaceResponseAccessCentrifyJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessCentrify] +type accessIdentityProviderReplaceResponseAccessCentrifyJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5862,17 +5787,17 @@ type accessIdentityProviderGetResponseAccessCentrifyJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessCentrify) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessCentrify) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessCentrify) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessCentrifyConfig struct { +type AccessIdentityProviderReplaceResponseAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount string `json:"centrify_account"` // Your centrify app id @@ -5884,13 +5809,14 @@ type AccessIdentityProviderGetResponseAccessCentrifyConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderGetResponseAccessCentrifyConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderReplaceResponseAccessCentrifyConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessCentrifyConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessCentrifyConfig] -type accessIdentityProviderGetResponseAccessCentrifyConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessCentrifyConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessCentrifyConfig] +type accessIdentityProviderReplaceResponseAccessCentrifyConfigJSON struct { CentrifyAccount apijson.Field CentrifyAppID apijson.Field Claims apijson.Field @@ -5901,35 +5827,35 @@ type accessIdentityProviderGetResponseAccessCentrifyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessCentrifyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessCentrifyType string +type AccessIdentityProviderReplaceResponseAccessCentrifyType string const ( - AccessIdentityProviderGetResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderGetResponseAccessCentrifyType = "onetimepin" - AccessIdentityProviderGetResponseAccessCentrifyTypeAzureAd AccessIdentityProviderGetResponseAccessCentrifyType = "azureAD" - AccessIdentityProviderGetResponseAccessCentrifyTypeSaml AccessIdentityProviderGetResponseAccessCentrifyType = "saml" - AccessIdentityProviderGetResponseAccessCentrifyTypeCentrify AccessIdentityProviderGetResponseAccessCentrifyType = "centrify" - AccessIdentityProviderGetResponseAccessCentrifyTypeFacebook AccessIdentityProviderGetResponseAccessCentrifyType = "facebook" - AccessIdentityProviderGetResponseAccessCentrifyTypeGitHub AccessIdentityProviderGetResponseAccessCentrifyType = "github" - AccessIdentityProviderGetResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderGetResponseAccessCentrifyType = "google-apps" - AccessIdentityProviderGetResponseAccessCentrifyTypeGoogle AccessIdentityProviderGetResponseAccessCentrifyType = "google" - AccessIdentityProviderGetResponseAccessCentrifyTypeLinkedin AccessIdentityProviderGetResponseAccessCentrifyType = "linkedin" - AccessIdentityProviderGetResponseAccessCentrifyTypeOidc AccessIdentityProviderGetResponseAccessCentrifyType = "oidc" - AccessIdentityProviderGetResponseAccessCentrifyTypeOkta AccessIdentityProviderGetResponseAccessCentrifyType = "okta" - AccessIdentityProviderGetResponseAccessCentrifyTypeOnelogin AccessIdentityProviderGetResponseAccessCentrifyType = "onelogin" - AccessIdentityProviderGetResponseAccessCentrifyTypePingone AccessIdentityProviderGetResponseAccessCentrifyType = "pingone" - AccessIdentityProviderGetResponseAccessCentrifyTypeYandex AccessIdentityProviderGetResponseAccessCentrifyType = "yandex" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeOnetimepin AccessIdentityProviderReplaceResponseAccessCentrifyType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeAzureAd AccessIdentityProviderReplaceResponseAccessCentrifyType = "azureAD" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeSaml AccessIdentityProviderReplaceResponseAccessCentrifyType = "saml" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeCentrify AccessIdentityProviderReplaceResponseAccessCentrifyType = "centrify" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeFacebook AccessIdentityProviderReplaceResponseAccessCentrifyType = "facebook" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeGitHub AccessIdentityProviderReplaceResponseAccessCentrifyType = "github" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeGoogleApps AccessIdentityProviderReplaceResponseAccessCentrifyType = "google-apps" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeGoogle AccessIdentityProviderReplaceResponseAccessCentrifyType = "google" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeLinkedin AccessIdentityProviderReplaceResponseAccessCentrifyType = "linkedin" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeOidc AccessIdentityProviderReplaceResponseAccessCentrifyType = "oidc" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeOkta AccessIdentityProviderReplaceResponseAccessCentrifyType = "okta" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeOnelogin AccessIdentityProviderReplaceResponseAccessCentrifyType = "onelogin" + AccessIdentityProviderReplaceResponseAccessCentrifyTypePingone AccessIdentityProviderReplaceResponseAccessCentrifyType = "pingone" + AccessIdentityProviderReplaceResponseAccessCentrifyTypeYandex AccessIdentityProviderReplaceResponseAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessCentrifyScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -5946,14 +5872,14 @@ type AccessIdentityProviderGetResponseAccessCentrifyScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessCentrifyScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessCentrifyScimConfig] -type accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessCentrifyScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessCentrifyScimConfig] +type accessIdentityProviderReplaceResponseAccessCentrifyScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -5963,32 +5889,32 @@ type accessIdentityProviderGetResponseAccessCentrifyScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessCentrifyScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessFacebook struct { +type AccessIdentityProviderReplaceResponseAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessFacebookConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessFacebookConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessFacebookType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessFacebookType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessFacebookScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessFacebookJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessFacebookScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessFacebookJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessFacebookJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessFacebook] -type accessIdentityProviderGetResponseAccessFacebookJSON struct { +// accessIdentityProviderReplaceResponseAccessFacebookJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessFacebook] +type accessIdentityProviderReplaceResponseAccessFacebookJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -5998,62 +5924,63 @@ type accessIdentityProviderGetResponseAccessFacebookJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessFacebook) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessFacebook) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessFacebook) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessFacebookConfig struct { +type AccessIdentityProviderReplaceResponseAccessFacebookConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderGetResponseAccessFacebookConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderReplaceResponseAccessFacebookConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessFacebookConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessFacebookConfig] -type accessIdentityProviderGetResponseAccessFacebookConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessFacebookConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessFacebookConfig] +type accessIdentityProviderReplaceResponseAccessFacebookConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessFacebookConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessFacebookType string +type AccessIdentityProviderReplaceResponseAccessFacebookType string const ( - AccessIdentityProviderGetResponseAccessFacebookTypeOnetimepin AccessIdentityProviderGetResponseAccessFacebookType = "onetimepin" - AccessIdentityProviderGetResponseAccessFacebookTypeAzureAd AccessIdentityProviderGetResponseAccessFacebookType = "azureAD" - AccessIdentityProviderGetResponseAccessFacebookTypeSaml AccessIdentityProviderGetResponseAccessFacebookType = "saml" - AccessIdentityProviderGetResponseAccessFacebookTypeCentrify AccessIdentityProviderGetResponseAccessFacebookType = "centrify" - AccessIdentityProviderGetResponseAccessFacebookTypeFacebook AccessIdentityProviderGetResponseAccessFacebookType = "facebook" - AccessIdentityProviderGetResponseAccessFacebookTypeGitHub AccessIdentityProviderGetResponseAccessFacebookType = "github" - AccessIdentityProviderGetResponseAccessFacebookTypeGoogleApps AccessIdentityProviderGetResponseAccessFacebookType = "google-apps" - AccessIdentityProviderGetResponseAccessFacebookTypeGoogle AccessIdentityProviderGetResponseAccessFacebookType = "google" - AccessIdentityProviderGetResponseAccessFacebookTypeLinkedin AccessIdentityProviderGetResponseAccessFacebookType = "linkedin" - AccessIdentityProviderGetResponseAccessFacebookTypeOidc AccessIdentityProviderGetResponseAccessFacebookType = "oidc" - AccessIdentityProviderGetResponseAccessFacebookTypeOkta AccessIdentityProviderGetResponseAccessFacebookType = "okta" - AccessIdentityProviderGetResponseAccessFacebookTypeOnelogin AccessIdentityProviderGetResponseAccessFacebookType = "onelogin" - AccessIdentityProviderGetResponseAccessFacebookTypePingone AccessIdentityProviderGetResponseAccessFacebookType = "pingone" - AccessIdentityProviderGetResponseAccessFacebookTypeYandex AccessIdentityProviderGetResponseAccessFacebookType = "yandex" + AccessIdentityProviderReplaceResponseAccessFacebookTypeOnetimepin AccessIdentityProviderReplaceResponseAccessFacebookType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessFacebookTypeAzureAd AccessIdentityProviderReplaceResponseAccessFacebookType = "azureAD" + AccessIdentityProviderReplaceResponseAccessFacebookTypeSaml AccessIdentityProviderReplaceResponseAccessFacebookType = "saml" + AccessIdentityProviderReplaceResponseAccessFacebookTypeCentrify AccessIdentityProviderReplaceResponseAccessFacebookType = "centrify" + AccessIdentityProviderReplaceResponseAccessFacebookTypeFacebook AccessIdentityProviderReplaceResponseAccessFacebookType = "facebook" + AccessIdentityProviderReplaceResponseAccessFacebookTypeGitHub AccessIdentityProviderReplaceResponseAccessFacebookType = "github" + AccessIdentityProviderReplaceResponseAccessFacebookTypeGoogleApps AccessIdentityProviderReplaceResponseAccessFacebookType = "google-apps" + AccessIdentityProviderReplaceResponseAccessFacebookTypeGoogle AccessIdentityProviderReplaceResponseAccessFacebookType = "google" + AccessIdentityProviderReplaceResponseAccessFacebookTypeLinkedin AccessIdentityProviderReplaceResponseAccessFacebookType = "linkedin" + AccessIdentityProviderReplaceResponseAccessFacebookTypeOidc AccessIdentityProviderReplaceResponseAccessFacebookType = "oidc" + AccessIdentityProviderReplaceResponseAccessFacebookTypeOkta AccessIdentityProviderReplaceResponseAccessFacebookType = "okta" + AccessIdentityProviderReplaceResponseAccessFacebookTypeOnelogin AccessIdentityProviderReplaceResponseAccessFacebookType = "onelogin" + AccessIdentityProviderReplaceResponseAccessFacebookTypePingone AccessIdentityProviderReplaceResponseAccessFacebookType = "pingone" + AccessIdentityProviderReplaceResponseAccessFacebookTypeYandex AccessIdentityProviderReplaceResponseAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessFacebookScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6070,14 +5997,14 @@ type AccessIdentityProviderGetResponseAccessFacebookScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessFacebookScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessFacebookScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessFacebookScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessFacebookScimConfig] -type accessIdentityProviderGetResponseAccessFacebookScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessFacebookScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessFacebookScimConfig] +type accessIdentityProviderReplaceResponseAccessFacebookScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6087,32 +6014,32 @@ type accessIdentityProviderGetResponseAccessFacebookScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessFacebookScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessGitHub struct { +type AccessIdentityProviderReplaceResponseAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessGitHubConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessGitHubConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessGitHubType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessGitHubType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessGitHubScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessGitHubJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessGitHubScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessGitHubJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGitHubJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessGitHub] -type accessIdentityProviderGetResponseAccessGitHubJSON struct { +// accessIdentityProviderReplaceResponseAccessGitHubJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessGitHub] +type accessIdentityProviderReplaceResponseAccessGitHubJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6122,62 +6049,63 @@ type accessIdentityProviderGetResponseAccessGitHubJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGitHub) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessGitHub) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessGitHub) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGitHubConfig struct { +type AccessIdentityProviderReplaceResponseAccessGitHubConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderGetResponseAccessGitHubConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderReplaceResponseAccessGitHubConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGitHubConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessGitHubConfig] -type accessIdentityProviderGetResponseAccessGitHubConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessGitHubConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessGitHubConfig] +type accessIdentityProviderReplaceResponseAccessGitHubConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGitHubConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGitHubType string +type AccessIdentityProviderReplaceResponseAccessGitHubType string const ( - AccessIdentityProviderGetResponseAccessGitHubTypeOnetimepin AccessIdentityProviderGetResponseAccessGitHubType = "onetimepin" - AccessIdentityProviderGetResponseAccessGitHubTypeAzureAd AccessIdentityProviderGetResponseAccessGitHubType = "azureAD" - AccessIdentityProviderGetResponseAccessGitHubTypeSaml AccessIdentityProviderGetResponseAccessGitHubType = "saml" - AccessIdentityProviderGetResponseAccessGitHubTypeCentrify AccessIdentityProviderGetResponseAccessGitHubType = "centrify" - AccessIdentityProviderGetResponseAccessGitHubTypeFacebook AccessIdentityProviderGetResponseAccessGitHubType = "facebook" - AccessIdentityProviderGetResponseAccessGitHubTypeGitHub AccessIdentityProviderGetResponseAccessGitHubType = "github" - AccessIdentityProviderGetResponseAccessGitHubTypeGoogleApps AccessIdentityProviderGetResponseAccessGitHubType = "google-apps" - AccessIdentityProviderGetResponseAccessGitHubTypeGoogle AccessIdentityProviderGetResponseAccessGitHubType = "google" - AccessIdentityProviderGetResponseAccessGitHubTypeLinkedin AccessIdentityProviderGetResponseAccessGitHubType = "linkedin" - AccessIdentityProviderGetResponseAccessGitHubTypeOidc AccessIdentityProviderGetResponseAccessGitHubType = "oidc" - AccessIdentityProviderGetResponseAccessGitHubTypeOkta AccessIdentityProviderGetResponseAccessGitHubType = "okta" - AccessIdentityProviderGetResponseAccessGitHubTypeOnelogin AccessIdentityProviderGetResponseAccessGitHubType = "onelogin" - AccessIdentityProviderGetResponseAccessGitHubTypePingone AccessIdentityProviderGetResponseAccessGitHubType = "pingone" - AccessIdentityProviderGetResponseAccessGitHubTypeYandex AccessIdentityProviderGetResponseAccessGitHubType = "yandex" + AccessIdentityProviderReplaceResponseAccessGitHubTypeOnetimepin AccessIdentityProviderReplaceResponseAccessGitHubType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessGitHubTypeAzureAd AccessIdentityProviderReplaceResponseAccessGitHubType = "azureAD" + AccessIdentityProviderReplaceResponseAccessGitHubTypeSaml AccessIdentityProviderReplaceResponseAccessGitHubType = "saml" + AccessIdentityProviderReplaceResponseAccessGitHubTypeCentrify AccessIdentityProviderReplaceResponseAccessGitHubType = "centrify" + AccessIdentityProviderReplaceResponseAccessGitHubTypeFacebook AccessIdentityProviderReplaceResponseAccessGitHubType = "facebook" + AccessIdentityProviderReplaceResponseAccessGitHubTypeGitHub AccessIdentityProviderReplaceResponseAccessGitHubType = "github" + AccessIdentityProviderReplaceResponseAccessGitHubTypeGoogleApps AccessIdentityProviderReplaceResponseAccessGitHubType = "google-apps" + AccessIdentityProviderReplaceResponseAccessGitHubTypeGoogle AccessIdentityProviderReplaceResponseAccessGitHubType = "google" + AccessIdentityProviderReplaceResponseAccessGitHubTypeLinkedin AccessIdentityProviderReplaceResponseAccessGitHubType = "linkedin" + AccessIdentityProviderReplaceResponseAccessGitHubTypeOidc AccessIdentityProviderReplaceResponseAccessGitHubType = "oidc" + AccessIdentityProviderReplaceResponseAccessGitHubTypeOkta AccessIdentityProviderReplaceResponseAccessGitHubType = "okta" + AccessIdentityProviderReplaceResponseAccessGitHubTypeOnelogin AccessIdentityProviderReplaceResponseAccessGitHubType = "onelogin" + AccessIdentityProviderReplaceResponseAccessGitHubTypePingone AccessIdentityProviderReplaceResponseAccessGitHubType = "pingone" + AccessIdentityProviderReplaceResponseAccessGitHubTypeYandex AccessIdentityProviderReplaceResponseAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessGitHubScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6194,14 +6122,14 @@ type AccessIdentityProviderGetResponseAccessGitHubScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessGitHubScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessGitHubScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGitHubScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessGitHubScimConfig] -type accessIdentityProviderGetResponseAccessGitHubScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessGitHubScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessGitHubScimConfig] +type accessIdentityProviderReplaceResponseAccessGitHubScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6211,32 +6139,32 @@ type accessIdentityProviderGetResponseAccessGitHubScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGitHubScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessGoogle struct { +type AccessIdentityProviderReplaceResponseAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessGoogleConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessGoogleConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessGoogleType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessGoogleType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessGoogleScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessGoogleJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessGoogleScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessGoogleJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessGoogle] -type accessIdentityProviderGetResponseAccessGoogleJSON struct { +// accessIdentityProviderReplaceResponseAccessGoogleJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessGoogle] +type accessIdentityProviderReplaceResponseAccessGoogleJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6246,17 +6174,17 @@ type accessIdentityProviderGetResponseAccessGoogleJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogle) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessGoogle) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessGoogle) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGoogleConfig struct { +type AccessIdentityProviderReplaceResponseAccessGoogleConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -6264,13 +6192,14 @@ type AccessIdentityProviderGetResponseAccessGoogleConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderGetResponseAccessGoogleConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderReplaceResponseAccessGoogleConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessGoogleConfig] -type accessIdentityProviderGetResponseAccessGoogleConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessGoogleConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessGoogleConfig] +type accessIdentityProviderReplaceResponseAccessGoogleConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -6279,35 +6208,35 @@ type accessIdentityProviderGetResponseAccessGoogleConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogleConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGoogleType string +type AccessIdentityProviderReplaceResponseAccessGoogleType string const ( - AccessIdentityProviderGetResponseAccessGoogleTypeOnetimepin AccessIdentityProviderGetResponseAccessGoogleType = "onetimepin" - AccessIdentityProviderGetResponseAccessGoogleTypeAzureAd AccessIdentityProviderGetResponseAccessGoogleType = "azureAD" - AccessIdentityProviderGetResponseAccessGoogleTypeSaml AccessIdentityProviderGetResponseAccessGoogleType = "saml" - AccessIdentityProviderGetResponseAccessGoogleTypeCentrify AccessIdentityProviderGetResponseAccessGoogleType = "centrify" - AccessIdentityProviderGetResponseAccessGoogleTypeFacebook AccessIdentityProviderGetResponseAccessGoogleType = "facebook" - AccessIdentityProviderGetResponseAccessGoogleTypeGitHub AccessIdentityProviderGetResponseAccessGoogleType = "github" - AccessIdentityProviderGetResponseAccessGoogleTypeGoogleApps AccessIdentityProviderGetResponseAccessGoogleType = "google-apps" - AccessIdentityProviderGetResponseAccessGoogleTypeGoogle AccessIdentityProviderGetResponseAccessGoogleType = "google" - AccessIdentityProviderGetResponseAccessGoogleTypeLinkedin AccessIdentityProviderGetResponseAccessGoogleType = "linkedin" - AccessIdentityProviderGetResponseAccessGoogleTypeOidc AccessIdentityProviderGetResponseAccessGoogleType = "oidc" - AccessIdentityProviderGetResponseAccessGoogleTypeOkta AccessIdentityProviderGetResponseAccessGoogleType = "okta" - AccessIdentityProviderGetResponseAccessGoogleTypeOnelogin AccessIdentityProviderGetResponseAccessGoogleType = "onelogin" - AccessIdentityProviderGetResponseAccessGoogleTypePingone AccessIdentityProviderGetResponseAccessGoogleType = "pingone" - AccessIdentityProviderGetResponseAccessGoogleTypeYandex AccessIdentityProviderGetResponseAccessGoogleType = "yandex" + AccessIdentityProviderReplaceResponseAccessGoogleTypeOnetimepin AccessIdentityProviderReplaceResponseAccessGoogleType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessGoogleTypeAzureAd AccessIdentityProviderReplaceResponseAccessGoogleType = "azureAD" + AccessIdentityProviderReplaceResponseAccessGoogleTypeSaml AccessIdentityProviderReplaceResponseAccessGoogleType = "saml" + AccessIdentityProviderReplaceResponseAccessGoogleTypeCentrify AccessIdentityProviderReplaceResponseAccessGoogleType = "centrify" + AccessIdentityProviderReplaceResponseAccessGoogleTypeFacebook AccessIdentityProviderReplaceResponseAccessGoogleType = "facebook" + AccessIdentityProviderReplaceResponseAccessGoogleTypeGitHub AccessIdentityProviderReplaceResponseAccessGoogleType = "github" + AccessIdentityProviderReplaceResponseAccessGoogleTypeGoogleApps AccessIdentityProviderReplaceResponseAccessGoogleType = "google-apps" + AccessIdentityProviderReplaceResponseAccessGoogleTypeGoogle AccessIdentityProviderReplaceResponseAccessGoogleType = "google" + AccessIdentityProviderReplaceResponseAccessGoogleTypeLinkedin AccessIdentityProviderReplaceResponseAccessGoogleType = "linkedin" + AccessIdentityProviderReplaceResponseAccessGoogleTypeOidc AccessIdentityProviderReplaceResponseAccessGoogleType = "oidc" + AccessIdentityProviderReplaceResponseAccessGoogleTypeOkta AccessIdentityProviderReplaceResponseAccessGoogleType = "okta" + AccessIdentityProviderReplaceResponseAccessGoogleTypeOnelogin AccessIdentityProviderReplaceResponseAccessGoogleType = "onelogin" + AccessIdentityProviderReplaceResponseAccessGoogleTypePingone AccessIdentityProviderReplaceResponseAccessGoogleType = "pingone" + AccessIdentityProviderReplaceResponseAccessGoogleTypeYandex AccessIdentityProviderReplaceResponseAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessGoogleScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6324,14 +6253,14 @@ type AccessIdentityProviderGetResponseAccessGoogleScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessGoogleScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessGoogleScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessGoogleScimConfig] -type accessIdentityProviderGetResponseAccessGoogleScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessGoogleScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessGoogleScimConfig] +type accessIdentityProviderReplaceResponseAccessGoogleScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6341,32 +6270,32 @@ type accessIdentityProviderGetResponseAccessGoogleScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogleScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessGoogleApps struct { +type AccessIdentityProviderReplaceResponseAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessGoogleAppsConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessGoogleAppsConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessGoogleAppsType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessGoogleAppsType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessGoogleAppsJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessGoogleAppsScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessGoogleAppsJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleAppsJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessGoogleApps] -type accessIdentityProviderGetResponseAccessGoogleAppsJSON struct { +// accessIdentityProviderReplaceResponseAccessGoogleAppsJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessGoogleApps] +type accessIdentityProviderReplaceResponseAccessGoogleAppsJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6376,17 +6305,17 @@ type accessIdentityProviderGetResponseAccessGoogleAppsJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogleApps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessGoogleApps) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessGoogleApps) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGoogleAppsConfig struct { +type AccessIdentityProviderReplaceResponseAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain string `json:"apps_domain"` // Custom claims @@ -6396,14 +6325,14 @@ type AccessIdentityProviderGetResponseAccessGoogleAppsConfig struct { // Your OAuth Client Secret ClientSecret string `json:"client_secret"` // The claim name for email in the id_token response. - EmailClaimName string `json:"email_claim_name"` - JSON accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON `json:"-"` + EmailClaimName string `json:"email_claim_name"` + JSON accessIdentityProviderReplaceResponseAccessGoogleAppsConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessGoogleAppsConfig] -type accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessGoogleAppsConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessGoogleAppsConfig] +type accessIdentityProviderReplaceResponseAccessGoogleAppsConfigJSON struct { AppsDomain apijson.Field Claims apijson.Field ClientID apijson.Field @@ -6413,35 +6342,35 @@ type accessIdentityProviderGetResponseAccessGoogleAppsConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogleAppsConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessGoogleAppsType string +type AccessIdentityProviderReplaceResponseAccessGoogleAppsType string const ( - AccessIdentityProviderGetResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderGetResponseAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderGetResponseAccessGoogleAppsType = "azureAD" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeSaml AccessIdentityProviderGetResponseAccessGoogleAppsType = "saml" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderGetResponseAccessGoogleAppsType = "centrify" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderGetResponseAccessGoogleAppsType = "facebook" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderGetResponseAccessGoogleAppsType = "github" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderGetResponseAccessGoogleAppsType = "google-apps" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderGetResponseAccessGoogleAppsType = "google" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderGetResponseAccessGoogleAppsType = "linkedin" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeOidc AccessIdentityProviderGetResponseAccessGoogleAppsType = "oidc" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeOkta AccessIdentityProviderGetResponseAccessGoogleAppsType = "okta" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderGetResponseAccessGoogleAppsType = "onelogin" - AccessIdentityProviderGetResponseAccessGoogleAppsTypePingone AccessIdentityProviderGetResponseAccessGoogleAppsType = "pingone" - AccessIdentityProviderGetResponseAccessGoogleAppsTypeYandex AccessIdentityProviderGetResponseAccessGoogleAppsType = "yandex" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeOnetimepin AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeAzureAd AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "azureAD" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeSaml AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "saml" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeCentrify AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "centrify" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeFacebook AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "facebook" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeGitHub AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "github" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeGoogleApps AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "google-apps" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeGoogle AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "google" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeLinkedin AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "linkedin" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeOidc AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "oidc" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeOkta AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "okta" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeOnelogin AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "onelogin" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypePingone AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "pingone" + AccessIdentityProviderReplaceResponseAccessGoogleAppsTypeYandex AccessIdentityProviderReplaceResponseAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6458,14 +6387,14 @@ type AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessGoogleAppsScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON contains the +// accessIdentityProviderReplaceResponseAccessGoogleAppsScimConfigJSON contains the // JSON metadata for the struct -// [AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig] -type accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON struct { +// [AccessIdentityProviderReplaceResponseAccessGoogleAppsScimConfig] +type accessIdentityProviderReplaceResponseAccessGoogleAppsScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6475,32 +6404,32 @@ type accessIdentityProviderGetResponseAccessGoogleAppsScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessGoogleAppsScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessLinkedin struct { +type AccessIdentityProviderReplaceResponseAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessLinkedinConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessLinkedinConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessLinkedinType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessLinkedinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessLinkedinScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessLinkedinJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessLinkedinScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessLinkedinJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessLinkedinJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessLinkedin] -type accessIdentityProviderGetResponseAccessLinkedinJSON struct { +// accessIdentityProviderReplaceResponseAccessLinkedinJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessLinkedin] +type accessIdentityProviderReplaceResponseAccessLinkedinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6510,62 +6439,63 @@ type accessIdentityProviderGetResponseAccessLinkedinJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessLinkedin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessLinkedin) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessLinkedin) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessLinkedinConfig struct { +type AccessIdentityProviderReplaceResponseAccessLinkedinConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderGetResponseAccessLinkedinConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderReplaceResponseAccessLinkedinConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessLinkedinConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessLinkedinConfig] -type accessIdentityProviderGetResponseAccessLinkedinConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessLinkedinConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessLinkedinConfig] +type accessIdentityProviderReplaceResponseAccessLinkedinConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessLinkedinConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessLinkedinType string +type AccessIdentityProviderReplaceResponseAccessLinkedinType string const ( - AccessIdentityProviderGetResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderGetResponseAccessLinkedinType = "onetimepin" - AccessIdentityProviderGetResponseAccessLinkedinTypeAzureAd AccessIdentityProviderGetResponseAccessLinkedinType = "azureAD" - AccessIdentityProviderGetResponseAccessLinkedinTypeSaml AccessIdentityProviderGetResponseAccessLinkedinType = "saml" - AccessIdentityProviderGetResponseAccessLinkedinTypeCentrify AccessIdentityProviderGetResponseAccessLinkedinType = "centrify" - AccessIdentityProviderGetResponseAccessLinkedinTypeFacebook AccessIdentityProviderGetResponseAccessLinkedinType = "facebook" - AccessIdentityProviderGetResponseAccessLinkedinTypeGitHub AccessIdentityProviderGetResponseAccessLinkedinType = "github" - AccessIdentityProviderGetResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderGetResponseAccessLinkedinType = "google-apps" - AccessIdentityProviderGetResponseAccessLinkedinTypeGoogle AccessIdentityProviderGetResponseAccessLinkedinType = "google" - AccessIdentityProviderGetResponseAccessLinkedinTypeLinkedin AccessIdentityProviderGetResponseAccessLinkedinType = "linkedin" - AccessIdentityProviderGetResponseAccessLinkedinTypeOidc AccessIdentityProviderGetResponseAccessLinkedinType = "oidc" - AccessIdentityProviderGetResponseAccessLinkedinTypeOkta AccessIdentityProviderGetResponseAccessLinkedinType = "okta" - AccessIdentityProviderGetResponseAccessLinkedinTypeOnelogin AccessIdentityProviderGetResponseAccessLinkedinType = "onelogin" - AccessIdentityProviderGetResponseAccessLinkedinTypePingone AccessIdentityProviderGetResponseAccessLinkedinType = "pingone" - AccessIdentityProviderGetResponseAccessLinkedinTypeYandex AccessIdentityProviderGetResponseAccessLinkedinType = "yandex" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeOnetimepin AccessIdentityProviderReplaceResponseAccessLinkedinType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeAzureAd AccessIdentityProviderReplaceResponseAccessLinkedinType = "azureAD" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeSaml AccessIdentityProviderReplaceResponseAccessLinkedinType = "saml" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeCentrify AccessIdentityProviderReplaceResponseAccessLinkedinType = "centrify" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeFacebook AccessIdentityProviderReplaceResponseAccessLinkedinType = "facebook" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeGitHub AccessIdentityProviderReplaceResponseAccessLinkedinType = "github" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeGoogleApps AccessIdentityProviderReplaceResponseAccessLinkedinType = "google-apps" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeGoogle AccessIdentityProviderReplaceResponseAccessLinkedinType = "google" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeLinkedin AccessIdentityProviderReplaceResponseAccessLinkedinType = "linkedin" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeOidc AccessIdentityProviderReplaceResponseAccessLinkedinType = "oidc" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeOkta AccessIdentityProviderReplaceResponseAccessLinkedinType = "okta" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeOnelogin AccessIdentityProviderReplaceResponseAccessLinkedinType = "onelogin" + AccessIdentityProviderReplaceResponseAccessLinkedinTypePingone AccessIdentityProviderReplaceResponseAccessLinkedinType = "pingone" + AccessIdentityProviderReplaceResponseAccessLinkedinTypeYandex AccessIdentityProviderReplaceResponseAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessLinkedinScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6582,14 +6512,14 @@ type AccessIdentityProviderGetResponseAccessLinkedinScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessLinkedinScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessLinkedinScimConfig] -type accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessLinkedinScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessLinkedinScimConfig] +type accessIdentityProviderReplaceResponseAccessLinkedinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6599,32 +6529,32 @@ type accessIdentityProviderGetResponseAccessLinkedinScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessLinkedinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessOidc struct { +type AccessIdentityProviderReplaceResponseAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessOidcConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessOidcConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessOidcType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessOidcType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessOidcScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessOidcJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessOidcScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessOidcJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOidcJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessOidc] -type accessIdentityProviderGetResponseAccessOidcJSON struct { +// accessIdentityProviderReplaceResponseAccessOidcJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessOidc] +type accessIdentityProviderReplaceResponseAccessOidcJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6634,16 +6564,17 @@ type accessIdentityProviderGetResponseAccessOidcJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOidc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessOidc) implementsAccessIdentityProviderGetResponse() {} +func (r AccessIdentityProviderReplaceResponseAccessOidc) implementsAccessIdentityProviderReplaceResponse() { +} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOidcConfig struct { +type AccessIdentityProviderReplaceResponseAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL string `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -6659,13 +6590,13 @@ type AccessIdentityProviderGetResponseAccessOidcConfig struct { // OAuth scopes Scopes []string `json:"scopes"` // The token_endpoint URL of your IdP - TokenURL string `json:"token_url"` - JSON accessIdentityProviderGetResponseAccessOidcConfigJSON `json:"-"` + TokenURL string `json:"token_url"` + JSON accessIdentityProviderReplaceResponseAccessOidcConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOidcConfigJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessOidcConfig] -type accessIdentityProviderGetResponseAccessOidcConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOidcConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessOidcConfig] +type accessIdentityProviderReplaceResponseAccessOidcConfigJSON struct { AuthURL apijson.Field CertsURL apijson.Field Claims apijson.Field @@ -6678,35 +6609,35 @@ type accessIdentityProviderGetResponseAccessOidcConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOidcConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOidcType string +type AccessIdentityProviderReplaceResponseAccessOidcType string const ( - AccessIdentityProviderGetResponseAccessOidcTypeOnetimepin AccessIdentityProviderGetResponseAccessOidcType = "onetimepin" - AccessIdentityProviderGetResponseAccessOidcTypeAzureAd AccessIdentityProviderGetResponseAccessOidcType = "azureAD" - AccessIdentityProviderGetResponseAccessOidcTypeSaml AccessIdentityProviderGetResponseAccessOidcType = "saml" - AccessIdentityProviderGetResponseAccessOidcTypeCentrify AccessIdentityProviderGetResponseAccessOidcType = "centrify" - AccessIdentityProviderGetResponseAccessOidcTypeFacebook AccessIdentityProviderGetResponseAccessOidcType = "facebook" - AccessIdentityProviderGetResponseAccessOidcTypeGitHub AccessIdentityProviderGetResponseAccessOidcType = "github" - AccessIdentityProviderGetResponseAccessOidcTypeGoogleApps AccessIdentityProviderGetResponseAccessOidcType = "google-apps" - AccessIdentityProviderGetResponseAccessOidcTypeGoogle AccessIdentityProviderGetResponseAccessOidcType = "google" - AccessIdentityProviderGetResponseAccessOidcTypeLinkedin AccessIdentityProviderGetResponseAccessOidcType = "linkedin" - AccessIdentityProviderGetResponseAccessOidcTypeOidc AccessIdentityProviderGetResponseAccessOidcType = "oidc" - AccessIdentityProviderGetResponseAccessOidcTypeOkta AccessIdentityProviderGetResponseAccessOidcType = "okta" - AccessIdentityProviderGetResponseAccessOidcTypeOnelogin AccessIdentityProviderGetResponseAccessOidcType = "onelogin" - AccessIdentityProviderGetResponseAccessOidcTypePingone AccessIdentityProviderGetResponseAccessOidcType = "pingone" - AccessIdentityProviderGetResponseAccessOidcTypeYandex AccessIdentityProviderGetResponseAccessOidcType = "yandex" + AccessIdentityProviderReplaceResponseAccessOidcTypeOnetimepin AccessIdentityProviderReplaceResponseAccessOidcType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessOidcTypeAzureAd AccessIdentityProviderReplaceResponseAccessOidcType = "azureAD" + AccessIdentityProviderReplaceResponseAccessOidcTypeSaml AccessIdentityProviderReplaceResponseAccessOidcType = "saml" + AccessIdentityProviderReplaceResponseAccessOidcTypeCentrify AccessIdentityProviderReplaceResponseAccessOidcType = "centrify" + AccessIdentityProviderReplaceResponseAccessOidcTypeFacebook AccessIdentityProviderReplaceResponseAccessOidcType = "facebook" + AccessIdentityProviderReplaceResponseAccessOidcTypeGitHub AccessIdentityProviderReplaceResponseAccessOidcType = "github" + AccessIdentityProviderReplaceResponseAccessOidcTypeGoogleApps AccessIdentityProviderReplaceResponseAccessOidcType = "google-apps" + AccessIdentityProviderReplaceResponseAccessOidcTypeGoogle AccessIdentityProviderReplaceResponseAccessOidcType = "google" + AccessIdentityProviderReplaceResponseAccessOidcTypeLinkedin AccessIdentityProviderReplaceResponseAccessOidcType = "linkedin" + AccessIdentityProviderReplaceResponseAccessOidcTypeOidc AccessIdentityProviderReplaceResponseAccessOidcType = "oidc" + AccessIdentityProviderReplaceResponseAccessOidcTypeOkta AccessIdentityProviderReplaceResponseAccessOidcType = "okta" + AccessIdentityProviderReplaceResponseAccessOidcTypeOnelogin AccessIdentityProviderReplaceResponseAccessOidcType = "onelogin" + AccessIdentityProviderReplaceResponseAccessOidcTypePingone AccessIdentityProviderReplaceResponseAccessOidcType = "pingone" + AccessIdentityProviderReplaceResponseAccessOidcTypeYandex AccessIdentityProviderReplaceResponseAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessOidcScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6723,13 +6654,14 @@ type AccessIdentityProviderGetResponseAccessOidcScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessOidcScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessOidcScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOidcScimConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessOidcScimConfig] -type accessIdentityProviderGetResponseAccessOidcScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOidcScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessOidcScimConfig] +type accessIdentityProviderReplaceResponseAccessOidcScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6739,32 +6671,32 @@ type accessIdentityProviderGetResponseAccessOidcScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOidcScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessOkta struct { +type AccessIdentityProviderReplaceResponseAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessOktaConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessOktaConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessOktaType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessOktaType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessOktaScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessOktaJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessOktaScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessOktaJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOktaJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessOkta] -type accessIdentityProviderGetResponseAccessOktaJSON struct { +// accessIdentityProviderReplaceResponseAccessOktaJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessOkta] +type accessIdentityProviderReplaceResponseAccessOktaJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6774,16 +6706,17 @@ type accessIdentityProviderGetResponseAccessOktaJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOkta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessOkta) implementsAccessIdentityProviderGetResponse() {} +func (r AccessIdentityProviderReplaceResponseAccessOkta) implementsAccessIdentityProviderReplaceResponse() { +} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOktaConfig struct { +type AccessIdentityProviderReplaceResponseAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID string `json:"authorization_server_id"` // Custom claims @@ -6795,13 +6728,13 @@ type AccessIdentityProviderGetResponseAccessOktaConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your okta account url - OktaAccount string `json:"okta_account"` - JSON accessIdentityProviderGetResponseAccessOktaConfigJSON `json:"-"` + OktaAccount string `json:"okta_account"` + JSON accessIdentityProviderReplaceResponseAccessOktaConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOktaConfigJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessOktaConfig] -type accessIdentityProviderGetResponseAccessOktaConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOktaConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessOktaConfig] +type accessIdentityProviderReplaceResponseAccessOktaConfigJSON struct { AuthorizationServerID apijson.Field Claims apijson.Field ClientID apijson.Field @@ -6809,38 +6742,38 @@ type accessIdentityProviderGetResponseAccessOktaConfigJSON struct { EmailClaimName apijson.Field OktaAccount apijson.Field raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderGetResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of identity provider. To determine the value for a specific provider, -// refer to our -// [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOktaType string - -const ( - AccessIdentityProviderGetResponseAccessOktaTypeOnetimepin AccessIdentityProviderGetResponseAccessOktaType = "onetimepin" - AccessIdentityProviderGetResponseAccessOktaTypeAzureAd AccessIdentityProviderGetResponseAccessOktaType = "azureAD" - AccessIdentityProviderGetResponseAccessOktaTypeSaml AccessIdentityProviderGetResponseAccessOktaType = "saml" - AccessIdentityProviderGetResponseAccessOktaTypeCentrify AccessIdentityProviderGetResponseAccessOktaType = "centrify" - AccessIdentityProviderGetResponseAccessOktaTypeFacebook AccessIdentityProviderGetResponseAccessOktaType = "facebook" - AccessIdentityProviderGetResponseAccessOktaTypeGitHub AccessIdentityProviderGetResponseAccessOktaType = "github" - AccessIdentityProviderGetResponseAccessOktaTypeGoogleApps AccessIdentityProviderGetResponseAccessOktaType = "google-apps" - AccessIdentityProviderGetResponseAccessOktaTypeGoogle AccessIdentityProviderGetResponseAccessOktaType = "google" - AccessIdentityProviderGetResponseAccessOktaTypeLinkedin AccessIdentityProviderGetResponseAccessOktaType = "linkedin" - AccessIdentityProviderGetResponseAccessOktaTypeOidc AccessIdentityProviderGetResponseAccessOktaType = "oidc" - AccessIdentityProviderGetResponseAccessOktaTypeOkta AccessIdentityProviderGetResponseAccessOktaType = "okta" - AccessIdentityProviderGetResponseAccessOktaTypeOnelogin AccessIdentityProviderGetResponseAccessOktaType = "onelogin" - AccessIdentityProviderGetResponseAccessOktaTypePingone AccessIdentityProviderGetResponseAccessOktaType = "pingone" - AccessIdentityProviderGetResponseAccessOktaTypeYandex AccessIdentityProviderGetResponseAccessOktaType = "yandex" + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderReplaceResponseAccessOktaConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of identity provider. To determine the value for a specific provider, +// refer to our +// [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). +type AccessIdentityProviderReplaceResponseAccessOktaType string + +const ( + AccessIdentityProviderReplaceResponseAccessOktaTypeOnetimepin AccessIdentityProviderReplaceResponseAccessOktaType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessOktaTypeAzureAd AccessIdentityProviderReplaceResponseAccessOktaType = "azureAD" + AccessIdentityProviderReplaceResponseAccessOktaTypeSaml AccessIdentityProviderReplaceResponseAccessOktaType = "saml" + AccessIdentityProviderReplaceResponseAccessOktaTypeCentrify AccessIdentityProviderReplaceResponseAccessOktaType = "centrify" + AccessIdentityProviderReplaceResponseAccessOktaTypeFacebook AccessIdentityProviderReplaceResponseAccessOktaType = "facebook" + AccessIdentityProviderReplaceResponseAccessOktaTypeGitHub AccessIdentityProviderReplaceResponseAccessOktaType = "github" + AccessIdentityProviderReplaceResponseAccessOktaTypeGoogleApps AccessIdentityProviderReplaceResponseAccessOktaType = "google-apps" + AccessIdentityProviderReplaceResponseAccessOktaTypeGoogle AccessIdentityProviderReplaceResponseAccessOktaType = "google" + AccessIdentityProviderReplaceResponseAccessOktaTypeLinkedin AccessIdentityProviderReplaceResponseAccessOktaType = "linkedin" + AccessIdentityProviderReplaceResponseAccessOktaTypeOidc AccessIdentityProviderReplaceResponseAccessOktaType = "oidc" + AccessIdentityProviderReplaceResponseAccessOktaTypeOkta AccessIdentityProviderReplaceResponseAccessOktaType = "okta" + AccessIdentityProviderReplaceResponseAccessOktaTypeOnelogin AccessIdentityProviderReplaceResponseAccessOktaType = "onelogin" + AccessIdentityProviderReplaceResponseAccessOktaTypePingone AccessIdentityProviderReplaceResponseAccessOktaType = "pingone" + AccessIdentityProviderReplaceResponseAccessOktaTypeYandex AccessIdentityProviderReplaceResponseAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessOktaScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6857,13 +6790,14 @@ type AccessIdentityProviderGetResponseAccessOktaScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessOktaScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessOktaScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOktaScimConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessOktaScimConfig] -type accessIdentityProviderGetResponseAccessOktaScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOktaScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessOktaScimConfig] +type accessIdentityProviderReplaceResponseAccessOktaScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -6873,32 +6807,32 @@ type accessIdentityProviderGetResponseAccessOktaScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOktaScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessOnelogin struct { +type AccessIdentityProviderReplaceResponseAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessOneloginConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessOneloginConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessOneloginType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessOneloginType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessOneloginScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessOneloginJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessOneloginScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessOneloginJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOneloginJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessOnelogin] -type accessIdentityProviderGetResponseAccessOneloginJSON struct { +// accessIdentityProviderReplaceResponseAccessOneloginJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessOnelogin] +type accessIdentityProviderReplaceResponseAccessOneloginJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -6908,17 +6842,17 @@ type accessIdentityProviderGetResponseAccessOneloginJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOnelogin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessOnelogin) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessOnelogin) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOneloginConfig struct { +type AccessIdentityProviderReplaceResponseAccessOneloginConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -6928,13 +6862,14 @@ type AccessIdentityProviderGetResponseAccessOneloginConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your OneLogin account url - OneloginAccount string `json:"onelogin_account"` - JSON accessIdentityProviderGetResponseAccessOneloginConfigJSON `json:"-"` + OneloginAccount string `json:"onelogin_account"` + JSON accessIdentityProviderReplaceResponseAccessOneloginConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOneloginConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessOneloginConfig] -type accessIdentityProviderGetResponseAccessOneloginConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOneloginConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessOneloginConfig] +type accessIdentityProviderReplaceResponseAccessOneloginConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -6944,35 +6879,35 @@ type accessIdentityProviderGetResponseAccessOneloginConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOneloginConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOneloginType string +type AccessIdentityProviderReplaceResponseAccessOneloginType string const ( - AccessIdentityProviderGetResponseAccessOneloginTypeOnetimepin AccessIdentityProviderGetResponseAccessOneloginType = "onetimepin" - AccessIdentityProviderGetResponseAccessOneloginTypeAzureAd AccessIdentityProviderGetResponseAccessOneloginType = "azureAD" - AccessIdentityProviderGetResponseAccessOneloginTypeSaml AccessIdentityProviderGetResponseAccessOneloginType = "saml" - AccessIdentityProviderGetResponseAccessOneloginTypeCentrify AccessIdentityProviderGetResponseAccessOneloginType = "centrify" - AccessIdentityProviderGetResponseAccessOneloginTypeFacebook AccessIdentityProviderGetResponseAccessOneloginType = "facebook" - AccessIdentityProviderGetResponseAccessOneloginTypeGitHub AccessIdentityProviderGetResponseAccessOneloginType = "github" - AccessIdentityProviderGetResponseAccessOneloginTypeGoogleApps AccessIdentityProviderGetResponseAccessOneloginType = "google-apps" - AccessIdentityProviderGetResponseAccessOneloginTypeGoogle AccessIdentityProviderGetResponseAccessOneloginType = "google" - AccessIdentityProviderGetResponseAccessOneloginTypeLinkedin AccessIdentityProviderGetResponseAccessOneloginType = "linkedin" - AccessIdentityProviderGetResponseAccessOneloginTypeOidc AccessIdentityProviderGetResponseAccessOneloginType = "oidc" - AccessIdentityProviderGetResponseAccessOneloginTypeOkta AccessIdentityProviderGetResponseAccessOneloginType = "okta" - AccessIdentityProviderGetResponseAccessOneloginTypeOnelogin AccessIdentityProviderGetResponseAccessOneloginType = "onelogin" - AccessIdentityProviderGetResponseAccessOneloginTypePingone AccessIdentityProviderGetResponseAccessOneloginType = "pingone" - AccessIdentityProviderGetResponseAccessOneloginTypeYandex AccessIdentityProviderGetResponseAccessOneloginType = "yandex" + AccessIdentityProviderReplaceResponseAccessOneloginTypeOnetimepin AccessIdentityProviderReplaceResponseAccessOneloginType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessOneloginTypeAzureAd AccessIdentityProviderReplaceResponseAccessOneloginType = "azureAD" + AccessIdentityProviderReplaceResponseAccessOneloginTypeSaml AccessIdentityProviderReplaceResponseAccessOneloginType = "saml" + AccessIdentityProviderReplaceResponseAccessOneloginTypeCentrify AccessIdentityProviderReplaceResponseAccessOneloginType = "centrify" + AccessIdentityProviderReplaceResponseAccessOneloginTypeFacebook AccessIdentityProviderReplaceResponseAccessOneloginType = "facebook" + AccessIdentityProviderReplaceResponseAccessOneloginTypeGitHub AccessIdentityProviderReplaceResponseAccessOneloginType = "github" + AccessIdentityProviderReplaceResponseAccessOneloginTypeGoogleApps AccessIdentityProviderReplaceResponseAccessOneloginType = "google-apps" + AccessIdentityProviderReplaceResponseAccessOneloginTypeGoogle AccessIdentityProviderReplaceResponseAccessOneloginType = "google" + AccessIdentityProviderReplaceResponseAccessOneloginTypeLinkedin AccessIdentityProviderReplaceResponseAccessOneloginType = "linkedin" + AccessIdentityProviderReplaceResponseAccessOneloginTypeOidc AccessIdentityProviderReplaceResponseAccessOneloginType = "oidc" + AccessIdentityProviderReplaceResponseAccessOneloginTypeOkta AccessIdentityProviderReplaceResponseAccessOneloginType = "okta" + AccessIdentityProviderReplaceResponseAccessOneloginTypeOnelogin AccessIdentityProviderReplaceResponseAccessOneloginType = "onelogin" + AccessIdentityProviderReplaceResponseAccessOneloginTypePingone AccessIdentityProviderReplaceResponseAccessOneloginType = "pingone" + AccessIdentityProviderReplaceResponseAccessOneloginTypeYandex AccessIdentityProviderReplaceResponseAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessOneloginScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -6989,14 +6924,14 @@ type AccessIdentityProviderGetResponseAccessOneloginScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessOneloginScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessOneloginScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOneloginScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessOneloginScimConfig] -type accessIdentityProviderGetResponseAccessOneloginScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessOneloginScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessOneloginScimConfig] +type accessIdentityProviderReplaceResponseAccessOneloginScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -7006,32 +6941,32 @@ type accessIdentityProviderGetResponseAccessOneloginScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOneloginScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessPingone struct { +type AccessIdentityProviderReplaceResponseAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessPingoneConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessPingoneConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessPingoneType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessPingoneType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessPingoneScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessPingoneJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessPingoneScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessPingoneJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessPingoneJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessPingone] -type accessIdentityProviderGetResponseAccessPingoneJSON struct { +// accessIdentityProviderReplaceResponseAccessPingoneJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessPingone] +type accessIdentityProviderReplaceResponseAccessPingoneJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -7041,17 +6976,17 @@ type accessIdentityProviderGetResponseAccessPingoneJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessPingone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessPingone) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessPingone) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessPingoneConfig struct { +type AccessIdentityProviderReplaceResponseAccessPingoneConfig struct { // Custom claims Claims []string `json:"claims"` // Your OAuth Client ID @@ -7061,13 +6996,14 @@ type AccessIdentityProviderGetResponseAccessPingoneConfig struct { // The claim name for email in the id_token response. EmailClaimName string `json:"email_claim_name"` // Your PingOne environment identifier - PingEnvID string `json:"ping_env_id"` - JSON accessIdentityProviderGetResponseAccessPingoneConfigJSON `json:"-"` + PingEnvID string `json:"ping_env_id"` + JSON accessIdentityProviderReplaceResponseAccessPingoneConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessPingoneConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessPingoneConfig] -type accessIdentityProviderGetResponseAccessPingoneConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessPingoneConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessPingoneConfig] +type accessIdentityProviderReplaceResponseAccessPingoneConfigJSON struct { Claims apijson.Field ClientID apijson.Field ClientSecret apijson.Field @@ -7077,35 +7013,35 @@ type accessIdentityProviderGetResponseAccessPingoneConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessPingoneConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessPingoneType string +type AccessIdentityProviderReplaceResponseAccessPingoneType string const ( - AccessIdentityProviderGetResponseAccessPingoneTypeOnetimepin AccessIdentityProviderGetResponseAccessPingoneType = "onetimepin" - AccessIdentityProviderGetResponseAccessPingoneTypeAzureAd AccessIdentityProviderGetResponseAccessPingoneType = "azureAD" - AccessIdentityProviderGetResponseAccessPingoneTypeSaml AccessIdentityProviderGetResponseAccessPingoneType = "saml" - AccessIdentityProviderGetResponseAccessPingoneTypeCentrify AccessIdentityProviderGetResponseAccessPingoneType = "centrify" - AccessIdentityProviderGetResponseAccessPingoneTypeFacebook AccessIdentityProviderGetResponseAccessPingoneType = "facebook" - AccessIdentityProviderGetResponseAccessPingoneTypeGitHub AccessIdentityProviderGetResponseAccessPingoneType = "github" - AccessIdentityProviderGetResponseAccessPingoneTypeGoogleApps AccessIdentityProviderGetResponseAccessPingoneType = "google-apps" - AccessIdentityProviderGetResponseAccessPingoneTypeGoogle AccessIdentityProviderGetResponseAccessPingoneType = "google" - AccessIdentityProviderGetResponseAccessPingoneTypeLinkedin AccessIdentityProviderGetResponseAccessPingoneType = "linkedin" - AccessIdentityProviderGetResponseAccessPingoneTypeOidc AccessIdentityProviderGetResponseAccessPingoneType = "oidc" - AccessIdentityProviderGetResponseAccessPingoneTypeOkta AccessIdentityProviderGetResponseAccessPingoneType = "okta" - AccessIdentityProviderGetResponseAccessPingoneTypeOnelogin AccessIdentityProviderGetResponseAccessPingoneType = "onelogin" - AccessIdentityProviderGetResponseAccessPingoneTypePingone AccessIdentityProviderGetResponseAccessPingoneType = "pingone" - AccessIdentityProviderGetResponseAccessPingoneTypeYandex AccessIdentityProviderGetResponseAccessPingoneType = "yandex" + AccessIdentityProviderReplaceResponseAccessPingoneTypeOnetimepin AccessIdentityProviderReplaceResponseAccessPingoneType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessPingoneTypeAzureAd AccessIdentityProviderReplaceResponseAccessPingoneType = "azureAD" + AccessIdentityProviderReplaceResponseAccessPingoneTypeSaml AccessIdentityProviderReplaceResponseAccessPingoneType = "saml" + AccessIdentityProviderReplaceResponseAccessPingoneTypeCentrify AccessIdentityProviderReplaceResponseAccessPingoneType = "centrify" + AccessIdentityProviderReplaceResponseAccessPingoneTypeFacebook AccessIdentityProviderReplaceResponseAccessPingoneType = "facebook" + AccessIdentityProviderReplaceResponseAccessPingoneTypeGitHub AccessIdentityProviderReplaceResponseAccessPingoneType = "github" + AccessIdentityProviderReplaceResponseAccessPingoneTypeGoogleApps AccessIdentityProviderReplaceResponseAccessPingoneType = "google-apps" + AccessIdentityProviderReplaceResponseAccessPingoneTypeGoogle AccessIdentityProviderReplaceResponseAccessPingoneType = "google" + AccessIdentityProviderReplaceResponseAccessPingoneTypeLinkedin AccessIdentityProviderReplaceResponseAccessPingoneType = "linkedin" + AccessIdentityProviderReplaceResponseAccessPingoneTypeOidc AccessIdentityProviderReplaceResponseAccessPingoneType = "oidc" + AccessIdentityProviderReplaceResponseAccessPingoneTypeOkta AccessIdentityProviderReplaceResponseAccessPingoneType = "okta" + AccessIdentityProviderReplaceResponseAccessPingoneTypeOnelogin AccessIdentityProviderReplaceResponseAccessPingoneType = "onelogin" + AccessIdentityProviderReplaceResponseAccessPingoneTypePingone AccessIdentityProviderReplaceResponseAccessPingoneType = "pingone" + AccessIdentityProviderReplaceResponseAccessPingoneTypeYandex AccessIdentityProviderReplaceResponseAccessPingoneType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessPingoneScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessPingoneScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7122,14 +7058,14 @@ type AccessIdentityProviderGetResponseAccessPingoneScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessPingoneScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessPingoneScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessPingoneScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessPingoneScimConfig] -type accessIdentityProviderGetResponseAccessPingoneScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessPingoneScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessPingoneScimConfig] +type accessIdentityProviderReplaceResponseAccessPingoneScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -7139,32 +7075,32 @@ type accessIdentityProviderGetResponseAccessPingoneScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessPingoneScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessSaml struct { +type AccessIdentityProviderReplaceResponseAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessSamlConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessSamlConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessSamlType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessSamlType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessSamlScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessSamlJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessSamlScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessSamlJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessSamlJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessSaml] -type accessIdentityProviderGetResponseAccessSamlJSON struct { +// accessIdentityProviderReplaceResponseAccessSamlJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessSaml] +type accessIdentityProviderReplaceResponseAccessSamlJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -7174,16 +7110,17 @@ type accessIdentityProviderGetResponseAccessSamlJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessSaml) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessSaml) implementsAccessIdentityProviderGetResponse() {} +func (r AccessIdentityProviderReplaceResponseAccessSaml) implementsAccessIdentityProviderReplaceResponse() { +} // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessSamlConfig struct { +type AccessIdentityProviderReplaceResponseAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes []string `json:"attributes"` @@ -7191,7 +7128,7 @@ type AccessIdentityProviderGetResponseAccessSamlConfig struct { EmailAttributeName string `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes []AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` + HeaderAttributes []AccessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -7200,13 +7137,13 @@ type AccessIdentityProviderGetResponseAccessSamlConfig struct { // signature, use the public key from the Access certs endpoints. SignRequest bool `json:"sign_request"` // URL to send the SAML authentication requests to - SSOTargetURL string `json:"sso_target_url"` - JSON accessIdentityProviderGetResponseAccessSamlConfigJSON `json:"-"` + SSOTargetURL string `json:"sso_target_url"` + JSON accessIdentityProviderReplaceResponseAccessSamlConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessSamlConfigJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessSamlConfig] -type accessIdentityProviderGetResponseAccessSamlConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessSamlConfigJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessSamlConfig] +type accessIdentityProviderReplaceResponseAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field @@ -7218,57 +7155,57 @@ type accessIdentityProviderGetResponseAccessSamlConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessSamlConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName string `json:"attribute_name"` // header that will be added on the request to the origin - HeaderName string `json:"header_name"` - JSON accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` + HeaderName string `json:"header_name"` + JSON accessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttributeJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON contains -// the JSON metadata for the struct -// [AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute] -type accessIdentityProviderGetResponseAccessSamlConfigHeaderAttributeJSON struct { +// accessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttributeJSON +// contains the JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttribute] +type accessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttributeJSON struct { AttributeName apijson.Field HeaderName apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessSamlConfigHeaderAttribute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessSamlType string +type AccessIdentityProviderReplaceResponseAccessSamlType string const ( - AccessIdentityProviderGetResponseAccessSamlTypeOnetimepin AccessIdentityProviderGetResponseAccessSamlType = "onetimepin" - AccessIdentityProviderGetResponseAccessSamlTypeAzureAd AccessIdentityProviderGetResponseAccessSamlType = "azureAD" - AccessIdentityProviderGetResponseAccessSamlTypeSaml AccessIdentityProviderGetResponseAccessSamlType = "saml" - AccessIdentityProviderGetResponseAccessSamlTypeCentrify AccessIdentityProviderGetResponseAccessSamlType = "centrify" - AccessIdentityProviderGetResponseAccessSamlTypeFacebook AccessIdentityProviderGetResponseAccessSamlType = "facebook" - AccessIdentityProviderGetResponseAccessSamlTypeGitHub AccessIdentityProviderGetResponseAccessSamlType = "github" - AccessIdentityProviderGetResponseAccessSamlTypeGoogleApps AccessIdentityProviderGetResponseAccessSamlType = "google-apps" - AccessIdentityProviderGetResponseAccessSamlTypeGoogle AccessIdentityProviderGetResponseAccessSamlType = "google" - AccessIdentityProviderGetResponseAccessSamlTypeLinkedin AccessIdentityProviderGetResponseAccessSamlType = "linkedin" - AccessIdentityProviderGetResponseAccessSamlTypeOidc AccessIdentityProviderGetResponseAccessSamlType = "oidc" - AccessIdentityProviderGetResponseAccessSamlTypeOkta AccessIdentityProviderGetResponseAccessSamlType = "okta" - AccessIdentityProviderGetResponseAccessSamlTypeOnelogin AccessIdentityProviderGetResponseAccessSamlType = "onelogin" - AccessIdentityProviderGetResponseAccessSamlTypePingone AccessIdentityProviderGetResponseAccessSamlType = "pingone" - AccessIdentityProviderGetResponseAccessSamlTypeYandex AccessIdentityProviderGetResponseAccessSamlType = "yandex" + AccessIdentityProviderReplaceResponseAccessSamlTypeOnetimepin AccessIdentityProviderReplaceResponseAccessSamlType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessSamlTypeAzureAd AccessIdentityProviderReplaceResponseAccessSamlType = "azureAD" + AccessIdentityProviderReplaceResponseAccessSamlTypeSaml AccessIdentityProviderReplaceResponseAccessSamlType = "saml" + AccessIdentityProviderReplaceResponseAccessSamlTypeCentrify AccessIdentityProviderReplaceResponseAccessSamlType = "centrify" + AccessIdentityProviderReplaceResponseAccessSamlTypeFacebook AccessIdentityProviderReplaceResponseAccessSamlType = "facebook" + AccessIdentityProviderReplaceResponseAccessSamlTypeGitHub AccessIdentityProviderReplaceResponseAccessSamlType = "github" + AccessIdentityProviderReplaceResponseAccessSamlTypeGoogleApps AccessIdentityProviderReplaceResponseAccessSamlType = "google-apps" + AccessIdentityProviderReplaceResponseAccessSamlTypeGoogle AccessIdentityProviderReplaceResponseAccessSamlType = "google" + AccessIdentityProviderReplaceResponseAccessSamlTypeLinkedin AccessIdentityProviderReplaceResponseAccessSamlType = "linkedin" + AccessIdentityProviderReplaceResponseAccessSamlTypeOidc AccessIdentityProviderReplaceResponseAccessSamlType = "oidc" + AccessIdentityProviderReplaceResponseAccessSamlTypeOkta AccessIdentityProviderReplaceResponseAccessSamlType = "okta" + AccessIdentityProviderReplaceResponseAccessSamlTypeOnelogin AccessIdentityProviderReplaceResponseAccessSamlType = "onelogin" + AccessIdentityProviderReplaceResponseAccessSamlTypePingone AccessIdentityProviderReplaceResponseAccessSamlType = "pingone" + AccessIdentityProviderReplaceResponseAccessSamlTypeYandex AccessIdentityProviderReplaceResponseAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessSamlScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7285,13 +7222,14 @@ type AccessIdentityProviderGetResponseAccessSamlScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessSamlScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessSamlScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessSamlScimConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessSamlScimConfig] -type accessIdentityProviderGetResponseAccessSamlScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessSamlScimConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessSamlScimConfig] +type accessIdentityProviderReplaceResponseAccessSamlScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -7301,32 +7239,32 @@ type accessIdentityProviderGetResponseAccessSamlScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessSamlScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessYandex struct { +type AccessIdentityProviderReplaceResponseAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config AccessIdentityProviderGetResponseAccessYandexConfig `json:"config,required"` + Config AccessIdentityProviderReplaceResponseAccessYandexConfig `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name string `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessYandexType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessYandexType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessYandexScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessYandexJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessYandexScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessYandexJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessYandexJSON contains the JSON metadata for -// the struct [AccessIdentityProviderGetResponseAccessYandex] -type accessIdentityProviderGetResponseAccessYandexJSON struct { +// accessIdentityProviderReplaceResponseAccessYandexJSON contains the JSON metadata +// for the struct [AccessIdentityProviderReplaceResponseAccessYandex] +type accessIdentityProviderReplaceResponseAccessYandexJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -7336,62 +7274,63 @@ type accessIdentityProviderGetResponseAccessYandexJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessYandex) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessYandex) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessYandex) implementsAccessIdentityProviderReplaceResponse() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessYandexConfig struct { +type AccessIdentityProviderReplaceResponseAccessYandexConfig struct { // Your OAuth Client ID ClientID string `json:"client_id"` // Your OAuth Client Secret - ClientSecret string `json:"client_secret"` - JSON accessIdentityProviderGetResponseAccessYandexConfigJSON `json:"-"` + ClientSecret string `json:"client_secret"` + JSON accessIdentityProviderReplaceResponseAccessYandexConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessYandexConfigJSON contains the JSON -// metadata for the struct [AccessIdentityProviderGetResponseAccessYandexConfig] -type accessIdentityProviderGetResponseAccessYandexConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessYandexConfigJSON contains the JSON +// metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessYandexConfig] +type accessIdentityProviderReplaceResponseAccessYandexConfigJSON struct { ClientID apijson.Field ClientSecret apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessYandexConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessYandexType string +type AccessIdentityProviderReplaceResponseAccessYandexType string const ( - AccessIdentityProviderGetResponseAccessYandexTypeOnetimepin AccessIdentityProviderGetResponseAccessYandexType = "onetimepin" - AccessIdentityProviderGetResponseAccessYandexTypeAzureAd AccessIdentityProviderGetResponseAccessYandexType = "azureAD" - AccessIdentityProviderGetResponseAccessYandexTypeSaml AccessIdentityProviderGetResponseAccessYandexType = "saml" - AccessIdentityProviderGetResponseAccessYandexTypeCentrify AccessIdentityProviderGetResponseAccessYandexType = "centrify" - AccessIdentityProviderGetResponseAccessYandexTypeFacebook AccessIdentityProviderGetResponseAccessYandexType = "facebook" - AccessIdentityProviderGetResponseAccessYandexTypeGitHub AccessIdentityProviderGetResponseAccessYandexType = "github" - AccessIdentityProviderGetResponseAccessYandexTypeGoogleApps AccessIdentityProviderGetResponseAccessYandexType = "google-apps" - AccessIdentityProviderGetResponseAccessYandexTypeGoogle AccessIdentityProviderGetResponseAccessYandexType = "google" - AccessIdentityProviderGetResponseAccessYandexTypeLinkedin AccessIdentityProviderGetResponseAccessYandexType = "linkedin" - AccessIdentityProviderGetResponseAccessYandexTypeOidc AccessIdentityProviderGetResponseAccessYandexType = "oidc" - AccessIdentityProviderGetResponseAccessYandexTypeOkta AccessIdentityProviderGetResponseAccessYandexType = "okta" - AccessIdentityProviderGetResponseAccessYandexTypeOnelogin AccessIdentityProviderGetResponseAccessYandexType = "onelogin" - AccessIdentityProviderGetResponseAccessYandexTypePingone AccessIdentityProviderGetResponseAccessYandexType = "pingone" - AccessIdentityProviderGetResponseAccessYandexTypeYandex AccessIdentityProviderGetResponseAccessYandexType = "yandex" + AccessIdentityProviderReplaceResponseAccessYandexTypeOnetimepin AccessIdentityProviderReplaceResponseAccessYandexType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessYandexTypeAzureAd AccessIdentityProviderReplaceResponseAccessYandexType = "azureAD" + AccessIdentityProviderReplaceResponseAccessYandexTypeSaml AccessIdentityProviderReplaceResponseAccessYandexType = "saml" + AccessIdentityProviderReplaceResponseAccessYandexTypeCentrify AccessIdentityProviderReplaceResponseAccessYandexType = "centrify" + AccessIdentityProviderReplaceResponseAccessYandexTypeFacebook AccessIdentityProviderReplaceResponseAccessYandexType = "facebook" + AccessIdentityProviderReplaceResponseAccessYandexTypeGitHub AccessIdentityProviderReplaceResponseAccessYandexType = "github" + AccessIdentityProviderReplaceResponseAccessYandexTypeGoogleApps AccessIdentityProviderReplaceResponseAccessYandexType = "google-apps" + AccessIdentityProviderReplaceResponseAccessYandexTypeGoogle AccessIdentityProviderReplaceResponseAccessYandexType = "google" + AccessIdentityProviderReplaceResponseAccessYandexTypeLinkedin AccessIdentityProviderReplaceResponseAccessYandexType = "linkedin" + AccessIdentityProviderReplaceResponseAccessYandexTypeOidc AccessIdentityProviderReplaceResponseAccessYandexType = "oidc" + AccessIdentityProviderReplaceResponseAccessYandexTypeOkta AccessIdentityProviderReplaceResponseAccessYandexType = "okta" + AccessIdentityProviderReplaceResponseAccessYandexTypeOnelogin AccessIdentityProviderReplaceResponseAccessYandexType = "onelogin" + AccessIdentityProviderReplaceResponseAccessYandexTypePingone AccessIdentityProviderReplaceResponseAccessYandexType = "pingone" + AccessIdentityProviderReplaceResponseAccessYandexTypeYandex AccessIdentityProviderReplaceResponseAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessYandexScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7408,14 +7347,14 @@ type AccessIdentityProviderGetResponseAccessYandexScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessYandexScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessYandexScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessYandexScimConfigJSON contains the JSON -// metadata for the struct -// [AccessIdentityProviderGetResponseAccessYandexScimConfig] -type accessIdentityProviderGetResponseAccessYandexScimConfigJSON struct { +// accessIdentityProviderReplaceResponseAccessYandexScimConfigJSON contains the +// JSON metadata for the struct +// [AccessIdentityProviderReplaceResponseAccessYandexScimConfig] +type accessIdentityProviderReplaceResponseAccessYandexScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -7425,11 +7364,11 @@ type accessIdentityProviderGetResponseAccessYandexScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessYandexScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseAccessOnetimepin struct { +type AccessIdentityProviderReplaceResponseAccessOnetimepin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). @@ -7439,18 +7378,18 @@ type AccessIdentityProviderGetResponseAccessOnetimepin struct { // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type AccessIdentityProviderGetResponseAccessOnetimepinType `json:"type,required"` + Type AccessIdentityProviderReplaceResponseAccessOnetimepinType `json:"type,required"` // UUID ID string `json:"id"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig AccessIdentityProviderGetResponseAccessOnetimepinScimConfig `json:"scim_config"` - JSON accessIdentityProviderGetResponseAccessOnetimepinJSON `json:"-"` + ScimConfig AccessIdentityProviderReplaceResponseAccessOnetimepinScimConfig `json:"scim_config"` + JSON accessIdentityProviderReplaceResponseAccessOnetimepinJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOnetimepinJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseAccessOnetimepin] -type accessIdentityProviderGetResponseAccessOnetimepinJSON struct { +// accessIdentityProviderReplaceResponseAccessOnetimepinJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseAccessOnetimepin] +type accessIdentityProviderReplaceResponseAccessOnetimepinJSON struct { Config apijson.Field Name apijson.Field Type apijson.Field @@ -7460,38 +7399,38 @@ type accessIdentityProviderGetResponseAccessOnetimepinJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOnetimepin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r AccessIdentityProviderGetResponseAccessOnetimepin) implementsAccessIdentityProviderGetResponse() { +func (r AccessIdentityProviderReplaceResponseAccessOnetimepin) implementsAccessIdentityProviderReplaceResponse() { } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderGetResponseAccessOnetimepinType string +type AccessIdentityProviderReplaceResponseAccessOnetimepinType string const ( - AccessIdentityProviderGetResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderGetResponseAccessOnetimepinType = "onetimepin" - AccessIdentityProviderGetResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderGetResponseAccessOnetimepinType = "azureAD" - AccessIdentityProviderGetResponseAccessOnetimepinTypeSaml AccessIdentityProviderGetResponseAccessOnetimepinType = "saml" - AccessIdentityProviderGetResponseAccessOnetimepinTypeCentrify AccessIdentityProviderGetResponseAccessOnetimepinType = "centrify" - AccessIdentityProviderGetResponseAccessOnetimepinTypeFacebook AccessIdentityProviderGetResponseAccessOnetimepinType = "facebook" - AccessIdentityProviderGetResponseAccessOnetimepinTypeGitHub AccessIdentityProviderGetResponseAccessOnetimepinType = "github" - AccessIdentityProviderGetResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderGetResponseAccessOnetimepinType = "google-apps" - AccessIdentityProviderGetResponseAccessOnetimepinTypeGoogle AccessIdentityProviderGetResponseAccessOnetimepinType = "google" - AccessIdentityProviderGetResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderGetResponseAccessOnetimepinType = "linkedin" - AccessIdentityProviderGetResponseAccessOnetimepinTypeOidc AccessIdentityProviderGetResponseAccessOnetimepinType = "oidc" - AccessIdentityProviderGetResponseAccessOnetimepinTypeOkta AccessIdentityProviderGetResponseAccessOnetimepinType = "okta" - AccessIdentityProviderGetResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderGetResponseAccessOnetimepinType = "onelogin" - AccessIdentityProviderGetResponseAccessOnetimepinTypePingone AccessIdentityProviderGetResponseAccessOnetimepinType = "pingone" - AccessIdentityProviderGetResponseAccessOnetimepinTypeYandex AccessIdentityProviderGetResponseAccessOnetimepinType = "yandex" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeOnetimepin AccessIdentityProviderReplaceResponseAccessOnetimepinType = "onetimepin" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeAzureAd AccessIdentityProviderReplaceResponseAccessOnetimepinType = "azureAD" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeSaml AccessIdentityProviderReplaceResponseAccessOnetimepinType = "saml" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeCentrify AccessIdentityProviderReplaceResponseAccessOnetimepinType = "centrify" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeFacebook AccessIdentityProviderReplaceResponseAccessOnetimepinType = "facebook" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeGitHub AccessIdentityProviderReplaceResponseAccessOnetimepinType = "github" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeGoogleApps AccessIdentityProviderReplaceResponseAccessOnetimepinType = "google-apps" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeGoogle AccessIdentityProviderReplaceResponseAccessOnetimepinType = "google" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeLinkedin AccessIdentityProviderReplaceResponseAccessOnetimepinType = "linkedin" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeOidc AccessIdentityProviderReplaceResponseAccessOnetimepinType = "oidc" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeOkta AccessIdentityProviderReplaceResponseAccessOnetimepinType = "okta" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeOnelogin AccessIdentityProviderReplaceResponseAccessOnetimepinType = "onelogin" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypePingone AccessIdentityProviderReplaceResponseAccessOnetimepinType = "pingone" + AccessIdentityProviderReplaceResponseAccessOnetimepinTypeYandex AccessIdentityProviderReplaceResponseAccessOnetimepinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderGetResponseAccessOnetimepinScimConfig struct { +type AccessIdentityProviderReplaceResponseAccessOnetimepinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled bool `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7508,14 +7447,14 @@ type AccessIdentityProviderGetResponseAccessOnetimepinScimConfig struct { Secret string `json:"secret"` // A flag to enable revoking a user's session in Access and Gateway when they have // been deprovisioned in the Identity Provider. - UserDeprovision bool `json:"user_deprovision"` - JSON accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON `json:"-"` + UserDeprovision bool `json:"user_deprovision"` + JSON accessIdentityProviderReplaceResponseAccessOnetimepinScimConfigJSON `json:"-"` } -// accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON contains the +// accessIdentityProviderReplaceResponseAccessOnetimepinScimConfigJSON contains the // JSON metadata for the struct -// [AccessIdentityProviderGetResponseAccessOnetimepinScimConfig] -type accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON struct { +// [AccessIdentityProviderReplaceResponseAccessOnetimepinScimConfig] +type accessIdentityProviderReplaceResponseAccessOnetimepinScimConfigJSON struct { Enabled apijson.Field GroupMemberDeprovision apijson.Field SeatDeprovision apijson.Field @@ -7525,57 +7464,57 @@ type accessIdentityProviderGetResponseAccessOnetimepinScimConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseAccessOnetimepinScimConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // This interface is a union satisfied by one of the following: -// [AccessIdentityProviderUpdateParamsAccessAzureAd], -// [AccessIdentityProviderUpdateParamsAccessCentrify], -// [AccessIdentityProviderUpdateParamsAccessFacebook], -// [AccessIdentityProviderUpdateParamsAccessGitHub], -// [AccessIdentityProviderUpdateParamsAccessGoogle], -// [AccessIdentityProviderUpdateParamsAccessGoogleApps], -// [AccessIdentityProviderUpdateParamsAccessLinkedin], -// [AccessIdentityProviderUpdateParamsAccessOidc], -// [AccessIdentityProviderUpdateParamsAccessOkta], -// [AccessIdentityProviderUpdateParamsAccessOnelogin], -// [AccessIdentityProviderUpdateParamsAccessPingone], -// [AccessIdentityProviderUpdateParamsAccessSaml], -// [AccessIdentityProviderUpdateParamsAccessYandex], -// [AccessIdentityProviderUpdateParamsAccessOnetimepin]. -type AccessIdentityProviderUpdateParams interface { - ImplementsAccessIdentityProviderUpdateParams() -} - -type AccessIdentityProviderUpdateParamsAccessAzureAd struct { +// [AccessIdentityProviderNewParamsAccessAzureAd], +// [AccessIdentityProviderNewParamsAccessCentrify], +// [AccessIdentityProviderNewParamsAccessFacebook], +// [AccessIdentityProviderNewParamsAccessGitHub], +// [AccessIdentityProviderNewParamsAccessGoogle], +// [AccessIdentityProviderNewParamsAccessGoogleApps], +// [AccessIdentityProviderNewParamsAccessLinkedin], +// [AccessIdentityProviderNewParamsAccessOidc], +// [AccessIdentityProviderNewParamsAccessOkta], +// [AccessIdentityProviderNewParamsAccessOnelogin], +// [AccessIdentityProviderNewParamsAccessPingone], +// [AccessIdentityProviderNewParamsAccessSaml], +// [AccessIdentityProviderNewParamsAccessYandex], +// [AccessIdentityProviderNewParamsAccessOnetimepin]. +type AccessIdentityProviderNewParams interface { + ImplementsAccessIdentityProviderNewParams() +} + +type AccessIdentityProviderNewParamsAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessAzureAdConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessAzureAdConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessAzureAdType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessAzureAdType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessAzureAdScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessAzureAdScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessAzureAd) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessAzureAd) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessAzureAdConfig struct { +type AccessIdentityProviderNewParamsAccessAzureAdConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -7592,35 +7531,35 @@ type AccessIdentityProviderUpdateParamsAccessAzureAdConfig struct { SupportGroups param.Field[bool] `json:"support_groups"` } -func (r AccessIdentityProviderUpdateParamsAccessAzureAdConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessAzureAdConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessAzureAdType string +type AccessIdentityProviderNewParamsAccessAzureAdType string const ( - AccessIdentityProviderUpdateParamsAccessAzureAdTypeOnetimepin AccessIdentityProviderUpdateParamsAccessAzureAdType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeAzureAd AccessIdentityProviderUpdateParamsAccessAzureAdType = "azureAD" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeSaml AccessIdentityProviderUpdateParamsAccessAzureAdType = "saml" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeCentrify AccessIdentityProviderUpdateParamsAccessAzureAdType = "centrify" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeFacebook AccessIdentityProviderUpdateParamsAccessAzureAdType = "facebook" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeGitHub AccessIdentityProviderUpdateParamsAccessAzureAdType = "github" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeGoogleApps AccessIdentityProviderUpdateParamsAccessAzureAdType = "google-apps" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeGoogle AccessIdentityProviderUpdateParamsAccessAzureAdType = "google" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeLinkedin AccessIdentityProviderUpdateParamsAccessAzureAdType = "linkedin" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeOidc AccessIdentityProviderUpdateParamsAccessAzureAdType = "oidc" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeOkta AccessIdentityProviderUpdateParamsAccessAzureAdType = "okta" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeOnelogin AccessIdentityProviderUpdateParamsAccessAzureAdType = "onelogin" - AccessIdentityProviderUpdateParamsAccessAzureAdTypePingone AccessIdentityProviderUpdateParamsAccessAzureAdType = "pingone" - AccessIdentityProviderUpdateParamsAccessAzureAdTypeYandex AccessIdentityProviderUpdateParamsAccessAzureAdType = "yandex" + AccessIdentityProviderNewParamsAccessAzureAdTypeOnetimepin AccessIdentityProviderNewParamsAccessAzureAdType = "onetimepin" + AccessIdentityProviderNewParamsAccessAzureAdTypeAzureAd AccessIdentityProviderNewParamsAccessAzureAdType = "azureAD" + AccessIdentityProviderNewParamsAccessAzureAdTypeSaml AccessIdentityProviderNewParamsAccessAzureAdType = "saml" + AccessIdentityProviderNewParamsAccessAzureAdTypeCentrify AccessIdentityProviderNewParamsAccessAzureAdType = "centrify" + AccessIdentityProviderNewParamsAccessAzureAdTypeFacebook AccessIdentityProviderNewParamsAccessAzureAdType = "facebook" + AccessIdentityProviderNewParamsAccessAzureAdTypeGitHub AccessIdentityProviderNewParamsAccessAzureAdType = "github" + AccessIdentityProviderNewParamsAccessAzureAdTypeGoogleApps AccessIdentityProviderNewParamsAccessAzureAdType = "google-apps" + AccessIdentityProviderNewParamsAccessAzureAdTypeGoogle AccessIdentityProviderNewParamsAccessAzureAdType = "google" + AccessIdentityProviderNewParamsAccessAzureAdTypeLinkedin AccessIdentityProviderNewParamsAccessAzureAdType = "linkedin" + AccessIdentityProviderNewParamsAccessAzureAdTypeOidc AccessIdentityProviderNewParamsAccessAzureAdType = "oidc" + AccessIdentityProviderNewParamsAccessAzureAdTypeOkta AccessIdentityProviderNewParamsAccessAzureAdType = "okta" + AccessIdentityProviderNewParamsAccessAzureAdTypeOnelogin AccessIdentityProviderNewParamsAccessAzureAdType = "onelogin" + AccessIdentityProviderNewParamsAccessAzureAdTypePingone AccessIdentityProviderNewParamsAccessAzureAdType = "pingone" + AccessIdentityProviderNewParamsAccessAzureAdTypeYandex AccessIdentityProviderNewParamsAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessAzureAdScimConfig struct { +type AccessIdentityProviderNewParamsAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7640,38 +7579,38 @@ type AccessIdentityProviderUpdateParamsAccessAzureAdScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessAzureAdScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessAzureAdScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessCentrify struct { +type AccessIdentityProviderNewParamsAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessCentrifyConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessCentrifyConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessCentrifyType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessCentrifyType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessCentrifyScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessCentrifyScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessCentrify) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessCentrify) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessCentrify) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessCentrify) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessCentrifyConfig struct { +type AccessIdentityProviderNewParamsAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount param.Field[string] `json:"centrify_account"` // Your centrify app id @@ -7686,35 +7625,35 @@ type AccessIdentityProviderUpdateParamsAccessCentrifyConfig struct { EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderUpdateParamsAccessCentrifyConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessCentrifyConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessCentrifyType string +type AccessIdentityProviderNewParamsAccessCentrifyType string const ( - AccessIdentityProviderUpdateParamsAccessCentrifyTypeOnetimepin AccessIdentityProviderUpdateParamsAccessCentrifyType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeAzureAd AccessIdentityProviderUpdateParamsAccessCentrifyType = "azureAD" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeSaml AccessIdentityProviderUpdateParamsAccessCentrifyType = "saml" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeCentrify AccessIdentityProviderUpdateParamsAccessCentrifyType = "centrify" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeFacebook AccessIdentityProviderUpdateParamsAccessCentrifyType = "facebook" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeGitHub AccessIdentityProviderUpdateParamsAccessCentrifyType = "github" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeGoogleApps AccessIdentityProviderUpdateParamsAccessCentrifyType = "google-apps" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeGoogle AccessIdentityProviderUpdateParamsAccessCentrifyType = "google" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeLinkedin AccessIdentityProviderUpdateParamsAccessCentrifyType = "linkedin" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeOidc AccessIdentityProviderUpdateParamsAccessCentrifyType = "oidc" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeOkta AccessIdentityProviderUpdateParamsAccessCentrifyType = "okta" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeOnelogin AccessIdentityProviderUpdateParamsAccessCentrifyType = "onelogin" - AccessIdentityProviderUpdateParamsAccessCentrifyTypePingone AccessIdentityProviderUpdateParamsAccessCentrifyType = "pingone" - AccessIdentityProviderUpdateParamsAccessCentrifyTypeYandex AccessIdentityProviderUpdateParamsAccessCentrifyType = "yandex" + AccessIdentityProviderNewParamsAccessCentrifyTypeOnetimepin AccessIdentityProviderNewParamsAccessCentrifyType = "onetimepin" + AccessIdentityProviderNewParamsAccessCentrifyTypeAzureAd AccessIdentityProviderNewParamsAccessCentrifyType = "azureAD" + AccessIdentityProviderNewParamsAccessCentrifyTypeSaml AccessIdentityProviderNewParamsAccessCentrifyType = "saml" + AccessIdentityProviderNewParamsAccessCentrifyTypeCentrify AccessIdentityProviderNewParamsAccessCentrifyType = "centrify" + AccessIdentityProviderNewParamsAccessCentrifyTypeFacebook AccessIdentityProviderNewParamsAccessCentrifyType = "facebook" + AccessIdentityProviderNewParamsAccessCentrifyTypeGitHub AccessIdentityProviderNewParamsAccessCentrifyType = "github" + AccessIdentityProviderNewParamsAccessCentrifyTypeGoogleApps AccessIdentityProviderNewParamsAccessCentrifyType = "google-apps" + AccessIdentityProviderNewParamsAccessCentrifyTypeGoogle AccessIdentityProviderNewParamsAccessCentrifyType = "google" + AccessIdentityProviderNewParamsAccessCentrifyTypeLinkedin AccessIdentityProviderNewParamsAccessCentrifyType = "linkedin" + AccessIdentityProviderNewParamsAccessCentrifyTypeOidc AccessIdentityProviderNewParamsAccessCentrifyType = "oidc" + AccessIdentityProviderNewParamsAccessCentrifyTypeOkta AccessIdentityProviderNewParamsAccessCentrifyType = "okta" + AccessIdentityProviderNewParamsAccessCentrifyTypeOnelogin AccessIdentityProviderNewParamsAccessCentrifyType = "onelogin" + AccessIdentityProviderNewParamsAccessCentrifyTypePingone AccessIdentityProviderNewParamsAccessCentrifyType = "pingone" + AccessIdentityProviderNewParamsAccessCentrifyTypeYandex AccessIdentityProviderNewParamsAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessCentrifyScimConfig struct { +type AccessIdentityProviderNewParamsAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7734,73 +7673,73 @@ type AccessIdentityProviderUpdateParamsAccessCentrifyScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessCentrifyScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessCentrifyScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessFacebook struct { +type AccessIdentityProviderNewParamsAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessFacebookConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessFacebookConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessFacebookType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessFacebookType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessFacebookScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessFacebookScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessFacebook) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessFacebook) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessFacebook) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessFacebook) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessFacebookConfig struct { +type AccessIdentityProviderNewParamsAccessFacebookConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderUpdateParamsAccessFacebookConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessFacebookConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessFacebookType string +type AccessIdentityProviderNewParamsAccessFacebookType string const ( - AccessIdentityProviderUpdateParamsAccessFacebookTypeOnetimepin AccessIdentityProviderUpdateParamsAccessFacebookType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessFacebookTypeAzureAd AccessIdentityProviderUpdateParamsAccessFacebookType = "azureAD" - AccessIdentityProviderUpdateParamsAccessFacebookTypeSaml AccessIdentityProviderUpdateParamsAccessFacebookType = "saml" - AccessIdentityProviderUpdateParamsAccessFacebookTypeCentrify AccessIdentityProviderUpdateParamsAccessFacebookType = "centrify" - AccessIdentityProviderUpdateParamsAccessFacebookTypeFacebook AccessIdentityProviderUpdateParamsAccessFacebookType = "facebook" - AccessIdentityProviderUpdateParamsAccessFacebookTypeGitHub AccessIdentityProviderUpdateParamsAccessFacebookType = "github" - AccessIdentityProviderUpdateParamsAccessFacebookTypeGoogleApps AccessIdentityProviderUpdateParamsAccessFacebookType = "google-apps" - AccessIdentityProviderUpdateParamsAccessFacebookTypeGoogle AccessIdentityProviderUpdateParamsAccessFacebookType = "google" - AccessIdentityProviderUpdateParamsAccessFacebookTypeLinkedin AccessIdentityProviderUpdateParamsAccessFacebookType = "linkedin" - AccessIdentityProviderUpdateParamsAccessFacebookTypeOidc AccessIdentityProviderUpdateParamsAccessFacebookType = "oidc" - AccessIdentityProviderUpdateParamsAccessFacebookTypeOkta AccessIdentityProviderUpdateParamsAccessFacebookType = "okta" - AccessIdentityProviderUpdateParamsAccessFacebookTypeOnelogin AccessIdentityProviderUpdateParamsAccessFacebookType = "onelogin" - AccessIdentityProviderUpdateParamsAccessFacebookTypePingone AccessIdentityProviderUpdateParamsAccessFacebookType = "pingone" - AccessIdentityProviderUpdateParamsAccessFacebookTypeYandex AccessIdentityProviderUpdateParamsAccessFacebookType = "yandex" + AccessIdentityProviderNewParamsAccessFacebookTypeOnetimepin AccessIdentityProviderNewParamsAccessFacebookType = "onetimepin" + AccessIdentityProviderNewParamsAccessFacebookTypeAzureAd AccessIdentityProviderNewParamsAccessFacebookType = "azureAD" + AccessIdentityProviderNewParamsAccessFacebookTypeSaml AccessIdentityProviderNewParamsAccessFacebookType = "saml" + AccessIdentityProviderNewParamsAccessFacebookTypeCentrify AccessIdentityProviderNewParamsAccessFacebookType = "centrify" + AccessIdentityProviderNewParamsAccessFacebookTypeFacebook AccessIdentityProviderNewParamsAccessFacebookType = "facebook" + AccessIdentityProviderNewParamsAccessFacebookTypeGitHub AccessIdentityProviderNewParamsAccessFacebookType = "github" + AccessIdentityProviderNewParamsAccessFacebookTypeGoogleApps AccessIdentityProviderNewParamsAccessFacebookType = "google-apps" + AccessIdentityProviderNewParamsAccessFacebookTypeGoogle AccessIdentityProviderNewParamsAccessFacebookType = "google" + AccessIdentityProviderNewParamsAccessFacebookTypeLinkedin AccessIdentityProviderNewParamsAccessFacebookType = "linkedin" + AccessIdentityProviderNewParamsAccessFacebookTypeOidc AccessIdentityProviderNewParamsAccessFacebookType = "oidc" + AccessIdentityProviderNewParamsAccessFacebookTypeOkta AccessIdentityProviderNewParamsAccessFacebookType = "okta" + AccessIdentityProviderNewParamsAccessFacebookTypeOnelogin AccessIdentityProviderNewParamsAccessFacebookType = "onelogin" + AccessIdentityProviderNewParamsAccessFacebookTypePingone AccessIdentityProviderNewParamsAccessFacebookType = "pingone" + AccessIdentityProviderNewParamsAccessFacebookTypeYandex AccessIdentityProviderNewParamsAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessFacebookScimConfig struct { +type AccessIdentityProviderNewParamsAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7820,73 +7759,73 @@ type AccessIdentityProviderUpdateParamsAccessFacebookScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessFacebookScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessFacebookScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessGitHub struct { +type AccessIdentityProviderNewParamsAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessGitHubConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessGitHubConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessGitHubType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessGitHubType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessGitHubScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessGitHubScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessGitHub) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGitHub) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessGitHub) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessGitHub) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGitHubConfig struct { +type AccessIdentityProviderNewParamsAccessGitHubConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderUpdateParamsAccessGitHubConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGitHubConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGitHubType string +type AccessIdentityProviderNewParamsAccessGitHubType string const ( - AccessIdentityProviderUpdateParamsAccessGitHubTypeOnetimepin AccessIdentityProviderUpdateParamsAccessGitHubType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessGitHubTypeAzureAd AccessIdentityProviderUpdateParamsAccessGitHubType = "azureAD" - AccessIdentityProviderUpdateParamsAccessGitHubTypeSaml AccessIdentityProviderUpdateParamsAccessGitHubType = "saml" - AccessIdentityProviderUpdateParamsAccessGitHubTypeCentrify AccessIdentityProviderUpdateParamsAccessGitHubType = "centrify" - AccessIdentityProviderUpdateParamsAccessGitHubTypeFacebook AccessIdentityProviderUpdateParamsAccessGitHubType = "facebook" - AccessIdentityProviderUpdateParamsAccessGitHubTypeGitHub AccessIdentityProviderUpdateParamsAccessGitHubType = "github" - AccessIdentityProviderUpdateParamsAccessGitHubTypeGoogleApps AccessIdentityProviderUpdateParamsAccessGitHubType = "google-apps" - AccessIdentityProviderUpdateParamsAccessGitHubTypeGoogle AccessIdentityProviderUpdateParamsAccessGitHubType = "google" - AccessIdentityProviderUpdateParamsAccessGitHubTypeLinkedin AccessIdentityProviderUpdateParamsAccessGitHubType = "linkedin" - AccessIdentityProviderUpdateParamsAccessGitHubTypeOidc AccessIdentityProviderUpdateParamsAccessGitHubType = "oidc" - AccessIdentityProviderUpdateParamsAccessGitHubTypeOkta AccessIdentityProviderUpdateParamsAccessGitHubType = "okta" - AccessIdentityProviderUpdateParamsAccessGitHubTypeOnelogin AccessIdentityProviderUpdateParamsAccessGitHubType = "onelogin" - AccessIdentityProviderUpdateParamsAccessGitHubTypePingone AccessIdentityProviderUpdateParamsAccessGitHubType = "pingone" - AccessIdentityProviderUpdateParamsAccessGitHubTypeYandex AccessIdentityProviderUpdateParamsAccessGitHubType = "yandex" + AccessIdentityProviderNewParamsAccessGitHubTypeOnetimepin AccessIdentityProviderNewParamsAccessGitHubType = "onetimepin" + AccessIdentityProviderNewParamsAccessGitHubTypeAzureAd AccessIdentityProviderNewParamsAccessGitHubType = "azureAD" + AccessIdentityProviderNewParamsAccessGitHubTypeSaml AccessIdentityProviderNewParamsAccessGitHubType = "saml" + AccessIdentityProviderNewParamsAccessGitHubTypeCentrify AccessIdentityProviderNewParamsAccessGitHubType = "centrify" + AccessIdentityProviderNewParamsAccessGitHubTypeFacebook AccessIdentityProviderNewParamsAccessGitHubType = "facebook" + AccessIdentityProviderNewParamsAccessGitHubTypeGitHub AccessIdentityProviderNewParamsAccessGitHubType = "github" + AccessIdentityProviderNewParamsAccessGitHubTypeGoogleApps AccessIdentityProviderNewParamsAccessGitHubType = "google-apps" + AccessIdentityProviderNewParamsAccessGitHubTypeGoogle AccessIdentityProviderNewParamsAccessGitHubType = "google" + AccessIdentityProviderNewParamsAccessGitHubTypeLinkedin AccessIdentityProviderNewParamsAccessGitHubType = "linkedin" + AccessIdentityProviderNewParamsAccessGitHubTypeOidc AccessIdentityProviderNewParamsAccessGitHubType = "oidc" + AccessIdentityProviderNewParamsAccessGitHubTypeOkta AccessIdentityProviderNewParamsAccessGitHubType = "okta" + AccessIdentityProviderNewParamsAccessGitHubTypeOnelogin AccessIdentityProviderNewParamsAccessGitHubType = "onelogin" + AccessIdentityProviderNewParamsAccessGitHubTypePingone AccessIdentityProviderNewParamsAccessGitHubType = "pingone" + AccessIdentityProviderNewParamsAccessGitHubTypeYandex AccessIdentityProviderNewParamsAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessGitHubScimConfig struct { +type AccessIdentityProviderNewParamsAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7906,38 +7845,38 @@ type AccessIdentityProviderUpdateParamsAccessGitHubScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessGitHubScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGitHubScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessGoogle struct { +type AccessIdentityProviderNewParamsAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessGoogleConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessGoogleConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessGoogleType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessGoogleType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessGoogleScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessGoogleScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogle) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogle) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessGoogle) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessGoogle) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGoogleConfig struct { +type AccessIdentityProviderNewParamsAccessGoogleConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -7948,35 +7887,35 @@ type AccessIdentityProviderUpdateParamsAccessGoogleConfig struct { EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogleConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogleConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGoogleType string +type AccessIdentityProviderNewParamsAccessGoogleType string const ( - AccessIdentityProviderUpdateParamsAccessGoogleTypeOnetimepin AccessIdentityProviderUpdateParamsAccessGoogleType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessGoogleTypeAzureAd AccessIdentityProviderUpdateParamsAccessGoogleType = "azureAD" - AccessIdentityProviderUpdateParamsAccessGoogleTypeSaml AccessIdentityProviderUpdateParamsAccessGoogleType = "saml" - AccessIdentityProviderUpdateParamsAccessGoogleTypeCentrify AccessIdentityProviderUpdateParamsAccessGoogleType = "centrify" - AccessIdentityProviderUpdateParamsAccessGoogleTypeFacebook AccessIdentityProviderUpdateParamsAccessGoogleType = "facebook" - AccessIdentityProviderUpdateParamsAccessGoogleTypeGitHub AccessIdentityProviderUpdateParamsAccessGoogleType = "github" - AccessIdentityProviderUpdateParamsAccessGoogleTypeGoogleApps AccessIdentityProviderUpdateParamsAccessGoogleType = "google-apps" - AccessIdentityProviderUpdateParamsAccessGoogleTypeGoogle AccessIdentityProviderUpdateParamsAccessGoogleType = "google" - AccessIdentityProviderUpdateParamsAccessGoogleTypeLinkedin AccessIdentityProviderUpdateParamsAccessGoogleType = "linkedin" - AccessIdentityProviderUpdateParamsAccessGoogleTypeOidc AccessIdentityProviderUpdateParamsAccessGoogleType = "oidc" - AccessIdentityProviderUpdateParamsAccessGoogleTypeOkta AccessIdentityProviderUpdateParamsAccessGoogleType = "okta" - AccessIdentityProviderUpdateParamsAccessGoogleTypeOnelogin AccessIdentityProviderUpdateParamsAccessGoogleType = "onelogin" - AccessIdentityProviderUpdateParamsAccessGoogleTypePingone AccessIdentityProviderUpdateParamsAccessGoogleType = "pingone" - AccessIdentityProviderUpdateParamsAccessGoogleTypeYandex AccessIdentityProviderUpdateParamsAccessGoogleType = "yandex" + AccessIdentityProviderNewParamsAccessGoogleTypeOnetimepin AccessIdentityProviderNewParamsAccessGoogleType = "onetimepin" + AccessIdentityProviderNewParamsAccessGoogleTypeAzureAd AccessIdentityProviderNewParamsAccessGoogleType = "azureAD" + AccessIdentityProviderNewParamsAccessGoogleTypeSaml AccessIdentityProviderNewParamsAccessGoogleType = "saml" + AccessIdentityProviderNewParamsAccessGoogleTypeCentrify AccessIdentityProviderNewParamsAccessGoogleType = "centrify" + AccessIdentityProviderNewParamsAccessGoogleTypeFacebook AccessIdentityProviderNewParamsAccessGoogleType = "facebook" + AccessIdentityProviderNewParamsAccessGoogleTypeGitHub AccessIdentityProviderNewParamsAccessGoogleType = "github" + AccessIdentityProviderNewParamsAccessGoogleTypeGoogleApps AccessIdentityProviderNewParamsAccessGoogleType = "google-apps" + AccessIdentityProviderNewParamsAccessGoogleTypeGoogle AccessIdentityProviderNewParamsAccessGoogleType = "google" + AccessIdentityProviderNewParamsAccessGoogleTypeLinkedin AccessIdentityProviderNewParamsAccessGoogleType = "linkedin" + AccessIdentityProviderNewParamsAccessGoogleTypeOidc AccessIdentityProviderNewParamsAccessGoogleType = "oidc" + AccessIdentityProviderNewParamsAccessGoogleTypeOkta AccessIdentityProviderNewParamsAccessGoogleType = "okta" + AccessIdentityProviderNewParamsAccessGoogleTypeOnelogin AccessIdentityProviderNewParamsAccessGoogleType = "onelogin" + AccessIdentityProviderNewParamsAccessGoogleTypePingone AccessIdentityProviderNewParamsAccessGoogleType = "pingone" + AccessIdentityProviderNewParamsAccessGoogleTypeYandex AccessIdentityProviderNewParamsAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessGoogleScimConfig struct { +type AccessIdentityProviderNewParamsAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -7996,38 +7935,38 @@ type AccessIdentityProviderUpdateParamsAccessGoogleScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogleScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogleScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessGoogleApps struct { +type AccessIdentityProviderNewParamsAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessGoogleAppsConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessGoogleAppsConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessGoogleAppsType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessGoogleAppsType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessGoogleAppsScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessGoogleAppsScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogleApps) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogleApps) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessGoogleApps) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessGoogleApps) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGoogleAppsConfig struct { +type AccessIdentityProviderNewParamsAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain param.Field[string] `json:"apps_domain"` // Custom claims @@ -8040,35 +7979,35 @@ type AccessIdentityProviderUpdateParamsAccessGoogleAppsConfig struct { EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogleAppsConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogleAppsConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessGoogleAppsType string +type AccessIdentityProviderNewParamsAccessGoogleAppsType string const ( - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeOnetimepin AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeAzureAd AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "azureAD" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeSaml AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "saml" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeCentrify AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "centrify" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeFacebook AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "facebook" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeGitHub AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "github" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeGoogleApps AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "google-apps" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeGoogle AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "google" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeLinkedin AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "linkedin" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeOidc AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "oidc" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeOkta AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "okta" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeOnelogin AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "onelogin" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypePingone AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "pingone" - AccessIdentityProviderUpdateParamsAccessGoogleAppsTypeYandex AccessIdentityProviderUpdateParamsAccessGoogleAppsType = "yandex" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeOnetimepin AccessIdentityProviderNewParamsAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeAzureAd AccessIdentityProviderNewParamsAccessGoogleAppsType = "azureAD" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeSaml AccessIdentityProviderNewParamsAccessGoogleAppsType = "saml" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeCentrify AccessIdentityProviderNewParamsAccessGoogleAppsType = "centrify" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeFacebook AccessIdentityProviderNewParamsAccessGoogleAppsType = "facebook" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeGitHub AccessIdentityProviderNewParamsAccessGoogleAppsType = "github" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeGoogleApps AccessIdentityProviderNewParamsAccessGoogleAppsType = "google-apps" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeGoogle AccessIdentityProviderNewParamsAccessGoogleAppsType = "google" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeLinkedin AccessIdentityProviderNewParamsAccessGoogleAppsType = "linkedin" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeOidc AccessIdentityProviderNewParamsAccessGoogleAppsType = "oidc" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeOkta AccessIdentityProviderNewParamsAccessGoogleAppsType = "okta" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeOnelogin AccessIdentityProviderNewParamsAccessGoogleAppsType = "onelogin" + AccessIdentityProviderNewParamsAccessGoogleAppsTypePingone AccessIdentityProviderNewParamsAccessGoogleAppsType = "pingone" + AccessIdentityProviderNewParamsAccessGoogleAppsTypeYandex AccessIdentityProviderNewParamsAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderNewParamsAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8088,73 +8027,73 @@ type AccessIdentityProviderUpdateParamsAccessGoogleAppsScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessGoogleAppsScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessGoogleAppsScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessLinkedin struct { +type AccessIdentityProviderNewParamsAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessLinkedinConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessLinkedinConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessLinkedinType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessLinkedinType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessLinkedinScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessLinkedinScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessLinkedin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessLinkedin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessLinkedin) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessLinkedin) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessLinkedinConfig struct { +type AccessIdentityProviderNewParamsAccessLinkedinConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderUpdateParamsAccessLinkedinConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessLinkedinConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessLinkedinType string +type AccessIdentityProviderNewParamsAccessLinkedinType string const ( - AccessIdentityProviderUpdateParamsAccessLinkedinTypeOnetimepin AccessIdentityProviderUpdateParamsAccessLinkedinType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeAzureAd AccessIdentityProviderUpdateParamsAccessLinkedinType = "azureAD" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeSaml AccessIdentityProviderUpdateParamsAccessLinkedinType = "saml" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeCentrify AccessIdentityProviderUpdateParamsAccessLinkedinType = "centrify" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeFacebook AccessIdentityProviderUpdateParamsAccessLinkedinType = "facebook" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeGitHub AccessIdentityProviderUpdateParamsAccessLinkedinType = "github" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeGoogleApps AccessIdentityProviderUpdateParamsAccessLinkedinType = "google-apps" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeGoogle AccessIdentityProviderUpdateParamsAccessLinkedinType = "google" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeLinkedin AccessIdentityProviderUpdateParamsAccessLinkedinType = "linkedin" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeOidc AccessIdentityProviderUpdateParamsAccessLinkedinType = "oidc" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeOkta AccessIdentityProviderUpdateParamsAccessLinkedinType = "okta" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeOnelogin AccessIdentityProviderUpdateParamsAccessLinkedinType = "onelogin" - AccessIdentityProviderUpdateParamsAccessLinkedinTypePingone AccessIdentityProviderUpdateParamsAccessLinkedinType = "pingone" - AccessIdentityProviderUpdateParamsAccessLinkedinTypeYandex AccessIdentityProviderUpdateParamsAccessLinkedinType = "yandex" + AccessIdentityProviderNewParamsAccessLinkedinTypeOnetimepin AccessIdentityProviderNewParamsAccessLinkedinType = "onetimepin" + AccessIdentityProviderNewParamsAccessLinkedinTypeAzureAd AccessIdentityProviderNewParamsAccessLinkedinType = "azureAD" + AccessIdentityProviderNewParamsAccessLinkedinTypeSaml AccessIdentityProviderNewParamsAccessLinkedinType = "saml" + AccessIdentityProviderNewParamsAccessLinkedinTypeCentrify AccessIdentityProviderNewParamsAccessLinkedinType = "centrify" + AccessIdentityProviderNewParamsAccessLinkedinTypeFacebook AccessIdentityProviderNewParamsAccessLinkedinType = "facebook" + AccessIdentityProviderNewParamsAccessLinkedinTypeGitHub AccessIdentityProviderNewParamsAccessLinkedinType = "github" + AccessIdentityProviderNewParamsAccessLinkedinTypeGoogleApps AccessIdentityProviderNewParamsAccessLinkedinType = "google-apps" + AccessIdentityProviderNewParamsAccessLinkedinTypeGoogle AccessIdentityProviderNewParamsAccessLinkedinType = "google" + AccessIdentityProviderNewParamsAccessLinkedinTypeLinkedin AccessIdentityProviderNewParamsAccessLinkedinType = "linkedin" + AccessIdentityProviderNewParamsAccessLinkedinTypeOidc AccessIdentityProviderNewParamsAccessLinkedinType = "oidc" + AccessIdentityProviderNewParamsAccessLinkedinTypeOkta AccessIdentityProviderNewParamsAccessLinkedinType = "okta" + AccessIdentityProviderNewParamsAccessLinkedinTypeOnelogin AccessIdentityProviderNewParamsAccessLinkedinType = "onelogin" + AccessIdentityProviderNewParamsAccessLinkedinTypePingone AccessIdentityProviderNewParamsAccessLinkedinType = "pingone" + AccessIdentityProviderNewParamsAccessLinkedinTypeYandex AccessIdentityProviderNewParamsAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessLinkedinScimConfig struct { +type AccessIdentityProviderNewParamsAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8174,38 +8113,38 @@ type AccessIdentityProviderUpdateParamsAccessLinkedinScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessLinkedinScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessLinkedinScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessOidc struct { +type AccessIdentityProviderNewParamsAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessOidcConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessOidcConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessOidcType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessOidcType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessOidcScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessOidcScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessOidc) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOidc) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessOidc) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessOidc) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOidcConfig struct { +type AccessIdentityProviderNewParamsAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL param.Field[string] `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -8224,35 +8163,35 @@ type AccessIdentityProviderUpdateParamsAccessOidcConfig struct { TokenURL param.Field[string] `json:"token_url"` } -func (r AccessIdentityProviderUpdateParamsAccessOidcConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOidcConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOidcType string +type AccessIdentityProviderNewParamsAccessOidcType string const ( - AccessIdentityProviderUpdateParamsAccessOidcTypeOnetimepin AccessIdentityProviderUpdateParamsAccessOidcType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessOidcTypeAzureAd AccessIdentityProviderUpdateParamsAccessOidcType = "azureAD" - AccessIdentityProviderUpdateParamsAccessOidcTypeSaml AccessIdentityProviderUpdateParamsAccessOidcType = "saml" - AccessIdentityProviderUpdateParamsAccessOidcTypeCentrify AccessIdentityProviderUpdateParamsAccessOidcType = "centrify" - AccessIdentityProviderUpdateParamsAccessOidcTypeFacebook AccessIdentityProviderUpdateParamsAccessOidcType = "facebook" - AccessIdentityProviderUpdateParamsAccessOidcTypeGitHub AccessIdentityProviderUpdateParamsAccessOidcType = "github" - AccessIdentityProviderUpdateParamsAccessOidcTypeGoogleApps AccessIdentityProviderUpdateParamsAccessOidcType = "google-apps" - AccessIdentityProviderUpdateParamsAccessOidcTypeGoogle AccessIdentityProviderUpdateParamsAccessOidcType = "google" - AccessIdentityProviderUpdateParamsAccessOidcTypeLinkedin AccessIdentityProviderUpdateParamsAccessOidcType = "linkedin" - AccessIdentityProviderUpdateParamsAccessOidcTypeOidc AccessIdentityProviderUpdateParamsAccessOidcType = "oidc" - AccessIdentityProviderUpdateParamsAccessOidcTypeOkta AccessIdentityProviderUpdateParamsAccessOidcType = "okta" - AccessIdentityProviderUpdateParamsAccessOidcTypeOnelogin AccessIdentityProviderUpdateParamsAccessOidcType = "onelogin" - AccessIdentityProviderUpdateParamsAccessOidcTypePingone AccessIdentityProviderUpdateParamsAccessOidcType = "pingone" - AccessIdentityProviderUpdateParamsAccessOidcTypeYandex AccessIdentityProviderUpdateParamsAccessOidcType = "yandex" + AccessIdentityProviderNewParamsAccessOidcTypeOnetimepin AccessIdentityProviderNewParamsAccessOidcType = "onetimepin" + AccessIdentityProviderNewParamsAccessOidcTypeAzureAd AccessIdentityProviderNewParamsAccessOidcType = "azureAD" + AccessIdentityProviderNewParamsAccessOidcTypeSaml AccessIdentityProviderNewParamsAccessOidcType = "saml" + AccessIdentityProviderNewParamsAccessOidcTypeCentrify AccessIdentityProviderNewParamsAccessOidcType = "centrify" + AccessIdentityProviderNewParamsAccessOidcTypeFacebook AccessIdentityProviderNewParamsAccessOidcType = "facebook" + AccessIdentityProviderNewParamsAccessOidcTypeGitHub AccessIdentityProviderNewParamsAccessOidcType = "github" + AccessIdentityProviderNewParamsAccessOidcTypeGoogleApps AccessIdentityProviderNewParamsAccessOidcType = "google-apps" + AccessIdentityProviderNewParamsAccessOidcTypeGoogle AccessIdentityProviderNewParamsAccessOidcType = "google" + AccessIdentityProviderNewParamsAccessOidcTypeLinkedin AccessIdentityProviderNewParamsAccessOidcType = "linkedin" + AccessIdentityProviderNewParamsAccessOidcTypeOidc AccessIdentityProviderNewParamsAccessOidcType = "oidc" + AccessIdentityProviderNewParamsAccessOidcTypeOkta AccessIdentityProviderNewParamsAccessOidcType = "okta" + AccessIdentityProviderNewParamsAccessOidcTypeOnelogin AccessIdentityProviderNewParamsAccessOidcType = "onelogin" + AccessIdentityProviderNewParamsAccessOidcTypePingone AccessIdentityProviderNewParamsAccessOidcType = "pingone" + AccessIdentityProviderNewParamsAccessOidcTypeYandex AccessIdentityProviderNewParamsAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessOidcScimConfig struct { +type AccessIdentityProviderNewParamsAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8272,38 +8211,38 @@ type AccessIdentityProviderUpdateParamsAccessOidcScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessOidcScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOidcScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessOkta struct { +type AccessIdentityProviderNewParamsAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessOktaConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessOktaConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessOktaType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessOktaType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessOktaScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessOktaScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessOkta) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessOkta) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessOkta) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOktaConfig struct { +type AccessIdentityProviderNewParamsAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID param.Field[string] `json:"authorization_server_id"` // Custom claims @@ -8318,35 +8257,35 @@ type AccessIdentityProviderUpdateParamsAccessOktaConfig struct { OktaAccount param.Field[string] `json:"okta_account"` } -func (r AccessIdentityProviderUpdateParamsAccessOktaConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOktaConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOktaType string +type AccessIdentityProviderNewParamsAccessOktaType string const ( - AccessIdentityProviderUpdateParamsAccessOktaTypeOnetimepin AccessIdentityProviderUpdateParamsAccessOktaType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessOktaTypeAzureAd AccessIdentityProviderUpdateParamsAccessOktaType = "azureAD" - AccessIdentityProviderUpdateParamsAccessOktaTypeSaml AccessIdentityProviderUpdateParamsAccessOktaType = "saml" - AccessIdentityProviderUpdateParamsAccessOktaTypeCentrify AccessIdentityProviderUpdateParamsAccessOktaType = "centrify" - AccessIdentityProviderUpdateParamsAccessOktaTypeFacebook AccessIdentityProviderUpdateParamsAccessOktaType = "facebook" - AccessIdentityProviderUpdateParamsAccessOktaTypeGitHub AccessIdentityProviderUpdateParamsAccessOktaType = "github" - AccessIdentityProviderUpdateParamsAccessOktaTypeGoogleApps AccessIdentityProviderUpdateParamsAccessOktaType = "google-apps" - AccessIdentityProviderUpdateParamsAccessOktaTypeGoogle AccessIdentityProviderUpdateParamsAccessOktaType = "google" - AccessIdentityProviderUpdateParamsAccessOktaTypeLinkedin AccessIdentityProviderUpdateParamsAccessOktaType = "linkedin" - AccessIdentityProviderUpdateParamsAccessOktaTypeOidc AccessIdentityProviderUpdateParamsAccessOktaType = "oidc" - AccessIdentityProviderUpdateParamsAccessOktaTypeOkta AccessIdentityProviderUpdateParamsAccessOktaType = "okta" - AccessIdentityProviderUpdateParamsAccessOktaTypeOnelogin AccessIdentityProviderUpdateParamsAccessOktaType = "onelogin" - AccessIdentityProviderUpdateParamsAccessOktaTypePingone AccessIdentityProviderUpdateParamsAccessOktaType = "pingone" - AccessIdentityProviderUpdateParamsAccessOktaTypeYandex AccessIdentityProviderUpdateParamsAccessOktaType = "yandex" + AccessIdentityProviderNewParamsAccessOktaTypeOnetimepin AccessIdentityProviderNewParamsAccessOktaType = "onetimepin" + AccessIdentityProviderNewParamsAccessOktaTypeAzureAd AccessIdentityProviderNewParamsAccessOktaType = "azureAD" + AccessIdentityProviderNewParamsAccessOktaTypeSaml AccessIdentityProviderNewParamsAccessOktaType = "saml" + AccessIdentityProviderNewParamsAccessOktaTypeCentrify AccessIdentityProviderNewParamsAccessOktaType = "centrify" + AccessIdentityProviderNewParamsAccessOktaTypeFacebook AccessIdentityProviderNewParamsAccessOktaType = "facebook" + AccessIdentityProviderNewParamsAccessOktaTypeGitHub AccessIdentityProviderNewParamsAccessOktaType = "github" + AccessIdentityProviderNewParamsAccessOktaTypeGoogleApps AccessIdentityProviderNewParamsAccessOktaType = "google-apps" + AccessIdentityProviderNewParamsAccessOktaTypeGoogle AccessIdentityProviderNewParamsAccessOktaType = "google" + AccessIdentityProviderNewParamsAccessOktaTypeLinkedin AccessIdentityProviderNewParamsAccessOktaType = "linkedin" + AccessIdentityProviderNewParamsAccessOktaTypeOidc AccessIdentityProviderNewParamsAccessOktaType = "oidc" + AccessIdentityProviderNewParamsAccessOktaTypeOkta AccessIdentityProviderNewParamsAccessOktaType = "okta" + AccessIdentityProviderNewParamsAccessOktaTypeOnelogin AccessIdentityProviderNewParamsAccessOktaType = "onelogin" + AccessIdentityProviderNewParamsAccessOktaTypePingone AccessIdentityProviderNewParamsAccessOktaType = "pingone" + AccessIdentityProviderNewParamsAccessOktaTypeYandex AccessIdentityProviderNewParamsAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessOktaScimConfig struct { +type AccessIdentityProviderNewParamsAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8366,38 +8305,38 @@ type AccessIdentityProviderUpdateParamsAccessOktaScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessOktaScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOktaScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessOnelogin struct { +type AccessIdentityProviderNewParamsAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessOneloginConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessOneloginConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessOneloginType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessOneloginType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessOneloginScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessOneloginScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessOnelogin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOnelogin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessOnelogin) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessOnelogin) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOneloginConfig struct { +type AccessIdentityProviderNewParamsAccessOneloginConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -8410,35 +8349,35 @@ type AccessIdentityProviderUpdateParamsAccessOneloginConfig struct { OneloginAccount param.Field[string] `json:"onelogin_account"` } -func (r AccessIdentityProviderUpdateParamsAccessOneloginConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOneloginConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOneloginType string +type AccessIdentityProviderNewParamsAccessOneloginType string const ( - AccessIdentityProviderUpdateParamsAccessOneloginTypeOnetimepin AccessIdentityProviderUpdateParamsAccessOneloginType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessOneloginTypeAzureAd AccessIdentityProviderUpdateParamsAccessOneloginType = "azureAD" - AccessIdentityProviderUpdateParamsAccessOneloginTypeSaml AccessIdentityProviderUpdateParamsAccessOneloginType = "saml" - AccessIdentityProviderUpdateParamsAccessOneloginTypeCentrify AccessIdentityProviderUpdateParamsAccessOneloginType = "centrify" - AccessIdentityProviderUpdateParamsAccessOneloginTypeFacebook AccessIdentityProviderUpdateParamsAccessOneloginType = "facebook" - AccessIdentityProviderUpdateParamsAccessOneloginTypeGitHub AccessIdentityProviderUpdateParamsAccessOneloginType = "github" - AccessIdentityProviderUpdateParamsAccessOneloginTypeGoogleApps AccessIdentityProviderUpdateParamsAccessOneloginType = "google-apps" - AccessIdentityProviderUpdateParamsAccessOneloginTypeGoogle AccessIdentityProviderUpdateParamsAccessOneloginType = "google" - AccessIdentityProviderUpdateParamsAccessOneloginTypeLinkedin AccessIdentityProviderUpdateParamsAccessOneloginType = "linkedin" - AccessIdentityProviderUpdateParamsAccessOneloginTypeOidc AccessIdentityProviderUpdateParamsAccessOneloginType = "oidc" - AccessIdentityProviderUpdateParamsAccessOneloginTypeOkta AccessIdentityProviderUpdateParamsAccessOneloginType = "okta" - AccessIdentityProviderUpdateParamsAccessOneloginTypeOnelogin AccessIdentityProviderUpdateParamsAccessOneloginType = "onelogin" - AccessIdentityProviderUpdateParamsAccessOneloginTypePingone AccessIdentityProviderUpdateParamsAccessOneloginType = "pingone" - AccessIdentityProviderUpdateParamsAccessOneloginTypeYandex AccessIdentityProviderUpdateParamsAccessOneloginType = "yandex" + AccessIdentityProviderNewParamsAccessOneloginTypeOnetimepin AccessIdentityProviderNewParamsAccessOneloginType = "onetimepin" + AccessIdentityProviderNewParamsAccessOneloginTypeAzureAd AccessIdentityProviderNewParamsAccessOneloginType = "azureAD" + AccessIdentityProviderNewParamsAccessOneloginTypeSaml AccessIdentityProviderNewParamsAccessOneloginType = "saml" + AccessIdentityProviderNewParamsAccessOneloginTypeCentrify AccessIdentityProviderNewParamsAccessOneloginType = "centrify" + AccessIdentityProviderNewParamsAccessOneloginTypeFacebook AccessIdentityProviderNewParamsAccessOneloginType = "facebook" + AccessIdentityProviderNewParamsAccessOneloginTypeGitHub AccessIdentityProviderNewParamsAccessOneloginType = "github" + AccessIdentityProviderNewParamsAccessOneloginTypeGoogleApps AccessIdentityProviderNewParamsAccessOneloginType = "google-apps" + AccessIdentityProviderNewParamsAccessOneloginTypeGoogle AccessIdentityProviderNewParamsAccessOneloginType = "google" + AccessIdentityProviderNewParamsAccessOneloginTypeLinkedin AccessIdentityProviderNewParamsAccessOneloginType = "linkedin" + AccessIdentityProviderNewParamsAccessOneloginTypeOidc AccessIdentityProviderNewParamsAccessOneloginType = "oidc" + AccessIdentityProviderNewParamsAccessOneloginTypeOkta AccessIdentityProviderNewParamsAccessOneloginType = "okta" + AccessIdentityProviderNewParamsAccessOneloginTypeOnelogin AccessIdentityProviderNewParamsAccessOneloginType = "onelogin" + AccessIdentityProviderNewParamsAccessOneloginTypePingone AccessIdentityProviderNewParamsAccessOneloginType = "pingone" + AccessIdentityProviderNewParamsAccessOneloginTypeYandex AccessIdentityProviderNewParamsAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessOneloginScimConfig struct { +type AccessIdentityProviderNewParamsAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8458,38 +8397,38 @@ type AccessIdentityProviderUpdateParamsAccessOneloginScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessOneloginScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOneloginScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessPingone struct { +type AccessIdentityProviderNewParamsAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessPingoneConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessPingoneConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessPingoneType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessPingoneType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessPingoneScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessPingoneScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessPingone) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessPingone) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessPingone) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessPingone) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessPingoneConfig struct { +type AccessIdentityProviderNewParamsAccessPingoneConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -8502,35 +8441,35 @@ type AccessIdentityProviderUpdateParamsAccessPingoneConfig struct { PingEnvID param.Field[string] `json:"ping_env_id"` } -func (r AccessIdentityProviderUpdateParamsAccessPingoneConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessPingoneConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessPingoneType string +type AccessIdentityProviderNewParamsAccessPingoneType string const ( - AccessIdentityProviderUpdateParamsAccessPingoneTypeOnetimepin AccessIdentityProviderUpdateParamsAccessPingoneType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessPingoneTypeAzureAd AccessIdentityProviderUpdateParamsAccessPingoneType = "azureAD" - AccessIdentityProviderUpdateParamsAccessPingoneTypeSaml AccessIdentityProviderUpdateParamsAccessPingoneType = "saml" - AccessIdentityProviderUpdateParamsAccessPingoneTypeCentrify AccessIdentityProviderUpdateParamsAccessPingoneType = "centrify" - AccessIdentityProviderUpdateParamsAccessPingoneTypeFacebook AccessIdentityProviderUpdateParamsAccessPingoneType = "facebook" - AccessIdentityProviderUpdateParamsAccessPingoneTypeGitHub AccessIdentityProviderUpdateParamsAccessPingoneType = "github" - AccessIdentityProviderUpdateParamsAccessPingoneTypeGoogleApps AccessIdentityProviderUpdateParamsAccessPingoneType = "google-apps" - AccessIdentityProviderUpdateParamsAccessPingoneTypeGoogle AccessIdentityProviderUpdateParamsAccessPingoneType = "google" - AccessIdentityProviderUpdateParamsAccessPingoneTypeLinkedin AccessIdentityProviderUpdateParamsAccessPingoneType = "linkedin" - AccessIdentityProviderUpdateParamsAccessPingoneTypeOidc AccessIdentityProviderUpdateParamsAccessPingoneType = "oidc" - AccessIdentityProviderUpdateParamsAccessPingoneTypeOkta AccessIdentityProviderUpdateParamsAccessPingoneType = "okta" - AccessIdentityProviderUpdateParamsAccessPingoneTypeOnelogin AccessIdentityProviderUpdateParamsAccessPingoneType = "onelogin" - AccessIdentityProviderUpdateParamsAccessPingoneTypePingone AccessIdentityProviderUpdateParamsAccessPingoneType = "pingone" - AccessIdentityProviderUpdateParamsAccessPingoneTypeYandex AccessIdentityProviderUpdateParamsAccessPingoneType = "yandex" + AccessIdentityProviderNewParamsAccessPingoneTypeOnetimepin AccessIdentityProviderNewParamsAccessPingoneType = "onetimepin" + AccessIdentityProviderNewParamsAccessPingoneTypeAzureAd AccessIdentityProviderNewParamsAccessPingoneType = "azureAD" + AccessIdentityProviderNewParamsAccessPingoneTypeSaml AccessIdentityProviderNewParamsAccessPingoneType = "saml" + AccessIdentityProviderNewParamsAccessPingoneTypeCentrify AccessIdentityProviderNewParamsAccessPingoneType = "centrify" + AccessIdentityProviderNewParamsAccessPingoneTypeFacebook AccessIdentityProviderNewParamsAccessPingoneType = "facebook" + AccessIdentityProviderNewParamsAccessPingoneTypeGitHub AccessIdentityProviderNewParamsAccessPingoneType = "github" + AccessIdentityProviderNewParamsAccessPingoneTypeGoogleApps AccessIdentityProviderNewParamsAccessPingoneType = "google-apps" + AccessIdentityProviderNewParamsAccessPingoneTypeGoogle AccessIdentityProviderNewParamsAccessPingoneType = "google" + AccessIdentityProviderNewParamsAccessPingoneTypeLinkedin AccessIdentityProviderNewParamsAccessPingoneType = "linkedin" + AccessIdentityProviderNewParamsAccessPingoneTypeOidc AccessIdentityProviderNewParamsAccessPingoneType = "oidc" + AccessIdentityProviderNewParamsAccessPingoneTypeOkta AccessIdentityProviderNewParamsAccessPingoneType = "okta" + AccessIdentityProviderNewParamsAccessPingoneTypeOnelogin AccessIdentityProviderNewParamsAccessPingoneType = "onelogin" + AccessIdentityProviderNewParamsAccessPingoneTypePingone AccessIdentityProviderNewParamsAccessPingoneType = "pingone" + AccessIdentityProviderNewParamsAccessPingoneTypeYandex AccessIdentityProviderNewParamsAccessPingoneType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessPingoneScimConfig struct { +type AccessIdentityProviderNewParamsAccessPingoneScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8550,38 +8489,38 @@ type AccessIdentityProviderUpdateParamsAccessPingoneScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessPingoneScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessPingoneScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessSaml struct { +type AccessIdentityProviderNewParamsAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessSamlConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessSamlConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessSamlType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessSamlType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessSamlScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessSamlScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessSaml) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessSaml) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessSaml) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessSamlConfig struct { +type AccessIdentityProviderNewParamsAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes param.Field[[]string] `json:"attributes"` @@ -8589,7 +8528,7 @@ type AccessIdentityProviderUpdateParamsAccessSamlConfig struct { EmailAttributeName param.Field[string] `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes param.Field[[]AccessIdentityProviderUpdateParamsAccessSamlConfigHeaderAttribute] `json:"header_attributes"` + HeaderAttributes param.Field[[]AccessIdentityProviderNewParamsAccessSamlConfigHeaderAttribute] `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts param.Field[[]string] `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -8601,46 +8540,46 @@ type AccessIdentityProviderUpdateParamsAccessSamlConfig struct { SSOTargetURL param.Field[string] `json:"sso_target_url"` } -func (r AccessIdentityProviderUpdateParamsAccessSamlConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessSamlConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderNewParamsAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName param.Field[string] `json:"attribute_name"` // header that will be added on the request to the origin HeaderName param.Field[string] `json:"header_name"` } -func (r AccessIdentityProviderUpdateParamsAccessSamlConfigHeaderAttribute) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessSamlConfigHeaderAttribute) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessSamlType string +type AccessIdentityProviderNewParamsAccessSamlType string const ( - AccessIdentityProviderUpdateParamsAccessSamlTypeOnetimepin AccessIdentityProviderUpdateParamsAccessSamlType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessSamlTypeAzureAd AccessIdentityProviderUpdateParamsAccessSamlType = "azureAD" - AccessIdentityProviderUpdateParamsAccessSamlTypeSaml AccessIdentityProviderUpdateParamsAccessSamlType = "saml" - AccessIdentityProviderUpdateParamsAccessSamlTypeCentrify AccessIdentityProviderUpdateParamsAccessSamlType = "centrify" - AccessIdentityProviderUpdateParamsAccessSamlTypeFacebook AccessIdentityProviderUpdateParamsAccessSamlType = "facebook" - AccessIdentityProviderUpdateParamsAccessSamlTypeGitHub AccessIdentityProviderUpdateParamsAccessSamlType = "github" - AccessIdentityProviderUpdateParamsAccessSamlTypeGoogleApps AccessIdentityProviderUpdateParamsAccessSamlType = "google-apps" - AccessIdentityProviderUpdateParamsAccessSamlTypeGoogle AccessIdentityProviderUpdateParamsAccessSamlType = "google" - AccessIdentityProviderUpdateParamsAccessSamlTypeLinkedin AccessIdentityProviderUpdateParamsAccessSamlType = "linkedin" - AccessIdentityProviderUpdateParamsAccessSamlTypeOidc AccessIdentityProviderUpdateParamsAccessSamlType = "oidc" - AccessIdentityProviderUpdateParamsAccessSamlTypeOkta AccessIdentityProviderUpdateParamsAccessSamlType = "okta" - AccessIdentityProviderUpdateParamsAccessSamlTypeOnelogin AccessIdentityProviderUpdateParamsAccessSamlType = "onelogin" - AccessIdentityProviderUpdateParamsAccessSamlTypePingone AccessIdentityProviderUpdateParamsAccessSamlType = "pingone" - AccessIdentityProviderUpdateParamsAccessSamlTypeYandex AccessIdentityProviderUpdateParamsAccessSamlType = "yandex" + AccessIdentityProviderNewParamsAccessSamlTypeOnetimepin AccessIdentityProviderNewParamsAccessSamlType = "onetimepin" + AccessIdentityProviderNewParamsAccessSamlTypeAzureAd AccessIdentityProviderNewParamsAccessSamlType = "azureAD" + AccessIdentityProviderNewParamsAccessSamlTypeSaml AccessIdentityProviderNewParamsAccessSamlType = "saml" + AccessIdentityProviderNewParamsAccessSamlTypeCentrify AccessIdentityProviderNewParamsAccessSamlType = "centrify" + AccessIdentityProviderNewParamsAccessSamlTypeFacebook AccessIdentityProviderNewParamsAccessSamlType = "facebook" + AccessIdentityProviderNewParamsAccessSamlTypeGitHub AccessIdentityProviderNewParamsAccessSamlType = "github" + AccessIdentityProviderNewParamsAccessSamlTypeGoogleApps AccessIdentityProviderNewParamsAccessSamlType = "google-apps" + AccessIdentityProviderNewParamsAccessSamlTypeGoogle AccessIdentityProviderNewParamsAccessSamlType = "google" + AccessIdentityProviderNewParamsAccessSamlTypeLinkedin AccessIdentityProviderNewParamsAccessSamlType = "linkedin" + AccessIdentityProviderNewParamsAccessSamlTypeOidc AccessIdentityProviderNewParamsAccessSamlType = "oidc" + AccessIdentityProviderNewParamsAccessSamlTypeOkta AccessIdentityProviderNewParamsAccessSamlType = "okta" + AccessIdentityProviderNewParamsAccessSamlTypeOnelogin AccessIdentityProviderNewParamsAccessSamlType = "onelogin" + AccessIdentityProviderNewParamsAccessSamlTypePingone AccessIdentityProviderNewParamsAccessSamlType = "pingone" + AccessIdentityProviderNewParamsAccessSamlTypeYandex AccessIdentityProviderNewParamsAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessSamlScimConfig struct { +type AccessIdentityProviderNewParamsAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8660,73 +8599,73 @@ type AccessIdentityProviderUpdateParamsAccessSamlScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessSamlScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessSamlScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessYandex struct { +type AccessIdentityProviderNewParamsAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderUpdateParamsAccessYandexConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderNewParamsAccessYandexConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessYandexType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessYandexType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessYandexScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessYandexScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessYandex) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessYandex) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessYandex) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessYandex) ImplementsAccessIdentityProviderNewParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessYandexConfig struct { +type AccessIdentityProviderNewParamsAccessYandexConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderUpdateParamsAccessYandexConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessYandexConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessYandexType string +type AccessIdentityProviderNewParamsAccessYandexType string const ( - AccessIdentityProviderUpdateParamsAccessYandexTypeOnetimepin AccessIdentityProviderUpdateParamsAccessYandexType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessYandexTypeAzureAd AccessIdentityProviderUpdateParamsAccessYandexType = "azureAD" - AccessIdentityProviderUpdateParamsAccessYandexTypeSaml AccessIdentityProviderUpdateParamsAccessYandexType = "saml" - AccessIdentityProviderUpdateParamsAccessYandexTypeCentrify AccessIdentityProviderUpdateParamsAccessYandexType = "centrify" - AccessIdentityProviderUpdateParamsAccessYandexTypeFacebook AccessIdentityProviderUpdateParamsAccessYandexType = "facebook" - AccessIdentityProviderUpdateParamsAccessYandexTypeGitHub AccessIdentityProviderUpdateParamsAccessYandexType = "github" - AccessIdentityProviderUpdateParamsAccessYandexTypeGoogleApps AccessIdentityProviderUpdateParamsAccessYandexType = "google-apps" - AccessIdentityProviderUpdateParamsAccessYandexTypeGoogle AccessIdentityProviderUpdateParamsAccessYandexType = "google" - AccessIdentityProviderUpdateParamsAccessYandexTypeLinkedin AccessIdentityProviderUpdateParamsAccessYandexType = "linkedin" - AccessIdentityProviderUpdateParamsAccessYandexTypeOidc AccessIdentityProviderUpdateParamsAccessYandexType = "oidc" - AccessIdentityProviderUpdateParamsAccessYandexTypeOkta AccessIdentityProviderUpdateParamsAccessYandexType = "okta" - AccessIdentityProviderUpdateParamsAccessYandexTypeOnelogin AccessIdentityProviderUpdateParamsAccessYandexType = "onelogin" - AccessIdentityProviderUpdateParamsAccessYandexTypePingone AccessIdentityProviderUpdateParamsAccessYandexType = "pingone" - AccessIdentityProviderUpdateParamsAccessYandexTypeYandex AccessIdentityProviderUpdateParamsAccessYandexType = "yandex" + AccessIdentityProviderNewParamsAccessYandexTypeOnetimepin AccessIdentityProviderNewParamsAccessYandexType = "onetimepin" + AccessIdentityProviderNewParamsAccessYandexTypeAzureAd AccessIdentityProviderNewParamsAccessYandexType = "azureAD" + AccessIdentityProviderNewParamsAccessYandexTypeSaml AccessIdentityProviderNewParamsAccessYandexType = "saml" + AccessIdentityProviderNewParamsAccessYandexTypeCentrify AccessIdentityProviderNewParamsAccessYandexType = "centrify" + AccessIdentityProviderNewParamsAccessYandexTypeFacebook AccessIdentityProviderNewParamsAccessYandexType = "facebook" + AccessIdentityProviderNewParamsAccessYandexTypeGitHub AccessIdentityProviderNewParamsAccessYandexType = "github" + AccessIdentityProviderNewParamsAccessYandexTypeGoogleApps AccessIdentityProviderNewParamsAccessYandexType = "google-apps" + AccessIdentityProviderNewParamsAccessYandexTypeGoogle AccessIdentityProviderNewParamsAccessYandexType = "google" + AccessIdentityProviderNewParamsAccessYandexTypeLinkedin AccessIdentityProviderNewParamsAccessYandexType = "linkedin" + AccessIdentityProviderNewParamsAccessYandexTypeOidc AccessIdentityProviderNewParamsAccessYandexType = "oidc" + AccessIdentityProviderNewParamsAccessYandexTypeOkta AccessIdentityProviderNewParamsAccessYandexType = "okta" + AccessIdentityProviderNewParamsAccessYandexTypeOnelogin AccessIdentityProviderNewParamsAccessYandexType = "onelogin" + AccessIdentityProviderNewParamsAccessYandexTypePingone AccessIdentityProviderNewParamsAccessYandexType = "pingone" + AccessIdentityProviderNewParamsAccessYandexTypeYandex AccessIdentityProviderNewParamsAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessYandexScimConfig struct { +type AccessIdentityProviderNewParamsAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8746,11 +8685,11 @@ type AccessIdentityProviderUpdateParamsAccessYandexScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessYandexScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessYandexScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderUpdateParamsAccessOnetimepin struct { +type AccessIdentityProviderNewParamsAccessOnetimepin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). @@ -8760,45 +8699,45 @@ type AccessIdentityProviderUpdateParamsAccessOnetimepin struct { // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderUpdateParamsAccessOnetimepinType] `json:"type,required"` + Type param.Field[AccessIdentityProviderNewParamsAccessOnetimepinType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderUpdateParamsAccessOnetimepinScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderNewParamsAccessOnetimepinScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderUpdateParamsAccessOnetimepin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderNewParamsAccessOnetimepin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderUpdateParamsAccessOnetimepin) ImplementsAccessIdentityProviderUpdateParams() { +func (AccessIdentityProviderNewParamsAccessOnetimepin) ImplementsAccessIdentityProviderNewParams() { } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderUpdateParamsAccessOnetimepinType string +type AccessIdentityProviderNewParamsAccessOnetimepinType string const ( - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeOnetimepin AccessIdentityProviderUpdateParamsAccessOnetimepinType = "onetimepin" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeAzureAd AccessIdentityProviderUpdateParamsAccessOnetimepinType = "azureAD" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeSaml AccessIdentityProviderUpdateParamsAccessOnetimepinType = "saml" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeCentrify AccessIdentityProviderUpdateParamsAccessOnetimepinType = "centrify" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeFacebook AccessIdentityProviderUpdateParamsAccessOnetimepinType = "facebook" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeGitHub AccessIdentityProviderUpdateParamsAccessOnetimepinType = "github" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeGoogleApps AccessIdentityProviderUpdateParamsAccessOnetimepinType = "google-apps" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeGoogle AccessIdentityProviderUpdateParamsAccessOnetimepinType = "google" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeLinkedin AccessIdentityProviderUpdateParamsAccessOnetimepinType = "linkedin" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeOidc AccessIdentityProviderUpdateParamsAccessOnetimepinType = "oidc" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeOkta AccessIdentityProviderUpdateParamsAccessOnetimepinType = "okta" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeOnelogin AccessIdentityProviderUpdateParamsAccessOnetimepinType = "onelogin" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypePingone AccessIdentityProviderUpdateParamsAccessOnetimepinType = "pingone" - AccessIdentityProviderUpdateParamsAccessOnetimepinTypeYandex AccessIdentityProviderUpdateParamsAccessOnetimepinType = "yandex" + AccessIdentityProviderNewParamsAccessOnetimepinTypeOnetimepin AccessIdentityProviderNewParamsAccessOnetimepinType = "onetimepin" + AccessIdentityProviderNewParamsAccessOnetimepinTypeAzureAd AccessIdentityProviderNewParamsAccessOnetimepinType = "azureAD" + AccessIdentityProviderNewParamsAccessOnetimepinTypeSaml AccessIdentityProviderNewParamsAccessOnetimepinType = "saml" + AccessIdentityProviderNewParamsAccessOnetimepinTypeCentrify AccessIdentityProviderNewParamsAccessOnetimepinType = "centrify" + AccessIdentityProviderNewParamsAccessOnetimepinTypeFacebook AccessIdentityProviderNewParamsAccessOnetimepinType = "facebook" + AccessIdentityProviderNewParamsAccessOnetimepinTypeGitHub AccessIdentityProviderNewParamsAccessOnetimepinType = "github" + AccessIdentityProviderNewParamsAccessOnetimepinTypeGoogleApps AccessIdentityProviderNewParamsAccessOnetimepinType = "google-apps" + AccessIdentityProviderNewParamsAccessOnetimepinTypeGoogle AccessIdentityProviderNewParamsAccessOnetimepinType = "google" + AccessIdentityProviderNewParamsAccessOnetimepinTypeLinkedin AccessIdentityProviderNewParamsAccessOnetimepinType = "linkedin" + AccessIdentityProviderNewParamsAccessOnetimepinTypeOidc AccessIdentityProviderNewParamsAccessOnetimepinType = "oidc" + AccessIdentityProviderNewParamsAccessOnetimepinTypeOkta AccessIdentityProviderNewParamsAccessOnetimepinType = "okta" + AccessIdentityProviderNewParamsAccessOnetimepinTypeOnelogin AccessIdentityProviderNewParamsAccessOnetimepinType = "onelogin" + AccessIdentityProviderNewParamsAccessOnetimepinTypePingone AccessIdentityProviderNewParamsAccessOnetimepinType = "pingone" + AccessIdentityProviderNewParamsAccessOnetimepinTypeYandex AccessIdentityProviderNewParamsAccessOnetimepinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderUpdateParamsAccessOnetimepinScimConfig struct { +type AccessIdentityProviderNewParamsAccessOnetimepinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -8818,79 +8757,177 @@ type AccessIdentityProviderUpdateParamsAccessOnetimepinScimConfig struct { UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderUpdateParamsAccessOnetimepinScimConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r AccessIdentityProviderNewParamsAccessOnetimepinScimConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessIdentityProviderNewResponseEnvelope struct { + Errors []AccessIdentityProviderNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessIdentityProviderNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessIdentityProviderNewResponse `json:"result,required"` + // Whether the API call was successful + Success AccessIdentityProviderNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessIdentityProviderNewResponseEnvelopeJSON `json:"-"` +} + +// accessIdentityProviderNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessIdentityProviderNewResponseEnvelope] +type accessIdentityProviderNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessIdentityProviderNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessIdentityProviderNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseEnvelopeErrors] +type accessIdentityProviderNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessIdentityProviderNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessIdentityProviderNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessIdentityProviderNewResponseEnvelopeMessages] +type accessIdentityProviderNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseEnvelope struct { - Errors []AccessIdentityProviderUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessIdentityProviderUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessIdentityProviderUpdateResponse `json:"result,required"` +// Whether the API call was successful +type AccessIdentityProviderNewResponseEnvelopeSuccess bool + +const ( + AccessIdentityProviderNewResponseEnvelopeSuccessTrue AccessIdentityProviderNewResponseEnvelopeSuccess = true +) + +type AccessIdentityProviderListResponseEnvelope struct { + Errors []AccessIdentityProviderListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessIdentityProviderListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessIdentityProviderListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessIdentityProviderUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessIdentityProviderUpdateResponseEnvelopeJSON `json:"-"` + Success AccessIdentityProviderListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessIdentityProviderListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessIdentityProviderListResponseEnvelopeJSON `json:"-"` } -// accessIdentityProviderUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [AccessIdentityProviderUpdateResponseEnvelope] -type accessIdentityProviderUpdateResponseEnvelopeJSON struct { +// accessIdentityProviderListResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessIdentityProviderListResponseEnvelope] +type accessIdentityProviderListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessIdentityProviderListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderListResponseEnvelopeErrorsJSON `json:"-"` } -// accessIdentityProviderUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseEnvelopeErrors] -type accessIdentityProviderUpdateResponseEnvelopeErrorsJSON struct { +// accessIdentityProviderListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessIdentityProviderListResponseEnvelopeErrors] +type accessIdentityProviderListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessIdentityProviderListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderListResponseEnvelopeMessagesJSON `json:"-"` } -// accessIdentityProviderUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AccessIdentityProviderUpdateResponseEnvelopeMessages] -type accessIdentityProviderUpdateResponseEnvelopeMessagesJSON struct { +// accessIdentityProviderListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseEnvelopeMessages] +type accessIdentityProviderListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessIdentityProviderUpdateResponseEnvelopeSuccess bool +type AccessIdentityProviderListResponseEnvelopeSuccess bool const ( - AccessIdentityProviderUpdateResponseEnvelopeSuccessTrue AccessIdentityProviderUpdateResponseEnvelopeSuccess = true + AccessIdentityProviderListResponseEnvelopeSuccessTrue AccessIdentityProviderListResponseEnvelopeSuccess = true ) +type AccessIdentityProviderListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessIdentityProviderListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessIdentityProviderListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AccessIdentityProviderListResponseEnvelopeResultInfo] +type accessIdentityProviderListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AccessIdentityProviderDeleteResponseEnvelope struct { Errors []AccessIdentityProviderDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessIdentityProviderDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -8960,53 +8997,122 @@ const ( AccessIdentityProviderDeleteResponseEnvelopeSuccessTrue AccessIdentityProviderDeleteResponseEnvelopeSuccess = true ) +type AccessIdentityProviderGetResponseEnvelope struct { + Errors []AccessIdentityProviderGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessIdentityProviderGetResponseEnvelopeMessages `json:"messages,required"` + Result AccessIdentityProviderGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessIdentityProviderGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessIdentityProviderGetResponseEnvelopeJSON `json:"-"` +} + +// accessIdentityProviderGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessIdentityProviderGetResponseEnvelope] +type accessIdentityProviderGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessIdentityProviderGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessIdentityProviderGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseEnvelopeErrors] +type accessIdentityProviderGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessIdentityProviderGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessIdentityProviderGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessIdentityProviderGetResponseEnvelopeMessages] +type accessIdentityProviderGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessIdentityProviderGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessIdentityProviderGetResponseEnvelopeSuccess bool + +const ( + AccessIdentityProviderGetResponseEnvelopeSuccessTrue AccessIdentityProviderGetResponseEnvelopeSuccess = true +) + // This interface is a union satisfied by one of the following: -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAd], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrify], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebook], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHub], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogle], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleApps], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedin], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidc], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOkta], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnelogin], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingone], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSaml], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandex], -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepin]. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams interface { - ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() -} - -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAd struct { +// [AccessIdentityProviderReplaceParamsAccessAzureAd], +// [AccessIdentityProviderReplaceParamsAccessCentrify], +// [AccessIdentityProviderReplaceParamsAccessFacebook], +// [AccessIdentityProviderReplaceParamsAccessGitHub], +// [AccessIdentityProviderReplaceParamsAccessGoogle], +// [AccessIdentityProviderReplaceParamsAccessGoogleApps], +// [AccessIdentityProviderReplaceParamsAccessLinkedin], +// [AccessIdentityProviderReplaceParamsAccessOidc], +// [AccessIdentityProviderReplaceParamsAccessOkta], +// [AccessIdentityProviderReplaceParamsAccessOnelogin], +// [AccessIdentityProviderReplaceParamsAccessPingone], +// [AccessIdentityProviderReplaceParamsAccessSaml], +// [AccessIdentityProviderReplaceParamsAccessYandex], +// [AccessIdentityProviderReplaceParamsAccessOnetimepin]. +type AccessIdentityProviderReplaceParams interface { + ImplementsAccessIdentityProviderReplaceParams() +} + +type AccessIdentityProviderReplaceParamsAccessAzureAd struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessAzureAdConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessAzureAdType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessAzureAdScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAd) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessAzureAd) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAd) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessAzureAd) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdConfig struct { +type AccessIdentityProviderReplaceParamsAccessAzureAdConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -9023,35 +9129,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar SupportGroups param.Field[bool] `json:"support_groups"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessAzureAdConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType string +type AccessIdentityProviderReplaceParamsAccessAzureAdType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdType = "yandex" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeOnetimepin AccessIdentityProviderReplaceParamsAccessAzureAdType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeAzureAd AccessIdentityProviderReplaceParamsAccessAzureAdType = "azureAD" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeSaml AccessIdentityProviderReplaceParamsAccessAzureAdType = "saml" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeCentrify AccessIdentityProviderReplaceParamsAccessAzureAdType = "centrify" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeFacebook AccessIdentityProviderReplaceParamsAccessAzureAdType = "facebook" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeGitHub AccessIdentityProviderReplaceParamsAccessAzureAdType = "github" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeGoogleApps AccessIdentityProviderReplaceParamsAccessAzureAdType = "google-apps" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeGoogle AccessIdentityProviderReplaceParamsAccessAzureAdType = "google" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeLinkedin AccessIdentityProviderReplaceParamsAccessAzureAdType = "linkedin" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeOidc AccessIdentityProviderReplaceParamsAccessAzureAdType = "oidc" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeOkta AccessIdentityProviderReplaceParamsAccessAzureAdType = "okta" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeOnelogin AccessIdentityProviderReplaceParamsAccessAzureAdType = "onelogin" + AccessIdentityProviderReplaceParamsAccessAzureAdTypePingone AccessIdentityProviderReplaceParamsAccessAzureAdType = "pingone" + AccessIdentityProviderReplaceParamsAccessAzureAdTypeYandex AccessIdentityProviderReplaceParamsAccessAzureAdType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessAzureAdScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9071,38 +9177,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessAzureAdScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrify struct { +type AccessIdentityProviderReplaceParamsAccessCentrify struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessCentrifyConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessCentrifyType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessCentrifyScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrify) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessCentrify) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrify) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessCentrify) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyConfig struct { +type AccessIdentityProviderReplaceParamsAccessCentrifyConfig struct { // Your centrify account url CentrifyAccount param.Field[string] `json:"centrify_account"` // Your centrify app id @@ -9117,35 +9223,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessCentrifyConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType string +type AccessIdentityProviderReplaceParamsAccessCentrifyType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyType = "yandex" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeOnetimepin AccessIdentityProviderReplaceParamsAccessCentrifyType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeAzureAd AccessIdentityProviderReplaceParamsAccessCentrifyType = "azureAD" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeSaml AccessIdentityProviderReplaceParamsAccessCentrifyType = "saml" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeCentrify AccessIdentityProviderReplaceParamsAccessCentrifyType = "centrify" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeFacebook AccessIdentityProviderReplaceParamsAccessCentrifyType = "facebook" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeGitHub AccessIdentityProviderReplaceParamsAccessCentrifyType = "github" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeGoogleApps AccessIdentityProviderReplaceParamsAccessCentrifyType = "google-apps" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeGoogle AccessIdentityProviderReplaceParamsAccessCentrifyType = "google" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeLinkedin AccessIdentityProviderReplaceParamsAccessCentrifyType = "linkedin" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeOidc AccessIdentityProviderReplaceParamsAccessCentrifyType = "oidc" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeOkta AccessIdentityProviderReplaceParamsAccessCentrifyType = "okta" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeOnelogin AccessIdentityProviderReplaceParamsAccessCentrifyType = "onelogin" + AccessIdentityProviderReplaceParamsAccessCentrifyTypePingone AccessIdentityProviderReplaceParamsAccessCentrifyType = "pingone" + AccessIdentityProviderReplaceParamsAccessCentrifyTypeYandex AccessIdentityProviderReplaceParamsAccessCentrifyType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessCentrifyScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9165,73 +9271,73 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessCentrifyScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessCentrifyScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebook struct { +type AccessIdentityProviderReplaceParamsAccessFacebook struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessFacebookConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessFacebookType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessFacebookScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebook) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessFacebook) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebook) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessFacebook) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookConfig struct { +type AccessIdentityProviderReplaceParamsAccessFacebookConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessFacebookConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType string +type AccessIdentityProviderReplaceParamsAccessFacebookType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookType = "yandex" + AccessIdentityProviderReplaceParamsAccessFacebookTypeOnetimepin AccessIdentityProviderReplaceParamsAccessFacebookType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessFacebookTypeAzureAd AccessIdentityProviderReplaceParamsAccessFacebookType = "azureAD" + AccessIdentityProviderReplaceParamsAccessFacebookTypeSaml AccessIdentityProviderReplaceParamsAccessFacebookType = "saml" + AccessIdentityProviderReplaceParamsAccessFacebookTypeCentrify AccessIdentityProviderReplaceParamsAccessFacebookType = "centrify" + AccessIdentityProviderReplaceParamsAccessFacebookTypeFacebook AccessIdentityProviderReplaceParamsAccessFacebookType = "facebook" + AccessIdentityProviderReplaceParamsAccessFacebookTypeGitHub AccessIdentityProviderReplaceParamsAccessFacebookType = "github" + AccessIdentityProviderReplaceParamsAccessFacebookTypeGoogleApps AccessIdentityProviderReplaceParamsAccessFacebookType = "google-apps" + AccessIdentityProviderReplaceParamsAccessFacebookTypeGoogle AccessIdentityProviderReplaceParamsAccessFacebookType = "google" + AccessIdentityProviderReplaceParamsAccessFacebookTypeLinkedin AccessIdentityProviderReplaceParamsAccessFacebookType = "linkedin" + AccessIdentityProviderReplaceParamsAccessFacebookTypeOidc AccessIdentityProviderReplaceParamsAccessFacebookType = "oidc" + AccessIdentityProviderReplaceParamsAccessFacebookTypeOkta AccessIdentityProviderReplaceParamsAccessFacebookType = "okta" + AccessIdentityProviderReplaceParamsAccessFacebookTypeOnelogin AccessIdentityProviderReplaceParamsAccessFacebookType = "onelogin" + AccessIdentityProviderReplaceParamsAccessFacebookTypePingone AccessIdentityProviderReplaceParamsAccessFacebookType = "pingone" + AccessIdentityProviderReplaceParamsAccessFacebookTypeYandex AccessIdentityProviderReplaceParamsAccessFacebookType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessFacebookScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9251,73 +9357,73 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessFacebookScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessFacebookScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHub struct { +type AccessIdentityProviderReplaceParamsAccessGitHub struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessGitHubConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessGitHubType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessGitHubScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHub) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGitHub) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHub) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessGitHub) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubConfig struct { +type AccessIdentityProviderReplaceParamsAccessGitHubConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGitHubConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType string +type AccessIdentityProviderReplaceParamsAccessGitHubType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubType = "yandex" + AccessIdentityProviderReplaceParamsAccessGitHubTypeOnetimepin AccessIdentityProviderReplaceParamsAccessGitHubType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessGitHubTypeAzureAd AccessIdentityProviderReplaceParamsAccessGitHubType = "azureAD" + AccessIdentityProviderReplaceParamsAccessGitHubTypeSaml AccessIdentityProviderReplaceParamsAccessGitHubType = "saml" + AccessIdentityProviderReplaceParamsAccessGitHubTypeCentrify AccessIdentityProviderReplaceParamsAccessGitHubType = "centrify" + AccessIdentityProviderReplaceParamsAccessGitHubTypeFacebook AccessIdentityProviderReplaceParamsAccessGitHubType = "facebook" + AccessIdentityProviderReplaceParamsAccessGitHubTypeGitHub AccessIdentityProviderReplaceParamsAccessGitHubType = "github" + AccessIdentityProviderReplaceParamsAccessGitHubTypeGoogleApps AccessIdentityProviderReplaceParamsAccessGitHubType = "google-apps" + AccessIdentityProviderReplaceParamsAccessGitHubTypeGoogle AccessIdentityProviderReplaceParamsAccessGitHubType = "google" + AccessIdentityProviderReplaceParamsAccessGitHubTypeLinkedin AccessIdentityProviderReplaceParamsAccessGitHubType = "linkedin" + AccessIdentityProviderReplaceParamsAccessGitHubTypeOidc AccessIdentityProviderReplaceParamsAccessGitHubType = "oidc" + AccessIdentityProviderReplaceParamsAccessGitHubTypeOkta AccessIdentityProviderReplaceParamsAccessGitHubType = "okta" + AccessIdentityProviderReplaceParamsAccessGitHubTypeOnelogin AccessIdentityProviderReplaceParamsAccessGitHubType = "onelogin" + AccessIdentityProviderReplaceParamsAccessGitHubTypePingone AccessIdentityProviderReplaceParamsAccessGitHubType = "pingone" + AccessIdentityProviderReplaceParamsAccessGitHubTypeYandex AccessIdentityProviderReplaceParamsAccessGitHubType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessGitHubScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9337,38 +9443,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGitHubScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGitHubScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogle struct { +type AccessIdentityProviderReplaceParamsAccessGoogle struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessGoogleConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessGoogleType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessGoogleScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogle) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogle) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogle) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessGoogle) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleConfig struct { +type AccessIdentityProviderReplaceParamsAccessGoogleConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -9379,35 +9485,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogleConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType string +type AccessIdentityProviderReplaceParamsAccessGoogleType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleType = "yandex" + AccessIdentityProviderReplaceParamsAccessGoogleTypeOnetimepin AccessIdentityProviderReplaceParamsAccessGoogleType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessGoogleTypeAzureAd AccessIdentityProviderReplaceParamsAccessGoogleType = "azureAD" + AccessIdentityProviderReplaceParamsAccessGoogleTypeSaml AccessIdentityProviderReplaceParamsAccessGoogleType = "saml" + AccessIdentityProviderReplaceParamsAccessGoogleTypeCentrify AccessIdentityProviderReplaceParamsAccessGoogleType = "centrify" + AccessIdentityProviderReplaceParamsAccessGoogleTypeFacebook AccessIdentityProviderReplaceParamsAccessGoogleType = "facebook" + AccessIdentityProviderReplaceParamsAccessGoogleTypeGitHub AccessIdentityProviderReplaceParamsAccessGoogleType = "github" + AccessIdentityProviderReplaceParamsAccessGoogleTypeGoogleApps AccessIdentityProviderReplaceParamsAccessGoogleType = "google-apps" + AccessIdentityProviderReplaceParamsAccessGoogleTypeGoogle AccessIdentityProviderReplaceParamsAccessGoogleType = "google" + AccessIdentityProviderReplaceParamsAccessGoogleTypeLinkedin AccessIdentityProviderReplaceParamsAccessGoogleType = "linkedin" + AccessIdentityProviderReplaceParamsAccessGoogleTypeOidc AccessIdentityProviderReplaceParamsAccessGoogleType = "oidc" + AccessIdentityProviderReplaceParamsAccessGoogleTypeOkta AccessIdentityProviderReplaceParamsAccessGoogleType = "okta" + AccessIdentityProviderReplaceParamsAccessGoogleTypeOnelogin AccessIdentityProviderReplaceParamsAccessGoogleType = "onelogin" + AccessIdentityProviderReplaceParamsAccessGoogleTypePingone AccessIdentityProviderReplaceParamsAccessGoogleType = "pingone" + AccessIdentityProviderReplaceParamsAccessGoogleTypeYandex AccessIdentityProviderReplaceParamsAccessGoogleType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessGoogleScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9427,38 +9533,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogleScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleApps struct { +type AccessIdentityProviderReplaceParamsAccessGoogleApps struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessGoogleAppsConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessGoogleAppsType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessGoogleAppsScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleApps) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogleApps) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleApps) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessGoogleApps) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsConfig struct { +type AccessIdentityProviderReplaceParamsAccessGoogleAppsConfig struct { // Your companies TLD AppsDomain param.Field[string] `json:"apps_domain"` // Custom claims @@ -9471,35 +9577,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar EmailClaimName param.Field[string] `json:"email_claim_name"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogleAppsConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType string +type AccessIdentityProviderReplaceParamsAccessGoogleAppsType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsType = "yandex" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeOnetimepin AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeAzureAd AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "azureAD" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeSaml AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "saml" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeCentrify AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "centrify" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeFacebook AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "facebook" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeGitHub AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "github" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeGoogleApps AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "google-apps" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeGoogle AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "google" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeLinkedin AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "linkedin" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeOidc AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "oidc" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeOkta AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "okta" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeOnelogin AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "onelogin" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypePingone AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "pingone" + AccessIdentityProviderReplaceParamsAccessGoogleAppsTypeYandex AccessIdentityProviderReplaceParamsAccessGoogleAppsType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessGoogleAppsScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9519,73 +9625,73 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessGoogleAppsScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessGoogleAppsScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedin struct { +type AccessIdentityProviderReplaceParamsAccessLinkedin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessLinkedinConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessLinkedinType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessLinkedinScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessLinkedin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedin) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessLinkedin) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinConfig struct { +type AccessIdentityProviderReplaceParamsAccessLinkedinConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessLinkedinConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType string +type AccessIdentityProviderReplaceParamsAccessLinkedinType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinType = "yandex" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeOnetimepin AccessIdentityProviderReplaceParamsAccessLinkedinType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeAzureAd AccessIdentityProviderReplaceParamsAccessLinkedinType = "azureAD" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeSaml AccessIdentityProviderReplaceParamsAccessLinkedinType = "saml" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeCentrify AccessIdentityProviderReplaceParamsAccessLinkedinType = "centrify" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeFacebook AccessIdentityProviderReplaceParamsAccessLinkedinType = "facebook" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeGitHub AccessIdentityProviderReplaceParamsAccessLinkedinType = "github" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeGoogleApps AccessIdentityProviderReplaceParamsAccessLinkedinType = "google-apps" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeGoogle AccessIdentityProviderReplaceParamsAccessLinkedinType = "google" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeLinkedin AccessIdentityProviderReplaceParamsAccessLinkedinType = "linkedin" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeOidc AccessIdentityProviderReplaceParamsAccessLinkedinType = "oidc" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeOkta AccessIdentityProviderReplaceParamsAccessLinkedinType = "okta" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeOnelogin AccessIdentityProviderReplaceParamsAccessLinkedinType = "onelogin" + AccessIdentityProviderReplaceParamsAccessLinkedinTypePingone AccessIdentityProviderReplaceParamsAccessLinkedinType = "pingone" + AccessIdentityProviderReplaceParamsAccessLinkedinTypeYandex AccessIdentityProviderReplaceParamsAccessLinkedinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessLinkedinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9605,38 +9711,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessLinkedinScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessLinkedinScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidc struct { +type AccessIdentityProviderReplaceParamsAccessOidc struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessOidcConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessOidcType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessOidcScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidc) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOidc) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidc) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessOidc) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcConfig struct { +type AccessIdentityProviderReplaceParamsAccessOidcConfig struct { // The authorization_endpoint URL of your IdP AuthURL param.Field[string] `json:"auth_url"` // The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens @@ -9655,35 +9761,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar TokenURL param.Field[string] `json:"token_url"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOidcConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType string +type AccessIdentityProviderReplaceParamsAccessOidcType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcType = "yandex" + AccessIdentityProviderReplaceParamsAccessOidcTypeOnetimepin AccessIdentityProviderReplaceParamsAccessOidcType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessOidcTypeAzureAd AccessIdentityProviderReplaceParamsAccessOidcType = "azureAD" + AccessIdentityProviderReplaceParamsAccessOidcTypeSaml AccessIdentityProviderReplaceParamsAccessOidcType = "saml" + AccessIdentityProviderReplaceParamsAccessOidcTypeCentrify AccessIdentityProviderReplaceParamsAccessOidcType = "centrify" + AccessIdentityProviderReplaceParamsAccessOidcTypeFacebook AccessIdentityProviderReplaceParamsAccessOidcType = "facebook" + AccessIdentityProviderReplaceParamsAccessOidcTypeGitHub AccessIdentityProviderReplaceParamsAccessOidcType = "github" + AccessIdentityProviderReplaceParamsAccessOidcTypeGoogleApps AccessIdentityProviderReplaceParamsAccessOidcType = "google-apps" + AccessIdentityProviderReplaceParamsAccessOidcTypeGoogle AccessIdentityProviderReplaceParamsAccessOidcType = "google" + AccessIdentityProviderReplaceParamsAccessOidcTypeLinkedin AccessIdentityProviderReplaceParamsAccessOidcType = "linkedin" + AccessIdentityProviderReplaceParamsAccessOidcTypeOidc AccessIdentityProviderReplaceParamsAccessOidcType = "oidc" + AccessIdentityProviderReplaceParamsAccessOidcTypeOkta AccessIdentityProviderReplaceParamsAccessOidcType = "okta" + AccessIdentityProviderReplaceParamsAccessOidcTypeOnelogin AccessIdentityProviderReplaceParamsAccessOidcType = "onelogin" + AccessIdentityProviderReplaceParamsAccessOidcTypePingone AccessIdentityProviderReplaceParamsAccessOidcType = "pingone" + AccessIdentityProviderReplaceParamsAccessOidcTypeYandex AccessIdentityProviderReplaceParamsAccessOidcType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessOidcScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9703,38 +9809,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOidcScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOidcScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOkta struct { +type AccessIdentityProviderReplaceParamsAccessOkta struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessOktaConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessOktaType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessOktaScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOkta) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOkta) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOkta) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessOkta) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaConfig struct { +type AccessIdentityProviderReplaceParamsAccessOktaConfig struct { // Your okta authorization server id AuthorizationServerID param.Field[string] `json:"authorization_server_id"` // Custom claims @@ -9749,35 +9855,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar OktaAccount param.Field[string] `json:"okta_account"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOktaConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType string +type AccessIdentityProviderReplaceParamsAccessOktaType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaType = "yandex" + AccessIdentityProviderReplaceParamsAccessOktaTypeOnetimepin AccessIdentityProviderReplaceParamsAccessOktaType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessOktaTypeAzureAd AccessIdentityProviderReplaceParamsAccessOktaType = "azureAD" + AccessIdentityProviderReplaceParamsAccessOktaTypeSaml AccessIdentityProviderReplaceParamsAccessOktaType = "saml" + AccessIdentityProviderReplaceParamsAccessOktaTypeCentrify AccessIdentityProviderReplaceParamsAccessOktaType = "centrify" + AccessIdentityProviderReplaceParamsAccessOktaTypeFacebook AccessIdentityProviderReplaceParamsAccessOktaType = "facebook" + AccessIdentityProviderReplaceParamsAccessOktaTypeGitHub AccessIdentityProviderReplaceParamsAccessOktaType = "github" + AccessIdentityProviderReplaceParamsAccessOktaTypeGoogleApps AccessIdentityProviderReplaceParamsAccessOktaType = "google-apps" + AccessIdentityProviderReplaceParamsAccessOktaTypeGoogle AccessIdentityProviderReplaceParamsAccessOktaType = "google" + AccessIdentityProviderReplaceParamsAccessOktaTypeLinkedin AccessIdentityProviderReplaceParamsAccessOktaType = "linkedin" + AccessIdentityProviderReplaceParamsAccessOktaTypeOidc AccessIdentityProviderReplaceParamsAccessOktaType = "oidc" + AccessIdentityProviderReplaceParamsAccessOktaTypeOkta AccessIdentityProviderReplaceParamsAccessOktaType = "okta" + AccessIdentityProviderReplaceParamsAccessOktaTypeOnelogin AccessIdentityProviderReplaceParamsAccessOktaType = "onelogin" + AccessIdentityProviderReplaceParamsAccessOktaTypePingone AccessIdentityProviderReplaceParamsAccessOktaType = "pingone" + AccessIdentityProviderReplaceParamsAccessOktaTypeYandex AccessIdentityProviderReplaceParamsAccessOktaType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessOktaScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9797,38 +9903,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOktaScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOktaScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnelogin struct { +type AccessIdentityProviderReplaceParamsAccessOnelogin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessOneloginConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessOneloginType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessOneloginScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnelogin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOnelogin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnelogin) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessOnelogin) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginConfig struct { +type AccessIdentityProviderReplaceParamsAccessOneloginConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -9841,35 +9947,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar OneloginAccount param.Field[string] `json:"onelogin_account"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOneloginConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType string +type AccessIdentityProviderReplaceParamsAccessOneloginType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginType = "yandex" + AccessIdentityProviderReplaceParamsAccessOneloginTypeOnetimepin AccessIdentityProviderReplaceParamsAccessOneloginType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessOneloginTypeAzureAd AccessIdentityProviderReplaceParamsAccessOneloginType = "azureAD" + AccessIdentityProviderReplaceParamsAccessOneloginTypeSaml AccessIdentityProviderReplaceParamsAccessOneloginType = "saml" + AccessIdentityProviderReplaceParamsAccessOneloginTypeCentrify AccessIdentityProviderReplaceParamsAccessOneloginType = "centrify" + AccessIdentityProviderReplaceParamsAccessOneloginTypeFacebook AccessIdentityProviderReplaceParamsAccessOneloginType = "facebook" + AccessIdentityProviderReplaceParamsAccessOneloginTypeGitHub AccessIdentityProviderReplaceParamsAccessOneloginType = "github" + AccessIdentityProviderReplaceParamsAccessOneloginTypeGoogleApps AccessIdentityProviderReplaceParamsAccessOneloginType = "google-apps" + AccessIdentityProviderReplaceParamsAccessOneloginTypeGoogle AccessIdentityProviderReplaceParamsAccessOneloginType = "google" + AccessIdentityProviderReplaceParamsAccessOneloginTypeLinkedin AccessIdentityProviderReplaceParamsAccessOneloginType = "linkedin" + AccessIdentityProviderReplaceParamsAccessOneloginTypeOidc AccessIdentityProviderReplaceParamsAccessOneloginType = "oidc" + AccessIdentityProviderReplaceParamsAccessOneloginTypeOkta AccessIdentityProviderReplaceParamsAccessOneloginType = "okta" + AccessIdentityProviderReplaceParamsAccessOneloginTypeOnelogin AccessIdentityProviderReplaceParamsAccessOneloginType = "onelogin" + AccessIdentityProviderReplaceParamsAccessOneloginTypePingone AccessIdentityProviderReplaceParamsAccessOneloginType = "pingone" + AccessIdentityProviderReplaceParamsAccessOneloginTypeYandex AccessIdentityProviderReplaceParamsAccessOneloginType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessOneloginScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9889,38 +9995,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOneloginScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOneloginScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingone struct { +type AccessIdentityProviderReplaceParamsAccessPingone struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessPingoneConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessPingoneType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessPingoneScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingone) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessPingone) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingone) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessPingone) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneConfig struct { +type AccessIdentityProviderReplaceParamsAccessPingoneConfig struct { // Custom claims Claims param.Field[[]string] `json:"claims"` // Your OAuth Client ID @@ -9933,35 +10039,35 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar PingEnvID param.Field[string] `json:"ping_env_id"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessPingoneConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType string +type AccessIdentityProviderReplaceParamsAccessPingoneType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneType = "yandex" + AccessIdentityProviderReplaceParamsAccessPingoneTypeOnetimepin AccessIdentityProviderReplaceParamsAccessPingoneType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessPingoneTypeAzureAd AccessIdentityProviderReplaceParamsAccessPingoneType = "azureAD" + AccessIdentityProviderReplaceParamsAccessPingoneTypeSaml AccessIdentityProviderReplaceParamsAccessPingoneType = "saml" + AccessIdentityProviderReplaceParamsAccessPingoneTypeCentrify AccessIdentityProviderReplaceParamsAccessPingoneType = "centrify" + AccessIdentityProviderReplaceParamsAccessPingoneTypeFacebook AccessIdentityProviderReplaceParamsAccessPingoneType = "facebook" + AccessIdentityProviderReplaceParamsAccessPingoneTypeGitHub AccessIdentityProviderReplaceParamsAccessPingoneType = "github" + AccessIdentityProviderReplaceParamsAccessPingoneTypeGoogleApps AccessIdentityProviderReplaceParamsAccessPingoneType = "google-apps" + AccessIdentityProviderReplaceParamsAccessPingoneTypeGoogle AccessIdentityProviderReplaceParamsAccessPingoneType = "google" + AccessIdentityProviderReplaceParamsAccessPingoneTypeLinkedin AccessIdentityProviderReplaceParamsAccessPingoneType = "linkedin" + AccessIdentityProviderReplaceParamsAccessPingoneTypeOidc AccessIdentityProviderReplaceParamsAccessPingoneType = "oidc" + AccessIdentityProviderReplaceParamsAccessPingoneTypeOkta AccessIdentityProviderReplaceParamsAccessPingoneType = "okta" + AccessIdentityProviderReplaceParamsAccessPingoneTypeOnelogin AccessIdentityProviderReplaceParamsAccessPingoneType = "onelogin" + AccessIdentityProviderReplaceParamsAccessPingoneTypePingone AccessIdentityProviderReplaceParamsAccessPingoneType = "pingone" + AccessIdentityProviderReplaceParamsAccessPingoneTypeYandex AccessIdentityProviderReplaceParamsAccessPingoneType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessPingoneScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -9981,38 +10087,38 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessPingoneScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessPingoneScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSaml struct { +type AccessIdentityProviderReplaceParamsAccessSaml struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessSamlConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessSamlType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessSamlScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSaml) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessSaml) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSaml) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessSaml) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfig struct { +type AccessIdentityProviderReplaceParamsAccessSamlConfig struct { // A list of SAML attribute names that will be added to your signed JWT token and // can be used in SAML policy rules. Attributes param.Field[[]string] `json:"attributes"` @@ -10020,7 +10126,7 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar EmailAttributeName param.Field[string] `json:"email_attribute_name"` // Add a list of attribute names that will be returned in the response header from // the Access callback. - HeaderAttributes param.Field[[]AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfigHeaderAttribute] `json:"header_attributes"` + HeaderAttributes param.Field[[]AccessIdentityProviderReplaceParamsAccessSamlConfigHeaderAttribute] `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response IdpPublicCerts param.Field[[]string] `json:"idp_public_certs"` // IdP Entity ID or Issuer URL @@ -10032,46 +10138,46 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar SSOTargetURL param.Field[string] `json:"sso_target_url"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessSamlConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfigHeaderAttribute struct { +type AccessIdentityProviderReplaceParamsAccessSamlConfigHeaderAttribute struct { // attribute name from the IDP AttributeName param.Field[string] `json:"attribute_name"` // header that will be added on the request to the origin HeaderName param.Field[string] `json:"header_name"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlConfigHeaderAttribute) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessSamlConfigHeaderAttribute) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType string +type AccessIdentityProviderReplaceParamsAccessSamlType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlType = "yandex" + AccessIdentityProviderReplaceParamsAccessSamlTypeOnetimepin AccessIdentityProviderReplaceParamsAccessSamlType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessSamlTypeAzureAd AccessIdentityProviderReplaceParamsAccessSamlType = "azureAD" + AccessIdentityProviderReplaceParamsAccessSamlTypeSaml AccessIdentityProviderReplaceParamsAccessSamlType = "saml" + AccessIdentityProviderReplaceParamsAccessSamlTypeCentrify AccessIdentityProviderReplaceParamsAccessSamlType = "centrify" + AccessIdentityProviderReplaceParamsAccessSamlTypeFacebook AccessIdentityProviderReplaceParamsAccessSamlType = "facebook" + AccessIdentityProviderReplaceParamsAccessSamlTypeGitHub AccessIdentityProviderReplaceParamsAccessSamlType = "github" + AccessIdentityProviderReplaceParamsAccessSamlTypeGoogleApps AccessIdentityProviderReplaceParamsAccessSamlType = "google-apps" + AccessIdentityProviderReplaceParamsAccessSamlTypeGoogle AccessIdentityProviderReplaceParamsAccessSamlType = "google" + AccessIdentityProviderReplaceParamsAccessSamlTypeLinkedin AccessIdentityProviderReplaceParamsAccessSamlType = "linkedin" + AccessIdentityProviderReplaceParamsAccessSamlTypeOidc AccessIdentityProviderReplaceParamsAccessSamlType = "oidc" + AccessIdentityProviderReplaceParamsAccessSamlTypeOkta AccessIdentityProviderReplaceParamsAccessSamlType = "okta" + AccessIdentityProviderReplaceParamsAccessSamlTypeOnelogin AccessIdentityProviderReplaceParamsAccessSamlType = "onelogin" + AccessIdentityProviderReplaceParamsAccessSamlTypePingone AccessIdentityProviderReplaceParamsAccessSamlType = "pingone" + AccessIdentityProviderReplaceParamsAccessSamlTypeYandex AccessIdentityProviderReplaceParamsAccessSamlType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessSamlScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -10091,73 +10197,73 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessSamlScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessSamlScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandex struct { +type AccessIdentityProviderReplaceParamsAccessYandex struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Config param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexConfig] `json:"config,required"` + Config param.Field[AccessIdentityProviderReplaceParamsAccessYandexConfig] `json:"config,required"` // The name of the identity provider, shown to users on the login page. Name param.Field[string] `json:"name,required"` // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessYandexType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessYandexScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandex) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessYandex) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandex) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessYandex) ImplementsAccessIdentityProviderReplaceParams() { } // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexConfig struct { +type AccessIdentityProviderReplaceParamsAccessYandexConfig struct { // Your OAuth Client ID ClientID param.Field[string] `json:"client_id"` // Your OAuth Client Secret ClientSecret param.Field[string] `json:"client_secret"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessYandexConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType string +type AccessIdentityProviderReplaceParamsAccessYandexType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexType = "yandex" + AccessIdentityProviderReplaceParamsAccessYandexTypeOnetimepin AccessIdentityProviderReplaceParamsAccessYandexType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessYandexTypeAzureAd AccessIdentityProviderReplaceParamsAccessYandexType = "azureAD" + AccessIdentityProviderReplaceParamsAccessYandexTypeSaml AccessIdentityProviderReplaceParamsAccessYandexType = "saml" + AccessIdentityProviderReplaceParamsAccessYandexTypeCentrify AccessIdentityProviderReplaceParamsAccessYandexType = "centrify" + AccessIdentityProviderReplaceParamsAccessYandexTypeFacebook AccessIdentityProviderReplaceParamsAccessYandexType = "facebook" + AccessIdentityProviderReplaceParamsAccessYandexTypeGitHub AccessIdentityProviderReplaceParamsAccessYandexType = "github" + AccessIdentityProviderReplaceParamsAccessYandexTypeGoogleApps AccessIdentityProviderReplaceParamsAccessYandexType = "google-apps" + AccessIdentityProviderReplaceParamsAccessYandexTypeGoogle AccessIdentityProviderReplaceParamsAccessYandexType = "google" + AccessIdentityProviderReplaceParamsAccessYandexTypeLinkedin AccessIdentityProviderReplaceParamsAccessYandexType = "linkedin" + AccessIdentityProviderReplaceParamsAccessYandexTypeOidc AccessIdentityProviderReplaceParamsAccessYandexType = "oidc" + AccessIdentityProviderReplaceParamsAccessYandexTypeOkta AccessIdentityProviderReplaceParamsAccessYandexType = "okta" + AccessIdentityProviderReplaceParamsAccessYandexTypeOnelogin AccessIdentityProviderReplaceParamsAccessYandexType = "onelogin" + AccessIdentityProviderReplaceParamsAccessYandexTypePingone AccessIdentityProviderReplaceParamsAccessYandexType = "pingone" + AccessIdentityProviderReplaceParamsAccessYandexTypeYandex AccessIdentityProviderReplaceParamsAccessYandexType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessYandexScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -10177,11 +10283,11 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessYandexScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessYandexScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepin struct { +type AccessIdentityProviderReplaceParamsAccessOnetimepin struct { // The configuration parameters for the identity provider. To view the required // parameters for a specific provider, refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). @@ -10191,45 +10297,45 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - Type param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType] `json:"type,required"` + Type param.Field[AccessIdentityProviderReplaceParamsAccessOnetimepinType] `json:"type,required"` // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. - ScimConfig param.Field[AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinScimConfig] `json:"scim_config"` + ScimConfig param.Field[AccessIdentityProviderReplaceParamsAccessOnetimepinScimConfig] `json:"scim_config"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepin) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOnetimepin) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepin) ImplementsAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams() { +func (AccessIdentityProviderReplaceParamsAccessOnetimepin) ImplementsAccessIdentityProviderReplaceParams() { } // The type of identity provider. To determine the value for a specific provider, // refer to our // [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType string +type AccessIdentityProviderReplaceParamsAccessOnetimepinType string const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeOnetimepin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "onetimepin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeAzureAd AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "azureAD" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeSaml AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "saml" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeCentrify AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "centrify" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeFacebook AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "facebook" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeGitHub AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "github" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeGoogleApps AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "google-apps" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeGoogle AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "google" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeLinkedin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "linkedin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeOidc AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "oidc" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeOkta AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "okta" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeOnelogin AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "onelogin" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypePingone AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "pingone" - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinTypeYandex AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinType = "yandex" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeOnetimepin AccessIdentityProviderReplaceParamsAccessOnetimepinType = "onetimepin" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeAzureAd AccessIdentityProviderReplaceParamsAccessOnetimepinType = "azureAD" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeSaml AccessIdentityProviderReplaceParamsAccessOnetimepinType = "saml" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeCentrify AccessIdentityProviderReplaceParamsAccessOnetimepinType = "centrify" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeFacebook AccessIdentityProviderReplaceParamsAccessOnetimepinType = "facebook" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeGitHub AccessIdentityProviderReplaceParamsAccessOnetimepinType = "github" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeGoogleApps AccessIdentityProviderReplaceParamsAccessOnetimepinType = "google-apps" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeGoogle AccessIdentityProviderReplaceParamsAccessOnetimepinType = "google" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeLinkedin AccessIdentityProviderReplaceParamsAccessOnetimepinType = "linkedin" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeOidc AccessIdentityProviderReplaceParamsAccessOnetimepinType = "oidc" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeOkta AccessIdentityProviderReplaceParamsAccessOnetimepinType = "okta" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeOnelogin AccessIdentityProviderReplaceParamsAccessOnetimepinType = "onelogin" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypePingone AccessIdentityProviderReplaceParamsAccessOnetimepinType = "pingone" + AccessIdentityProviderReplaceParamsAccessOnetimepinTypeYandex AccessIdentityProviderReplaceParamsAccessOnetimepinType = "yandex" ) // The configuration settings for enabling a System for Cross-Domain Identity // Management (SCIM) with the identity provider. -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinScimConfig struct { +type AccessIdentityProviderReplaceParamsAccessOnetimepinScimConfig struct { // A flag to enable or disable SCIM for the identity provider. Enabled param.Field[bool] `json:"enabled"` // A flag to revoke a user's session in Access and force a reauthentication on the @@ -10249,196 +10355,22 @@ type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderPar UserDeprovision param.Field[bool] `json:"user_deprovision"` } -func (r AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessOnetimepinScimConfig) MarshalJSON() (data []byte, err error) { +func (r AccessIdentityProviderReplaceParamsAccessOnetimepinScimConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelope struct { - Errors []AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessages `json:"messages,required"` - Result AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse `json:"result,required"` - // Whether the API call was successful - Success AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeSuccess `json:"success,required"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelope] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrors] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessages] -type accessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeSuccess bool - -const ( - AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeSuccessTrue AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponseEnvelopeSuccess = true -) - -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelope struct { - Errors []AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessages `json:"messages,required"` - Result []AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfo `json:"result_info"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelope] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrors] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessages] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeSuccess bool - -const ( - AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeSuccessTrue AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeSuccess = true -) - -type AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfoJSON `json:"-"` -} - -// accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfo] -type accessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessIdentityProviderGetResponseEnvelope struct { - Errors []AccessIdentityProviderGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessIdentityProviderGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessIdentityProviderGetResponse `json:"result,required"` +type AccessIdentityProviderReplaceResponseEnvelope struct { + Errors []AccessIdentityProviderReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessIdentityProviderReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessIdentityProviderReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessIdentityProviderGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessIdentityProviderGetResponseEnvelopeJSON `json:"-"` + Success AccessIdentityProviderReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessIdentityProviderReplaceResponseEnvelopeJSON `json:"-"` } -// accessIdentityProviderGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessIdentityProviderGetResponseEnvelope] -type accessIdentityProviderGetResponseEnvelopeJSON struct { +// accessIdentityProviderReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessIdentityProviderReplaceResponseEnvelope] +type accessIdentityProviderReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -10447,51 +10379,51 @@ type accessIdentityProviderGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderGetResponseEnvelopeErrorsJSON `json:"-"` +type AccessIdentityProviderReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessIdentityProviderGetResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseEnvelopeErrors] -type accessIdentityProviderGetResponseEnvelopeErrorsJSON struct { +// accessIdentityProviderReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseEnvelopeErrors] +type accessIdentityProviderReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessIdentityProviderGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessIdentityProviderGetResponseEnvelopeMessagesJSON `json:"-"` +type AccessIdentityProviderReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessIdentityProviderReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessIdentityProviderGetResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AccessIdentityProviderGetResponseEnvelopeMessages] -type accessIdentityProviderGetResponseEnvelopeMessagesJSON struct { +// accessIdentityProviderReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessIdentityProviderReplaceResponseEnvelopeMessages] +type accessIdentityProviderReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityProviderGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityProviderReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessIdentityProviderGetResponseEnvelopeSuccess bool +type AccessIdentityProviderReplaceResponseEnvelopeSuccess bool const ( - AccessIdentityProviderGetResponseEnvelopeSuccessTrue AccessIdentityProviderGetResponseEnvelopeSuccess = true + AccessIdentityProviderReplaceResponseEnvelopeSuccessTrue AccessIdentityProviderReplaceResponseEnvelopeSuccess = true ) diff --git a/accessidentityprovider_test.go b/accessidentityprovider_test.go index 31fa0986db0..9d2192379b9 100644 --- a/accessidentityprovider_test.go +++ b/accessidentityprovider_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessIdentityProviderUpdateWithOptionalParams(t *testing.T) { +func TestAccessIdentityProviderNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,12 @@ func TestAccessIdentityProviderUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.IdentityProviders.Update( + _, err := client.Access.IdentityProviders.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessIdentityProviderUpdateParamsAccessAzureAd{ - Config: cloudflare.F(cloudflare.AccessIdentityProviderUpdateParamsAccessAzureAdConfig{ + cloudflare.AccessIdentityProviderNewParamsAccessAzureAd{ + Config: cloudflare.F(cloudflare.AccessIdentityProviderNewParamsAccessAzureAdConfig{ ClientID: cloudflare.F(""), ClientSecret: cloudflare.F(""), Claims: cloudflare.F([]string{"email_verified", "preferred_username", "custom_claim_name"}), @@ -45,8 +44,8 @@ func TestAccessIdentityProviderUpdateWithOptionalParams(t *testing.T) { SupportGroups: cloudflare.F(true), }), Name: cloudflare.F("Widget Corps IDP"), - Type: cloudflare.F(cloudflare.AccessIdentityProviderUpdateParamsAccessAzureAdTypeOnetimepin), - ScimConfig: cloudflare.F(cloudflare.AccessIdentityProviderUpdateParamsAccessAzureAdScimConfig{ + Type: cloudflare.F(cloudflare.AccessIdentityProviderNewParamsAccessAzureAdTypeOnetimepin), + ScimConfig: cloudflare.F(cloudflare.AccessIdentityProviderNewParamsAccessAzureAdScimConfig{ Enabled: cloudflare.F(true), GroupMemberDeprovision: cloudflare.F(true), SeatDeprovision: cloudflare.F(true), @@ -64,7 +63,7 @@ func TestAccessIdentityProviderUpdateWithOptionalParams(t *testing.T) { } } -func TestAccessIdentityProviderDelete(t *testing.T) { +func TestAccessIdentityProviderList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -80,11 +79,10 @@ func TestAccessIdentityProviderDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.IdentityProviders.Delete( + _, err := client.Access.IdentityProviders.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -95,7 +93,7 @@ func TestAccessIdentityProviderDelete(t *testing.T) { } } -func TestAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderWithOptionalParams(t *testing.T) { +func TestAccessIdentityProviderDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -111,30 +109,11 @@ func TestAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProvide option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.IdentityProviders.AccessIdentityProvidersAddAnAccessIdentityProvider( + _, err := client.Access.IdentityProviders.Delete( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAd{ - Config: cloudflare.F(cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdConfig{ - ClientID: cloudflare.F(""), - ClientSecret: cloudflare.F(""), - Claims: cloudflare.F([]string{"email_verified", "preferred_username", "custom_claim_name"}), - EmailClaimName: cloudflare.F("custom_claim_name"), - ConditionalAccessEnabled: cloudflare.F(true), - DirectoryID: cloudflare.F(""), - SupportGroups: cloudflare.F(true), - }), - Name: cloudflare.F("Widget Corps IDP"), - Type: cloudflare.F(cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdTypeOnetimepin), - ScimConfig: cloudflare.F(cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParamsAccessAzureAdScimConfig{ - Enabled: cloudflare.F(true), - GroupMemberDeprovision: cloudflare.F(true), - SeatDeprovision: cloudflare.F(true), - Secret: cloudflare.F("string"), - UserDeprovision: cloudflare.F(true), - }), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -145,7 +124,7 @@ func TestAccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProvide } } -func TestAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProviders(t *testing.T) { +func TestAccessIdentityProviderGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -161,10 +140,11 @@ func TestAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvider option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.IdentityProviders.AccessIdentityProvidersListAccessIdentityProviders( + _, err := client.Access.IdentityProviders.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -175,7 +155,7 @@ func TestAccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvider } } -func TestAccessIdentityProviderGet(t *testing.T) { +func TestAccessIdentityProviderReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -191,11 +171,31 @@ func TestAccessIdentityProviderGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.IdentityProviders.Get( + _, err := client.Access.IdentityProviders.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessIdentityProviderReplaceParamsAccessAzureAd{ + Config: cloudflare.F(cloudflare.AccessIdentityProviderReplaceParamsAccessAzureAdConfig{ + ClientID: cloudflare.F(""), + ClientSecret: cloudflare.F(""), + Claims: cloudflare.F([]string{"email_verified", "preferred_username", "custom_claim_name"}), + EmailClaimName: cloudflare.F("custom_claim_name"), + ConditionalAccessEnabled: cloudflare.F(true), + DirectoryID: cloudflare.F(""), + SupportGroups: cloudflare.F(true), + }), + Name: cloudflare.F("Widget Corps IDP"), + Type: cloudflare.F(cloudflare.AccessIdentityProviderReplaceParamsAccessAzureAdTypeOnetimepin), + ScimConfig: cloudflare.F(cloudflare.AccessIdentityProviderReplaceParamsAccessAzureAdScimConfig{ + Enabled: cloudflare.F(true), + GroupMemberDeprovision: cloudflare.F(true), + SeatDeprovision: cloudflare.F(true), + Secret: cloudflare.F("string"), + UserDeprovision: cloudflare.F(true), + }), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/accesskey.go b/accesskey.go index c161ea7640e..76ad6eacdfc 100644 --- a/accesskey.go +++ b/accesskey.go @@ -23,7 +23,6 @@ import ( // service directly, and instead use the [NewAccessKeyService] method instead. type AccessKeyService struct { Options []option.RequestOption - Rotates *AccessKeyRotateService } // NewAccessKeyService generates a new service that applies the given options to @@ -32,14 +31,13 @@ type AccessKeyService struct { func NewAccessKeyService(opts ...option.RequestOption) (r *AccessKeyService) { r = &AccessKeyService{} r.Options = opts - r.Rotates = NewAccessKeyRotateService(opts...) return } // Gets the Access key rotation settings for an account. -func (r *AccessKeyService) AccessKeyConfigurationGetTheAccessKeyConfiguration(ctx context.Context, identifier string, opts ...option.RequestOption) (res *AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse, err error) { +func (r *AccessKeyService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *AccessKeyListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelope + var env AccessKeyListResponseEnvelope path := fmt.Sprintf("accounts/%s/access/keys", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -50,9 +48,9 @@ func (r *AccessKeyService) AccessKeyConfigurationGetTheAccessKeyConfiguration(ct } // Updates the Access key rotation settings for an account. -func (r *AccessKeyService) AccessKeyConfigurationUpdateTheAccessKeyConfiguration(ctx context.Context, identifier string, body AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationParams, opts ...option.RequestOption) (res *AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse, err error) { +func (r *AccessKeyService) Replace(ctx context.Context, identifier string, body AccessKeyReplaceParams, opts ...option.RequestOption) (res *AccessKeyReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelope + var env AccessKeyReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/access/keys", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -62,16 +60,27 @@ func (r *AccessKeyService) AccessKeyConfigurationUpdateTheAccessKeyConfiguration return } -// Union satisfied by -// [AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseUnknown] or -// [shared.UnionString]. -type AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse interface { - ImplementsAccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse() +// Perfoms a key rotation for an account. +func (r *AccessKeyService) Rotate(ctx context.Context, identifier string, opts ...option.RequestOption) (res *AccessKeyRotateResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessKeyRotateResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/keys/rotate", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [AccessKeyListResponseUnknown] or [shared.UnionString]. +type AccessKeyListResponse interface { + ImplementsAccessKeyListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse)(nil)).Elem(), + reflect.TypeOf((*AccessKeyListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -80,16 +89,14 @@ func init() { ) } -// Union satisfied by -// [AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseUnknown] -// or [shared.UnionString]. -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse interface { - ImplementsAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse() +// Union satisfied by [AccessKeyReplaceResponseUnknown] or [shared.UnionString]. +type AccessKeyReplaceResponse interface { + ImplementsAccessKeyReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse)(nil)).Elem(), + reflect.TypeOf((*AccessKeyReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -98,25 +105,40 @@ func init() { ) } -type AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelope struct { - Errors []AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse `json:"result,required"` +// Union satisfied by [AccessKeyRotateResponseUnknown] or [shared.UnionString]. +type AccessKeyRotateResponse interface { + ImplementsAccessKeyRotateResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AccessKeyRotateResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AccessKeyListResponseEnvelope struct { + Errors []AccessKeyListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessKeyListResponseEnvelopeMessages `json:"messages,required"` + Result AccessKeyListResponse `json:"result,required"` // Whether the API call was successful - Success AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeSuccess `json:"success,required"` + Success AccessKeyListResponseEnvelopeSuccess `json:"success,required"` // The number of days until the next key rotation. DaysUntilNextRotation float64 `json:"days_until_next_rotation"` // The number of days between key rotations. KeyRotationIntervalDays float64 `json:"key_rotation_interval_days"` // The timestamp of the previous key rotation. - LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` - JSON accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeJSON `json:"-"` + LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` + JSON accessKeyListResponseEnvelopeJSON `json:"-"` } -// accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelope] -type accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeJSON struct { +// accessKeyListResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessKeyListResponseEnvelope] +type accessKeyListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -128,85 +150,160 @@ type accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type AccessKeyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyListResponseEnvelopeErrorsJSON `json:"-"` } -// accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrors] -type accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrorsJSON struct { +// accessKeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessKeyListResponseEnvelopeErrors] +type accessKeyListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type AccessKeyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyListResponseEnvelopeMessagesJSON `json:"-"` } -// accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessages] -type accessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessagesJSON struct { +// accessKeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessKeyListResponseEnvelopeMessages] +type accessKeyListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeSuccess bool +type AccessKeyListResponseEnvelopeSuccess bool const ( - AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeSuccessTrue AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponseEnvelopeSuccess = true + AccessKeyListResponseEnvelopeSuccessTrue AccessKeyListResponseEnvelopeSuccess = true ) -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationParams struct { +type AccessKeyReplaceParams struct { // The number of days between key rotations. KeyRotationIntervalDays param.Field[float64] `json:"key_rotation_interval_days,required"` } -func (r AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationParams) MarshalJSON() (data []byte, err error) { +func (r AccessKeyReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelope struct { - Errors []AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse `json:"result,required"` +type AccessKeyReplaceResponseEnvelope struct { + Errors []AccessKeyReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessKeyReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessKeyReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success AccessKeyReplaceResponseEnvelopeSuccess `json:"success,required"` + // The number of days until the next key rotation. + DaysUntilNextRotation float64 `json:"days_until_next_rotation"` + // The number of days between key rotations. + KeyRotationIntervalDays float64 `json:"key_rotation_interval_days"` + // The timestamp of the previous key rotation. + LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` + JSON accessKeyReplaceResponseEnvelopeJSON `json:"-"` +} + +// accessKeyReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessKeyReplaceResponseEnvelope] +type accessKeyReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + DaysUntilNextRotation apijson.Field + KeyRotationIntervalDays apijson.Field + LastKeyRotationAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessKeyReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessKeyReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessKeyReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessKeyReplaceResponseEnvelopeErrors] +type accessKeyReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessKeyReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessKeyReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessKeyReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessKeyReplaceResponseEnvelopeMessages] +type accessKeyReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessKeyReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessKeyReplaceResponseEnvelopeSuccess bool + +const ( + AccessKeyReplaceResponseEnvelopeSuccessTrue AccessKeyReplaceResponseEnvelopeSuccess = true +) + +type AccessKeyRotateResponseEnvelope struct { + Errors []AccessKeyRotateResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessKeyRotateResponseEnvelopeMessages `json:"messages,required"` + Result AccessKeyRotateResponse `json:"result,required"` // Whether the API call was successful - Success AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeSuccess `json:"success,required"` + Success AccessKeyRotateResponseEnvelopeSuccess `json:"success,required"` // The number of days until the next key rotation. DaysUntilNextRotation float64 `json:"days_until_next_rotation"` // The number of days between key rotations. KeyRotationIntervalDays float64 `json:"key_rotation_interval_days"` // The timestamp of the previous key rotation. - LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` - JSON accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeJSON `json:"-"` + LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` + JSON accessKeyRotateResponseEnvelopeJSON `json:"-"` } -// accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelope] -type accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeJSON struct { +// accessKeyRotateResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessKeyRotateResponseEnvelope] +type accessKeyRotateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -218,53 +315,51 @@ type accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvel ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyRotateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type AccessKeyRotateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyRotateResponseEnvelopeErrorsJSON `json:"-"` } -// accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrors] -type accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrorsJSON struct { +// accessKeyRotateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessKeyRotateResponseEnvelopeErrors] +type accessKeyRotateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyRotateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type AccessKeyRotateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessKeyRotateResponseEnvelopeMessagesJSON `json:"-"` } -// accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessages] -type accessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessagesJSON struct { +// accessKeyRotateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessKeyRotateResponseEnvelopeMessages] +type accessKeyRotateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessKeyRotateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeSuccess bool +type AccessKeyRotateResponseEnvelopeSuccess bool const ( - AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeSuccessTrue AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponseEnvelopeSuccess = true + AccessKeyRotateResponseEnvelopeSuccessTrue AccessKeyRotateResponseEnvelopeSuccess = true ) diff --git a/accesskey_test.go b/accesskey_test.go index 4fb81a9d980..6e783c9a8ad 100644 --- a/accesskey_test.go +++ b/accesskey_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessKeyAccessKeyConfigurationGetTheAccessKeyConfiguration(t *testing.T) { +func TestAccessKeyList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAccessKeyAccessKeyConfigurationGetTheAccessKeyConfiguration(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Keys.AccessKeyConfigurationGetTheAccessKeyConfiguration(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Access.Keys.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestAccessKeyAccessKeyConfigurationGetTheAccessKeyConfiguration(t *testing. } } -func TestAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfiguration(t *testing.T) { +func TestAccessKeyReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfiguration(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Keys.AccessKeyConfigurationUpdateTheAccessKeyConfiguration( + _, err := client.Access.Keys.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationParams{ + cloudflare.AccessKeyReplaceParams{ KeyRotationIntervalDays: cloudflare.F(30.000000), }, ) @@ -70,3 +70,29 @@ func TestAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfiguration(t *testi t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestAccessKeyRotate(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Keys.Rotate(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/accesskeyrotate.go b/accesskeyrotate.go deleted file mode 100644 index 9600e36596f..00000000000 --- a/accesskeyrotate.go +++ /dev/null @@ -1,147 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "reflect" - "time" - - "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" -) - -// AccessKeyRotateService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAccessKeyRotateService] method -// instead. -type AccessKeyRotateService struct { - Options []option.RequestOption -} - -// NewAccessKeyRotateService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAccessKeyRotateService(opts ...option.RequestOption) (r *AccessKeyRotateService) { - r = &AccessKeyRotateService{} - r.Options = opts - return -} - -// Perfoms a key rotation for an account. -func (r *AccessKeyRotateService) AccessKeyConfigurationRotateAccessKeys(ctx context.Context, identifier string, opts ...option.RequestOption) (res *AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelope - path := fmt.Sprintf("accounts/%s/access/keys/rotate", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by -// [AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseUnknown] or -// [shared.UnionString]. -type AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse interface { - ImplementsAccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelope struct { - Errors []AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessages `json:"messages,required"` - Result AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse `json:"result,required"` - // Whether the API call was successful - Success AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeSuccess `json:"success,required"` - // The number of days until the next key rotation. - DaysUntilNextRotation float64 `json:"days_until_next_rotation"` - // The number of days between key rotations. - KeyRotationIntervalDays float64 `json:"key_rotation_interval_days"` - // The timestamp of the previous key rotation. - LastKeyRotationAt time.Time `json:"last_key_rotation_at" format:"date-time"` - JSON accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeJSON `json:"-"` -} - -// accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelope] -type accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - DaysUntilNextRotation apijson.Field - KeyRotationIntervalDays apijson.Field - LastKeyRotationAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrors] -type accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessages] -type accessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeSuccess bool - -const ( - AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeSuccessTrue AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponseEnvelopeSuccess = true -) diff --git a/accesslogaccessrequest.go b/accesslogaccessrequest.go index 1cd51f3b746..626d022bb60 100644 --- a/accesslogaccessrequest.go +++ b/accesslogaccessrequest.go @@ -32,9 +32,9 @@ func NewAccessLogAccessRequestService(opts ...option.RequestOption) (r *AccessLo } // Gets a list of Access authentication audit logs for an account. -func (r *AccessLogAccessRequestService) AccessAuthenticationLogsGetAccessAuthenticationLogs(ctx context.Context, identifier string, opts ...option.RequestOption) (res *[]AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse, err error) { +func (r *AccessLogAccessRequestService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *[]AccessLogAccessRequestListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelope + var env AccessLogAccessRequestListResponseEnvelope path := fmt.Sprintf("accounts/%s/access/logs/access_requests", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,7 +44,7 @@ func (r *AccessLogAccessRequestService) AccessAuthenticationLogsGetAccessAuthent return } -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse struct { +type AccessLogAccessRequestListResponse struct { // The event that occurred, such as a login attempt. Action string `json:"action"` // The result of the authentication event. @@ -61,14 +61,13 @@ type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsRe // The unique identifier for the request to Cloudflare. RayID string `json:"ray_id"` // The email address of the authenticating user. - UserEmail string `json:"user_email" format:"email"` - JSON accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseJSON `json:"-"` + UserEmail string `json:"user_email" format:"email"` + JSON accessLogAccessRequestListResponseJSON `json:"-"` } -// accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseJSON -// contains the JSON metadata for the struct -// [AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse] -type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseJSON struct { +// accessLogAccessRequestListResponseJSON contains the JSON metadata for the struct +// [AccessLogAccessRequestListResponse] +type accessLogAccessRequestListResponseJSON struct { Action apijson.Field Allowed apijson.Field AppDomain apijson.Field @@ -82,24 +81,23 @@ type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsRe ExtraFields map[string]apijson.Field } -func (r *AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessLogAccessRequestListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelope struct { - Errors []AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessages `json:"messages,required"` - Result []AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse `json:"result,required,nullable"` +type AccessLogAccessRequestListResponseEnvelope struct { + Errors []AccessLogAccessRequestListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessLogAccessRequestListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessLogAccessRequestListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfo `json:"result_info"` - JSON accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeJSON `json:"-"` + Success AccessLogAccessRequestListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessLogAccessRequestListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessLogAccessRequestListResponseEnvelopeJSON `json:"-"` } -// accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelope] -type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeJSON struct { +// accessLogAccessRequestListResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessLogAccessRequestListResponseEnvelope] +type accessLogAccessRequestListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -109,58 +107,56 @@ type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsRe ExtraFields map[string]apijson.Field } -func (r *AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessLogAccessRequestListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrorsJSON `json:"-"` +type AccessLogAccessRequestListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessLogAccessRequestListResponseEnvelopeErrorsJSON `json:"-"` } -// accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrors] -type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrorsJSON struct { +// accessLogAccessRequestListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessLogAccessRequestListResponseEnvelopeErrors] +type accessLogAccessRequestListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessLogAccessRequestListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessagesJSON `json:"-"` +type AccessLogAccessRequestListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessLogAccessRequestListResponseEnvelopeMessagesJSON `json:"-"` } -// accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessages] -type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessagesJSON struct { +// accessLogAccessRequestListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessLogAccessRequestListResponseEnvelopeMessages] +type accessLogAccessRequestListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessLogAccessRequestListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeSuccess bool +type AccessLogAccessRequestListResponseEnvelopeSuccess bool const ( - AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeSuccessTrue AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeSuccess = true + AccessLogAccessRequestListResponseEnvelopeSuccessTrue AccessLogAccessRequestListResponseEnvelopeSuccess = true ) -type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfo struct { +type AccessLogAccessRequestListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -168,14 +164,13 @@ type AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsRe // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON accessLogAccessRequestListResponseEnvelopeResultInfoJSON `json:"-"` } -// accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfo] -type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfoJSON struct { +// accessLogAccessRequestListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AccessLogAccessRequestListResponseEnvelopeResultInfo] +type accessLogAccessRequestListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -184,6 +179,6 @@ type accessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsRe ExtraFields map[string]apijson.Field } -func (r *AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessLogAccessRequestListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/accesslogaccessrequest_test.go b/accesslogaccessrequest_test.go index 03abbee2fe9..bd149a7ff4e 100644 --- a/accesslogaccessrequest_test.go +++ b/accesslogaccessrequest_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogs(t *testing.T) { +func TestAccessLogAccessRequestList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLo option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Logs.AccessRequests.AccessAuthenticationLogsGetAccessAuthenticationLogs(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Access.Logs.AccessRequests.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/accessorganization.go b/accessorganization.go index fb22e1551ae..d8638ca1c09 100644 --- a/accessorganization.go +++ b/accessorganization.go @@ -20,8 +20,7 @@ import ( // this service directly, and instead use the [NewAccessOrganizationService] method // instead. type AccessOrganizationService struct { - Options []option.RequestOption - RevokeUsers *AccessOrganizationRevokeUserService + Options []option.RequestOption } // NewAccessOrganizationService generates a new service that applies the given @@ -30,14 +29,13 @@ type AccessOrganizationService struct { func NewAccessOrganizationService(opts ...option.RequestOption) (r *AccessOrganizationService) { r = &AccessOrganizationService{} r.Options = opts - r.RevokeUsers = NewAccessOrganizationRevokeUserService(opts...) return } // Sets up a Zero Trust organization for your account or zone. -func (r *AccessOrganizationService) ZeroTrustOrganizationNewYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams, opts ...option.RequestOption) (res *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse, err error) { +func (r *AccessOrganizationService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationNewParams, opts ...option.RequestOption) (res *AccessOrganizationNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelope + var env AccessOrganizationNewResponseEnvelope path := fmt.Sprintf("%s/%s/access/organizations", accountOrZone, accountOrZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -48,9 +46,9 @@ func (r *AccessOrganizationService) ZeroTrustOrganizationNewYourZeroTrustOrganiz } // Returns the configuration for your Zero Trust organization. -func (r *AccessOrganizationService) ZeroTrustOrganizationGetYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse, err error) { +func (r *AccessOrganizationService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *AccessOrganizationListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelope + var env AccessOrganizationListResponseEnvelope path := fmt.Sprintf("%s/%s/access/organizations", accountOrZone, accountOrZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -61,9 +59,9 @@ func (r *AccessOrganizationService) ZeroTrustOrganizationGetYourZeroTrustOrganiz } // Updates the configuration for your Zero Trust organization. -func (r *AccessOrganizationService) ZeroTrustOrganizationUpdateYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParams, opts ...option.RequestOption) (res *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse, err error) { +func (r *AccessOrganizationService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationReplaceParams, opts ...option.RequestOption) (res *AccessOrganizationReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelope + var env AccessOrganizationReplaceResponseEnvelope path := fmt.Sprintf("%s/%s/access/organizations", accountOrZone, accountOrZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -73,7 +71,20 @@ func (r *AccessOrganizationService) ZeroTrustOrganizationUpdateYourZeroTrustOrga return } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse struct { +// Revokes a user's access across all applications. +func (r *AccessOrganizationService) RevokeUsers(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationRevokeUsersParams, opts ...option.RequestOption) (res *AccessOrganizationRevokeUsersResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessOrganizationRevokeUsersResponseEnvelope + path := fmt.Sprintf("%s/%s/access/organizations/revoke_user", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type AccessOrganizationNewResponse struct { // When set to true, users can authenticate via WARP for any application in your // organization. Application settings will take precedence over this value. AllowAuthenticateViaWarp bool `json:"allow_authenticate_via_warp"` @@ -81,13 +92,13 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse AuthDomain string `json:"auth_domain"` // When set to `true`, users skip the identity provider selection step during // login. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - CustomPages AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPages `json:"custom_pages"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + CustomPages AccessOrganizationNewResponseCustomPages `json:"custom_pages"` // Lock all settings as Read-Only in the Dashboard, regardless of user permission. // Updates may only be made via the API or Terraform for this account when enabled. - IsUiReadOnly bool `json:"is_ui_read_only"` - LoginDesign AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesign `json:"login_design"` + IsUiReadOnly bool `json:"is_ui_read_only"` + LoginDesign AccessOrganizationNewResponseLoginDesign `json:"login_design"` // The name of your Zero Trust organization. Name string `json:"name"` // The amount of time that tokens issued for applications will be valid. Must be in @@ -104,14 +115,13 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse UserSeatExpirationInactiveTime string `json:"user_seat_expiration_inactive_time"` // The amount of time that tokens issued for applications will be valid. Must be in // the format `30m` or `2h45m`. Valid time units are: m, h. - WarpAuthSessionDuration string `json:"warp_auth_session_duration"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseJSON `json:"-"` + WarpAuthSessionDuration string `json:"warp_auth_session_duration"` + JSON accessOrganizationNewResponseJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseJSON struct { +// accessOrganizationNewResponseJSON contains the JSON metadata for the struct +// [AccessOrganizationNewResponse] +type accessOrganizationNewResponseJSON struct { AllowAuthenticateViaWarp apijson.Field AuthDomain apijson.Field AutoRedirectToIdentity apijson.Field @@ -129,34 +139,33 @@ type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPages struct { +type AccessOrganizationNewResponseCustomPages struct { // The uid of the custom page to use when a user is denied access after failing a // non-identity rule. Forbidden string `json:"forbidden"` // The uid of the custom page to use when a user is denied access. - IdentityDenied string `json:"identity_denied"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPagesJSON `json:"-"` + IdentityDenied string `json:"identity_denied"` + JSON accessOrganizationNewResponseCustomPagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPages] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPagesJSON struct { +// accessOrganizationNewResponseCustomPagesJSON contains the JSON metadata for the +// struct [AccessOrganizationNewResponseCustomPages] +type accessOrganizationNewResponseCustomPagesJSON struct { Forbidden apijson.Field IdentityDenied apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseCustomPages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponseCustomPages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesign struct { +type AccessOrganizationNewResponseLoginDesign struct { // The background color on your login page. BackgroundColor string `json:"background_color"` // The text at the bottom of your login page. @@ -166,14 +175,13 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse // The URL of the logo on your login page. LogoPath string `json:"logo_path"` // The text color on your login page. - TextColor string `json:"text_color"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesignJSON `json:"-"` + TextColor string `json:"text_color"` + JSON accessOrganizationNewResponseLoginDesignJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesignJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesign] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesignJSON struct { +// accessOrganizationNewResponseLoginDesignJSON contains the JSON metadata for the +// struct [AccessOrganizationNewResponseLoginDesign] +type accessOrganizationNewResponseLoginDesignJSON struct { BackgroundColor apijson.Field FooterText apijson.Field HeaderText apijson.Field @@ -183,11 +191,11 @@ type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse struct { +type AccessOrganizationListResponse struct { // When set to true, users can authenticate via WARP for any application in your // organization. Application settings will take precedence over this value. AllowAuthenticateViaWarp bool `json:"allow_authenticate_via_warp"` @@ -195,13 +203,13 @@ type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse AuthDomain string `json:"auth_domain"` // When set to `true`, users skip the identity provider selection step during // login. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - CustomPages AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPages `json:"custom_pages"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + CustomPages AccessOrganizationListResponseCustomPages `json:"custom_pages"` // Lock all settings as Read-Only in the Dashboard, regardless of user permission. // Updates may only be made via the API or Terraform for this account when enabled. - IsUiReadOnly bool `json:"is_ui_read_only"` - LoginDesign AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesign `json:"login_design"` + IsUiReadOnly bool `json:"is_ui_read_only"` + LoginDesign AccessOrganizationListResponseLoginDesign `json:"login_design"` // The name of your Zero Trust organization. Name string `json:"name"` // The amount of time that tokens issued for applications will be valid. Must be in @@ -218,14 +226,13 @@ type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse UserSeatExpirationInactiveTime string `json:"user_seat_expiration_inactive_time"` // The amount of time that tokens issued for applications will be valid. Must be in // the format `30m` or `2h45m`. Valid time units are: m, h. - WarpAuthSessionDuration string `json:"warp_auth_session_duration"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseJSON `json:"-"` + WarpAuthSessionDuration string `json:"warp_auth_session_duration"` + JSON accessOrganizationListResponseJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseJSON struct { +// accessOrganizationListResponseJSON contains the JSON metadata for the struct +// [AccessOrganizationListResponse] +type accessOrganizationListResponseJSON struct { AllowAuthenticateViaWarp apijson.Field AuthDomain apijson.Field AutoRedirectToIdentity apijson.Field @@ -243,34 +250,33 @@ type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPages struct { +type AccessOrganizationListResponseCustomPages struct { // The uid of the custom page to use when a user is denied access after failing a // non-identity rule. Forbidden string `json:"forbidden"` // The uid of the custom page to use when a user is denied access. - IdentityDenied string `json:"identity_denied"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPagesJSON `json:"-"` + IdentityDenied string `json:"identity_denied"` + JSON accessOrganizationListResponseCustomPagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPages] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPagesJSON struct { +// accessOrganizationListResponseCustomPagesJSON contains the JSON metadata for the +// struct [AccessOrganizationListResponseCustomPages] +type accessOrganizationListResponseCustomPagesJSON struct { Forbidden apijson.Field IdentityDenied apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseCustomPages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponseCustomPages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesign struct { +type AccessOrganizationListResponseLoginDesign struct { // The background color on your login page. BackgroundColor string `json:"background_color"` // The text at the bottom of your login page. @@ -280,14 +286,13 @@ type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse // The URL of the logo on your login page. LogoPath string `json:"logo_path"` // The text color on your login page. - TextColor string `json:"text_color"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesignJSON `json:"-"` + TextColor string `json:"text_color"` + JSON accessOrganizationListResponseLoginDesignJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesignJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesign] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesignJSON struct { +// accessOrganizationListResponseLoginDesignJSON contains the JSON metadata for the +// struct [AccessOrganizationListResponseLoginDesign] +type accessOrganizationListResponseLoginDesignJSON struct { BackgroundColor apijson.Field FooterText apijson.Field HeaderText apijson.Field @@ -297,11 +302,11 @@ type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse struct { +type AccessOrganizationReplaceResponse struct { // When set to true, users can authenticate via WARP for any application in your // organization. Application settings will take precedence over this value. AllowAuthenticateViaWarp bool `json:"allow_authenticate_via_warp"` @@ -309,13 +314,13 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo AuthDomain string `json:"auth_domain"` // When set to `true`, users skip the identity provider selection step during // login. - AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - CustomPages AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPages `json:"custom_pages"` + AutoRedirectToIdentity bool `json:"auto_redirect_to_identity"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + CustomPages AccessOrganizationReplaceResponseCustomPages `json:"custom_pages"` // Lock all settings as Read-Only in the Dashboard, regardless of user permission. // Updates may only be made via the API or Terraform for this account when enabled. - IsUiReadOnly bool `json:"is_ui_read_only"` - LoginDesign AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesign `json:"login_design"` + IsUiReadOnly bool `json:"is_ui_read_only"` + LoginDesign AccessOrganizationReplaceResponseLoginDesign `json:"login_design"` // The name of your Zero Trust organization. Name string `json:"name"` // The amount of time that tokens issued for applications will be valid. Must be in @@ -332,14 +337,13 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo UserSeatExpirationInactiveTime string `json:"user_seat_expiration_inactive_time"` // The amount of time that tokens issued for applications will be valid. Must be in // the format `30m` or `2h45m`. Valid time units are: m, h. - WarpAuthSessionDuration string `json:"warp_auth_session_duration"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseJSON `json:"-"` + WarpAuthSessionDuration string `json:"warp_auth_session_duration"` + JSON accessOrganizationReplaceResponseJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseJSON struct { +// accessOrganizationReplaceResponseJSON contains the JSON metadata for the struct +// [AccessOrganizationReplaceResponse] +type accessOrganizationReplaceResponseJSON struct { AllowAuthenticateViaWarp apijson.Field AuthDomain apijson.Field AutoRedirectToIdentity apijson.Field @@ -357,34 +361,33 @@ type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPages struct { +type AccessOrganizationReplaceResponseCustomPages struct { // The uid of the custom page to use when a user is denied access after failing a // non-identity rule. Forbidden string `json:"forbidden"` // The uid of the custom page to use when a user is denied access. - IdentityDenied string `json:"identity_denied"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPagesJSON `json:"-"` + IdentityDenied string `json:"identity_denied"` + JSON accessOrganizationReplaceResponseCustomPagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPages] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPagesJSON struct { +// accessOrganizationReplaceResponseCustomPagesJSON contains the JSON metadata for +// the struct [AccessOrganizationReplaceResponseCustomPages] +type accessOrganizationReplaceResponseCustomPagesJSON struct { Forbidden apijson.Field IdentityDenied apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseCustomPages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponseCustomPages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesign struct { +type AccessOrganizationReplaceResponseLoginDesign struct { // The background color on your login page. BackgroundColor string `json:"background_color"` // The text at the bottom of your login page. @@ -394,14 +397,13 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo // The URL of the logo on your login page. LogoPath string `json:"logo_path"` // The text color on your login page. - TextColor string `json:"text_color"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesignJSON `json:"-"` + TextColor string `json:"text_color"` + JSON accessOrganizationReplaceResponseLoginDesignJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesignJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesign] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesignJSON struct { +// accessOrganizationReplaceResponseLoginDesignJSON contains the JSON metadata for +// the struct [AccessOrganizationReplaceResponseLoginDesign] +type accessOrganizationReplaceResponseLoginDesignJSON struct { BackgroundColor apijson.Field FooterText apijson.Field HeaderText apijson.Field @@ -411,11 +413,18 @@ type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponseLoginDesign) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams struct { +type AccessOrganizationRevokeUsersResponse bool + +const ( + AccessOrganizationRevokeUsersResponseTrue AccessOrganizationRevokeUsersResponse = true + AccessOrganizationRevokeUsersResponseFalse AccessOrganizationRevokeUsersResponse = false +) + +type AccessOrganizationNewParams struct { // The unique subdomain assigned to your Zero Trust organization. AuthDomain param.Field[string] `json:"auth_domain,required"` // The name of your Zero Trust organization. @@ -428,8 +437,8 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams s AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` // Lock all settings as Read-Only in the Dashboard, regardless of user permission. // Updates may only be made via the API or Terraform for this account when enabled. - IsUiReadOnly param.Field[bool] `json:"is_ui_read_only"` - LoginDesign param.Field[AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParamsLoginDesign] `json:"login_design"` + IsUiReadOnly param.Field[bool] `json:"is_ui_read_only"` + LoginDesign param.Field[AccessOrganizationNewParamsLoginDesign] `json:"login_design"` // The amount of time that tokens issued for applications will be valid. Must be in // the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, // h. @@ -446,11 +455,11 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams s WarpAuthSessionDuration param.Field[string] `json:"warp_auth_session_duration"` } -func (r AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams) MarshalJSON() (data []byte, err error) { +func (r AccessOrganizationNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParamsLoginDesign struct { +type AccessOrganizationNewParamsLoginDesign struct { // The background color on your login page. BackgroundColor param.Field[string] `json:"background_color"` // The text at the bottom of your login page. @@ -463,23 +472,22 @@ type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParamsLo TextColor param.Field[string] `json:"text_color"` } -func (r AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParamsLoginDesign) MarshalJSON() (data []byte, err error) { +func (r AccessOrganizationNewParamsLoginDesign) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelope struct { - Errors []AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessages `json:"messages,required"` - Result AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse `json:"result,required"` +type AccessOrganizationNewResponseEnvelope struct { + Errors []AccessOrganizationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessOrganizationNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessOrganizationNewResponse `json:"result,required"` // Whether the API call was successful - Success AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeSuccess `json:"success,required"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeJSON `json:"-"` + Success AccessOrganizationNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessOrganizationNewResponseEnvelopeJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelope] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeJSON struct { +// accessOrganizationNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessOrganizationNewResponseEnvelope] +type accessOrganizationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -488,70 +496,67 @@ type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrorsJSON `json:"-"` +type AccessOrganizationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationNewResponseEnvelopeErrorsJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrors] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrorsJSON struct { +// accessOrganizationNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessOrganizationNewResponseEnvelopeErrors] +type accessOrganizationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessagesJSON `json:"-"` +type AccessOrganizationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationNewResponseEnvelopeMessagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessages] -type accessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessagesJSON struct { +// accessOrganizationNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessOrganizationNewResponseEnvelopeMessages] +type accessOrganizationNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeSuccess bool +type AccessOrganizationNewResponseEnvelopeSuccess bool const ( - AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeSuccessTrue AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponseEnvelopeSuccess = true + AccessOrganizationNewResponseEnvelopeSuccessTrue AccessOrganizationNewResponseEnvelopeSuccess = true ) -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelope struct { - Errors []AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessages `json:"messages,required"` - Result AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse `json:"result,required"` +type AccessOrganizationListResponseEnvelope struct { + Errors []AccessOrganizationListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessOrganizationListResponseEnvelopeMessages `json:"messages,required"` + Result AccessOrganizationListResponse `json:"result,required"` // Whether the API call was successful - Success AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeSuccess `json:"success,required"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeJSON `json:"-"` + Success AccessOrganizationListResponseEnvelopeSuccess `json:"success,required"` + JSON accessOrganizationListResponseEnvelopeJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelope] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeJSON struct { +// accessOrganizationListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessOrganizationListResponseEnvelope] +type accessOrganizationListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -560,58 +565,56 @@ type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrorsJSON `json:"-"` +type AccessOrganizationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationListResponseEnvelopeErrorsJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrors] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrorsJSON struct { +// accessOrganizationListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessOrganizationListResponseEnvelopeErrors] +type accessOrganizationListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessagesJSON `json:"-"` +type AccessOrganizationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationListResponseEnvelopeMessagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessages] -type accessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessagesJSON struct { +// accessOrganizationListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessOrganizationListResponseEnvelopeMessages] +type accessOrganizationListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeSuccess bool +type AccessOrganizationListResponseEnvelopeSuccess bool const ( - AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeSuccessTrue AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponseEnvelopeSuccess = true + AccessOrganizationListResponseEnvelopeSuccessTrue AccessOrganizationListResponseEnvelopeSuccess = true ) -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParams struct { +type AccessOrganizationReplaceParams struct { // When set to true, users can authenticate via WARP for any application in your // organization. Application settings will take precedence over this value. AllowAuthenticateViaWarp param.Field[bool] `json:"allow_authenticate_via_warp"` @@ -619,12 +622,12 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParam AuthDomain param.Field[string] `json:"auth_domain"` // When set to `true`, users skip the identity provider selection step during // login. - AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` - CustomPages param.Field[AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsCustomPages] `json:"custom_pages"` + AutoRedirectToIdentity param.Field[bool] `json:"auto_redirect_to_identity"` + CustomPages param.Field[AccessOrganizationReplaceParamsCustomPages] `json:"custom_pages"` // Lock all settings as Read-Only in the Dashboard, regardless of user permission. // Updates may only be made via the API or Terraform for this account when enabled. - IsUiReadOnly param.Field[bool] `json:"is_ui_read_only"` - LoginDesign param.Field[AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsLoginDesign] `json:"login_design"` + IsUiReadOnly param.Field[bool] `json:"is_ui_read_only"` + LoginDesign param.Field[AccessOrganizationReplaceParamsLoginDesign] `json:"login_design"` // The name of your Zero Trust organization. Name param.Field[string] `json:"name"` // The amount of time that tokens issued for applications will be valid. Must be in @@ -643,11 +646,11 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParam WarpAuthSessionDuration param.Field[string] `json:"warp_auth_session_duration"` } -func (r AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParams) MarshalJSON() (data []byte, err error) { +func (r AccessOrganizationReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsCustomPages struct { +type AccessOrganizationReplaceParamsCustomPages struct { // The uid of the custom page to use when a user is denied access after failing a // non-identity rule. Forbidden param.Field[string] `json:"forbidden"` @@ -655,11 +658,11 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParam IdentityDenied param.Field[string] `json:"identity_denied"` } -func (r AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsCustomPages) MarshalJSON() (data []byte, err error) { +func (r AccessOrganizationReplaceParamsCustomPages) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsLoginDesign struct { +type AccessOrganizationReplaceParamsLoginDesign struct { // The background color on your login page. BackgroundColor param.Field[string] `json:"background_color"` // The text at the bottom of your login page. @@ -672,23 +675,22 @@ type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParam TextColor param.Field[string] `json:"text_color"` } -func (r AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsLoginDesign) MarshalJSON() (data []byte, err error) { +func (r AccessOrganizationReplaceParamsLoginDesign) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelope struct { - Errors []AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessages `json:"messages,required"` - Result AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse `json:"result,required"` +type AccessOrganizationReplaceResponseEnvelope struct { + Errors []AccessOrganizationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessOrganizationReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessOrganizationReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeSuccess `json:"success,required"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeJSON `json:"-"` + Success AccessOrganizationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessOrganizationReplaceResponseEnvelopeJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelope] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeJSON struct { +// accessOrganizationReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessOrganizationReplaceResponseEnvelope] +type accessOrganizationReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -697,53 +699,86 @@ type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationRespo ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrorsJSON `json:"-"` +type AccessOrganizationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrors] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrorsJSON struct { +// accessOrganizationReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessOrganizationReplaceResponseEnvelopeErrors] +type accessOrganizationReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessagesJSON `json:"-"` +type AccessOrganizationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessOrganizationReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessages] -type accessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessagesJSON struct { +// accessOrganizationReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessOrganizationReplaceResponseEnvelopeMessages] +type accessOrganizationReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessOrganizationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeSuccess bool +type AccessOrganizationReplaceResponseEnvelopeSuccess bool + +const ( + AccessOrganizationReplaceResponseEnvelopeSuccessTrue AccessOrganizationReplaceResponseEnvelopeSuccess = true +) + +type AccessOrganizationRevokeUsersParams struct { + // The email of the user to revoke. + Email param.Field[string] `json:"email,required"` +} + +func (r AccessOrganizationRevokeUsersParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessOrganizationRevokeUsersResponseEnvelope struct { + Result AccessOrganizationRevokeUsersResponse `json:"result"` + Success AccessOrganizationRevokeUsersResponseEnvelopeSuccess `json:"success"` + JSON accessOrganizationRevokeUsersResponseEnvelopeJSON `json:"-"` +} + +// accessOrganizationRevokeUsersResponseEnvelopeJSON contains the JSON metadata for +// the struct [AccessOrganizationRevokeUsersResponseEnvelope] +type accessOrganizationRevokeUsersResponseEnvelopeJSON struct { + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessOrganizationRevokeUsersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessOrganizationRevokeUsersResponseEnvelopeSuccess bool const ( - AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeSuccessTrue AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponseEnvelopeSuccess = true + AccessOrganizationRevokeUsersResponseEnvelopeSuccessTrue AccessOrganizationRevokeUsersResponseEnvelopeSuccess = true + AccessOrganizationRevokeUsersResponseEnvelopeSuccessFalse AccessOrganizationRevokeUsersResponseEnvelopeSuccess = false ) diff --git a/accessorganization_test.go b/accessorganization_test.go index fa53359957e..ceeaf33e6b2 100644 --- a/accessorganization_test.go +++ b/accessorganization_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationWithOptionalParams(t *testing.T) { +func TestAccessOrganizationNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,17 +29,17 @@ func TestAccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationWith option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Organizations.ZeroTrustOrganizationNewYourZeroTrustOrganization( + _, err := client.Access.Organizations.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams{ + cloudflare.AccessOrganizationNewParams{ AuthDomain: cloudflare.F("test.cloudflareaccess.com"), Name: cloudflare.F("Widget Corps Internal Applications"), AllowAuthenticateViaWarp: cloudflare.F(true), AutoRedirectToIdentity: cloudflare.F(true), IsUiReadOnly: cloudflare.F(true), - LoginDesign: cloudflare.F(cloudflare.AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParamsLoginDesign{ + LoginDesign: cloudflare.F(cloudflare.AccessOrganizationNewParamsLoginDesign{ BackgroundColor: cloudflare.F("#c5ed1b"), FooterText: cloudflare.F("This is an example description."), HeaderText: cloudflare.F("This is an example description."), @@ -61,7 +61,7 @@ func TestAccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationWith } } -func TestAccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganization(t *testing.T) { +func TestAccessOrganizationList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -77,7 +77,7 @@ func TestAccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganization(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Organizations.ZeroTrustOrganizationGetYourZeroTrustOrganization( + _, err := client.Access.Organizations.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", @@ -91,7 +91,7 @@ func TestAccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganization(t * } } -func TestAccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationWithOptionalParams(t *testing.T) { +func TestAccessOrganizationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -107,20 +107,20 @@ func TestAccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationW option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Organizations.ZeroTrustOrganizationUpdateYourZeroTrustOrganization( + _, err := client.Access.Organizations.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParams{ + cloudflare.AccessOrganizationReplaceParams{ AllowAuthenticateViaWarp: cloudflare.F(true), AuthDomain: cloudflare.F("test.cloudflareaccess.com"), AutoRedirectToIdentity: cloudflare.F(true), - CustomPages: cloudflare.F(cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsCustomPages{ + CustomPages: cloudflare.F(cloudflare.AccessOrganizationReplaceParamsCustomPages{ Forbidden: cloudflare.F("699d98642c564d2e855e9661899b7252"), IdentityDenied: cloudflare.F("699d98642c564d2e855e9661899b7252"), }), IsUiReadOnly: cloudflare.F(true), - LoginDesign: cloudflare.F(cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParamsLoginDesign{ + LoginDesign: cloudflare.F(cloudflare.AccessOrganizationReplaceParamsLoginDesign{ BackgroundColor: cloudflare.F("#c5ed1b"), FooterText: cloudflare.F("This is an example description."), HeaderText: cloudflare.F("This is an example description."), @@ -142,3 +142,36 @@ func TestAccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationW t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestAccessOrganizationRevokeUsers(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Organizations.RevokeUsers( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.AccessOrganizationRevokeUsersParams{ + Email: cloudflare.F("test@example.com"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/accessorganizationrevokeuser.go b/accessorganizationrevokeuser.go deleted file mode 100644 index fa8060f7608..00000000000 --- a/accessorganizationrevokeuser.go +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// AccessOrganizationRevokeUserService contains methods and other services that -// help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewAccessOrganizationRevokeUserService] method instead. -type AccessOrganizationRevokeUserService struct { - Options []option.RequestOption -} - -// NewAccessOrganizationRevokeUserService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewAccessOrganizationRevokeUserService(opts ...option.RequestOption) (r *AccessOrganizationRevokeUserService) { - r = &AccessOrganizationRevokeUserService{} - r.Options = opts - return -} - -// Revokes a user's access across all applications. -func (r *AccessOrganizationRevokeUserService) ZeroTrustOrganizationRevokeAllAccessTokensForAUser(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserParams, opts ...option.RequestOption) (res *AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelope - path := fmt.Sprintf("%s/%s/access/organizations/revoke_user", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse bool - -const ( - AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseTrue AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse = true - AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseFalse AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse = false -) - -type AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserParams struct { - // The email of the user to revoke. - Email param.Field[string] `json:"email,required"` -} - -func (r AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelope struct { - Result AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse `json:"result"` - Success AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccess `json:"success"` - JSON accessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeJSON `json:"-"` -} - -// accessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelope] -type accessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccess bool - -const ( - AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccessTrue AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccess = true - AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccessFalse AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponseEnvelopeSuccess = false -) diff --git a/accessorganizationrevokeuser_test.go b/accessorganizationrevokeuser_test.go deleted file mode 100644 index 2e789145537..00000000000 --- a/accessorganizationrevokeuser_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUser(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Access.Organizations.RevokeUsers.ZeroTrustOrganizationRevokeAllAccessTokensForAUser( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserParams{ - Email: cloudflare.F("test@example.com"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/accessseat.go b/accessseat.go index 2f11652e43c..5e4748792df 100644 --- a/accessseat.go +++ b/accessseat.go @@ -33,9 +33,9 @@ func NewAccessSeatService(opts ...option.RequestOption) (r *AccessSeatService) { // Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` // are set to false. -func (r *AccessSeatService) ZeroTrustSeatsUpdateAUserSeat(ctx context.Context, identifier string, body AccessSeatZeroTrustSeatsUpdateAUserSeatParams, opts ...option.RequestOption) (res *[]AccessSeatZeroTrustSeatsUpdateAUserSeatResponse, err error) { +func (r *AccessSeatService) Update(ctx context.Context, identifier string, body AccessSeatUpdateParams, opts ...option.RequestOption) (res *[]AccessSeatUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelope + var env AccessSeatUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/access/seats", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { @@ -45,21 +45,21 @@ func (r *AccessSeatService) ZeroTrustSeatsUpdateAUserSeat(ctx context.Context, i return } -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponse struct { +type AccessSeatUpdateResponse struct { // True if the seat is part of Access. AccessSeat bool `json:"access_seat"` CreatedAt time.Time `json:"created_at" format:"date-time"` // True if the seat is part of Gateway. GatewaySeat bool `json:"gateway_seat"` // Identifier - SeatUid string `json:"seat_uid"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessSeatZeroTrustSeatsUpdateAUserSeatResponseJSON `json:"-"` + SeatUid string `json:"seat_uid"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessSeatUpdateResponseJSON `json:"-"` } -// accessSeatZeroTrustSeatsUpdateAUserSeatResponseJSON contains the JSON metadata -// for the struct [AccessSeatZeroTrustSeatsUpdateAUserSeatResponse] -type accessSeatZeroTrustSeatsUpdateAUserSeatResponseJSON struct { +// accessSeatUpdateResponseJSON contains the JSON metadata for the struct +// [AccessSeatUpdateResponse] +type accessSeatUpdateResponseJSON struct { AccessSeat apijson.Field CreatedAt apijson.Field GatewaySeat apijson.Field @@ -69,43 +69,42 @@ type accessSeatZeroTrustSeatsUpdateAUserSeatResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessSeatZeroTrustSeatsUpdateAUserSeatResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessSeatUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessSeatZeroTrustSeatsUpdateAUserSeatParams struct { - Body param.Field[[]AccessSeatZeroTrustSeatsUpdateAUserSeatParamsBody] `json:"body,required"` +type AccessSeatUpdateParams struct { + Body param.Field[[]AccessSeatUpdateParamsBody] `json:"body,required"` } -func (r AccessSeatZeroTrustSeatsUpdateAUserSeatParams) MarshalJSON() (data []byte, err error) { +func (r AccessSeatUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type AccessSeatZeroTrustSeatsUpdateAUserSeatParamsBody struct { +type AccessSeatUpdateParamsBody struct { // True if the seat is part of Access. AccessSeat param.Field[bool] `json:"access_seat,required"` // True if the seat is part of Gateway. GatewaySeat param.Field[bool] `json:"gateway_seat,required"` } -func (r AccessSeatZeroTrustSeatsUpdateAUserSeatParamsBody) MarshalJSON() (data []byte, err error) { +func (r AccessSeatUpdateParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelope struct { - Errors []AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessages `json:"messages,required"` - Result []AccessSeatZeroTrustSeatsUpdateAUserSeatResponse `json:"result,required,nullable"` +type AccessSeatUpdateResponseEnvelope struct { + Errors []AccessSeatUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessSeatUpdateResponseEnvelopeMessages `json:"messages,required"` + Result []AccessSeatUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfo `json:"result_info"` - JSON accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeJSON `json:"-"` + Success AccessSeatUpdateResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessSeatUpdateResponseEnvelopeResultInfo `json:"result_info"` + JSON accessSeatUpdateResponseEnvelopeJSON `json:"-"` } -// accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelope] -type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeJSON struct { +// accessSeatUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessSeatUpdateResponseEnvelope] +type accessSeatUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -115,58 +114,56 @@ type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessSeatUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrorsJSON `json:"-"` +type AccessSeatUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessSeatUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrors] -type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrorsJSON struct { +// accessSeatUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessSeatUpdateResponseEnvelopeErrors] +type accessSeatUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessSeatUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessagesJSON `json:"-"` +type AccessSeatUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessSeatUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessages] -type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessagesJSON struct { +// accessSeatUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessSeatUpdateResponseEnvelopeMessages] +type accessSeatUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessSeatUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeSuccess bool +type AccessSeatUpdateResponseEnvelopeSuccess bool const ( - AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeSuccessTrue AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeSuccess = true + AccessSeatUpdateResponseEnvelopeSuccessTrue AccessSeatUpdateResponseEnvelopeSuccess = true ) -type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfo struct { +type AccessSeatUpdateResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -174,14 +171,13 @@ type AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON accessSeatUpdateResponseEnvelopeResultInfoJSON `json:"-"` } -// accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfo] -type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfoJSON struct { +// accessSeatUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [AccessSeatUpdateResponseEnvelopeResultInfo] +type accessSeatUpdateResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -190,6 +186,6 @@ type accessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfoJSON struc ExtraFields map[string]apijson.Field } -func (r *AccessSeatZeroTrustSeatsUpdateAUserSeatResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessSeatUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/accessseat_test.go b/accessseat_test.go index 2b0a64b7e1f..b2ce5bce2ca 100644 --- a/accessseat_test.go +++ b/accessseat_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessSeatZeroTrustSeatsUpdateAUserSeat(t *testing.T) { +func TestAccessSeatUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestAccessSeatZeroTrustSeatsUpdateAUserSeat(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Seats.ZeroTrustSeatsUpdateAUserSeat( + _, err := client.Access.Seats.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessSeatZeroTrustSeatsUpdateAUserSeatParams{ - Body: cloudflare.F([]cloudflare.AccessSeatZeroTrustSeatsUpdateAUserSeatParamsBody{{ + cloudflare.AccessSeatUpdateParams{ + Body: cloudflare.F([]cloudflare.AccessSeatUpdateParamsBody{{ AccessSeat: cloudflare.F(false), GatewaySeat: cloudflare.F(false), }, { diff --git a/accessservicetoken.go b/accessservicetoken.go index d27e7f3acc2..0f7ee69ab18 100644 --- a/accessservicetoken.go +++ b/accessservicetoken.go @@ -20,9 +20,7 @@ import ( // this service directly, and instead use the [NewAccessServiceTokenService] method // instead. type AccessServiceTokenService struct { - Options []option.RequestOption - Refreshes *AccessServiceTokenRefreshService - Rotates *AccessServiceTokenRotateService + Options []option.RequestOption } // NewAccessServiceTokenService generates a new service that applies the given @@ -31,17 +29,30 @@ type AccessServiceTokenService struct { func NewAccessServiceTokenService(opts ...option.RequestOption) (r *AccessServiceTokenService) { r = &AccessServiceTokenService{} r.Options = opts - r.Refreshes = NewAccessServiceTokenRefreshService(opts...) - r.Rotates = NewAccessServiceTokenRotateService(opts...) return } -// Updates a configured service token. -func (r *AccessServiceTokenService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessServiceTokenUpdateParams, opts ...option.RequestOption) (res *AccessServiceTokenUpdateResponse, err error) { +// Generates a new service token. **Note:** This is the only time you can get the +// Client Secret. If you lose the Client Secret, you will have to rotate the Client +// Secret or create a new service token. +func (r *AccessServiceTokenService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessServiceTokenNewParams, opts ...option.RequestOption) (res *AccessServiceTokenNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessServiceTokenUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/access/service_tokens/%s", accountOrZone, accountOrZoneID, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AccessServiceTokenNewResponseEnvelope + path := fmt.Sprintf("%s/%s/access/service_tokens", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists all service tokens. +func (r *AccessServiceTokenService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessServiceTokenListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessServiceTokenListResponseEnvelope + path := fmt.Sprintf("%s/%s/access/service_tokens", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -62,14 +73,12 @@ func (r *AccessServiceTokenService) Delete(ctx context.Context, accountOrZone st return } -// Generates a new service token. **Note:** This is the only time you can get the -// Client Secret. If you lose the Client Secret, you will have to rotate the Client -// Secret or create a new service token. -func (r *AccessServiceTokenService) AccessServiceTokensNewAServiceToken(ctx context.Context, accountOrZone string, accountOrZoneID string, body AccessServiceTokenAccessServiceTokensNewAServiceTokenParams, opts ...option.RequestOption) (res *AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse, err error) { +// Refreshes the expiration of a service token. +func (r *AccessServiceTokenService) Refresh(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *AccessServiceTokenRefreshResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelope - path := fmt.Sprintf("%s/%s/access/service_tokens", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AccessServiceTokenRefreshResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/service_tokens/%s/refresh", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -77,12 +86,12 @@ func (r *AccessServiceTokenService) AccessServiceTokensNewAServiceToken(ctx cont return } -// Lists all service tokens. -func (r *AccessServiceTokenService) AccessServiceTokensListServiceTokens(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]AccessServiceTokenAccessServiceTokensListServiceTokensResponse, err error) { +// Updates a configured service token. +func (r *AccessServiceTokenService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body AccessServiceTokenReplaceParams, opts ...option.RequestOption) (res *AccessServiceTokenReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelope - path := fmt.Sprintf("%s/%s/access/service_tokens", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env AccessServiceTokenReplaceResponseEnvelope + path := fmt.Sprintf("%s/%s/access/service_tokens/%s", accountOrZone, accountOrZoneID, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -90,7 +99,58 @@ func (r *AccessServiceTokenService) AccessServiceTokensListServiceTokens(ctx con return } -type AccessServiceTokenUpdateResponse struct { +// Generates a new Client Secret for a service token and revokes the old one. +func (r *AccessServiceTokenService) Rotate(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *AccessServiceTokenRotateResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessServiceTokenRotateResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/service_tokens/%s/rotate", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type AccessServiceTokenNewResponse struct { + // The ID of the service token. + ID interface{} `json:"id"` + // The Client ID for the service token. Access will check for this value in the + // `CF-Access-Client-ID` request header. + ClientID string `json:"client_id"` + // The Client Secret for the service token. Access will check for this value in the + // `CF-Access-Client-Secret` request header. + ClientSecret string `json:"client_secret"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The duration for how long the service token will be valid. Must be in the format + // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The + // default is 1 year in hours (8760h). + Duration string `json:"duration"` + // The name of the service token. + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessServiceTokenNewResponseJSON `json:"-"` +} + +// accessServiceTokenNewResponseJSON contains the JSON metadata for the struct +// [AccessServiceTokenNewResponse] +type accessServiceTokenNewResponseJSON struct { + ID apijson.Field + ClientID apijson.Field + ClientSecret apijson.Field + CreatedAt apijson.Field + Duration apijson.Field + Name apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessServiceTokenListResponse struct { // The ID of the service token. ID interface{} `json:"id"` // The Client ID for the service token. Access will check for this value in the @@ -102,14 +162,14 @@ type AccessServiceTokenUpdateResponse struct { // default is 1 year in hours (8760h). Duration string `json:"duration"` // The name of the service token. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessServiceTokenUpdateResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessServiceTokenListResponseJSON `json:"-"` } -// accessServiceTokenUpdateResponseJSON contains the JSON metadata for the struct -// [AccessServiceTokenUpdateResponse] -type accessServiceTokenUpdateResponseJSON struct { +// accessServiceTokenListResponseJSON contains the JSON metadata for the struct +// [AccessServiceTokenListResponse] +type accessServiceTokenListResponseJSON struct { ID apijson.Field ClientID apijson.Field CreatedAt apijson.Field @@ -120,7 +180,7 @@ type accessServiceTokenUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -158,46 +218,41 @@ func (r *AccessServiceTokenDeleteResponse) UnmarshalJSON(data []byte) (err error return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse struct { +type AccessServiceTokenRefreshResponse struct { // The ID of the service token. ID interface{} `json:"id"` // The Client ID for the service token. Access will check for this value in the // `CF-Access-Client-ID` request header. - ClientID string `json:"client_id"` - // The Client Secret for the service token. Access will check for this value in the - // `CF-Access-Client-Secret` request header. - ClientSecret string `json:"client_secret"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + ClientID string `json:"client_id"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The duration for how long the service token will be valid. Must be in the format // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The // default is 1 year in hours (8760h). Duration string `json:"duration"` // The name of the service token. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessServiceTokenAccessServiceTokensNewAServiceTokenResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessServiceTokenRefreshResponseJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensNewAServiceTokenResponseJSON contains the -// JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse] -type accessServiceTokenAccessServiceTokensNewAServiceTokenResponseJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientSecret apijson.Field - CreatedAt apijson.Field - Duration apijson.Field - Name apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field +// accessServiceTokenRefreshResponseJSON contains the JSON metadata for the struct +// [AccessServiceTokenRefreshResponse] +type accessServiceTokenRefreshResponseJSON struct { + ID apijson.Field + ClientID apijson.Field + CreatedAt apijson.Field + Duration apijson.Field + Name apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenRefreshResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensListServiceTokensResponse struct { +type AccessServiceTokenReplaceResponse struct { // The ID of the service token. ID interface{} `json:"id"` // The Client ID for the service token. Access will check for this value in the @@ -209,15 +264,14 @@ type AccessServiceTokenAccessServiceTokensListServiceTokensResponse struct { // default is 1 year in hours (8760h). Duration string `json:"duration"` // The name of the service token. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessServiceTokenAccessServiceTokensListServiceTokensResponseJSON `json:"-"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessServiceTokenReplaceResponseJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensListServiceTokensResponseJSON contains the -// JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensListServiceTokensResponse] -type accessServiceTokenAccessServiceTokensListServiceTokensResponseJSON struct { +// accessServiceTokenReplaceResponseJSON contains the JSON metadata for the struct +// [AccessServiceTokenReplaceResponse] +type accessServiceTokenReplaceResponseJSON struct { ID apijson.Field ClientID apijson.Field CreatedAt apijson.Field @@ -228,35 +282,73 @@ type accessServiceTokenAccessServiceTokensListServiceTokensResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensListServiceTokensResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenUpdateParams struct { +type AccessServiceTokenRotateResponse struct { + // The ID of the service token. + ID interface{} `json:"id"` + // The Client ID for the service token. Access will check for this value in the + // `CF-Access-Client-ID` request header. + ClientID string `json:"client_id"` + // The Client Secret for the service token. Access will check for this value in the + // `CF-Access-Client-Secret` request header. + ClientSecret string `json:"client_secret"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // The duration for how long the service token will be valid. Must be in the format // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The // default is 1 year in hours (8760h). - Duration param.Field[string] `json:"duration"` + Duration string `json:"duration"` // The name of the service token. - Name param.Field[string] `json:"name"` + Name string `json:"name"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessServiceTokenRotateResponseJSON `json:"-"` } -func (r AccessServiceTokenUpdateParams) MarshalJSON() (data []byte, err error) { +// accessServiceTokenRotateResponseJSON contains the JSON metadata for the struct +// [AccessServiceTokenRotateResponse] +type accessServiceTokenRotateResponseJSON struct { + ID apijson.Field + ClientID apijson.Field + ClientSecret apijson.Field + CreatedAt apijson.Field + Duration apijson.Field + Name apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenRotateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessServiceTokenNewParams struct { + // The name of the service token. + Name param.Field[string] `json:"name,required"` + // The duration for how long the service token will be valid. Must be in the format + // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The + // default is 1 year in hours (8760h). + Duration param.Field[string] `json:"duration"` +} + +func (r AccessServiceTokenNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccessServiceTokenUpdateResponseEnvelope struct { - Errors []AccessServiceTokenUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessServiceTokenUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccessServiceTokenUpdateResponse `json:"result,required"` +type AccessServiceTokenNewResponseEnvelope struct { + Errors []AccessServiceTokenNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessServiceTokenNewResponseEnvelopeMessages `json:"messages,required"` + Result AccessServiceTokenNewResponse `json:"result,required"` // Whether the API call was successful - Success AccessServiceTokenUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accessServiceTokenUpdateResponseEnvelopeJSON `json:"-"` + Success AccessServiceTokenNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessServiceTokenNewResponseEnvelopeJSON `json:"-"` } -// accessServiceTokenUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccessServiceTokenUpdateResponseEnvelope] -type accessServiceTokenUpdateResponseEnvelopeJSON struct { +// accessServiceTokenNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessServiceTokenNewResponseEnvelope] +type accessServiceTokenNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -265,55 +357,153 @@ type accessServiceTokenUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccessServiceTokenNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenNewResponseEnvelopeErrorsJSON `json:"-"` } -// accessServiceTokenUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AccessServiceTokenUpdateResponseEnvelopeErrors] -type accessServiceTokenUpdateResponseEnvelopeErrorsJSON struct { +// accessServiceTokenNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessServiceTokenNewResponseEnvelopeErrors] +type accessServiceTokenNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccessServiceTokenNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenNewResponseEnvelopeMessagesJSON `json:"-"` } -// accessServiceTokenUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AccessServiceTokenUpdateResponseEnvelopeMessages] -type accessServiceTokenUpdateResponseEnvelopeMessagesJSON struct { +// accessServiceTokenNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccessServiceTokenNewResponseEnvelopeMessages] +type accessServiceTokenNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessServiceTokenUpdateResponseEnvelopeSuccess bool +type AccessServiceTokenNewResponseEnvelopeSuccess bool const ( - AccessServiceTokenUpdateResponseEnvelopeSuccessTrue AccessServiceTokenUpdateResponseEnvelopeSuccess = true + AccessServiceTokenNewResponseEnvelopeSuccessTrue AccessServiceTokenNewResponseEnvelopeSuccess = true ) +type AccessServiceTokenListResponseEnvelope struct { + Errors []AccessServiceTokenListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessServiceTokenListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessServiceTokenListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AccessServiceTokenListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessServiceTokenListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessServiceTokenListResponseEnvelopeJSON `json:"-"` +} + +// accessServiceTokenListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessServiceTokenListResponseEnvelope] +type accessServiceTokenListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessServiceTokenListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenListResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessServiceTokenListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccessServiceTokenListResponseEnvelopeErrors] +type accessServiceTokenListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessServiceTokenListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenListResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessServiceTokenListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessServiceTokenListResponseEnvelopeMessages] +type accessServiceTokenListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessServiceTokenListResponseEnvelopeSuccess bool + +const ( + AccessServiceTokenListResponseEnvelopeSuccessTrue AccessServiceTokenListResponseEnvelopeSuccess = true +) + +type AccessServiceTokenListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON accessServiceTokenListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// accessServiceTokenListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AccessServiceTokenListResponseEnvelopeResultInfo] +type accessServiceTokenListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AccessServiceTokenDeleteResponseEnvelope struct { Errors []AccessServiceTokenDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessServiceTokenDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -383,32 +573,18 @@ const ( AccessServiceTokenDeleteResponseEnvelopeSuccessTrue AccessServiceTokenDeleteResponseEnvelopeSuccess = true ) -type AccessServiceTokenAccessServiceTokensNewAServiceTokenParams struct { - // The name of the service token. - Name param.Field[string] `json:"name,required"` - // The duration for how long the service token will be valid. Must be in the format - // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - // default is 1 year in hours (8760h). - Duration param.Field[string] `json:"duration"` -} - -func (r AccessServiceTokenAccessServiceTokensNewAServiceTokenParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelope struct { - Errors []AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessages `json:"messages,required"` - Result AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse `json:"result,required"` +type AccessServiceTokenRefreshResponseEnvelope struct { + Errors []AccessServiceTokenRefreshResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessServiceTokenRefreshResponseEnvelopeMessages `json:"messages,required"` + Result AccessServiceTokenRefreshResponse `json:"result,required"` // Whether the API call was successful - Success AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeSuccess `json:"success,required"` - JSON accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeJSON `json:"-"` + Success AccessServiceTokenRefreshResponseEnvelopeSuccess `json:"success,required"` + JSON accessServiceTokenRefreshResponseEnvelopeJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelope] -type accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeJSON struct { +// accessServiceTokenRefreshResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessServiceTokenRefreshResponseEnvelope] +type accessServiceTokenRefreshResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -417,155 +593,202 @@ type accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeJSON s ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenRefreshResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrorsJSON `json:"-"` +type AccessServiceTokenRefreshResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenRefreshResponseEnvelopeErrorsJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrors] -type accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrorsJSON struct { +// accessServiceTokenRefreshResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessServiceTokenRefreshResponseEnvelopeErrors] +type accessServiceTokenRefreshResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenRefreshResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessagesJSON `json:"-"` +type AccessServiceTokenRefreshResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenRefreshResponseEnvelopeMessagesJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessages] -type accessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessagesJSON struct { +// accessServiceTokenRefreshResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessServiceTokenRefreshResponseEnvelopeMessages] +type accessServiceTokenRefreshResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenRefreshResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeSuccess bool +type AccessServiceTokenRefreshResponseEnvelopeSuccess bool const ( - AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeSuccessTrue AccessServiceTokenAccessServiceTokensNewAServiceTokenResponseEnvelopeSuccess = true + AccessServiceTokenRefreshResponseEnvelopeSuccessTrue AccessServiceTokenRefreshResponseEnvelopeSuccess = true ) -type AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelope struct { - Errors []AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessages `json:"messages,required"` - Result []AccessServiceTokenAccessServiceTokensListServiceTokensResponse `json:"result,required,nullable"` +type AccessServiceTokenReplaceParams struct { + // The duration for how long the service token will be valid. Must be in the format + // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The + // default is 1 year in hours (8760h). + Duration param.Field[string] `json:"duration"` + // The name of the service token. + Name param.Field[string] `json:"name"` +} + +func (r AccessServiceTokenReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessServiceTokenReplaceResponseEnvelope struct { + Errors []AccessServiceTokenReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessServiceTokenReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccessServiceTokenReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfo `json:"result_info"` - JSON accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeJSON `json:"-"` + Success AccessServiceTokenReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessServiceTokenReplaceResponseEnvelopeJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelope] -type accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeJSON struct { +// accessServiceTokenReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessServiceTokenReplaceResponseEnvelope] +type accessServiceTokenReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrorsJSON `json:"-"` +type AccessServiceTokenReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrors] -type accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrorsJSON struct { +// accessServiceTokenReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessServiceTokenReplaceResponseEnvelopeErrors] +type accessServiceTokenReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessagesJSON `json:"-"` +type AccessServiceTokenReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessages] -type accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessagesJSON struct { +// accessServiceTokenReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessServiceTokenReplaceResponseEnvelopeMessages] +type accessServiceTokenReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeSuccess bool +type AccessServiceTokenReplaceResponseEnvelopeSuccess bool const ( - AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeSuccessTrue AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeSuccess = true + AccessServiceTokenReplaceResponseEnvelopeSuccessTrue AccessServiceTokenReplaceResponseEnvelopeSuccess = true ) -type AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfoJSON `json:"-"` +type AccessServiceTokenRotateResponseEnvelope struct { + Errors []AccessServiceTokenRotateResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessServiceTokenRotateResponseEnvelopeMessages `json:"messages,required"` + Result AccessServiceTokenRotateResponse `json:"result,required"` + // Whether the API call was successful + Success AccessServiceTokenRotateResponseEnvelopeSuccess `json:"success,required"` + JSON accessServiceTokenRotateResponseEnvelopeJSON `json:"-"` } -// accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfo] -type accessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field +// accessServiceTokenRotateResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessServiceTokenRotateResponseEnvelope] +type accessServiceTokenRotateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessServiceTokenAccessServiceTokensListServiceTokensResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessServiceTokenRotateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type AccessServiceTokenRotateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenRotateResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessServiceTokenRotateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessServiceTokenRotateResponseEnvelopeErrors] +type accessServiceTokenRotateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenRotateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessServiceTokenRotateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessServiceTokenRotateResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessServiceTokenRotateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessServiceTokenRotateResponseEnvelopeMessages] +type accessServiceTokenRotateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessServiceTokenRotateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessServiceTokenRotateResponseEnvelopeSuccess bool + +const ( + AccessServiceTokenRotateResponseEnvelopeSuccessTrue AccessServiceTokenRotateResponseEnvelopeSuccess = true +) diff --git a/accessservicetoken_test.go b/accessservicetoken_test.go index fb90c90193a..7b6b6c86534 100644 --- a/accessservicetoken_test.go +++ b/accessservicetoken_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessServiceTokenUpdateWithOptionalParams(t *testing.T) { +func TestAccessServiceTokenNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,13 @@ func TestAccessServiceTokenUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.ServiceTokens.Update( + _, err := client.Access.ServiceTokens.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.AccessServiceTokenUpdateParams{ - Duration: cloudflare.F("60m"), + cloudflare.AccessServiceTokenNewParams{ Name: cloudflare.F("CI/CD token"), + Duration: cloudflare.F("60m"), }, ) if err != nil { @@ -48,6 +47,36 @@ func TestAccessServiceTokenUpdateWithOptionalParams(t *testing.T) { } } +func TestAccessServiceTokenList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.ServiceTokens.List( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestAccessServiceTokenDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -79,7 +108,37 @@ func TestAccessServiceTokenDelete(t *testing.T) { } } -func TestAccessServiceTokenAccessServiceTokensNewAServiceTokenWithOptionalParams(t *testing.T) { +func TestAccessServiceTokenRefresh(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.ServiceTokens.Refresh( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessServiceTokenReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -95,13 +154,14 @@ func TestAccessServiceTokenAccessServiceTokensNewAServiceTokenWithOptionalParams option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.ServiceTokens.AccessServiceTokensNewAServiceToken( + _, err := client.Access.ServiceTokens.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AccessServiceTokenAccessServiceTokensNewAServiceTokenParams{ - Name: cloudflare.F("CI/CD token"), + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.AccessServiceTokenReplaceParams{ Duration: cloudflare.F("60m"), + Name: cloudflare.F("CI/CD token"), }, ) if err != nil { @@ -113,7 +173,7 @@ func TestAccessServiceTokenAccessServiceTokensNewAServiceTokenWithOptionalParams } } -func TestAccessServiceTokenAccessServiceTokensListServiceTokens(t *testing.T) { +func TestAccessServiceTokenRotate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -129,10 +189,10 @@ func TestAccessServiceTokenAccessServiceTokensListServiceTokens(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.ServiceTokens.AccessServiceTokensListServiceTokens( + _, err := client.Access.ServiceTokens.Rotate( context.TODO(), - "string", "023e105f4ecef8ad9ca31a8372d0c353", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error diff --git a/accessservicetokenrefresh.go b/accessservicetokenrefresh.go deleted file mode 100644 index 24f78c83f3e..00000000000 --- a/accessservicetokenrefresh.go +++ /dev/null @@ -1,152 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// AccessServiceTokenRefreshService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewAccessServiceTokenRefreshService] method instead. -type AccessServiceTokenRefreshService struct { - Options []option.RequestOption -} - -// NewAccessServiceTokenRefreshService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewAccessServiceTokenRefreshService(opts ...option.RequestOption) (r *AccessServiceTokenRefreshService) { - r = &AccessServiceTokenRefreshService{} - r.Options = opts - return -} - -// Refreshes the expiration of a service token. -func (r *AccessServiceTokenRefreshService) AccessServiceTokensRefreshAServiceToken(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelope - path := fmt.Sprintf("accounts/%s/access/service_tokens/%s/refresh", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse struct { - // The ID of the service token. - ID interface{} `json:"id"` - // The Client ID for the service token. Access will check for this value in the - // `CF-Access-Client-ID` request header. - ClientID string `json:"client_id"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The duration for how long the service token will be valid. Must be in the format - // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - // default is 1 year in hours (8760h). - Duration string `json:"duration"` - // The name of the service token. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseJSON `json:"-"` -} - -// accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse] -type accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseJSON struct { - ID apijson.Field - ClientID apijson.Field - CreatedAt apijson.Field - Duration apijson.Field - Name apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelope struct { - Errors []AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessages `json:"messages,required"` - Result AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse `json:"result,required"` - // Whether the API call was successful - Success AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeSuccess `json:"success,required"` - JSON accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeJSON `json:"-"` -} - -// accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelope] -type accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrors] -type accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessages] -type accessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeSuccess bool - -const ( - AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeSuccessTrue AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponseEnvelopeSuccess = true -) diff --git a/accessservicetokenrotate.go b/accessservicetokenrotate.go deleted file mode 100644 index 005caf03c79..00000000000 --- a/accessservicetokenrotate.go +++ /dev/null @@ -1,156 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// AccessServiceTokenRotateService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewAccessServiceTokenRotateService] method instead. -type AccessServiceTokenRotateService struct { - Options []option.RequestOption -} - -// NewAccessServiceTokenRotateService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewAccessServiceTokenRotateService(opts ...option.RequestOption) (r *AccessServiceTokenRotateService) { - r = &AccessServiceTokenRotateService{} - r.Options = opts - return -} - -// Generates a new Client Secret for a service token and revokes the old one. -func (r *AccessServiceTokenRotateService) AccessServiceTokensRotateAServiceToken(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelope - path := fmt.Sprintf("accounts/%s/access/service_tokens/%s/rotate", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse struct { - // The ID of the service token. - ID interface{} `json:"id"` - // The Client ID for the service token. Access will check for this value in the - // `CF-Access-Client-ID` request header. - ClientID string `json:"client_id"` - // The Client Secret for the service token. Access will check for this value in the - // `CF-Access-Client-Secret` request header. - ClientSecret string `json:"client_secret"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The duration for how long the service token will be valid. Must be in the format - // `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - // default is 1 year in hours (8760h). - Duration string `json:"duration"` - // The name of the service token. - Name string `json:"name"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseJSON `json:"-"` -} - -// accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse] -type accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientSecret apijson.Field - CreatedAt apijson.Field - Duration apijson.Field - Name apijson.Field - UpdatedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelope struct { - Errors []AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessages `json:"messages,required"` - Result AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse `json:"result,required"` - // Whether the API call was successful - Success AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeSuccess `json:"success,required"` - JSON accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeJSON `json:"-"` -} - -// accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelope] -type accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrorsJSON `json:"-"` -} - -// accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrors] -type accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessagesJSON `json:"-"` -} - -// accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessages] -type accessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeSuccess bool - -const ( - AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeSuccessTrue AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponseEnvelopeSuccess = true -) diff --git a/accesstag.go b/accesstag.go index ac3be26e518..10653a3adfe 100644 --- a/accesstag.go +++ b/accesstag.go @@ -9,6 +9,7 @@ import ( "time" "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/option" ) @@ -30,6 +31,19 @@ func NewAccessTagService(opts ...option.RequestOption) (r *AccessTagService) { return } +// Create a tag +func (r *AccessTagService) New(ctx context.Context, identifier string, body AccessTagNewParams, opts ...option.RequestOption) (res *AccessTagNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessTagNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/tags", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // List tags func (r *AccessTagService) List(ctx context.Context, identifier string, opts ...option.RequestOption) (res *[]AccessTagListResponse, err error) { opts = append(r.Options[:], opts...) @@ -43,6 +57,71 @@ func (r *AccessTagService) List(ctx context.Context, identifier string, opts ... return } +// Delete a tag +func (r *AccessTagService) Delete(ctx context.Context, identifier string, name string, opts ...option.RequestOption) (res *AccessTagDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessTagDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/tags/%s", identifier, name) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Get a tag +func (r *AccessTagService) Get(ctx context.Context, identifier string, name string, opts ...option.RequestOption) (res *AccessTagGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessTagGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/tags/%s", identifier, name) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Update a tag +func (r *AccessTagService) Replace(ctx context.Context, identifier string, tagName string, body AccessTagReplaceParams, opts ...option.RequestOption) (res *AccessTagReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccessTagReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/access/tags/%s", identifier, tagName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// A tag +type AccessTagNewResponse struct { + // The name of the tag + Name string `json:"name,required"` + // The number of applications that have this tag + AppCount int64 `json:"app_count"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessTagNewResponseJSON `json:"-"` +} + +// accessTagNewResponseJSON contains the JSON metadata for the struct +// [AccessTagNewResponse] +type accessTagNewResponseJSON struct { + Name apijson.Field + AppCount apijson.Field + CreatedAt apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // A tag type AccessTagListResponse struct { // The name of the tag @@ -69,6 +148,155 @@ func (r *AccessTagListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type AccessTagDeleteResponse struct { + // The name of the tag + Name string `json:"name"` + JSON accessTagDeleteResponseJSON `json:"-"` +} + +// accessTagDeleteResponseJSON contains the JSON metadata for the struct +// [AccessTagDeleteResponse] +type accessTagDeleteResponseJSON struct { + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A tag +type AccessTagGetResponse struct { + // The name of the tag + Name string `json:"name,required"` + // The number of applications that have this tag + AppCount int64 `json:"app_count"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessTagGetResponseJSON `json:"-"` +} + +// accessTagGetResponseJSON contains the JSON metadata for the struct +// [AccessTagGetResponse] +type accessTagGetResponseJSON struct { + Name apijson.Field + AppCount apijson.Field + CreatedAt apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A tag +type AccessTagReplaceResponse struct { + // The name of the tag + Name string `json:"name,required"` + // The number of applications that have this tag + AppCount int64 `json:"app_count"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON accessTagReplaceResponseJSON `json:"-"` +} + +// accessTagReplaceResponseJSON contains the JSON metadata for the struct +// [AccessTagReplaceResponse] +type accessTagReplaceResponseJSON struct { + Name apijson.Field + AppCount apijson.Field + CreatedAt apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagNewParams struct { + // The name of the tag + Name param.Field[string] `json:"name,required"` +} + +func (r AccessTagNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessTagNewResponseEnvelope struct { + Errors []AccessTagNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessTagNewResponseEnvelopeMessages `json:"messages,required"` + // A tag + Result AccessTagNewResponse `json:"result,required"` + // Whether the API call was successful + Success AccessTagNewResponseEnvelopeSuccess `json:"success,required"` + JSON accessTagNewResponseEnvelopeJSON `json:"-"` +} + +// accessTagNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessTagNewResponseEnvelope] +type accessTagNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessTagNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [AccessTagNewResponseEnvelopeErrors] +type accessTagNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessTagNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessTagNewResponseEnvelopeMessages] +type accessTagNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessTagNewResponseEnvelopeSuccess bool + +const ( + AccessTagNewResponseEnvelopeSuccessTrue AccessTagNewResponseEnvelopeSuccess = true +) + type AccessTagListResponseEnvelope struct { Errors []AccessTagListResponseEnvelopeErrors `json:"errors,required"` Messages []AccessTagListResponseEnvelopeMessages `json:"messages,required"` @@ -166,3 +394,221 @@ type accessTagListResponseEnvelopeResultInfoJSON struct { func (r *AccessTagListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type AccessTagDeleteResponseEnvelope struct { + Errors []AccessTagDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessTagDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AccessTagDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success AccessTagDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON accessTagDeleteResponseEnvelopeJSON `json:"-"` +} + +// accessTagDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessTagDeleteResponseEnvelope] +type accessTagDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessTagDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessTagDeleteResponseEnvelopeErrors] +type accessTagDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessTagDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessTagDeleteResponseEnvelopeMessages] +type accessTagDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessTagDeleteResponseEnvelopeSuccess bool + +const ( + AccessTagDeleteResponseEnvelopeSuccessTrue AccessTagDeleteResponseEnvelopeSuccess = true +) + +type AccessTagGetResponseEnvelope struct { + Errors []AccessTagGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessTagGetResponseEnvelopeMessages `json:"messages,required"` + // A tag + Result AccessTagGetResponse `json:"result,required"` + // Whether the API call was successful + Success AccessTagGetResponseEnvelopeSuccess `json:"success,required"` + JSON accessTagGetResponseEnvelopeJSON `json:"-"` +} + +// accessTagGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessTagGetResponseEnvelope] +type accessTagGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessTagGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [AccessTagGetResponseEnvelopeErrors] +type accessTagGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessTagGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessTagGetResponseEnvelopeMessages] +type accessTagGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessTagGetResponseEnvelopeSuccess bool + +const ( + AccessTagGetResponseEnvelopeSuccessTrue AccessTagGetResponseEnvelopeSuccess = true +) + +type AccessTagReplaceParams struct { + // The name of the tag + Name param.Field[string] `json:"name,required"` +} + +func (r AccessTagReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccessTagReplaceResponseEnvelope struct { + Errors []AccessTagReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessTagReplaceResponseEnvelopeMessages `json:"messages,required"` + // A tag + Result AccessTagReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success AccessTagReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accessTagReplaceResponseEnvelopeJSON `json:"-"` +} + +// accessTagReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccessTagReplaceResponseEnvelope] +type accessTagReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// accessTagReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccessTagReplaceResponseEnvelopeErrors] +type accessTagReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccessTagReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessTagReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// accessTagReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccessTagReplaceResponseEnvelopeMessages] +type accessTagReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccessTagReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccessTagReplaceResponseEnvelopeSuccess bool + +const ( + AccessTagReplaceResponseEnvelopeSuccessTrue AccessTagReplaceResponseEnvelopeSuccess = true +) diff --git a/accesstag_test.go b/accesstag_test.go index 59fd5dab04d..08cb8c0703f 100644 --- a/accesstag_test.go +++ b/accesstag_test.go @@ -13,6 +13,38 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) +func TestAccessTagNew(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Tags.New( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.AccessTagNewParams{ + Name: cloudflare.F("engineers"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestAccessTagList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -38,3 +70,96 @@ func TestAccessTagList(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestAccessTagDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Tags.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "engineers", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessTagGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Tags.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "engineers", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAccessTagReplace(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Access.Tags.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "engineers", + cloudflare.AccessTagReplaceParams{ + Name: cloudflare.F("engineers"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/accessuserfailedlogin.go b/accessuserfailedlogin.go index 03608b4a620..a8f5b204411 100644 --- a/accessuserfailedlogin.go +++ b/accessuserfailedlogin.go @@ -31,9 +31,9 @@ func NewAccessUserFailedLoginService(opts ...option.RequestOption) (r *AccessUse } // Get all failed login attempts for a single user. -func (r *AccessUserFailedLoginService) ZeroTrustUsersGetFailedLogins(ctx context.Context, identifier string, id string, opts ...option.RequestOption) (res *[]AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse, err error) { +func (r *AccessUserFailedLoginService) List(ctx context.Context, identifier string, id string, opts ...option.RequestOption) (res *[]AccessUserFailedLoginListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelope + var env AccessUserFailedLoginListResponseEnvelope path := fmt.Sprintf("accounts/%s/access/users/%s/failed_logins", identifier, id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,40 +43,38 @@ func (r *AccessUserFailedLoginService) ZeroTrustUsersGetFailedLogins(ctx context return } -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse struct { - Expiration int64 `json:"expiration"` - Metadata interface{} `json:"metadata"` - JSON accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseJSON `json:"-"` +type AccessUserFailedLoginListResponse struct { + Expiration int64 `json:"expiration"` + Metadata interface{} `json:"metadata"` + JSON accessUserFailedLoginListResponseJSON `json:"-"` } -// accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseJSON contains the JSON -// metadata for the struct -// [AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse] -type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseJSON struct { +// accessUserFailedLoginListResponseJSON contains the JSON metadata for the struct +// [AccessUserFailedLoginListResponse] +type accessUserFailedLoginListResponseJSON struct { Expiration apijson.Field Metadata apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserFailedLoginListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelope struct { - Errors []AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessages `json:"messages,required"` - Result []AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse `json:"result,required,nullable"` +type AccessUserFailedLoginListResponseEnvelope struct { + Errors []AccessUserFailedLoginListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessUserFailedLoginListResponseEnvelopeMessages `json:"messages,required"` + Result []AccessUserFailedLoginListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfo `json:"result_info"` - JSON accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeJSON `json:"-"` + Success AccessUserFailedLoginListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AccessUserFailedLoginListResponseEnvelopeResultInfo `json:"result_info"` + JSON accessUserFailedLoginListResponseEnvelopeJSON `json:"-"` } -// accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelope] -type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeJSON struct { +// accessUserFailedLoginListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccessUserFailedLoginListResponseEnvelope] +type accessUserFailedLoginListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -86,58 +84,56 @@ type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeJSON stru ExtraFields map[string]apijson.Field } -func (r *AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserFailedLoginListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrorsJSON `json:"-"` +type AccessUserFailedLoginListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessUserFailedLoginListResponseEnvelopeErrorsJSON `json:"-"` } -// accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrors] -type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrorsJSON struct { +// accessUserFailedLoginListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AccessUserFailedLoginListResponseEnvelopeErrors] +type accessUserFailedLoginListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserFailedLoginListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessagesJSON `json:"-"` +type AccessUserFailedLoginListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessUserFailedLoginListResponseEnvelopeMessagesJSON `json:"-"` } -// accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessages] -type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessagesJSON struct { +// accessUserFailedLoginListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AccessUserFailedLoginListResponseEnvelopeMessages] +type accessUserFailedLoginListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserFailedLoginListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeSuccess bool +type AccessUserFailedLoginListResponseEnvelopeSuccess bool const ( - AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeSuccessTrue AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeSuccess = true + AccessUserFailedLoginListResponseEnvelopeSuccessTrue AccessUserFailedLoginListResponseEnvelopeSuccess = true ) -type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfo struct { +type AccessUserFailedLoginListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -145,14 +141,13 @@ type AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInf // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON accessUserFailedLoginListResponseEnvelopeResultInfoJSON `json:"-"` } -// accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfo] -type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfoJSON struct { +// accessUserFailedLoginListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AccessUserFailedLoginListResponseEnvelopeResultInfo] +type accessUserFailedLoginListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -161,6 +156,6 @@ type accessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInf ExtraFields map[string]apijson.Field } -func (r *AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserFailedLoginListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/accessuserfailedlogin_test.go b/accessuserfailedlogin_test.go index 4fa81e50487..2afd6d89249 100644 --- a/accessuserfailedlogin_test.go +++ b/accessuserfailedlogin_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessUserFailedLoginZeroTrustUsersGetFailedLogins(t *testing.T) { +func TestAccessUserFailedLoginList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAccessUserFailedLoginZeroTrustUsersGetFailedLogins(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Users.FailedLogins.ZeroTrustUsersGetFailedLogins( + _, err := client.Access.Users.FailedLogins.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/accessuserlastseenidentity.go b/accessuserlastseenidentity.go index 223e738becf..236b785195f 100644 --- a/accessuserlastseenidentity.go +++ b/accessuserlastseenidentity.go @@ -31,9 +31,9 @@ func NewAccessUserLastSeenIdentityService(opts ...option.RequestOption) (r *Acce } // Get last seen identity for a single user. -func (r *AccessUserLastSeenIdentityService) Get(ctx context.Context, identifier string, id string, opts ...option.RequestOption) (res *AccessUserLastSeenIdentityGetResponse, err error) { +func (r *AccessUserLastSeenIdentityService) List(ctx context.Context, identifier string, id string, opts ...option.RequestOption) (res *AccessUserLastSeenIdentityListResponse, err error) { opts = append(r.Options[:], opts...) - var env AccessUserLastSeenIdentityGetResponseEnvelope + var env AccessUserLastSeenIdentityListResponseEnvelope path := fmt.Sprintf("accounts/%s/access/users/%s/last_seen_identity", identifier, id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,31 +43,31 @@ func (r *AccessUserLastSeenIdentityService) Get(ctx context.Context, identifier return } -type AccessUserLastSeenIdentityGetResponse struct { - AccountID string `json:"account_id"` - AuthStatus string `json:"auth_status"` - CommonName string `json:"common_name"` - DeviceID string `json:"device_id"` - DeviceSessions map[string]AccessUserLastSeenIdentityGetResponseDeviceSession `json:"device_sessions"` - DevicePosture map[string]AccessUserLastSeenIdentityGetResponseDevicePosture `json:"devicePosture"` - Email string `json:"email"` - Geo AccessUserLastSeenIdentityGetResponseGeo `json:"geo"` - Iat float64 `json:"iat"` - Idp AccessUserLastSeenIdentityGetResponseIdp `json:"idp"` - IP string `json:"ip"` - IsGateway bool `json:"is_gateway"` - IsWarp bool `json:"is_warp"` - MtlsAuth AccessUserLastSeenIdentityGetResponseMtlsAuth `json:"mtls_auth"` - ServiceTokenID string `json:"service_token_id"` - ServiceTokenStatus bool `json:"service_token_status"` - UserUuid string `json:"user_uuid"` - Version float64 `json:"version"` - JSON accessUserLastSeenIdentityGetResponseJSON `json:"-"` -} - -// accessUserLastSeenIdentityGetResponseJSON contains the JSON metadata for the -// struct [AccessUserLastSeenIdentityGetResponse] -type accessUserLastSeenIdentityGetResponseJSON struct { +type AccessUserLastSeenIdentityListResponse struct { + AccountID string `json:"account_id"` + AuthStatus string `json:"auth_status"` + CommonName string `json:"common_name"` + DeviceID string `json:"device_id"` + DeviceSessions map[string]AccessUserLastSeenIdentityListResponseDeviceSession `json:"device_sessions"` + DevicePosture map[string]AccessUserLastSeenIdentityListResponseDevicePosture `json:"devicePosture"` + Email string `json:"email"` + Geo AccessUserLastSeenIdentityListResponseGeo `json:"geo"` + Iat float64 `json:"iat"` + Idp AccessUserLastSeenIdentityListResponseIdp `json:"idp"` + IP string `json:"ip"` + IsGateway bool `json:"is_gateway"` + IsWarp bool `json:"is_warp"` + MtlsAuth AccessUserLastSeenIdentityListResponseMtlsAuth `json:"mtls_auth"` + ServiceTokenID string `json:"service_token_id"` + ServiceTokenStatus bool `json:"service_token_status"` + UserUuid string `json:"user_uuid"` + Version float64 `json:"version"` + JSON accessUserLastSeenIdentityListResponseJSON `json:"-"` +} + +// accessUserLastSeenIdentityListResponseJSON contains the JSON metadata for the +// struct [AccessUserLastSeenIdentityListResponse] +type accessUserLastSeenIdentityListResponseJSON struct { AccountID apijson.Field AuthStatus apijson.Field CommonName apijson.Field @@ -90,43 +90,43 @@ type accessUserLastSeenIdentityGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseDeviceSession struct { - LastAuthenticated float64 `json:"last_authenticated"` - JSON accessUserLastSeenIdentityGetResponseDeviceSessionJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseDeviceSession struct { + LastAuthenticated float64 `json:"last_authenticated"` + JSON accessUserLastSeenIdentityListResponseDeviceSessionJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseDeviceSessionJSON contains the JSON -// metadata for the struct [AccessUserLastSeenIdentityGetResponseDeviceSession] -type accessUserLastSeenIdentityGetResponseDeviceSessionJSON struct { +// accessUserLastSeenIdentityListResponseDeviceSessionJSON contains the JSON +// metadata for the struct [AccessUserLastSeenIdentityListResponseDeviceSession] +type accessUserLastSeenIdentityListResponseDeviceSessionJSON struct { LastAuthenticated apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseDeviceSession) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseDeviceSession) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseDevicePosture struct { - ID string `json:"id"` - Check AccessUserLastSeenIdentityGetResponseDevicePostureCheck `json:"check"` - Data interface{} `json:"data"` - Description string `json:"description"` - Error string `json:"error"` - RuleName string `json:"rule_name"` - Success bool `json:"success"` - Timestamp string `json:"timestamp"` - Type string `json:"type"` - JSON accessUserLastSeenIdentityGetResponseDevicePostureJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseDevicePosture struct { + ID string `json:"id"` + Check AccessUserLastSeenIdentityListResponseDevicePostureCheck `json:"check"` + Data interface{} `json:"data"` + Description string `json:"description"` + Error string `json:"error"` + RuleName string `json:"rule_name"` + Success bool `json:"success"` + Timestamp string `json:"timestamp"` + Type string `json:"type"` + JSON accessUserLastSeenIdentityListResponseDevicePostureJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseDevicePostureJSON contains the JSON -// metadata for the struct [AccessUserLastSeenIdentityGetResponseDevicePosture] -type accessUserLastSeenIdentityGetResponseDevicePostureJSON struct { +// accessUserLastSeenIdentityListResponseDevicePostureJSON contains the JSON +// metadata for the struct [AccessUserLastSeenIdentityListResponseDevicePosture] +type accessUserLastSeenIdentityListResponseDevicePostureJSON struct { ID apijson.Field Check apijson.Field Data apijson.Field @@ -140,78 +140,78 @@ type accessUserLastSeenIdentityGetResponseDevicePostureJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseDevicePosture) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseDevicePosture) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseDevicePostureCheck struct { - Exists bool `json:"exists"` - Path string `json:"path"` - JSON accessUserLastSeenIdentityGetResponseDevicePostureCheckJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseDevicePostureCheck struct { + Exists bool `json:"exists"` + Path string `json:"path"` + JSON accessUserLastSeenIdentityListResponseDevicePostureCheckJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseDevicePostureCheckJSON contains the JSON +// accessUserLastSeenIdentityListResponseDevicePostureCheckJSON contains the JSON // metadata for the struct -// [AccessUserLastSeenIdentityGetResponseDevicePostureCheck] -type accessUserLastSeenIdentityGetResponseDevicePostureCheckJSON struct { +// [AccessUserLastSeenIdentityListResponseDevicePostureCheck] +type accessUserLastSeenIdentityListResponseDevicePostureCheckJSON struct { Exists apijson.Field Path apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseDevicePostureCheck) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseDevicePostureCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseGeo struct { - Country string `json:"country"` - JSON accessUserLastSeenIdentityGetResponseGeoJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseGeo struct { + Country string `json:"country"` + JSON accessUserLastSeenIdentityListResponseGeoJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseGeoJSON contains the JSON metadata for the -// struct [AccessUserLastSeenIdentityGetResponseGeo] -type accessUserLastSeenIdentityGetResponseGeoJSON struct { +// accessUserLastSeenIdentityListResponseGeoJSON contains the JSON metadata for the +// struct [AccessUserLastSeenIdentityListResponseGeo] +type accessUserLastSeenIdentityListResponseGeoJSON struct { Country apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseGeo) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseGeo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseIdp struct { - ID string `json:"id"` - Type string `json:"type"` - JSON accessUserLastSeenIdentityGetResponseIdpJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseIdp struct { + ID string `json:"id"` + Type string `json:"type"` + JSON accessUserLastSeenIdentityListResponseIdpJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseIdpJSON contains the JSON metadata for the -// struct [AccessUserLastSeenIdentityGetResponseIdp] -type accessUserLastSeenIdentityGetResponseIdpJSON struct { +// accessUserLastSeenIdentityListResponseIdpJSON contains the JSON metadata for the +// struct [AccessUserLastSeenIdentityListResponseIdp] +type accessUserLastSeenIdentityListResponseIdpJSON struct { ID apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseIdp) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseIdp) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseMtlsAuth struct { - AuthStatus string `json:"auth_status"` - CertIssuerDn string `json:"cert_issuer_dn"` - CertIssuerSki string `json:"cert_issuer_ski"` - CertPresented bool `json:"cert_presented"` - CertSerial string `json:"cert_serial"` - JSON accessUserLastSeenIdentityGetResponseMtlsAuthJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseMtlsAuth struct { + AuthStatus string `json:"auth_status"` + CertIssuerDn string `json:"cert_issuer_dn"` + CertIssuerSki string `json:"cert_issuer_ski"` + CertPresented bool `json:"cert_presented"` + CertSerial string `json:"cert_serial"` + JSON accessUserLastSeenIdentityListResponseMtlsAuthJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseMtlsAuthJSON contains the JSON metadata for -// the struct [AccessUserLastSeenIdentityGetResponseMtlsAuth] -type accessUserLastSeenIdentityGetResponseMtlsAuthJSON struct { +// accessUserLastSeenIdentityListResponseMtlsAuthJSON contains the JSON metadata +// for the struct [AccessUserLastSeenIdentityListResponseMtlsAuth] +type accessUserLastSeenIdentityListResponseMtlsAuthJSON struct { AuthStatus apijson.Field CertIssuerDn apijson.Field CertIssuerSki apijson.Field @@ -221,22 +221,22 @@ type accessUserLastSeenIdentityGetResponseMtlsAuthJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseMtlsAuth) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseMtlsAuth) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseEnvelope struct { - Errors []AccessUserLastSeenIdentityGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccessUserLastSeenIdentityGetResponseEnvelopeMessages `json:"messages,required"` - Result AccessUserLastSeenIdentityGetResponse `json:"result,required"` +type AccessUserLastSeenIdentityListResponseEnvelope struct { + Errors []AccessUserLastSeenIdentityListResponseEnvelopeErrors `json:"errors,required"` + Messages []AccessUserLastSeenIdentityListResponseEnvelopeMessages `json:"messages,required"` + Result AccessUserLastSeenIdentityListResponse `json:"result,required"` // Whether the API call was successful - Success AccessUserLastSeenIdentityGetResponseEnvelopeSuccess `json:"success,required"` - JSON accessUserLastSeenIdentityGetResponseEnvelopeJSON `json:"-"` + Success AccessUserLastSeenIdentityListResponseEnvelopeSuccess `json:"success,required"` + JSON accessUserLastSeenIdentityListResponseEnvelopeJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseEnvelopeJSON contains the JSON metadata for -// the struct [AccessUserLastSeenIdentityGetResponseEnvelope] -type accessUserLastSeenIdentityGetResponseEnvelopeJSON struct { +// accessUserLastSeenIdentityListResponseEnvelopeJSON contains the JSON metadata +// for the struct [AccessUserLastSeenIdentityListResponseEnvelope] +type accessUserLastSeenIdentityListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -245,51 +245,51 @@ type accessUserLastSeenIdentityGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessUserLastSeenIdentityGetResponseEnvelopeErrorsJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessUserLastSeenIdentityListResponseEnvelopeErrorsJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AccessUserLastSeenIdentityGetResponseEnvelopeErrors] -type accessUserLastSeenIdentityGetResponseEnvelopeErrorsJSON struct { +// accessUserLastSeenIdentityListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AccessUserLastSeenIdentityListResponseEnvelopeErrors] +type accessUserLastSeenIdentityListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccessUserLastSeenIdentityGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accessUserLastSeenIdentityGetResponseEnvelopeMessagesJSON `json:"-"` +type AccessUserLastSeenIdentityListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accessUserLastSeenIdentityListResponseEnvelopeMessagesJSON `json:"-"` } -// accessUserLastSeenIdentityGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AccessUserLastSeenIdentityGetResponseEnvelopeMessages] -type accessUserLastSeenIdentityGetResponseEnvelopeMessagesJSON struct { +// accessUserLastSeenIdentityListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AccessUserLastSeenIdentityListResponseEnvelopeMessages] +type accessUserLastSeenIdentityListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserLastSeenIdentityGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserLastSeenIdentityListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccessUserLastSeenIdentityGetResponseEnvelopeSuccess bool +type AccessUserLastSeenIdentityListResponseEnvelopeSuccess bool const ( - AccessUserLastSeenIdentityGetResponseEnvelopeSuccessTrue AccessUserLastSeenIdentityGetResponseEnvelopeSuccess = true + AccessUserLastSeenIdentityListResponseEnvelopeSuccessTrue AccessUserLastSeenIdentityListResponseEnvelopeSuccess = true ) diff --git a/accessuserlastseenidentity_test.go b/accessuserlastseenidentity_test.go index ccec7739735..4c0eb15e1a3 100644 --- a/accessuserlastseenidentity_test.go +++ b/accessuserlastseenidentity_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessUserLastSeenIdentityGet(t *testing.T) { +func TestAccessUserLastSeenIdentityList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAccessUserLastSeenIdentityGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Users.LastSeenIdentity.Get( + _, err := client.Access.Users.LastSeenIdentity.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/account.go b/account.go index 4f79a8f4935..754349ff77c 100644 --- a/account.go +++ b/account.go @@ -35,19 +35,6 @@ func NewAccountService(opts ...option.RequestOption) (r *AccountService) { return } -// Update an existing account. -func (r *AccountService) Update(ctx context.Context, accountID interface{}, body AccountUpdateParams, opts ...option.RequestOption) (res *AccountUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccountUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List all accounts you have ownership or verified access to. func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AccountListResponse], err error) { var raw *http.Response @@ -84,20 +71,17 @@ func (r *AccountService) Get(ctx context.Context, accountID interface{}, opts .. return } -// Union satisfied by [AccountUpdateResponseUnknown] or [shared.UnionString]. -type AccountUpdateResponse interface { - ImplementsAccountUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AccountUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Update an existing account. +func (r *AccountService) Replace(ctx context.Context, accountID interface{}, body AccountReplaceParams, opts ...option.RequestOption) (res *AccountReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccountReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } type AccountListResponse = interface{} @@ -118,74 +102,59 @@ func init() { ) } -type AccountUpdateParams struct { - // Account name - Name param.Field[string] `json:"name,required"` - // Account settings - Settings param.Field[AccountUpdateParamsSettings] `json:"settings"` +// Union satisfied by [AccountReplaceResponseUnknown] or [shared.UnionString]. +type AccountReplaceResponse interface { + ImplementsAccountReplaceResponse() } -func (r AccountUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AccountReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// Account settings -type AccountUpdateParamsSettings struct { - // Specifies the default nameservers to be used for new zones added to this - // account. - // - // - `cloudflare.standard` for Cloudflare-branded nameservers - // - `custom.account` for account custom nameservers - // - `custom.tenant` for tenant custom nameservers - // - // See - // [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) - // for more information. - DefaultNameservers param.Field[AccountUpdateParamsSettingsDefaultNameservers] `json:"default_nameservers"` - // Indicates whether membership in this account requires that Two-Factor - // Authentication is enabled - EnforceTwofactor param.Field[bool] `json:"enforce_twofactor"` - // Indicates whether new zones should use the account-level custom nameservers by - // default. - // - // Deprecated in favor of `default_nameservers`. - UseAccountCustomNsByDefault param.Field[bool] `json:"use_account_custom_ns_by_default"` +type AccountListParams struct { + // Direction to order results. + Direction param.Field[AccountListParamsDirection] `query:"direction"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // Maximum number of results per page. + PerPage param.Field[float64] `query:"per_page"` } -func (r AccountUpdateParamsSettings) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// URLQuery serializes [AccountListParams]'s query parameters as `url.Values`. +func (r AccountListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) } -// Specifies the default nameservers to be used for new zones added to this -// account. -// -// - `cloudflare.standard` for Cloudflare-branded nameservers -// - `custom.account` for account custom nameservers -// - `custom.tenant` for tenant custom nameservers -// -// See -// [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) -// for more information. -type AccountUpdateParamsSettingsDefaultNameservers string +// Direction to order results. +type AccountListParamsDirection string const ( - AccountUpdateParamsSettingsDefaultNameserversCloudflareStandard AccountUpdateParamsSettingsDefaultNameservers = "cloudflare.standard" - AccountUpdateParamsSettingsDefaultNameserversCustomAccount AccountUpdateParamsSettingsDefaultNameservers = "custom.account" - AccountUpdateParamsSettingsDefaultNameserversCustomTenant AccountUpdateParamsSettingsDefaultNameservers = "custom.tenant" + AccountListParamsDirectionAsc AccountListParamsDirection = "asc" + AccountListParamsDirectionDesc AccountListParamsDirection = "desc" ) -type AccountUpdateResponseEnvelope struct { - Errors []AccountUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccountUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccountUpdateResponse `json:"result,required"` +type AccountGetResponseEnvelope struct { + Errors []AccountGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AccountGetResponseEnvelopeMessages `json:"messages,required"` + Result AccountGetResponse `json:"result,required"` // Whether the API call was successful - Success AccountUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accountUpdateResponseEnvelopeJSON `json:"-"` + Success AccountGetResponseEnvelopeSuccess `json:"success,required"` + JSON accountGetResponseEnvelopeJSON `json:"-"` } -// accountUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccountUpdateResponseEnvelope] -type accountUpdateResponseEnvelopeJSON struct { +// accountGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccountGetResponseEnvelope] +type accountGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -194,92 +163,123 @@ type accountUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccountUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccountGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccountGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountGetResponseEnvelopeErrorsJSON `json:"-"` } -// accountUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccountUpdateResponseEnvelopeErrors] -type accountUpdateResponseEnvelopeErrorsJSON struct { +// accountGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [AccountGetResponseEnvelopeErrors] +type accountGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccountGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccountGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountGetResponseEnvelopeMessagesJSON `json:"-"` } -// accountUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccountUpdateResponseEnvelopeMessages] -type accountUpdateResponseEnvelopeMessagesJSON struct { +// accountGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [AccountGetResponseEnvelopeMessages] +type accountGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccountGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccountUpdateResponseEnvelopeSuccess bool +type AccountGetResponseEnvelopeSuccess bool const ( - AccountUpdateResponseEnvelopeSuccessTrue AccountUpdateResponseEnvelopeSuccess = true + AccountGetResponseEnvelopeSuccessTrue AccountGetResponseEnvelopeSuccess = true ) -type AccountListParams struct { - // Direction to order results. - Direction param.Field[AccountListParamsDirection] `query:"direction"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Maximum number of results per page. - PerPage param.Field[float64] `query:"per_page"` +type AccountReplaceParams struct { + // Account name + Name param.Field[string] `json:"name,required"` + // Account settings + Settings param.Field[AccountReplaceParamsSettings] `json:"settings"` } -// URLQuery serializes [AccountListParams]'s query parameters as `url.Values`. -func (r AccountListParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +func (r AccountReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Direction to order results. -type AccountListParamsDirection string +// Account settings +type AccountReplaceParamsSettings struct { + // Specifies the default nameservers to be used for new zones added to this + // account. + // + // - `cloudflare.standard` for Cloudflare-branded nameservers + // - `custom.account` for account custom nameservers + // - `custom.tenant` for tenant custom nameservers + // + // See + // [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) + // for more information. + DefaultNameservers param.Field[AccountReplaceParamsSettingsDefaultNameservers] `json:"default_nameservers"` + // Indicates whether membership in this account requires that Two-Factor + // Authentication is enabled + EnforceTwofactor param.Field[bool] `json:"enforce_twofactor"` + // Indicates whether new zones should use the account-level custom nameservers by + // default. + // + // Deprecated in favor of `default_nameservers`. + UseAccountCustomNsByDefault param.Field[bool] `json:"use_account_custom_ns_by_default"` +} + +func (r AccountReplaceParamsSettings) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Specifies the default nameservers to be used for new zones added to this +// account. +// +// - `cloudflare.standard` for Cloudflare-branded nameservers +// - `custom.account` for account custom nameservers +// - `custom.tenant` for tenant custom nameservers +// +// See +// [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) +// for more information. +type AccountReplaceParamsSettingsDefaultNameservers string const ( - AccountListParamsDirectionAsc AccountListParamsDirection = "asc" - AccountListParamsDirectionDesc AccountListParamsDirection = "desc" + AccountReplaceParamsSettingsDefaultNameserversCloudflareStandard AccountReplaceParamsSettingsDefaultNameservers = "cloudflare.standard" + AccountReplaceParamsSettingsDefaultNameserversCustomAccount AccountReplaceParamsSettingsDefaultNameservers = "custom.account" + AccountReplaceParamsSettingsDefaultNameserversCustomTenant AccountReplaceParamsSettingsDefaultNameservers = "custom.tenant" ) -type AccountGetResponseEnvelope struct { - Errors []AccountGetResponseEnvelopeErrors `json:"errors,required"` - Messages []AccountGetResponseEnvelopeMessages `json:"messages,required"` - Result AccountGetResponse `json:"result,required"` +type AccountReplaceResponseEnvelope struct { + Errors []AccountReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccountReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccountReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AccountGetResponseEnvelopeSuccess `json:"success,required"` - JSON accountGetResponseEnvelopeJSON `json:"-"` + Success AccountReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accountReplaceResponseEnvelopeJSON `json:"-"` } -// accountGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccountGetResponseEnvelope] -type accountGetResponseEnvelopeJSON struct { +// accountReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccountReplaceResponseEnvelope] +type accountReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -288,51 +288,51 @@ type accountGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccountGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccountReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountGetResponseEnvelopeErrorsJSON `json:"-"` +type AccountReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// accountGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [AccountGetResponseEnvelopeErrors] -type accountGetResponseEnvelopeErrorsJSON struct { +// accountReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccountReplaceResponseEnvelopeErrors] +type accountReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccountReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountGetResponseEnvelopeMessagesJSON `json:"-"` +type AccountReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// accountGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [AccountGetResponseEnvelopeMessages] -type accountGetResponseEnvelopeMessagesJSON struct { +// accountReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccountReplaceResponseEnvelopeMessages] +type accountReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccountReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccountGetResponseEnvelopeSuccess bool +type AccountReplaceResponseEnvelopeSuccess bool const ( - AccountGetResponseEnvelopeSuccessTrue AccountGetResponseEnvelopeSuccess = true + AccountReplaceResponseEnvelopeSuccessTrue AccountReplaceResponseEnvelopeSuccess = true ) diff --git a/account_test.go b/account_test.go index 64b69f475ae..fb100e9d7bd 100644 --- a/account_test.go +++ b/account_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccountUpdateWithOptionalParams(t *testing.T) { +func TestAccountListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,18 +29,11 @@ func TestAccountUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Accounts.Update( - context.TODO(), - map[string]interface{}{}, - cloudflare.AccountUpdateParams{ - Name: cloudflare.F("Demo Account"), - Settings: cloudflare.F(cloudflare.AccountUpdateParamsSettings{ - DefaultNameservers: cloudflare.F(cloudflare.AccountUpdateParamsSettingsDefaultNameserversCloudflareStandard), - EnforceTwofactor: cloudflare.F(true), - UseAccountCustomNsByDefault: cloudflare.F(true), - }), - }, - ) + _, err := client.Accounts.List(context.TODO(), cloudflare.AccountListParams{ + Direction: cloudflare.F(cloudflare.AccountListParamsDirectionDesc), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -50,7 +43,7 @@ func TestAccountUpdateWithOptionalParams(t *testing.T) { } } -func TestAccountListWithOptionalParams(t *testing.T) { +func TestAccountGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -66,11 +59,7 @@ func TestAccountListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Accounts.List(context.TODO(), cloudflare.AccountListParams{ - Direction: cloudflare.F(cloudflare.AccountListParamsDirectionDesc), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - }) + _, err := client.Accounts.Get(context.TODO(), map[string]interface{}{}) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -80,7 +69,7 @@ func TestAccountListWithOptionalParams(t *testing.T) { } } -func TestAccountGet(t *testing.T) { +func TestAccountReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -96,7 +85,18 @@ func TestAccountGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Accounts.Get(context.TODO(), map[string]interface{}{}) + _, err := client.Accounts.Replace( + context.TODO(), + map[string]interface{}{}, + cloudflare.AccountReplaceParams{ + Name: cloudflare.F("Demo Account"), + Settings: cloudflare.F(cloudflare.AccountReplaceParamsSettings{ + DefaultNameservers: cloudflare.F(cloudflare.AccountReplaceParamsSettingsDefaultNameserversCloudflareStandard), + EnforceTwofactor: cloudflare.F(true), + UseAccountCustomNsByDefault: cloudflare.F(true), + }), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/accountmember.go b/accountmember.go index 22c38952647..92e1255885f 100644 --- a/accountmember.go +++ b/accountmember.go @@ -47,19 +47,6 @@ func (r *AccountMemberService) New(ctx context.Context, accountID interface{}, b return } -// Modify an account member. -func (r *AccountMemberService) Update(ctx context.Context, accountID interface{}, memberID string, body AccountMemberUpdateParams, opts ...option.RequestOption) (res *AccountMemberUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env AccountMemberUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/members/%s", accountID, memberID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List all members of an account. func (r *AccountMemberService) List(ctx context.Context, accountID interface{}, query AccountMemberListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AccountMemberListResponse], err error) { var raw *http.Response @@ -109,6 +96,19 @@ func (r *AccountMemberService) Get(ctx context.Context, accountID interface{}, m return } +// Modify an account member. +func (r *AccountMemberService) Replace(ctx context.Context, accountID interface{}, memberID string, body AccountMemberReplaceParams, opts ...option.RequestOption) (res *AccountMemberReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env AccountMemberReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/members/%s", accountID, memberID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type AccountMemberNewResponse struct { // Membership identifier tag. ID string `json:"id,required"` @@ -461,357 +461,6 @@ func (r *AccountMemberNewResponseUser) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateResponse struct { - // Membership identifier tag. - ID string `json:"id,required"` - // Roles assigned to this member. - Roles []AccountMemberUpdateResponseRole `json:"roles,required"` - Status interface{} `json:"status,required"` - User AccountMemberUpdateResponseUser `json:"user,required"` - JSON accountMemberUpdateResponseJSON `json:"-"` -} - -// accountMemberUpdateResponseJSON contains the JSON metadata for the struct -// [AccountMemberUpdateResponse] -type accountMemberUpdateResponseJSON struct { - ID apijson.Field - Roles apijson.Field - Status apijson.Field - User apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRole struct { - // Role identifier tag. - ID string `json:"id,required"` - // Description of role's permissions. - Description string `json:"description,required"` - // Role name. - Name string `json:"name,required"` - Permissions AccountMemberUpdateResponseRolesPermissions `json:"permissions,required"` - JSON accountMemberUpdateResponseRoleJSON `json:"-"` -} - -// accountMemberUpdateResponseRoleJSON contains the JSON metadata for the struct -// [AccountMemberUpdateResponseRole] -type accountMemberUpdateResponseRoleJSON struct { - ID apijson.Field - Description apijson.Field - Name apijson.Field - Permissions apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRole) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissions struct { - Analytics AccountMemberUpdateResponseRolesPermissionsAnalytics `json:"analytics"` - Billing AccountMemberUpdateResponseRolesPermissionsBilling `json:"billing"` - CachePurge AccountMemberUpdateResponseRolesPermissionsCachePurge `json:"cache_purge"` - DNS AccountMemberUpdateResponseRolesPermissionsDNS `json:"dns"` - DNSRecords AccountMemberUpdateResponseRolesPermissionsDNSRecords `json:"dns_records"` - Lb AccountMemberUpdateResponseRolesPermissionsLb `json:"lb"` - Logs AccountMemberUpdateResponseRolesPermissionsLogs `json:"logs"` - Organization AccountMemberUpdateResponseRolesPermissionsOrganization `json:"organization"` - SSL AccountMemberUpdateResponseRolesPermissionsSSL `json:"ssl"` - WAF AccountMemberUpdateResponseRolesPermissionsWAF `json:"waf"` - ZoneSettings AccountMemberUpdateResponseRolesPermissionsZoneSettings `json:"zone_settings"` - Zones AccountMemberUpdateResponseRolesPermissionsZones `json:"zones"` - JSON accountMemberUpdateResponseRolesPermissionsJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsJSON contains the JSON metadata for -// the struct [AccountMemberUpdateResponseRolesPermissions] -type accountMemberUpdateResponseRolesPermissionsJSON struct { - Analytics apijson.Field - Billing apijson.Field - CachePurge apijson.Field - DNS apijson.Field - DNSRecords apijson.Field - Lb apijson.Field - Logs apijson.Field - Organization apijson.Field - SSL apijson.Field - WAF apijson.Field - ZoneSettings apijson.Field - Zones apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissions) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsAnalytics struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsAnalyticsJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsAnalyticsJSON contains the JSON -// metadata for the struct [AccountMemberUpdateResponseRolesPermissionsAnalytics] -type accountMemberUpdateResponseRolesPermissionsAnalyticsJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsBilling struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsBillingJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsBillingJSON contains the JSON -// metadata for the struct [AccountMemberUpdateResponseRolesPermissionsBilling] -type accountMemberUpdateResponseRolesPermissionsBillingJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsCachePurge struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsCachePurgeJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsCachePurgeJSON contains the JSON -// metadata for the struct [AccountMemberUpdateResponseRolesPermissionsCachePurge] -type accountMemberUpdateResponseRolesPermissionsCachePurgeJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsDNS struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsDNSJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsDNSJSON contains the JSON metadata -// for the struct [AccountMemberUpdateResponseRolesPermissionsDNS] -type accountMemberUpdateResponseRolesPermissionsDNSJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsDNSRecords struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsDNSRecordsJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsDNSRecordsJSON contains the JSON -// metadata for the struct [AccountMemberUpdateResponseRolesPermissionsDNSRecords] -type accountMemberUpdateResponseRolesPermissionsDNSRecordsJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsLb struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsLbJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsLbJSON contains the JSON metadata for -// the struct [AccountMemberUpdateResponseRolesPermissionsLb] -type accountMemberUpdateResponseRolesPermissionsLbJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsLogs struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsLogsJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsLogsJSON contains the JSON metadata -// for the struct [AccountMemberUpdateResponseRolesPermissionsLogs] -type accountMemberUpdateResponseRolesPermissionsLogsJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsOrganization struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsOrganizationJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsOrganizationJSON contains the JSON -// metadata for the struct -// [AccountMemberUpdateResponseRolesPermissionsOrganization] -type accountMemberUpdateResponseRolesPermissionsOrganizationJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsSSL struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsSSLJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsSSLJSON contains the JSON metadata -// for the struct [AccountMemberUpdateResponseRolesPermissionsSSL] -type accountMemberUpdateResponseRolesPermissionsSSLJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsWAF struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsWAFJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsWAFJSON contains the JSON metadata -// for the struct [AccountMemberUpdateResponseRolesPermissionsWAF] -type accountMemberUpdateResponseRolesPermissionsWAFJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsZoneSettings struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsZoneSettingsJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsZoneSettingsJSON contains the JSON -// metadata for the struct -// [AccountMemberUpdateResponseRolesPermissionsZoneSettings] -type accountMemberUpdateResponseRolesPermissionsZoneSettingsJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseRolesPermissionsZones struct { - Read bool `json:"read"` - Write bool `json:"write"` - JSON accountMemberUpdateResponseRolesPermissionsZonesJSON `json:"-"` -} - -// accountMemberUpdateResponseRolesPermissionsZonesJSON contains the JSON metadata -// for the struct [AccountMemberUpdateResponseRolesPermissionsZones] -type accountMemberUpdateResponseRolesPermissionsZonesJSON struct { - Read apijson.Field - Write apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AccountMemberUpdateResponseUser struct { - // The contact email address of the user. - Email string `json:"email,required"` - // Identifier - ID string `json:"id"` - // User's first name - FirstName string `json:"first_name,nullable"` - // User's last name - LastName string `json:"last_name,nullable"` - // Indicates whether two-factor authentication is enabled for the user account. - // Does not apply to API authentication. - TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"` - JSON accountMemberUpdateResponseUserJSON `json:"-"` -} - -// accountMemberUpdateResponseUserJSON contains the JSON metadata for the struct -// [AccountMemberUpdateResponseUser] -type accountMemberUpdateResponseUserJSON struct { - Email apijson.Field - ID apijson.Field - FirstName apijson.Field - LastName apijson.Field - TwoFactorAuthenticationEnabled apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AccountMemberUpdateResponseUser) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type AccountMemberListResponse struct { // Identifier ID string `json:"id,required"` @@ -1244,251 +893,388 @@ func (r *AccountMemberGetResponseUser) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberNewParams struct { - // The contact email address of the user. - Email param.Field[string] `json:"email,required"` - // Array of roles associated with this member. - Roles param.Field[[]string] `json:"roles,required"` - Status param.Field[AccountMemberNewParamsStatus] `json:"status"` +type AccountMemberReplaceResponse struct { + // Membership identifier tag. + ID string `json:"id,required"` + // Roles assigned to this member. + Roles []AccountMemberReplaceResponseRole `json:"roles,required"` + Status interface{} `json:"status,required"` + User AccountMemberReplaceResponseUser `json:"user,required"` + JSON accountMemberReplaceResponseJSON `json:"-"` } -func (r AccountMemberNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accountMemberReplaceResponseJSON contains the JSON metadata for the struct +// [AccountMemberReplaceResponse] +type accountMemberReplaceResponseJSON struct { + ID apijson.Field + Roles apijson.Field + Status apijson.Field + User apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccountMemberNewParamsStatus string +func (r *AccountMemberReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -const ( - AccountMemberNewParamsStatusAccepted AccountMemberNewParamsStatus = "accepted" - AccountMemberNewParamsStatusPending AccountMemberNewParamsStatus = "pending" -) +type AccountMemberReplaceResponseRole struct { + // Role identifier tag. + ID string `json:"id,required"` + // Description of role's permissions. + Description string `json:"description,required"` + // Role name. + Name string `json:"name,required"` + Permissions AccountMemberReplaceResponseRolesPermissions `json:"permissions,required"` + JSON accountMemberReplaceResponseRoleJSON `json:"-"` +} -type AccountMemberNewResponseEnvelope struct { - Errors []AccountMemberNewResponseEnvelopeErrors `json:"errors,required"` - Messages []AccountMemberNewResponseEnvelopeMessages `json:"messages,required"` - Result AccountMemberNewResponse `json:"result,required"` - // Whether the API call was successful - Success AccountMemberNewResponseEnvelopeSuccess `json:"success,required"` - JSON accountMemberNewResponseEnvelopeJSON `json:"-"` +// accountMemberReplaceResponseRoleJSON contains the JSON metadata for the struct +// [AccountMemberReplaceResponseRole] +type accountMemberReplaceResponseRoleJSON struct { + ID apijson.Field + Description apijson.Field + Name apijson.Field + Permissions apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// accountMemberNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [AccountMemberNewResponseEnvelope] -type accountMemberNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field +func (r *AccountMemberReplaceResponseRole) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccountMemberReplaceResponseRolesPermissions struct { + Analytics AccountMemberReplaceResponseRolesPermissionsAnalytics `json:"analytics"` + Billing AccountMemberReplaceResponseRolesPermissionsBilling `json:"billing"` + CachePurge AccountMemberReplaceResponseRolesPermissionsCachePurge `json:"cache_purge"` + DNS AccountMemberReplaceResponseRolesPermissionsDNS `json:"dns"` + DNSRecords AccountMemberReplaceResponseRolesPermissionsDNSRecords `json:"dns_records"` + Lb AccountMemberReplaceResponseRolesPermissionsLb `json:"lb"` + Logs AccountMemberReplaceResponseRolesPermissionsLogs `json:"logs"` + Organization AccountMemberReplaceResponseRolesPermissionsOrganization `json:"organization"` + SSL AccountMemberReplaceResponseRolesPermissionsSSL `json:"ssl"` + WAF AccountMemberReplaceResponseRolesPermissionsWAF `json:"waf"` + ZoneSettings AccountMemberReplaceResponseRolesPermissionsZoneSettings `json:"zone_settings"` + Zones AccountMemberReplaceResponseRolesPermissionsZones `json:"zones"` + JSON accountMemberReplaceResponseRolesPermissionsJSON `json:"-"` +} + +// accountMemberReplaceResponseRolesPermissionsJSON contains the JSON metadata for +// the struct [AccountMemberReplaceResponseRolesPermissions] +type accountMemberReplaceResponseRolesPermissionsJSON struct { + Analytics apijson.Field + Billing apijson.Field + CachePurge apijson.Field + DNS apijson.Field + DNSRecords apijson.Field + Lb apijson.Field + Logs apijson.Field + Organization apijson.Field + SSL apijson.Field + WAF apijson.Field + ZoneSettings apijson.Field + Zones apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccountMemberReplaceResponseRolesPermissions) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccountMemberReplaceResponseRolesPermissionsAnalytics struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsAnalyticsJSON `json:"-"` +} + +// accountMemberReplaceResponseRolesPermissionsAnalyticsJSON contains the JSON +// metadata for the struct [AccountMemberReplaceResponseRolesPermissionsAnalytics] +type accountMemberReplaceResponseRolesPermissionsAnalyticsJSON struct { + Read apijson.Field + Write apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountMemberNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberReplaceResponseRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountMemberNewResponseEnvelopeErrorsJSON `json:"-"` +type AccountMemberReplaceResponseRolesPermissionsBilling struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsBillingJSON `json:"-"` } -// accountMemberNewResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccountMemberNewResponseEnvelopeErrors] -type accountMemberNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field +// accountMemberReplaceResponseRolesPermissionsBillingJSON contains the JSON +// metadata for the struct [AccountMemberReplaceResponseRolesPermissionsBilling] +type accountMemberReplaceResponseRolesPermissionsBillingJSON struct { + Read apijson.Field + Write apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountMemberNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberReplaceResponseRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountMemberNewResponseEnvelopeMessagesJSON `json:"-"` +type AccountMemberReplaceResponseRolesPermissionsCachePurge struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsCachePurgeJSON `json:"-"` } -// accountMemberNewResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AccountMemberNewResponseEnvelopeMessages] -type accountMemberNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field +// accountMemberReplaceResponseRolesPermissionsCachePurgeJSON contains the JSON +// metadata for the struct [AccountMemberReplaceResponseRolesPermissionsCachePurge] +type accountMemberReplaceResponseRolesPermissionsCachePurgeJSON struct { + Read apijson.Field + Write apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountMemberNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberReplaceResponseRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type AccountMemberNewResponseEnvelopeSuccess bool +type AccountMemberReplaceResponseRolesPermissionsDNS struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsDNSJSON `json:"-"` +} -const ( - AccountMemberNewResponseEnvelopeSuccessTrue AccountMemberNewResponseEnvelopeSuccess = true -) +// accountMemberReplaceResponseRolesPermissionsDNSJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsDNS] +type accountMemberReplaceResponseRolesPermissionsDNSJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field +} -type AccountMemberUpdateParams struct { - // Roles assigned to this member. - Roles param.Field[[]AccountMemberUpdateParamsRole] `json:"roles,required"` +func (r *AccountMemberReplaceResponseRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccountMemberUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccountMemberReplaceResponseRolesPermissionsDNSRecords struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsDNSRecordsJSON `json:"-"` } -type AccountMemberUpdateParamsRole struct { - // Role identifier tag. - ID param.Field[string] `json:"id,required"` +// accountMemberReplaceResponseRolesPermissionsDNSRecordsJSON contains the JSON +// metadata for the struct [AccountMemberReplaceResponseRolesPermissionsDNSRecords] +type accountMemberReplaceResponseRolesPermissionsDNSRecordsJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r AccountMemberUpdateParamsRole) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *AccountMemberReplaceResponseRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateParamsRolesPermissions struct { - Analytics param.Field[AccountMemberUpdateParamsRolesPermissionsAnalytics] `json:"analytics"` - Billing param.Field[AccountMemberUpdateParamsRolesPermissionsBilling] `json:"billing"` - CachePurge param.Field[AccountMemberUpdateParamsRolesPermissionsCachePurge] `json:"cache_purge"` - DNS param.Field[AccountMemberUpdateParamsRolesPermissionsDNS] `json:"dns"` - DNSRecords param.Field[AccountMemberUpdateParamsRolesPermissionsDNSRecords] `json:"dns_records"` - Lb param.Field[AccountMemberUpdateParamsRolesPermissionsLb] `json:"lb"` - Logs param.Field[AccountMemberUpdateParamsRolesPermissionsLogs] `json:"logs"` - Organization param.Field[AccountMemberUpdateParamsRolesPermissionsOrganization] `json:"organization"` - SSL param.Field[AccountMemberUpdateParamsRolesPermissionsSSL] `json:"ssl"` - WAF param.Field[AccountMemberUpdateParamsRolesPermissionsWAF] `json:"waf"` - ZoneSettings param.Field[AccountMemberUpdateParamsRolesPermissionsZoneSettings] `json:"zone_settings"` - Zones param.Field[AccountMemberUpdateParamsRolesPermissionsZones] `json:"zones"` +type AccountMemberReplaceResponseRolesPermissionsLb struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsLbJSON `json:"-"` } -func (r AccountMemberUpdateParamsRolesPermissions) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accountMemberReplaceResponseRolesPermissionsLbJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsLb] +type accountMemberReplaceResponseRolesPermissionsLbJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccountMemberUpdateParamsRolesPermissionsAnalytics struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +func (r *AccountMemberReplaceResponseRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccountMemberUpdateParamsRolesPermissionsAnalytics) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccountMemberReplaceResponseRolesPermissionsLogs struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsLogsJSON `json:"-"` } -type AccountMemberUpdateParamsRolesPermissionsBilling struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +// accountMemberReplaceResponseRolesPermissionsLogsJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsLogs] +type accountMemberReplaceResponseRolesPermissionsLogsJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r AccountMemberUpdateParamsRolesPermissionsBilling) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *AccountMemberReplaceResponseRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateParamsRolesPermissionsCachePurge struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +type AccountMemberReplaceResponseRolesPermissionsOrganization struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsOrganizationJSON `json:"-"` } -func (r AccountMemberUpdateParamsRolesPermissionsCachePurge) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accountMemberReplaceResponseRolesPermissionsOrganizationJSON contains the JSON +// metadata for the struct +// [AccountMemberReplaceResponseRolesPermissionsOrganization] +type accountMemberReplaceResponseRolesPermissionsOrganizationJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccountMemberUpdateParamsRolesPermissionsDNS struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +func (r *AccountMemberReplaceResponseRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccountMemberUpdateParamsRolesPermissionsDNS) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccountMemberReplaceResponseRolesPermissionsSSL struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsSSLJSON `json:"-"` } -type AccountMemberUpdateParamsRolesPermissionsDNSRecords struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +// accountMemberReplaceResponseRolesPermissionsSSLJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsSSL] +type accountMemberReplaceResponseRolesPermissionsSSLJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r AccountMemberUpdateParamsRolesPermissionsDNSRecords) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *AccountMemberReplaceResponseRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateParamsRolesPermissionsLb struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +type AccountMemberReplaceResponseRolesPermissionsWAF struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsWAFJSON `json:"-"` } -func (r AccountMemberUpdateParamsRolesPermissionsLb) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accountMemberReplaceResponseRolesPermissionsWAFJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsWAF] +type accountMemberReplaceResponseRolesPermissionsWAFJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccountMemberUpdateParamsRolesPermissionsLogs struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +func (r *AccountMemberReplaceResponseRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccountMemberUpdateParamsRolesPermissionsLogs) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccountMemberReplaceResponseRolesPermissionsZoneSettings struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsZoneSettingsJSON `json:"-"` } -type AccountMemberUpdateParamsRolesPermissionsOrganization struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +// accountMemberReplaceResponseRolesPermissionsZoneSettingsJSON contains the JSON +// metadata for the struct +// [AccountMemberReplaceResponseRolesPermissionsZoneSettings] +type accountMemberReplaceResponseRolesPermissionsZoneSettingsJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r AccountMemberUpdateParamsRolesPermissionsOrganization) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *AccountMemberReplaceResponseRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateParamsRolesPermissionsSSL struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +type AccountMemberReplaceResponseRolesPermissionsZones struct { + Read bool `json:"read"` + Write bool `json:"write"` + JSON accountMemberReplaceResponseRolesPermissionsZonesJSON `json:"-"` } -func (r AccountMemberUpdateParamsRolesPermissionsSSL) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// accountMemberReplaceResponseRolesPermissionsZonesJSON contains the JSON metadata +// for the struct [AccountMemberReplaceResponseRolesPermissionsZones] +type accountMemberReplaceResponseRolesPermissionsZonesJSON struct { + Read apijson.Field + Write apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AccountMemberUpdateParamsRolesPermissionsWAF struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +func (r *AccountMemberReplaceResponseRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AccountMemberUpdateParamsRolesPermissionsWAF) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AccountMemberReplaceResponseUser struct { + // The contact email address of the user. + Email string `json:"email,required"` + // Identifier + ID string `json:"id"` + // User's first name + FirstName string `json:"first_name,nullable"` + // User's last name + LastName string `json:"last_name,nullable"` + // Indicates whether two-factor authentication is enabled for the user account. + // Does not apply to API authentication. + TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"` + JSON accountMemberReplaceResponseUserJSON `json:"-"` } -type AccountMemberUpdateParamsRolesPermissionsZoneSettings struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +// accountMemberReplaceResponseUserJSON contains the JSON metadata for the struct +// [AccountMemberReplaceResponseUser] +type accountMemberReplaceResponseUserJSON struct { + Email apijson.Field + ID apijson.Field + FirstName apijson.Field + LastName apijson.Field + TwoFactorAuthenticationEnabled apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r AccountMemberUpdateParamsRolesPermissionsZoneSettings) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *AccountMemberReplaceResponseUser) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateParamsRolesPermissionsZones struct { - Read param.Field[bool] `json:"read"` - Write param.Field[bool] `json:"write"` +type AccountMemberNewParams struct { + // The contact email address of the user. + Email param.Field[string] `json:"email,required"` + // Array of roles associated with this member. + Roles param.Field[[]string] `json:"roles,required"` + Status param.Field[AccountMemberNewParamsStatus] `json:"status"` } -func (r AccountMemberUpdateParamsRolesPermissionsZones) MarshalJSON() (data []byte, err error) { +func (r AccountMemberNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AccountMemberUpdateResponseEnvelope struct { - Errors []AccountMemberUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AccountMemberUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AccountMemberUpdateResponse `json:"result,required"` +type AccountMemberNewParamsStatus string + +const ( + AccountMemberNewParamsStatusAccepted AccountMemberNewParamsStatus = "accepted" + AccountMemberNewParamsStatusPending AccountMemberNewParamsStatus = "pending" +) + +type AccountMemberNewResponseEnvelope struct { + Errors []AccountMemberNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AccountMemberNewResponseEnvelopeMessages `json:"messages,required"` + Result AccountMemberNewResponse `json:"result,required"` // Whether the API call was successful - Success AccountMemberUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON accountMemberUpdateResponseEnvelopeJSON `json:"-"` + Success AccountMemberNewResponseEnvelopeSuccess `json:"success,required"` + JSON accountMemberNewResponseEnvelopeJSON `json:"-"` } -// accountMemberUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AccountMemberUpdateResponseEnvelope] -type accountMemberUpdateResponseEnvelopeJSON struct { +// accountMemberNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AccountMemberNewResponseEnvelope] +type accountMemberNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1497,53 +1283,53 @@ type accountMemberUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AccountMemberUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountMemberUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AccountMemberNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountMemberNewResponseEnvelopeErrorsJSON `json:"-"` } -// accountMemberUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AccountMemberUpdateResponseEnvelopeErrors] -type accountMemberUpdateResponseEnvelopeErrorsJSON struct { +// accountMemberNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AccountMemberNewResponseEnvelopeErrors] +type accountMemberNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountMemberUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AccountMemberUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON accountMemberUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AccountMemberNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountMemberNewResponseEnvelopeMessagesJSON `json:"-"` } -// accountMemberUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [AccountMemberUpdateResponseEnvelopeMessages] -type accountMemberUpdateResponseEnvelopeMessagesJSON struct { +// accountMemberNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AccountMemberNewResponseEnvelopeMessages] +type accountMemberNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccountMemberUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AccountMemberNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AccountMemberUpdateResponseEnvelopeSuccess bool +type AccountMemberNewResponseEnvelopeSuccess bool const ( - AccountMemberUpdateResponseEnvelopeSuccessTrue AccountMemberUpdateResponseEnvelopeSuccess = true + AccountMemberNewResponseEnvelopeSuccessTrue AccountMemberNewResponseEnvelopeSuccess = true ) type AccountMemberListParams struct { @@ -1732,3 +1518,217 @@ type AccountMemberGetResponseEnvelopeSuccess bool const ( AccountMemberGetResponseEnvelopeSuccessTrue AccountMemberGetResponseEnvelopeSuccess = true ) + +type AccountMemberReplaceParams struct { + // Roles assigned to this member. + Roles param.Field[[]AccountMemberReplaceParamsRole] `json:"roles,required"` +} + +func (r AccountMemberReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRole struct { + // Role identifier tag. + ID param.Field[string] `json:"id,required"` +} + +func (r AccountMemberReplaceParamsRole) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissions struct { + Analytics param.Field[AccountMemberReplaceParamsRolesPermissionsAnalytics] `json:"analytics"` + Billing param.Field[AccountMemberReplaceParamsRolesPermissionsBilling] `json:"billing"` + CachePurge param.Field[AccountMemberReplaceParamsRolesPermissionsCachePurge] `json:"cache_purge"` + DNS param.Field[AccountMemberReplaceParamsRolesPermissionsDNS] `json:"dns"` + DNSRecords param.Field[AccountMemberReplaceParamsRolesPermissionsDNSRecords] `json:"dns_records"` + Lb param.Field[AccountMemberReplaceParamsRolesPermissionsLb] `json:"lb"` + Logs param.Field[AccountMemberReplaceParamsRolesPermissionsLogs] `json:"logs"` + Organization param.Field[AccountMemberReplaceParamsRolesPermissionsOrganization] `json:"organization"` + SSL param.Field[AccountMemberReplaceParamsRolesPermissionsSSL] `json:"ssl"` + WAF param.Field[AccountMemberReplaceParamsRolesPermissionsWAF] `json:"waf"` + ZoneSettings param.Field[AccountMemberReplaceParamsRolesPermissionsZoneSettings] `json:"zone_settings"` + Zones param.Field[AccountMemberReplaceParamsRolesPermissionsZones] `json:"zones"` +} + +func (r AccountMemberReplaceParamsRolesPermissions) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsAnalytics struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsAnalytics) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsBilling struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsBilling) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsCachePurge struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsCachePurge) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsDNS struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsDNS) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsDNSRecords struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsDNSRecords) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsLb struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsLb) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsLogs struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsLogs) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsOrganization struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsOrganization) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsSSL struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsSSL) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsWAF struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsWAF) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsZoneSettings struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsZoneSettings) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceParamsRolesPermissionsZones struct { + Read param.Field[bool] `json:"read"` + Write param.Field[bool] `json:"write"` +} + +func (r AccountMemberReplaceParamsRolesPermissionsZones) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AccountMemberReplaceResponseEnvelope struct { + Errors []AccountMemberReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AccountMemberReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AccountMemberReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success AccountMemberReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON accountMemberReplaceResponseEnvelopeJSON `json:"-"` +} + +// accountMemberReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AccountMemberReplaceResponseEnvelope] +type accountMemberReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccountMemberReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccountMemberReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountMemberReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// accountMemberReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AccountMemberReplaceResponseEnvelopeErrors] +type accountMemberReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccountMemberReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AccountMemberReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON accountMemberReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// accountMemberReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AccountMemberReplaceResponseEnvelopeMessages] +type accountMemberReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AccountMemberReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AccountMemberReplaceResponseEnvelopeSuccess bool + +const ( + AccountMemberReplaceResponseEnvelopeSuccessTrue AccountMemberReplaceResponseEnvelopeSuccess = true +) diff --git a/accountmember_test.go b/accountmember_test.go index 5fe1939ed8c..d0c21e6ddd0 100644 --- a/accountmember_test.go +++ b/accountmember_test.go @@ -47,7 +47,7 @@ func TestAccountMemberNewWithOptionalParams(t *testing.T) { } } -func TestAccountMemberUpdate(t *testing.T) { +func TestAccountMemberListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,18 +63,15 @@ func TestAccountMemberUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AccountMembers.Update( + _, err := client.AccountMembers.List( context.TODO(), map[string]interface{}{}, - "4536bcfad5faccb111b47003c79917fa", - cloudflare.AccountMemberUpdateParams{ - Roles: cloudflare.F([]cloudflare.AccountMemberUpdateParamsRole{{ - ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), - }, { - ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), - }, { - ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), - }}), + cloudflare.AccountMemberListParams{ + Direction: cloudflare.F(cloudflare.AccountMemberListParamsDirectionDesc), + Order: cloudflare.F(cloudflare.AccountMemberListParamsOrderStatus), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Status: cloudflare.F(cloudflare.AccountMemberListParamsStatusAccepted), }, ) if err != nil { @@ -86,7 +83,7 @@ func TestAccountMemberUpdate(t *testing.T) { } } -func TestAccountMemberListWithOptionalParams(t *testing.T) { +func TestAccountMemberDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -102,16 +99,10 @@ func TestAccountMemberListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AccountMembers.List( + _, err := client.AccountMembers.Delete( context.TODO(), map[string]interface{}{}, - cloudflare.AccountMemberListParams{ - Direction: cloudflare.F(cloudflare.AccountMemberListParamsDirectionDesc), - Order: cloudflare.F(cloudflare.AccountMemberListParamsOrderStatus), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - Status: cloudflare.F(cloudflare.AccountMemberListParamsStatusAccepted), - }, + "4536bcfad5faccb111b47003c79917fa", ) if err != nil { var apierr *cloudflare.Error @@ -122,7 +113,7 @@ func TestAccountMemberListWithOptionalParams(t *testing.T) { } } -func TestAccountMemberDelete(t *testing.T) { +func TestAccountMemberGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -138,7 +129,7 @@ func TestAccountMemberDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AccountMembers.Delete( + _, err := client.AccountMembers.Get( context.TODO(), map[string]interface{}{}, "4536bcfad5faccb111b47003c79917fa", @@ -152,7 +143,7 @@ func TestAccountMemberDelete(t *testing.T) { } } -func TestAccountMemberGet(t *testing.T) { +func TestAccountMemberReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -168,10 +159,19 @@ func TestAccountMemberGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AccountMembers.Get( + _, err := client.AccountMembers.Replace( context.TODO(), map[string]interface{}{}, "4536bcfad5faccb111b47003c79917fa", + cloudflare.AccountMemberReplaceParams{ + Roles: cloudflare.F([]cloudflare.AccountMemberReplaceParamsRole{{ + ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), + }, { + ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), + }, { + ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), + }}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/acmtotaltls.go b/acmtotaltls.go index 36a11e94d90..7cea72015c2 100644 --- a/acmtotaltls.go +++ b/acmtotaltls.go @@ -32,9 +32,9 @@ func NewAcmTotalTLSService(opts ...option.RequestOption) (r *AcmTotalTLSService) } // Set Total TLS Settings or disable the feature for a Zone. -func (r *AcmTotalTLSService) Update(ctx context.Context, zoneID string, body AcmTotalTLSUpdateParams, opts ...option.RequestOption) (res *AcmTotalTLSUpdateResponse, err error) { +func (r *AcmTotalTLSService) New(ctx context.Context, zoneID string, body AcmTotalTLSNewParams, opts ...option.RequestOption) (res *AcmTotalTLSNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AcmTotalTLSUpdateResponseEnvelope + var env AcmTotalTLSNewResponseEnvelope path := fmt.Sprintf("zones/%s/acm/total_tls", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -57,20 +57,20 @@ func (r *AcmTotalTLSService) Get(ctx context.Context, zoneID string, opts ...opt return } -type AcmTotalTLSUpdateResponse struct { +type AcmTotalTLSNewResponse struct { // The Certificate Authority that Total TLS certificates will be issued through. - CertificateAuthority AcmTotalTLSUpdateResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority AcmTotalTLSNewResponseCertificateAuthority `json:"certificate_authority"` // If enabled, Total TLS will order a hostname specific TLS certificate for any // proxied A, AAAA, or CNAME record in your zone. Enabled bool `json:"enabled"` // The validity period in days for the certificates ordered via Total TLS. - ValidityDays AcmTotalTLSUpdateResponseValidityDays `json:"validity_days"` - JSON acmTotalTLSUpdateResponseJSON `json:"-"` + ValidityDays AcmTotalTLSNewResponseValidityDays `json:"validity_days"` + JSON acmTotalTLSNewResponseJSON `json:"-"` } -// acmTotalTLSUpdateResponseJSON contains the JSON metadata for the struct -// [AcmTotalTLSUpdateResponse] -type acmTotalTLSUpdateResponseJSON struct { +// acmTotalTLSNewResponseJSON contains the JSON metadata for the struct +// [AcmTotalTLSNewResponse] +type acmTotalTLSNewResponseJSON struct { CertificateAuthority apijson.Field Enabled apijson.Field ValidityDays apijson.Field @@ -78,23 +78,23 @@ type acmTotalTLSUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AcmTotalTLSUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AcmTotalTLSNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The Certificate Authority that Total TLS certificates will be issued through. -type AcmTotalTLSUpdateResponseCertificateAuthority string +type AcmTotalTLSNewResponseCertificateAuthority string const ( - AcmTotalTLSUpdateResponseCertificateAuthorityGoogle AcmTotalTLSUpdateResponseCertificateAuthority = "google" - AcmTotalTLSUpdateResponseCertificateAuthorityLetsEncrypt AcmTotalTLSUpdateResponseCertificateAuthority = "lets_encrypt" + AcmTotalTLSNewResponseCertificateAuthorityGoogle AcmTotalTLSNewResponseCertificateAuthority = "google" + AcmTotalTLSNewResponseCertificateAuthorityLetsEncrypt AcmTotalTLSNewResponseCertificateAuthority = "lets_encrypt" ) // The validity period in days for the certificates ordered via Total TLS. -type AcmTotalTLSUpdateResponseValidityDays int64 +type AcmTotalTLSNewResponseValidityDays int64 const ( - AcmTotalTLSUpdateResponseValidityDays90 AcmTotalTLSUpdateResponseValidityDays = 90 + AcmTotalTLSNewResponseValidityDays90 AcmTotalTLSNewResponseValidityDays = 90 ) type AcmTotalTLSGetResponse struct { @@ -137,38 +137,38 @@ const ( AcmTotalTLSGetResponseValidityDays90 AcmTotalTLSGetResponseValidityDays = 90 ) -type AcmTotalTLSUpdateParams struct { +type AcmTotalTLSNewParams struct { // If enabled, Total TLS will order a hostname specific TLS certificate for any // proxied A, AAAA, or CNAME record in your zone. Enabled param.Field[bool] `json:"enabled,required"` // The Certificate Authority that Total TLS certificates will be issued through. - CertificateAuthority param.Field[AcmTotalTLSUpdateParamsCertificateAuthority] `json:"certificate_authority"` + CertificateAuthority param.Field[AcmTotalTLSNewParamsCertificateAuthority] `json:"certificate_authority"` } -func (r AcmTotalTLSUpdateParams) MarshalJSON() (data []byte, err error) { +func (r AcmTotalTLSNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The Certificate Authority that Total TLS certificates will be issued through. -type AcmTotalTLSUpdateParamsCertificateAuthority string +type AcmTotalTLSNewParamsCertificateAuthority string const ( - AcmTotalTLSUpdateParamsCertificateAuthorityGoogle AcmTotalTLSUpdateParamsCertificateAuthority = "google" - AcmTotalTLSUpdateParamsCertificateAuthorityLetsEncrypt AcmTotalTLSUpdateParamsCertificateAuthority = "lets_encrypt" + AcmTotalTLSNewParamsCertificateAuthorityGoogle AcmTotalTLSNewParamsCertificateAuthority = "google" + AcmTotalTLSNewParamsCertificateAuthorityLetsEncrypt AcmTotalTLSNewParamsCertificateAuthority = "lets_encrypt" ) -type AcmTotalTLSUpdateResponseEnvelope struct { - Errors []AcmTotalTLSUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AcmTotalTLSUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AcmTotalTLSUpdateResponse `json:"result,required"` +type AcmTotalTLSNewResponseEnvelope struct { + Errors []AcmTotalTLSNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AcmTotalTLSNewResponseEnvelopeMessages `json:"messages,required"` + Result AcmTotalTLSNewResponse `json:"result,required"` // Whether the API call was successful - Success AcmTotalTLSUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON acmTotalTLSUpdateResponseEnvelopeJSON `json:"-"` + Success AcmTotalTLSNewResponseEnvelopeSuccess `json:"success,required"` + JSON acmTotalTLSNewResponseEnvelopeJSON `json:"-"` } -// acmTotalTLSUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [AcmTotalTLSUpdateResponseEnvelope] -type acmTotalTLSUpdateResponseEnvelopeJSON struct { +// acmTotalTLSNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AcmTotalTLSNewResponseEnvelope] +type acmTotalTLSNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -177,53 +177,53 @@ type acmTotalTLSUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AcmTotalTLSUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AcmTotalTLSNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AcmTotalTLSUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON acmTotalTLSUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AcmTotalTLSNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON acmTotalTLSNewResponseEnvelopeErrorsJSON `json:"-"` } -// acmTotalTLSUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [AcmTotalTLSUpdateResponseEnvelopeErrors] -type acmTotalTLSUpdateResponseEnvelopeErrorsJSON struct { +// acmTotalTLSNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AcmTotalTLSNewResponseEnvelopeErrors] +type acmTotalTLSNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AcmTotalTLSUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AcmTotalTLSNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AcmTotalTLSUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON acmTotalTLSUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AcmTotalTLSNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON acmTotalTLSNewResponseEnvelopeMessagesJSON `json:"-"` } -// acmTotalTLSUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [AcmTotalTLSUpdateResponseEnvelopeMessages] -type acmTotalTLSUpdateResponseEnvelopeMessagesJSON struct { +// acmTotalTLSNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AcmTotalTLSNewResponseEnvelopeMessages] +type acmTotalTLSNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AcmTotalTLSUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AcmTotalTLSNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AcmTotalTLSUpdateResponseEnvelopeSuccess bool +type AcmTotalTLSNewResponseEnvelopeSuccess bool const ( - AcmTotalTLSUpdateResponseEnvelopeSuccessTrue AcmTotalTLSUpdateResponseEnvelopeSuccess = true + AcmTotalTLSNewResponseEnvelopeSuccessTrue AcmTotalTLSNewResponseEnvelopeSuccess = true ) type AcmTotalTLSGetResponseEnvelope struct { diff --git a/acmtotaltls_test.go b/acmtotaltls_test.go index bd702e5366d..d0d43971c46 100644 --- a/acmtotaltls_test.go +++ b/acmtotaltls_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAcmTotalTLSUpdateWithOptionalParams(t *testing.T) { +func TestAcmTotalTLSNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,12 @@ func TestAcmTotalTLSUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Acms.TotalTLS.Update( + _, err := client.Acm.TotalTLS.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AcmTotalTLSUpdateParams{ + cloudflare.AcmTotalTLSNewParams{ Enabled: cloudflare.F(true), - CertificateAuthority: cloudflare.F(cloudflare.AcmTotalTLSUpdateParamsCertificateAuthorityGoogle), + CertificateAuthority: cloudflare.F(cloudflare.AcmTotalTLSNewParamsCertificateAuthorityGoogle), }, ) if err != nil { @@ -62,7 +62,7 @@ func TestAcmTotalTLSGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Acms.TotalTLS.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Acm.TotalTLS.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/activationcheck.go b/activationcheck.go index bc9092c3c3f..07ef4b27741 100644 --- a/activationcheck.go +++ b/activationcheck.go @@ -32,9 +32,9 @@ func NewActivationCheckService(opts ...option.RequestOption) (r *ActivationCheck // Triggeres a new activation check for a PENDING Zone. This can be triggered every // 5 min for paygo/ent customers, every hour for FREE Zones. -func (r *ActivationCheckService) PutZonesZoneIDActivationCheck(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ActivationCheckPutZonesZoneIDActivationCheckResponse, err error) { +func (r *ActivationCheckService) Replace(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ActivationCheckReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelope + var env ActivationCheckReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/activation_check", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { @@ -44,37 +44,36 @@ func (r *ActivationCheckService) PutZonesZoneIDActivationCheck(ctx context.Conte return } -type ActivationCheckPutZonesZoneIDActivationCheckResponse struct { +type ActivationCheckReplaceResponse struct { // Identifier - ID string `json:"id"` - JSON activationCheckPutZonesZoneIDActivationCheckResponseJSON `json:"-"` + ID string `json:"id"` + JSON activationCheckReplaceResponseJSON `json:"-"` } -// activationCheckPutZonesZoneIDActivationCheckResponseJSON contains the JSON -// metadata for the struct [ActivationCheckPutZonesZoneIDActivationCheckResponse] -type activationCheckPutZonesZoneIDActivationCheckResponseJSON struct { +// activationCheckReplaceResponseJSON contains the JSON metadata for the struct +// [ActivationCheckReplaceResponse] +type activationCheckReplaceResponseJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ActivationCheckPutZonesZoneIDActivationCheckResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ActivationCheckReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelope struct { - Errors []ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrors `json:"errors,required"` - Messages []ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessages `json:"messages,required"` - Result ActivationCheckPutZonesZoneIDActivationCheckResponse `json:"result,required"` +type ActivationCheckReplaceResponseEnvelope struct { + Errors []ActivationCheckReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []ActivationCheckReplaceResponseEnvelopeMessages `json:"messages,required"` + Result ActivationCheckReplaceResponse `json:"result,required"` // Whether the API call was successful - Success ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeSuccess `json:"success,required"` - JSON activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeJSON `json:"-"` + Success ActivationCheckReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON activationCheckReplaceResponseEnvelopeJSON `json:"-"` } -// activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelope] -type activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeJSON struct { +// activationCheckReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [ActivationCheckReplaceResponseEnvelope] +type activationCheckReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -83,53 +82,51 @@ type activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ActivationCheckReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrorsJSON `json:"-"` +type ActivationCheckReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON activationCheckReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrors] -type activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrorsJSON struct { +// activationCheckReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ActivationCheckReplaceResponseEnvelopeErrors] +type activationCheckReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ActivationCheckReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessagesJSON `json:"-"` +type ActivationCheckReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON activationCheckReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessages] -type activationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessagesJSON struct { +// activationCheckReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ActivationCheckReplaceResponseEnvelopeMessages] +type activationCheckReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ActivationCheckReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeSuccess bool +type ActivationCheckReplaceResponseEnvelopeSuccess bool const ( - ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeSuccessTrue ActivationCheckPutZonesZoneIDActivationCheckResponseEnvelopeSuccess = true + ActivationCheckReplaceResponseEnvelopeSuccessTrue ActivationCheckReplaceResponseEnvelopeSuccess = true ) diff --git a/activationcheck_test.go b/activationcheck_test.go index 0b1e1ebdffc..e4fe2dcd27a 100644 --- a/activationcheck_test.go +++ b/activationcheck_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestActivationCheckPutZonesZoneIDActivationCheck(t *testing.T) { +func TestActivationCheckReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestActivationCheckPutZonesZoneIDActivationCheck(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ActivationChecks.PutZonesZoneIDActivationCheck(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.ActivationChecks.Replace(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/addressaddressmapaccount.go b/addressaddressmapaccount.go index 95b838ea37f..d2f2fa3be40 100644 --- a/addressaddressmapaccount.go +++ b/addressaddressmapaccount.go @@ -33,12 +33,12 @@ func NewAddressAddressMapAccountService(opts ...option.RequestOption) (r *Addres return } -// Add an account as a member of a particular address map. -func (r *AddressAddressMapAccountService) Update(ctx context.Context, accountID string, addressMapID string, opts ...option.RequestOption) (res *AddressAddressMapAccountUpdateResponse, err error) { +// Remove an account as a member of a particular address map. +func (r *AddressAddressMapAccountService) Delete(ctx context.Context, accountID string, addressMapID string, opts ...option.RequestOption) (res *AddressAddressMapAccountDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapAccountUpdateResponseEnvelope + var env AddressAddressMapAccountDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/:account_id", accountID, addressMapID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -46,12 +46,12 @@ func (r *AddressAddressMapAccountService) Update(ctx context.Context, accountID return } -// Remove an account as a member of a particular address map. -func (r *AddressAddressMapAccountService) Delete(ctx context.Context, accountID string, addressMapID string, opts ...option.RequestOption) (res *AddressAddressMapAccountDeleteResponse, err error) { +// Add an account as a member of a particular address map. +func (r *AddressAddressMapAccountService) Replace(ctx context.Context, accountID string, addressMapID string, opts ...option.RequestOption) (res *AddressAddressMapAccountReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapAccountDeleteResponseEnvelope + var env AddressAddressMapAccountReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/:account_id", accountID, addressMapID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return } @@ -59,15 +59,15 @@ func (r *AddressAddressMapAccountService) Delete(ctx context.Context, accountID return } -// Union satisfied by [AddressAddressMapAccountUpdateResponseUnknown], -// [AddressAddressMapAccountUpdateResponseArray] or [shared.UnionString]. -type AddressAddressMapAccountUpdateResponse interface { - ImplementsAddressAddressMapAccountUpdateResponse() +// Union satisfied by [AddressAddressMapAccountDeleteResponseUnknown], +// [AddressAddressMapAccountDeleteResponseArray] or [shared.UnionString]. +type AddressAddressMapAccountDeleteResponse interface { + ImplementsAddressAddressMapAccountDeleteResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapAccountUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapAccountDeleteResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -76,20 +76,20 @@ func init() { ) } -type AddressAddressMapAccountUpdateResponseArray []interface{} +type AddressAddressMapAccountDeleteResponseArray []interface{} -func (r AddressAddressMapAccountUpdateResponseArray) ImplementsAddressAddressMapAccountUpdateResponse() { +func (r AddressAddressMapAccountDeleteResponseArray) ImplementsAddressAddressMapAccountDeleteResponse() { } -// Union satisfied by [AddressAddressMapAccountDeleteResponseUnknown], -// [AddressAddressMapAccountDeleteResponseArray] or [shared.UnionString]. -type AddressAddressMapAccountDeleteResponse interface { - ImplementsAddressAddressMapAccountDeleteResponse() +// Union satisfied by [AddressAddressMapAccountReplaceResponseUnknown], +// [AddressAddressMapAccountReplaceResponseArray] or [shared.UnionString]. +type AddressAddressMapAccountReplaceResponse interface { + ImplementsAddressAddressMapAccountReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapAccountDeleteResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapAccountReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -98,24 +98,24 @@ func init() { ) } -type AddressAddressMapAccountDeleteResponseArray []interface{} +type AddressAddressMapAccountReplaceResponseArray []interface{} -func (r AddressAddressMapAccountDeleteResponseArray) ImplementsAddressAddressMapAccountDeleteResponse() { +func (r AddressAddressMapAccountReplaceResponseArray) ImplementsAddressAddressMapAccountReplaceResponse() { } -type AddressAddressMapAccountUpdateResponseEnvelope struct { - Errors []AddressAddressMapAccountUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapAccountUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapAccountUpdateResponse `json:"result,required,nullable"` +type AddressAddressMapAccountDeleteResponseEnvelope struct { + Errors []AddressAddressMapAccountDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapAccountDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapAccountDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapAccountUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapAccountUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapAccountUpdateResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapAccountDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapAccountDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapAccountDeleteResponseEnvelopeJSON `json:"-"` } -// addressAddressMapAccountUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [AddressAddressMapAccountUpdateResponseEnvelope] -type addressAddressMapAccountUpdateResponseEnvelopeJSON struct { +// addressAddressMapAccountDeleteResponseEnvelopeJSON contains the JSON metadata +// for the struct [AddressAddressMapAccountDeleteResponseEnvelope] +type addressAddressMapAccountDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -125,56 +125,56 @@ type addressAddressMapAccountUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapAccountUpdateResponseEnvelopeErrors struct { +type AddressAddressMapAccountDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapAccountUpdateResponseEnvelopeErrorsJSON `json:"-"` + JSON addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapAccountUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AddressAddressMapAccountUpdateResponseEnvelopeErrors] -type addressAddressMapAccountUpdateResponseEnvelopeErrorsJSON struct { +// addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AddressAddressMapAccountDeleteResponseEnvelopeErrors] +type addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapAccountUpdateResponseEnvelopeMessages struct { +type AddressAddressMapAccountDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapAccountUpdateResponseEnvelopeMessagesJSON `json:"-"` + JSON addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapAccountUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AddressAddressMapAccountUpdateResponseEnvelopeMessages] -type addressAddressMapAccountUpdateResponseEnvelopeMessagesJSON struct { +// addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressAddressMapAccountDeleteResponseEnvelopeMessages] +type addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapAccountUpdateResponseEnvelopeSuccess bool +type AddressAddressMapAccountDeleteResponseEnvelopeSuccess bool const ( - AddressAddressMapAccountUpdateResponseEnvelopeSuccessTrue AddressAddressMapAccountUpdateResponseEnvelopeSuccess = true + AddressAddressMapAccountDeleteResponseEnvelopeSuccessTrue AddressAddressMapAccountDeleteResponseEnvelopeSuccess = true ) -type AddressAddressMapAccountUpdateResponseEnvelopeResultInfo struct { +type AddressAddressMapAccountDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -183,13 +183,13 @@ type AddressAddressMapAccountUpdateResponseEnvelopeResultInfo struct { PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` - JSON addressAddressMapAccountUpdateResponseEnvelopeResultInfoJSON `json:"-"` + JSON addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapAccountUpdateResponseEnvelopeResultInfoJSON contains the JSON +// addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON contains the JSON // metadata for the struct -// [AddressAddressMapAccountUpdateResponseEnvelopeResultInfo] -type addressAddressMapAccountUpdateResponseEnvelopeResultInfoJSON struct { +// [AddressAddressMapAccountDeleteResponseEnvelopeResultInfo] +type addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -198,23 +198,23 @@ type addressAddressMapAccountUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapAccountDeleteResponseEnvelope struct { - Errors []AddressAddressMapAccountDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapAccountDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapAccountDeleteResponse `json:"result,required,nullable"` +type AddressAddressMapAccountReplaceResponseEnvelope struct { + Errors []AddressAddressMapAccountReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapAccountReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapAccountReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapAccountDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapAccountDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapAccountDeleteResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapAccountReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapAccountReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapAccountReplaceResponseEnvelopeJSON `json:"-"` } -// addressAddressMapAccountDeleteResponseEnvelopeJSON contains the JSON metadata -// for the struct [AddressAddressMapAccountDeleteResponseEnvelope] -type addressAddressMapAccountDeleteResponseEnvelopeJSON struct { +// addressAddressMapAccountReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [AddressAddressMapAccountReplaceResponseEnvelope] +type addressAddressMapAccountReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -224,56 +224,57 @@ type addressAddressMapAccountDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapAccountDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AddressAddressMapAccountReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapAccountReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AddressAddressMapAccountDeleteResponseEnvelopeErrors] -type addressAddressMapAccountDeleteResponseEnvelopeErrorsJSON struct { +// addressAddressMapAccountReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AddressAddressMapAccountReplaceResponseEnvelopeErrors] +type addressAddressMapAccountReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapAccountDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AddressAddressMapAccountReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapAccountReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AddressAddressMapAccountDeleteResponseEnvelopeMessages] -type addressAddressMapAccountDeleteResponseEnvelopeMessagesJSON struct { +// addressAddressMapAccountReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AddressAddressMapAccountReplaceResponseEnvelopeMessages] +type addressAddressMapAccountReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapAccountDeleteResponseEnvelopeSuccess bool +type AddressAddressMapAccountReplaceResponseEnvelopeSuccess bool const ( - AddressAddressMapAccountDeleteResponseEnvelopeSuccessTrue AddressAddressMapAccountDeleteResponseEnvelopeSuccess = true + AddressAddressMapAccountReplaceResponseEnvelopeSuccessTrue AddressAddressMapAccountReplaceResponseEnvelopeSuccess = true ) -type AddressAddressMapAccountDeleteResponseEnvelopeResultInfo struct { +type AddressAddressMapAccountReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -281,14 +282,14 @@ type AddressAddressMapAccountDeleteResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON addressAddressMapAccountReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON contains the JSON +// addressAddressMapAccountReplaceResponseEnvelopeResultInfoJSON contains the JSON // metadata for the struct -// [AddressAddressMapAccountDeleteResponseEnvelopeResultInfo] -type addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON struct { +// [AddressAddressMapAccountReplaceResponseEnvelopeResultInfo] +type addressAddressMapAccountReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -297,6 +298,6 @@ type addressAddressMapAccountDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapAccountDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapAccountReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/addressaddressmapaccount_test.go b/addressaddressmapaccount_test.go index 990059c0692..c5e74843482 100644 --- a/addressaddressmapaccount_test.go +++ b/addressaddressmapaccount_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressAddressMapAccountUpdate(t *testing.T) { +func TestAddressAddressMapAccountDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAddressAddressMapAccountUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.Accounts.Update( + _, err := client.Addresses.AddressMaps.Accounts.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -43,7 +43,7 @@ func TestAddressAddressMapAccountUpdate(t *testing.T) { } } -func TestAddressAddressMapAccountDelete(t *testing.T) { +func TestAddressAddressMapAccountReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +59,7 @@ func TestAddressAddressMapAccountDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.Accounts.Delete( + _, err := client.Addresses.AddressMaps.Accounts.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/addressaddressmapip.go b/addressaddressmapip.go index 8369247912e..230526de695 100644 --- a/addressaddressmapip.go +++ b/addressaddressmapip.go @@ -33,12 +33,12 @@ func NewAddressAddressMapIPService(opts ...option.RequestOption) (r *AddressAddr return } -// Add an IP from a prefix owned by the account to a particular address map. -func (r *AddressAddressMapIPService) Update(ctx context.Context, accountID string, addressMapID string, ipAddress string, opts ...option.RequestOption) (res *AddressAddressMapIPUpdateResponse, err error) { +// Remove an IP from a particular address map. +func (r *AddressAddressMapIPService) Delete(ctx context.Context, accountID string, addressMapID string, ipAddress string, opts ...option.RequestOption) (res *AddressAddressMapIPDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapIPUpdateResponseEnvelope + var env AddressAddressMapIPDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", accountID, addressMapID, ipAddress) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -46,12 +46,12 @@ func (r *AddressAddressMapIPService) Update(ctx context.Context, accountID strin return } -// Remove an IP from a particular address map. -func (r *AddressAddressMapIPService) Delete(ctx context.Context, accountID string, addressMapID string, ipAddress string, opts ...option.RequestOption) (res *AddressAddressMapIPDeleteResponse, err error) { +// Add an IP from a prefix owned by the account to a particular address map. +func (r *AddressAddressMapIPService) Replace(ctx context.Context, accountID string, addressMapID string, ipAddress string, opts ...option.RequestOption) (res *AddressAddressMapIPReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapIPDeleteResponseEnvelope + var env AddressAddressMapIPReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", accountID, addressMapID, ipAddress) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return } @@ -59,15 +59,15 @@ func (r *AddressAddressMapIPService) Delete(ctx context.Context, accountID strin return } -// Union satisfied by [AddressAddressMapIPUpdateResponseUnknown], -// [AddressAddressMapIPUpdateResponseArray] or [shared.UnionString]. -type AddressAddressMapIPUpdateResponse interface { - ImplementsAddressAddressMapIPUpdateResponse() +// Union satisfied by [AddressAddressMapIPDeleteResponseUnknown], +// [AddressAddressMapIPDeleteResponseArray] or [shared.UnionString]. +type AddressAddressMapIPDeleteResponse interface { + ImplementsAddressAddressMapIPDeleteResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapIPUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapIPDeleteResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -76,19 +76,19 @@ func init() { ) } -type AddressAddressMapIPUpdateResponseArray []interface{} +type AddressAddressMapIPDeleteResponseArray []interface{} -func (r AddressAddressMapIPUpdateResponseArray) ImplementsAddressAddressMapIPUpdateResponse() {} +func (r AddressAddressMapIPDeleteResponseArray) ImplementsAddressAddressMapIPDeleteResponse() {} -// Union satisfied by [AddressAddressMapIPDeleteResponseUnknown], -// [AddressAddressMapIPDeleteResponseArray] or [shared.UnionString]. -type AddressAddressMapIPDeleteResponse interface { - ImplementsAddressAddressMapIPDeleteResponse() +// Union satisfied by [AddressAddressMapIPReplaceResponseUnknown], +// [AddressAddressMapIPReplaceResponseArray] or [shared.UnionString]. +type AddressAddressMapIPReplaceResponse interface { + ImplementsAddressAddressMapIPReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapIPDeleteResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapIPReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -97,23 +97,23 @@ func init() { ) } -type AddressAddressMapIPDeleteResponseArray []interface{} +type AddressAddressMapIPReplaceResponseArray []interface{} -func (r AddressAddressMapIPDeleteResponseArray) ImplementsAddressAddressMapIPDeleteResponse() {} +func (r AddressAddressMapIPReplaceResponseArray) ImplementsAddressAddressMapIPReplaceResponse() {} -type AddressAddressMapIPUpdateResponseEnvelope struct { - Errors []AddressAddressMapIPUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapIPUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapIPUpdateResponse `json:"result,required,nullable"` +type AddressAddressMapIPDeleteResponseEnvelope struct { + Errors []AddressAddressMapIPDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapIPDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapIPDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapIPUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapIPUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapIPUpdateResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapIPDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapIPDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapIPDeleteResponseEnvelopeJSON `json:"-"` } -// addressAddressMapIPUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AddressAddressMapIPUpdateResponseEnvelope] -type addressAddressMapIPUpdateResponseEnvelopeJSON struct { +// addressAddressMapIPDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [AddressAddressMapIPDeleteResponseEnvelope] +type addressAddressMapIPDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -123,56 +123,56 @@ type addressAddressMapIPUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapIPUpdateResponseEnvelopeErrors struct { +type AddressAddressMapIPDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapIPUpdateResponseEnvelopeErrorsJSON `json:"-"` + JSON addressAddressMapIPDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapIPUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AddressAddressMapIPUpdateResponseEnvelopeErrors] -type addressAddressMapIPUpdateResponseEnvelopeErrorsJSON struct { +// addressAddressMapIPDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressAddressMapIPDeleteResponseEnvelopeErrors] +type addressAddressMapIPDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapIPUpdateResponseEnvelopeMessages struct { +type AddressAddressMapIPDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapIPUpdateResponseEnvelopeMessagesJSON `json:"-"` + JSON addressAddressMapIPDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapIPUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AddressAddressMapIPUpdateResponseEnvelopeMessages] -type addressAddressMapIPUpdateResponseEnvelopeMessagesJSON struct { +// addressAddressMapIPDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AddressAddressMapIPDeleteResponseEnvelopeMessages] +type addressAddressMapIPDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapIPUpdateResponseEnvelopeSuccess bool +type AddressAddressMapIPDeleteResponseEnvelopeSuccess bool const ( - AddressAddressMapIPUpdateResponseEnvelopeSuccessTrue AddressAddressMapIPUpdateResponseEnvelopeSuccess = true + AddressAddressMapIPDeleteResponseEnvelopeSuccessTrue AddressAddressMapIPDeleteResponseEnvelopeSuccess = true ) -type AddressAddressMapIPUpdateResponseEnvelopeResultInfo struct { +type AddressAddressMapIPDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -181,12 +181,12 @@ type AddressAddressMapIPUpdateResponseEnvelopeResultInfo struct { PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` - JSON addressAddressMapIPUpdateResponseEnvelopeResultInfoJSON `json:"-"` + JSON addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapIPUpdateResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AddressAddressMapIPUpdateResponseEnvelopeResultInfo] -type addressAddressMapIPUpdateResponseEnvelopeResultInfoJSON struct { +// addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AddressAddressMapIPDeleteResponseEnvelopeResultInfo] +type addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -195,23 +195,23 @@ type addressAddressMapIPUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapIPDeleteResponseEnvelope struct { - Errors []AddressAddressMapIPDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapIPDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapIPDeleteResponse `json:"result,required,nullable"` +type AddressAddressMapIPReplaceResponseEnvelope struct { + Errors []AddressAddressMapIPReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapIPReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapIPReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapIPDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapIPDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapIPDeleteResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapIPReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapIPReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapIPReplaceResponseEnvelopeJSON `json:"-"` } -// addressAddressMapIPDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [AddressAddressMapIPDeleteResponseEnvelope] -type addressAddressMapIPDeleteResponseEnvelopeJSON struct { +// addressAddressMapIPReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressAddressMapIPReplaceResponseEnvelope] +type addressAddressMapIPReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -221,56 +221,56 @@ type addressAddressMapIPDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapIPDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapIPDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AddressAddressMapIPReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapIPReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapIPDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AddressAddressMapIPDeleteResponseEnvelopeErrors] -type addressAddressMapIPDeleteResponseEnvelopeErrorsJSON struct { +// addressAddressMapIPReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressAddressMapIPReplaceResponseEnvelopeErrors] +type addressAddressMapIPReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapIPDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapIPDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AddressAddressMapIPReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapIPReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapIPDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AddressAddressMapIPDeleteResponseEnvelopeMessages] -type addressAddressMapIPDeleteResponseEnvelopeMessagesJSON struct { +// addressAddressMapIPReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressAddressMapIPReplaceResponseEnvelopeMessages] +type addressAddressMapIPReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapIPDeleteResponseEnvelopeSuccess bool +type AddressAddressMapIPReplaceResponseEnvelopeSuccess bool const ( - AddressAddressMapIPDeleteResponseEnvelopeSuccessTrue AddressAddressMapIPDeleteResponseEnvelopeSuccess = true + AddressAddressMapIPReplaceResponseEnvelopeSuccessTrue AddressAddressMapIPReplaceResponseEnvelopeSuccess = true ) -type AddressAddressMapIPDeleteResponseEnvelopeResultInfo struct { +type AddressAddressMapIPReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -278,13 +278,13 @@ type AddressAddressMapIPDeleteResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON addressAddressMapIPReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AddressAddressMapIPDeleteResponseEnvelopeResultInfo] -type addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON struct { +// addressAddressMapIPReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AddressAddressMapIPReplaceResponseEnvelopeResultInfo] +type addressAddressMapIPReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -293,6 +293,6 @@ type addressAddressMapIPDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapIPDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapIPReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/addressaddressmapip_test.go b/addressaddressmapip_test.go index 1cb0896f71e..56ce0cbaff1 100644 --- a/addressaddressmapip_test.go +++ b/addressaddressmapip_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressAddressMapIPUpdate(t *testing.T) { +func TestAddressAddressMapIPDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAddressAddressMapIPUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.IPs.Update( + _, err := client.Addresses.AddressMaps.IPs.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -44,7 +44,7 @@ func TestAddressAddressMapIPUpdate(t *testing.T) { } } -func TestAddressAddressMapIPDelete(t *testing.T) { +func TestAddressAddressMapIPReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,7 +60,7 @@ func TestAddressAddressMapIPDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.IPs.Delete( + _, err := client.Addresses.AddressMaps.IPs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/addressaddressmapzone.go b/addressaddressmapzone.go index 9e54c1f6ae7..2485948b993 100644 --- a/addressaddressmapzone.go +++ b/addressaddressmapzone.go @@ -33,12 +33,12 @@ func NewAddressAddressMapZoneService(opts ...option.RequestOption) (r *AddressAd return } -// Add a zone as a member of a particular address map. -func (r *AddressAddressMapZoneService) Update(ctx context.Context, accountID string, addressMapID string, zoneID string, opts ...option.RequestOption) (res *AddressAddressMapZoneUpdateResponse, err error) { +// Remove a zone as a member of a particular address map. +func (r *AddressAddressMapZoneService) Delete(ctx context.Context, accountID string, addressMapID string, zoneID string, opts ...option.RequestOption) (res *AddressAddressMapZoneDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapZoneUpdateResponseEnvelope + var env AddressAddressMapZoneDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountID, addressMapID, zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -46,12 +46,12 @@ func (r *AddressAddressMapZoneService) Update(ctx context.Context, accountID str return } -// Remove a zone as a member of a particular address map. -func (r *AddressAddressMapZoneService) Delete(ctx context.Context, accountID string, addressMapID string, zoneID string, opts ...option.RequestOption) (res *AddressAddressMapZoneDeleteResponse, err error) { +// Add a zone as a member of a particular address map. +func (r *AddressAddressMapZoneService) Replace(ctx context.Context, accountID string, addressMapID string, zoneID string, opts ...option.RequestOption) (res *AddressAddressMapZoneReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressAddressMapZoneDeleteResponseEnvelope + var env AddressAddressMapZoneReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountID, addressMapID, zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return } @@ -59,15 +59,15 @@ func (r *AddressAddressMapZoneService) Delete(ctx context.Context, accountID str return } -// Union satisfied by [AddressAddressMapZoneUpdateResponseUnknown], -// [AddressAddressMapZoneUpdateResponseArray] or [shared.UnionString]. -type AddressAddressMapZoneUpdateResponse interface { - ImplementsAddressAddressMapZoneUpdateResponse() +// Union satisfied by [AddressAddressMapZoneDeleteResponseUnknown], +// [AddressAddressMapZoneDeleteResponseArray] or [shared.UnionString]. +type AddressAddressMapZoneDeleteResponse interface { + ImplementsAddressAddressMapZoneDeleteResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapZoneUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapZoneDeleteResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -76,19 +76,19 @@ func init() { ) } -type AddressAddressMapZoneUpdateResponseArray []interface{} +type AddressAddressMapZoneDeleteResponseArray []interface{} -func (r AddressAddressMapZoneUpdateResponseArray) ImplementsAddressAddressMapZoneUpdateResponse() {} +func (r AddressAddressMapZoneDeleteResponseArray) ImplementsAddressAddressMapZoneDeleteResponse() {} -// Union satisfied by [AddressAddressMapZoneDeleteResponseUnknown], -// [AddressAddressMapZoneDeleteResponseArray] or [shared.UnionString]. -type AddressAddressMapZoneDeleteResponse interface { - ImplementsAddressAddressMapZoneDeleteResponse() +// Union satisfied by [AddressAddressMapZoneReplaceResponseUnknown], +// [AddressAddressMapZoneReplaceResponseArray] or [shared.UnionString]. +type AddressAddressMapZoneReplaceResponse interface { + ImplementsAddressAddressMapZoneReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AddressAddressMapZoneDeleteResponse)(nil)).Elem(), + reflect.TypeOf((*AddressAddressMapZoneReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -97,23 +97,23 @@ func init() { ) } -type AddressAddressMapZoneDeleteResponseArray []interface{} +type AddressAddressMapZoneReplaceResponseArray []interface{} -func (r AddressAddressMapZoneDeleteResponseArray) ImplementsAddressAddressMapZoneDeleteResponse() {} +func (r AddressAddressMapZoneReplaceResponseArray) ImplementsAddressAddressMapZoneReplaceResponse() {} -type AddressAddressMapZoneUpdateResponseEnvelope struct { - Errors []AddressAddressMapZoneUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapZoneUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapZoneUpdateResponse `json:"result,required,nullable"` +type AddressAddressMapZoneDeleteResponseEnvelope struct { + Errors []AddressAddressMapZoneDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapZoneDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapZoneDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapZoneUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapZoneUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapZoneUpdateResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapZoneDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapZoneDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapZoneDeleteResponseEnvelopeJSON `json:"-"` } -// addressAddressMapZoneUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [AddressAddressMapZoneUpdateResponseEnvelope] -type addressAddressMapZoneUpdateResponseEnvelopeJSON struct { +// addressAddressMapZoneDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressAddressMapZoneDeleteResponseEnvelope] +type addressAddressMapZoneDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -123,56 +123,56 @@ type addressAddressMapZoneUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapZoneUpdateResponseEnvelopeErrors struct { +type AddressAddressMapZoneDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapZoneUpdateResponseEnvelopeErrorsJSON `json:"-"` + JSON addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapZoneUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AddressAddressMapZoneUpdateResponseEnvelopeErrors] -type addressAddressMapZoneUpdateResponseEnvelopeErrorsJSON struct { +// addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressAddressMapZoneDeleteResponseEnvelopeErrors] +type addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapZoneUpdateResponseEnvelopeMessages struct { +type AddressAddressMapZoneDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON addressAddressMapZoneUpdateResponseEnvelopeMessagesJSON `json:"-"` + JSON addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapZoneUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AddressAddressMapZoneUpdateResponseEnvelopeMessages] -type addressAddressMapZoneUpdateResponseEnvelopeMessagesJSON struct { +// addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressAddressMapZoneDeleteResponseEnvelopeMessages] +type addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapZoneUpdateResponseEnvelopeSuccess bool +type AddressAddressMapZoneDeleteResponseEnvelopeSuccess bool const ( - AddressAddressMapZoneUpdateResponseEnvelopeSuccessTrue AddressAddressMapZoneUpdateResponseEnvelopeSuccess = true + AddressAddressMapZoneDeleteResponseEnvelopeSuccessTrue AddressAddressMapZoneDeleteResponseEnvelopeSuccess = true ) -type AddressAddressMapZoneUpdateResponseEnvelopeResultInfo struct { +type AddressAddressMapZoneDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -181,12 +181,12 @@ type AddressAddressMapZoneUpdateResponseEnvelopeResultInfo struct { PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` - JSON addressAddressMapZoneUpdateResponseEnvelopeResultInfoJSON `json:"-"` + JSON addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapZoneUpdateResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AddressAddressMapZoneUpdateResponseEnvelopeResultInfo] -type addressAddressMapZoneUpdateResponseEnvelopeResultInfoJSON struct { +// addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AddressAddressMapZoneDeleteResponseEnvelopeResultInfo] +type addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -195,23 +195,23 @@ type addressAddressMapZoneUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapZoneDeleteResponseEnvelope struct { - Errors []AddressAddressMapZoneDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressAddressMapZoneDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AddressAddressMapZoneDeleteResponse `json:"result,required,nullable"` +type AddressAddressMapZoneReplaceResponseEnvelope struct { + Errors []AddressAddressMapZoneReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressAddressMapZoneReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AddressAddressMapZoneReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressAddressMapZoneDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressAddressMapZoneDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON addressAddressMapZoneDeleteResponseEnvelopeJSON `json:"-"` + Success AddressAddressMapZoneReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressAddressMapZoneReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON addressAddressMapZoneReplaceResponseEnvelopeJSON `json:"-"` } -// addressAddressMapZoneDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [AddressAddressMapZoneDeleteResponseEnvelope] -type addressAddressMapZoneDeleteResponseEnvelopeJSON struct { +// addressAddressMapZoneReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressAddressMapZoneReplaceResponseEnvelope] +type addressAddressMapZoneReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -221,56 +221,56 @@ type addressAddressMapZoneDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapZoneDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AddressAddressMapZoneReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapZoneReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [AddressAddressMapZoneDeleteResponseEnvelopeErrors] -type addressAddressMapZoneDeleteResponseEnvelopeErrorsJSON struct { +// addressAddressMapZoneReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AddressAddressMapZoneReplaceResponseEnvelopeErrors] +type addressAddressMapZoneReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressAddressMapZoneDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AddressAddressMapZoneReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressAddressMapZoneReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AddressAddressMapZoneDeleteResponseEnvelopeMessages] -type addressAddressMapZoneDeleteResponseEnvelopeMessagesJSON struct { +// addressAddressMapZoneReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressAddressMapZoneReplaceResponseEnvelopeMessages] +type addressAddressMapZoneReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressAddressMapZoneDeleteResponseEnvelopeSuccess bool +type AddressAddressMapZoneReplaceResponseEnvelopeSuccess bool const ( - AddressAddressMapZoneDeleteResponseEnvelopeSuccessTrue AddressAddressMapZoneDeleteResponseEnvelopeSuccess = true + AddressAddressMapZoneReplaceResponseEnvelopeSuccessTrue AddressAddressMapZoneReplaceResponseEnvelopeSuccess = true ) -type AddressAddressMapZoneDeleteResponseEnvelopeResultInfo struct { +type AddressAddressMapZoneReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -278,13 +278,13 @@ type AddressAddressMapZoneDeleteResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON addressAddressMapZoneReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AddressAddressMapZoneDeleteResponseEnvelopeResultInfo] -type addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON struct { +// addressAddressMapZoneReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AddressAddressMapZoneReplaceResponseEnvelopeResultInfo] +type addressAddressMapZoneReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -293,6 +293,6 @@ type addressAddressMapZoneDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressAddressMapZoneDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AddressAddressMapZoneReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/addressaddressmapzone_test.go b/addressaddressmapzone_test.go index 752793fbf1c..50aa3cddaf7 100644 --- a/addressaddressmapzone_test.go +++ b/addressaddressmapzone_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressAddressMapZoneUpdate(t *testing.T) { +func TestAddressAddressMapZoneDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAddressAddressMapZoneUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.Zones.Update( + _, err := client.Addresses.AddressMaps.Zones.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -44,7 +44,7 @@ func TestAddressAddressMapZoneUpdate(t *testing.T) { } } -func TestAddressAddressMapZoneDelete(t *testing.T) { +func TestAddressAddressMapZoneReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,7 +60,7 @@ func TestAddressAddressMapZoneDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.AddressMaps.Zones.Delete( + _, err := client.Addresses.AddressMaps.Zones.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/addressloadocument.go b/addressloadocument.go index 3ae42407759..13f4604b5bc 100644 --- a/addressloadocument.go +++ b/addressloadocument.go @@ -34,9 +34,9 @@ func NewAddressLoaDocumentService(opts ...option.RequestOption) (r *AddressLoaDo } // Submit LOA document (pdf format) under the account. -func (r *AddressLoaDocumentService) IPAddressManagementPrefixesUploadLoaDocument(ctx context.Context, accountID string, body AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams, opts ...option.RequestOption) (res *AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, err error) { +func (r *AddressLoaDocumentService) New(ctx context.Context, accountID string, body AddressLoaDocumentNewParams, opts ...option.RequestOption) (res *AddressLoaDocumentNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelope + var env AddressLoaDocumentNewResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/loa_documents", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -46,47 +46,45 @@ func (r *AddressLoaDocumentService) IPAddressManagementPrefixesUploadLoaDocument return } -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse struct { +type AddressLoaDocumentNewResponse struct { // Name of LOA document. - Filename string `json:"filename"` - JSON addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseJSON `json:"-"` + Filename string `json:"filename"` + JSON addressLoaDocumentNewResponseJSON `json:"-"` } -// addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseJSON -// contains the JSON metadata for the struct -// [AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse] -type addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseJSON struct { +// addressLoaDocumentNewResponseJSON contains the JSON metadata for the struct +// [AddressLoaDocumentNewResponse] +type addressLoaDocumentNewResponseJSON struct { Filename apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressLoaDocumentNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams struct { +type AddressLoaDocumentNewParams struct { // LOA document to upload. LoaDocument param.Field[string] `json:"loa_document,required"` } -func (r AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams) MarshalJSON() (data []byte, err error) { +func (r AddressLoaDocumentNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelope struct { - Errors []AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessages `json:"messages,required"` - Result AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse `json:"result,required"` +type AddressLoaDocumentNewResponseEnvelope struct { + Errors []AddressLoaDocumentNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressLoaDocumentNewResponseEnvelopeMessages `json:"messages,required"` + Result AddressLoaDocumentNewResponse `json:"result,required"` // Whether the API call was successful - Success AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeSuccess `json:"success,required"` - JSON addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeJSON `json:"-"` + Success AddressLoaDocumentNewResponseEnvelopeSuccess `json:"success,required"` + JSON addressLoaDocumentNewResponseEnvelopeJSON `json:"-"` } -// addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelope] -type addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeJSON struct { +// addressLoaDocumentNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AddressLoaDocumentNewResponseEnvelope] +type addressLoaDocumentNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -95,53 +93,51 @@ type addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvel ExtraFields map[string]apijson.Field } -func (r *AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressLoaDocumentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrorsJSON `json:"-"` +type AddressLoaDocumentNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressLoaDocumentNewResponseEnvelopeErrorsJSON `json:"-"` } -// addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrors] -type addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrorsJSON struct { +// addressLoaDocumentNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AddressLoaDocumentNewResponseEnvelopeErrors] +type addressLoaDocumentNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressLoaDocumentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessagesJSON `json:"-"` +type AddressLoaDocumentNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressLoaDocumentNewResponseEnvelopeMessagesJSON `json:"-"` } -// addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessages] -type addressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessagesJSON struct { +// addressLoaDocumentNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AddressLoaDocumentNewResponseEnvelopeMessages] +type addressLoaDocumentNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressLoaDocumentNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeSuccess bool +type AddressLoaDocumentNewResponseEnvelopeSuccess bool const ( - AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeSuccessTrue AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponseEnvelopeSuccess = true + AddressLoaDocumentNewResponseEnvelopeSuccessTrue AddressLoaDocumentNewResponseEnvelopeSuccess = true ) diff --git a/addressloadocument_test.go b/addressloadocument_test.go index 68f46238514..14a7cfe3af0 100644 --- a/addressloadocument_test.go +++ b/addressloadocument_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocument(t *testing.T) { +func TestAddressLoaDocumentNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestAddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocument(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.LoaDocuments.IPAddressManagementPrefixesUploadLoaDocument( + _, err := client.Addresses.LoaDocuments.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams{ + cloudflare.AddressLoaDocumentNewParams{ LoaDocument: cloudflare.F("@document.pdf"), }, ) diff --git a/addressprefix.go b/addressprefix.go index fb71d272297..99ea21875af 100644 --- a/addressprefix.go +++ b/addressprefix.go @@ -39,12 +39,12 @@ func NewAddressPrefixService(opts ...option.RequestOption) (r *AddressPrefixServ return } -// Modify the description for a prefix owned by the account. -func (r *AddressPrefixService) Update(ctx context.Context, accountID string, prefixID string, body AddressPrefixUpdateParams, opts ...option.RequestOption) (res *AddressPrefixUpdateResponse, err error) { +// Add a new prefix under the account. +func (r *AddressPrefixService) New(ctx context.Context, accountID string, body AddressPrefixNewParams, opts ...option.RequestOption) (res *AddressPrefixNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env AddressPrefixNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -52,12 +52,12 @@ func (r *AddressPrefixService) Update(ctx context.Context, accountID string, pre return } -// Delete an unapproved prefix owned by the account. -func (r *AddressPrefixService) Delete(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixDeleteResponse, err error) { +// Modify the description for a prefix owned by the account. +func (r *AddressPrefixService) Update(ctx context.Context, accountID string, prefixID string, body AddressPrefixUpdateParams, opts ...option.RequestOption) (res *AddressPrefixUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixDeleteResponseEnvelope + var env AddressPrefixUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -65,11 +65,11 @@ func (r *AddressPrefixService) Delete(ctx context.Context, accountID string, pre return } -// List a particular prefix owned by the account. -func (r *AddressPrefixService) Get(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixGetResponse, err error) { +// List all prefixes owned by the account. +func (r *AddressPrefixService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AddressPrefixListResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", accountID, prefixID) + var env AddressPrefixListResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -78,12 +78,12 @@ func (r *AddressPrefixService) Get(ctx context.Context, accountID string, prefix return } -// Add a new prefix under the account. -func (r *AddressPrefixService) IPAddressManagementPrefixesAddPrefix(ctx context.Context, accountID string, body AddressPrefixIPAddressManagementPrefixesAddPrefixParams, opts ...option.RequestOption) (res *AddressPrefixIPAddressManagementPrefixesAddPrefixResponse, err error) { +// Delete an unapproved prefix owned by the account. +func (r *AddressPrefixService) Delete(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AddressPrefixDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", accountID, prefixID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -91,11 +91,11 @@ func (r *AddressPrefixService) IPAddressManagementPrefixesAddPrefix(ctx context. return } -// List all prefixes owned by the account. -func (r *AddressPrefixService) IPAddressManagementPrefixesListPrefixes(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AddressPrefixIPAddressManagementPrefixesListPrefixesResponse, err error) { +// List a particular prefix owned by the account. +func (r *AddressPrefixService) Get(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes", accountID) + var env AddressPrefixGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", accountID, prefixID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -104,7 +104,7 @@ func (r *AddressPrefixService) IPAddressManagementPrefixesListPrefixes(ctx conte return } -type AddressPrefixUpdateResponse struct { +type AddressPrefixNewResponse struct { // Identifier ID string `json:"id"` // Identifier @@ -132,13 +132,13 @@ type AddressPrefixUpdateResponse struct { OnDemandEnabled bool `json:"on_demand_enabled"` // Whether advertisement status of the prefix is locked, meaning it cannot be // changed. - OnDemandLocked bool `json:"on_demand_locked"` - JSON addressPrefixUpdateResponseJSON `json:"-"` + OnDemandLocked bool `json:"on_demand_locked"` + JSON addressPrefixNewResponseJSON `json:"-"` } -// addressPrefixUpdateResponseJSON contains the JSON metadata for the struct -// [AddressPrefixUpdateResponse] -type addressPrefixUpdateResponseJSON struct { +// addressPrefixNewResponseJSON contains the JSON metadata for the struct +// [AddressPrefixNewResponse] +type addressPrefixNewResponseJSON struct { ID apijson.Field AccountID apijson.Field Advertised apijson.Field @@ -156,32 +156,11 @@ type addressPrefixUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressPrefixUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [AddressPrefixDeleteResponseUnknown], -// [AddressPrefixDeleteResponseArray] or [shared.UnionString]. -type AddressPrefixDeleteResponse interface { - ImplementsAddressPrefixDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AddressPrefixDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AddressPrefixDeleteResponseArray []interface{} - -func (r AddressPrefixDeleteResponseArray) ImplementsAddressPrefixDeleteResponse() {} - -type AddressPrefixGetResponse struct { +type AddressPrefixUpdateResponse struct { // Identifier ID string `json:"id"` // Identifier @@ -209,13 +188,13 @@ type AddressPrefixGetResponse struct { OnDemandEnabled bool `json:"on_demand_enabled"` // Whether advertisement status of the prefix is locked, meaning it cannot be // changed. - OnDemandLocked bool `json:"on_demand_locked"` - JSON addressPrefixGetResponseJSON `json:"-"` + OnDemandLocked bool `json:"on_demand_locked"` + JSON addressPrefixUpdateResponseJSON `json:"-"` } -// addressPrefixGetResponseJSON contains the JSON metadata for the struct -// [AddressPrefixGetResponse] -type addressPrefixGetResponseJSON struct { +// addressPrefixUpdateResponseJSON contains the JSON metadata for the struct +// [AddressPrefixUpdateResponse] +type addressPrefixUpdateResponseJSON struct { ID apijson.Field AccountID apijson.Field Advertised apijson.Field @@ -233,11 +212,11 @@ type addressPrefixGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressPrefixGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixIPAddressManagementPrefixesAddPrefixResponse struct { +type AddressPrefixListResponse struct { // Identifier ID string `json:"id"` // Identifier @@ -265,14 +244,13 @@ type AddressPrefixIPAddressManagementPrefixesAddPrefixResponse struct { OnDemandEnabled bool `json:"on_demand_enabled"` // Whether advertisement status of the prefix is locked, meaning it cannot be // changed. - OnDemandLocked bool `json:"on_demand_locked"` - JSON addressPrefixIPAddressManagementPrefixesAddPrefixResponseJSON `json:"-"` + OnDemandLocked bool `json:"on_demand_locked"` + JSON addressPrefixListResponseJSON `json:"-"` } -// addressPrefixIPAddressManagementPrefixesAddPrefixResponseJSON contains the JSON -// metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesAddPrefixResponse] -type addressPrefixIPAddressManagementPrefixesAddPrefixResponseJSON struct { +// addressPrefixListResponseJSON contains the JSON metadata for the struct +// [AddressPrefixListResponse] +type addressPrefixListResponseJSON struct { ID apijson.Field AccountID apijson.Field Advertised apijson.Field @@ -290,11 +268,32 @@ type addressPrefixIPAddressManagementPrefixesAddPrefixResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressPrefixIPAddressManagementPrefixesAddPrefixResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponse struct { +// Union satisfied by [AddressPrefixDeleteResponseUnknown], +// [AddressPrefixDeleteResponseArray] or [shared.UnionString]. +type AddressPrefixDeleteResponse interface { + ImplementsAddressPrefixDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AddressPrefixDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AddressPrefixDeleteResponseArray []interface{} + +func (r AddressPrefixDeleteResponseArray) ImplementsAddressPrefixDeleteResponse() {} + +type AddressPrefixGetResponse struct { // Identifier ID string `json:"id"` // Identifier @@ -322,14 +321,13 @@ type AddressPrefixIPAddressManagementPrefixesListPrefixesResponse struct { OnDemandEnabled bool `json:"on_demand_enabled"` // Whether advertisement status of the prefix is locked, meaning it cannot be // changed. - OnDemandLocked bool `json:"on_demand_locked"` - JSON addressPrefixIPAddressManagementPrefixesListPrefixesResponseJSON `json:"-"` + OnDemandLocked bool `json:"on_demand_locked"` + JSON addressPrefixGetResponseJSON `json:"-"` } -// addressPrefixIPAddressManagementPrefixesListPrefixesResponseJSON contains the -// JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesListPrefixesResponse] -type addressPrefixIPAddressManagementPrefixesListPrefixesResponseJSON struct { +// addressPrefixGetResponseJSON contains the JSON metadata for the struct +// [AddressPrefixGetResponse] +type addressPrefixGetResponseJSON struct { ID apijson.Field AccountID apijson.Field Advertised apijson.Field @@ -347,10 +345,92 @@ type addressPrefixIPAddressManagementPrefixesListPrefixesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressPrefixIPAddressManagementPrefixesListPrefixesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type AddressPrefixNewParams struct { + // Autonomous System Number (ASN) the prefix will be advertised under. + Asn param.Field[int64] `json:"asn,required"` + // IP Prefix in Classless Inter-Domain Routing format. + Cidr param.Field[string] `json:"cidr,required"` + // Identifier for the uploaded LOA document. + LoaDocumentID param.Field[string] `json:"loa_document_id,required"` +} + +func (r AddressPrefixNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AddressPrefixNewResponseEnvelope struct { + Errors []AddressPrefixNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixNewResponseEnvelopeMessages `json:"messages,required"` + Result AddressPrefixNewResponse `json:"result,required"` + // Whether the API call was successful + Success AddressPrefixNewResponseEnvelopeSuccess `json:"success,required"` + JSON addressPrefixNewResponseEnvelopeJSON `json:"-"` +} + +// addressPrefixNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AddressPrefixNewResponseEnvelope] +type addressPrefixNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// addressPrefixNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AddressPrefixNewResponseEnvelopeErrors] +type addressPrefixNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// addressPrefixNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AddressPrefixNewResponseEnvelopeMessages] +type addressPrefixNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AddressPrefixNewResponseEnvelopeSuccess bool + +const ( + AddressPrefixNewResponseEnvelopeSuccessTrue AddressPrefixNewResponseEnvelopeSuccess = true +) + type AddressPrefixUpdateParams struct { // Description of the prefix. Description param.Field[string] `json:"description,required"` @@ -429,6 +509,104 @@ const ( AddressPrefixUpdateResponseEnvelopeSuccessTrue AddressPrefixUpdateResponseEnvelopeSuccess = true ) +type AddressPrefixListResponseEnvelope struct { + Errors []AddressPrefixListResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixListResponseEnvelopeMessages `json:"messages,required"` + Result []AddressPrefixListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AddressPrefixListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressPrefixListResponseEnvelopeResultInfo `json:"result_info"` + JSON addressPrefixListResponseEnvelopeJSON `json:"-"` +} + +// addressPrefixListResponseEnvelopeJSON contains the JSON metadata for the struct +// [AddressPrefixListResponseEnvelope] +type addressPrefixListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixListResponseEnvelopeErrorsJSON `json:"-"` +} + +// addressPrefixListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AddressPrefixListResponseEnvelopeErrors] +type addressPrefixListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixListResponseEnvelopeMessagesJSON `json:"-"` +} + +// addressPrefixListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AddressPrefixListResponseEnvelopeMessages] +type addressPrefixListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AddressPrefixListResponseEnvelopeSuccess bool + +const ( + AddressPrefixListResponseEnvelopeSuccessTrue AddressPrefixListResponseEnvelopeSuccess = true +) + +type AddressPrefixListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON addressPrefixListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// addressPrefixListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [AddressPrefixListResponseEnvelopeResultInfo] +type addressPrefixListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AddressPrefixDeleteResponseEnvelope struct { Errors []AddressPrefixDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AddressPrefixDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -595,190 +773,3 @@ type AddressPrefixGetResponseEnvelopeSuccess bool const ( AddressPrefixGetResponseEnvelopeSuccessTrue AddressPrefixGetResponseEnvelopeSuccess = true ) - -type AddressPrefixIPAddressManagementPrefixesAddPrefixParams struct { - // Autonomous System Number (ASN) the prefix will be advertised under. - Asn param.Field[int64] `json:"asn,required"` - // IP Prefix in Classless Inter-Domain Routing format. - Cidr param.Field[string] `json:"cidr,required"` - // Identifier for the uploaded LOA document. - LoaDocumentID param.Field[string] `json:"loa_document_id,required"` -} - -func (r AddressPrefixIPAddressManagementPrefixesAddPrefixParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelope struct { - Errors []AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessages `json:"messages,required"` - Result AddressPrefixIPAddressManagementPrefixesAddPrefixResponse `json:"result,required"` - // Whether the API call was successful - Success AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeSuccess `json:"success,required"` - JSON addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelope] -type addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrorsJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrors] -type addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessagesJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessages] -type addressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeSuccess bool - -const ( - AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeSuccessTrue AddressPrefixIPAddressManagementPrefixesAddPrefixResponseEnvelopeSuccess = true -) - -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelope struct { - Errors []AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessages `json:"messages,required"` - Result []AddressPrefixIPAddressManagementPrefixesListPrefixesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfo `json:"result_info"` - JSON addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelope] -type addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrorsJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrors] -type addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessagesJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessages] -type addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeSuccess bool - -const ( - AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeSuccessTrue AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeSuccess = true -) - -type AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfo] -type addressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixIPAddressManagementPrefixesListPrefixesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/addressprefix_test.go b/addressprefix_test.go index 0316d886dfd..a1f32e3e35e 100644 --- a/addressprefix_test.go +++ b/addressprefix_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressPrefixUpdate(t *testing.T) { +func TestAddressPrefixNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,13 @@ func TestAddressPrefixUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Update( + _, err := client.Addresses.Prefixes.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AddressPrefixUpdateParams{ - Description: cloudflare.F("Internal test prefix"), + cloudflare.AddressPrefixNewParams{ + Asn: cloudflare.F(int64(209242)), + Cidr: cloudflare.F("192.0.2.0/24"), + LoaDocumentID: cloudflare.F("d933b1530bc56c9953cf8ce166da8004"), }, ) if err != nil { @@ -46,7 +47,7 @@ func TestAddressPrefixUpdate(t *testing.T) { } } -func TestAddressPrefixDelete(t *testing.T) { +func TestAddressPrefixUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,10 +63,13 @@ func TestAddressPrefixDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Delete( + _, err := client.Addresses.Prefixes.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.AddressPrefixUpdateParams{ + Description: cloudflare.F("Internal test prefix"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -76,7 +80,7 @@ func TestAddressPrefixDelete(t *testing.T) { } } -func TestAddressPrefixGet(t *testing.T) { +func TestAddressPrefixList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -92,11 +96,7 @@ func TestAddressPrefixGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Addresses.Prefixes.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -106,7 +106,7 @@ func TestAddressPrefixGet(t *testing.T) { } } -func TestAddressPrefixIPAddressManagementPrefixesAddPrefix(t *testing.T) { +func TestAddressPrefixDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,14 +122,10 @@ func TestAddressPrefixIPAddressManagementPrefixesAddPrefix(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.IPAddressManagementPrefixesAddPrefix( + _, err := client.Addresses.Prefixes.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AddressPrefixIPAddressManagementPrefixesAddPrefixParams{ - Asn: cloudflare.F(int64(209242)), - Cidr: cloudflare.F("192.0.2.0/24"), - LoaDocumentID: cloudflare.F("d933b1530bc56c9953cf8ce166da8004"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -140,7 +136,7 @@ func TestAddressPrefixIPAddressManagementPrefixesAddPrefix(t *testing.T) { } } -func TestAddressPrefixIPAddressManagementPrefixesListPrefixes(t *testing.T) { +func TestAddressPrefixGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -156,7 +152,11 @@ func TestAddressPrefixIPAddressManagementPrefixesListPrefixes(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.IPAddressManagementPrefixesListPrefixes(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Addresses.Prefixes.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/addressprefixbgpstatus.go b/addressprefixbgpstatus.go index bd56c3846ca..9ea68f87e81 100644 --- a/addressprefixbgpstatus.go +++ b/addressprefixbgpstatus.go @@ -32,12 +32,12 @@ func NewAddressPrefixBGPStatusService(opts ...option.RequestOption) (r *AddressP return } -// List the current advertisement state for a prefix. -func (r *AddressPrefixBGPStatusService) IPAddressManagementDynamicAdvertisementGetAdvertisementStatus(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, err error) { +// Advertise or withdraw BGP route for a prefix. +func (r *AddressPrefixBGPStatusService) Update(ctx context.Context, accountID string, prefixID string, body AddressPrefixBGPStatusUpdateParams, opts ...option.RequestOption) (res *AddressPrefixBGPStatusUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelope + var env AddressPrefixBGPStatusUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *AddressPrefixBGPStatusService) IPAddressManagementDynamicAdvertisementG return } -// Advertise or withdraw BGP route for a prefix. -func (r *AddressPrefixBGPStatusService) IPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatus(ctx context.Context, accountID string, prefixID string, body AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams, opts ...option.RequestOption) (res *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, err error) { +// List the current advertisement state for a prefix. +func (r *AddressPrefixBGPStatusService) Get(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *AddressPrefixBGPStatusGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelope + var env AddressPrefixBGPStatusGetResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,65 +58,71 @@ func (r *AddressPrefixBGPStatusService) IPAddressManagementDynamicAdvertisementU return } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse struct { +type AddressPrefixBGPStatusUpdateResponse struct { // Enablement of prefix advertisement to the Internet. Advertised bool `json:"advertised"` // Last time the advertisement status was changed. This field is only not 'null' if // on demand is enabled. - AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseJSON `json:"-"` + AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"` + JSON addressPrefixBGPStatusUpdateResponseJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseJSON struct { +// addressPrefixBGPStatusUpdateResponseJSON contains the JSON metadata for the +// struct [AddressPrefixBGPStatusUpdateResponse] +type addressPrefixBGPStatusUpdateResponseJSON struct { Advertised apijson.Field AdvertisedModifiedAt apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse struct { +type AddressPrefixBGPStatusGetResponse struct { // Enablement of prefix advertisement to the Internet. Advertised bool `json:"advertised"` // Last time the advertisement status was changed. This field is only not 'null' if // on demand is enabled. - AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseJSON `json:"-"` + AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"` + JSON addressPrefixBGPStatusGetResponseJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseJSON struct { +// addressPrefixBGPStatusGetResponseJSON contains the JSON metadata for the struct +// [AddressPrefixBGPStatusGetResponse] +type addressPrefixBGPStatusGetResponseJSON struct { Advertised apijson.Field AdvertisedModifiedAt apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelope struct { - Errors []AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessages `json:"messages,required"` - Result AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse `json:"result,required"` +type AddressPrefixBGPStatusUpdateParams struct { + // Enablement of prefix advertisement to the Internet. + Advertised param.Field[bool] `json:"advertised,required"` +} + +func (r AddressPrefixBGPStatusUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AddressPrefixBGPStatusUpdateResponseEnvelope struct { + Errors []AddressPrefixBGPStatusUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixBGPStatusUpdateResponseEnvelopeMessages `json:"messages,required"` + Result AddressPrefixBGPStatusUpdateResponse `json:"result,required"` // Whether the API call was successful - Success AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeSuccess `json:"success,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeJSON `json:"-"` + Success AddressPrefixBGPStatusUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON addressPrefixBGPStatusUpdateResponseEnvelopeJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelope] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeJSON struct { +// addressPrefixBGPStatusUpdateResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressPrefixBGPStatusUpdateResponseEnvelope] +type addressPrefixBGPStatusUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -125,79 +131,67 @@ type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertiseme ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrorsJSON `json:"-"` +type AddressPrefixBGPStatusUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixBGPStatusUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrors] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrorsJSON struct { +// addressPrefixBGPStatusUpdateResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AddressPrefixBGPStatusUpdateResponseEnvelopeErrors] +type addressPrefixBGPStatusUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessagesJSON `json:"-"` +type AddressPrefixBGPStatusUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixBGPStatusUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessages] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessagesJSON struct { +// addressPrefixBGPStatusUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressPrefixBGPStatusUpdateResponseEnvelopeMessages] +type addressPrefixBGPStatusUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeSuccess bool +type AddressPrefixBGPStatusUpdateResponseEnvelopeSuccess bool const ( - AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeSuccessTrue AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponseEnvelopeSuccess = true + AddressPrefixBGPStatusUpdateResponseEnvelopeSuccessTrue AddressPrefixBGPStatusUpdateResponseEnvelopeSuccess = true ) -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams struct { - // Enablement of prefix advertisement to the Internet. - Advertised param.Field[bool] `json:"advertised,required"` -} - -func (r AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelope struct { - Errors []AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessages `json:"messages,required"` - Result AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse `json:"result,required"` +type AddressPrefixBGPStatusGetResponseEnvelope struct { + Errors []AddressPrefixBGPStatusGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixBGPStatusGetResponseEnvelopeMessages `json:"messages,required"` + Result AddressPrefixBGPStatusGetResponse `json:"result,required"` // Whether the API call was successful - Success AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeSuccess `json:"success,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeJSON `json:"-"` + Success AddressPrefixBGPStatusGetResponseEnvelopeSuccess `json:"success,required"` + JSON addressPrefixBGPStatusGetResponseEnvelopeJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelope] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeJSON struct { +// addressPrefixBGPStatusGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [AddressPrefixBGPStatusGetResponseEnvelope] +type addressPrefixBGPStatusGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -206,53 +200,51 @@ type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDy ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrorsJSON `json:"-"` +type AddressPrefixBGPStatusGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixBGPStatusGetResponseEnvelopeErrorsJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrors] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrorsJSON struct { +// addressPrefixBGPStatusGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressPrefixBGPStatusGetResponseEnvelopeErrors] +type addressPrefixBGPStatusGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessagesJSON `json:"-"` +type AddressPrefixBGPStatusGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixBGPStatusGetResponseEnvelopeMessagesJSON `json:"-"` } -// addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessages] -type addressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessagesJSON struct { +// addressPrefixBGPStatusGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AddressPrefixBGPStatusGetResponseEnvelopeMessages] +type addressPrefixBGPStatusGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixBGPStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeSuccess bool +type AddressPrefixBGPStatusGetResponseEnvelopeSuccess bool const ( - AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeSuccessTrue AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponseEnvelopeSuccess = true + AddressPrefixBGPStatusGetResponseEnvelopeSuccessTrue AddressPrefixBGPStatusGetResponseEnvelopeSuccess = true ) diff --git a/addressprefixbgpstatus_test.go b/addressprefixbgpstatus_test.go index 4b644096c1e..459b64c3d3a 100644 --- a/addressprefixbgpstatus_test.go +++ b/addressprefixbgpstatus_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatus(t *testing.T) { +func TestAddressPrefixBGPStatusUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,13 @@ func TestAddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdverti option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.BGPs.Statuses.IPAddressManagementDynamicAdvertisementGetAdvertisementStatus( + _, err := client.Addresses.Prefixes.BGPs.Statuses.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.AddressPrefixBGPStatusUpdateParams{ + Advertised: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +46,7 @@ func TestAddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdverti } } -func TestAddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatus(t *testing.T) { +func TestAddressPrefixBGPStatusGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,13 +62,10 @@ func TestAddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePref option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.BGPs.Statuses.IPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatus( + _, err := client.Addresses.Prefixes.BGPs.Statuses.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams{ - Advertised: cloudflare.F(true), - }, ) if err != nil { var apierr *cloudflare.Error diff --git a/addressprefixdelegation.go b/addressprefixdelegation.go index dee5fe1d70f..d64ee26b15e 100644 --- a/addressprefixdelegation.go +++ b/addressprefixdelegation.go @@ -32,12 +32,12 @@ func NewAddressPrefixDelegationService(opts ...option.RequestOption) (r *Address return } -// Delete an account delegation for a given IP prefix. -func (r *AddressPrefixDelegationService) Delete(ctx context.Context, accountID string, prefixID string, delegationID string, opts ...option.RequestOption) (res *AddressPrefixDelegationDeleteResponse, err error) { +// Create a new account delegation for a given IP prefix. +func (r *AddressPrefixDelegationService) New(ctx context.Context, accountID string, prefixID string, body AddressPrefixDelegationNewParams, opts ...option.RequestOption) (res *AddressPrefixDelegationNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixDelegationDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", accountID, prefixID, delegationID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env AddressPrefixDelegationNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", accountID, prefixID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *AddressPrefixDelegationService) Delete(ctx context.Context, accountID s return } -// Create a new account delegation for a given IP prefix. -func (r *AddressPrefixDelegationService) IPAddressManagementPrefixDelegationNewPrefixDelegation(ctx context.Context, accountID string, prefixID string, body AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationParams, opts ...option.RequestOption) (res *AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse, err error) { +// List all delegations for a given account IP prefix. +func (r *AddressPrefixDelegationService) List(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *[]AddressPrefixDelegationListResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelope + var env AddressPrefixDelegationListResponseEnvelope path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,12 +58,12 @@ func (r *AddressPrefixDelegationService) IPAddressManagementPrefixDelegationNewP return } -// List all delegations for a given account IP prefix. -func (r *AddressPrefixDelegationService) IPAddressManagementPrefixDelegationListPrefixDelegations(ctx context.Context, accountID string, prefixID string, opts ...option.RequestOption) (res *[]AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, err error) { +// Delete an account delegation for a given IP prefix. +func (r *AddressPrefixDelegationService) Delete(ctx context.Context, accountID string, prefixID string, delegationID string, opts ...option.RequestOption) (res *AddressPrefixDelegationDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", accountID, prefixID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env AddressPrefixDelegationDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", accountID, prefixID, delegationID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -71,25 +71,7 @@ func (r *AddressPrefixDelegationService) IPAddressManagementPrefixDelegationList return } -type AddressPrefixDelegationDeleteResponse struct { - // Delegation identifier tag. - ID string `json:"id"` - JSON addressPrefixDelegationDeleteResponseJSON `json:"-"` -} - -// addressPrefixDelegationDeleteResponseJSON contains the JSON metadata for the -// struct [AddressPrefixDelegationDeleteResponse] -type addressPrefixDelegationDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixDelegationDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse struct { +type AddressPrefixDelegationNewResponse struct { // Delegation identifier tag. ID string `json:"id"` // IP Prefix in Classless Inter-Domain Routing format. @@ -99,14 +81,13 @@ type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegati DelegatedAccountID string `json:"delegated_account_id"` ModifiedAt time.Time `json:"modified_at" format:"date-time"` // Identifier - ParentPrefixID string `json:"parent_prefix_id"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseJSON `json:"-"` + ParentPrefixID string `json:"parent_prefix_id"` + JSON addressPrefixDelegationNewResponseJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse] -type addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseJSON struct { +// addressPrefixDelegationNewResponseJSON contains the JSON metadata for the struct +// [AddressPrefixDelegationNewResponse] +type addressPrefixDelegationNewResponseJSON struct { ID apijson.Field Cidr apijson.Field CreatedAt apijson.Field @@ -117,11 +98,11 @@ type addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegati ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse struct { +type AddressPrefixDelegationListResponse struct { // Delegation identifier tag. ID string `json:"id"` // IP Prefix in Classless Inter-Domain Routing format. @@ -131,14 +112,13 @@ type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegat DelegatedAccountID string `json:"delegated_account_id"` ModifiedAt time.Time `json:"modified_at" format:"date-time"` // Identifier - ParentPrefixID string `json:"parent_prefix_id"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseJSON `json:"-"` + ParentPrefixID string `json:"parent_prefix_id"` + JSON addressPrefixDelegationListResponseJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse] -type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseJSON struct { +// addressPrefixDelegationListResponseJSON contains the JSON metadata for the +// struct [AddressPrefixDelegationListResponse] +type addressPrefixDelegationListResponseJSON struct { ID apijson.Field Cidr apijson.Field CreatedAt apijson.Field @@ -149,22 +129,51 @@ type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegat ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationDeleteResponseEnvelope struct { - Errors []AddressPrefixDelegationDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixDelegationDeleteResponseEnvelopeMessages `json:"messages,required"` - Result AddressPrefixDelegationDeleteResponse `json:"result,required"` +type AddressPrefixDelegationDeleteResponse struct { + // Delegation identifier tag. + ID string `json:"id"` + JSON addressPrefixDelegationDeleteResponseJSON `json:"-"` +} + +// addressPrefixDelegationDeleteResponseJSON contains the JSON metadata for the +// struct [AddressPrefixDelegationDeleteResponse] +type addressPrefixDelegationDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixDelegationDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixDelegationNewParams struct { + // IP Prefix in Classless Inter-Domain Routing format. + Cidr param.Field[string] `json:"cidr,required"` + // Account identifier for the account to which prefix is being delegated. + DelegatedAccountID param.Field[string] `json:"delegated_account_id,required"` +} + +func (r AddressPrefixDelegationNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AddressPrefixDelegationNewResponseEnvelope struct { + Errors []AddressPrefixDelegationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixDelegationNewResponseEnvelopeMessages `json:"messages,required"` + Result AddressPrefixDelegationNewResponse `json:"result,required"` // Whether the API call was successful - Success AddressPrefixDelegationDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON addressPrefixDelegationDeleteResponseEnvelopeJSON `json:"-"` + Success AddressPrefixDelegationNewResponseEnvelopeSuccess `json:"success,required"` + JSON addressPrefixDelegationNewResponseEnvelopeJSON `json:"-"` } -// addressPrefixDelegationDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [AddressPrefixDelegationDeleteResponseEnvelope] -type addressPrefixDelegationDeleteResponseEnvelopeJSON struct { +// addressPrefixDelegationNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressPrefixDelegationNewResponseEnvelope] +type addressPrefixDelegationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -173,236 +182,218 @@ type addressPrefixDelegationDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON `json:"-"` +type AddressPrefixDelegationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationNewResponseEnvelopeErrorsJSON `json:"-"` } -// addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AddressPrefixDelegationDeleteResponseEnvelopeErrors] -type addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON struct { +// addressPrefixDelegationNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressPrefixDelegationNewResponseEnvelopeErrors] +type addressPrefixDelegationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON `json:"-"` +type AddressPrefixDelegationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationNewResponseEnvelopeMessagesJSON `json:"-"` } -// addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AddressPrefixDelegationDeleteResponseEnvelopeMessages] -type addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON struct { +// addressPrefixDelegationNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressPrefixDelegationNewResponseEnvelopeMessages] +type addressPrefixDelegationNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressPrefixDelegationDeleteResponseEnvelopeSuccess bool +type AddressPrefixDelegationNewResponseEnvelopeSuccess bool const ( - AddressPrefixDelegationDeleteResponseEnvelopeSuccessTrue AddressPrefixDelegationDeleteResponseEnvelopeSuccess = true + AddressPrefixDelegationNewResponseEnvelopeSuccessTrue AddressPrefixDelegationNewResponseEnvelopeSuccess = true ) -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationParams struct { - // IP Prefix in Classless Inter-Domain Routing format. - Cidr param.Field[string] `json:"cidr,required"` - // Account identifier for the account to which prefix is being delegated. - DelegatedAccountID param.Field[string] `json:"delegated_account_id,required"` -} - -func (r AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelope struct { - Errors []AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessages `json:"messages,required"` - Result AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse `json:"result,required"` +type AddressPrefixDelegationListResponseEnvelope struct { + Errors []AddressPrefixDelegationListResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixDelegationListResponseEnvelopeMessages `json:"messages,required"` + Result []AddressPrefixDelegationListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeSuccess `json:"success,required"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeJSON `json:"-"` + Success AddressPrefixDelegationListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AddressPrefixDelegationListResponseEnvelopeResultInfo `json:"result_info"` + JSON addressPrefixDelegationListResponseEnvelopeJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelope] -type addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeJSON struct { +// addressPrefixDelegationListResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressPrefixDelegationListResponseEnvelope] +type addressPrefixDelegationListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrorsJSON `json:"-"` +type AddressPrefixDelegationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationListResponseEnvelopeErrorsJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrors] -type addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrorsJSON struct { +// addressPrefixDelegationListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [AddressPrefixDelegationListResponseEnvelopeErrors] +type addressPrefixDelegationListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessagesJSON `json:"-"` +type AddressPrefixDelegationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationListResponseEnvelopeMessagesJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessages] -type addressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessagesJSON struct { +// addressPrefixDelegationListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressPrefixDelegationListResponseEnvelopeMessages] +type addressPrefixDelegationListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeSuccess bool +type AddressPrefixDelegationListResponseEnvelopeSuccess bool const ( - AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeSuccessTrue AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponseEnvelopeSuccess = true + AddressPrefixDelegationListResponseEnvelopeSuccessTrue AddressPrefixDelegationListResponseEnvelopeSuccess = true ) -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelope struct { - Errors []AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrors `json:"errors,required"` - Messages []AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessages `json:"messages,required"` - Result []AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse `json:"result,required,nullable"` +type AddressPrefixDelegationListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON addressPrefixDelegationListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// addressPrefixDelegationListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [AddressPrefixDelegationListResponseEnvelopeResultInfo] +type addressPrefixDelegationListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AddressPrefixDelegationListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AddressPrefixDelegationDeleteResponseEnvelope struct { + Errors []AddressPrefixDelegationDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AddressPrefixDelegationDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AddressPrefixDelegationDeleteResponse `json:"result,required"` // Whether the API call was successful - Success AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfo `json:"result_info"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeJSON `json:"-"` + Success AddressPrefixDelegationDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON addressPrefixDelegationDeleteResponseEnvelopeJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelope] -type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeJSON struct { +// addressPrefixDelegationDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [AddressPrefixDelegationDeleteResponseEnvelope] +type addressPrefixDelegationDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrorsJSON `json:"-"` +type AddressPrefixDelegationDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrors] -type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrorsJSON struct { +// addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AddressPrefixDelegationDeleteResponseEnvelopeErrors] +type addressPrefixDelegationDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessagesJSON `json:"-"` +type AddressPrefixDelegationDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessages] -type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessagesJSON struct { +// addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [AddressPrefixDelegationDeleteResponseEnvelopeMessages] +type addressPrefixDelegationDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AddressPrefixDelegationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeSuccess bool +type AddressPrefixDelegationDeleteResponseEnvelopeSuccess bool const ( - AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeSuccessTrue AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeSuccess = true + AddressPrefixDelegationDeleteResponseEnvelopeSuccessTrue AddressPrefixDelegationDeleteResponseEnvelopeSuccess = true ) - -type AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfo] -type addressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/addressprefixdelegation_test.go b/addressprefixdelegation_test.go index 40808ddacf5..891bbd8657e 100644 --- a/addressprefixdelegation_test.go +++ b/addressprefixdelegation_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAddressPrefixDelegationDelete(t *testing.T) { +func TestAddressPrefixDelegationNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,14 @@ func TestAddressPrefixDelegationDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Delegations.Delete( + _, err := client.Addresses.Prefixes.Delegations.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - "d933b1530bc56c9953cf8ce166da8004", + cloudflare.AddressPrefixDelegationNewParams{ + Cidr: cloudflare.F("192.0.2.0/24"), + DelegatedAccountID: cloudflare.F("b1946ac92492d2347c6235b4d2611184"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -44,7 +47,7 @@ func TestAddressPrefixDelegationDelete(t *testing.T) { } } -func TestAddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegation(t *testing.T) { +func TestAddressPrefixDelegationList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,14 +63,10 @@ func TestAddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDele option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Delegations.IPAddressManagementPrefixDelegationNewPrefixDelegation( + _, err := client.Addresses.Prefixes.Delegations.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationParams{ - Cidr: cloudflare.F("192.0.2.0/24"), - DelegatedAccountID: cloudflare.F("b1946ac92492d2347c6235b4d2611184"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +77,7 @@ func TestAddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDele } } -func TestAddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegations(t *testing.T) { +func TestAddressPrefixDelegationDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,10 +93,11 @@ func TestAddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDel option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Addresses.Prefixes.Delegations.IPAddressManagementPrefixDelegationListPrefixDelegations( + _, err := client.Addresses.Prefixes.Delegations.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + "d933b1530bc56c9953cf8ce166da8004", ) if err != nil { var apierr *cloudflare.Error diff --git a/ai.go b/ai.go index 9c3e18070e1..eab79057282 100644 --- a/ai.go +++ b/ai.go @@ -36,9 +36,9 @@ func NewAIService(opts ...option.RequestOption) (r *AIService) { // By submitting the required input data, users can receive real-time predictions // or results generated by the chosen AI model. The endpoint supports various AI // model types, ensuring flexibility and adaptability for diverse use cases. -func (r *AIService) Run(ctx context.Context, accountID string, modelName string, body AIRunParams, opts ...option.RequestOption) (res *AIRunResponse, err error) { +func (r *AIService) New(ctx context.Context, accountID string, modelName string, body AINewParams, opts ...option.RequestOption) (res *AINewResponse, err error) { opts = append(r.Options[:], opts...) - var env AIRunResponseEnvelope + var env AINewResponseEnvelope path := fmt.Sprintf("accounts/%s/ai/run/%s", accountID, modelName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -48,27 +48,27 @@ func (r *AIService) Run(ctx context.Context, accountID string, modelName string, return } -type AIRunResponse = interface{} +type AINewResponse = interface{} -type AIRunParams struct { +type AINewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r AIRunParams) MarshalJSON() (data []byte, err error) { +func (r AINewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type AIRunResponseEnvelope struct { - Errors []AIRunResponseEnvelopeErrors `json:"errors,required"` +type AINewResponseEnvelope struct { + Errors []AINewResponseEnvelopeErrors `json:"errors,required"` Messages []string `json:"messages,required"` - Result AIRunResponse `json:"result,required"` + Result AINewResponse `json:"result,required"` Success bool `json:"success,required"` - JSON aiRunResponseEnvelopeJSON `json:"-"` + JSON aiNewResponseEnvelopeJSON `json:"-"` } -// aiRunResponseEnvelopeJSON contains the JSON metadata for the struct -// [AIRunResponseEnvelope] -type aiRunResponseEnvelopeJSON struct { +// aiNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [AINewResponseEnvelope] +type aiNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -77,23 +77,23 @@ type aiRunResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *AIRunResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AINewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AIRunResponseEnvelopeErrors struct { +type AINewResponseEnvelopeErrors struct { Message string `json:"message,required"` - JSON aiRunResponseEnvelopeErrorsJSON `json:"-"` + JSON aiNewResponseEnvelopeErrorsJSON `json:"-"` } -// aiRunResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [AIRunResponseEnvelopeErrors] -type aiRunResponseEnvelopeErrorsJSON struct { +// aiNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [AINewResponseEnvelopeErrors] +type aiNewResponseEnvelopeErrorsJSON struct { Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AIRunResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AINewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/ai_test.go b/ai_test.go index e169e77077a..1ccae90e086 100644 --- a/ai_test.go +++ b/ai_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAIRun(t *testing.T) { +func TestAINew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestAIRun(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AI.Run( + _, err := client.AI.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "string", - cloudflare.AIRunParams{ + cloudflare.AINewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) diff --git a/alerting.go b/alerting.go index a7433cc7d0c..d9b06a6e2ba 100644 --- a/alerting.go +++ b/alerting.go @@ -12,7 +12,6 @@ import ( // service directly, and instead use the [NewAlertingService] method instead. type AlertingService struct { Options []option.RequestOption - V3s *AlertingV3Service V3 *AlertingV3Service } @@ -22,7 +21,6 @@ type AlertingService struct { func NewAlertingService(opts ...option.RequestOption) (r *AlertingService) { r = &AlertingService{} r.Options = opts - r.V3s = NewAlertingV3Service(opts...) r.V3 = NewAlertingV3Service(opts...) return } diff --git a/alertingv3.go b/alertingv3.go index 0ffb1c6d099..5fb8955dd24 100644 --- a/alertingv3.go +++ b/alertingv3.go @@ -3,7 +3,16 @@ package cloudflare 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" ) // AlertingV3Service contains methods and other services that help with interacting @@ -28,3 +37,135 @@ func NewAlertingV3Service(opts ...option.RequestOption) (r *AlertingV3Service) { r.Policies = NewAlertingV3PolicyService(opts...) return } + +// Gets a list of all alert types for which an account is eligible. +func (r *AlertingV3Service) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3ListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3ListResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/available_alerts", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [AlertingV3ListResponseUnknown], +// [AlertingV3ListResponseArray] or [shared.UnionString]. +type AlertingV3ListResponse interface { + ImplementsAlertingV3ListResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AlertingV3ListResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AlertingV3ListResponseArray []interface{} + +func (r AlertingV3ListResponseArray) ImplementsAlertingV3ListResponse() {} + +type AlertingV3ListResponseEnvelope struct { + Errors []AlertingV3ListResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3ListResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3ListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AlertingV3ListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3ListResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3ListResponseEnvelopeJSON `json:"-"` +} + +// alertingV3ListResponseEnvelopeJSON contains the JSON metadata for the struct +// [AlertingV3ListResponseEnvelope] +type alertingV3ListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3ListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3ListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3ListResponseEnvelopeErrorsJSON `json:"-"` +} + +// alertingV3ListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AlertingV3ListResponseEnvelopeErrors] +type alertingV3ListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3ListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3ListResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3ListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [AlertingV3ListResponseEnvelopeMessages] +type alertingV3ListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3ListResponseEnvelopeSuccess bool + +const ( + AlertingV3ListResponseEnvelopeSuccessTrue AlertingV3ListResponseEnvelopeSuccess = true +) + +type AlertingV3ListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON alertingV3ListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// alertingV3ListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [AlertingV3ListResponseEnvelopeResultInfo] +type alertingV3ListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3ListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/customnverify_test.go b/alertingv3_test.go similarity index 87% rename from customnverify_test.go rename to alertingv3_test.go index 6ac1aae9b08..4dbee538cfe 100644 --- a/customnverify_test.go +++ b/alertingv3_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomNVerifyUpdate(t *testing.T) { +func TestAlertingV3List(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestCustomNVerifyUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomNs.Verifies.Update(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + _, err := client.Alerting.V3.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/alertingv3availablealert.go b/alertingv3availablealert.go deleted file mode 100644 index 6cc5356235f..00000000000 --- a/alertingv3availablealert.go +++ /dev/null @@ -1,166 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -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" -) - -// AlertingV3AvailableAlertService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewAlertingV3AvailableAlertService] method instead. -type AlertingV3AvailableAlertService struct { - Options []option.RequestOption -} - -// NewAlertingV3AvailableAlertService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewAlertingV3AvailableAlertService(opts ...option.RequestOption) (r *AlertingV3AvailableAlertService) { - r = &AlertingV3AvailableAlertService{} - r.Options = opts - return -} - -// Gets a list of all alert types for which an account is eligible. -func (r *AlertingV3AvailableAlertService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3AvailableAlertListResponse, err error) { - opts = append(r.Options[:], opts...) - var env AlertingV3AvailableAlertListResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/available_alerts", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [AlertingV3AvailableAlertListResponseUnknown], -// [AlertingV3AvailableAlertListResponseArray] or [shared.UnionString]. -type AlertingV3AvailableAlertListResponse interface { - ImplementsAlertingV3AvailableAlertListResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AlertingV3AvailableAlertListResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AlertingV3AvailableAlertListResponseArray []interface{} - -func (r AlertingV3AvailableAlertListResponseArray) ImplementsAlertingV3AvailableAlertListResponse() {} - -type AlertingV3AvailableAlertListResponseEnvelope struct { - Errors []AlertingV3AvailableAlertListResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3AvailableAlertListResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3AvailableAlertListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AlertingV3AvailableAlertListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3AvailableAlertListResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3AvailableAlertListResponseEnvelopeJSON `json:"-"` -} - -// alertingV3AvailableAlertListResponseEnvelopeJSON contains the JSON metadata for -// the struct [AlertingV3AvailableAlertListResponseEnvelope] -type alertingV3AvailableAlertListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3AvailableAlertListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3AvailableAlertListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3AvailableAlertListResponseEnvelopeErrorsJSON `json:"-"` -} - -// alertingV3AvailableAlertListResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [AlertingV3AvailableAlertListResponseEnvelopeErrors] -type alertingV3AvailableAlertListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3AvailableAlertListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3AvailableAlertListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3AvailableAlertListResponseEnvelopeMessagesJSON `json:"-"` -} - -// alertingV3AvailableAlertListResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [AlertingV3AvailableAlertListResponseEnvelopeMessages] -type alertingV3AvailableAlertListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3AvailableAlertListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AlertingV3AvailableAlertListResponseEnvelopeSuccess bool - -const ( - AlertingV3AvailableAlertListResponseEnvelopeSuccessTrue AlertingV3AvailableAlertListResponseEnvelopeSuccess = true -) - -type AlertingV3AvailableAlertListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3AvailableAlertListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// alertingV3AvailableAlertListResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [AlertingV3AvailableAlertListResponseEnvelopeResultInfo] -type alertingV3AvailableAlertListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3AvailableAlertListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/alertingv3destination.go b/alertingv3destination.go index bac55a9e210..496e111b0ab 100644 --- a/alertingv3destination.go +++ b/alertingv3destination.go @@ -12,10 +12,10 @@ import ( // this service directly, and instead use the [NewAlertingV3DestinationService] // method instead. type AlertingV3DestinationService struct { - Options []option.RequestOption - Eligibles *AlertingV3DestinationEligibleService - Pagerduties *AlertingV3DestinationPagerdutyService - Webhooks *AlertingV3DestinationWebhookService + Options []option.RequestOption + Eligible *AlertingV3DestinationEligibleService + Pagerduty *AlertingV3DestinationPagerdutyService + Webhooks *AlertingV3DestinationWebhookService } // NewAlertingV3DestinationService generates a new service that applies the given @@ -24,8 +24,8 @@ type AlertingV3DestinationService struct { func NewAlertingV3DestinationService(opts ...option.RequestOption) (r *AlertingV3DestinationService) { r = &AlertingV3DestinationService{} r.Options = opts - r.Eligibles = NewAlertingV3DestinationEligibleService(opts...) - r.Pagerduties = NewAlertingV3DestinationPagerdutyService(opts...) + r.Eligible = NewAlertingV3DestinationEligibleService(opts...) + r.Pagerduty = NewAlertingV3DestinationPagerdutyService(opts...) r.Webhooks = NewAlertingV3DestinationWebhookService(opts...) return } diff --git a/alertingv3destinationeligible.go b/alertingv3destinationeligible.go index ea369240806..ac8b88c1990 100644 --- a/alertingv3destinationeligible.go +++ b/alertingv3destinationeligible.go @@ -34,9 +34,9 @@ func NewAlertingV3DestinationEligibleService(opts ...option.RequestOption) (r *A } // Get a list of all delivery mechanism types for which an account is eligible. -func (r *AlertingV3DestinationEligibleService) NotificationMechanismEligibilityGetDeliveryMechanismEligibility(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse, err error) { +func (r *AlertingV3DestinationEligibleService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3DestinationEligibleGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelope + var env AlertingV3DestinationEligibleGetResponseEnvelope path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/eligible", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,17 +46,15 @@ func (r *AlertingV3DestinationEligibleService) NotificationMechanismEligibilityG return } -// Union satisfied by -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseUnknown], -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseArray] -// or [shared.UnionString]. -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse interface { - ImplementsAlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse() +// Union satisfied by [AlertingV3DestinationEligibleGetResponseUnknown], +// [AlertingV3DestinationEligibleGetResponseArray] or [shared.UnionString]. +type AlertingV3DestinationEligibleGetResponse interface { + ImplementsAlertingV3DestinationEligibleGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse)(nil)).Elem(), + reflect.TypeOf((*AlertingV3DestinationEligibleGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -65,25 +63,24 @@ func init() { ) } -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseArray []interface{} +type AlertingV3DestinationEligibleGetResponseArray []interface{} -func (r AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseArray) ImplementsAlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse() { +func (r AlertingV3DestinationEligibleGetResponseArray) ImplementsAlertingV3DestinationEligibleGetResponse() { } -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelope struct { - Errors []AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse `json:"result,required,nullable"` +type AlertingV3DestinationEligibleGetResponseEnvelope struct { + Errors []AlertingV3DestinationEligibleGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationEligibleGetResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationEligibleGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeJSON `json:"-"` + Success AlertingV3DestinationEligibleGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3DestinationEligibleGetResponseEnvelopeJSON `json:"-"` } -// alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelope] -type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeJSON struct { +// alertingV3DestinationEligibleGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [AlertingV3DestinationEligibleGetResponseEnvelope] +type alertingV3DestinationEligibleGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -93,58 +90,57 @@ type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMec ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationEligibleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3DestinationEligibleGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrors] -type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrorsJSON struct { +// alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AlertingV3DestinationEligibleGetResponseEnvelopeErrors] +type alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationEligibleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3DestinationEligibleGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessages] -type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessagesJSON struct { +// alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationEligibleGetResponseEnvelopeMessages] +type alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationEligibleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeSuccess bool +type AlertingV3DestinationEligibleGetResponseEnvelopeSuccess bool const ( - AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeSuccessTrue AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeSuccess = true + AlertingV3DestinationEligibleGetResponseEnvelopeSuccessTrue AlertingV3DestinationEligibleGetResponseEnvelopeSuccess = true ) -type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfo struct { +type AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -152,14 +148,14 @@ type AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMec // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON `json:"-"` } -// alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfo] -type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfoJSON struct { +// alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo] +type alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -168,6 +164,6 @@ type alertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMec ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/alertingv3destinationeligible_test.go b/alertingv3destinationeligible_test.go index 3225ce12c57..c52ca2fca02 100644 --- a/alertingv3destinationeligible_test.go +++ b/alertingv3destinationeligible_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibility(t *testing.T) { +func TestAlertingV3DestinationEligibleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliver option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Eligibles.NotificationMechanismEligibilityGetDeliveryMechanismEligibility(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Alerting.V3.Destinations.Eligible.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/alertingv3destinationpagerduty.go b/alertingv3destinationpagerduty.go index 49737dd5c8b..e837af64cc5 100644 --- a/alertingv3destinationpagerduty.go +++ b/alertingv3destinationpagerduty.go @@ -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" ) // AlertingV3DestinationPagerdutyService contains methods and other services that @@ -30,10 +33,36 @@ func NewAlertingV3DestinationPagerdutyService(opts ...option.RequestOption) (r * return } +// Creates a new token for integrating with PagerDuty. +func (r *AlertingV3DestinationPagerdutyService) New(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3DestinationPagerdutyNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Deletes all the PagerDuty Services connected to the account. +func (r *AlertingV3DestinationPagerdutyService) Delete(ctx context.Context, accountID string, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3DestinationPagerdutyDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Get a list of all configured PagerDuty services. -func (r *AlertingV3DestinationPagerdutyService) NotificationDestinationsWithPagerDutyListPagerDutyServices(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse, err error) { +func (r *AlertingV3DestinationPagerdutyService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3DestinationPagerdutyGetResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelope + var env AlertingV3DestinationPagerdutyGetResponseEnvelope path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,42 +72,182 @@ func (r *AlertingV3DestinationPagerdutyService) NotificationDestinationsWithPage return } -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse struct { +// Links PagerDuty with the account using the integration token. +func (r *AlertingV3DestinationPagerdutyService) Link(ctx context.Context, accountID string, tokenID string, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyLinkResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3DestinationPagerdutyLinkResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect/%s", accountID, tokenID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type AlertingV3DestinationPagerdutyNewResponse struct { + // UUID + ID string `json:"id"` + JSON alertingV3DestinationPagerdutyNewResponseJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyNewResponseJSON contains the JSON metadata for the +// struct [AlertingV3DestinationPagerdutyNewResponse] +type alertingV3DestinationPagerdutyNewResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [AlertingV3DestinationPagerdutyDeleteResponseUnknown], +// [AlertingV3DestinationPagerdutyDeleteResponseArray] or [shared.UnionString]. +type AlertingV3DestinationPagerdutyDeleteResponse interface { + ImplementsAlertingV3DestinationPagerdutyDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AlertingV3DestinationPagerdutyDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type AlertingV3DestinationPagerdutyDeleteResponseArray []interface{} + +func (r AlertingV3DestinationPagerdutyDeleteResponseArray) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() { +} + +type AlertingV3DestinationPagerdutyGetResponse struct { // UUID ID string `json:"id"` // The name of the pagerduty service. - Name string `json:"name"` - JSON alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseJSON `json:"-"` + Name string `json:"name"` + JSON alertingV3DestinationPagerdutyGetResponseJSON `json:"-"` } -// alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse] -type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseJSON struct { +// alertingV3DestinationPagerdutyGetResponseJSON contains the JSON metadata for the +// struct [AlertingV3DestinationPagerdutyGetResponse] +type alertingV3DestinationPagerdutyGetResponseJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationPagerdutyGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyLinkResponse struct { + // UUID + ID string `json:"id"` + JSON alertingV3DestinationPagerdutyLinkResponseJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyLinkResponseJSON contains the JSON metadata for +// the struct [AlertingV3DestinationPagerdutyLinkResponse] +type alertingV3DestinationPagerdutyLinkResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyLinkResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyNewResponseEnvelope struct { + Errors []AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationPagerdutyNewResponse `json:"result,required"` + // Whether the API call was successful + Success AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3DestinationPagerdutyNewResponseEnvelopeJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [AlertingV3DestinationPagerdutyNewResponseEnvelope] +type alertingV3DestinationPagerdutyNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors] +type alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelope struct { - Errors []AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessages `json:"messages,required"` - Result []AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse `json:"result,required,nullable"` +type AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages] +type alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess bool + +const ( + AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess = true +) + +type AlertingV3DestinationPagerdutyDeleteResponseEnvelope struct { + Errors []AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationPagerdutyDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeJSON `json:"-"` + Success AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON `json:"-"` } -// alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelope] -type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeJSON struct { +// alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON contains the JSON +// metadata for the struct [AlertingV3DestinationPagerdutyDeleteResponseEnvelope] +type alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -88,58 +257,58 @@ type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPage ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrors] -type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrorsJSON struct { +// alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors] +type alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessages] -type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessagesJSON struct { +// alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages] +type alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeSuccess bool +type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess bool const ( - AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeSuccess = true + AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess = true ) -type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfo struct { +type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -147,14 +316,14 @@ type AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPage // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfo] -type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfoJSON struct { +// alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo] +type alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -163,6 +332,178 @@ type alertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPage ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type AlertingV3DestinationPagerdutyGetResponseEnvelope struct { + Errors []AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages `json:"messages,required"` + Result []AlertingV3DestinationPagerdutyGetResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3DestinationPagerdutyGetResponseEnvelopeJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [AlertingV3DestinationPagerdutyGetResponseEnvelope] +type alertingV3DestinationPagerdutyGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors] +type alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages] +type alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess bool + +const ( + AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess = true +) + +type AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo] +type alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyLinkResponseEnvelope struct { + Errors []AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationPagerdutyLinkResponse `json:"result,required"` + // Whether the API call was successful + Success AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON contains the JSON +// metadata for the struct [AlertingV3DestinationPagerdutyLinkResponseEnvelope] +type alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors] +type alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages] +type alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess bool + +const ( + AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess = true +) diff --git a/alertingv3destinationpagerduty_test.go b/alertingv3destinationpagerduty_test.go index a39a5f45bbb..1ba2446d291 100644 --- a/alertingv3destinationpagerduty_test.go +++ b/alertingv3destinationpagerduty_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServices(t *testing.T) { +func TestAlertingV3DestinationPagerdutyNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,89 @@ func TestAlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyList option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Pagerduties.NotificationDestinationsWithPagerDutyListPagerDutyServices(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Alerting.V3.Destinations.Pagerduty.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAlertingV3DestinationPagerdutyDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Alerting.V3.Destinations.Pagerduty.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAlertingV3DestinationPagerdutyGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Alerting.V3.Destinations.Pagerduty.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestAlertingV3DestinationPagerdutyLink(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Alerting.V3.Destinations.Pagerduty.Link( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "8c71e667571b4f61b94d9e4b12158038", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/alertingv3destinationwebhook.go b/alertingv3destinationwebhook.go index 876ce74b61d..968da4b7bb8 100644 --- a/alertingv3destinationwebhook.go +++ b/alertingv3destinationwebhook.go @@ -35,12 +35,25 @@ func NewAlertingV3DestinationWebhookService(opts ...option.RequestOption) (r *Al return } -// Update a webhook destination. -func (r *AlertingV3DestinationWebhookService) Update(ctx context.Context, accountID string, webhookID string, body AlertingV3DestinationWebhookUpdateParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookUpdateResponse, err error) { +// Creates a new webhook destination. +func (r *AlertingV3DestinationWebhookService) New(ctx context.Context, accountID string, body AlertingV3DestinationWebhookNewParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3DestinationWebhookUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", accountID, webhookID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AlertingV3DestinationWebhookNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Gets a list of all configured webhook destinations. +func (r *AlertingV3DestinationWebhookService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3DestinationWebhookListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3DestinationWebhookListResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -74,12 +87,12 @@ func (r *AlertingV3DestinationWebhookService) Get(ctx context.Context, accountID return } -// Creates a new webhook destination. -func (r *AlertingV3DestinationWebhookService) NotificationWebhooksNewAWebhook(ctx context.Context, accountID string, body AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse, err error) { +// Update a webhook destination. +func (r *AlertingV3DestinationWebhookService) Replace(ctx context.Context, accountID string, webhookID string, body AlertingV3DestinationWebhookReplaceParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env AlertingV3DestinationWebhookReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", accountID, webhookID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -87,37 +100,77 @@ func (r *AlertingV3DestinationWebhookService) NotificationWebhooksNewAWebhook(ct return } -// Gets a list of all configured webhook destinations. -func (r *AlertingV3DestinationWebhookService) NotificationWebhooksListWebhooks(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse, err error) { - opts = append(r.Options[:], opts...) - var env AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type AlertingV3DestinationWebhookNewResponse struct { + // UUID + ID string `json:"id"` + JSON alertingV3DestinationWebhookNewResponseJSON `json:"-"` } -type AlertingV3DestinationWebhookUpdateResponse struct { - // UUID - ID string `json:"id"` - JSON alertingV3DestinationWebhookUpdateResponseJSON `json:"-"` +// alertingV3DestinationWebhookNewResponseJSON contains the JSON metadata for the +// struct [AlertingV3DestinationWebhookNewResponse] +type alertingV3DestinationWebhookNewResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationWebhookNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3DestinationWebhookListResponse struct { + // The unique identifier of a webhook + ID string `json:"id"` + // Timestamp of when the webhook destination was created. + CreatedAt time.Time `json:"created_at" format:"date-time"` + // Timestamp of the last time an attempt to dispatch a notification to this webhook + // failed. + LastFailure time.Time `json:"last_failure" format:"date-time"` + // Timestamp of the last time Cloudflare was able to successfully dispatch a + // notification using this webhook. + LastSuccess time.Time `json:"last_success" format:"date-time"` + // The name of the webhook destination. This will be included in the request body + // when you receive a webhook notification. + Name string `json:"name"` + // Optional secret that will be passed in the `cf-webhook-auth` header when + // dispatching generic webhook notifications or formatted for supported + // destinations. Secrets are not returned in any API response body. + Secret string `json:"secret"` + // Type of webhook endpoint. + Type AlertingV3DestinationWebhookListResponseType `json:"type"` + // The POST endpoint to call when dispatching a notification. + URL string `json:"url"` + JSON alertingV3DestinationWebhookListResponseJSON `json:"-"` } -// alertingV3DestinationWebhookUpdateResponseJSON contains the JSON metadata for -// the struct [AlertingV3DestinationWebhookUpdateResponse] -type alertingV3DestinationWebhookUpdateResponseJSON struct { +// alertingV3DestinationWebhookListResponseJSON contains the JSON metadata for the +// struct [AlertingV3DestinationWebhookListResponse] +type alertingV3DestinationWebhookListResponseJSON struct { ID apijson.Field + CreatedAt apijson.Field + LastFailure apijson.Field + LastSuccess apijson.Field + Name apijson.Field + Secret apijson.Field + Type apijson.Field + URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +// Type of webhook endpoint. +type AlertingV3DestinationWebhookListResponseType string + +const ( + AlertingV3DestinationWebhookListResponseTypeSlack AlertingV3DestinationWebhookListResponseType = "slack" + AlertingV3DestinationWebhookListResponseTypeGeneric AlertingV3DestinationWebhookListResponseType = "generic" + AlertingV3DestinationWebhookListResponseTypeGchat AlertingV3DestinationWebhookListResponseType = "gchat" +) + // Union satisfied by [AlertingV3DestinationWebhookDeleteResponseUnknown], // [AlertingV3DestinationWebhookDeleteResponseArray] or [shared.UnionString]. type AlertingV3DestinationWebhookDeleteResponse interface { @@ -193,166 +246,210 @@ const ( AlertingV3DestinationWebhookGetResponseTypeGchat AlertingV3DestinationWebhookGetResponseType = "gchat" ) -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse struct { +type AlertingV3DestinationWebhookReplaceResponse struct { // UUID - ID string `json:"id"` - JSON alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseJSON `json:"-"` + ID string `json:"id"` + JSON alertingV3DestinationWebhookReplaceResponseJSON `json:"-"` } -// alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseJSON contains -// the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse] -type alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseJSON struct { +// alertingV3DestinationWebhookReplaceResponseJSON contains the JSON metadata for +// the struct [AlertingV3DestinationWebhookReplaceResponse] +type alertingV3DestinationWebhookReplaceResponseJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse struct { - // The unique identifier of a webhook - ID string `json:"id"` - // Timestamp of when the webhook destination was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of the last time an attempt to dispatch a notification to this webhook - // failed. - LastFailure time.Time `json:"last_failure" format:"date-time"` - // Timestamp of the last time Cloudflare was able to successfully dispatch a - // notification using this webhook. - LastSuccess time.Time `json:"last_success" format:"date-time"` +type AlertingV3DestinationWebhookNewParams struct { // The name of the webhook destination. This will be included in the request body // when you receive a webhook notification. - Name string `json:"name"` + Name param.Field[string] `json:"name,required"` + // The POST endpoint to call when dispatching a notification. + URL param.Field[string] `json:"url,required"` // Optional secret that will be passed in the `cf-webhook-auth` header when // dispatching generic webhook notifications or formatted for supported // destinations. Secrets are not returned in any API response body. - Secret string `json:"secret"` - // Type of webhook endpoint. - Type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseType `json:"type"` - // The POST endpoint to call when dispatching a notification. - URL string `json:"url"` - JSON alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseJSON `json:"-"` + Secret param.Field[string] `json:"secret"` } -// alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse] -type alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseJSON struct { - ID apijson.Field - CreatedAt apijson.Field - LastFailure apijson.Field - LastSuccess apijson.Field - Name apijson.Field - Secret apijson.Field - Type apijson.Field - URL apijson.Field +func (r AlertingV3DestinationWebhookNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type AlertingV3DestinationWebhookNewResponseEnvelope struct { + Errors []AlertingV3DestinationWebhookNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationWebhookNewResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationWebhookNewResponse `json:"result,required"` + // Whether the API call was successful + Success AlertingV3DestinationWebhookNewResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3DestinationWebhookNewResponseEnvelopeJSON `json:"-"` +} + +// alertingV3DestinationWebhookNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [AlertingV3DestinationWebhookNewResponseEnvelope] +type alertingV3DestinationWebhookNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Type of webhook endpoint. -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseType string +type AlertingV3DestinationWebhookNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON `json:"-"` +} -const ( - AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseTypeSlack AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseType = "slack" - AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseTypeGeneric AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseType = "generic" - AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseTypeGchat AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseType = "gchat" -) +// alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AlertingV3DestinationWebhookNewResponseEnvelopeErrors] +type alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} -type AlertingV3DestinationWebhookUpdateParams struct { - // The name of the webhook destination. This will be included in the request body - // when you receive a webhook notification. - Name param.Field[string] `json:"name,required"` - // The POST endpoint to call when dispatching a notification. - URL param.Field[string] `json:"url,required"` - // Optional secret that will be passed in the `cf-webhook-auth` header when - // dispatching generic webhook notifications or formatted for supported - // destinations. Secrets are not returned in any API response body. - Secret param.Field[string] `json:"secret"` +func (r *AlertingV3DestinationWebhookNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r AlertingV3DestinationWebhookUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type AlertingV3DestinationWebhookNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationWebhookNewResponseEnvelopeMessages] +type alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type AlertingV3DestinationWebhookUpdateResponseEnvelope struct { - Errors []AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3DestinationWebhookUpdateResponse `json:"result,required"` +func (r *AlertingV3DestinationWebhookNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3DestinationWebhookNewResponseEnvelopeSuccess bool + +const ( + AlertingV3DestinationWebhookNewResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookNewResponseEnvelopeSuccess = true +) + +type AlertingV3DestinationWebhookListResponseEnvelope struct { + Errors []AlertingV3DestinationWebhookListResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationWebhookListResponseEnvelopeMessages `json:"messages,required"` + Result []AlertingV3DestinationWebhookListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON alertingV3DestinationWebhookUpdateResponseEnvelopeJSON `json:"-"` + Success AlertingV3DestinationWebhookListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3DestinationWebhookListResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3DestinationWebhookListResponseEnvelopeJSON `json:"-"` } -// alertingV3DestinationWebhookUpdateResponseEnvelopeJSON contains the JSON -// metadata for the struct [AlertingV3DestinationWebhookUpdateResponseEnvelope] -type alertingV3DestinationWebhookUpdateResponseEnvelopeJSON struct { +// alertingV3DestinationWebhookListResponseEnvelopeJSON contains the JSON metadata +// for the struct [AlertingV3DestinationWebhookListResponseEnvelope] +type alertingV3DestinationWebhookListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3DestinationWebhookListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors] -type alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON struct { +// alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [AlertingV3DestinationWebhookListResponseEnvelopeErrors] +type alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3DestinationWebhookListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON contains the JSON +// alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON contains the JSON // metadata for the struct -// [AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages] -type alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON struct { +// [AlertingV3DestinationWebhookListResponseEnvelopeMessages] +type alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess bool +type AlertingV3DestinationWebhookListResponseEnvelopeSuccess bool const ( - AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess = true + AlertingV3DestinationWebhookListResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookListResponseEnvelopeSuccess = true ) +type AlertingV3DestinationWebhookListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationWebhookListResponseEnvelopeResultInfo] +type alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3DestinationWebhookListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AlertingV3DestinationWebhookDeleteResponseEnvelope struct { Errors []AlertingV3DestinationWebhookDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AlertingV3DestinationWebhookDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -524,7 +621,7 @@ const ( AlertingV3DestinationWebhookGetResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookGetResponseEnvelopeSuccess = true ) -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams struct { +type AlertingV3DestinationWebhookReplaceParams struct { // The name of the webhook destination. This will be included in the request body // when you receive a webhook notification. Name param.Field[string] `json:"name,required"` @@ -536,180 +633,77 @@ type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams struct { Secret param.Field[string] `json:"secret"` } -func (r AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams) MarshalJSON() (data []byte, err error) { +func (r AlertingV3DestinationWebhookReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelope struct { - Errors []AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse `json:"result,required"` - // Whether the API call was successful - Success AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeSuccess `json:"success,required"` - JSON alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeJSON `json:"-"` -} - -// alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelope] -type alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrorsJSON `json:"-"` -} - -// alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrors] -type alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessagesJSON `json:"-"` -} - -// alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessages] -type alertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeSuccess bool - -const ( - AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponseEnvelopeSuccess = true -) - -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelope struct { - Errors []AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessages `json:"messages,required"` - Result []AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse `json:"result,required,nullable"` +type AlertingV3DestinationWebhookReplaceResponseEnvelope struct { + Errors []AlertingV3DestinationWebhookReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3DestinationWebhookReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3DestinationWebhookReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeJSON `json:"-"` + Success AlertingV3DestinationWebhookReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3DestinationWebhookReplaceResponseEnvelopeJSON `json:"-"` } -// alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelope] -type alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeJSON struct { +// alertingV3DestinationWebhookReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [AlertingV3DestinationWebhookReplaceResponseEnvelope] +type alertingV3DestinationWebhookReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3DestinationWebhookReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrors] -type alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrorsJSON struct { +// alertingV3DestinationWebhookReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [AlertingV3DestinationWebhookReplaceResponseEnvelopeErrors] +type alertingV3DestinationWebhookReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3DestinationWebhookReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3DestinationWebhookReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessages] -type alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessagesJSON struct { +// alertingV3DestinationWebhookReplaceResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [AlertingV3DestinationWebhookReplaceResponseEnvelopeMessages] +type alertingV3DestinationWebhookReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3DestinationWebhookReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeSuccess bool +type AlertingV3DestinationWebhookReplaceResponseEnvelopeSuccess bool const ( - AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeSuccess = true + AlertingV3DestinationWebhookReplaceResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookReplaceResponseEnvelopeSuccess = true ) - -type AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfoJSON `json:"-"` -} - -// alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfo] -type alertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/alertingv3destinationwebhook_test.go b/alertingv3destinationwebhook_test.go index eca53a8359c..8e4fbb01e58 100644 --- a/alertingv3destinationwebhook_test.go +++ b/alertingv3destinationwebhook_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3DestinationWebhookUpdateWithOptionalParams(t *testing.T) { +func TestAlertingV3DestinationWebhookNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestAlertingV3DestinationWebhookUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Webhooks.Update( + _, err := client.Alerting.V3.Destinations.Webhooks.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "b115d5ec-15c6-41ee-8b76-92c449b5227b", - cloudflare.AlertingV3DestinationWebhookUpdateParams{ + cloudflare.AlertingV3DestinationWebhookNewParams{ Name: cloudflare.F("Slack Webhook"), URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"), Secret: cloudflare.F("string"), @@ -48,7 +47,7 @@ func TestAlertingV3DestinationWebhookUpdateWithOptionalParams(t *testing.T) { } } -func TestAlertingV3DestinationWebhookDelete(t *testing.T) { +func TestAlertingV3DestinationWebhookList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,11 +63,7 @@ func TestAlertingV3DestinationWebhookDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Webhooks.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "b115d5ec-15c6-41ee-8b76-92c449b5227b", - ) + _, err := client.Alerting.V3.Destinations.Webhooks.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -78,7 +73,7 @@ func TestAlertingV3DestinationWebhookDelete(t *testing.T) { } } -func TestAlertingV3DestinationWebhookGet(t *testing.T) { +func TestAlertingV3DestinationWebhookDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,7 +89,7 @@ func TestAlertingV3DestinationWebhookGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Webhooks.Get( + _, err := client.Alerting.V3.Destinations.Webhooks.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "b115d5ec-15c6-41ee-8b76-92c449b5227b", @@ -108,7 +103,7 @@ func TestAlertingV3DestinationWebhookGet(t *testing.T) { } } -func TestAlertingV3DestinationWebhookNotificationWebhooksNewAWebhookWithOptionalParams(t *testing.T) { +func TestAlertingV3DestinationWebhookGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,14 +119,10 @@ func TestAlertingV3DestinationWebhookNotificationWebhooksNewAWebhookWithOptional option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Webhooks.NotificationWebhooksNewAWebhook( + _, err := client.Alerting.V3.Destinations.Webhooks.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams{ - Name: cloudflare.F("Slack Webhook"), - URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"), - Secret: cloudflare.F("string"), - }, + "b115d5ec-15c6-41ee-8b76-92c449b5227b", ) if err != nil { var apierr *cloudflare.Error @@ -142,7 +133,7 @@ func TestAlertingV3DestinationWebhookNotificationWebhooksNewAWebhookWithOptional } } -func TestAlertingV3DestinationWebhookNotificationWebhooksListWebhooks(t *testing.T) { +func TestAlertingV3DestinationWebhookReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -158,7 +149,16 @@ func TestAlertingV3DestinationWebhookNotificationWebhooksListWebhooks(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Destinations.Webhooks.NotificationWebhooksListWebhooks(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Alerting.V3.Destinations.Webhooks.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "b115d5ec-15c6-41ee-8b76-92c449b5227b", + cloudflare.AlertingV3DestinationWebhookReplaceParams{ + Name: cloudflare.F("Slack Webhook"), + URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"), + Secret: cloudflare.F("string"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/alertingv3history.go b/alertingv3history.go index e94e036894c..18cee0555f3 100644 --- a/alertingv3history.go +++ b/alertingv3history.go @@ -13,6 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -37,19 +38,31 @@ func NewAlertingV3HistoryService(opts ...option.RequestOption) (r *AlertingV3His // Gets a list of history records for notifications sent to an account. The records // are displayed for last `x` number of days based on the zone plan (free = 30, pro // = 30, biz = 30, ent = 90). -func (r *AlertingV3HistoryService) NotificationHistoryListHistory(ctx context.Context, accountID string, query AlertingV3HistoryNotificationHistoryListHistoryParams, opts ...option.RequestOption) (res *[]AlertingV3HistoryNotificationHistoryListHistoryResponse, err error) { - opts = append(r.Options[:], opts...) - var env AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelope +func (r *AlertingV3HistoryService) List(ctx context.Context, accountID string, query AlertingV3HistoryListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AlertingV3HistoryListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/alerting/v3/history", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Gets a list of history records for notifications sent to an account. The records +// are displayed for last `x` number of days based on the zone plan (free = 30, pro +// = 30, biz = 30, ent = 90). +func (r *AlertingV3HistoryService) ListAutoPaging(ctx context.Context, accountID string, query AlertingV3HistoryListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AlertingV3HistoryListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountID, query, opts...)) } -type AlertingV3HistoryNotificationHistoryListHistoryResponse struct { +type AlertingV3HistoryListResponse struct { // UUID ID string `json:"id"` // Message body included in the notification sent. @@ -62,20 +75,19 @@ type AlertingV3HistoryNotificationHistoryListHistoryResponse struct { Mechanism string `json:"mechanism"` // The type of mechanism to which the notification has been dispatched. This can be // email/pagerduty/webhook based on the mechanism configured. - MechanismType AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismType `json:"mechanism_type"` + MechanismType AlertingV3HistoryListResponseMechanismType `json:"mechanism_type"` // Name of the policy. Name string `json:"name"` // The unique identifier of a notification policy PolicyID string `json:"policy_id"` // Timestamp of when the notification was dispatched in ISO 8601 format. - Sent time.Time `json:"sent" format:"date-time"` - JSON alertingV3HistoryNotificationHistoryListHistoryResponseJSON `json:"-"` + Sent time.Time `json:"sent" format:"date-time"` + JSON alertingV3HistoryListResponseJSON `json:"-"` } -// alertingV3HistoryNotificationHistoryListHistoryResponseJSON contains the JSON -// metadata for the struct -// [AlertingV3HistoryNotificationHistoryListHistoryResponse] -type alertingV3HistoryNotificationHistoryListHistoryResponseJSON struct { +// alertingV3HistoryListResponseJSON contains the JSON metadata for the struct +// [AlertingV3HistoryListResponse] +type alertingV3HistoryListResponseJSON struct { ID apijson.Field AlertBody apijson.Field AlertType apijson.Field @@ -89,21 +101,21 @@ type alertingV3HistoryNotificationHistoryListHistoryResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AlertingV3HistoryNotificationHistoryListHistoryResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3HistoryListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of mechanism to which the notification has been dispatched. This can be // email/pagerduty/webhook based on the mechanism configured. -type AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismType string +type AlertingV3HistoryListResponseMechanismType string const ( - AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismTypeEmail AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismType = "email" - AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismTypePagerduty AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismType = "pagerduty" - AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismTypeWebhook AlertingV3HistoryNotificationHistoryListHistoryResponseMechanismType = "webhook" + AlertingV3HistoryListResponseMechanismTypeEmail AlertingV3HistoryListResponseMechanismType = "email" + AlertingV3HistoryListResponseMechanismTypePagerduty AlertingV3HistoryListResponseMechanismType = "pagerduty" + AlertingV3HistoryListResponseMechanismTypeWebhook AlertingV3HistoryListResponseMechanismType = "webhook" ) -type AlertingV3HistoryNotificationHistoryListHistoryParams struct { +type AlertingV3HistoryListParams struct { // Limit the returned results to history records older than the specified date. // This must be a timestamp that conforms to RFC3339. Before param.Field[time.Time] `query:"before" format:"date-time"` @@ -116,113 +128,11 @@ type AlertingV3HistoryNotificationHistoryListHistoryParams struct { Since param.Field[time.Time] `query:"since" format:"date-time"` } -// URLQuery serializes [AlertingV3HistoryNotificationHistoryListHistoryParams]'s -// query parameters as `url.Values`. -func (r AlertingV3HistoryNotificationHistoryListHistoryParams) URLQuery() (v url.Values) { +// URLQuery serializes [AlertingV3HistoryListParams]'s query parameters as +// `url.Values`. +func (r AlertingV3HistoryListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } - -type AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelope struct { - Errors []AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessages `json:"messages,required"` - Result []AlertingV3HistoryNotificationHistoryListHistoryResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeJSON `json:"-"` -} - -// alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelope] -type alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrorsJSON `json:"-"` -} - -// alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrors] -type alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessagesJSON `json:"-"` -} - -// alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessages] -type alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeSuccess bool - -const ( - AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeSuccessTrue AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeSuccess = true -) - -type AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfoJSON `json:"-"` -} - -// alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfo] -type alertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3HistoryNotificationHistoryListHistoryResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/alertingv3history_test.go b/alertingv3history_test.go index c4024692c5b..da5f155be26 100644 --- a/alertingv3history_test.go +++ b/alertingv3history_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3HistoryNotificationHistoryListHistoryWithOptionalParams(t *testing.T) { +func TestAlertingV3HistoryListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,10 +30,10 @@ func TestAlertingV3HistoryNotificationHistoryListHistoryWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Histories.NotificationHistoryListHistory( + _, err := client.Alerting.V3.Histories.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AlertingV3HistoryNotificationHistoryListHistoryParams{ + cloudflare.AlertingV3HistoryListParams{ Before: cloudflare.F(time.Now()), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(5.000000), diff --git a/alertingv3policy.go b/alertingv3policy.go index a2238b0626c..a93c28059bf 100644 --- a/alertingv3policy.go +++ b/alertingv3policy.go @@ -35,12 +35,25 @@ func NewAlertingV3PolicyService(opts ...option.RequestOption) (r *AlertingV3Poli return } -// Update a Notification policy. -func (r *AlertingV3PolicyService) Update(ctx context.Context, accountID string, policyID string, body AlertingV3PolicyUpdateParams, opts ...option.RequestOption) (res *AlertingV3PolicyUpdateResponse, err error) { +// Creates a new Notification policy. +func (r *AlertingV3PolicyService) New(ctx context.Context, accountID string, body AlertingV3PolicyNewParams, opts ...option.RequestOption) (res *AlertingV3PolicyNewResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3PolicyUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", accountID, policyID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env AlertingV3PolicyNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/policies", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Get a list of all Notification policies. +func (r *AlertingV3PolicyService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3PolicyListResponse, err error) { + opts = append(r.Options[:], opts...) + var env AlertingV3PolicyListResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/policies", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -74,25 +87,12 @@ func (r *AlertingV3PolicyService) Get(ctx context.Context, accountID string, pol return } -// Creates a new Notification policy. -func (r *AlertingV3PolicyService) NotificationPoliciesNewANotificationPolicy(ctx context.Context, accountID string, body AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParams, opts ...option.RequestOption) (res *AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/policies", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a list of all Notification policies. -func (r *AlertingV3PolicyService) NotificationPoliciesListNotificationPolicies(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse, err error) { +// Update a Notification policy. +func (r *AlertingV3PolicyService) Replace(ctx context.Context, accountID string, policyID string, body AlertingV3PolicyReplaceParams, opts ...option.RequestOption) (res *AlertingV3PolicyReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelope - path := fmt.Sprintf("accounts/%s/alerting/v3/policies", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env AlertingV3PolicyReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", accountID, policyID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -100,53 +100,32 @@ func (r *AlertingV3PolicyService) NotificationPoliciesListNotificationPolicies(c return } -type AlertingV3PolicyUpdateResponse struct { +type AlertingV3PolicyNewResponse struct { // UUID - ID string `json:"id"` - JSON alertingV3PolicyUpdateResponseJSON `json:"-"` + ID string `json:"id"` + JSON alertingV3PolicyNewResponseJSON `json:"-"` } -// alertingV3PolicyUpdateResponseJSON contains the JSON metadata for the struct -// [AlertingV3PolicyUpdateResponse] -type alertingV3PolicyUpdateResponseJSON struct { +// alertingV3PolicyNewResponseJSON contains the JSON metadata for the struct +// [AlertingV3PolicyNewResponse] +type alertingV3PolicyNewResponseJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [AlertingV3PolicyDeleteResponseUnknown], -// [AlertingV3PolicyDeleteResponseArray] or [shared.UnionString]. -type AlertingV3PolicyDeleteResponse interface { - ImplementsAlertingV3PolicyDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AlertingV3PolicyDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AlertingV3PolicyDeleteResponseArray []interface{} - -func (r AlertingV3PolicyDeleteResponseArray) ImplementsAlertingV3PolicyDeleteResponse() {} - -type AlertingV3PolicyGetResponse struct { +type AlertingV3PolicyListResponse struct { // The unique identifier of a notification policy ID string `json:"id"` // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. - AlertType AlertingV3PolicyGetResponseAlertType `json:"alert_type"` - Created time.Time `json:"created" format:"date-time"` + AlertType AlertingV3PolicyListResponseAlertType `json:"alert_type"` + Created time.Time `json:"created" format:"date-time"` // Optional description for the Notification policy. Description string `json:"description"` // Whether or not the Notification policy is enabled. @@ -154,19 +133,19 @@ type AlertingV3PolicyGetResponse struct { // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. - Filters AlertingV3PolicyGetResponseFilters `json:"filters"` + Filters AlertingV3PolicyListResponseFilters `json:"filters"` // List of IDs that will be used when dispatching a notification. IDs for email // type will be the email address. - Mechanisms map[string][]AlertingV3PolicyGetResponseMechanisms `json:"mechanisms"` - Modified time.Time `json:"modified" format:"date-time"` + Mechanisms map[string][]AlertingV3PolicyListResponseMechanisms `json:"mechanisms"` + Modified time.Time `json:"modified" format:"date-time"` // Name of the policy. - Name string `json:"name"` - JSON alertingV3PolicyGetResponseJSON `json:"-"` + Name string `json:"name"` + JSON alertingV3PolicyListResponseJSON `json:"-"` } -// alertingV3PolicyGetResponseJSON contains the JSON metadata for the struct -// [AlertingV3PolicyGetResponse] -type alertingV3PolicyGetResponseJSON struct { +// alertingV3PolicyListResponseJSON contains the JSON metadata for the struct +// [AlertingV3PolicyListResponse] +type alertingV3PolicyListResponseJSON struct { ID apijson.Field AlertType apijson.Field Created apijson.Field @@ -180,76 +159,76 @@ type alertingV3PolicyGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. -type AlertingV3PolicyGetResponseAlertType string +type AlertingV3PolicyListResponseAlertType string const ( - AlertingV3PolicyGetResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "access_custom_certificate_expiration_type" - AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l4_alert" - AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l7_alert" - AlertingV3PolicyGetResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyGetResponseAlertType = "advanced_http_alert_error" - AlertingV3PolicyGetResponseAlertTypeBGPHijackNotification AlertingV3PolicyGetResponseAlertType = "bgp_hijack_notification" - AlertingV3PolicyGetResponseAlertTypeBillingUsageAlert AlertingV3PolicyGetResponseAlertType = "billing_usage_alert" - AlertingV3PolicyGetResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyGetResponseAlertType = "block_notification_block_removed" - AlertingV3PolicyGetResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyGetResponseAlertType = "block_notification_new_block" - AlertingV3PolicyGetResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyGetResponseAlertType = "block_notification_review_rejected" - AlertingV3PolicyGetResponseAlertTypeBrandProtectionAlert AlertingV3PolicyGetResponseAlertType = "brand_protection_alert" - AlertingV3PolicyGetResponseAlertTypeBrandProtectionDigest AlertingV3PolicyGetResponseAlertType = "brand_protection_digest" - AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_anomaly" - AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_ent_anomaly" - AlertingV3PolicyGetResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "custom_ssl_certificate_event_type" - AlertingV3PolicyGetResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "dedicated_ssl_certificate_event_type" - AlertingV3PolicyGetResponseAlertTypeDosAttackL4 AlertingV3PolicyGetResponseAlertType = "dos_attack_l4" - AlertingV3PolicyGetResponseAlertTypeDosAttackL7 AlertingV3PolicyGetResponseAlertType = "dos_attack_l7" - AlertingV3PolicyGetResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyGetResponseAlertType = "expiring_service_token_alert" - AlertingV3PolicyGetResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyGetResponseAlertType = "failing_logpush_job_disabled_alert" - AlertingV3PolicyGetResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyGetResponseAlertType = "fbm_auto_advertisement" - AlertingV3PolicyGetResponseAlertTypeFbmDosdAttack AlertingV3PolicyGetResponseAlertType = "fbm_dosd_attack" - AlertingV3PolicyGetResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyGetResponseAlertType = "fbm_volumetric_attack" - AlertingV3PolicyGetResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyGetResponseAlertType = "health_check_status_notification" - AlertingV3PolicyGetResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "hostname_aop_custom_certificate_expiration_type" - AlertingV3PolicyGetResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyGetResponseAlertType = "http_alert_edge_error" - AlertingV3PolicyGetResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyGetResponseAlertType = "http_alert_origin_error" - AlertingV3PolicyGetResponseAlertTypeIncidentAlert AlertingV3PolicyGetResponseAlertType = "incident_alert" - AlertingV3PolicyGetResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_health_alert" - AlertingV3PolicyGetResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_pool_enablement_alert" - AlertingV3PolicyGetResponseAlertTypeLogoMatchAlert AlertingV3PolicyGetResponseAlertType = "logo_match_alert" - AlertingV3PolicyGetResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyGetResponseAlertType = "magic_tunnel_health_check_event" - AlertingV3PolicyGetResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyGetResponseAlertType = "maintenance_event_notification" - AlertingV3PolicyGetResponseAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "mtls_certificate_store_certificate_expiration_type" - AlertingV3PolicyGetResponseAlertTypePagesEventAlert AlertingV3PolicyGetResponseAlertType = "pages_event_alert" - AlertingV3PolicyGetResponseAlertTypeRadarNotification AlertingV3PolicyGetResponseAlertType = "radar_notification" - AlertingV3PolicyGetResponseAlertTypeRealOriginMonitoring AlertingV3PolicyGetResponseAlertType = "real_origin_monitoring" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_code_change_detections" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_hosts" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_hosts" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_scripts" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_url" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url" - AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_resources" - AlertingV3PolicyGetResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_all_primaries_failing" - AlertingV3PolicyGetResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_primaries_failing" - AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_successfully_updated" - AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_validation_warning" - AlertingV3PolicyGetResponseAlertTypeSentinelAlert AlertingV3PolicyGetResponseAlertType = "sentinel_alert" - AlertingV3PolicyGetResponseAlertTypeStreamLiveNotifications AlertingV3PolicyGetResponseAlertType = "stream_live_notifications" - AlertingV3PolicyGetResponseAlertTypeTunnelHealthEvent AlertingV3PolicyGetResponseAlertType = "tunnel_health_event" - AlertingV3PolicyGetResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyGetResponseAlertType = "tunnel_update_event" - AlertingV3PolicyGetResponseAlertTypeUniversalSSLEventType AlertingV3PolicyGetResponseAlertType = "universal_ssl_event_type" - AlertingV3PolicyGetResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyGetResponseAlertType = "web_analytics_metrics_update" - AlertingV3PolicyGetResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "zone_aop_custom_certificate_expiration_type" + AlertingV3PolicyListResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "access_custom_certificate_expiration_type" + AlertingV3PolicyListResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyListResponseAlertType = "advanced_ddos_attack_l4_alert" + AlertingV3PolicyListResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyListResponseAlertType = "advanced_ddos_attack_l7_alert" + AlertingV3PolicyListResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyListResponseAlertType = "advanced_http_alert_error" + AlertingV3PolicyListResponseAlertTypeBGPHijackNotification AlertingV3PolicyListResponseAlertType = "bgp_hijack_notification" + AlertingV3PolicyListResponseAlertTypeBillingUsageAlert AlertingV3PolicyListResponseAlertType = "billing_usage_alert" + AlertingV3PolicyListResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyListResponseAlertType = "block_notification_block_removed" + AlertingV3PolicyListResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyListResponseAlertType = "block_notification_new_block" + AlertingV3PolicyListResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyListResponseAlertType = "block_notification_review_rejected" + AlertingV3PolicyListResponseAlertTypeBrandProtectionAlert AlertingV3PolicyListResponseAlertType = "brand_protection_alert" + AlertingV3PolicyListResponseAlertTypeBrandProtectionDigest AlertingV3PolicyListResponseAlertType = "brand_protection_digest" + AlertingV3PolicyListResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyListResponseAlertType = "clickhouse_alert_fw_anomaly" + AlertingV3PolicyListResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyListResponseAlertType = "clickhouse_alert_fw_ent_anomaly" + AlertingV3PolicyListResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyListResponseAlertType = "custom_ssl_certificate_event_type" + AlertingV3PolicyListResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyListResponseAlertType = "dedicated_ssl_certificate_event_type" + AlertingV3PolicyListResponseAlertTypeDosAttackL4 AlertingV3PolicyListResponseAlertType = "dos_attack_l4" + AlertingV3PolicyListResponseAlertTypeDosAttackL7 AlertingV3PolicyListResponseAlertType = "dos_attack_l7" + AlertingV3PolicyListResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyListResponseAlertType = "expiring_service_token_alert" + AlertingV3PolicyListResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyListResponseAlertType = "failing_logpush_job_disabled_alert" + AlertingV3PolicyListResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyListResponseAlertType = "fbm_auto_advertisement" + AlertingV3PolicyListResponseAlertTypeFbmDosdAttack AlertingV3PolicyListResponseAlertType = "fbm_dosd_attack" + AlertingV3PolicyListResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyListResponseAlertType = "fbm_volumetric_attack" + AlertingV3PolicyListResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyListResponseAlertType = "health_check_status_notification" + AlertingV3PolicyListResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "hostname_aop_custom_certificate_expiration_type" + AlertingV3PolicyListResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyListResponseAlertType = "http_alert_edge_error" + AlertingV3PolicyListResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyListResponseAlertType = "http_alert_origin_error" + AlertingV3PolicyListResponseAlertTypeIncidentAlert AlertingV3PolicyListResponseAlertType = "incident_alert" + AlertingV3PolicyListResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyListResponseAlertType = "load_balancing_health_alert" + AlertingV3PolicyListResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyListResponseAlertType = "load_balancing_pool_enablement_alert" + AlertingV3PolicyListResponseAlertTypeLogoMatchAlert AlertingV3PolicyListResponseAlertType = "logo_match_alert" + AlertingV3PolicyListResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyListResponseAlertType = "magic_tunnel_health_check_event" + AlertingV3PolicyListResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyListResponseAlertType = "maintenance_event_notification" + AlertingV3PolicyListResponseAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyListResponseAlertType = "mtls_certificate_store_certificate_expiration_type" + AlertingV3PolicyListResponseAlertTypePagesEventAlert AlertingV3PolicyListResponseAlertType = "pages_event_alert" + AlertingV3PolicyListResponseAlertTypeRadarNotification AlertingV3PolicyListResponseAlertType = "radar_notification" + AlertingV3PolicyListResponseAlertTypeRealOriginMonitoring AlertingV3PolicyListResponseAlertType = "real_origin_monitoring" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_code_change_detections" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_hosts" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_hosts" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_scripts" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_url" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url" + AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_resources" + AlertingV3PolicyListResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyListResponseAlertType = "secondary_dns_all_primaries_failing" + AlertingV3PolicyListResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyListResponseAlertType = "secondary_dns_primaries_failing" + AlertingV3PolicyListResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyListResponseAlertType = "secondary_dns_zone_successfully_updated" + AlertingV3PolicyListResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyListResponseAlertType = "secondary_dns_zone_validation_warning" + AlertingV3PolicyListResponseAlertTypeSentinelAlert AlertingV3PolicyListResponseAlertType = "sentinel_alert" + AlertingV3PolicyListResponseAlertTypeStreamLiveNotifications AlertingV3PolicyListResponseAlertType = "stream_live_notifications" + AlertingV3PolicyListResponseAlertTypeTunnelHealthEvent AlertingV3PolicyListResponseAlertType = "tunnel_health_event" + AlertingV3PolicyListResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyListResponseAlertType = "tunnel_update_event" + AlertingV3PolicyListResponseAlertTypeUniversalSSLEventType AlertingV3PolicyListResponseAlertType = "universal_ssl_event_type" + AlertingV3PolicyListResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyListResponseAlertType = "web_analytics_metrics_update" + AlertingV3PolicyListResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "zone_aop_custom_certificate_expiration_type" ) // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. -type AlertingV3PolicyGetResponseFilters struct { +type AlertingV3PolicyListResponseFilters struct { // Usage depends on specific alert type Actions []string `json:"actions"` // Used for configuring radar_notification @@ -263,7 +242,7 @@ type AlertingV3PolicyGetResponseFilters struct { // Usage depends on specific alert type AlertTriggerPreferences []string `json:"alert_trigger_preferences"` // Used for configuring magic_tunnel_health_check_event - AlertTriggerPreferencesValue []AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"` + AlertTriggerPreferencesValue []AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"` // Used for configuring load_balancing_pool_enablement_alert Enabled []string `json:"enabled"` // Used for configuring pages_event_alert @@ -279,7 +258,7 @@ type AlertingV3PolicyGetResponseFilters struct { // Used for configuring health_check_status_notification HealthCheckID []string `json:"health_check_id"` // Used for configuring incident_alert - IncidentImpact []AlertingV3PolicyGetResponseFiltersIncidentImpact `json:"incident_impact"` + IncidentImpact []AlertingV3PolicyListResponseFiltersIncidentImpact `json:"incident_impact"` // Used for configuring stream_live_notifications InputID []string `json:"input_id"` // Used for configuring billing_usage_alert @@ -321,7 +300,7 @@ type AlertingV3PolicyGetResponseFilters struct { // Used for configuring advanced_ddos_attack_l7_alert TargetZoneName []string `json:"target_zone_name"` // Used for configuring traffic_anomalies_alert - TrafficExclusions []AlertingV3PolicyGetResponseFiltersTrafficExclusion `json:"traffic_exclusions"` + TrafficExclusions []AlertingV3PolicyListResponseFiltersTrafficExclusion `json:"traffic_exclusions"` // Used for configuring tunnel_health_event TunnelID []string `json:"tunnel_id"` // Used for configuring magic_tunnel_health_check_event @@ -329,13 +308,13 @@ type AlertingV3PolicyGetResponseFilters struct { // Usage depends on specific alert type Where []string `json:"where"` // Usage depends on specific alert type - Zones []string `json:"zones"` - JSON alertingV3PolicyGetResponseFiltersJSON `json:"-"` + Zones []string `json:"zones"` + JSON alertingV3PolicyListResponseFiltersJSON `json:"-"` } -// alertingV3PolicyGetResponseFiltersJSON contains the JSON metadata for the struct -// [AlertingV3PolicyGetResponseFilters] -type alertingV3PolicyGetResponseFiltersJSON struct { +// alertingV3PolicyListResponseFiltersJSON contains the JSON metadata for the +// struct [AlertingV3PolicyListResponseFilters] +type alertingV3PolicyListResponseFiltersJSON struct { Actions apijson.Field AffectedAsns apijson.Field AffectedComponents apijson.Field @@ -380,61 +359,61 @@ type alertingV3PolicyGetResponseFiltersJSON struct { ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyGetResponseFilters) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponseFilters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue string +type AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue string const ( - AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "99.0" - AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "98.0" - AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "97.0" + AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "99.0" + AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "98.0" + AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "97.0" ) -type AlertingV3PolicyGetResponseFiltersIncidentImpact string +type AlertingV3PolicyListResponseFiltersIncidentImpact string const ( - AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" - AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" - AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" - AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" + AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" + AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" + AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" + AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" ) -type AlertingV3PolicyGetResponseFiltersTrafficExclusion string +type AlertingV3PolicyListResponseFiltersTrafficExclusion string const ( - AlertingV3PolicyGetResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyGetResponseFiltersTrafficExclusion = "security_events" + AlertingV3PolicyListResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyListResponseFiltersTrafficExclusion = "security_events" ) -type AlertingV3PolicyGetResponseMechanisms struct { +type AlertingV3PolicyListResponseMechanisms struct { // UUID - ID AlertingV3PolicyGetResponseMechanismsID `json:"id"` - JSON alertingV3PolicyGetResponseMechanismsJSON `json:"-"` + ID AlertingV3PolicyListResponseMechanismsID `json:"id"` + JSON alertingV3PolicyListResponseMechanismsJSON `json:"-"` } -// alertingV3PolicyGetResponseMechanismsJSON contains the JSON metadata for the -// struct [AlertingV3PolicyGetResponseMechanisms] -type alertingV3PolicyGetResponseMechanismsJSON struct { +// alertingV3PolicyListResponseMechanismsJSON contains the JSON metadata for the +// struct [AlertingV3PolicyListResponseMechanisms] +type alertingV3PolicyListResponseMechanismsJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyGetResponseMechanisms) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponseMechanisms) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // UUID // // Union satisfied by [shared.UnionString] or [shared.UnionString]. -type AlertingV3PolicyGetResponseMechanismsID interface { - ImplementsAlertingV3PolicyGetResponseMechanismsID() +type AlertingV3PolicyListResponseMechanismsID interface { + ImplementsAlertingV3PolicyListResponseMechanismsID() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AlertingV3PolicyGetResponseMechanismsID)(nil)).Elem(), + reflect.TypeOf((*AlertingV3PolicyListResponseMechanismsID)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -447,33 +426,35 @@ func init() { ) } -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse struct { - // UUID - ID string `json:"id"` - JSON alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseJSON `json:"-"` +// Union satisfied by [AlertingV3PolicyDeleteResponseUnknown], +// [AlertingV3PolicyDeleteResponseArray] or [shared.UnionString]. +type AlertingV3PolicyDeleteResponse interface { + ImplementsAlertingV3PolicyDeleteResponse() } -// alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseJSON contains -// the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse] -type alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*AlertingV3PolicyDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -func (r *AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +type AlertingV3PolicyDeleteResponseArray []interface{} -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse struct { +func (r AlertingV3PolicyDeleteResponseArray) ImplementsAlertingV3PolicyDeleteResponse() {} + +type AlertingV3PolicyGetResponse struct { // The unique identifier of a notification policy ID string `json:"id"` // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. - AlertType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType `json:"alert_type"` - Created time.Time `json:"created" format:"date-time"` + AlertType AlertingV3PolicyGetResponseAlertType `json:"alert_type"` + Created time.Time `json:"created" format:"date-time"` // Optional description for the Notification policy. Description string `json:"description"` // Whether or not the Notification policy is enabled. @@ -481,20 +462,19 @@ type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse struct // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. - Filters AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters `json:"filters"` + Filters AlertingV3PolicyGetResponseFilters `json:"filters"` // List of IDs that will be used when dispatching a notification. IDs for email // type will be the email address. - Mechanisms map[string][]AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanisms `json:"mechanisms"` - Modified time.Time `json:"modified" format:"date-time"` + Mechanisms map[string][]AlertingV3PolicyGetResponseMechanisms `json:"mechanisms"` + Modified time.Time `json:"modified" format:"date-time"` // Name of the policy. - Name string `json:"name"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseJSON `json:"-"` + Name string `json:"name"` + JSON alertingV3PolicyGetResponseJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseJSON struct { +// alertingV3PolicyGetResponseJSON contains the JSON metadata for the struct +// [AlertingV3PolicyGetResponse] +type alertingV3PolicyGetResponseJSON struct { ID apijson.Field AlertType apijson.Field Created apijson.Field @@ -508,76 +488,76 @@ type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseJSON st ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType string +type AlertingV3PolicyGetResponseAlertType string const ( - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "access_custom_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "advanced_ddos_attack_l4_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "advanced_ddos_attack_l7_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "advanced_http_alert_error" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBGPHijackNotification AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "bgp_hijack_notification" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBillingUsageAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "billing_usage_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "block_notification_block_removed" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "block_notification_new_block" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "block_notification_review_rejected" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBrandProtectionAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "brand_protection_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeBrandProtectionDigest AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "brand_protection_digest" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "clickhouse_alert_fw_anomaly" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "clickhouse_alert_fw_ent_anomaly" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "custom_ssl_certificate_event_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "dedicated_ssl_certificate_event_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeDosAttackL4 AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "dos_attack_l4" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeDosAttackL7 AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "dos_attack_l7" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "expiring_service_token_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "failing_logpush_job_disabled_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "fbm_auto_advertisement" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeFbmDosdAttack AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "fbm_dosd_attack" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "fbm_volumetric_attack" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "health_check_status_notification" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "hostname_aop_custom_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "http_alert_edge_error" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "http_alert_origin_error" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeIncidentAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "incident_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "load_balancing_health_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "load_balancing_pool_enablement_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeLogoMatchAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "logo_match_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "magic_tunnel_health_check_event" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "maintenance_event_notification" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "mtls_certificate_store_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypePagesEventAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "pages_event_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeRadarNotification AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "radar_notification" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeRealOriginMonitoring AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "real_origin_monitoring" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_code_change_detections" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_hosts" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_malicious_hosts" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_malicious_scripts" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_malicious_url" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "scriptmonitor_alert_new_resources" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "secondary_dns_all_primaries_failing" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "secondary_dns_primaries_failing" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "secondary_dns_zone_successfully_updated" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "secondary_dns_zone_validation_warning" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeSentinelAlert AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "sentinel_alert" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeStreamLiveNotifications AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "stream_live_notifications" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeTunnelHealthEvent AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "tunnel_health_event" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "tunnel_update_event" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeUniversalSSLEventType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "universal_ssl_event_type" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "web_analytics_metrics_update" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseAlertType = "zone_aop_custom_certificate_expiration_type" + AlertingV3PolicyGetResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "access_custom_certificate_expiration_type" + AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l4_alert" + AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l7_alert" + AlertingV3PolicyGetResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyGetResponseAlertType = "advanced_http_alert_error" + AlertingV3PolicyGetResponseAlertTypeBGPHijackNotification AlertingV3PolicyGetResponseAlertType = "bgp_hijack_notification" + AlertingV3PolicyGetResponseAlertTypeBillingUsageAlert AlertingV3PolicyGetResponseAlertType = "billing_usage_alert" + AlertingV3PolicyGetResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyGetResponseAlertType = "block_notification_block_removed" + AlertingV3PolicyGetResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyGetResponseAlertType = "block_notification_new_block" + AlertingV3PolicyGetResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyGetResponseAlertType = "block_notification_review_rejected" + AlertingV3PolicyGetResponseAlertTypeBrandProtectionAlert AlertingV3PolicyGetResponseAlertType = "brand_protection_alert" + AlertingV3PolicyGetResponseAlertTypeBrandProtectionDigest AlertingV3PolicyGetResponseAlertType = "brand_protection_digest" + AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_anomaly" + AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_ent_anomaly" + AlertingV3PolicyGetResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "custom_ssl_certificate_event_type" + AlertingV3PolicyGetResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "dedicated_ssl_certificate_event_type" + AlertingV3PolicyGetResponseAlertTypeDosAttackL4 AlertingV3PolicyGetResponseAlertType = "dos_attack_l4" + AlertingV3PolicyGetResponseAlertTypeDosAttackL7 AlertingV3PolicyGetResponseAlertType = "dos_attack_l7" + AlertingV3PolicyGetResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyGetResponseAlertType = "expiring_service_token_alert" + AlertingV3PolicyGetResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyGetResponseAlertType = "failing_logpush_job_disabled_alert" + AlertingV3PolicyGetResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyGetResponseAlertType = "fbm_auto_advertisement" + AlertingV3PolicyGetResponseAlertTypeFbmDosdAttack AlertingV3PolicyGetResponseAlertType = "fbm_dosd_attack" + AlertingV3PolicyGetResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyGetResponseAlertType = "fbm_volumetric_attack" + AlertingV3PolicyGetResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyGetResponseAlertType = "health_check_status_notification" + AlertingV3PolicyGetResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "hostname_aop_custom_certificate_expiration_type" + AlertingV3PolicyGetResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyGetResponseAlertType = "http_alert_edge_error" + AlertingV3PolicyGetResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyGetResponseAlertType = "http_alert_origin_error" + AlertingV3PolicyGetResponseAlertTypeIncidentAlert AlertingV3PolicyGetResponseAlertType = "incident_alert" + AlertingV3PolicyGetResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_health_alert" + AlertingV3PolicyGetResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_pool_enablement_alert" + AlertingV3PolicyGetResponseAlertTypeLogoMatchAlert AlertingV3PolicyGetResponseAlertType = "logo_match_alert" + AlertingV3PolicyGetResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyGetResponseAlertType = "magic_tunnel_health_check_event" + AlertingV3PolicyGetResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyGetResponseAlertType = "maintenance_event_notification" + AlertingV3PolicyGetResponseAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "mtls_certificate_store_certificate_expiration_type" + AlertingV3PolicyGetResponseAlertTypePagesEventAlert AlertingV3PolicyGetResponseAlertType = "pages_event_alert" + AlertingV3PolicyGetResponseAlertTypeRadarNotification AlertingV3PolicyGetResponseAlertType = "radar_notification" + AlertingV3PolicyGetResponseAlertTypeRealOriginMonitoring AlertingV3PolicyGetResponseAlertType = "real_origin_monitoring" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_code_change_detections" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_hosts" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_hosts" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_scripts" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_url" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url" + AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_resources" + AlertingV3PolicyGetResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_all_primaries_failing" + AlertingV3PolicyGetResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_primaries_failing" + AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_successfully_updated" + AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_validation_warning" + AlertingV3PolicyGetResponseAlertTypeSentinelAlert AlertingV3PolicyGetResponseAlertType = "sentinel_alert" + AlertingV3PolicyGetResponseAlertTypeStreamLiveNotifications AlertingV3PolicyGetResponseAlertType = "stream_live_notifications" + AlertingV3PolicyGetResponseAlertTypeTunnelHealthEvent AlertingV3PolicyGetResponseAlertType = "tunnel_health_event" + AlertingV3PolicyGetResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyGetResponseAlertType = "tunnel_update_event" + AlertingV3PolicyGetResponseAlertTypeUniversalSSLEventType AlertingV3PolicyGetResponseAlertType = "universal_ssl_event_type" + AlertingV3PolicyGetResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyGetResponseAlertType = "web_analytics_metrics_update" + AlertingV3PolicyGetResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "zone_aop_custom_certificate_expiration_type" ) // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters struct { +type AlertingV3PolicyGetResponseFilters struct { // Usage depends on specific alert type Actions []string `json:"actions"` // Used for configuring radar_notification @@ -591,7 +571,7 @@ type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters // Usage depends on specific alert type AlertTriggerPreferences []string `json:"alert_trigger_preferences"` // Used for configuring magic_tunnel_health_check_event - AlertTriggerPreferencesValue []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"` + AlertTriggerPreferencesValue []AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"` // Used for configuring load_balancing_pool_enablement_alert Enabled []string `json:"enabled"` // Used for configuring pages_event_alert @@ -607,7 +587,7 @@ type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters // Used for configuring health_check_status_notification HealthCheckID []string `json:"health_check_id"` // Used for configuring incident_alert - IncidentImpact []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact `json:"incident_impact"` + IncidentImpact []AlertingV3PolicyGetResponseFiltersIncidentImpact `json:"incident_impact"` // Used for configuring stream_live_notifications InputID []string `json:"input_id"` // Used for configuring billing_usage_alert @@ -649,7 +629,7 @@ type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters // Used for configuring advanced_ddos_attack_l7_alert TargetZoneName []string `json:"target_zone_name"` // Used for configuring traffic_anomalies_alert - TrafficExclusions []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersTrafficExclusion `json:"traffic_exclusions"` + TrafficExclusions []AlertingV3PolicyGetResponseFiltersTrafficExclusion `json:"traffic_exclusions"` // Used for configuring tunnel_health_event TunnelID []string `json:"tunnel_id"` // Used for configuring magic_tunnel_health_check_event @@ -657,14 +637,13 @@ type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters // Usage depends on specific alert type Where []string `json:"where"` // Usage depends on specific alert type - Zones []string `json:"zones"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersJSON `json:"-"` + Zones []string `json:"zones"` + JSON alertingV3PolicyGetResponseFiltersJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersJSON struct { +// alertingV3PolicyGetResponseFiltersJSON contains the JSON metadata for the struct +// [AlertingV3PolicyGetResponseFilters] +type alertingV3PolicyGetResponseFiltersJSON struct { Actions apijson.Field AffectedAsns apijson.Field AffectedComponents apijson.Field @@ -709,62 +688,61 @@ type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFilters) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyGetResponseFilters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue string +type AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue string const ( - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue = "99.0" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue = "98.0" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersAlertTriggerPreferencesValue = "97.0" + AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "99.0" + AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "98.0" + AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "97.0" ) -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact string +type AlertingV3PolicyGetResponseFiltersIncidentImpact string const ( - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" + AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" + AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" + AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" + AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" ) -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersTrafficExclusion string +type AlertingV3PolicyGetResponseFiltersTrafficExclusion string const ( - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseFiltersTrafficExclusion = "security_events" + AlertingV3PolicyGetResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyGetResponseFiltersTrafficExclusion = "security_events" ) -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanisms struct { +type AlertingV3PolicyGetResponseMechanisms struct { // UUID - ID AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsID `json:"id"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsJSON `json:"-"` + ID AlertingV3PolicyGetResponseMechanismsID `json:"id"` + JSON alertingV3PolicyGetResponseMechanismsJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanisms] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsJSON struct { +// alertingV3PolicyGetResponseMechanismsJSON contains the JSON metadata for the +// struct [AlertingV3PolicyGetResponseMechanisms] +type alertingV3PolicyGetResponseMechanismsJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanisms) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyGetResponseMechanisms) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // UUID // // Union satisfied by [shared.UnionString] or [shared.UnionString]. -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsID interface { - ImplementsAlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsID() +type AlertingV3PolicyGetResponseMechanismsID interface { + ImplementsAlertingV3PolicyGetResponseMechanismsID() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsID)(nil)).Elem(), + reflect.TypeOf((*AlertingV3PolicyGetResponseMechanismsID)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -777,96 +755,130 @@ func init() { ) } -type AlertingV3PolicyUpdateParams struct { +type AlertingV3PolicyReplaceResponse struct { + // UUID + ID string `json:"id"` + JSON alertingV3PolicyReplaceResponseJSON `json:"-"` +} + +// alertingV3PolicyReplaceResponseJSON contains the JSON metadata for the struct +// [AlertingV3PolicyReplaceResponse] +type alertingV3PolicyReplaceResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3PolicyReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3PolicyNewParams struct { // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. - AlertType param.Field[AlertingV3PolicyUpdateParamsAlertType] `json:"alert_type"` + AlertType param.Field[AlertingV3PolicyNewParamsAlertType] `json:"alert_type,required"` + // Whether or not the Notification policy is enabled. + Enabled param.Field[bool] `json:"enabled,required"` + // List of IDs that will be used when dispatching a notification. IDs for email + // type will be the email address. + Mechanisms param.Field[map[string][]AlertingV3PolicyNewParamsMechanisms] `json:"mechanisms,required"` + // Name of the policy. + Name param.Field[string] `json:"name,required"` // Optional description for the Notification policy. Description param.Field[string] `json:"description"` - // Whether or not the Notification policy is enabled. - Enabled param.Field[bool] `json:"enabled"` // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. - Filters param.Field[AlertingV3PolicyUpdateParamsFilters] `json:"filters"` - // List of IDs that will be used when dispatching a notification. IDs for email - // type will be the email address. - Mechanisms param.Field[map[string][]AlertingV3PolicyUpdateParamsMechanisms] `json:"mechanisms"` - // Name of the policy. - Name param.Field[string] `json:"name"` + Filters param.Field[AlertingV3PolicyNewParamsFilters] `json:"filters"` } -func (r AlertingV3PolicyUpdateParams) MarshalJSON() (data []byte, err error) { +func (r AlertingV3PolicyNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. -type AlertingV3PolicyUpdateParamsAlertType string +type AlertingV3PolicyNewParamsAlertType string const ( - AlertingV3PolicyUpdateParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "access_custom_certificate_expiration_type" - AlertingV3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l4_alert" - AlertingV3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l7_alert" - AlertingV3PolicyUpdateParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyUpdateParamsAlertType = "advanced_http_alert_error" - AlertingV3PolicyUpdateParamsAlertTypeBGPHijackNotification AlertingV3PolicyUpdateParamsAlertType = "bgp_hijack_notification" - AlertingV3PolicyUpdateParamsAlertTypeBillingUsageAlert AlertingV3PolicyUpdateParamsAlertType = "billing_usage_alert" - AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyUpdateParamsAlertType = "block_notification_block_removed" - AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyUpdateParamsAlertType = "block_notification_new_block" - AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyUpdateParamsAlertType = "block_notification_review_rejected" - AlertingV3PolicyUpdateParamsAlertTypeBrandProtectionAlert AlertingV3PolicyUpdateParamsAlertType = "brand_protection_alert" - AlertingV3PolicyUpdateParamsAlertTypeBrandProtectionDigest AlertingV3PolicyUpdateParamsAlertType = "brand_protection_digest" - AlertingV3PolicyUpdateParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_anomaly" - AlertingV3PolicyUpdateParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_ent_anomaly" - AlertingV3PolicyUpdateParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyUpdateParamsAlertType = "custom_ssl_certificate_event_type" - AlertingV3PolicyUpdateParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyUpdateParamsAlertType = "dedicated_ssl_certificate_event_type" - AlertingV3PolicyUpdateParamsAlertTypeDosAttackL4 AlertingV3PolicyUpdateParamsAlertType = "dos_attack_l4" - AlertingV3PolicyUpdateParamsAlertTypeDosAttackL7 AlertingV3PolicyUpdateParamsAlertType = "dos_attack_l7" - AlertingV3PolicyUpdateParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyUpdateParamsAlertType = "expiring_service_token_alert" - AlertingV3PolicyUpdateParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyUpdateParamsAlertType = "failing_logpush_job_disabled_alert" - AlertingV3PolicyUpdateParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyUpdateParamsAlertType = "fbm_auto_advertisement" - AlertingV3PolicyUpdateParamsAlertTypeFbmDosdAttack AlertingV3PolicyUpdateParamsAlertType = "fbm_dosd_attack" - AlertingV3PolicyUpdateParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyUpdateParamsAlertType = "fbm_volumetric_attack" - AlertingV3PolicyUpdateParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyUpdateParamsAlertType = "health_check_status_notification" - AlertingV3PolicyUpdateParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "hostname_aop_custom_certificate_expiration_type" - AlertingV3PolicyUpdateParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyUpdateParamsAlertType = "http_alert_edge_error" - AlertingV3PolicyUpdateParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyUpdateParamsAlertType = "http_alert_origin_error" - AlertingV3PolicyUpdateParamsAlertTypeIncidentAlert AlertingV3PolicyUpdateParamsAlertType = "incident_alert" - AlertingV3PolicyUpdateParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyUpdateParamsAlertType = "load_balancing_health_alert" - AlertingV3PolicyUpdateParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyUpdateParamsAlertType = "load_balancing_pool_enablement_alert" - AlertingV3PolicyUpdateParamsAlertTypeLogoMatchAlert AlertingV3PolicyUpdateParamsAlertType = "logo_match_alert" - AlertingV3PolicyUpdateParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyUpdateParamsAlertType = "magic_tunnel_health_check_event" - AlertingV3PolicyUpdateParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyUpdateParamsAlertType = "maintenance_event_notification" - AlertingV3PolicyUpdateParamsAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "mtls_certificate_store_certificate_expiration_type" - AlertingV3PolicyUpdateParamsAlertTypePagesEventAlert AlertingV3PolicyUpdateParamsAlertType = "pages_event_alert" - AlertingV3PolicyUpdateParamsAlertTypeRadarNotification AlertingV3PolicyUpdateParamsAlertType = "radar_notification" - AlertingV3PolicyUpdateParamsAlertTypeRealOriginMonitoring AlertingV3PolicyUpdateParamsAlertType = "real_origin_monitoring" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_code_change_detections" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_hosts" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_hosts" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_scripts" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_url" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url" - AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_resources" - AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_all_primaries_failing" - AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_primaries_failing" - AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_zone_successfully_updated" - AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_zone_validation_warning" - AlertingV3PolicyUpdateParamsAlertTypeSentinelAlert AlertingV3PolicyUpdateParamsAlertType = "sentinel_alert" - AlertingV3PolicyUpdateParamsAlertTypeStreamLiveNotifications AlertingV3PolicyUpdateParamsAlertType = "stream_live_notifications" - AlertingV3PolicyUpdateParamsAlertTypeTunnelHealthEvent AlertingV3PolicyUpdateParamsAlertType = "tunnel_health_event" - AlertingV3PolicyUpdateParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyUpdateParamsAlertType = "tunnel_update_event" - AlertingV3PolicyUpdateParamsAlertTypeUniversalSSLEventType AlertingV3PolicyUpdateParamsAlertType = "universal_ssl_event_type" - AlertingV3PolicyUpdateParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyUpdateParamsAlertType = "web_analytics_metrics_update" - AlertingV3PolicyUpdateParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "zone_aop_custom_certificate_expiration_type" + AlertingV3PolicyNewParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "access_custom_certificate_expiration_type" + AlertingV3PolicyNewParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyNewParamsAlertType = "advanced_ddos_attack_l4_alert" + AlertingV3PolicyNewParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyNewParamsAlertType = "advanced_ddos_attack_l7_alert" + AlertingV3PolicyNewParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyNewParamsAlertType = "advanced_http_alert_error" + AlertingV3PolicyNewParamsAlertTypeBGPHijackNotification AlertingV3PolicyNewParamsAlertType = "bgp_hijack_notification" + AlertingV3PolicyNewParamsAlertTypeBillingUsageAlert AlertingV3PolicyNewParamsAlertType = "billing_usage_alert" + AlertingV3PolicyNewParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyNewParamsAlertType = "block_notification_block_removed" + AlertingV3PolicyNewParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyNewParamsAlertType = "block_notification_new_block" + AlertingV3PolicyNewParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyNewParamsAlertType = "block_notification_review_rejected" + AlertingV3PolicyNewParamsAlertTypeBrandProtectionAlert AlertingV3PolicyNewParamsAlertType = "brand_protection_alert" + AlertingV3PolicyNewParamsAlertTypeBrandProtectionDigest AlertingV3PolicyNewParamsAlertType = "brand_protection_digest" + AlertingV3PolicyNewParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyNewParamsAlertType = "clickhouse_alert_fw_anomaly" + AlertingV3PolicyNewParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyNewParamsAlertType = "clickhouse_alert_fw_ent_anomaly" + AlertingV3PolicyNewParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyNewParamsAlertType = "custom_ssl_certificate_event_type" + AlertingV3PolicyNewParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyNewParamsAlertType = "dedicated_ssl_certificate_event_type" + AlertingV3PolicyNewParamsAlertTypeDosAttackL4 AlertingV3PolicyNewParamsAlertType = "dos_attack_l4" + AlertingV3PolicyNewParamsAlertTypeDosAttackL7 AlertingV3PolicyNewParamsAlertType = "dos_attack_l7" + AlertingV3PolicyNewParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyNewParamsAlertType = "expiring_service_token_alert" + AlertingV3PolicyNewParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyNewParamsAlertType = "failing_logpush_job_disabled_alert" + AlertingV3PolicyNewParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyNewParamsAlertType = "fbm_auto_advertisement" + AlertingV3PolicyNewParamsAlertTypeFbmDosdAttack AlertingV3PolicyNewParamsAlertType = "fbm_dosd_attack" + AlertingV3PolicyNewParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyNewParamsAlertType = "fbm_volumetric_attack" + AlertingV3PolicyNewParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyNewParamsAlertType = "health_check_status_notification" + AlertingV3PolicyNewParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "hostname_aop_custom_certificate_expiration_type" + AlertingV3PolicyNewParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyNewParamsAlertType = "http_alert_edge_error" + AlertingV3PolicyNewParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyNewParamsAlertType = "http_alert_origin_error" + AlertingV3PolicyNewParamsAlertTypeIncidentAlert AlertingV3PolicyNewParamsAlertType = "incident_alert" + AlertingV3PolicyNewParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyNewParamsAlertType = "load_balancing_health_alert" + AlertingV3PolicyNewParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyNewParamsAlertType = "load_balancing_pool_enablement_alert" + AlertingV3PolicyNewParamsAlertTypeLogoMatchAlert AlertingV3PolicyNewParamsAlertType = "logo_match_alert" + AlertingV3PolicyNewParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyNewParamsAlertType = "magic_tunnel_health_check_event" + AlertingV3PolicyNewParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyNewParamsAlertType = "maintenance_event_notification" + AlertingV3PolicyNewParamsAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "mtls_certificate_store_certificate_expiration_type" + AlertingV3PolicyNewParamsAlertTypePagesEventAlert AlertingV3PolicyNewParamsAlertType = "pages_event_alert" + AlertingV3PolicyNewParamsAlertTypeRadarNotification AlertingV3PolicyNewParamsAlertType = "radar_notification" + AlertingV3PolicyNewParamsAlertTypeRealOriginMonitoring AlertingV3PolicyNewParamsAlertType = "real_origin_monitoring" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_code_change_detections" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_hosts" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_hosts" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_scripts" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_url" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url" + AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_resources" + AlertingV3PolicyNewParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyNewParamsAlertType = "secondary_dns_all_primaries_failing" + AlertingV3PolicyNewParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyNewParamsAlertType = "secondary_dns_primaries_failing" + AlertingV3PolicyNewParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyNewParamsAlertType = "secondary_dns_zone_successfully_updated" + AlertingV3PolicyNewParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyNewParamsAlertType = "secondary_dns_zone_validation_warning" + AlertingV3PolicyNewParamsAlertTypeSentinelAlert AlertingV3PolicyNewParamsAlertType = "sentinel_alert" + AlertingV3PolicyNewParamsAlertTypeStreamLiveNotifications AlertingV3PolicyNewParamsAlertType = "stream_live_notifications" + AlertingV3PolicyNewParamsAlertTypeTunnelHealthEvent AlertingV3PolicyNewParamsAlertType = "tunnel_health_event" + AlertingV3PolicyNewParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyNewParamsAlertType = "tunnel_update_event" + AlertingV3PolicyNewParamsAlertTypeUniversalSSLEventType AlertingV3PolicyNewParamsAlertType = "universal_ssl_event_type" + AlertingV3PolicyNewParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyNewParamsAlertType = "web_analytics_metrics_update" + AlertingV3PolicyNewParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "zone_aop_custom_certificate_expiration_type" ) +type AlertingV3PolicyNewParamsMechanisms struct { + // UUID + ID param.Field[AlertingV3PolicyNewParamsMechanismsID] `json:"id"` +} + +func (r AlertingV3PolicyNewParamsMechanisms) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// UUID +// +// Satisfied by [shared.UnionString], [shared.UnionString]. +type AlertingV3PolicyNewParamsMechanismsID interface { + ImplementsAlertingV3PolicyNewParamsMechanismsID() +} + // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. -type AlertingV3PolicyUpdateParamsFilters struct { +type AlertingV3PolicyNewParamsFilters struct { // Usage depends on specific alert type Actions param.Field[[]string] `json:"actions"` // Used for configuring radar_notification @@ -880,7 +892,7 @@ type AlertingV3PolicyUpdateParamsFilters struct { // Usage depends on specific alert type AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"` // Used for configuring magic_tunnel_health_check_event - AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"` + AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"` // Used for configuring load_balancing_pool_enablement_alert Enabled param.Field[[]string] `json:"enabled"` // Used for configuring pages_event_alert @@ -896,7 +908,7 @@ type AlertingV3PolicyUpdateParamsFilters struct { // Used for configuring health_check_status_notification HealthCheckID param.Field[[]string] `json:"health_check_id"` // Used for configuring incident_alert - IncidentImpact param.Field[[]AlertingV3PolicyUpdateParamsFiltersIncidentImpact] `json:"incident_impact"` + IncidentImpact param.Field[[]AlertingV3PolicyNewParamsFiltersIncidentImpact] `json:"incident_impact"` // Used for configuring stream_live_notifications InputID param.Field[[]string] `json:"input_id"` // Used for configuring billing_usage_alert @@ -938,7 +950,7 @@ type AlertingV3PolicyUpdateParamsFilters struct { // Used for configuring advanced_ddos_attack_l7_alert TargetZoneName param.Field[[]string] `json:"target_zone_name"` // Used for configuring traffic_anomalies_alert - TrafficExclusions param.Field[[]AlertingV3PolicyUpdateParamsFiltersTrafficExclusion] `json:"traffic_exclusions"` + TrafficExclusions param.Field[[]AlertingV3PolicyNewParamsFiltersTrafficExclusion] `json:"traffic_exclusions"` // Used for configuring tunnel_health_event TunnelID param.Field[[]string] `json:"tunnel_id"` // Used for configuring magic_tunnel_health_check_event @@ -949,118 +961,200 @@ type AlertingV3PolicyUpdateParamsFilters struct { Zones param.Field[[]string] `json:"zones"` } -func (r AlertingV3PolicyUpdateParamsFilters) MarshalJSON() (data []byte, err error) { +func (r AlertingV3PolicyNewParamsFilters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue string +type AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue string const ( - AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "99.0" - AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "98.0" - AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "97.0" + AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "99.0" + AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "98.0" + AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "97.0" ) -type AlertingV3PolicyUpdateParamsFiltersIncidentImpact string +type AlertingV3PolicyNewParamsFiltersIncidentImpact string const ( - AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" - AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" - AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" - AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" + AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" + AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" + AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" + AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" ) -type AlertingV3PolicyUpdateParamsFiltersTrafficExclusion string +type AlertingV3PolicyNewParamsFiltersTrafficExclusion string const ( - AlertingV3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyUpdateParamsFiltersTrafficExclusion = "security_events" + AlertingV3PolicyNewParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyNewParamsFiltersTrafficExclusion = "security_events" ) -type AlertingV3PolicyUpdateParamsMechanisms struct { - // UUID - ID param.Field[AlertingV3PolicyUpdateParamsMechanismsID] `json:"id"` +type AlertingV3PolicyNewResponseEnvelope struct { + Errors []AlertingV3PolicyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3PolicyNewResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3PolicyNewResponse `json:"result,required"` + // Whether the API call was successful + Success AlertingV3PolicyNewResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3PolicyNewResponseEnvelopeJSON `json:"-"` } -func (r AlertingV3PolicyUpdateParamsMechanisms) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// alertingV3PolicyNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [AlertingV3PolicyNewResponseEnvelope] +type alertingV3PolicyNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// UUID -// -// Satisfied by [shared.UnionString], [shared.UnionString]. -type AlertingV3PolicyUpdateParamsMechanismsID interface { - ImplementsAlertingV3PolicyUpdateParamsMechanismsID() +func (r *AlertingV3PolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type AlertingV3PolicyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// alertingV3PolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [AlertingV3PolicyNewResponseEnvelopeErrors] +type alertingV3PolicyNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3PolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyUpdateResponseEnvelope struct { - Errors []AlertingV3PolicyUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3PolicyUpdateResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3PolicyUpdateResponse `json:"result,required"` +type AlertingV3PolicyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// alertingV3PolicyNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AlertingV3PolicyNewResponseEnvelopeMessages] +type alertingV3PolicyNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3PolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type AlertingV3PolicyNewResponseEnvelopeSuccess bool + +const ( + AlertingV3PolicyNewResponseEnvelopeSuccessTrue AlertingV3PolicyNewResponseEnvelopeSuccess = true +) + +type AlertingV3PolicyListResponseEnvelope struct { + Errors []AlertingV3PolicyListResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3PolicyListResponseEnvelopeMessages `json:"messages,required"` + Result []AlertingV3PolicyListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AlertingV3PolicyUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON alertingV3PolicyUpdateResponseEnvelopeJSON `json:"-"` + Success AlertingV3PolicyListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AlertingV3PolicyListResponseEnvelopeResultInfo `json:"result_info"` + JSON alertingV3PolicyListResponseEnvelopeJSON `json:"-"` } -// alertingV3PolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [AlertingV3PolicyUpdateResponseEnvelope] -type alertingV3PolicyUpdateResponseEnvelopeJSON struct { +// alertingV3PolicyListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AlertingV3PolicyListResponseEnvelope] +type alertingV3PolicyListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyUpdateResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3PolicyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyListResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3PolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [AlertingV3PolicyUpdateResponseEnvelopeErrors] -type alertingV3PolicyUpdateResponseEnvelopeErrorsJSON struct { +// alertingV3PolicyListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AlertingV3PolicyListResponseEnvelopeErrors] +type alertingV3PolicyListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyUpdateResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3PolicyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyListResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3PolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [AlertingV3PolicyUpdateResponseEnvelopeMessages] -type alertingV3PolicyUpdateResponseEnvelopeMessagesJSON struct { +// alertingV3PolicyListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AlertingV3PolicyListResponseEnvelopeMessages] +type alertingV3PolicyListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3PolicyUpdateResponseEnvelopeSuccess bool +type AlertingV3PolicyListResponseEnvelopeSuccess bool const ( - AlertingV3PolicyUpdateResponseEnvelopeSuccessTrue AlertingV3PolicyUpdateResponseEnvelopeSuccess = true + AlertingV3PolicyListResponseEnvelopeSuccessTrue AlertingV3PolicyListResponseEnvelopeSuccess = true ) +type AlertingV3PolicyListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON alertingV3PolicyListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// alertingV3PolicyListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AlertingV3PolicyListResponseEnvelopeResultInfo] +type alertingV3PolicyListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *AlertingV3PolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type AlertingV3PolicyDeleteResponseEnvelope struct { Errors []AlertingV3PolicyDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AlertingV3PolicyDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -1228,112 +1322,96 @@ const ( AlertingV3PolicyGetResponseEnvelopeSuccessTrue AlertingV3PolicyGetResponseEnvelopeSuccess = true ) -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParams struct { +type AlertingV3PolicyReplaceParams struct { // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. - AlertType param.Field[AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType] `json:"alert_type,required"` - // Whether or not the Notification policy is enabled. - Enabled param.Field[bool] `json:"enabled,required"` - // List of IDs that will be used when dispatching a notification. IDs for email - // type will be the email address. - Mechanisms param.Field[map[string][]AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanisms] `json:"mechanisms,required"` - // Name of the policy. - Name param.Field[string] `json:"name,required"` + AlertType param.Field[AlertingV3PolicyReplaceParamsAlertType] `json:"alert_type"` // Optional description for the Notification policy. Description param.Field[string] `json:"description"` + // Whether or not the Notification policy is enabled. + Enabled param.Field[bool] `json:"enabled"` // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. - Filters param.Field[AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters] `json:"filters"` + Filters param.Field[AlertingV3PolicyReplaceParamsFilters] `json:"filters"` + // List of IDs that will be used when dispatching a notification. IDs for email + // type will be the email address. + Mechanisms param.Field[map[string][]AlertingV3PolicyReplaceParamsMechanisms] `json:"mechanisms"` + // Name of the policy. + Name param.Field[string] `json:"name"` } -func (r AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParams) MarshalJSON() (data []byte, err error) { +func (r AlertingV3PolicyReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Refers to which event will trigger a Notification dispatch. You can use the // endpoint to get available alert types which then will give you a list of // possible values. -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType string +type AlertingV3PolicyReplaceParamsAlertType string const ( - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "access_custom_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "advanced_ddos_attack_l4_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "advanced_ddos_attack_l7_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "advanced_http_alert_error" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBGPHijackNotification AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "bgp_hijack_notification" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBillingUsageAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "billing_usage_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "block_notification_block_removed" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "block_notification_new_block" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "block_notification_review_rejected" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBrandProtectionAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "brand_protection_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeBrandProtectionDigest AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "brand_protection_digest" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "clickhouse_alert_fw_anomaly" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "clickhouse_alert_fw_ent_anomaly" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "custom_ssl_certificate_event_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "dedicated_ssl_certificate_event_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeDosAttackL4 AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "dos_attack_l4" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeDosAttackL7 AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "dos_attack_l7" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "expiring_service_token_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "failing_logpush_job_disabled_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "fbm_auto_advertisement" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeFbmDosdAttack AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "fbm_dosd_attack" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "fbm_volumetric_attack" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "health_check_status_notification" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "hostname_aop_custom_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "http_alert_edge_error" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "http_alert_origin_error" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeIncidentAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "incident_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "load_balancing_health_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "load_balancing_pool_enablement_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeLogoMatchAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "logo_match_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "magic_tunnel_health_check_event" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "maintenance_event_notification" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "mtls_certificate_store_certificate_expiration_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypePagesEventAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "pages_event_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeRadarNotification AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "radar_notification" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeRealOriginMonitoring AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "real_origin_monitoring" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_code_change_detections" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_hosts" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_malicious_hosts" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_malicious_scripts" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_malicious_url" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "scriptmonitor_alert_new_resources" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "secondary_dns_all_primaries_failing" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "secondary_dns_primaries_failing" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "secondary_dns_zone_successfully_updated" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "secondary_dns_zone_validation_warning" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeSentinelAlert AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "sentinel_alert" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeStreamLiveNotifications AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "stream_live_notifications" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeTunnelHealthEvent AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "tunnel_health_event" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "tunnel_update_event" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeUniversalSSLEventType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "universal_ssl_event_type" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "web_analytics_metrics_update" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertType = "zone_aop_custom_certificate_expiration_type" + AlertingV3PolicyReplaceParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyReplaceParamsAlertType = "access_custom_certificate_expiration_type" + AlertingV3PolicyReplaceParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyReplaceParamsAlertType = "advanced_ddos_attack_l4_alert" + AlertingV3PolicyReplaceParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyReplaceParamsAlertType = "advanced_ddos_attack_l7_alert" + AlertingV3PolicyReplaceParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyReplaceParamsAlertType = "advanced_http_alert_error" + AlertingV3PolicyReplaceParamsAlertTypeBGPHijackNotification AlertingV3PolicyReplaceParamsAlertType = "bgp_hijack_notification" + AlertingV3PolicyReplaceParamsAlertTypeBillingUsageAlert AlertingV3PolicyReplaceParamsAlertType = "billing_usage_alert" + AlertingV3PolicyReplaceParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyReplaceParamsAlertType = "block_notification_block_removed" + AlertingV3PolicyReplaceParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyReplaceParamsAlertType = "block_notification_new_block" + AlertingV3PolicyReplaceParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyReplaceParamsAlertType = "block_notification_review_rejected" + AlertingV3PolicyReplaceParamsAlertTypeBrandProtectionAlert AlertingV3PolicyReplaceParamsAlertType = "brand_protection_alert" + AlertingV3PolicyReplaceParamsAlertTypeBrandProtectionDigest AlertingV3PolicyReplaceParamsAlertType = "brand_protection_digest" + AlertingV3PolicyReplaceParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyReplaceParamsAlertType = "clickhouse_alert_fw_anomaly" + AlertingV3PolicyReplaceParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyReplaceParamsAlertType = "clickhouse_alert_fw_ent_anomaly" + AlertingV3PolicyReplaceParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyReplaceParamsAlertType = "custom_ssl_certificate_event_type" + AlertingV3PolicyReplaceParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyReplaceParamsAlertType = "dedicated_ssl_certificate_event_type" + AlertingV3PolicyReplaceParamsAlertTypeDosAttackL4 AlertingV3PolicyReplaceParamsAlertType = "dos_attack_l4" + AlertingV3PolicyReplaceParamsAlertTypeDosAttackL7 AlertingV3PolicyReplaceParamsAlertType = "dos_attack_l7" + AlertingV3PolicyReplaceParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyReplaceParamsAlertType = "expiring_service_token_alert" + AlertingV3PolicyReplaceParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyReplaceParamsAlertType = "failing_logpush_job_disabled_alert" + AlertingV3PolicyReplaceParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyReplaceParamsAlertType = "fbm_auto_advertisement" + AlertingV3PolicyReplaceParamsAlertTypeFbmDosdAttack AlertingV3PolicyReplaceParamsAlertType = "fbm_dosd_attack" + AlertingV3PolicyReplaceParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyReplaceParamsAlertType = "fbm_volumetric_attack" + AlertingV3PolicyReplaceParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyReplaceParamsAlertType = "health_check_status_notification" + AlertingV3PolicyReplaceParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyReplaceParamsAlertType = "hostname_aop_custom_certificate_expiration_type" + AlertingV3PolicyReplaceParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyReplaceParamsAlertType = "http_alert_edge_error" + AlertingV3PolicyReplaceParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyReplaceParamsAlertType = "http_alert_origin_error" + AlertingV3PolicyReplaceParamsAlertTypeIncidentAlert AlertingV3PolicyReplaceParamsAlertType = "incident_alert" + AlertingV3PolicyReplaceParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyReplaceParamsAlertType = "load_balancing_health_alert" + AlertingV3PolicyReplaceParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyReplaceParamsAlertType = "load_balancing_pool_enablement_alert" + AlertingV3PolicyReplaceParamsAlertTypeLogoMatchAlert AlertingV3PolicyReplaceParamsAlertType = "logo_match_alert" + AlertingV3PolicyReplaceParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyReplaceParamsAlertType = "magic_tunnel_health_check_event" + AlertingV3PolicyReplaceParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyReplaceParamsAlertType = "maintenance_event_notification" + AlertingV3PolicyReplaceParamsAlertTypeMtlsCertificateStoreCertificateExpirationType AlertingV3PolicyReplaceParamsAlertType = "mtls_certificate_store_certificate_expiration_type" + AlertingV3PolicyReplaceParamsAlertTypePagesEventAlert AlertingV3PolicyReplaceParamsAlertType = "pages_event_alert" + AlertingV3PolicyReplaceParamsAlertTypeRadarNotification AlertingV3PolicyReplaceParamsAlertType = "radar_notification" + AlertingV3PolicyReplaceParamsAlertTypeRealOriginMonitoring AlertingV3PolicyReplaceParamsAlertType = "real_origin_monitoring" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_code_change_detections" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_hosts" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_malicious_hosts" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_malicious_scripts" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_malicious_url" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url" + AlertingV3PolicyReplaceParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyReplaceParamsAlertType = "scriptmonitor_alert_new_resources" + AlertingV3PolicyReplaceParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyReplaceParamsAlertType = "secondary_dns_all_primaries_failing" + AlertingV3PolicyReplaceParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyReplaceParamsAlertType = "secondary_dns_primaries_failing" + AlertingV3PolicyReplaceParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyReplaceParamsAlertType = "secondary_dns_zone_successfully_updated" + AlertingV3PolicyReplaceParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyReplaceParamsAlertType = "secondary_dns_zone_validation_warning" + AlertingV3PolicyReplaceParamsAlertTypeSentinelAlert AlertingV3PolicyReplaceParamsAlertType = "sentinel_alert" + AlertingV3PolicyReplaceParamsAlertTypeStreamLiveNotifications AlertingV3PolicyReplaceParamsAlertType = "stream_live_notifications" + AlertingV3PolicyReplaceParamsAlertTypeTunnelHealthEvent AlertingV3PolicyReplaceParamsAlertType = "tunnel_health_event" + AlertingV3PolicyReplaceParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyReplaceParamsAlertType = "tunnel_update_event" + AlertingV3PolicyReplaceParamsAlertTypeUniversalSSLEventType AlertingV3PolicyReplaceParamsAlertType = "universal_ssl_event_type" + AlertingV3PolicyReplaceParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyReplaceParamsAlertType = "web_analytics_metrics_update" + AlertingV3PolicyReplaceParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyReplaceParamsAlertType = "zone_aop_custom_certificate_expiration_type" ) -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanisms struct { - // UUID - ID param.Field[AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID] `json:"id"` -} - -func (r AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanisms) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// UUID -// -// Satisfied by [shared.UnionString], [shared.UnionString]. -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID interface { - ImplementsAlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID() -} - // Optional filters that allow you to be alerted only on a subset of events for // that alert type based on some criteria. This is only available for select alert // types. See alert type documentation for more details. -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters struct { +type AlertingV3PolicyReplaceParamsFilters struct { // Usage depends on specific alert type Actions param.Field[[]string] `json:"actions"` // Used for configuring radar_notification @@ -1347,7 +1425,7 @@ type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters str // Usage depends on specific alert type AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"` // Used for configuring magic_tunnel_health_check_event - AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"` + AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"` // Used for configuring load_balancing_pool_enablement_alert Enabled param.Field[[]string] `json:"enabled"` // Used for configuring pages_event_alert @@ -1363,7 +1441,7 @@ type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters str // Used for configuring health_check_status_notification HealthCheckID param.Field[[]string] `json:"health_check_id"` // Used for configuring incident_alert - IncidentImpact param.Field[[]AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact] `json:"incident_impact"` + IncidentImpact param.Field[[]AlertingV3PolicyReplaceParamsFiltersIncidentImpact] `json:"incident_impact"` // Used for configuring stream_live_notifications InputID param.Field[[]string] `json:"input_id"` // Used for configuring billing_usage_alert @@ -1405,7 +1483,7 @@ type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters str // Used for configuring advanced_ddos_attack_l7_alert TargetZoneName param.Field[[]string] `json:"target_zone_name"` // Used for configuring traffic_anomalies_alert - TrafficExclusions param.Field[[]AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusion] `json:"traffic_exclusions"` + TrafficExclusions param.Field[[]AlertingV3PolicyReplaceParamsFiltersTrafficExclusion] `json:"traffic_exclusions"` // Used for configuring tunnel_health_event TunnelID param.Field[[]string] `json:"tunnel_id"` // Used for configuring magic_tunnel_health_check_event @@ -1416,203 +1494,114 @@ type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters str Zones param.Field[[]string] `json:"zones"` } -func (r AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters) MarshalJSON() (data []byte, err error) { +func (r AlertingV3PolicyReplaceParamsFilters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue string +type AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue string const ( - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue = "99.0" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue = "98.0" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue = "97.0" + AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue = "99.0" + AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue = "98.0" + AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue = "97.0" ) -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact string +type AlertingV3PolicyReplaceParamsFiltersIncidentImpact string const ( - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" + AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyReplaceParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE" + AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyReplaceParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR" + AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyReplaceParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR" + AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyReplaceParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL" ) -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusion string +type AlertingV3PolicyReplaceParamsFiltersTrafficExclusion string const ( - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusion = "security_events" + AlertingV3PolicyReplaceParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyReplaceParamsFiltersTrafficExclusion = "security_events" ) -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelope struct { - Errors []AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessages `json:"messages,required"` - Result AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse `json:"result,required"` - // Whether the API call was successful - Success AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeSuccess `json:"success,required"` - JSON alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeJSON `json:"-"` -} - -// alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelope] -type alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrors] -type alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3PolicyReplaceParamsMechanisms struct { + // UUID + ID param.Field[AlertingV3PolicyReplaceParamsMechanismsID] `json:"id"` } -// alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessages] -type alertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r AlertingV3PolicyReplaceParamsMechanisms) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// UUID +// +// Satisfied by [shared.UnionString], [shared.UnionString]. +type AlertingV3PolicyReplaceParamsMechanismsID interface { + ImplementsAlertingV3PolicyReplaceParamsMechanismsID() } -// Whether the API call was successful -type AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeSuccess bool - -const ( - AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeSuccessTrue AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponseEnvelopeSuccess = true -) - -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelope struct { - Errors []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrors `json:"errors,required"` - Messages []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessages `json:"messages,required"` - Result []AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse `json:"result,required,nullable"` +type AlertingV3PolicyReplaceResponseEnvelope struct { + Errors []AlertingV3PolicyReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []AlertingV3PolicyReplaceResponseEnvelopeMessages `json:"messages,required"` + Result AlertingV3PolicyReplaceResponse `json:"result,required"` // Whether the API call was successful - Success AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfo `json:"result_info"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeJSON `json:"-"` + Success AlertingV3PolicyReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON alertingV3PolicyReplaceResponseEnvelopeJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelope] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeJSON struct { +// alertingV3PolicyReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [AlertingV3PolicyReplaceResponseEnvelope] +type alertingV3PolicyReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrorsJSON `json:"-"` +type AlertingV3PolicyReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrors] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrorsJSON struct { +// alertingV3PolicyReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AlertingV3PolicyReplaceResponseEnvelopeErrors] +type alertingV3PolicyReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessagesJSON `json:"-"` +type AlertingV3PolicyReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON alertingV3PolicyReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessages] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessagesJSON struct { +// alertingV3PolicyReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [AlertingV3PolicyReplaceResponseEnvelopeMessages] +type alertingV3PolicyReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AlertingV3PolicyReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeSuccess bool +type AlertingV3PolicyReplaceResponseEnvelopeSuccess bool const ( - AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeSuccessTrue AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeSuccess = true + AlertingV3PolicyReplaceResponseEnvelopeSuccessTrue AlertingV3PolicyReplaceResponseEnvelopeSuccess = true ) - -type AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfo] -type alertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/alertingv3policy_test.go b/alertingv3policy_test.go index 45da212189f..7cf22751d42 100644 --- a/alertingv3policy_test.go +++ b/alertingv3policy_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3PolicyUpdateWithOptionalParams(t *testing.T) { +func TestAlertingV3PolicyNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,22 +30,33 @@ func TestAlertingV3PolicyUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Policies.Update( + _, err := client.Alerting.V3.Policies.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "0da2b59e-f118-439d-8097-bdfb215203c9", - cloudflare.AlertingV3PolicyUpdateParams{ - AlertType: cloudflare.F(cloudflare.AlertingV3PolicyUpdateParamsAlertTypeUniversalSSLEventType), + cloudflare.AlertingV3PolicyNewParams{ + AlertType: cloudflare.F(cloudflare.AlertingV3PolicyNewParamsAlertTypeUniversalSSLEventType), + Enabled: cloudflare.F(true), + Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyNewParamsMechanisms{ + "email": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("test@example.com")), + }}, + "pagerduty": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")), + }}, + "webhooks": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")), + }}, + }), + Name: cloudflare.F("SSL Notification Event Policy"), Description: cloudflare.F("Something describing the policy."), - Enabled: cloudflare.F(true), - Filters: cloudflare.F(cloudflare.AlertingV3PolicyUpdateParamsFilters{ + Filters: cloudflare.F(cloudflare.AlertingV3PolicyNewParamsFilters{ Actions: cloudflare.F([]string{"string", "string", "string"}), AffectedAsns: cloudflare.F([]string{"string", "string", "string"}), AffectedComponents: cloudflare.F([]string{"string", "string", "string"}), AffectedLocations: cloudflare.F([]string{"string", "string", "string"}), AirportCode: cloudflare.F([]string{"string", "string", "string"}), AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}), - AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0}), + AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0}), Enabled: cloudflare.F([]string{"string", "string", "string"}), Environment: cloudflare.F([]string{"string", "string", "string"}), Event: cloudflare.F([]string{"string", "string", "string"}), @@ -53,7 +64,7 @@ func TestAlertingV3PolicyUpdateWithOptionalParams(t *testing.T) { EventType: cloudflare.F([]string{"string", "string", "string"}), GroupBy: cloudflare.F([]string{"string", "string", "string"}), HealthCheckID: cloudflare.F([]string{"string", "string", "string"}), - IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor}), + IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor}), InputID: cloudflare.F([]string{"string", "string", "string"}), Limit: cloudflare.F([]string{"string", "string", "string"}), LogoTag: cloudflare.F([]string{"string", "string", "string"}), @@ -74,24 +85,12 @@ func TestAlertingV3PolicyUpdateWithOptionalParams(t *testing.T) { TargetHostname: cloudflare.F([]string{"string", "string", "string"}), TargetIP: cloudflare.F([]string{"string", "string", "string"}), TargetZoneName: cloudflare.F([]string{"string", "string", "string"}), - TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents}), + TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyNewParamsFiltersTrafficExclusionSecurityEvents}), TunnelID: cloudflare.F([]string{"string", "string", "string"}), TunnelName: cloudflare.F([]string{"string", "string", "string"}), Where: cloudflare.F([]string{"string", "string", "string"}), Zones: cloudflare.F([]string{"string", "string", "string"}), }), - Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyUpdateParamsMechanisms{ - "email": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("test@example.com")), - }}, - "pagerduty": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")), - }}, - "webhooks": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")), - }}, - }), - Name: cloudflare.F("SSL Notification Event Policy"), }, ) if err != nil { @@ -103,6 +102,32 @@ func TestAlertingV3PolicyUpdateWithOptionalParams(t *testing.T) { } } +func TestAlertingV3PolicyList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Alerting.V3.Policies.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestAlertingV3PolicyDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -119,7 +144,7 @@ func TestAlertingV3PolicyDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Policies.Delete( + _, err := client.Alerting.V3.Policies.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0da2b59e-f118-439d-8097-bdfb215203c9", @@ -149,7 +174,7 @@ func TestAlertingV3PolicyGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Policies.Get( + _, err := client.Alerting.V3.Policies.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0da2b59e-f118-439d-8097-bdfb215203c9", @@ -163,7 +188,7 @@ func TestAlertingV3PolicyGet(t *testing.T) { } } -func TestAlertingV3PolicyNotificationPoliciesNewANotificationPolicyWithOptionalParams(t *testing.T) { +func TestAlertingV3PolicyReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -179,33 +204,22 @@ func TestAlertingV3PolicyNotificationPoliciesNewANotificationPolicyWithOptionalP option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3s.Policies.NotificationPoliciesNewANotificationPolicy( + _, err := client.Alerting.V3.Policies.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParams{ - AlertType: cloudflare.F(cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsAlertTypeUniversalSSLEventType), - Enabled: cloudflare.F(true), - Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanisms{ - "email": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID](shared.UnionString("test@example.com")), - }}, - "pagerduty": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")), - }}, - "webhooks": {{ - ID: cloudflare.F[cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")), - }}, - }), - Name: cloudflare.F("SSL Notification Event Policy"), + "0da2b59e-f118-439d-8097-bdfb215203c9", + cloudflare.AlertingV3PolicyReplaceParams{ + AlertType: cloudflare.F(cloudflare.AlertingV3PolicyReplaceParamsAlertTypeUniversalSSLEventType), Description: cloudflare.F("Something describing the policy."), - Filters: cloudflare.F(cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFilters{ + Enabled: cloudflare.F(true), + Filters: cloudflare.F(cloudflare.AlertingV3PolicyReplaceParamsFilters{ Actions: cloudflare.F([]string{"string", "string", "string"}), AffectedAsns: cloudflare.F([]string{"string", "string", "string"}), AffectedComponents: cloudflare.F([]string{"string", "string", "string"}), AffectedLocations: cloudflare.F([]string{"string", "string", "string"}), AirportCode: cloudflare.F([]string{"string", "string", "string"}), AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}), - AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersAlertTriggerPreferencesValue97_0}), + AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyReplaceParamsFiltersAlertTriggerPreferencesValue97_0}), Enabled: cloudflare.F([]string{"string", "string", "string"}), Environment: cloudflare.F([]string{"string", "string", "string"}), Event: cloudflare.F([]string{"string", "string", "string"}), @@ -213,7 +227,7 @@ func TestAlertingV3PolicyNotificationPoliciesNewANotificationPolicyWithOptionalP EventType: cloudflare.F([]string{"string", "string", "string"}), GroupBy: cloudflare.F([]string{"string", "string", "string"}), HealthCheckID: cloudflare.F([]string{"string", "string", "string"}), - IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersIncidentImpactIncidentImpactMajor}), + IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyReplaceParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyReplaceParamsFiltersIncidentImpactIncidentImpactMajor}), InputID: cloudflare.F([]string{"string", "string", "string"}), Limit: cloudflare.F([]string{"string", "string", "string"}), LogoTag: cloudflare.F([]string{"string", "string", "string"}), @@ -234,12 +248,24 @@ func TestAlertingV3PolicyNotificationPoliciesNewANotificationPolicyWithOptionalP TargetHostname: cloudflare.F([]string{"string", "string", "string"}), TargetIP: cloudflare.F([]string{"string", "string", "string"}), TargetZoneName: cloudflare.F([]string{"string", "string", "string"}), - TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsFiltersTrafficExclusionSecurityEvents}), + TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyReplaceParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyReplaceParamsFiltersTrafficExclusionSecurityEvents}), TunnelID: cloudflare.F([]string{"string", "string", "string"}), TunnelName: cloudflare.F([]string{"string", "string", "string"}), Where: cloudflare.F([]string{"string", "string", "string"}), Zones: cloudflare.F([]string{"string", "string", "string"}), }), + Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyReplaceParamsMechanisms{ + "email": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyReplaceParamsMechanismsID](shared.UnionString("test@example.com")), + }}, + "pagerduty": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyReplaceParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")), + }}, + "webhooks": {{ + ID: cloudflare.F[cloudflare.AlertingV3PolicyReplaceParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")), + }}, + }), + Name: cloudflare.F("SSL Notification Event Policy"), }, ) if err != nil { @@ -250,29 +276,3 @@ func TestAlertingV3PolicyNotificationPoliciesNewANotificationPolicyWithOptionalP t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestAlertingV3PolicyNotificationPoliciesListNotificationPolicies(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Alerting.V3s.Policies.NotificationPoliciesListNotificationPolicies(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/analytics.go b/analytics.go deleted file mode 100644 index 6f1049714d0..00000000000 --- a/analytics.go +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// AnalyticsService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewAnalyticsService] method instead. -type AnalyticsService struct { - Options []option.RequestOption - Colo *AnalyticsColoService - Dashboards *AnalyticsDashboardService - Latencies *AnalyticsLatencyService -} - -// NewAnalyticsService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAnalyticsService(opts ...option.RequestOption) (r *AnalyticsService) { - r = &AnalyticsService{} - r.Options = opts - r.Colo = NewAnalyticsColoService(opts...) - r.Dashboards = NewAnalyticsDashboardService(opts...) - r.Latencies = NewAnalyticsLatencyService(opts...) - return -} diff --git a/analyticscolo.go b/analyticscolo.go deleted file mode 100644 index 5e5044b68fa..00000000000 --- a/analyticscolo.go +++ /dev/null @@ -1,719 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "reflect" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "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" -) - -// AnalyticsColoService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAnalyticsColoService] method -// instead. -type AnalyticsColoService struct { - Options []option.RequestOption -} - -// NewAnalyticsColoService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewAnalyticsColoService(opts ...option.RequestOption) (r *AnalyticsColoService) { - r = &AnalyticsColoService{} - r.Options = opts - return -} - -// This view provides a breakdown of analytics data by datacenter. Note: This is -// available to Enterprise customers only. -func (r *AnalyticsColoService) ZoneAnalyticsDeprecatedGetAnalyticsByCoLocations(ctx context.Context, zoneIdentifier string, query AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams, opts ...option.RequestOption) (res *[]AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse, err error) { - opts = append(r.Options[:], opts...) - var env AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelope - path := fmt.Sprintf("zones/%s/analytics/colos", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse struct { - // The airport code identifer for the co-location. - ColoID string `json:"colo_id"` - // Time deltas containing metadata about each bucket of time. The number of buckets - // (resolution) is determined by the amount of time between the since and until - // parameters. - Timeseries []AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimesery `json:"timeseries"` - // Breakdown of totals by data type. - Totals AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotals `json:"totals"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseJSON struct { - ColoID apijson.Field - Timeseries apijson.Field - Totals apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimesery struct { - // Breakdown of totals for bandwidth in the form of bytes. - Bandwidth AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidth `json:"bandwidth"` - // Breakdown of totals for requests. - Requests AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequests `json:"requests"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince `json:"since"` - // Breakdown of totals for threats. - Threats AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreats `json:"threats"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil `json:"until"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseryJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseryJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimesery] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseryJSON struct { - Bandwidth apijson.Field - Requests apijson.Field - Since apijson.Field - Threats apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimesery) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for bandwidth in the form of bytes. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidth struct { - // The total number of bytes served within the time frame. - All int64 `json:"all"` - // The number of bytes that were cached (and served) by Cloudflare. - Cached int64 `json:"cached"` - // The number of bytes that were fetched and served from the origin server. - Uncached int64 `json:"uncached"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidthJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidthJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidth] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidthJSON struct { - All apijson.Field - Cached apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesBandwidth) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for requests. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequests struct { - // Total number of requests served. - All int64 `json:"all"` - // Total number of cached requests served. - Cached int64 `json:"cached"` - // Key/value pairs where the key is a two-digit country code and the value is the - // number of requests served to that country. - Country map[string]interface{} `json:"country"` - // A variable list of key/value pairs where the key is a HTTP status code and the - // value is the number of requests with that code served. - HTTPStatus interface{} `json:"http_status"` - // Total number of requests served from the origin. - Uncached int64 `json:"uncached"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequestsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequestsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequests] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequestsJSON struct { - All apijson.Field - Cached apijson.Field - Country apijson.Field - HTTPStatus apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesRequests) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals for threats. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreats struct { - // The total number of identifiable threats received over the time frame. - All int64 `json:"all"` - // A list of key/value pairs where the key is a two-digit country code and the - // value is the number of malicious requests received from that country. - Country interface{} `json:"country"` - // The list of key/value pairs where the key is a threat category and the value is - // the number of requests. - Type interface{} `json:"type"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreatsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreatsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreats] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreatsJSON struct { - All apijson.Field - Country apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesThreats) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals by data type. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotals struct { - // Breakdown of totals for bandwidth in the form of bytes. - Bandwidth AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidth `json:"bandwidth"` - // Breakdown of totals for requests. - Requests AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequests `json:"requests"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince `json:"since"` - // Breakdown of totals for threats. - Threats AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreats `json:"threats"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil `json:"until"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotals] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsJSON struct { - Bandwidth apijson.Field - Requests apijson.Field - Since apijson.Field - Threats apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotals) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for bandwidth in the form of bytes. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidth struct { - // The total number of bytes served within the time frame. - All int64 `json:"all"` - // The number of bytes that were cached (and served) by Cloudflare. - Cached int64 `json:"cached"` - // The number of bytes that were fetched and served from the origin server. - Uncached int64 `json:"uncached"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidthJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidthJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidth] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidthJSON struct { - All apijson.Field - Cached apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsBandwidth) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for requests. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequests struct { - // Total number of requests served. - All int64 `json:"all"` - // Total number of cached requests served. - Cached int64 `json:"cached"` - // Key/value pairs where the key is a two-digit country code and the value is the - // number of requests served to that country. - Country map[string]interface{} `json:"country"` - // A variable list of key/value pairs where the key is a HTTP status code and the - // value is the number of requests with that code served. - HTTPStatus interface{} `json:"http_status"` - // Total number of requests served from the origin. - Uncached int64 `json:"uncached"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequestsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequestsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequests] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequestsJSON struct { - All apijson.Field - Cached apijson.Field - Country apijson.Field - HTTPStatus apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsRequests) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals for threats. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreats struct { - // The total number of identifiable threats received over the time frame. - All int64 `json:"all"` - // A list of key/value pairs where the key is a two-digit country code and the - // value is the number of malicious requests received from that country. - Country interface{} `json:"country"` - // The list of key/value pairs where the key is a threat category and the value is - // the number of requests. - Type interface{} `json:"type"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreatsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreatsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreats] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreatsJSON struct { - All apijson.Field - Country apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsThreats) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams struct { - // When set to true, the API will move the requested time window backward, until it - // finds a region with completely aggregated data. - // - // The API response _may not represent the requested time window_. - Continuous param.Field[bool] `query:"continuous"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since param.Field[AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince] `query:"since"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until param.Field[AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil] `query:"until"` -} - -// URLQuery serializes -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams]'s query -// parameters as `url.Values`. -func (r AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Satisfied by [shared.UnionString], [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince() -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Satisfied by [shared.UnionString], [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil() -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelope struct { - Errors []AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrors `json:"errors,required"` - Messages []AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessages `json:"messages,required"` - // A breakdown of all dashboard analytics data by co-locations. This is limited to - // Enterprise zones only. - Result []AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse `json:"result,required"` - // Whether the API call was successful - Success AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeSuccess `json:"success,required"` - // The exact parameters/timestamps the analytics service used to return data. - Query AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuery `json:"query"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelope] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - Query apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrorsJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrors] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessagesJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessages] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeSuccess bool - -const ( - AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeSuccessTrue AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeSuccess = true -) - -// The exact parameters/timestamps the analytics service used to return data. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuery struct { - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince `json:"since"` - // The amount of time (in minutes) that each data point in the timeseries - // represents. The granularity of the time-series returned (e.g. each bucket in the - // time series representing 1-minute vs 1-day) is calculated by the API based on - // the time-range provided to the API. - TimeDelta int64 `json:"time_delta"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil `json:"until"` - JSON analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryJSON `json:"-"` -} - -// analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryJSON -// contains the JSON metadata for the struct -// [AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuery] -type analyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryJSON struct { - Since apijson.Field - TimeDelta apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuery) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil interface { - ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} diff --git a/analyticscolo_test.go b/analyticscolo_test.go deleted file mode 100644 index c1ca455132f..00000000000 --- a/analyticscolo_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/shared" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Analytics.Colo.ZoneAnalyticsDeprecatedGetAnalyticsByCoLocations( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams{ - Continuous: cloudflare.F(true), - Since: cloudflare.F[cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince](shared.UnionString("2015-01-01T12:23:00Z")), - Until: cloudflare.F[cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil](shared.UnionString("2015-01-02T12:23:00Z")), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/analyticsdashboard.go b/analyticsdashboard.go deleted file mode 100644 index c2ee2fd5478..00000000000 --- a/analyticsdashboard.go +++ /dev/null @@ -1,1080 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "reflect" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "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" -) - -// AnalyticsDashboardService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAnalyticsDashboardService] method -// instead. -type AnalyticsDashboardService struct { - Options []option.RequestOption -} - -// NewAnalyticsDashboardService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewAnalyticsDashboardService(opts ...option.RequestOption) (r *AnalyticsDashboardService) { - r = &AnalyticsDashboardService{} - r.Options = opts - return -} - -// The dashboard view provides both totals and timeseries data for the given zone -// and time period across the entire Cloudflare network. -func (r *AnalyticsDashboardService) ZoneAnalyticsDeprecatedGetDashboard(ctx context.Context, zoneIdentifier string, query AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams, opts ...option.RequestOption) (res *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse, err error) { - opts = append(r.Options[:], opts...) - var env AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelope - path := fmt.Sprintf("zones/%s/analytics/dashboard", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Totals and timeseries data. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse struct { - // Time deltas containing metadata about each bucket of time. The number of buckets - // (resolution) is determined by the amount of time between the since and until - // parameters. - Timeseries []AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimesery `json:"timeseries"` - // Breakdown of totals by data type. - Totals AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotals `json:"totals"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseJSON contains the -// JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseJSON struct { - Timeseries apijson.Field - Totals apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimesery struct { - // Breakdown of totals for bandwidth in the form of bytes. - Bandwidth AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidth `json:"bandwidth"` - // Breakdown of totals for pageviews. - Pageviews AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviews `json:"pageviews"` - // Breakdown of totals for requests. - Requests AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequests `json:"requests"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince `json:"since"` - // Breakdown of totals for threats. - Threats AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreats `json:"threats"` - Uniques AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniques `json:"uniques"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil `json:"until"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseryJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseryJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimesery] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseryJSON struct { - Bandwidth apijson.Field - Pageviews apijson.Field - Requests apijson.Field - Since apijson.Field - Threats apijson.Field - Uniques apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimesery) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for bandwidth in the form of bytes. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidth struct { - // The total number of bytes served within the time frame. - All int64 `json:"all"` - // The number of bytes that were cached (and served) by Cloudflare. - Cached int64 `json:"cached"` - // A variable list of key/value pairs where the key represents the type of content - // served, and the value is the number in bytes served. - ContentType interface{} `json:"content_type"` - // A variable list of key/value pairs where the key is a two-digit country code and - // the value is the number of bytes served to that country. - Country interface{} `json:"country"` - // A break down of bytes served over HTTPS. - SSL AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSL `json:"ssl"` - // A breakdown of requests by their SSL protocol. - SSLProtocols AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocols `json:"ssl_protocols"` - // The number of bytes that were fetched and served from the origin server. - Uncached int64 `json:"uncached"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidth] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthJSON struct { - All apijson.Field - Cached apijson.Field - ContentType apijson.Field - Country apijson.Field - SSL apijson.Field - SSLProtocols apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidth) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A break down of bytes served over HTTPS. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSL struct { - // The number of bytes served over HTTPS. - Encrypted int64 `json:"encrypted"` - // The number of bytes served over HTTP. - Unencrypted int64 `json:"unencrypted"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSL] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLJSON struct { - Encrypted apijson.Field - Unencrypted apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSL) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A breakdown of requests by their SSL protocol. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocols struct { - // The number of requests served over HTTP. - None int64 `json:"none"` - // The number of requests served over TLS v1.0. - TlSv1 int64 `json:"TLSv1"` - // The number of requests served over TLS v1.1. - TlSv1_1 int64 `json:"TLSv1.1"` - // The number of requests served over TLS v1.2. - TlSv1_2 int64 `json:"TLSv1.2"` - // The number of requests served over TLS v1.3. - TlSv1_3 int64 `json:"TLSv1.3"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocolsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocolsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocols] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocolsJSON struct { - None apijson.Field - TlSv1 apijson.Field - TlSv1_1 apijson.Field - TlSv1_2 apijson.Field - TlSv1_3 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesBandwidthSSLProtocols) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for pageviews. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviews struct { - // The total number of pageviews served within the time range. - All int64 `json:"all"` - // A variable list of key/value pairs representing the search engine and number of - // hits. - SearchEngine interface{} `json:"search_engine"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviewsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviewsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviews] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviewsJSON struct { - All apijson.Field - SearchEngine apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesPageviews) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for requests. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequests struct { - // Total number of requests served. - All int64 `json:"all"` - // Total number of cached requests served. - Cached int64 `json:"cached"` - // A variable list of key/value pairs where the key represents the type of content - // served, and the value is the number of requests. - ContentType interface{} `json:"content_type"` - // A variable list of key/value pairs where the key is a two-digit country code and - // the value is the number of requests served to that country. - Country interface{} `json:"country"` - // Key/value pairs where the key is a HTTP status code and the value is the number - // of requests served with that code. - HTTPStatus map[string]interface{} `json:"http_status"` - // A break down of requests served over HTTPS. - SSL AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSL `json:"ssl"` - // A breakdown of requests by their SSL protocol. - SSLProtocols AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocols `json:"ssl_protocols"` - // Total number of requests served from the origin. - Uncached int64 `json:"uncached"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequests] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsJSON struct { - All apijson.Field - Cached apijson.Field - ContentType apijson.Field - Country apijson.Field - HTTPStatus apijson.Field - SSL apijson.Field - SSLProtocols apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequests) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A break down of requests served over HTTPS. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSL struct { - // The number of requests served over HTTPS. - Encrypted int64 `json:"encrypted"` - // The number of requests served over HTTP. - Unencrypted int64 `json:"unencrypted"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSL] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLJSON struct { - Encrypted apijson.Field - Unencrypted apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSL) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A breakdown of requests by their SSL protocol. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocols struct { - // The number of requests served over HTTP. - None int64 `json:"none"` - // The number of requests served over TLS v1.0. - TlSv1 int64 `json:"TLSv1"` - // The number of requests served over TLS v1.1. - TlSv1_1 int64 `json:"TLSv1.1"` - // The number of requests served over TLS v1.2. - TlSv1_2 int64 `json:"TLSv1.2"` - // The number of requests served over TLS v1.3. - TlSv1_3 int64 `json:"TLSv1.3"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocolsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocolsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocols] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocolsJSON struct { - None apijson.Field - TlSv1 apijson.Field - TlSv1_1 apijson.Field - TlSv1_2 apijson.Field - TlSv1_3 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesRequestsSSLProtocols) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals for threats. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreats struct { - // The total number of identifiable threats received over the time frame. - All int64 `json:"all"` - // A list of key/value pairs where the key is a two-digit country code and the - // value is the number of malicious requests received from that country. - Country interface{} `json:"country"` - // The list of key/value pairs where the key is a threat category and the value is - // the number of requests. - Type interface{} `json:"type"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreatsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreatsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreats] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreatsJSON struct { - All apijson.Field - Country apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesThreats) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniques struct { - // Total number of unique IP addresses within the time range. - All int64 `json:"all"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniquesJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniquesJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniques] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniquesJSON struct { - All apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUniques) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals by data type. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotals struct { - // Breakdown of totals for bandwidth in the form of bytes. - Bandwidth AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidth `json:"bandwidth"` - // Breakdown of totals for pageviews. - Pageviews AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviews `json:"pageviews"` - // Breakdown of totals for requests. - Requests AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequests `json:"requests"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince `json:"since"` - // Breakdown of totals for threats. - Threats AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreats `json:"threats"` - Uniques AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniques `json:"uniques"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil `json:"until"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsJSON contains -// the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotals] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsJSON struct { - Bandwidth apijson.Field - Pageviews apijson.Field - Requests apijson.Field - Since apijson.Field - Threats apijson.Field - Uniques apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotals) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for bandwidth in the form of bytes. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidth struct { - // The total number of bytes served within the time frame. - All int64 `json:"all"` - // The number of bytes that were cached (and served) by Cloudflare. - Cached int64 `json:"cached"` - // A variable list of key/value pairs where the key represents the type of content - // served, and the value is the number in bytes served. - ContentType interface{} `json:"content_type"` - // A variable list of key/value pairs where the key is a two-digit country code and - // the value is the number of bytes served to that country. - Country interface{} `json:"country"` - // A break down of bytes served over HTTPS. - SSL AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSL `json:"ssl"` - // A breakdown of requests by their SSL protocol. - SSLProtocols AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocols `json:"ssl_protocols"` - // The number of bytes that were fetched and served from the origin server. - Uncached int64 `json:"uncached"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidth] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthJSON struct { - All apijson.Field - Cached apijson.Field - ContentType apijson.Field - Country apijson.Field - SSL apijson.Field - SSLProtocols apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidth) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A break down of bytes served over HTTPS. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSL struct { - // The number of bytes served over HTTPS. - Encrypted int64 `json:"encrypted"` - // The number of bytes served over HTTP. - Unencrypted int64 `json:"unencrypted"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSL] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLJSON struct { - Encrypted apijson.Field - Unencrypted apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSL) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A breakdown of requests by their SSL protocol. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocols struct { - // The number of requests served over HTTP. - None int64 `json:"none"` - // The number of requests served over TLS v1.0. - TlSv1 int64 `json:"TLSv1"` - // The number of requests served over TLS v1.1. - TlSv1_1 int64 `json:"TLSv1.1"` - // The number of requests served over TLS v1.2. - TlSv1_2 int64 `json:"TLSv1.2"` - // The number of requests served over TLS v1.3. - TlSv1_3 int64 `json:"TLSv1.3"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocolsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocolsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocols] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocolsJSON struct { - None apijson.Field - TlSv1 apijson.Field - TlSv1_1 apijson.Field - TlSv1_2 apijson.Field - TlSv1_3 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsBandwidthSSLProtocols) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for pageviews. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviews struct { - // The total number of pageviews served within the time range. - All int64 `json:"all"` - // A variable list of key/value pairs representing the search engine and number of - // hits. - SearchEngine interface{} `json:"search_engine"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviewsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviewsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviews] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviewsJSON struct { - All apijson.Field - SearchEngine apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsPageviews) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Breakdown of totals for requests. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequests struct { - // Total number of requests served. - All int64 `json:"all"` - // Total number of cached requests served. - Cached int64 `json:"cached"` - // A variable list of key/value pairs where the key represents the type of content - // served, and the value is the number of requests. - ContentType interface{} `json:"content_type"` - // A variable list of key/value pairs where the key is a two-digit country code and - // the value is the number of requests served to that country. - Country interface{} `json:"country"` - // Key/value pairs where the key is a HTTP status code and the value is the number - // of requests served with that code. - HTTPStatus map[string]interface{} `json:"http_status"` - // A break down of requests served over HTTPS. - SSL AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSL `json:"ssl"` - // A breakdown of requests by their SSL protocol. - SSLProtocols AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocols `json:"ssl_protocols"` - // Total number of requests served from the origin. - Uncached int64 `json:"uncached"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequests] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsJSON struct { - All apijson.Field - Cached apijson.Field - ContentType apijson.Field - Country apijson.Field - HTTPStatus apijson.Field - SSL apijson.Field - SSLProtocols apijson.Field - Uncached apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequests) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A break down of requests served over HTTPS. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSL struct { - // The number of requests served over HTTPS. - Encrypted int64 `json:"encrypted"` - // The number of requests served over HTTP. - Unencrypted int64 `json:"unencrypted"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSL] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLJSON struct { - Encrypted apijson.Field - Unencrypted apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSL) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A breakdown of requests by their SSL protocol. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocols struct { - // The number of requests served over HTTP. - None int64 `json:"none"` - // The number of requests served over TLS v1.0. - TlSv1 int64 `json:"TLSv1"` - // The number of requests served over TLS v1.1. - TlSv1_1 int64 `json:"TLSv1.1"` - // The number of requests served over TLS v1.2. - TlSv1_2 int64 `json:"TLSv1.2"` - // The number of requests served over TLS v1.3. - TlSv1_3 int64 `json:"TLSv1.3"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocolsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocolsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocols] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocolsJSON struct { - None apijson.Field - TlSv1 apijson.Field - TlSv1_1 apijson.Field - TlSv1_2 apijson.Field - TlSv1_3 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsRequestsSSLProtocols) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// Breakdown of totals for threats. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreats struct { - // The total number of identifiable threats received over the time frame. - All int64 `json:"all"` - // A list of key/value pairs where the key is a two-digit country code and the - // value is the number of malicious requests received from that country. - Country interface{} `json:"country"` - // The list of key/value pairs where the key is a threat category and the value is - // the number of requests. - Type interface{} `json:"type"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreatsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreatsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreats] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreatsJSON struct { - All apijson.Field - Country apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsThreats) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniques struct { - // Total number of unique IP addresses within the time range. - All int64 `json:"all"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniquesJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniquesJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniques] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniquesJSON struct { - All apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUniques) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams struct { - // When set to true, the API will move the requested time window backward, until it - // finds a region with completely aggregated data. - // - // The API response _may not represent the requested time window_. - Continuous param.Field[bool] `query:"continuous"` - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since param.Field[AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince] `query:"since"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until param.Field[AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil] `query:"until"` -} - -// URLQuery serializes -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams]'s query parameters -// as `url.Values`. -func (r AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Satisfied by [shared.UnionString], [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince() -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Satisfied by [shared.UnionString], [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil() -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelope struct { - Errors []AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrors `json:"errors,required"` - Messages []AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessages `json:"messages,required"` - // Totals and timeseries data. - Result AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse `json:"result,required"` - // Whether the API call was successful - Success AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeSuccess `json:"success,required"` - // The exact parameters/timestamps the analytics service used to return data. - Query AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuery `json:"query"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelope] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - Query apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrorsJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrors] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessagesJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessages] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeSuccess bool - -const ( - AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeSuccessTrue AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeSuccess = true -) - -// The exact parameters/timestamps the analytics service used to return data. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuery struct { - // The (inclusive) beginning of the requested time frame. This value can be a - // negative integer representing the number of minutes in the past relative to time - // the request is made, or can be an absolute timestamp that conforms to RFC 3339. - // At this point in time, it cannot exceed a time in the past greater than one - // year. - // - // Ranges that the Cloudflare web application provides will provide the following - // period length for each point: - // - // - Last 60 minutes (from -59 to -1): 1 minute resolution - // - Last 7 hours (from -419 to -60): 15 minutes resolution - // - Last 15 hours (from -899 to -420): 30 minutes resolution - // - Last 72 hours (from -4320 to -900): 1 hour resolution - // - Older than 3 days (-525600 to -4320): 1 day resolution. - Since AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince `json:"since"` - // The amount of time (in minutes) that each data point in the timeseries - // represents. The granularity of the time-series returned (e.g. each bucket in the - // time series representing 1-minute vs 1-day) is calculated by the API based on - // the time-range provided to the API. - TimeDelta int64 `json:"time_delta"` - // The (exclusive) end of the requested time frame. This value can be a negative - // integer representing the number of minutes in the past relative to time the - // request is made, or can be an absolute timestamp that conforms to RFC 3339. If - // omitted, the time of the request is used. - Until AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil `json:"until"` - JSON analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryJSON `json:"-"` -} - -// analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryJSON -// contains the JSON metadata for the struct -// [AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuery] -type analyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryJSON struct { - Since apijson.Field - TimeDelta apijson.Field - Until apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuery) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The (inclusive) beginning of the requested time frame. This value can be a -// negative integer representing the number of minutes in the past relative to time -// the request is made, or can be an absolute timestamp that conforms to RFC 3339. -// At this point in time, it cannot exceed a time in the past greater than one -// year. -// -// Ranges that the Cloudflare web application provides will provide the following -// period length for each point: -// -// - Last 60 minutes (from -59 to -1): 1 minute resolution -// - Last 7 hours (from -419 to -60): 15 minutes resolution -// - Last 15 hours (from -899 to -420): 30 minutes resolution -// - Last 72 hours (from -4320 to -900): 1 hour resolution -// - Older than 3 days (-525600 to -4320): 1 day resolution. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} - -// The (exclusive) end of the requested time frame. This value can be a negative -// integer representing the number of minutes in the past relative to time the -// request is made, or can be an absolute timestamp that conforms to RFC 3339. If -// omitted, the time of the request is used. -// -// Union satisfied by [shared.UnionString] or [shared.UnionInt]. -type AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil interface { - ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionInt(0)), - }, - ) -} diff --git a/analyticsdashboard_test.go b/analyticsdashboard_test.go deleted file mode 100644 index 2787580bcdc..00000000000 --- a/analyticsdashboard_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/shared" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Analytics.Dashboards.ZoneAnalyticsDeprecatedGetDashboard( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams{ - Continuous: cloudflare.F(true), - Since: cloudflare.F[cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince](shared.UnionString("2015-01-01T12:23:00Z")), - Until: cloudflare.F[cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil](shared.UnionString("2015-01-02T12:23:00Z")), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/analyticslatency.go b/analyticslatency.go deleted file mode 100644 index 995b66c7c53..00000000000 --- a/analyticslatency.go +++ /dev/null @@ -1,156 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "reflect" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "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" -) - -// AnalyticsLatencyService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAnalyticsLatencyService] method -// instead. -type AnalyticsLatencyService struct { - Options []option.RequestOption - Colos *AnalyticsLatencyColoService -} - -// NewAnalyticsLatencyService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewAnalyticsLatencyService(opts ...option.RequestOption) (r *AnalyticsLatencyService) { - r = &AnalyticsLatencyService{} - r.Options = opts - r.Colos = NewAnalyticsLatencyColoService(opts...) - return -} - -// Argo Analytics for a zone -func (r *AnalyticsLatencyService) ArgoAnalyticsForZoneArgoAnalyticsForAZone(ctx context.Context, zoneID string, query AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams, opts ...option.RequestOption) (res *AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse, err error) { - opts = append(r.Options[:], opts...) - var env AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelope - path := fmt.Sprintf("zones/%s/analytics/latency", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by -// [AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseUnknown] or -// [shared.UnionString]. -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse interface { - ImplementsAnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams struct { - Bins param.Field[string] `query:"bins"` -} - -// URLQuery serializes -// [AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams]'s query -// parameters as `url.Values`. -func (r AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelope struct { - Errors []AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrors `json:"errors,required"` - Messages []AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessages `json:"messages,required"` - Result AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse `json:"result,required"` - // Whether the API call was successful - Success AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeSuccess `json:"success,required"` - JSON analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeJSON `json:"-"` -} - -// analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelope] -type analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrorsJSON `json:"-"` -} - -// analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrors] -type analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessagesJSON `json:"-"` -} - -// analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessages] -type analyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeSuccess bool - -const ( - AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeSuccessTrue AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponseEnvelopeSuccess = true -) diff --git a/analyticslatency_test.go b/analyticslatency_test.go deleted file mode 100644 index cfe0f740c2d..00000000000 --- a/analyticslatency_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Analytics.Latencies.ArgoAnalyticsForZoneArgoAnalyticsForAZone( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams{ - Bins: cloudflare.F("string"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/analyticslatencycolo.go b/analyticslatencycolo.go deleted file mode 100644 index 03f038ed59c..00000000000 --- a/analyticslatencycolo.go +++ /dev/null @@ -1,137 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -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" -) - -// AnalyticsLatencyColoService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewAnalyticsLatencyColoService] -// method instead. -type AnalyticsLatencyColoService struct { - Options []option.RequestOption -} - -// NewAnalyticsLatencyColoService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewAnalyticsLatencyColoService(opts ...option.RequestOption) (r *AnalyticsLatencyColoService) { - r = &AnalyticsLatencyColoService{} - r.Options = opts - return -} - -// Argo Analytics for a zone at different PoPs -func (r *AnalyticsLatencyColoService) ArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPs(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse, err error) { - opts = append(r.Options[:], opts...) - var env AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelope - path := fmt.Sprintf("zones/%s/analytics/latency/colos", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by -// [AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseUnknown] -// or [shared.UnionString]. -type AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse interface { - ImplementsAnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelope struct { - Errors []AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrors `json:"errors,required"` - Messages []AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessages `json:"messages,required"` - Result AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse `json:"result,required"` - // Whether the API call was successful - Success AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeSuccess `json:"success,required"` - JSON analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeJSON `json:"-"` -} - -// analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelope] -type analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrorsJSON `json:"-"` -} - -// analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrors] -type analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessagesJSON `json:"-"` -} - -// analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessages] -type analyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeSuccess bool - -const ( - AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeSuccessTrue AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponseEnvelopeSuccess = true -) diff --git a/analyticslatencycolo_test.go b/analyticslatencycolo_test.go deleted file mode 100644 index 9e9a56e5cd2..00000000000 --- a/analyticslatencycolo_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestAnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPs(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Analytics.Latencies.Colos.ArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPs(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/api.md b/api.md index bf43ce34991..5fd9d659544 100644 --- a/api.md +++ b/api.md @@ -2,31 +2,31 @@ Response Types: -- cloudflare.AccountUpdateResponse - cloudflare.AccountListResponse - cloudflare.AccountGetResponse +- cloudflare.AccountReplaceResponse Methods: -- client.Accounts.Update(ctx context.Context, accountID interface{}, body cloudflare.AccountUpdateParams) (cloudflare.AccountUpdateResponse, error) - client.Accounts.List(ctx context.Context, query cloudflare.AccountListParams) (shared.V4PagePaginationArray[cloudflare.AccountListResponse], error) - client.Accounts.Get(ctx context.Context, accountID interface{}) (cloudflare.AccountGetResponse, error) +- client.Accounts.Replace(ctx context.Context, accountID interface{}, body cloudflare.AccountReplaceParams) (cloudflare.AccountReplaceResponse, error) # Certificates Response Types: +- cloudflare.CertificateNewResponse +- cloudflare.CertificateListResponse - cloudflare.CertificateDeleteResponse - cloudflare.CertificateGetResponse -- cloudflare.CertificateOriginCaNewCertificateResponse -- cloudflare.CertificateOriginCaListCertificatesResponse Methods: +- client.Certificates.New(ctx context.Context, body cloudflare.CertificateNewParams) (cloudflare.CertificateNewResponse, error) +- client.Certificates.List(ctx context.Context, query cloudflare.CertificateListParams) ([]cloudflare.CertificateListResponse, error) - client.Certificates.Delete(ctx context.Context, certificateID string) (cloudflare.CertificateDeleteResponse, error) - client.Certificates.Get(ctx context.Context, certificateID string) (cloudflare.CertificateGetResponse, error) -- client.Certificates.OriginCaNewCertificate(ctx context.Context, body cloudflare.CertificateOriginCaNewCertificateParams) (cloudflare.CertificateOriginCaNewCertificateResponse, error) -- client.Certificates.OriginCaListCertificates(ctx context.Context, query cloudflare.CertificateOriginCaListCertificatesParams) ([]cloudflare.CertificateOriginCaListCertificatesResponse, error) # IPs @@ -42,29 +42,29 @@ Methods: Response Types: -- cloudflare.MembershipUpdateResponse - cloudflare.MembershipListResponse - cloudflare.MembershipDeleteResponse - cloudflare.MembershipGetResponse +- cloudflare.MembershipReplaceResponse Methods: -- client.Memberships.Update(ctx context.Context, membershipID string, body cloudflare.MembershipUpdateParams) (cloudflare.MembershipUpdateResponse, error) - client.Memberships.List(ctx context.Context, query cloudflare.MembershipListParams) (shared.V4PagePaginationArray[cloudflare.MembershipListResponse], error) - client.Memberships.Delete(ctx context.Context, membershipID string) (cloudflare.MembershipDeleteResponse, error) - client.Memberships.Get(ctx context.Context, membershipID string) (cloudflare.MembershipGetResponse, error) +- client.Memberships.Replace(ctx context.Context, membershipID string, body cloudflare.MembershipReplaceParams) (cloudflare.MembershipReplaceResponse, error) # Users Response Types: -- cloudflare.UserUserEditUserResponse -- cloudflare.UserUserUserDetailsResponse +- cloudflare.UserUpdateResponse +- cloudflare.UserListResponse Methods: -- client.Users.UserEditUser(ctx context.Context, body cloudflare.UserUserEditUserParams) (cloudflare.UserUserEditUserResponse, error) -- client.Users.UserUserDetails(ctx context.Context) (cloudflare.UserUserUserDetailsResponse, error) +- client.Users.Update(ctx context.Context, body cloudflare.UserUpdateParams) (cloudflare.UserUpdateResponse, error) +- client.Users.List(ctx context.Context) (cloudflare.UserListResponse, error) ## AuditLogs @@ -78,27 +78,27 @@ Methods: ## Billings -### Histories +### History Response Types: -- cloudflare.UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse +- cloudflare.UserBillingHistoryListResponse Methods: -- client.Users.Billings.Histories.UserBillingHistoryBillingHistoryDetails(ctx context.Context, query cloudflare.UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams) ([]cloudflare.UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse, error) +- client.Users.Billings.History.List(ctx context.Context, query cloudflare.UserBillingHistoryListParams) (shared.V4PagePaginationArray[cloudflare.UserBillingHistoryListResponse], error) ### Profiles Response Types: -- cloudflare.UserBillingProfileUserBillingProfileBillingProfileDetailsResponse +- cloudflare.UserBillingProfileListResponse Methods: -- client.Users.Billings.Profiles.UserBillingProfileBillingProfileDetails(ctx context.Context) (cloudflare.UserBillingProfileUserBillingProfileBillingProfileDetailsResponse, error) +- client.Users.Billings.Profiles.List(ctx context.Context) (cloudflare.UserBillingProfileListResponse, error) -## Firewalls +## Firewall ### AccessRules @@ -106,31 +106,31 @@ Methods: Response Types: +- cloudflare.UserFirewallAccessRuleRuleNewResponse - cloudflare.UserFirewallAccessRuleRuleUpdateResponse +- cloudflare.UserFirewallAccessRuleRuleListResponse - cloudflare.UserFirewallAccessRuleRuleDeleteResponse -- cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse -- cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse Methods: -- client.Users.Firewalls.AccessRules.Rules.Update(ctx context.Context, identifier string, body cloudflare.UserFirewallAccessRuleRuleUpdateParams) (cloudflare.UserFirewallAccessRuleRuleUpdateResponse, error) -- client.Users.Firewalls.AccessRules.Rules.Delete(ctx context.Context, identifier string) (cloudflare.UserFirewallAccessRuleRuleDeleteResponse, error) -- client.Users.Firewalls.AccessRules.Rules.IPAccessRulesForAUserNewAnIPAccessRule(ctx context.Context, body cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParams) (cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse, error) -- client.Users.Firewalls.AccessRules.Rules.IPAccessRulesForAUserListIPAccessRules(ctx context.Context, query cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams) ([]cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse, error) +- client.Users.Firewall.AccessRules.Rules.New(ctx context.Context, body cloudflare.UserFirewallAccessRuleRuleNewParams) (cloudflare.UserFirewallAccessRuleRuleNewResponse, error) +- client.Users.Firewall.AccessRules.Rules.Update(ctx context.Context, identifier string, body cloudflare.UserFirewallAccessRuleRuleUpdateParams) (cloudflare.UserFirewallAccessRuleRuleUpdateResponse, error) +- client.Users.Firewall.AccessRules.Rules.List(ctx context.Context, query cloudflare.UserFirewallAccessRuleRuleListParams) (shared.V4PagePaginationArray[cloudflare.UserFirewallAccessRuleRuleListResponse], error) +- client.Users.Firewall.AccessRules.Rules.Delete(ctx context.Context, identifier string) (cloudflare.UserFirewallAccessRuleRuleDeleteResponse, error) ## Invites Response Types: - cloudflare.UserInviteUpdateResponse +- cloudflare.UserInviteListResponse - cloudflare.UserInviteGetResponse -- cloudflare.UserInviteUserSInvitesListInvitationsResponse Methods: - client.Users.Invites.Update(ctx context.Context, inviteID string, body cloudflare.UserInviteUpdateParams) (cloudflare.UserInviteUpdateResponse, error) +- client.Users.Invites.List(ctx context.Context) ([]cloudflare.UserInviteListResponse, error) - client.Users.Invites.Get(ctx context.Context, inviteID string) (cloudflare.UserInviteGetResponse, error) -- client.Users.Invites.UserSInvitesListInvitations(ctx context.Context) ([]cloudflare.UserInviteUserSInvitesListInvitationsResponse, error) ## LoadBalancers @@ -156,11 +156,11 @@ Methods: Response Types: -- cloudflare.UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse +- cloudflare.UserLoadBalancerMonitorPreviewNewResponse Methods: -- client.Users.LoadBalancers.Monitors.Previews.LoadBalancerMonitorsPreviewMonitor(ctx context.Context, monitorID string, body cloudflare.UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams) (cloudflare.UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse, error) +- client.Users.LoadBalancers.Monitors.Previews.New(ctx context.Context, monitorID string, body cloudflare.UserLoadBalancerMonitorPreviewNewParams) (cloudflare.UserLoadBalancerMonitorPreviewNewResponse, error) #### References @@ -176,51 +176,49 @@ Methods: Response Types: +- cloudflare.UserLoadBalancerPoolNewResponse - cloudflare.UserLoadBalancerPoolUpdateResponse +- cloudflare.UserLoadBalancerPoolListResponse - cloudflare.UserLoadBalancerPoolDeleteResponse - cloudflare.UserLoadBalancerPoolGetResponse -- cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse -- cloudflare.UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse -- cloudflare.UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse Methods: +- client.Users.LoadBalancers.Pools.New(ctx context.Context, body cloudflare.UserLoadBalancerPoolNewParams) (cloudflare.UserLoadBalancerPoolNewResponse, error) - client.Users.LoadBalancers.Pools.Update(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolUpdateParams) (cloudflare.UserLoadBalancerPoolUpdateResponse, error) +- client.Users.LoadBalancers.Pools.List(ctx context.Context, query cloudflare.UserLoadBalancerPoolListParams) ([]cloudflare.UserLoadBalancerPoolListResponse, error) - client.Users.LoadBalancers.Pools.Delete(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolDeleteResponse, error) - client.Users.LoadBalancers.Pools.Get(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolGetResponse, error) -- client.Users.LoadBalancers.Pools.LoadBalancerPoolsNewPool(ctx context.Context, body cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParams) (cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse, error) -- client.Users.LoadBalancers.Pools.LoadBalancerPoolsListPools(ctx context.Context, query cloudflare.UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams) ([]cloudflare.UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse, error) -- client.Users.LoadBalancers.Pools.LoadBalancerPoolsPatchPools(ctx context.Context, body cloudflare.UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParams) ([]cloudflare.UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse, error) #### Health Response Types: -- cloudflare.UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse +- cloudflare.UserLoadBalancerPoolHealthListResponse Methods: -- client.Users.LoadBalancers.Pools.Health.LoadBalancerPoolsPoolHealthDetails(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse, error) +- client.Users.LoadBalancers.Pools.Health.List(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolHealthListResponse, error) #### Previews Response Types: -- cloudflare.UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse +- cloudflare.UserLoadBalancerPoolPreviewNewResponse Methods: -- client.Users.LoadBalancers.Pools.Previews.LoadBalancerPoolsPreviewPool(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams) (cloudflare.UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse, error) +- client.Users.LoadBalancers.Pools.Previews.New(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolPreviewNewParams) (cloudflare.UserLoadBalancerPoolPreviewNewResponse, error) #### References Response Types: -- cloudflare.UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse +- cloudflare.UserLoadBalancerPoolReferenceListResponse Methods: -- client.Users.LoadBalancers.Pools.References.LoadBalancerPoolsListPoolReferences(ctx context.Context, poolID string) ([]cloudflare.UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse, error) +- client.Users.LoadBalancers.Pools.References.List(ctx context.Context, poolID string) ([]cloudflare.UserLoadBalancerPoolReferenceListResponse, error) ### Previews @@ -238,83 +236,75 @@ Methods: Response Types: -- cloudflare.UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse +- cloudflare.UserLoadBalancingAnalyticEventListResponse Methods: -- client.Users.LoadBalancingAnalytics.Events.LoadBalancerHealthcheckEventsListHealthcheckEvents(ctx context.Context, query cloudflare.UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams) ([]cloudflare.UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse, error) +- client.Users.LoadBalancingAnalytics.Events.List(ctx context.Context, query cloudflare.UserLoadBalancingAnalyticEventListParams) ([]cloudflare.UserLoadBalancingAnalyticEventListResponse, error) ## Organizations Response Types: +- cloudflare.UserOrganizationListResponse - cloudflare.UserOrganizationDeleteResponse - cloudflare.UserOrganizationGetResponse -- cloudflare.UserOrganizationUserSOrganizationsListOrganizationsResponse Methods: +- client.Users.Organizations.List(ctx context.Context, query cloudflare.UserOrganizationListParams) (shared.V4PagePaginationArray[cloudflare.UserOrganizationListResponse], error) - client.Users.Organizations.Delete(ctx context.Context, organizationID string) (cloudflare.UserOrganizationDeleteResponse, error) - client.Users.Organizations.Get(ctx context.Context, organizationID string) (cloudflare.UserOrganizationGetResponse, error) -- client.Users.Organizations.UserSOrganizationsListOrganizations(ctx context.Context, query cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParams) ([]cloudflare.UserOrganizationUserSOrganizationsListOrganizationsResponse, error) ## Subscriptions Response Types: -- cloudflare.UserSubscriptionUpdateResponse +- cloudflare.UserSubscriptionListResponse - cloudflare.UserSubscriptionDeleteResponse -- cloudflare.UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse +- cloudflare.UserSubscriptionReplaceResponse Methods: -- client.Users.Subscriptions.Update(ctx context.Context, identifier string, body cloudflare.UserSubscriptionUpdateParams) (cloudflare.UserSubscriptionUpdateResponse, error) +- client.Users.Subscriptions.List(ctx context.Context) ([]cloudflare.UserSubscriptionListResponse, error) - client.Users.Subscriptions.Delete(ctx context.Context, identifier string) (cloudflare.UserSubscriptionDeleteResponse, error) -- client.Users.Subscriptions.UserSubscriptionGetUserSubscriptions(ctx context.Context) ([]cloudflare.UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse, error) +- client.Users.Subscriptions.Replace(ctx context.Context, identifier string, body cloudflare.UserSubscriptionReplaceParams) (cloudflare.UserSubscriptionReplaceResponse, error) ## Tokens Response Types: -- cloudflare.UserTokenUpdateResponse +- cloudflare.UserTokenNewResponse +- cloudflare.UserTokenListResponse - cloudflare.UserTokenDeleteResponse - cloudflare.UserTokenGetResponse -- cloudflare.UserTokenUserAPITokensNewTokenResponse -- cloudflare.UserTokenUserAPITokensListTokensResponse +- cloudflare.UserTokenReplaceResponse +- cloudflare.UserTokenVerifyResponse Methods: -- client.Users.Tokens.Update(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenUpdateParams) (cloudflare.UserTokenUpdateResponse, error) +- client.Users.Tokens.New(ctx context.Context, body cloudflare.UserTokenNewParams) (cloudflare.UserTokenNewResponse, error) +- client.Users.Tokens.List(ctx context.Context, query cloudflare.UserTokenListParams) (shared.V4PagePaginationArray[cloudflare.UserTokenListResponse], error) - client.Users.Tokens.Delete(ctx context.Context, tokenID interface{}) (cloudflare.UserTokenDeleteResponse, error) - client.Users.Tokens.Get(ctx context.Context, tokenID interface{}) (cloudflare.UserTokenGetResponse, error) -- client.Users.Tokens.UserAPITokensNewToken(ctx context.Context, body cloudflare.UserTokenUserAPITokensNewTokenParams) (cloudflare.UserTokenUserAPITokensNewTokenResponse, error) -- client.Users.Tokens.UserAPITokensListTokens(ctx context.Context, query cloudflare.UserTokenUserAPITokensListTokensParams) ([]cloudflare.UserTokenUserAPITokensListTokensResponse, error) +- client.Users.Tokens.Replace(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenReplaceParams) (cloudflare.UserTokenReplaceResponse, error) +- client.Users.Tokens.Verify(ctx context.Context) (cloudflare.UserTokenVerifyResponse, error) ### PermissionGroups Response Types: -- cloudflare.UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponse - -Methods: - -- client.Users.Tokens.PermissionGroups.PermissionGroupsListPermissionGroups(ctx context.Context) ([]cloudflare.UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponse, error) - -### Verifies - -Response Types: - -- cloudflare.UserTokenVerifyUserAPITokensVerifyTokenResponse +- cloudflare.UserTokenPermissionGroupListResponse Methods: -- client.Users.Tokens.Verifies.UserAPITokensVerifyToken(ctx context.Context) (cloudflare.UserTokenVerifyUserAPITokensVerifyTokenResponse, error) +- client.Users.Tokens.PermissionGroups.List(ctx context.Context) ([]cloudflare.UserTokenPermissionGroupListResponse, error) ### Values Methods: -- client.Users.Tokens.Values.UserAPITokensRollToken(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenValueUserAPITokensRollTokenParams) (string, error) +- client.Users.Tokens.Values.Replace(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenValueReplaceParams) (string, error) # Zones @@ -334,29 +324,29 @@ Methods: - client.Zones.Delete(ctx context.Context, zoneID string) (cloudflare.ZoneDeleteResponse, error) - client.Zones.Get(ctx context.Context, zoneID string) (cloudflare.ZoneGetResponse, error) -## Hold +## Holds Response Types: -- cloudflare.ZoneHoldEnforceResponse +- cloudflare.ZoneHoldNewResponse +- cloudflare.ZoneHoldDeleteResponse - cloudflare.ZoneHoldGetResponse -- cloudflare.ZoneHoldRemoveResponse Methods: -- client.Zones.Hold.Enforce(ctx context.Context, zoneID string, body cloudflare.ZoneHoldEnforceParams) (cloudflare.ZoneHoldEnforceResponse, error) -- client.Zones.Hold.Get(ctx context.Context, zoneID string) (cloudflare.ZoneHoldGetResponse, error) -- client.Zones.Hold.Remove(ctx context.Context, zoneID string, body cloudflare.ZoneHoldRemoveParams) (cloudflare.ZoneHoldRemoveResponse, error) +- client.Zones.Holds.New(ctx context.Context, zoneID string, body cloudflare.ZoneHoldNewParams) (cloudflare.ZoneHoldNewResponse, error) +- client.Zones.Holds.Delete(ctx context.Context, zoneID string, body cloudflare.ZoneHoldDeleteParams) (cloudflare.ZoneHoldDeleteResponse, error) +- client.Zones.Holds.Get(ctx context.Context, zoneID string) (cloudflare.ZoneHoldGetResponse, error) # AI Response Types: -- cloudflare.AIRunResponse +- cloudflare.AINewResponse Methods: -- client.AI.Run(ctx context.Context, accountID string, modelName string, body cloudflare.AIRunParams) (cloudflare.AIRunResponse, error) +- client.AI.New(ctx context.Context, accountID string, modelName string, body cloudflare.AINewParams) (cloudflare.AINewResponse, error) # LoadBalancers @@ -398,21 +388,21 @@ Methods: Response Types: -- cloudflare.LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse +- cloudflare.LoadBalancerMonitorPreviewNewResponse Methods: -- client.LoadBalancers.Monitors.Previews.AccountLoadBalancerMonitorsPreviewMonitor(ctx context.Context, accountID string, monitorID string, body cloudflare.LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams) (cloudflare.LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse, error) +- client.LoadBalancers.Monitors.Previews.New(ctx context.Context, accountID string, monitorID string, body cloudflare.LoadBalancerMonitorPreviewNewParams) (cloudflare.LoadBalancerMonitorPreviewNewResponse, error) ### References Response Types: -- cloudflare.LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse +- cloudflare.LoadBalancerMonitorReferenceListResponse Methods: -- client.LoadBalancers.Monitors.References.AccountLoadBalancerMonitorsListMonitorReferences(ctx context.Context, accountID string, monitorID string) ([]cloudflare.LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse, error) +- client.LoadBalancers.Monitors.References.List(ctx context.Context, accountID string, monitorID string) ([]cloudflare.LoadBalancerMonitorReferenceListResponse, error) ## Pools @@ -436,13 +426,13 @@ Methods: Response Types: +- cloudflare.LoadBalancerPoolHealthNewResponse - cloudflare.LoadBalancerPoolHealthGetResponse -- cloudflare.LoadBalancerPoolHealthPreviewResponse Methods: +- client.LoadBalancers.Pools.Health.New(ctx context.Context, accountID string, poolID string, body cloudflare.LoadBalancerPoolHealthNewParams) (cloudflare.LoadBalancerPoolHealthNewResponse, error) - client.LoadBalancers.Pools.Health.Get(ctx context.Context, accountID string, poolID string) (cloudflare.LoadBalancerPoolHealthGetResponse, error) -- client.LoadBalancers.Pools.Health.Preview(ctx context.Context, accountID string, poolID string, body cloudflare.LoadBalancerPoolHealthPreviewParams) (cloudflare.LoadBalancerPoolHealthPreviewResponse, error) ### References @@ -468,13 +458,13 @@ Methods: Response Types: +- cloudflare.LoadBalancerRegionListResponse - cloudflare.LoadBalancerRegionGetResponse -- cloudflare.LoadBalancerRegionLoadBalancerRegionsListRegionsResponse Methods: +- client.LoadBalancers.Regions.List(ctx context.Context, accountID string, query cloudflare.LoadBalancerRegionListParams) (cloudflare.LoadBalancerRegionListResponse, error) - client.LoadBalancers.Regions.Get(ctx context.Context, accountID string, regionID cloudflare.LoadBalancerRegionGetParamsRegionID) (cloudflare.LoadBalancerRegionGetResponse, error) -- client.LoadBalancers.Regions.LoadBalancerRegionsListRegions(ctx context.Context, accountID string, query cloudflare.LoadBalancerRegionLoadBalancerRegionsListRegionsParams) (cloudflare.LoadBalancerRegionLoadBalancerRegionsListRegionsResponse, error) ## Searches @@ -488,243 +478,201 @@ Methods: # Access -## Apps +## Applications Response Types: -- cloudflare.AccessAppNewResponse -- cloudflare.AccessAppUpdateResponse -- cloudflare.AccessAppListResponse -- cloudflare.AccessAppDeleteResponse -- cloudflare.AccessAppGetResponse +- cloudflare.AccessApplicationNewResponse +- cloudflare.AccessApplicationListResponse +- cloudflare.AccessApplicationDeleteResponse +- cloudflare.AccessApplicationGetResponse +- cloudflare.AccessApplicationReplaceResponse +- cloudflare.AccessApplicationRevokeTokensResponse Methods: -- client.Access.Apps.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessAppNewParams) (cloudflare.AccessAppNewResponse, error) -- client.Access.Apps.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessAppUpdateParamsVariant0AppID, body cloudflare.AccessAppUpdateParams) (cloudflare.AccessAppUpdateResponse, error) -- client.Access.Apps.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessAppListResponse, error) -- client.Access.Apps.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessAppDeleteParamsAppID) (cloudflare.AccessAppDeleteResponse, error) -- client.Access.Apps.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessAppGetParamsAppID) (cloudflare.AccessAppGetResponse, error) +- client.Access.Applications.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessApplicationNewParams) (cloudflare.AccessApplicationNewResponse, error) +- client.Access.Applications.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessApplicationListResponse, error) +- client.Access.Applications.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessApplicationDeleteParamsAppID) (cloudflare.AccessApplicationDeleteResponse, error) +- client.Access.Applications.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessApplicationGetParamsAppID) (cloudflare.AccessApplicationGetResponse, error) +- client.Access.Applications.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessApplicationReplaceParamsVariant0AppID, body cloudflare.AccessApplicationReplaceParams) (cloudflare.AccessApplicationReplaceResponse, error) +- client.Access.Applications.RevokeTokens(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessApplicationRevokeTokensParamsAppID) (cloudflare.AccessApplicationRevokeTokensResponse, error) ### Cas Response Types: -- cloudflare.AccessAppCaNewResponse -- cloudflare.AccessAppCaListResponse -- cloudflare.AccessAppCaDeleteResponse -- cloudflare.AccessAppCaGetResponse - -Methods: - -- client.Access.Apps.Cas.New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessAppCaNewResponse, error) -- client.Access.Apps.Cas.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessAppCaListResponse, error) -- client.Access.Apps.Cas.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessAppCaDeleteResponse, error) -- client.Access.Apps.Cas.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessAppCaGetResponse, error) - -### RevokeTokens - -Response Types: - -- cloudflare.AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponse +- cloudflare.AccessApplicationCaNewResponse +- cloudflare.AccessApplicationCaListResponse +- cloudflare.AccessApplicationCaDeleteResponse +- cloudflare.AccessApplicationCaGetResponse Methods: -- client.Access.Apps.RevokeTokens.AccessApplicationsRevokeServiceTokens(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensParamsAppID) (cloudflare.AccessAppRevokeTokenAccessApplicationsRevokeServiceTokensResponse, error) +- client.Access.Applications.Cas.New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessApplicationCaNewResponse, error) +- client.Access.Applications.Cas.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessApplicationCaListResponse, error) +- client.Access.Applications.Cas.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessApplicationCaDeleteResponse, error) +- client.Access.Applications.Cas.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessApplicationCaGetResponse, error) ### UserPolicyChecks Response Types: -- cloudflare.AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse +- cloudflare.AccessApplicationUserPolicyCheckListResponse Methods: -- client.Access.Apps.UserPolicyChecks.AccessApplicationsTestAccessPolicies(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesParamsAppID) (cloudflare.AccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesResponse, error) +- client.Access.Applications.UserPolicyChecks.List(ctx context.Context, accountOrZone string, accountOrZoneID string, appID cloudflare.AccessApplicationUserPolicyCheckListParamsAppID) (cloudflare.AccessApplicationUserPolicyCheckListResponse, error) ### Policies Response Types: -- cloudflare.AccessAppPolicyNewResponse -- cloudflare.AccessAppPolicyUpdateResponse -- cloudflare.AccessAppPolicyDeleteResponse -- cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse -- cloudflare.AccessAppPolicyAccessPoliciesListAccessPoliciesResponse -- cloudflare.AccessAppPolicyGetResponse +- cloudflare.AccessApplicationPolicyNewResponse +- cloudflare.AccessApplicationPolicyListResponse +- cloudflare.AccessApplicationPolicyDeleteResponse +- cloudflare.AccessApplicationPolicyGetResponse +- cloudflare.AccessApplicationPolicyReplaceResponse Methods: -- client.Access.Apps.Policies.New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessAppPolicyNewParams) (cloudflare.AccessAppPolicyNewResponse, error) -- client.Access.Apps.Policies.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, body cloudflare.AccessAppPolicyUpdateParams) (cloudflare.AccessAppPolicyUpdateResponse, error) -- client.Access.Apps.Policies.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string) (cloudflare.AccessAppPolicyDeleteResponse, error) -- client.Access.Apps.Policies.AccessPoliciesNewAnAccessPolicy(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyParams) (cloudflare.AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse, error) -- client.Access.Apps.Policies.AccessPoliciesListAccessPolicies(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) ([]cloudflare.AccessAppPolicyAccessPoliciesListAccessPoliciesResponse, error) -- client.Access.Apps.Policies.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string) (cloudflare.AccessAppPolicyGetResponse, error) +- client.Access.Applications.Policies.New(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessApplicationPolicyNewParams) (cloudflare.AccessApplicationPolicyNewResponse, error) +- client.Access.Applications.Policies.List(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) ([]cloudflare.AccessApplicationPolicyListResponse, error) +- client.Access.Applications.Policies.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string) (cloudflare.AccessApplicationPolicyDeleteResponse, error) +- client.Access.Applications.Policies.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string) (cloudflare.AccessApplicationPolicyGetResponse, error) +- client.Access.Applications.Policies.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid1 string, uuid string, body cloudflare.AccessApplicationPolicyReplaceParams) (cloudflare.AccessApplicationPolicyReplaceResponse, error) ## Certificates Response Types: -- cloudflare.AccessCertificateUpdateResponse +- cloudflare.AccessCertificateNewResponse +- cloudflare.AccessCertificateListResponse - cloudflare.AccessCertificateDeleteResponse -- cloudflare.AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse -- cloudflare.AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse - cloudflare.AccessCertificateGetResponse +- cloudflare.AccessCertificateReplaceResponse Methods: -- client.Access.Certificates.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessCertificateUpdateParams) (cloudflare.AccessCertificateUpdateResponse, error) +- client.Access.Certificates.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessCertificateNewParams) (cloudflare.AccessCertificateNewResponse, error) +- client.Access.Certificates.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessCertificateListResponse, error) - client.Access.Certificates.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessCertificateDeleteResponse, error) -- client.Access.Certificates.AccessMTLSAuthenticationAddAnMTLSCertificate(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessCertificateAccessMTLSAuthenticationAddAnMTLSCertificateParams) (cloudflare.AccessCertificateAccessMtlsAuthenticationAddAnMtlsCertificateResponse, error) -- client.Access.Certificates.AccessMTLSAuthenticationListMTLSCertificates(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessCertificateAccessMtlsAuthenticationListMtlsCertificatesResponse, error) - client.Access.Certificates.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessCertificateGetResponse, error) +- client.Access.Certificates.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessCertificateReplaceParams) (cloudflare.AccessCertificateReplaceResponse, error) ### Settings Response Types: -- cloudflare.AccessCertificateSettingUpdateResponse - cloudflare.AccessCertificateSettingListResponse +- cloudflare.AccessCertificateSettingReplaceResponse Methods: -- client.Access.Certificates.Settings.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessCertificateSettingUpdateParams) ([]cloudflare.AccessCertificateSettingUpdateResponse, error) - client.Access.Certificates.Settings.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessCertificateSettingListResponse, error) +- client.Access.Certificates.Settings.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessCertificateSettingReplaceParams) ([]cloudflare.AccessCertificateSettingReplaceResponse, error) ## Groups Response Types: -- cloudflare.AccessGroupUpdateResponse +- cloudflare.AccessGroupNewResponse +- cloudflare.AccessGroupListResponse - cloudflare.AccessGroupDeleteResponse -- cloudflare.AccessGroupAccessGroupsNewAnAccessGroupResponse -- cloudflare.AccessGroupAccessGroupsListAccessGroupsResponse - cloudflare.AccessGroupGetResponse +- cloudflare.AccessGroupReplaceResponse Methods: -- client.Access.Groups.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessGroupUpdateParams) (cloudflare.AccessGroupUpdateResponse, error) +- client.Access.Groups.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessGroupNewParams) (cloudflare.AccessGroupNewResponse, error) +- client.Access.Groups.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessGroupListResponse, error) - client.Access.Groups.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessGroupDeleteResponse, error) -- client.Access.Groups.AccessGroupsNewAnAccessGroup(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessGroupAccessGroupsNewAnAccessGroupParams) (cloudflare.AccessGroupAccessGroupsNewAnAccessGroupResponse, error) -- client.Access.Groups.AccessGroupsListAccessGroups(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessGroupAccessGroupsListAccessGroupsResponse, error) - client.Access.Groups.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessGroupGetResponse, error) +- client.Access.Groups.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessGroupReplaceParams) (cloudflare.AccessGroupReplaceResponse, error) ## IdentityProviders Response Types: -- cloudflare.AccessIdentityProviderUpdateResponse +- cloudflare.AccessIdentityProviderNewResponse +- cloudflare.AccessIdentityProviderListResponse - cloudflare.AccessIdentityProviderDeleteResponse -- cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse -- cloudflare.AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse - cloudflare.AccessIdentityProviderGetResponse +- cloudflare.AccessIdentityProviderReplaceResponse Methods: -- client.Access.IdentityProviders.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessIdentityProviderUpdateParams) (cloudflare.AccessIdentityProviderUpdateResponse, error) +- client.Access.IdentityProviders.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessIdentityProviderNewParams) (cloudflare.AccessIdentityProviderNewResponse, error) +- client.Access.IdentityProviders.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessIdentityProviderListResponse, error) - client.Access.IdentityProviders.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessIdentityProviderDeleteResponse, error) -- client.Access.IdentityProviders.AccessIdentityProvidersAddAnAccessIdentityProvider(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderParams) (cloudflare.AccessIdentityProviderAccessIdentityProvidersAddAnAccessIdentityProviderResponse, error) -- client.Access.IdentityProviders.AccessIdentityProvidersListAccessIdentityProviders(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessIdentityProviderAccessIdentityProvidersListAccessIdentityProvidersResponse, error) - client.Access.IdentityProviders.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessIdentityProviderGetResponse, error) +- client.Access.IdentityProviders.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessIdentityProviderReplaceParams) (cloudflare.AccessIdentityProviderReplaceResponse, error) ## Organizations Response Types: -- cloudflare.AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse -- cloudflare.AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse -- cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse - -Methods: - -- client.Access.Organizations.ZeroTrustOrganizationNewYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationParams) (cloudflare.AccessOrganizationZeroTrustOrganizationNewYourZeroTrustOrganizationResponse, error) -- client.Access.Organizations.ZeroTrustOrganizationGetYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string) (cloudflare.AccessOrganizationZeroTrustOrganizationGetYourZeroTrustOrganizationResponse, error) -- client.Access.Organizations.ZeroTrustOrganizationUpdateYourZeroTrustOrganization(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationParams) (cloudflare.AccessOrganizationZeroTrustOrganizationUpdateYourZeroTrustOrganizationResponse, error) - -### RevokeUsers - -Response Types: - -- cloudflare.AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse +- cloudflare.AccessOrganizationNewResponse +- cloudflare.AccessOrganizationListResponse +- cloudflare.AccessOrganizationReplaceResponse +- cloudflare.AccessOrganizationRevokeUsersResponse Methods: -- client.Access.Organizations.RevokeUsers.ZeroTrustOrganizationRevokeAllAccessTokensForAUser(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserParams) (cloudflare.AccessOrganizationRevokeUserZeroTrustOrganizationRevokeAllAccessTokensForAUserResponse, error) +- client.Access.Organizations.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationNewParams) (cloudflare.AccessOrganizationNewResponse, error) +- client.Access.Organizations.List(ctx context.Context, accountOrZone string, accountOrZoneID string) (cloudflare.AccessOrganizationListResponse, error) +- client.Access.Organizations.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationReplaceParams) (cloudflare.AccessOrganizationReplaceResponse, error) +- client.Access.Organizations.RevokeUsers(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessOrganizationRevokeUsersParams) (cloudflare.AccessOrganizationRevokeUsersResponse, error) ## ServiceTokens Response Types: -- cloudflare.AccessServiceTokenUpdateResponse +- cloudflare.AccessServiceTokenNewResponse +- cloudflare.AccessServiceTokenListResponse - cloudflare.AccessServiceTokenDeleteResponse -- cloudflare.AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse -- cloudflare.AccessServiceTokenAccessServiceTokensListServiceTokensResponse +- cloudflare.AccessServiceTokenRefreshResponse +- cloudflare.AccessServiceTokenReplaceResponse +- cloudflare.AccessServiceTokenRotateResponse Methods: -- client.Access.ServiceTokens.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessServiceTokenUpdateParams) (cloudflare.AccessServiceTokenUpdateResponse, error) +- client.Access.ServiceTokens.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessServiceTokenNewParams) (cloudflare.AccessServiceTokenNewResponse, error) +- client.Access.ServiceTokens.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessServiceTokenListResponse, error) - client.Access.ServiceTokens.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string) (cloudflare.AccessServiceTokenDeleteResponse, error) -- client.Access.ServiceTokens.AccessServiceTokensNewAServiceToken(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.AccessServiceTokenAccessServiceTokensNewAServiceTokenParams) (cloudflare.AccessServiceTokenAccessServiceTokensNewAServiceTokenResponse, error) -- client.Access.ServiceTokens.AccessServiceTokensListServiceTokens(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.AccessServiceTokenAccessServiceTokensListServiceTokensResponse, error) - -### Refreshes - -Response Types: - -- cloudflare.AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse - -Methods: - -- client.Access.ServiceTokens.Refreshes.AccessServiceTokensRefreshAServiceToken(ctx context.Context, identifier string, uuid string) (cloudflare.AccessServiceTokenRefreshAccessServiceTokensRefreshAServiceTokenResponse, error) - -### Rotates - -Response Types: - -- cloudflare.AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse - -Methods: - -- client.Access.ServiceTokens.Rotates.AccessServiceTokensRotateAServiceToken(ctx context.Context, identifier string, uuid string) (cloudflare.AccessServiceTokenRotateAccessServiceTokensRotateAServiceTokenResponse, error) +- client.Access.ServiceTokens.Refresh(ctx context.Context, identifier string, uuid string) (cloudflare.AccessServiceTokenRefreshResponse, error) +- client.Access.ServiceTokens.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, uuid string, body cloudflare.AccessServiceTokenReplaceParams) (cloudflare.AccessServiceTokenReplaceResponse, error) +- client.Access.ServiceTokens.Rotate(ctx context.Context, identifier string, uuid string) (cloudflare.AccessServiceTokenRotateResponse, error) ## Bookmarks Response Types: -- cloudflare.AccessBookmarkUpdateResponse +- cloudflare.AccessBookmarkListResponse - cloudflare.AccessBookmarkDeleteResponse -- cloudflare.AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse - cloudflare.AccessBookmarkGetResponse +- cloudflare.AccessBookmarkReplaceResponse Methods: -- client.Access.Bookmarks.Update(ctx context.Context, identifier interface{}, uuid string) (cloudflare.AccessBookmarkUpdateResponse, error) +- client.Access.Bookmarks.List(ctx context.Context, identifier interface{}) ([]cloudflare.AccessBookmarkListResponse, error) - client.Access.Bookmarks.Delete(ctx context.Context, identifier interface{}, uuid string) (cloudflare.AccessBookmarkDeleteResponse, error) -- client.Access.Bookmarks.AccessBookmarkApplicationsDeprecatedListBookmarkApplications(ctx context.Context, identifier interface{}) ([]cloudflare.AccessBookmarkAccessBookmarkApplicationsDeprecatedListBookmarkApplicationsResponse, error) - client.Access.Bookmarks.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.AccessBookmarkGetResponse, error) +- client.Access.Bookmarks.Replace(ctx context.Context, identifier interface{}, uuid string) (cloudflare.AccessBookmarkReplaceResponse, error) ## Keys Response Types: -- cloudflare.AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse -- cloudflare.AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse +- cloudflare.AccessKeyListResponse +- cloudflare.AccessKeyReplaceResponse +- cloudflare.AccessKeyRotateResponse Methods: -- client.Access.Keys.AccessKeyConfigurationGetTheAccessKeyConfiguration(ctx context.Context, identifier string) (cloudflare.AccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse, error) -- client.Access.Keys.AccessKeyConfigurationUpdateTheAccessKeyConfiguration(ctx context.Context, identifier string, body cloudflare.AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationParams) (cloudflare.AccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse, error) - -### Rotates - -Response Types: - -- cloudflare.AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse - -Methods: - -- client.Access.Keys.Rotates.AccessKeyConfigurationRotateAccessKeys(ctx context.Context, identifier string) (cloudflare.AccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse, error) +- client.Access.Keys.List(ctx context.Context, identifier string) (cloudflare.AccessKeyListResponse, error) +- client.Access.Keys.Replace(ctx context.Context, identifier string, body cloudflare.AccessKeyReplaceParams) (cloudflare.AccessKeyReplaceResponse, error) +- client.Access.Keys.Rotate(ctx context.Context, identifier string) (cloudflare.AccessKeyRotateResponse, error) ## Logs @@ -732,21 +680,21 @@ Methods: Response Types: -- cloudflare.AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse +- cloudflare.AccessLogAccessRequestListResponse Methods: -- client.Access.Logs.AccessRequests.AccessAuthenticationLogsGetAccessAuthenticationLogs(ctx context.Context, identifier string) ([]cloudflare.AccessLogAccessRequestAccessAuthenticationLogsGetAccessAuthenticationLogsResponse, error) +- client.Access.Logs.AccessRequests.List(ctx context.Context, identifier string) ([]cloudflare.AccessLogAccessRequestListResponse, error) ## Seats Response Types: -- cloudflare.AccessSeatZeroTrustSeatsUpdateAUserSeatResponse +- cloudflare.AccessSeatUpdateResponse Methods: -- client.Access.Seats.ZeroTrustSeatsUpdateAUserSeat(ctx context.Context, identifier string, body cloudflare.AccessSeatZeroTrustSeatsUpdateAUserSeatParams) ([]cloudflare.AccessSeatZeroTrustSeatsUpdateAUserSeatResponse, error) +- client.Access.Seats.Update(ctx context.Context, identifier string, body cloudflare.AccessSeatUpdateParams) ([]cloudflare.AccessSeatUpdateResponse, error) ## Users @@ -774,49 +722,57 @@ Methods: Response Types: -- cloudflare.AccessUserLastSeenIdentityGetResponse +- cloudflare.AccessUserLastSeenIdentityListResponse Methods: -- client.Access.Users.LastSeenIdentity.Get(ctx context.Context, identifier string, id string) (cloudflare.AccessUserLastSeenIdentityGetResponse, error) +- client.Access.Users.LastSeenIdentity.List(ctx context.Context, identifier string, id string) (cloudflare.AccessUserLastSeenIdentityListResponse, error) ### FailedLogins Response Types: -- cloudflare.AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse +- cloudflare.AccessUserFailedLoginListResponse Methods: -- client.Access.Users.FailedLogins.ZeroTrustUsersGetFailedLogins(ctx context.Context, identifier string, id string) ([]cloudflare.AccessUserFailedLoginZeroTrustUsersGetFailedLoginsResponse, error) +- client.Access.Users.FailedLogins.List(ctx context.Context, identifier string, id string) ([]cloudflare.AccessUserFailedLoginListResponse, error) ## CustomPages Response Types: - cloudflare.AccessCustomPageNewResponse -- cloudflare.AccessCustomPageUpdateResponse - cloudflare.AccessCustomPageListResponse - cloudflare.AccessCustomPageDeleteResponse - cloudflare.AccessCustomPageGetResponse +- cloudflare.AccessCustomPageReplaceResponse Methods: - client.Access.CustomPages.New(ctx context.Context, identifier string, body cloudflare.AccessCustomPageNewParams) (cloudflare.AccessCustomPageNewResponse, error) -- client.Access.CustomPages.Update(ctx context.Context, identifier string, uuid string, body cloudflare.AccessCustomPageUpdateParams) (cloudflare.AccessCustomPageUpdateResponse, error) - client.Access.CustomPages.List(ctx context.Context, identifier string) ([]cloudflare.AccessCustomPageListResponse, error) - client.Access.CustomPages.Delete(ctx context.Context, identifier string, uuid string) (cloudflare.AccessCustomPageDeleteResponse, error) - client.Access.CustomPages.Get(ctx context.Context, identifier string, uuid string) (cloudflare.AccessCustomPageGetResponse, error) +- client.Access.CustomPages.Replace(ctx context.Context, identifier string, uuid string, body cloudflare.AccessCustomPageReplaceParams) (cloudflare.AccessCustomPageReplaceResponse, error) ## Tags Response Types: +- cloudflare.AccessTagNewResponse - cloudflare.AccessTagListResponse +- cloudflare.AccessTagDeleteResponse +- cloudflare.AccessTagGetResponse +- cloudflare.AccessTagReplaceResponse Methods: +- client.Access.Tags.New(ctx context.Context, identifier string, body cloudflare.AccessTagNewParams) (cloudflare.AccessTagNewResponse, error) - client.Access.Tags.List(ctx context.Context, identifier string) ([]cloudflare.AccessTagListResponse, error) +- client.Access.Tags.Delete(ctx context.Context, identifier string, name string) (cloudflare.AccessTagDeleteResponse, error) +- client.Access.Tags.Get(ctx context.Context, identifier string, name string) (cloudflare.AccessTagGetResponse, error) +- client.Access.Tags.Replace(ctx context.Context, identifier string, tagName string, body cloudflare.AccessTagReplaceParams) (cloudflare.AccessTagReplaceResponse, error) # DNSAnalytics @@ -840,177 +796,183 @@ Methods: - client.DNSAnalytics.Reports.Bytimes.List(ctx context.Context, identifier string, query cloudflare.DNSAnalyticReportBytimeListParams) (cloudflare.DNSAnalyticReportBytimeListResponse, error) -# PurgeCaches +# Cache Response Types: -- cloudflare.PurgeCachZonePurgeResponse +- cloudflare.CachePurgeResponse Methods: -- client.PurgeCaches.ZonePurge(ctx context.Context, identifier string, body cloudflare.PurgeCachZonePurgeParams) (cloudflare.PurgeCachZonePurgeResponse, error) - -# SSLs +- client.Cache.Purge(ctx context.Context, identifier string, body cloudflare.CachePurgeParams) (cloudflare.CachePurgeResponse, error) -## Analyzes +## CacheReserves Response Types: -- cloudflare.SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse +- cloudflare.CacheCacheReserveUpdateResponse +- cloudflare.CacheCacheReserveListResponse Methods: -- client.SSLs.Analyzes.AnalyzeCertificateAnalyzeCertificate(ctx context.Context, zoneID string, body cloudflare.SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams) (cloudflare.SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse, error) +- client.Cache.CacheReserves.Update(ctx context.Context, zoneID string, body cloudflare.CacheCacheReserveUpdateParams) (cloudflare.CacheCacheReserveUpdateResponse, error) +- client.Cache.CacheReserves.List(ctx context.Context, zoneID string) (cloudflare.CacheCacheReserveListResponse, error) -## CertificatePacks +## TieredCacheSmartTopology Response Types: -- cloudflare.SSLCertificatePackUpdateResponse -- cloudflare.SSLCertificatePackDeleteResponse -- cloudflare.SSLCertificatePackCertificatePacksListCertificatePacksResponse -- cloudflare.SSLCertificatePackGetResponse +- cloudflare.CacheTieredCacheSmartTopologyUpdateResponse +- cloudflare.CacheTieredCacheSmartTopologyDeleteResponse +- cloudflare.CacheTieredCacheSmartTopologyGetResponse Methods: -- client.SSLs.CertificatePacks.Update(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackUpdateResponse, error) -- client.SSLs.CertificatePacks.Delete(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackDeleteResponse, error) -- client.SSLs.CertificatePacks.CertificatePacksListCertificatePacks(ctx context.Context, zoneID string, query cloudflare.SSLCertificatePackCertificatePacksListCertificatePacksParams) ([]cloudflare.SSLCertificatePackCertificatePacksListCertificatePacksResponse, error) -- client.SSLs.CertificatePacks.Get(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackGetResponse, error) +- client.Cache.TieredCacheSmartTopology.Update(ctx context.Context, zoneID string, body cloudflare.CacheTieredCacheSmartTopologyUpdateParams) (cloudflare.CacheTieredCacheSmartTopologyUpdateResponse, error) +- client.Cache.TieredCacheSmartTopology.Delete(ctx context.Context, zoneID string) (cloudflare.CacheTieredCacheSmartTopologyDeleteResponse, error) +- client.Cache.TieredCacheSmartTopology.Get(ctx context.Context, zoneID string) (cloudflare.CacheTieredCacheSmartTopologyGetResponse, error) -### Orders +## Variants Response Types: -- cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse +- cloudflare.CacheVariantUpdateResponse +- cloudflare.CacheVariantListResponse +- cloudflare.CacheVariantDeleteResponse Methods: -- client.SSLs.CertificatePacks.Orders.CertificatePacksOrderAdvancedCertificateManagerCertificatePack(ctx context.Context, zoneID string, body cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams) (cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, error) +- client.Cache.Variants.Update(ctx context.Context, zoneID string, body cloudflare.CacheVariantUpdateParams) (cloudflare.CacheVariantUpdateResponse, error) +- client.Cache.Variants.List(ctx context.Context, zoneID string) (cloudflare.CacheVariantListResponse, error) +- client.Cache.Variants.Delete(ctx context.Context, zoneID string) (cloudflare.CacheVariantDeleteResponse, error) -### Quotas +## RegionalTieredCache Response Types: -- cloudflare.SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse +- cloudflare.CacheRegionalTieredCacheUpdateResponse +- cloudflare.CacheRegionalTieredCacheGetResponse Methods: -- client.SSLs.CertificatePacks.Quotas.CertificatePacksGetCertificatePackQuotas(ctx context.Context, zoneID string) (cloudflare.SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse, error) +- client.Cache.RegionalTieredCache.Update(ctx context.Context, zoneID string, body cloudflare.CacheRegionalTieredCacheUpdateParams) (cloudflare.CacheRegionalTieredCacheUpdateResponse, error) +- client.Cache.RegionalTieredCache.Get(ctx context.Context, zoneID string) (cloudflare.CacheRegionalTieredCacheGetResponse, error) -## Recommendations +# SSL + +## Analyze Response Types: -- cloudflare.SSLRecommendationListResponse +- cloudflare.SSLAnalyzeNewResponse Methods: -- client.SSLs.Recommendations.List(ctx context.Context, zoneIdentifier string) (cloudflare.SSLRecommendationListResponse, error) - -## Universals +- client.SSL.Analyze.New(ctx context.Context, zoneID string, body cloudflare.SSLAnalyzeNewParams) (cloudflare.SSLAnalyzeNewResponse, error) -### Settings +## CertificatePacks Response Types: -- cloudflare.SSLUniversalSettingUpdateResponse -- cloudflare.SSLUniversalSettingGetResponse +- cloudflare.SSLCertificatePackUpdateResponse +- cloudflare.SSLCertificatePackListResponse +- cloudflare.SSLCertificatePackDeleteResponse +- cloudflare.SSLCertificatePackGetResponse Methods: -- client.SSLs.Universals.Settings.Update(ctx context.Context, zoneID string, body cloudflare.SSLUniversalSettingUpdateParams) (cloudflare.SSLUniversalSettingUpdateResponse, error) -- client.SSLs.Universals.Settings.Get(ctx context.Context, zoneID string) (cloudflare.SSLUniversalSettingGetResponse, error) +- client.SSL.CertificatePacks.Update(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackUpdateResponse, error) +- client.SSL.CertificatePacks.List(ctx context.Context, zoneID string, query cloudflare.SSLCertificatePackListParams) ([]cloudflare.SSLCertificatePackListResponse, error) +- client.SSL.CertificatePacks.Delete(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackDeleteResponse, error) +- client.SSL.CertificatePacks.Get(ctx context.Context, zoneID string, certificatePackID string) (cloudflare.SSLCertificatePackGetResponse, error) -## Verifications +### Order Response Types: -- cloudflare.SSLVerificationUpdateResponse -- cloudflare.SSLVerificationSSLVerificationSSLVerificationDetailsResponse +- cloudflare.SSLCertificatePackOrderNewResponse Methods: -- client.SSLs.Verifications.Update(ctx context.Context, zoneID string, certificatePackID string, body cloudflare.SSLVerificationUpdateParams) (cloudflare.SSLVerificationUpdateResponse, error) -- client.SSLs.Verifications.SSLVerificationSSLVerificationDetails(ctx context.Context, zoneID string, query cloudflare.SSLVerificationSSLVerificationSSLVerificationDetailsParams) ([]cloudflare.SSLVerificationSSLVerificationSSLVerificationDetailsResponse, error) +- client.SSL.CertificatePacks.Order.New(ctx context.Context, zoneID string, body cloudflare.SSLCertificatePackOrderNewParams) (cloudflare.SSLCertificatePackOrderNewResponse, error) -# Subscriptions +### Quota Response Types: -- cloudflare.SubscriptionUpdateResponse -- cloudflare.SubscriptionDeleteResponse -- cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionResponse -- cloudflare.SubscriptionAccountSubscriptionsListSubscriptionsResponse -- cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionResponse -- cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse -- cloudflare.SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse +- cloudflare.SSLCertificatePackQuotaListResponse Methods: -- client.Subscriptions.Update(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body cloudflare.SubscriptionUpdateParams) (cloudflare.SubscriptionUpdateResponse, error) -- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string) (cloudflare.SubscriptionDeleteResponse, error) -- client.Subscriptions.AccountSubscriptionsNewSubscription(ctx context.Context, accountIdentifier string, body cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParams) (cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionResponse, error) -- client.Subscriptions.AccountSubscriptionsListSubscriptions(ctx context.Context, accountIdentifier string) ([]cloudflare.SubscriptionAccountSubscriptionsListSubscriptionsResponse, error) -- client.Subscriptions.ZoneSubscriptionNewZoneSubscription(ctx context.Context, identifier string, body cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParams) (cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionResponse, error) -- client.Subscriptions.ZoneSubscriptionUpdateZoneSubscription(ctx context.Context, identifier string, body cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams) (cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, error) -- client.Subscriptions.ZoneSubscriptionZoneSubscriptionDetails(ctx context.Context, identifier string) (cloudflare.SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, error) - -# Acms +- client.SSL.CertificatePacks.Quota.List(ctx context.Context, zoneID string) (cloudflare.SSLCertificatePackQuotaListResponse, error) -## TotalTLS +## Recommendations Response Types: -- cloudflare.AcmTotalTLSUpdateResponse -- cloudflare.AcmTotalTLSGetResponse +- cloudflare.SSLRecommendationListResponse Methods: -- client.Acms.TotalTLS.Update(ctx context.Context, zoneID string, body cloudflare.AcmTotalTLSUpdateParams) (cloudflare.AcmTotalTLSUpdateResponse, error) -- client.Acms.TotalTLS.Get(ctx context.Context, zoneID string) (cloudflare.AcmTotalTLSGetResponse, error) +- client.SSL.Recommendations.List(ctx context.Context, zoneIdentifier string) (cloudflare.SSLRecommendationListResponse, error) -# Analytics +## Universal -## Colo +### Settings Response Types: -- cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse +- cloudflare.SSLUniversalSettingUpdateResponse +- cloudflare.SSLUniversalSettingGetResponse Methods: -- client.Analytics.Colo.ZoneAnalyticsDeprecatedGetAnalyticsByCoLocations(ctx context.Context, zoneIdentifier string, query cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParams) ([]cloudflare.AnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponse, error) +- client.SSL.Universal.Settings.Update(ctx context.Context, zoneID string, body cloudflare.SSLUniversalSettingUpdateParams) (cloudflare.SSLUniversalSettingUpdateResponse, error) +- client.SSL.Universal.Settings.Get(ctx context.Context, zoneID string) (cloudflare.SSLUniversalSettingGetResponse, error) -## Dashboards +## Verification Response Types: -- cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse +- cloudflare.SSLVerificationUpdateResponse +- cloudflare.SSLVerificationListResponse Methods: -- client.Analytics.Dashboards.ZoneAnalyticsDeprecatedGetDashboard(ctx context.Context, zoneIdentifier string, query cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParams) (cloudflare.AnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponse, error) +- client.SSL.Verification.Update(ctx context.Context, zoneID string, certificatePackID string, body cloudflare.SSLVerificationUpdateParams) (cloudflare.SSLVerificationUpdateResponse, error) +- client.SSL.Verification.List(ctx context.Context, zoneID string, query cloudflare.SSLVerificationListParams) ([]cloudflare.SSLVerificationListResponse, error) -## Latencies +# Subscriptions Response Types: -- cloudflare.AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse +- cloudflare.SubscriptionNewResponse +- cloudflare.SubscriptionListResponse +- cloudflare.SubscriptionDeleteResponse +- cloudflare.SubscriptionGetResponse +- cloudflare.SubscriptionReplaceResponse Methods: -- client.Analytics.Latencies.ArgoAnalyticsForZoneArgoAnalyticsForAZone(ctx context.Context, zoneID string, query cloudflare.AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneParams) (cloudflare.AnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse, error) +- client.Subscriptions.New(ctx context.Context, identifier string, body cloudflare.SubscriptionNewParams) (cloudflare.SubscriptionNewResponse, error) +- client.Subscriptions.List(ctx context.Context, accountIdentifier string) ([]cloudflare.SubscriptionListResponse, error) +- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string) (cloudflare.SubscriptionDeleteResponse, error) +- client.Subscriptions.Get(ctx context.Context, identifier string) (cloudflare.SubscriptionGetResponse, error) +- client.Subscriptions.Replace(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body cloudflare.SubscriptionReplaceParams) (cloudflare.SubscriptionReplaceResponse, error) -### Colos +# Acm + +## TotalTLS Response Types: -- cloudflare.AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse +- cloudflare.AcmTotalTLSNewResponse +- cloudflare.AcmTotalTLSGetResponse Methods: -- client.Analytics.Latencies.Colos.ArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPs(ctx context.Context, zoneID string) (cloudflare.AnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse, error) +- client.Acm.TotalTLS.New(ctx context.Context, zoneID string, body cloudflare.AcmTotalTLSNewParams) (cloudflare.AcmTotalTLSNewResponse, error) +- client.Acm.TotalTLS.Get(ctx context.Context, zoneID string) (cloudflare.AcmTotalTLSGetResponse, error) # Argo @@ -1030,13 +992,13 @@ Methods: Response Types: -- cloudflare.ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse -- cloudflare.ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse +- cloudflare.ArgoTieredCachingUpdateResponse +- cloudflare.ArgoTieredCachingGetResponse Methods: -- client.Argo.TieredCaching.TieredCachingGetTieredCachingSetting(ctx context.Context, zoneID string) (cloudflare.ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse, error) -- client.Argo.TieredCaching.TieredCachingPatchTieredCachingSetting(ctx context.Context, zoneID string, body cloudflare.ArgoTieredCachingTieredCachingPatchTieredCachingSettingParams) (cloudflare.ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse, error) +- client.Argo.TieredCaching.Update(ctx context.Context, zoneID string, body cloudflare.ArgoTieredCachingUpdateParams) (cloudflare.ArgoTieredCachingUpdateResponse, error) +- client.Argo.TieredCaching.Get(ctx context.Context, zoneID string) (cloudflare.ArgoTieredCachingGetResponse, error) # AvailablePlans @@ -1054,53 +1016,11 @@ Methods: Response Types: -- cloudflare.AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse - -Methods: - -- client.AvailableRatePlans.ZoneRatePlanListAvailableRatePlans(ctx context.Context, zoneIdentifier string) ([]cloudflare.AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse, error) - -# Caches - -## CacheReserves - -Response Types: - -- cloudflare.CachCacheReserveListResponse -- cloudflare.CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse - -Methods: - -- client.Caches.CacheReserves.List(ctx context.Context, zoneID string) (cloudflare.CachCacheReserveListResponse, error) -- client.Caches.CacheReserves.ZoneCacheSettingsChangeCacheReserveSetting(ctx context.Context, zoneID string, body cloudflare.CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParams) (cloudflare.CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse, error) - -## TieredCacheSmartTopologyEnables - -Response Types: - -- cloudflare.CachTieredCacheSmartTopologyEnableDeleteResponse -- cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse -- cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse - -Methods: - -- client.Caches.TieredCacheSmartTopologyEnables.Delete(ctx context.Context, zoneID string) (cloudflare.CachTieredCacheSmartTopologyEnableDeleteResponse, error) -- client.Caches.TieredCacheSmartTopologyEnables.SmartTieredCacheGetSmartTieredCacheSetting(ctx context.Context, zoneID string) (cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse, error) -- client.Caches.TieredCacheSmartTopologyEnables.SmartTieredCachePatchSmartTieredCacheSetting(ctx context.Context, zoneID string, body cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParams) (cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse, error) - -## Variants - -Response Types: - -- cloudflare.CachVariantListResponse -- cloudflare.CachVariantDeleteResponse -- cloudflare.CachVariantZoneCacheSettingsChangeVariantsSettingResponse +- cloudflare.AvailableRatePlanListResponse Methods: -- client.Caches.Variants.List(ctx context.Context, zoneID string) (cloudflare.CachVariantListResponse, error) -- client.Caches.Variants.Delete(ctx context.Context, zoneID string) (cloudflare.CachVariantDeleteResponse, error) -- client.Caches.Variants.ZoneCacheSettingsChangeVariantsSetting(ctx context.Context, zoneID string, body cloudflare.CachVariantZoneCacheSettingsChangeVariantsSettingParams) (cloudflare.CachVariantZoneCacheSettingsChangeVariantsSettingResponse, error) +- client.AvailableRatePlans.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.AvailableRatePlanListResponse, error) # CertificateAuthorities @@ -1108,30 +1028,30 @@ Methods: Response Types: -- cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse -- cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse +- cloudflare.CertificateAuthorityHostnameAssociationListResponse +- cloudflare.CertificateAuthorityHostnameAssociationReplaceResponse Methods: -- client.CertificateAuthorities.HostnameAssociations.ClientCertificateForAZoneListHostnameAssociations(ctx context.Context, zoneID string, query cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams) (cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse, error) -- client.CertificateAuthorities.HostnameAssociations.ClientCertificateForAZonePutHostnameAssociations(ctx context.Context, zoneID string, body cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsParams) (cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse, error) +- client.CertificateAuthorities.HostnameAssociations.List(ctx context.Context, zoneID string, query cloudflare.CertificateAuthorityHostnameAssociationListParams) (cloudflare.CertificateAuthorityHostnameAssociationListResponse, error) +- client.CertificateAuthorities.HostnameAssociations.Replace(ctx context.Context, zoneID string, body cloudflare.CertificateAuthorityHostnameAssociationReplaceParams) (cloudflare.CertificateAuthorityHostnameAssociationReplaceResponse, error) # ClientCertificates Response Types: +- cloudflare.ClientCertificateNewResponse - cloudflare.ClientCertificateUpdateResponse +- cloudflare.ClientCertificateListResponse - cloudflare.ClientCertificateDeleteResponse -- cloudflare.ClientCertificateClientCertificateForAZoneNewClientCertificateResponse -- cloudflare.ClientCertificateClientCertificateForAZoneListClientCertificatesResponse - cloudflare.ClientCertificateGetResponse Methods: +- client.ClientCertificates.New(ctx context.Context, zoneID string, body cloudflare.ClientCertificateNewParams) (cloudflare.ClientCertificateNewResponse, error) - client.ClientCertificates.Update(ctx context.Context, zoneID string, clientCertificateID string) (cloudflare.ClientCertificateUpdateResponse, error) +- client.ClientCertificates.List(ctx context.Context, zoneID string, query cloudflare.ClientCertificateListParams) (shared.V4PagePaginationArray[cloudflare.ClientCertificateListResponse], error) - client.ClientCertificates.Delete(ctx context.Context, zoneID string, clientCertificateID string) (cloudflare.ClientCertificateDeleteResponse, error) -- client.ClientCertificates.ClientCertificateForAZoneNewClientCertificate(ctx context.Context, zoneID string, body cloudflare.ClientCertificateClientCertificateForAZoneNewClientCertificateParams) (cloudflare.ClientCertificateClientCertificateForAZoneNewClientCertificateResponse, error) -- client.ClientCertificates.ClientCertificateForAZoneListClientCertificates(ctx context.Context, zoneID string, query cloudflare.ClientCertificateClientCertificateForAZoneListClientCertificatesParams) ([]cloudflare.ClientCertificateClientCertificateForAZoneListClientCertificatesResponse, error) - client.ClientCertificates.Get(ctx context.Context, zoneID string, clientCertificateID string) (cloudflare.ClientCertificateGetResponse, error) # CustomCertificates @@ -1152,220 +1072,207 @@ Methods: - client.CustomCertificates.Delete(ctx context.Context, zoneID string, customCertificateID string) (cloudflare.CustomCertificateDeleteResponse, error) - client.CustomCertificates.Get(ctx context.Context, zoneID string, customCertificateID string) (cloudflare.CustomCertificateGetResponse, error) -## Prioritizes +## Prioritize Response Types: -- cloudflare.CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse +- cloudflare.CustomCertificatePrioritizeReplaceResponse Methods: -- client.CustomCertificates.Prioritizes.CustomSSLForAZoneRePrioritizeSSLCertificates(ctx context.Context, zoneID string, body cloudflare.CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParams) ([]cloudflare.CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse, error) +- client.CustomCertificates.Prioritize.Replace(ctx context.Context, zoneID string, body cloudflare.CustomCertificatePrioritizeReplaceParams) ([]cloudflare.CustomCertificatePrioritizeReplaceResponse, error) # CustomHostnames Response Types: +- cloudflare.CustomHostnameNewResponse - cloudflare.CustomHostnameUpdateResponse +- cloudflare.CustomHostnameListResponse - cloudflare.CustomHostnameDeleteResponse -- cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse -- cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse - cloudflare.CustomHostnameGetResponse Methods: +- client.CustomHostnames.New(ctx context.Context, zoneID string, body cloudflare.CustomHostnameNewParams) (cloudflare.CustomHostnameNewResponse, error) - client.CustomHostnames.Update(ctx context.Context, zoneID string, customHostnameID string, body cloudflare.CustomHostnameUpdateParams) (cloudflare.CustomHostnameUpdateResponse, error) +- client.CustomHostnames.List(ctx context.Context, zoneID string, query cloudflare.CustomHostnameListParams) (shared.V4PagePaginationArray[cloudflare.CustomHostnameListResponse], error) - client.CustomHostnames.Delete(ctx context.Context, zoneID string, customHostnameID string) (cloudflare.CustomHostnameDeleteResponse, error) -- client.CustomHostnames.CustomHostnameForAZoneNewCustomHostname(ctx context.Context, zoneID string, body cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParams) (cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse, error) -- client.CustomHostnames.CustomHostnameForAZoneListCustomHostnames(ctx context.Context, zoneID string, query cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams) ([]cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse, error) - client.CustomHostnames.Get(ctx context.Context, zoneID string, customHostnameID string) (cloudflare.CustomHostnameGetResponse, error) -## FallbackOrigins +## FallbackOrigin Response Types: -- cloudflare.CustomHostnameFallbackOriginUpdateResponse - cloudflare.CustomHostnameFallbackOriginDeleteResponse - cloudflare.CustomHostnameFallbackOriginGetResponse +- cloudflare.CustomHostnameFallbackOriginReplaceResponse Methods: -- client.CustomHostnames.FallbackOrigins.Update(ctx context.Context, zoneID string, body cloudflare.CustomHostnameFallbackOriginUpdateParams) (cloudflare.CustomHostnameFallbackOriginUpdateResponse, error) -- client.CustomHostnames.FallbackOrigins.Delete(ctx context.Context, zoneID string) (cloudflare.CustomHostnameFallbackOriginDeleteResponse, error) -- client.CustomHostnames.FallbackOrigins.Get(ctx context.Context, zoneID string) (cloudflare.CustomHostnameFallbackOriginGetResponse, error) - -# CustomNs - -Response Types: - -- cloudflare.CustomNNewResponse -- cloudflare.CustomNListResponse -- cloudflare.CustomNDeleteResponse - -Methods: - -- client.CustomNs.New(ctx context.Context, accountID string, body cloudflare.CustomNNewParams) (cloudflare.CustomNNewResponse, error) -- client.CustomNs.List(ctx context.Context, accountID string) ([]cloudflare.CustomNListResponse, error) -- client.CustomNs.Delete(ctx context.Context, accountID string, customNsID string) (cloudflare.CustomNDeleteResponse, error) - -## Availabilities - -Methods: - -- client.CustomNs.Availabilities.Get(ctx context.Context, accountID string) ([]string, error) +- client.CustomHostnames.FallbackOrigin.Delete(ctx context.Context, zoneID string) (cloudflare.CustomHostnameFallbackOriginDeleteResponse, error) +- client.CustomHostnames.FallbackOrigin.Get(ctx context.Context, zoneID string) (cloudflare.CustomHostnameFallbackOriginGetResponse, error) +- client.CustomHostnames.FallbackOrigin.Replace(ctx context.Context, zoneID string, body cloudflare.CustomHostnameFallbackOriginReplaceParams) (cloudflare.CustomHostnameFallbackOriginReplaceResponse, error) -## Verifies +# CustomNameservers Response Types: -- cloudflare.CustomNVerifyUpdateResponse +- cloudflare.CustomNameserverNewResponse +- cloudflare.CustomNameserverListResponse +- cloudflare.CustomNameserverDeleteResponse +- cloudflare.CustomNameserverVerifyResponse Methods: -- client.CustomNs.Verifies.Update(ctx context.Context, accountID string) ([]cloudflare.CustomNVerifyUpdateResponse, error) +- client.CustomNameservers.New(ctx context.Context, accountID string, body cloudflare.CustomNameserverNewParams) (cloudflare.CustomNameserverNewResponse, error) +- client.CustomNameservers.List(ctx context.Context, accountID string) ([]cloudflare.CustomNameserverListResponse, error) +- client.CustomNameservers.Delete(ctx context.Context, accountID string, customNsID string) (cloudflare.CustomNameserverDeleteResponse, error) +- client.CustomNameservers.Availabilty(ctx context.Context, accountID string) ([]string, error) +- client.CustomNameservers.Verify(ctx context.Context, accountID string) ([]cloudflare.CustomNameserverVerifyResponse, error) # DNSRecords Response Types: - cloudflare.DNSRecordNewResponse -- cloudflare.DNSRecordUpdateResponse - cloudflare.DNSRecordListResponse - cloudflare.DNSRecordDeleteResponse - cloudflare.DNSRecordGetResponse - cloudflare.DNSRecordImportResponse +- cloudflare.DNSRecordReplaceResponse - cloudflare.DNSRecordScanResponse Methods: - client.DNSRecords.New(ctx context.Context, zoneID string, body cloudflare.DNSRecordNewParams) (cloudflare.DNSRecordNewResponse, error) -- client.DNSRecords.Update(ctx context.Context, zoneID string, dnsRecordID string, body cloudflare.DNSRecordUpdateParams) (cloudflare.DNSRecordUpdateResponse, error) - client.DNSRecords.List(ctx context.Context, zoneID string, query cloudflare.DNSRecordListParams) (shared.V4PagePaginationArray[cloudflare.DNSRecordListResponse], error) - client.DNSRecords.Delete(ctx context.Context, zoneID string, dnsRecordID string) (cloudflare.DNSRecordDeleteResponse, error) - client.DNSRecords.Export(ctx context.Context, zoneID string) (string, error) - client.DNSRecords.Get(ctx context.Context, zoneID string, dnsRecordID string) (cloudflare.DNSRecordGetResponse, error) - client.DNSRecords.Import(ctx context.Context, zoneID string, body cloudflare.DNSRecordImportParams) (cloudflare.DNSRecordImportResponse, error) +- client.DNSRecords.Replace(ctx context.Context, zoneID string, dnsRecordID string, body cloudflare.DNSRecordReplaceParams) (cloudflare.DNSRecordReplaceResponse, error) - client.DNSRecords.Scan(ctx context.Context, zoneID string) (cloudflare.DNSRecordScanResponse, error) -# DNSSECs +# DNSSEC Response Types: - cloudflare.DNSSECUpdateResponse +- cloudflare.DNSSECDeleteResponse - cloudflare.DNSSECGetResponse Methods: -- client.DNSSECs.Update(ctx context.Context, zoneID string, body cloudflare.DNSSECUpdateParams) (cloudflare.DNSSECUpdateResponse, error) -- client.DNSSECs.Get(ctx context.Context, zoneID string) (cloudflare.DNSSECGetResponse, error) +- client.DNSSEC.Update(ctx context.Context, zoneID string, body cloudflare.DNSSECUpdateParams) (cloudflare.DNSSECUpdateResponse, error) +- client.DNSSEC.Delete(ctx context.Context, zoneID string) (cloudflare.DNSSECDeleteResponse, error) +- client.DNSSEC.Get(ctx context.Context, zoneID string) (cloudflare.DNSSECGetResponse, error) # Emails -## Routings +## Routing Response Types: -- cloudflare.EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse +- cloudflare.EmailRoutingGetResponse Methods: -- client.Emails.Routings.EmailRoutingSettingsGetEmailRoutingSettings(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse, error) +- client.Emails.Routing.Get(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingGetResponse, error) ### Disables Response Types: -- cloudflare.EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse +- cloudflare.EmailRoutingDisableNewResponse Methods: -- client.Emails.Routings.Disables.EmailRoutingSettingsDisableEmailRouting(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse, error) +- client.Emails.Routing.Disables.New(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingDisableNewResponse, error) ### DNS Response Types: -- cloudflare.EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse +- cloudflare.EmailRoutingDNSGetResponse Methods: -- client.Emails.Routings.DNS.EmailRoutingSettingsEmailRoutingDNSSettings(ctx context.Context, zoneIdentifier string) ([]cloudflare.EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse, error) +- client.Emails.Routing.DNS.Get(ctx context.Context, zoneIdentifier string) ([]cloudflare.EmailRoutingDNSGetResponse, error) ### Enables Response Types: -- cloudflare.EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse +- cloudflare.EmailRoutingEnableNewResponse Methods: -- client.Emails.Routings.Enables.EmailRoutingSettingsEnableEmailRouting(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse, error) +- client.Emails.Routing.Enables.New(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingEnableNewResponse, error) ### Rules Response Types: -- cloudflare.EmailRoutingRuleUpdateResponse +- cloudflare.EmailRoutingRuleNewResponse +- cloudflare.EmailRoutingRuleListResponse - cloudflare.EmailRoutingRuleDeleteResponse -- cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse -- cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse - cloudflare.EmailRoutingRuleGetResponse +- cloudflare.EmailRoutingRuleReplaceResponse Methods: -- client.Emails.Routings.Rules.Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body cloudflare.EmailRoutingRuleUpdateParams) (cloudflare.EmailRoutingRuleUpdateResponse, error) -- client.Emails.Routings.Rules.Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRuleDeleteResponse, error) -- client.Emails.Routings.Rules.EmailRoutingRoutingRulesNewRoutingRule(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParams) (cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse, error) -- client.Emails.Routings.Rules.EmailRoutingRoutingRulesListRoutingRules(ctx context.Context, zoneIdentifier string, query cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams) ([]cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse, error) -- client.Emails.Routings.Rules.Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRuleGetResponse, error) +- client.Emails.Routing.Rules.New(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRuleNewParams) (cloudflare.EmailRoutingRuleNewResponse, error) +- client.Emails.Routing.Rules.List(ctx context.Context, zoneIdentifier string, query cloudflare.EmailRoutingRuleListParams) (shared.V4PagePaginationArray[cloudflare.EmailRoutingRuleListResponse], error) +- client.Emails.Routing.Rules.Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRuleDeleteResponse, error) +- client.Emails.Routing.Rules.Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRuleGetResponse, error) +- client.Emails.Routing.Rules.Replace(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body cloudflare.EmailRoutingRuleReplaceParams) (cloudflare.EmailRoutingRuleReplaceResponse, error) #### CatchAlls Response Types: -- cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse -- cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse +- cloudflare.EmailRoutingRuleCatchAllGetResponse +- cloudflare.EmailRoutingRuleCatchAllReplaceResponse Methods: -- client.Emails.Routings.Rules.CatchAlls.EmailRoutingRoutingRulesGetCatchAllRule(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse, error) -- client.Emails.Routings.Rules.CatchAlls.EmailRoutingRoutingRulesUpdateCatchAllRule(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParams) (cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse, error) +- client.Emails.Routing.Rules.CatchAlls.Get(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRuleCatchAllGetResponse, error) +- client.Emails.Routing.Rules.CatchAlls.Replace(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRuleCatchAllReplaceParams) (cloudflare.EmailRoutingRuleCatchAllReplaceResponse, error) ### Addresses Response Types: +- cloudflare.EmailRoutingAddressNewResponse - cloudflare.EmailRoutingAddressDeleteResponse -- cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse - cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesResponse - cloudflare.EmailRoutingAddressGetResponse Methods: -- client.Emails.Routings.Addresses.Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingAddressDeleteResponse, error) -- client.Emails.Routings.Addresses.EmailRoutingDestinationAddressesNewADestinationAddress(ctx context.Context, accountIdentifier string, body cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressParams) (cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse, error) -- client.Emails.Routings.Addresses.EmailRoutingDestinationAddressesListDestinationAddresses(ctx context.Context, accountIdentifier string, query cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesParams) ([]cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, error) -- client.Emails.Routings.Addresses.Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingAddressGetResponse, error) +- client.Emails.Routing.Addresses.New(ctx context.Context, accountIdentifier string, body cloudflare.EmailRoutingAddressNewParams) (cloudflare.EmailRoutingAddressNewResponse, error) +- client.Emails.Routing.Addresses.Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingAddressDeleteResponse, error) +- client.Emails.Routing.Addresses.EmailRoutingDestinationAddressesListDestinationAddresses(ctx context.Context, accountIdentifier string, query cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesParams) ([]cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, error) +- client.Emails.Routing.Addresses.Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingAddressGetResponse, error) # Filters Response Types: -- cloudflare.FilterUpdateResponse +- cloudflare.FilterNewResponse +- cloudflare.FilterListResponse - cloudflare.FilterDeleteResponse -- cloudflare.FilterFiltersNewFiltersResponse -- cloudflare.FilterFiltersListFiltersResponse -- cloudflare.FilterFiltersUpdateFiltersResponse - cloudflare.FilterGetResponse +- cloudflare.FilterReplaceResponse Methods: -- client.Filters.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FilterUpdateParams) (cloudflare.FilterUpdateResponse, error) +- client.Filters.New(ctx context.Context, zoneIdentifier string, body cloudflare.FilterNewParams) ([]cloudflare.FilterNewResponse, error) +- client.Filters.List(ctx context.Context, zoneIdentifier string, query cloudflare.FilterListParams) (shared.V4PagePaginationArray[cloudflare.FilterListResponse], error) - client.Filters.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FilterDeleteResponse, error) -- client.Filters.FiltersNewFilters(ctx context.Context, zoneIdentifier string, body cloudflare.FilterFiltersNewFiltersParams) ([]cloudflare.FilterFiltersNewFiltersResponse, error) -- client.Filters.FiltersListFilters(ctx context.Context, zoneIdentifier string, query cloudflare.FilterFiltersListFiltersParams) ([]cloudflare.FilterFiltersListFiltersResponse, error) -- client.Filters.FiltersUpdateFilters(ctx context.Context, zoneIdentifier string, body cloudflare.FilterFiltersUpdateFiltersParams) ([]cloudflare.FilterFiltersUpdateFiltersResponse, error) - client.Filters.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FilterGetResponse, error) +- client.Filters.Replace(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FilterReplaceParams) (cloudflare.FilterReplaceResponse, error) # Firewalls @@ -1373,41 +1280,39 @@ Methods: Response Types: -- cloudflare.FirewallLockdownUpdateResponse +- cloudflare.FirewallLockdownNewResponse +- cloudflare.FirewallLockdownListResponse - cloudflare.FirewallLockdownDeleteResponse - cloudflare.FirewallLockdownGetResponse -- cloudflare.FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse -- cloudflare.FirewallLockdownZoneLockdownListZoneLockdownRulesResponse +- cloudflare.FirewallLockdownReplaceResponse Methods: -- client.Firewalls.Lockdowns.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallLockdownUpdateParams) (cloudflare.FirewallLockdownUpdateResponse, error) +- client.Firewalls.Lockdowns.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallLockdownNewParams) (cloudflare.FirewallLockdownNewResponse, error) +- client.Firewalls.Lockdowns.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallLockdownListParams) (shared.V4PagePaginationArray[cloudflare.FirewallLockdownListResponse], error) - client.Firewalls.Lockdowns.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallLockdownDeleteResponse, error) - client.Firewalls.Lockdowns.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallLockdownGetResponse, error) -- client.Firewalls.Lockdowns.ZoneLockdownNewAZoneLockdownRule(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallLockdownZoneLockdownNewAZoneLockdownRuleParams) (cloudflare.FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse, error) -- client.Firewalls.Lockdowns.ZoneLockdownListZoneLockdownRules(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallLockdownZoneLockdownListZoneLockdownRulesParams) ([]cloudflare.FirewallLockdownZoneLockdownListZoneLockdownRulesResponse, error) +- client.Firewalls.Lockdowns.Replace(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallLockdownReplaceParams) (cloudflare.FirewallLockdownReplaceResponse, error) ## Rules Response Types: +- cloudflare.FirewallRuleNewResponse - cloudflare.FirewallRuleUpdateResponse +- cloudflare.FirewallRuleListResponse - cloudflare.FirewallRuleDeleteResponse -- cloudflare.FirewallRuleFirewallRulesNewFirewallRulesResponse -- cloudflare.FirewallRuleFirewallRulesListFirewallRulesResponse -- cloudflare.FirewallRuleFirewallRulesUpdateFirewallRulesResponse -- cloudflare.FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse - cloudflare.FirewallRuleGetResponse +- cloudflare.FirewallRuleReplaceResponse Methods: -- client.Firewalls.Rules.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleUpdateParams) (cloudflare.FirewallRuleUpdateResponse, error) +- client.Firewalls.Rules.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleNewParams) ([]cloudflare.FirewallRuleNewResponse, error) +- client.Firewalls.Rules.Update(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleUpdateParams) ([]cloudflare.FirewallRuleUpdateResponse, error) +- client.Firewalls.Rules.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallRuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallRuleListResponse], error) - client.Firewalls.Rules.Delete(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleDeleteParams) (cloudflare.FirewallRuleDeleteResponse, error) -- client.Firewalls.Rules.FirewallRulesNewFirewallRules(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleFirewallRulesNewFirewallRulesParams) ([]cloudflare.FirewallRuleFirewallRulesNewFirewallRulesResponse, error) -- client.Firewalls.Rules.FirewallRulesListFirewallRules(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallRuleFirewallRulesListFirewallRulesParams) ([]cloudflare.FirewallRuleFirewallRulesListFirewallRulesResponse, error) -- client.Firewalls.Rules.FirewallRulesUpdateFirewallRules(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleFirewallRulesUpdateFirewallRulesParams) ([]cloudflare.FirewallRuleFirewallRulesUpdateFirewallRulesResponse, error) -- client.Firewalls.Rules.FirewallRulesUpdatePriorityOfFirewallRules(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesParams) ([]cloudflare.FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse, error) - client.Firewalls.Rules.Get(ctx context.Context, zoneIdentifier string, id string, query cloudflare.FirewallRuleGetParams) (cloudflare.FirewallRuleGetResponse, error) +- client.Firewalls.Rules.Replace(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleReplaceParams) (cloudflare.FirewallRuleReplaceResponse, error) ## AccessRules @@ -1431,19 +1336,19 @@ Methods: Response Types: -- cloudflare.FirewallUaRuleUpdateResponse +- cloudflare.FirewallUaRuleNewResponse +- cloudflare.FirewallUaRuleListResponse - cloudflare.FirewallUaRuleDeleteResponse - cloudflare.FirewallUaRuleGetResponse -- cloudflare.FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse -- cloudflare.FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse +- cloudflare.FirewallUaRuleReplaceResponse Methods: -- client.Firewalls.UaRules.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallUaRuleUpdateParams) (cloudflare.FirewallUaRuleUpdateResponse, error) +- client.Firewalls.UaRules.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallUaRuleNewParams) (cloudflare.FirewallUaRuleNewResponse, error) +- client.Firewalls.UaRules.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallUaRuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallUaRuleListResponse], error) - client.Firewalls.UaRules.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallUaRuleDeleteResponse, error) - client.Firewalls.UaRules.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallUaRuleGetResponse, error) -- client.Firewalls.UaRules.UserAgentBlockingRulesNewAUserAgentBlockingRule(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleParams) (cloudflare.FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse, error) -- client.Firewalls.UaRules.UserAgentBlockingRulesListUserAgentBlockingRules(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams) ([]cloudflare.FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse, error) +- client.Firewalls.UaRules.Replace(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallUaRuleReplaceParams) (cloudflare.FirewallUaRuleReplaceResponse, error) ## WAF @@ -1451,19 +1356,19 @@ Methods: Response Types: -- cloudflare.FirewallWAFOverrideUpdateResponse +- cloudflare.FirewallWAFOverrideNewResponse +- cloudflare.FirewallWAFOverrideListResponse - cloudflare.FirewallWAFOverrideDeleteResponse - cloudflare.FirewallWAFOverrideGetResponse -- cloudflare.FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse -- cloudflare.FirewallWAFOverrideWAFOverridesListWAFOverridesResponse +- cloudflare.FirewallWAFOverrideReplaceResponse Methods: -- client.Firewalls.WAF.Overrides.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallWAFOverrideUpdateParams) (cloudflare.FirewallWAFOverrideUpdateResponse, error) +- client.Firewalls.WAF.Overrides.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallWAFOverrideNewParams) (cloudflare.FirewallWAFOverrideNewResponse, error) +- client.Firewalls.WAF.Overrides.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallWAFOverrideListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFOverrideListResponse], error) - client.Firewalls.WAF.Overrides.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallWAFOverrideDeleteResponse, error) - client.Firewalls.WAF.Overrides.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallWAFOverrideGetResponse, error) -- client.Firewalls.WAF.Overrides.WAFOverridesNewAWAFOverride(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallWAFOverrideWAFOverridesNewAWAFOverrideParams) (cloudflare.FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse, error) -- client.Firewalls.WAF.Overrides.WAFOverridesListWAFOverrides(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallWAFOverrideWAFOverridesListWAFOverridesParams) ([]cloudflare.FirewallWAFOverrideWAFOverridesListWAFOverridesResponse, error) +- client.Firewalls.WAF.Overrides.Replace(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallWAFOverrideReplaceParams) (cloudflare.FirewallWAFOverrideReplaceResponse, error) ### Packages @@ -1482,14 +1387,14 @@ Methods: Response Types: - cloudflare.FirewallWAFPackageGroupUpdateResponse +- cloudflare.FirewallWAFPackageGroupListResponse - cloudflare.FirewallWAFPackageGroupGetResponse -- cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse Methods: - client.Firewalls.WAF.Packages.Groups.Update(ctx context.Context, zoneID string, packageID string, groupID string, body cloudflare.FirewallWAFPackageGroupUpdateParams) (cloudflare.FirewallWAFPackageGroupUpdateResponse, error) +- client.Firewalls.WAF.Packages.Groups.List(ctx context.Context, zoneID string, packageID string, query cloudflare.FirewallWAFPackageGroupListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFPackageGroupListResponse], error) - client.Firewalls.WAF.Packages.Groups.Get(ctx context.Context, zoneID string, packageID string, groupID string) (cloudflare.FirewallWAFPackageGroupGetResponse, error) -- client.Firewalls.WAF.Packages.Groups.WAFRuleGroupsListWAFRuleGroups(ctx context.Context, zoneID string, packageID string, query cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams) ([]cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse, error) #### Rules @@ -1509,33 +1414,33 @@ Methods: Response Types: -- cloudflare.HealthcheckUpdateResponse +- cloudflare.HealthcheckNewResponse +- cloudflare.HealthcheckListResponse - cloudflare.HealthcheckDeleteResponse - cloudflare.HealthcheckGetResponse -- cloudflare.HealthcheckHealthChecksNewHealthCheckResponse -- cloudflare.HealthcheckHealthChecksListHealthChecksResponse +- cloudflare.HealthcheckReplaceResponse Methods: -- client.Healthchecks.Update(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.HealthcheckUpdateParams) (cloudflare.HealthcheckUpdateResponse, error) +- client.Healthchecks.New(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckNewParams) (cloudflare.HealthcheckNewResponse, error) +- client.Healthchecks.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.HealthcheckListResponse, error) - client.Healthchecks.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckDeleteResponse, error) - client.Healthchecks.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckGetResponse, error) -- client.Healthchecks.HealthChecksNewHealthCheck(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckHealthChecksNewHealthCheckParams) (cloudflare.HealthcheckHealthChecksNewHealthCheckResponse, error) -- client.Healthchecks.HealthChecksListHealthChecks(ctx context.Context, zoneIdentifier string) ([]cloudflare.HealthcheckHealthChecksListHealthChecksResponse, error) +- client.Healthchecks.Replace(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.HealthcheckReplaceParams) (cloudflare.HealthcheckReplaceResponse, error) ## Previews Response Types: +- cloudflare.HealthcheckPreviewNewResponse - cloudflare.HealthcheckPreviewDeleteResponse - cloudflare.HealthcheckPreviewGetResponse -- cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse Methods: +- client.Healthchecks.Previews.New(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckPreviewNewParams) (cloudflare.HealthcheckPreviewNewResponse, error) - client.Healthchecks.Previews.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckPreviewDeleteResponse, error) - client.Healthchecks.Previews.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckPreviewGetResponse, error) -- client.Healthchecks.Previews.HealthChecksNewPreviewHealthCheck(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParams) (cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse, error) # KeylessCertificates @@ -1579,79 +1484,59 @@ Methods: - client.Logpush.Datasets.Jobs.List(ctx context.Context, accountOrZone string, accountOrZoneID string, datasetID string) ([]cloudflare.LogpushDatasetJobListResponse, error) -## Edges +## Edge Response Types: -- cloudflare.LogpushEdgeUpdateResponse +- cloudflare.LogpushEdgeNewResponse - cloudflare.LogpushEdgeGetResponse Methods: -- client.Logpush.Edges.Update(ctx context.Context, zoneID string, body cloudflare.LogpushEdgeUpdateParams) (cloudflare.LogpushEdgeUpdateResponse, error) -- client.Logpush.Edges.Get(ctx context.Context, zoneID string) ([]cloudflare.LogpushEdgeGetResponse, error) +- client.Logpush.Edge.New(ctx context.Context, zoneID string, body cloudflare.LogpushEdgeNewParams) (cloudflare.LogpushEdgeNewResponse, error) +- client.Logpush.Edge.Get(ctx context.Context, zoneID string) ([]cloudflare.LogpushEdgeGetResponse, error) ## Jobs Response Types: - cloudflare.LogpushJobNewResponse -- cloudflare.LogpushJobUpdateResponse - cloudflare.LogpushJobListResponse - cloudflare.LogpushJobDeleteResponse - cloudflare.LogpushJobGetResponse +- cloudflare.LogpushJobReplaceResponse Methods: - client.Logpush.Jobs.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushJobNewParams) (cloudflare.LogpushJobNewResponse, error) -- client.Logpush.Jobs.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64, body cloudflare.LogpushJobUpdateParams) (cloudflare.LogpushJobUpdateResponse, error) - client.Logpush.Jobs.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.LogpushJobListResponse, error) - client.Logpush.Jobs.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64) (cloudflare.LogpushJobDeleteResponse, error) - client.Logpush.Jobs.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64) (cloudflare.LogpushJobGetResponse, error) +- client.Logpush.Jobs.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64, body cloudflare.LogpushJobReplaceParams) (cloudflare.LogpushJobReplaceResponse, error) -## Ownerships - -Response Types: - -- cloudflare.LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse - -Methods: - -- client.Logpush.Ownerships.PostAccountsAccountIdentifierLogpushOwnership(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipParams) (cloudflare.LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse, error) - -### Validates - -Response Types: - -- cloudflare.LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse - -Methods: - -- client.Logpush.Ownerships.Validates.PostAccountsAccountIdentifierLogpushOwnershipValidate(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateParams) (cloudflare.LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse, error) - -## Validates - -### Destinations - -#### Exists +## Ownership Response Types: -- cloudflare.LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse +- cloudflare.LogpushOwnershipNewResponse +- cloudflare.LogpushOwnershipValidateResponse Methods: -- client.Logpush.Validates.Destinations.Exists.DeleteAccountsAccountIdentifierLogpushValidateDestinationExists(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsParams) (cloudflare.LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse, error) +- client.Logpush.Ownership.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushOwnershipNewParams) (cloudflare.LogpushOwnershipNewResponse, error) +- client.Logpush.Ownership.Validate(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushOwnershipValidateParams) (cloudflare.LogpushOwnershipValidateResponse, error) -### Origins +## Validate Response Types: -- cloudflare.LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse +- cloudflare.LogpushValidateDestinationResponse +- cloudflare.LogpushValidateOriginResponse Methods: -- client.Logpush.Validates.Origins.PostAccountsAccountIdentifierLogpushValidateOrigin(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginParams) (cloudflare.LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse, error) +- client.Logpush.Validate.Destination(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushValidateDestinationParams) (cloudflare.LogpushValidateDestinationResponse, error) +- client.Logpush.Validate.Origin(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.LogpushValidateOriginParams) (cloudflare.LogpushValidateOriginResponse, error) # Logs @@ -1663,29 +1548,29 @@ Methods: Response Types: +- cloudflare.LogControlRetentionFlagNewResponse - cloudflare.LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse -- cloudflare.LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse Methods: +- client.Logs.Controls.Retentions.Flags.New(ctx context.Context, zoneIdentifier string, body cloudflare.LogControlRetentionFlagNewParams) (cloudflare.LogControlRetentionFlagNewResponse, error) - client.Logs.Controls.Retentions.Flags.LogsReceivedGetLogRetentionFlag(ctx context.Context, zoneIdentifier string) (cloudflare.LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse, error) -- client.Logs.Controls.Retentions.Flags.LogsReceivedUpdateLogRetentionFlag(ctx context.Context, zoneIdentifier string, body cloudflare.LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagParams) (cloudflare.LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse, error) ### Cmb -#### Configs +#### Config Response Types: +- cloudflare.LogControlCmbConfigNewResponse - cloudflare.LogControlCmbConfigDeleteResponse -- cloudflare.LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse -- cloudflare.LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse +- cloudflare.LogControlCmbConfigGetResponse Methods: -- client.Logs.Controls.Cmb.Configs.Delete(ctx context.Context, accountID string) (cloudflare.LogControlCmbConfigDeleteResponse, error) -- client.Logs.Controls.Cmb.Configs.GetAccountsAccountIdentifierLogsControlCmbConfig(ctx context.Context, accountID string) (cloudflare.LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse, error) -- client.Logs.Controls.Cmb.Configs.PutAccountsAccountIdentifierLogsControlCmbConfig(ctx context.Context, accountID string, body cloudflare.LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigParams) (cloudflare.LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse, error) +- client.Logs.Controls.Cmb.Config.New(ctx context.Context, accountID string, body cloudflare.LogControlCmbConfigNewParams) (cloudflare.LogControlCmbConfigNewResponse, error) +- client.Logs.Controls.Cmb.Config.Delete(ctx context.Context, accountID string) (cloudflare.LogControlCmbConfigDeleteResponse, error) +- client.Logs.Controls.Cmb.Config.Get(ctx context.Context, accountID string) (cloudflare.LogControlCmbConfigGetResponse, error) ## Rayids @@ -1697,25 +1582,25 @@ Methods: - client.Logs.Rayids.Get(ctx context.Context, zoneIdentifier string, rayIdentifier string, query cloudflare.LogRayidGetParams) (cloudflare.LogRayidGetResponse, error) -## Receiveds +## Received Response Types: -- cloudflare.LogReceivedReceivedGetLogsReceivedResponse +- cloudflare.LogReceivedGetResponse Methods: -- client.Logs.Receiveds.ReceivedGetLogsReceived(ctx context.Context, zoneIdentifier string, query cloudflare.LogReceivedReceivedGetLogsReceivedParams) (cloudflare.LogReceivedReceivedGetLogsReceivedResponse, error) +- client.Logs.Received.Get(ctx context.Context, zoneIdentifier string, query cloudflare.LogReceivedGetParams) (cloudflare.LogReceivedGetResponse, error) ### Fields Response Types: -- cloudflare.LogReceivedFieldLogsReceivedListFieldsResponse +- cloudflare.LogReceivedFieldListResponse Methods: -- client.Logs.Receiveds.Fields.LogsReceivedListFields(ctx context.Context, zoneIdentifier string) (cloudflare.LogReceivedFieldLogsReceivedListFieldsResponse, error) +- client.Logs.Received.Fields.List(ctx context.Context, zoneIdentifier string) (cloudflare.LogReceivedFieldListResponse, error) # OriginTLSClientAuth @@ -1737,13 +1622,13 @@ Methods: Response Types: -- cloudflare.OriginTLSClientAuthHostnameUpdateResponse - cloudflare.OriginTLSClientAuthHostnameGetResponse +- cloudflare.OriginTLSClientAuthHostnameReplaceResponse Methods: -- client.OriginTLSClientAuth.Hostnames.Update(ctx context.Context, zoneID string, body cloudflare.OriginTLSClientAuthHostnameUpdateParams) ([]cloudflare.OriginTLSClientAuthHostnameUpdateResponse, error) - client.OriginTLSClientAuth.Hostnames.Get(ctx context.Context, zoneID string, hostname string) (cloudflare.OriginTLSClientAuthHostnameGetResponse, error) +- client.OriginTLSClientAuth.Hostnames.Replace(ctx context.Context, zoneID string, body cloudflare.OriginTLSClientAuthHostnameReplaceParams) ([]cloudflare.OriginTLSClientAuthHostnameReplaceResponse, error) ### Certificates @@ -1765,54 +1650,58 @@ Methods: Response Types: -- cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse -- cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse +- cloudflare.OriginTLSClientAuthSettingGetResponse +- cloudflare.OriginTLSClientAuthSettingReplaceResponse Methods: -- client.OriginTLSClientAuth.Settings.ZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZone(ctx context.Context, zoneID string) (cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse, error) -- client.OriginTLSClientAuth.Settings.ZoneLevelAuthenticatedOriginPullsSetEnablementForZone(ctx context.Context, zoneID string, body cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneParams) (cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse, error) +- client.OriginTLSClientAuth.Settings.Get(ctx context.Context, zoneID string) (cloudflare.OriginTLSClientAuthSettingGetResponse, error) +- client.OriginTLSClientAuth.Settings.Replace(ctx context.Context, zoneID string, body cloudflare.OriginTLSClientAuthSettingReplaceParams) (cloudflare.OriginTLSClientAuthSettingReplaceResponse, error) # Pagerules Response Types: - cloudflare.PageruleNewResponse -- cloudflare.PageruleUpdateResponse - cloudflare.PageruleListResponse - cloudflare.PageruleDeleteResponse - cloudflare.PageruleGetResponse +- cloudflare.PageruleReplaceResponse Methods: - client.Pagerules.New(ctx context.Context, zoneID string, body cloudflare.PageruleNewParams) (cloudflare.PageruleNewResponse, error) -- client.Pagerules.Update(ctx context.Context, zoneID string, pageruleID string, body cloudflare.PageruleUpdateParams) (cloudflare.PageruleUpdateResponse, error) - client.Pagerules.List(ctx context.Context, zoneID string, query cloudflare.PageruleListParams) ([]cloudflare.PageruleListResponse, error) - client.Pagerules.Delete(ctx context.Context, zoneID string, pageruleID string) (cloudflare.PageruleDeleteResponse, error) - client.Pagerules.Get(ctx context.Context, zoneID string, pageruleID string) (cloudflare.PageruleGetResponse, error) +- client.Pagerules.Replace(ctx context.Context, zoneID string, pageruleID string, body cloudflare.PageruleReplaceParams) (cloudflare.PageruleReplaceResponse, error) ## Settings Response Types: -- cloudflare.PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponse +- cloudflare.PageruleSettingListResponse Methods: -- client.Pagerules.Settings.AvailablePageRulesSettingsListAvailablePageRulesSettings(ctx context.Context, zoneID string) ([]cloudflare.PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponse, error) +- client.Pagerules.Settings.List(ctx context.Context, zoneID string) ([]cloudflare.PageruleSettingListResponse, error) # RateLimits Response Types: +- cloudflare.RateLimitNewResponse - cloudflare.RateLimitUpdateResponse - cloudflare.RateLimitListResponse +- cloudflare.RateLimitDeleteResponse - cloudflare.RateLimitGetResponse Methods: +- client.RateLimits.New(ctx context.Context, zoneIdentifier string, body cloudflare.RateLimitNewParams) (cloudflare.RateLimitNewResponse, error) - client.RateLimits.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.RateLimitUpdateParams) (cloudflare.RateLimitUpdateResponse, error) - client.RateLimits.List(ctx context.Context, zoneIdentifier string, query cloudflare.RateLimitListParams) (shared.V4PagePaginationArray[cloudflare.RateLimitListResponse], error) +- client.RateLimits.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.RateLimitDeleteResponse, error) - client.RateLimits.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.RateLimitGetResponse, error) # SecondaryDNS @@ -1821,117 +1710,102 @@ Methods: Methods: -- client.SecondaryDNS.ForceAxfrs.SecondaryDNSSecondaryZoneForceAxfr(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.ForceAxfrs.New(ctx context.Context, zoneID interface{}) (string, error) -## Incomings +## Incoming Response Types: +- cloudflare.SecondaryDNSIncomingNewResponse - cloudflare.SecondaryDNSIncomingDeleteResponse -- cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse -- cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse -- cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse +- cloudflare.SecondaryDNSIncomingGetResponse +- cloudflare.SecondaryDNSIncomingReplaceResponse Methods: -- client.SecondaryDNS.Incomings.Delete(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSIncomingDeleteResponse, error) -- client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneNewSecondaryZoneConfiguration(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationParams) (cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse, error) -- client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetails(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse, error) -- client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneUpdateSecondaryZoneConfiguration(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationParams) (cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse, error) +- client.SecondaryDNS.Incoming.New(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSIncomingNewParams) (cloudflare.SecondaryDNSIncomingNewResponse, error) +- client.SecondaryDNS.Incoming.Delete(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSIncomingDeleteResponse, error) +- client.SecondaryDNS.Incoming.Get(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSIncomingGetResponse, error) +- client.SecondaryDNS.Incoming.Replace(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSIncomingReplaceParams) (cloudflare.SecondaryDNSIncomingReplaceResponse, error) -## Outgoings +## Outgoing Response Types: +- cloudflare.SecondaryDNSOutgoingNewResponse - cloudflare.SecondaryDNSOutgoingDeleteResponse -- cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse -- cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse -- cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse - -Methods: - -- client.SecondaryDNS.Outgoings.Delete(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSOutgoingDeleteResponse, error) -- client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationParams) (cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse, error) -- client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZonePrimaryZoneConfigurationDetails(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse, error) -- client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZoneUpdatePrimaryZoneConfiguration(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationParams) (cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse, error) - -### Disables - -Methods: - -- client.SecondaryDNS.Outgoings.Disables.SecondaryDNSPrimaryZoneDisableOutgoingZoneTransfers(ctx context.Context, zoneID interface{}) (string, error) - -### Enables +- cloudflare.SecondaryDNSOutgoingGetResponse +- cloudflare.SecondaryDNSOutgoingReplaceResponse Methods: -- client.SecondaryDNS.Outgoings.Enables.SecondaryDNSPrimaryZoneEnableOutgoingZoneTransfers(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.Outgoing.New(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSOutgoingNewParams) (cloudflare.SecondaryDNSOutgoingNewResponse, error) +- client.SecondaryDNS.Outgoing.Delete(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSOutgoingDeleteResponse, error) +- client.SecondaryDNS.Outgoing.Disable(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.Outgoing.Enable(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.Outgoing.ForceNotify(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.Outgoing.Get(ctx context.Context, zoneID interface{}) (cloudflare.SecondaryDNSOutgoingGetResponse, error) +- client.SecondaryDNS.Outgoing.Replace(ctx context.Context, zoneID interface{}, body cloudflare.SecondaryDNSOutgoingReplaceParams) (cloudflare.SecondaryDNSOutgoingReplaceResponse, error) -### ForceNotifies +### Status Methods: -- client.SecondaryDNS.Outgoings.ForceNotifies.SecondaryDNSPrimaryZoneForceDNSNotify(ctx context.Context, zoneID interface{}) (string, error) - -### Statuses - -Methods: - -- client.SecondaryDNS.Outgoings.Statuses.SecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatus(ctx context.Context, zoneID interface{}) (string, error) +- client.SecondaryDNS.Outgoing.Status.Get(ctx context.Context, zoneID interface{}) (string, error) ## ACLs Response Types: -- cloudflare.SecondaryDnsaclUpdateResponse +- cloudflare.SecondaryDnsaclNewResponse +- cloudflare.SecondaryDnsaclListResponse - cloudflare.SecondaryDnsaclDeleteResponse - cloudflare.SecondaryDnsaclGetResponse -- cloudflare.SecondaryDnsaclSecondaryDnsaclNewACLResponse -- cloudflare.SecondaryDnsaclSecondaryDnsaclListACLsResponse +- cloudflare.SecondaryDnsaclReplaceResponse Methods: -- client.SecondaryDNS.ACLs.Update(ctx context.Context, accountID interface{}, aclID interface{}, body cloudflare.SecondaryDNSACLUpdateParams) (cloudflare.SecondaryDnsaclUpdateResponse, error) +- client.SecondaryDNS.ACLs.New(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSACLNewParams) (cloudflare.SecondaryDnsaclNewResponse, error) +- client.SecondaryDNS.ACLs.List(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDnsaclListResponse, error) - client.SecondaryDNS.ACLs.Delete(ctx context.Context, accountID interface{}, aclID interface{}) (cloudflare.SecondaryDnsaclDeleteResponse, error) - client.SecondaryDNS.ACLs.Get(ctx context.Context, accountID interface{}, aclID interface{}) (cloudflare.SecondaryDnsaclGetResponse, error) -- client.SecondaryDNS.ACLs.SecondaryDNSACLNewACL(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSACLSecondaryDNSACLNewACLParams) (cloudflare.SecondaryDnsaclSecondaryDnsaclNewACLResponse, error) -- client.SecondaryDNS.ACLs.SecondaryDNSACLListACLs(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDnsaclSecondaryDnsaclListACLsResponse, error) +- client.SecondaryDNS.ACLs.Replace(ctx context.Context, accountID interface{}, aclID interface{}, body cloudflare.SecondaryDNSACLReplaceParams) (cloudflare.SecondaryDnsaclReplaceResponse, error) ## Peers Response Types: -- cloudflare.SecondaryDNSPeerUpdateResponse +- cloudflare.SecondaryDNSPeerNewResponse +- cloudflare.SecondaryDNSPeerListResponse - cloudflare.SecondaryDNSPeerDeleteResponse - cloudflare.SecondaryDNSPeerGetResponse -- cloudflare.SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse -- cloudflare.SecondaryDNSPeerSecondaryDNSPeerListPeersResponse +- cloudflare.SecondaryDNSPeerReplaceResponse Methods: -- client.SecondaryDNS.Peers.Update(ctx context.Context, accountID interface{}, peerID interface{}, body cloudflare.SecondaryDNSPeerUpdateParams) (cloudflare.SecondaryDNSPeerUpdateResponse, error) +- client.SecondaryDNS.Peers.New(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSPeerNewParams) (cloudflare.SecondaryDNSPeerNewResponse, error) +- client.SecondaryDNS.Peers.List(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDNSPeerListResponse, error) - client.SecondaryDNS.Peers.Delete(ctx context.Context, accountID interface{}, peerID interface{}) (cloudflare.SecondaryDNSPeerDeleteResponse, error) - client.SecondaryDNS.Peers.Get(ctx context.Context, accountID interface{}, peerID interface{}) (cloudflare.SecondaryDNSPeerGetResponse, error) -- client.SecondaryDNS.Peers.SecondaryDNSPeerNewPeer(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSPeerSecondaryDNSPeerNewPeerParams) (cloudflare.SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse, error) -- client.SecondaryDNS.Peers.SecondaryDNSPeerListPeers(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDNSPeerSecondaryDNSPeerListPeersResponse, error) +- client.SecondaryDNS.Peers.Replace(ctx context.Context, accountID interface{}, peerID interface{}, body cloudflare.SecondaryDNSPeerReplaceParams) (cloudflare.SecondaryDNSPeerReplaceResponse, error) ## Tsigs Response Types: -- cloudflare.SecondaryDNSTsigUpdateResponse +- cloudflare.SecondaryDNSTsigNewResponse +- cloudflare.SecondaryDNSTsigListResponse - cloudflare.SecondaryDNSTsigDeleteResponse - cloudflare.SecondaryDNSTsigGetResponse -- cloudflare.SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse -- cloudflare.SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse +- cloudflare.SecondaryDNSTsigReplaceResponse Methods: -- client.SecondaryDNS.Tsigs.Update(ctx context.Context, accountID interface{}, tsigID interface{}, body cloudflare.SecondaryDNSTsigUpdateParams) (cloudflare.SecondaryDNSTsigUpdateResponse, error) +- client.SecondaryDNS.Tsigs.New(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSTsigNewParams) (cloudflare.SecondaryDNSTsigNewResponse, error) +- client.SecondaryDNS.Tsigs.List(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDNSTsigListResponse, error) - client.SecondaryDNS.Tsigs.Delete(ctx context.Context, accountID interface{}, tsigID interface{}) (cloudflare.SecondaryDNSTsigDeleteResponse, error) - client.SecondaryDNS.Tsigs.Get(ctx context.Context, accountID interface{}, tsigID interface{}) (cloudflare.SecondaryDNSTsigGetResponse, error) -- client.SecondaryDNS.Tsigs.SecondaryDNSTsigNewTsig(ctx context.Context, accountID interface{}, body cloudflare.SecondaryDNSTsigSecondaryDNSTsigNewTsigParams) (cloudflare.SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse, error) -- client.SecondaryDNS.Tsigs.SecondaryDNSTsigListTsiGs(ctx context.Context, accountID interface{}) ([]cloudflare.SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse, error) +- client.SecondaryDNS.Tsigs.Replace(ctx context.Context, accountID interface{}, tsigID interface{}, body cloudflare.SecondaryDNSTsigReplaceParams) (cloudflare.SecondaryDNSTsigReplaceResponse, error) # Settings @@ -1949,13 +1823,13 @@ Methods: Response Types: +- cloudflare.SettingZeroRttUpdateResponse - cloudflare.SettingZeroRttGetResponse -- cloudflare.SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse Methods: +- client.Settings.ZeroRtt.Update(ctx context.Context, zoneID string, body cloudflare.SettingZeroRttUpdateParams) (cloudflare.SettingZeroRttUpdateResponse, error) - client.Settings.ZeroRtt.Get(ctx context.Context, zoneID string) (cloudflare.SettingZeroRttGetResponse, error) -- client.Settings.ZeroRtt.ZoneSettingsChange0RttSessionResumptionSetting(ctx context.Context, zoneID string, body cloudflare.SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParams) (cloudflare.SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse, error) ## AdvancedDDOS @@ -2099,7 +1973,7 @@ Methods: - client.Settings.DevelopmentMode.Update(ctx context.Context, zoneID string, body cloudflare.SettingDevelopmentModeUpdateParams) (cloudflare.SettingDevelopmentModeUpdateResponse, error) - client.Settings.DevelopmentMode.Get(ctx context.Context, zoneID string) (cloudflare.SettingDevelopmentModeGetResponse, error) -## EarlyHint +## EarlyHints Response Types: @@ -2108,8 +1982,8 @@ Response Types: Methods: -- client.Settings.EarlyHint.Update(ctx context.Context, zoneID string, body cloudflare.SettingEarlyHintUpdateParams) (cloudflare.SettingEarlyHintUpdateResponse, error) -- client.Settings.EarlyHint.Get(ctx context.Context, zoneID string) (cloudflare.SettingEarlyHintGetResponse, error) +- client.Settings.EarlyHints.Update(ctx context.Context, zoneID string, body cloudflare.SettingEarlyHintUpdateParams) (cloudflare.SettingEarlyHintUpdateResponse, error) +- client.Settings.EarlyHints.Get(ctx context.Context, zoneID string) (cloudflare.SettingEarlyHintGetResponse, error) ## EmailObfuscation @@ -2543,89 +2417,93 @@ Methods: - client.Settings.Websocket.Update(ctx context.Context, zoneID string, body cloudflare.SettingWebsocketUpdateParams) (cloudflare.SettingWebsocketUpdateResponse, error) - client.Settings.Websocket.Get(ctx context.Context, zoneID string) (cloudflare.SettingWebsocketGetResponse, error) +## FontSettings + +Response Types: + +- cloudflare.SettingFontSettingUpdateResponse +- cloudflare.SettingFontSettingGetResponse + +Methods: + +- client.Settings.FontSettings.Update(ctx context.Context, zoneID string, body cloudflare.SettingFontSettingUpdateParams) (cloudflare.SettingFontSettingUpdateResponse, error) +- client.Settings.FontSettings.Get(ctx context.Context, zoneID string) (cloudflare.SettingFontSettingGetResponse, error) + # WaitingRooms Response Types: - cloudflare.WaitingRoomNewResponse -- cloudflare.WaitingRoomUpdateResponse - cloudflare.WaitingRoomListResponse - cloudflare.WaitingRoomDeleteResponse - cloudflare.WaitingRoomGetResponse +- cloudflare.WaitingRoomPreviewResponse +- cloudflare.WaitingRoomReplaceResponse Methods: - client.WaitingRooms.New(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomNewParams) (cloudflare.WaitingRoomNewResponse, error) -- client.WaitingRooms.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomUpdateParams) (cloudflare.WaitingRoomUpdateResponse, error) - client.WaitingRooms.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.WaitingRoomListResponse, error) - client.WaitingRooms.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomDeleteResponse, error) - client.WaitingRooms.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomGetResponse, error) - -## Previews - -Response Types: - -- cloudflare.WaitingRoomPreviewNewResponse - -Methods: - -- client.WaitingRooms.Previews.New(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomPreviewNewParams) (cloudflare.WaitingRoomPreviewNewResponse, error) +- client.WaitingRooms.Preview(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomPreviewParams) (cloudflare.WaitingRoomPreviewResponse, error) +- client.WaitingRooms.Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomReplaceParams) (cloudflare.WaitingRoomReplaceResponse, error) ## Events Response Types: -- cloudflare.WaitingRoomEventUpdateResponse +- cloudflare.WaitingRoomEventNewResponse +- cloudflare.WaitingRoomEventListResponse - cloudflare.WaitingRoomEventDeleteResponse - cloudflare.WaitingRoomEventGetResponse -- cloudflare.WaitingRoomEventWaitingRoomNewEventResponse -- cloudflare.WaitingRoomEventWaitingRoomListEventsResponse +- cloudflare.WaitingRoomEventReplaceResponse Methods: -- client.WaitingRooms.Events.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body cloudflare.WaitingRoomEventUpdateParams) (cloudflare.WaitingRoomEventUpdateResponse, error) +- client.WaitingRooms.Events.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomEventNewParams) (cloudflare.WaitingRoomEventNewResponse, error) +- client.WaitingRooms.Events.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomEventListResponse, error) - client.WaitingRooms.Events.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventDeleteResponse, error) - client.WaitingRooms.Events.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventGetResponse, error) -- client.WaitingRooms.Events.WaitingRoomNewEvent(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomEventWaitingRoomNewEventParams) (cloudflare.WaitingRoomEventWaitingRoomNewEventResponse, error) -- client.WaitingRooms.Events.WaitingRoomListEvents(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomEventWaitingRoomListEventsResponse, error) +- client.WaitingRooms.Events.Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body cloudflare.WaitingRoomEventReplaceParams) (cloudflare.WaitingRoomEventReplaceResponse, error) ### Details Response Types: -- cloudflare.WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse +- cloudflare.WaitingRoomEventDetailGetResponse Methods: -- client.WaitingRooms.Events.Details.WaitingRoomPreviewActiveEventDetails(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse, error) +- client.WaitingRooms.Events.Details.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventDetailGetResponse, error) ## Rules Response Types: +- cloudflare.WaitingRoomRuleNewResponse - cloudflare.WaitingRoomRuleUpdateResponse +- cloudflare.WaitingRoomRuleListResponse - cloudflare.WaitingRoomRuleDeleteResponse -- cloudflare.WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse -- cloudflare.WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse -- cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse +- cloudflare.WaitingRoomRuleReplaceResponse Methods: +- client.WaitingRooms.Rules.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleNewParams) ([]cloudflare.WaitingRoomRuleNewResponse, error) - client.WaitingRooms.Rules.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body cloudflare.WaitingRoomRuleUpdateParams) ([]cloudflare.WaitingRoomRuleUpdateResponse, error) +- client.WaitingRooms.Rules.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomRuleListResponse, error) - client.WaitingRooms.Rules.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string) ([]cloudflare.WaitingRoomRuleDeleteResponse, error) -- client.WaitingRooms.Rules.WaitingRoomNewWaitingRoomRule(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParams) ([]cloudflare.WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse, error) -- client.WaitingRooms.Rules.WaitingRoomListWaitingRoomRules(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse, error) -- client.WaitingRooms.Rules.WaitingRoomReplaceWaitingRoomRules(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParams) ([]cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse, error) +- client.WaitingRooms.Rules.Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleReplaceParams) ([]cloudflare.WaitingRoomRuleReplaceResponse, error) ## Statuses Response Types: -- cloudflare.WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse +- cloudflare.WaitingRoomStatusGetResponse Methods: -- client.WaitingRooms.Statuses.WaitingRoomGetWaitingRoomStatus(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse, error) +- client.WaitingRooms.Statuses.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomStatusGetResponse, error) ## Settings @@ -2640,25 +2518,25 @@ Methods: - client.WaitingRooms.Settings.Update(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomSettingUpdateParams) (cloudflare.WaitingRoomSettingUpdateResponse, error) - client.WaitingRooms.Settings.Get(ctx context.Context, zoneIdentifier string) (cloudflare.WaitingRoomSettingGetResponse, error) -# Web3s +# Web3 ## Hostnames Response Types: +- cloudflare.Web3HostnameNewResponse - cloudflare.Web3HostnameUpdateResponse +- cloudflare.Web3HostnameListResponse - cloudflare.Web3HostnameDeleteResponse - cloudflare.Web3HostnameGetResponse -- cloudflare.Web3HostnameWeb3HostnameNewWeb3HostnameResponse -- cloudflare.Web3HostnameWeb3HostnameListWeb3HostnamesResponse Methods: -- client.Web3s.Hostnames.Update(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameUpdateParams) (cloudflare.Web3HostnameUpdateResponse, error) -- client.Web3s.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameDeleteResponse, error) -- client.Web3s.Hostnames.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameGetResponse, error) -- client.Web3s.Hostnames.Web3HostnameNewWeb3Hostname(ctx context.Context, zoneIdentifier string, body cloudflare.Web3HostnameWeb3HostnameNewWeb3HostnameParams) (cloudflare.Web3HostnameWeb3HostnameNewWeb3HostnameResponse, error) -- client.Web3s.Hostnames.Web3HostnameListWeb3Hostnames(ctx context.Context, zoneIdentifier string) ([]cloudflare.Web3HostnameWeb3HostnameListWeb3HostnamesResponse, error) +- client.Web3.Hostnames.New(ctx context.Context, zoneIdentifier string, body cloudflare.Web3HostnameNewParams) (cloudflare.Web3HostnameNewResponse, error) +- client.Web3.Hostnames.Update(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameUpdateParams) (cloudflare.Web3HostnameUpdateResponse, error) +- client.Web3.Hostnames.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.Web3HostnameListResponse, error) +- client.Web3.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameDeleteResponse, error) +- client.Web3.Hostnames.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameGetResponse, error) ### IpfsUniversalPaths @@ -2666,31 +2544,31 @@ Methods: Response Types: -- cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse -- cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse +- cloudflare.Web3HostnameIpfsUniversalPathContentListListResponse +- cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceResponse Methods: -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Web3HostnameIpfsUniversalPathGatewayContentListDetails(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse, error) -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Web3HostnameUpdateIpfsUniversalPathGatewayContentList(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.List(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListListResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Replace(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceResponse, error) ##### Entries Response Types: -- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse +- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryNewResponse +- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryListResponse - cloudflare.Web3HostnameIpfsUniversalPathContentListEntryDeleteResponse - cloudflare.Web3HostnameIpfsUniversalPathContentListEntryGetResponse -- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse -- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse +- cloudflare.Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse Methods: -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Update(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListEntryUpdateParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse, error) -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryDeleteResponse, error) -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Get(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryGetResponse, error) -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Web3HostnameNewIpfsUniversalPathGatewayContentListEntry(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse, error) -- client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Web3HostnameListIpfsUniversalPathGatewayContentListEntries(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.New(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListEntryNewParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryNewResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.List(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryListResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryDeleteResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Get(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryGetResponse, error) +- client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Replace(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body cloudflare.Web3HostnameIpfsUniversalPathContentListEntryReplaceParams) (cloudflare.Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse, error) # Workers @@ -2698,17 +2576,15 @@ Methods: Response Types: -- cloudflare.WorkerScriptNewResponse -- cloudflare.WorkerScriptUpdateResponse - cloudflare.WorkerScriptListResponse +- cloudflare.WorkerScriptReplaceResponse Methods: -- client.Workers.Scripts.New(ctx context.Context, zoneID string) (cloudflare.WorkerScriptNewResponse, error) -- client.Workers.Scripts.Update(ctx context.Context, accountID string, scriptName string, params cloudflare.WorkerScriptUpdateParams) (cloudflare.WorkerScriptUpdateResponse, error) - client.Workers.Scripts.List(ctx context.Context, accountID string) ([]cloudflare.WorkerScriptListResponse, error) - client.Workers.Scripts.Delete(ctx context.Context, accountID string, scriptName string, body cloudflare.WorkerScriptDeleteParams) error - client.Workers.Scripts.Get(ctx context.Context, accountID string, scriptName string) (http.Response, error) +- client.Workers.Scripts.Replace(ctx context.Context, accountID string, scriptName string, params cloudflare.WorkerScriptReplaceParams) (cloudflare.WorkerScriptReplaceResponse, error) ### Bindings @@ -2724,85 +2600,85 @@ Methods: Response Types: -- cloudflare.WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse -- cloudflare.WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse +- cloudflare.WorkerScriptScheduleListResponse +- cloudflare.WorkerScriptScheduleReplaceResponse Methods: -- client.Workers.Scripts.Schedules.WorkerCronTriggerGetCronTriggers(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse, error) -- client.Workers.Scripts.Schedules.WorkerCronTriggerUpdateCronTriggers(ctx context.Context, accountID string, scriptName string, body cloudflare.WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersParams) (cloudflare.WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse, error) +- client.Workers.Scripts.Schedules.List(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptScheduleListResponse, error) +- client.Workers.Scripts.Schedules.Replace(ctx context.Context, accountID string, scriptName string, body cloudflare.WorkerScriptScheduleReplaceParams) (cloudflare.WorkerScriptScheduleReplaceResponse, error) -### Tails +### Tail Response Types: +- cloudflare.WorkerScriptTailNewResponse +- cloudflare.WorkerScriptTailListResponse - cloudflare.WorkerScriptTailDeleteResponse -- cloudflare.WorkerScriptTailWorkerTailLogsListTailsResponse -- cloudflare.WorkerScriptTailWorkerTailLogsStartTailResponse Methods: -- client.Workers.Scripts.Tails.Delete(ctx context.Context, accountID string, scriptName string, id string) (cloudflare.WorkerScriptTailDeleteResponse, error) -- client.Workers.Scripts.Tails.WorkerTailLogsListTails(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptTailWorkerTailLogsListTailsResponse, error) -- client.Workers.Scripts.Tails.WorkerTailLogsStartTail(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptTailWorkerTailLogsStartTailResponse, error) +- client.Workers.Scripts.Tail.New(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptTailNewResponse, error) +- client.Workers.Scripts.Tail.List(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptTailListResponse, error) +- client.Workers.Scripts.Tail.Delete(ctx context.Context, accountID string, scriptName string, id string) (cloudflare.WorkerScriptTailDeleteResponse, error) -### UsageModels +### UsageModel Response Types: -- cloudflare.WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse -- cloudflare.WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse +- cloudflare.WorkerScriptUsageModelGetResponse +- cloudflare.WorkerScriptUsageModelReplaceResponse Methods: -- client.Workers.Scripts.UsageModels.WorkerScriptFetchUsageModel(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse, error) -- client.Workers.Scripts.UsageModels.WorkerScriptUpdateUsageModel(ctx context.Context, accountID string, scriptName string, body cloudflare.WorkerScriptUsageModelWorkerScriptUpdateUsageModelParams) (cloudflare.WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse, error) +- client.Workers.Scripts.UsageModel.Get(ctx context.Context, accountID string, scriptName string) (cloudflare.WorkerScriptUsageModelGetResponse, error) +- client.Workers.Scripts.UsageModel.Replace(ctx context.Context, accountID string, scriptName string, body cloudflare.WorkerScriptUsageModelReplaceParams) (cloudflare.WorkerScriptUsageModelReplaceResponse, error) ## Filters Response Types: -- cloudflare.WorkerFilterUpdateResponse +- cloudflare.WorkerFilterNewResponse +- cloudflare.WorkerFilterListResponse - cloudflare.WorkerFilterDeleteResponse -- cloudflare.WorkerFilterWorkerFiltersDeprecatedNewFilterResponse -- cloudflare.WorkerFilterWorkerFiltersDeprecatedListFiltersResponse +- cloudflare.WorkerFilterReplaceResponse Methods: -- client.Workers.Filters.Update(ctx context.Context, zoneID string, filterID string, body cloudflare.WorkerFilterUpdateParams) (cloudflare.WorkerFilterUpdateResponse, error) +- client.Workers.Filters.New(ctx context.Context, zoneID string, body cloudflare.WorkerFilterNewParams) (cloudflare.WorkerFilterNewResponse, error) +- client.Workers.Filters.List(ctx context.Context, zoneID string) ([]cloudflare.WorkerFilterListResponse, error) - client.Workers.Filters.Delete(ctx context.Context, zoneID string, filterID string) (cloudflare.WorkerFilterDeleteResponse, error) -- client.Workers.Filters.WorkerFiltersDeprecatedNewFilter(ctx context.Context, zoneID string, body cloudflare.WorkerFilterWorkerFiltersDeprecatedNewFilterParams) (cloudflare.WorkerFilterWorkerFiltersDeprecatedNewFilterResponse, error) -- client.Workers.Filters.WorkerFiltersDeprecatedListFilters(ctx context.Context, zoneID string) ([]cloudflare.WorkerFilterWorkerFiltersDeprecatedListFiltersResponse, error) +- client.Workers.Filters.Replace(ctx context.Context, zoneID string, filterID string, body cloudflare.WorkerFilterReplaceParams) (cloudflare.WorkerFilterReplaceResponse, error) ## Routes Response Types: -- cloudflare.WorkerRouteUpdateResponse +- cloudflare.WorkerRouteNewResponse +- cloudflare.WorkerRouteListResponse - cloudflare.WorkerRouteDeleteResponse - cloudflare.WorkerRouteGetResponse -- cloudflare.WorkerRouteWorkerRoutesNewRouteResponse -- cloudflare.WorkerRouteWorkerRoutesListRoutesResponse +- cloudflare.WorkerRouteReplaceResponse Methods: -- client.Workers.Routes.Update(ctx context.Context, zoneID string, routeID string, body cloudflare.WorkerRouteUpdateParams) (cloudflare.WorkerRouteUpdateResponse, error) +- client.Workers.Routes.New(ctx context.Context, zoneID string, body cloudflare.WorkerRouteNewParams) (cloudflare.WorkerRouteNewResponse, error) +- client.Workers.Routes.List(ctx context.Context, zoneID string) ([]cloudflare.WorkerRouteListResponse, error) - client.Workers.Routes.Delete(ctx context.Context, zoneID string, routeID string) (cloudflare.WorkerRouteDeleteResponse, error) - client.Workers.Routes.Get(ctx context.Context, zoneID string, routeID string) (cloudflare.WorkerRouteGetResponse, error) -- client.Workers.Routes.WorkerRoutesNewRoute(ctx context.Context, zoneID string, body cloudflare.WorkerRouteWorkerRoutesNewRouteParams) (cloudflare.WorkerRouteWorkerRoutesNewRouteResponse, error) -- client.Workers.Routes.WorkerRoutesListRoutes(ctx context.Context, zoneID string) ([]cloudflare.WorkerRouteWorkerRoutesListRoutesResponse, error) +- client.Workers.Routes.Replace(ctx context.Context, zoneID string, routeID string, body cloudflare.WorkerRouteReplaceParams) (cloudflare.WorkerRouteReplaceResponse, error) ## AccountSettings Response Types: -- cloudflare.WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse -- cloudflare.WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse +- cloudflare.WorkerAccountSettingGetResponse +- cloudflare.WorkerAccountSettingReplaceResponse Methods: -- client.Workers.AccountSettings.WorkerAccountSettingsNewWorkerAccountSettings(ctx context.Context, accountID string, body cloudflare.WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsParams) (cloudflare.WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse, error) -- client.Workers.AccountSettings.WorkerAccountSettingsFetchWorkerAccountSettings(ctx context.Context, accountID string) (cloudflare.WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse, error) +- client.Workers.AccountSettings.Get(ctx context.Context, accountID string) (cloudflare.WorkerAccountSettingGetResponse, error) +- client.Workers.AccountSettings.Replace(ctx context.Context, accountID string, body cloudflare.WorkerAccountSettingReplaceParams) (cloudflare.WorkerAccountSettingReplaceResponse, error) ## Deployments @@ -2810,36 +2686,28 @@ Methods: Response Types: -- cloudflare.WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse +- cloudflare.WorkerDeploymentByScriptListResponse +- cloudflare.WorkerDeploymentByScriptGetResponse Methods: -- client.Workers.Deployments.ByScripts.WorkerDeploymentsListDeployments(ctx context.Context, accountID string, scriptID string) (cloudflare.WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse, error) - -#### Details - -Response Types: - -- cloudflare.WorkerDeploymentByScriptDetailGetResponse - -Methods: - -- client.Workers.Deployments.ByScripts.Details.Get(ctx context.Context, accountID string, scriptID string, deploymentID string) (cloudflare.WorkerDeploymentByScriptDetailGetResponse, error) +- client.Workers.Deployments.ByScripts.List(ctx context.Context, accountID string, scriptID string) (cloudflare.WorkerDeploymentByScriptListResponse, error) +- client.Workers.Deployments.ByScripts.Get(ctx context.Context, accountID string, scriptID string, deploymentID string) (cloudflare.WorkerDeploymentByScriptGetResponse, error) ## Domains Response Types: +- cloudflare.WorkerDomainListResponse - cloudflare.WorkerDomainGetResponse -- cloudflare.WorkerDomainWorkerDomainAttachToDomainResponse -- cloudflare.WorkerDomainWorkerDomainListDomainsResponse +- cloudflare.WorkerDomainReplaceResponse Methods: +- client.Workers.Domains.List(ctx context.Context, accountID interface{}, query cloudflare.WorkerDomainListParams) ([]cloudflare.WorkerDomainListResponse, error) - client.Workers.Domains.Delete(ctx context.Context, accountID interface{}, domainID interface{}) error - client.Workers.Domains.Get(ctx context.Context, accountID interface{}, domainID interface{}) (cloudflare.WorkerDomainGetResponse, error) -- client.Workers.Domains.WorkerDomainAttachToDomain(ctx context.Context, accountID interface{}, body cloudflare.WorkerDomainWorkerDomainAttachToDomainParams) (cloudflare.WorkerDomainWorkerDomainAttachToDomainResponse, error) -- client.Workers.Domains.WorkerDomainListDomains(ctx context.Context, accountID interface{}, query cloudflare.WorkerDomainWorkerDomainListDomainsParams) ([]cloudflare.WorkerDomainWorkerDomainListDomainsResponse, error) +- client.Workers.Domains.Replace(ctx context.Context, accountID interface{}, body cloudflare.WorkerDomainReplaceParams) (cloudflare.WorkerDomainReplaceResponse, error) ## DurableObjects @@ -2867,47 +2735,47 @@ Methods: Response Types: -- cloudflare.WorkerQueueUpdateResponse +- cloudflare.WorkerQueueNewResponse - cloudflare.WorkerQueueListResponse - cloudflare.WorkerQueueDeleteResponse - cloudflare.WorkerQueueGetResponse -- cloudflare.WorkerQueueQueueNewQueueResponse +- cloudflare.WorkerQueueReplaceResponse Methods: -- client.Workers.Queues.Update(ctx context.Context, accountID string, name string, body cloudflare.WorkerQueueUpdateParams) (cloudflare.WorkerQueueUpdateResponse, error) +- client.Workers.Queues.New(ctx context.Context, accountID string, body cloudflare.WorkerQueueNewParams) (cloudflare.WorkerQueueNewResponse, error) - client.Workers.Queues.List(ctx context.Context, accountID string) ([]cloudflare.WorkerQueueListResponse, error) - client.Workers.Queues.Delete(ctx context.Context, accountID string, name string) (cloudflare.WorkerQueueDeleteResponse, error) - client.Workers.Queues.Get(ctx context.Context, accountID string, name string) (cloudflare.WorkerQueueGetResponse, error) -- client.Workers.Queues.QueueNewQueue(ctx context.Context, accountID string, body cloudflare.WorkerQueueQueueNewQueueParams) (cloudflare.WorkerQueueQueueNewQueueResponse, error) +- client.Workers.Queues.Replace(ctx context.Context, accountID string, name string, body cloudflare.WorkerQueueReplaceParams) (cloudflare.WorkerQueueReplaceResponse, error) ### Consumers Response Types: -- cloudflare.WorkerQueueConsumerUpdateResponse +- cloudflare.WorkerQueueConsumerNewResponse - cloudflare.WorkerQueueConsumerListResponse - cloudflare.WorkerQueueConsumerDeleteResponse -- cloudflare.WorkerQueueConsumerQueueNewQueueConsumerResponse +- cloudflare.WorkerQueueConsumerReplaceResponse Methods: -- client.Workers.Queues.Consumers.Update(ctx context.Context, accountID string, name string, consumerName string, body cloudflare.WorkerQueueConsumerUpdateParams) (cloudflare.WorkerQueueConsumerUpdateResponse, error) +- client.Workers.Queues.Consumers.New(ctx context.Context, accountID string, name string, body cloudflare.WorkerQueueConsumerNewParams) (cloudflare.WorkerQueueConsumerNewResponse, error) - client.Workers.Queues.Consumers.List(ctx context.Context, accountID string, name string) ([]cloudflare.WorkerQueueConsumerListResponse, error) - client.Workers.Queues.Consumers.Delete(ctx context.Context, accountID string, name string, consumerName string) (cloudflare.WorkerQueueConsumerDeleteResponse, error) -- client.Workers.Queues.Consumers.QueueNewQueueConsumer(ctx context.Context, accountID string, name string, body cloudflare.WorkerQueueConsumerQueueNewQueueConsumerParams) (cloudflare.WorkerQueueConsumerQueueNewQueueConsumerResponse, error) +- client.Workers.Queues.Consumers.Replace(ctx context.Context, accountID string, name string, consumerName string, body cloudflare.WorkerQueueConsumerReplaceParams) (cloudflare.WorkerQueueConsumerReplaceResponse, error) ## Subdomains Response Types: -- cloudflare.WorkerSubdomainWorkerSubdomainNewSubdomainResponse -- cloudflare.WorkerSubdomainWorkerSubdomainGetSubdomainResponse +- cloudflare.WorkerSubdomainGetResponse +- cloudflare.WorkerSubdomainReplaceResponse Methods: -- client.Workers.Subdomains.WorkerSubdomainNewSubdomain(ctx context.Context, accountID string, body cloudflare.WorkerSubdomainWorkerSubdomainNewSubdomainParams) (cloudflare.WorkerSubdomainWorkerSubdomainNewSubdomainResponse, error) -- client.Workers.Subdomains.WorkerSubdomainGetSubdomain(ctx context.Context, accountID string) (cloudflare.WorkerSubdomainWorkerSubdomainGetSubdomainResponse, error) +- client.Workers.Subdomains.Get(ctx context.Context, accountID string) (cloudflare.WorkerSubdomainGetResponse, error) +- client.Workers.Subdomains.Replace(ctx context.Context, accountID string, body cloudflare.WorkerSubdomainReplaceParams) (cloudflare.WorkerSubdomainReplaceResponse, error) ## DeploymentsByScript @@ -2929,24 +2797,24 @@ Methods: Response Types: -- cloudflare.WorkerServiceEnvironmentContentUpdateResponse +- cloudflare.WorkerServiceEnvironmentContentReplaceResponse Methods: -- client.Workers.Services.Environments.Content.Update(ctx context.Context, accountID string, serviceName string, environmentName string, params cloudflare.WorkerServiceEnvironmentContentUpdateParams) (cloudflare.WorkerServiceEnvironmentContentUpdateResponse, error) - client.Workers.Services.Environments.Content.Get(ctx context.Context, accountID string, serviceName string, environmentName string) (http.Response, error) +- client.Workers.Services.Environments.Content.Replace(ctx context.Context, accountID string, serviceName string, environmentName string, params cloudflare.WorkerServiceEnvironmentContentReplaceParams) (cloudflare.WorkerServiceEnvironmentContentReplaceResponse, error) #### Settings Response Types: +- cloudflare.WorkerServiceEnvironmentSettingUpdateResponse - cloudflare.WorkerServiceEnvironmentSettingGetResponse -- cloudflare.WorkerServiceEnvironmentSettingModifyResponse Methods: +- client.Workers.Services.Environments.Settings.Update(ctx context.Context, accountID string, serviceName string, environmentName string, body cloudflare.WorkerServiceEnvironmentSettingUpdateParams) (cloudflare.WorkerServiceEnvironmentSettingUpdateResponse, error) - client.Workers.Services.Environments.Settings.Get(ctx context.Context, accountID string, serviceName string, environmentName string) (cloudflare.WorkerServiceEnvironmentSettingGetResponse, error) -- client.Workers.Services.Environments.Settings.Modify(ctx context.Context, accountID string, serviceName string, environmentName string, body cloudflare.WorkerServiceEnvironmentSettingModifyParams) (cloudflare.WorkerServiceEnvironmentSettingModifyResponse, error) ## Script @@ -2958,76 +2826,93 @@ Methods: Response Types: -- cloudflare.ActivationCheckPutZonesZoneIDActivationCheckResponse +- cloudflare.ActivationCheckReplaceResponse Methods: -- client.ActivationChecks.PutZonesZoneIDActivationCheck(ctx context.Context, zoneID string) (cloudflare.ActivationCheckPutZonesZoneIDActivationCheckResponse, error) +- client.ActivationChecks.Replace(ctx context.Context, zoneID string) (cloudflare.ActivationCheckReplaceResponse, error) # ManagedHeaders Response Types: +- cloudflare.ManagedHeaderUpdateResponse - cloudflare.ManagedHeaderListResponse -- cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse Methods: +- client.ManagedHeaders.Update(ctx context.Context, zoneID string, body cloudflare.ManagedHeaderUpdateParams) (cloudflare.ManagedHeaderUpdateResponse, error) - client.ManagedHeaders.List(ctx context.Context, zoneID string) (cloudflare.ManagedHeaderListResponse, error) -- client.ManagedHeaders.ManagedTransformsUpdateStatusOfManagedTransforms(ctx context.Context, zoneID string, body cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParams) (cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse, error) -# PageShields +# PageShield Response Types: - cloudflare.PageShieldListResponse -- cloudflare.PageShieldPageShieldUpdatePageShieldSettingsResponse +- cloudflare.PageShieldReplaceResponse + +Methods: + +- client.PageShield.List(ctx context.Context, zoneID string) (cloudflare.PageShieldListResponse, error) +- client.PageShield.Replace(ctx context.Context, zoneID string, body cloudflare.PageShieldReplaceParams) (cloudflare.PageShieldReplaceResponse, error) + +## Policies + +Response Types: + +- cloudflare.PageShieldPolicyNewResponse +- cloudflare.PageShieldPolicyListResponse +- cloudflare.PageShieldPolicyGetResponse +- cloudflare.PageShieldPolicyReplaceResponse Methods: -- client.PageShields.List(ctx context.Context, zoneID string) (cloudflare.PageShieldListResponse, error) -- client.PageShields.PageShieldUpdatePageShieldSettings(ctx context.Context, zoneID string, body cloudflare.PageShieldPageShieldUpdatePageShieldSettingsParams) (cloudflare.PageShieldPageShieldUpdatePageShieldSettingsResponse, error) +- client.PageShield.Policies.New(ctx context.Context, zoneID string, body cloudflare.PageShieldPolicyNewParams) (cloudflare.PageShieldPolicyNewResponse, error) +- client.PageShield.Policies.List(ctx context.Context, zoneID string) ([]cloudflare.PageShieldPolicyListResponse, error) +- client.PageShield.Policies.Delete(ctx context.Context, zoneID string, policyID string) error +- client.PageShield.Policies.Get(ctx context.Context, zoneID string, policyID string) (cloudflare.PageShieldPolicyGetResponse, error) +- client.PageShield.Policies.Replace(ctx context.Context, zoneID string, policyID string, body cloudflare.PageShieldPolicyReplaceParams) (cloudflare.PageShieldPolicyReplaceResponse, error) ## Connections Response Types: +- cloudflare.PageShieldConnectionListResponse - cloudflare.PageShieldConnectionGetResponse -- cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsResponse Methods: -- client.PageShields.Connections.Get(ctx context.Context, zoneID string, connectionID string) (cloudflare.PageShieldConnectionGetResponse, error) -- client.PageShields.Connections.PageShieldListPageShieldConnections(ctx context.Context, zoneID string, query cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsParams) ([]cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsResponse, error) +- client.PageShield.Connections.List(ctx context.Context, zoneID string, query cloudflare.PageShieldConnectionListParams) ([]cloudflare.PageShieldConnectionListResponse, error) +- client.PageShield.Connections.Get(ctx context.Context, zoneID string, connectionID string) (cloudflare.PageShieldConnectionGetResponse, error) ## Scripts Response Types: +- cloudflare.PageShieldScriptListResponse - cloudflare.PageShieldScriptGetResponse -- cloudflare.PageShieldScriptPageShieldListPageShieldScriptsResponse Methods: -- client.PageShields.Scripts.Get(ctx context.Context, zoneID string, scriptID string) (cloudflare.PageShieldScriptGetResponse, error) -- client.PageShields.Scripts.PageShieldListPageShieldScripts(ctx context.Context, zoneID string, query cloudflare.PageShieldScriptPageShieldListPageShieldScriptsParams) ([]cloudflare.PageShieldScriptPageShieldListPageShieldScriptsResponse, error) +- client.PageShield.Scripts.List(ctx context.Context, zoneID string, query cloudflare.PageShieldScriptListParams) ([]cloudflare.PageShieldScriptListResponse, error) +- client.PageShield.Scripts.Get(ctx context.Context, zoneID string, scriptID string) (cloudflare.PageShieldScriptGetResponse, error) # Rulesets Response Types: - cloudflare.RulesetNewResponse -- cloudflare.RulesetUpdateResponse - cloudflare.RulesetListResponse - cloudflare.RulesetGetResponse +- cloudflare.RulesetReplaceResponse Methods: - client.Rulesets.New(ctx context.Context, accountOrZone string, accountOrZoneID string, body cloudflare.RulesetNewParams) (cloudflare.RulesetNewResponse, error) -- client.Rulesets.Update(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body cloudflare.RulesetUpdateParams) (cloudflare.RulesetUpdateResponse, error) - client.Rulesets.List(ctx context.Context, accountOrZone string, accountOrZoneID string) ([]cloudflare.RulesetListResponse, error) - client.Rulesets.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string) error - client.Rulesets.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string) (cloudflare.RulesetGetResponse, error) +- client.Rulesets.Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body cloudflare.RulesetReplaceParams) (cloudflare.RulesetReplaceResponse, error) ## Phases @@ -3043,27 +2928,27 @@ Methods: Response Types: +- cloudflare.RulesetRuleNewResponse - cloudflare.RulesetRuleUpdateResponse - cloudflare.RulesetRuleDeleteResponse -- cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse Methods: +- client.Rulesets.Rules.New(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body cloudflare.RulesetRuleNewParams) (cloudflare.RulesetRuleNewResponse, error) - client.Rulesets.Rules.Update(ctx context.Context, rulesetID string, ruleID string, params cloudflare.RulesetRuleUpdateParams) (cloudflare.RulesetRuleUpdateResponse, error) - client.Rulesets.Rules.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, ruleID string) (cloudflare.RulesetRuleDeleteResponse, error) -- client.Rulesets.Rules.AccountRulesetsNewAnAccountRulesetRule(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams) (cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse, error) ## Versions Response Types: -- cloudflare.RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse +- cloudflare.RulesetVersionListResponse - cloudflare.RulesetVersionGetResponse Methods: +- client.Rulesets.Versions.List(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string) ([]cloudflare.RulesetVersionListResponse, error) - client.Rulesets.Versions.Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string) error -- client.Rulesets.Versions.AccountRulesetsListAnAccountRulesetSVersions(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string) ([]cloudflare.RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse, error) - client.Rulesets.Versions.Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string) (cloudflare.RulesetVersionGetResponse, error) ### ByTags @@ -3080,15 +2965,15 @@ Methods: Response Types: -- cloudflare.URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse -- cloudflare.URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse +- cloudflare.URLNormalizationGetResponse +- cloudflare.URLNormalizationReplaceResponse Methods: -- client.URLNormalizations.URLNormalizationGetURLNormalizationSettings(ctx context.Context, zoneID string) (cloudflare.URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse, error) -- client.URLNormalizations.URLNormalizationUpdateURLNormalizationSettings(ctx context.Context, zoneID string, body cloudflare.URLNormalizationURLNormalizationUpdateURLNormalizationSettingsParams) (cloudflare.URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse, error) +- client.URLNormalizations.Get(ctx context.Context, zoneID string) (cloudflare.URLNormalizationGetResponse, error) +- client.URLNormalizations.Replace(ctx context.Context, zoneID string, body cloudflare.URLNormalizationReplaceParams) (cloudflare.URLNormalizationReplaceResponse, error) -# Spectrums +# Spectrum ## Analytics @@ -3098,11 +2983,11 @@ Methods: Response Types: -- cloudflare.SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponse +- cloudflare.SpectrumAnalyticsAggregateCurrentGetResponse Methods: -- client.Spectrums.Analytics.Aggregates.Currents.SpectrumAggregateAnalyticsGetCurrentAggregatedAnalytics(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams) ([]cloudflare.SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponse, error) +- client.Spectrum.Analytics.Aggregates.Currents.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsAggregateCurrentGetParams) ([]cloudflare.SpectrumAnalyticsAggregateCurrentGetResponse, error) ### Events @@ -3110,39 +2995,39 @@ Methods: Response Types: -- cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse +- cloudflare.SpectrumAnalyticsEventBytimeGetResponse Methods: -- client.Spectrums.Analytics.Events.Bytimes.SpectrumAnalyticsByTimeGetAnalyticsByTime(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams) (cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse, error) +- client.Spectrum.Analytics.Events.Bytimes.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventBytimeGetParams) (cloudflare.SpectrumAnalyticsEventBytimeGetResponse, error) #### Summaries Response Types: -- cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse +- cloudflare.SpectrumAnalyticsEventSummaryGetResponse Methods: -- client.Spectrums.Analytics.Events.Summaries.SpectrumAnalyticsSummaryGetAnalyticsSummary(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams) (cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse, error) +- client.Spectrum.Analytics.Events.Summaries.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventSummaryGetParams) (cloudflare.SpectrumAnalyticsEventSummaryGetResponse, error) ## Apps Response Types: -- cloudflare.SpectrumAppUpdateResponse +- cloudflare.SpectrumAppNewResponse +- cloudflare.SpectrumAppListResponse - cloudflare.SpectrumAppDeleteResponse - cloudflare.SpectrumAppGetResponse -- cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse -- cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponse +- cloudflare.SpectrumAppReplaceResponse Methods: -- client.Spectrums.Apps.Update(ctx context.Context, zone string, appID string, body cloudflare.SpectrumAppUpdateParams) (cloudflare.SpectrumAppUpdateResponse, error) -- client.Spectrums.Apps.Delete(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppDeleteResponse, error) -- client.Spectrums.Apps.Get(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppGetResponse, error) -- client.Spectrums.Apps.SpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin(ctx context.Context, zone string, body cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParams) (cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse, error) -- client.Spectrums.Apps.SpectrumApplicationsListSpectrumApplications(ctx context.Context, zone string, query cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams) ([]cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponse, error) +- client.Spectrum.Apps.New(ctx context.Context, zone string, body cloudflare.SpectrumAppNewParams) (cloudflare.SpectrumAppNewResponse, error) +- client.Spectrum.Apps.List(ctx context.Context, zone string, query cloudflare.SpectrumAppListParams) (shared.V4PagePaginationArray[cloudflare.SpectrumAppListResponse], error) +- client.Spectrum.Apps.Delete(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppDeleteResponse, error) +- client.Spectrum.Apps.Get(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppGetResponse, error) +- client.Spectrum.Apps.Replace(ctx context.Context, zone string, appID string, body cloudflare.SpectrumAppReplaceParams) (cloudflare.SpectrumAppReplaceResponse, error) # Addresses @@ -3168,47 +3053,47 @@ Methods: Response Types: -- cloudflare.AddressAddressMapAccountUpdateResponse - cloudflare.AddressAddressMapAccountDeleteResponse +- cloudflare.AddressAddressMapAccountReplaceResponse Methods: -- client.Addresses.AddressMaps.Accounts.Update(ctx context.Context, accountID string, addressMapID string) (cloudflare.AddressAddressMapAccountUpdateResponse, error) - client.Addresses.AddressMaps.Accounts.Delete(ctx context.Context, accountID string, addressMapID string) (cloudflare.AddressAddressMapAccountDeleteResponse, error) +- client.Addresses.AddressMaps.Accounts.Replace(ctx context.Context, accountID string, addressMapID string) (cloudflare.AddressAddressMapAccountReplaceResponse, error) ### IPs Response Types: -- cloudflare.AddressAddressMapIPUpdateResponse - cloudflare.AddressAddressMapIPDeleteResponse +- cloudflare.AddressAddressMapIPReplaceResponse Methods: -- client.Addresses.AddressMaps.IPs.Update(ctx context.Context, accountID string, addressMapID string, ipAddress string) (cloudflare.AddressAddressMapIPUpdateResponse, error) - client.Addresses.AddressMaps.IPs.Delete(ctx context.Context, accountID string, addressMapID string, ipAddress string) (cloudflare.AddressAddressMapIPDeleteResponse, error) +- client.Addresses.AddressMaps.IPs.Replace(ctx context.Context, accountID string, addressMapID string, ipAddress string) (cloudflare.AddressAddressMapIPReplaceResponse, error) ### Zones Response Types: -- cloudflare.AddressAddressMapZoneUpdateResponse - cloudflare.AddressAddressMapZoneDeleteResponse +- cloudflare.AddressAddressMapZoneReplaceResponse Methods: -- client.Addresses.AddressMaps.Zones.Update(ctx context.Context, accountID string, addressMapID string, zoneID string) (cloudflare.AddressAddressMapZoneUpdateResponse, error) - client.Addresses.AddressMaps.Zones.Delete(ctx context.Context, accountID string, addressMapID string, zoneID string) (cloudflare.AddressAddressMapZoneDeleteResponse, error) +- client.Addresses.AddressMaps.Zones.Replace(ctx context.Context, accountID string, addressMapID string, zoneID string) (cloudflare.AddressAddressMapZoneReplaceResponse, error) ## LoaDocuments Response Types: -- cloudflare.AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse +- cloudflare.AddressLoaDocumentNewResponse Methods: -- client.Addresses.LoaDocuments.IPAddressManagementPrefixesUploadLoaDocument(ctx context.Context, accountID string, body cloudflare.AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams) (cloudflare.AddressLoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, error) +- client.Addresses.LoaDocuments.New(ctx context.Context, accountID string, body cloudflare.AddressLoaDocumentNewParams) (cloudflare.AddressLoaDocumentNewResponse, error) ### Downloads @@ -3224,19 +3109,19 @@ Methods: Response Types: +- cloudflare.AddressPrefixNewResponse - cloudflare.AddressPrefixUpdateResponse +- cloudflare.AddressPrefixListResponse - cloudflare.AddressPrefixDeleteResponse - cloudflare.AddressPrefixGetResponse -- cloudflare.AddressPrefixIPAddressManagementPrefixesAddPrefixResponse -- cloudflare.AddressPrefixIPAddressManagementPrefixesListPrefixesResponse Methods: +- client.Addresses.Prefixes.New(ctx context.Context, accountID string, body cloudflare.AddressPrefixNewParams) (cloudflare.AddressPrefixNewResponse, error) - client.Addresses.Prefixes.Update(ctx context.Context, accountID string, prefixID string, body cloudflare.AddressPrefixUpdateParams) (cloudflare.AddressPrefixUpdateResponse, error) +- client.Addresses.Prefixes.List(ctx context.Context, accountID string) ([]cloudflare.AddressPrefixListResponse, error) - client.Addresses.Prefixes.Delete(ctx context.Context, accountID string, prefixID string) (cloudflare.AddressPrefixDeleteResponse, error) - client.Addresses.Prefixes.Get(ctx context.Context, accountID string, prefixID string) (cloudflare.AddressPrefixGetResponse, error) -- client.Addresses.Prefixes.IPAddressManagementPrefixesAddPrefix(ctx context.Context, accountID string, body cloudflare.AddressPrefixIPAddressManagementPrefixesAddPrefixParams) (cloudflare.AddressPrefixIPAddressManagementPrefixesAddPrefixResponse, error) -- client.Addresses.Prefixes.IPAddressManagementPrefixesListPrefixes(ctx context.Context, accountID string) ([]cloudflare.AddressPrefixIPAddressManagementPrefixesListPrefixesResponse, error) ### BGPs @@ -3244,37 +3129,37 @@ Methods: Response Types: -- cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse -- cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse +- cloudflare.AddressPrefixBGPStatusUpdateResponse +- cloudflare.AddressPrefixBGPStatusGetResponse Methods: -- client.Addresses.Prefixes.BGPs.Statuses.IPAddressManagementDynamicAdvertisementGetAdvertisementStatus(ctx context.Context, accountID string, prefixID string) (cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, error) -- client.Addresses.Prefixes.BGPs.Statuses.IPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatus(ctx context.Context, accountID string, prefixID string, body cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams) (cloudflare.AddressPrefixBGPStatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, error) +- client.Addresses.Prefixes.BGPs.Statuses.Update(ctx context.Context, accountID string, prefixID string, body cloudflare.AddressPrefixBGPStatusUpdateParams) (cloudflare.AddressPrefixBGPStatusUpdateResponse, error) +- client.Addresses.Prefixes.BGPs.Statuses.Get(ctx context.Context, accountID string, prefixID string) (cloudflare.AddressPrefixBGPStatusGetResponse, error) ### Delegations Response Types: +- cloudflare.AddressPrefixDelegationNewResponse +- cloudflare.AddressPrefixDelegationListResponse - cloudflare.AddressPrefixDelegationDeleteResponse -- cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse -- cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse Methods: +- client.Addresses.Prefixes.Delegations.New(ctx context.Context, accountID string, prefixID string, body cloudflare.AddressPrefixDelegationNewParams) (cloudflare.AddressPrefixDelegationNewResponse, error) +- client.Addresses.Prefixes.Delegations.List(ctx context.Context, accountID string, prefixID string) ([]cloudflare.AddressPrefixDelegationListResponse, error) - client.Addresses.Prefixes.Delegations.Delete(ctx context.Context, accountID string, prefixID string, delegationID string) (cloudflare.AddressPrefixDelegationDeleteResponse, error) -- client.Addresses.Prefixes.Delegations.IPAddressManagementPrefixDelegationNewPrefixDelegation(ctx context.Context, accountID string, prefixID string, body cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationParams) (cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationNewPrefixDelegationResponse, error) -- client.Addresses.Prefixes.Delegations.IPAddressManagementPrefixDelegationListPrefixDelegations(ctx context.Context, accountID string, prefixID string) ([]cloudflare.AddressPrefixDelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, error) # AuditLogs Response Types: -- cloudflare.AuditLogAuditLogsGetAccountAuditLogsResponse +- cloudflare.AuditLogListResponse Methods: -- client.AuditLogs.AuditLogsGetAccountAuditLogs(ctx context.Context, accountIdentifier string, query cloudflare.AuditLogAuditLogsGetAccountAuditLogsParams) (cloudflare.AuditLogAuditLogsGetAccountAuditLogsResponse, error) +- client.AuditLogs.List(ctx context.Context, accountIdentifier string, query cloudflare.AuditLogListParams) (shared.V4PagePaginationArray[cloudflare.AuditLogListResponse], error) # Billings @@ -3282,105 +3167,105 @@ Methods: Response Types: -- cloudflare.BillingProfileAccountBillingProfileBillingProfileDetailsResponse +- cloudflare.BillingProfileGetResponse Methods: -- client.Billings.Profiles.AccountBillingProfileBillingProfileDetails(ctx context.Context, accountIdentifier interface{}) (cloudflare.BillingProfileAccountBillingProfileBillingProfileDetailsResponse, error) +- client.Billings.Profiles.Get(ctx context.Context, accountIdentifier interface{}) (cloudflare.BillingProfileGetResponse, error) -# BrandProtections +# BrandProtection ## Submits Response Types: -- cloudflare.BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse +- cloudflare.BrandProtectionSubmitNewResponse Methods: -- client.BrandProtections.Submits.PhishingURLScannerSubmitSuspiciousURLForScanning(ctx context.Context, accountID string, body cloudflare.BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningParams) (cloudflare.BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse, error) +- client.BrandProtection.Submits.New(ctx context.Context, accountID string, body cloudflare.BrandProtectionSubmitNewParams) (cloudflare.BrandProtectionSubmitNewResponse, error) ## URLInfos Response Types: -- cloudflare.BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse +- cloudflare.BrandProtectionURLInfoGetResponse Methods: -- client.BrandProtections.URLInfos.PhishingURLInformationGetResultsForAURLScan(ctx context.Context, accountID string, query cloudflare.BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams) (cloudflare.BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse, error) +- client.BrandProtection.URLInfos.Get(ctx context.Context, accountID string, query cloudflare.BrandProtectionURLInfoGetParams) (cloudflare.BrandProtectionURLInfoGetResponse, error) -# CfdTunnels +# Tunnels Response Types: -- cloudflare.CfdTunnelUpdateResponse -- cloudflare.CfdTunnelDeleteResponse -- cloudflare.CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse -- cloudflare.CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse -- cloudflare.CfdTunnelGetResponse +- cloudflare.TunnelNewResponse +- cloudflare.TunnelUpdateResponse +- cloudflare.TunnelListResponse +- cloudflare.TunnelDeleteResponse +- cloudflare.TunnelGetResponse Methods: -- client.CfdTunnels.Update(ctx context.Context, accountID string, tunnelID string, body cloudflare.CfdTunnelUpdateParams) (cloudflare.CfdTunnelUpdateResponse, error) -- client.CfdTunnels.Delete(ctx context.Context, accountID string, tunnelID string, body cloudflare.CfdTunnelDeleteParams) (cloudflare.CfdTunnelDeleteResponse, error) -- client.CfdTunnels.CloudflareTunnelNewACloudflareTunnel(ctx context.Context, accountID string, body cloudflare.CfdTunnelCloudflareTunnelNewACloudflareTunnelParams) (cloudflare.CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse, error) -- client.CfdTunnels.CloudflareTunnelListCloudflareTunnels(ctx context.Context, accountID string, query cloudflare.CfdTunnelCloudflareTunnelListCloudflareTunnelsParams) ([]cloudflare.CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse, error) -- client.CfdTunnels.Get(ctx context.Context, accountID string, tunnelID string) (cloudflare.CfdTunnelGetResponse, error) +- client.Tunnels.New(ctx context.Context, accountID string, body cloudflare.TunnelNewParams) (cloudflare.TunnelNewResponse, error) +- client.Tunnels.Update(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelUpdateParams) (cloudflare.TunnelUpdateResponse, error) +- client.Tunnels.List(ctx context.Context, accountID string, query cloudflare.TunnelListParams) (shared.V4PagePaginationArray[cloudflare.TunnelListResponse], error) +- client.Tunnels.Delete(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelDeleteParams) (cloudflare.TunnelDeleteResponse, error) +- client.Tunnels.Get(ctx context.Context, accountID string, tunnelID string) (cloudflare.TunnelGetResponse, error) ## Configurations Response Types: -- cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse -- cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse +- cloudflare.TunnelConfigurationListResponse +- cloudflare.TunnelConfigurationReplaceResponse Methods: -- client.CfdTunnels.Configurations.CloudflareTunnelConfigurationGetConfiguration(ctx context.Context, accountID string, tunnelID string) (cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse, error) -- client.CfdTunnels.Configurations.CloudflareTunnelConfigurationPutConfiguration(ctx context.Context, accountID string, tunnelID string, body cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParams) (cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse, error) +- client.Tunnels.Configurations.List(ctx context.Context, accountID string, tunnelID string) (cloudflare.TunnelConfigurationListResponse, error) +- client.Tunnels.Configurations.Replace(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelConfigurationReplaceParams) (cloudflare.TunnelConfigurationReplaceResponse, error) ## Connections Response Types: -- cloudflare.CfdTunnelConnectionDeleteResponse -- cloudflare.CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse +- cloudflare.TunnelConnectionListResponse +- cloudflare.TunnelConnectionDeleteResponse Methods: -- client.CfdTunnels.Connections.Delete(ctx context.Context, accountID string, tunnelID string, params cloudflare.CfdTunnelConnectionDeleteParams) (cloudflare.CfdTunnelConnectionDeleteResponse, error) -- client.CfdTunnels.Connections.CloudflareTunnelListCloudflareTunnelConnections(ctx context.Context, accountID string, tunnelID string) ([]cloudflare.CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse, error) +- client.Tunnels.Connections.List(ctx context.Context, accountID string, tunnelID string) ([]cloudflare.TunnelConnectionListResponse, error) +- client.Tunnels.Connections.Delete(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelConnectionDeleteParams) (cloudflare.TunnelConnectionDeleteResponse, error) ## Tokens Response Types: -- cloudflare.CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse +- cloudflare.TunnelTokenGetResponse Methods: -- client.CfdTunnels.Tokens.CloudflareTunnelGetACloudflareTunnelToken(ctx context.Context, accountID string, tunnelID string) (cloudflare.CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse, error) +- client.Tunnels.Tokens.Get(ctx context.Context, accountID string, tunnelID string) (cloudflare.TunnelTokenGetResponse, error) ## Connectors Response Types: -- cloudflare.CfdTunnelConnectorGetResponse +- cloudflare.TunnelConnectorGetResponse Methods: -- client.CfdTunnels.Connectors.Get(ctx context.Context, accountID string, tunnelID string, connectorID string) (cloudflare.CfdTunnelConnectorGetResponse, error) +- client.Tunnels.Connectors.Get(ctx context.Context, accountID string, tunnelID string, connectorID string) (cloudflare.TunnelConnectorGetResponse, error) ## Management Response Types: -- cloudflare.CfdTunnelManagementNewResponse +- cloudflare.TunnelManagementNewResponse Methods: -- client.CfdTunnels.Management.New(ctx context.Context, accountID string, tunnelID string, body cloudflare.CfdTunnelManagementNewParams) (cloudflare.CfdTunnelManagementNewResponse, error) +- client.Tunnels.Management.New(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelManagementNewParams) (cloudflare.TunnelManagementNewResponse, error) # Diagnostics @@ -3388,79 +3273,106 @@ Methods: Response Types: -- cloudflare.DiagnosticTracerouteDiagnosticsTracerouteResponse +- cloudflare.DiagnosticTracerouteNewResponse Methods: -- client.Diagnostics.Traceroutes.DiagnosticsTraceroute(ctx context.Context, accountID string, body cloudflare.DiagnosticTracerouteDiagnosticsTracerouteParams) ([]cloudflare.DiagnosticTracerouteDiagnosticsTracerouteResponse, error) +- client.Diagnostics.Traceroutes.New(ctx context.Context, accountID string, body cloudflare.DiagnosticTracerouteNewParams) ([]cloudflare.DiagnosticTracerouteNewResponse, error) -# DLPs +# DLP -## Patterns +## Datasets + +Response Types: + +- cloudflare.DLPDatasetNewResponse +- cloudflare.DLPDatasetListResponse +- cloudflare.DLPDatasetGetResponse +- cloudflare.DLPDatasetReplaceResponse + +Methods: + +- client.DLP.Datasets.New(ctx context.Context, accountID string, body cloudflare.DLPDatasetNewParams) (cloudflare.DLPDatasetNewResponse, error) +- client.DLP.Datasets.List(ctx context.Context, accountID string) ([]cloudflare.DLPDatasetListResponse, error) +- client.DLP.Datasets.Delete(ctx context.Context, accountID string, datasetID string) error +- client.DLP.Datasets.Get(ctx context.Context, accountID string, datasetID string) (cloudflare.DLPDatasetGetResponse, error) +- client.DLP.Datasets.Replace(ctx context.Context, accountID string, datasetID string, body cloudflare.DLPDatasetReplaceParams) (cloudflare.DLPDatasetReplaceResponse, error) -### Validates +### Upload Response Types: -- cloudflare.DLPPatternValidateDLPPatternValidationValidatePatternResponse +- cloudflare.DLPDatasetUploadNewResponse +- cloudflare.DLPDatasetUploadUpdateResponse Methods: -- client.DLPs.Patterns.Validates.DLPPatternValidationValidatePattern(ctx context.Context, accountID string, body cloudflare.DLPPatternValidateDLPPatternValidationValidatePatternParams) (cloudflare.DLPPatternValidateDLPPatternValidationValidatePatternResponse, error) +- client.DLP.Datasets.Upload.New(ctx context.Context, accountID string, datasetID string) (cloudflare.DLPDatasetUploadNewResponse, error) +- client.DLP.Datasets.Upload.Update(ctx context.Context, accountID string, datasetID string, version int64) (cloudflare.DLPDatasetUploadUpdateResponse, error) + +## Patterns + +Response Types: + +- cloudflare.DLPPatternValidateResponse + +Methods: + +- client.DLP.Patterns.Validate(ctx context.Context, accountID string, body cloudflare.DLPPatternValidateParams) (cloudflare.DLPPatternValidateResponse, error) ## PayloadLogs Response Types: -- cloudflare.DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse -- cloudflare.DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse +- cloudflare.DLPPayloadLogGetResponse +- cloudflare.DLPPayloadLogReplaceResponse Methods: -- client.DLPs.PayloadLogs.DLPPayloadLogSettingsGetSettings(ctx context.Context, accountID string) (cloudflare.DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse, error) -- client.DLPs.PayloadLogs.DLPPayloadLogSettingsUpdateSettings(ctx context.Context, accountID string, body cloudflare.DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsParams) (cloudflare.DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse, error) +- client.DLP.PayloadLogs.Get(ctx context.Context, accountID string) (cloudflare.DLPPayloadLogGetResponse, error) +- client.DLP.PayloadLogs.Replace(ctx context.Context, accountID string, body cloudflare.DLPPayloadLogReplaceParams) (cloudflare.DLPPayloadLogReplaceResponse, error) ## Profiles Response Types: -- cloudflare.DLPProfileDLPProfilesListAllProfilesResponse +- cloudflare.DLPProfileListResponse - cloudflare.DLPProfileGetResponse Methods: -- client.DLPs.Profiles.DLPProfilesListAllProfiles(ctx context.Context, accountID string) ([]cloudflare.DLPProfileDLPProfilesListAllProfilesResponse, error) -- client.DLPs.Profiles.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileGetResponse, error) +- client.DLP.Profiles.List(ctx context.Context, accountID string) ([]cloudflare.DLPProfileListResponse, error) +- client.DLP.Profiles.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileGetResponse, error) ### Customs Response Types: -- cloudflare.DLPProfileCustomUpdateResponse +- cloudflare.DLPProfileCustomNewResponse - cloudflare.DLPProfileCustomDeleteResponse -- cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesResponse - cloudflare.DLPProfileCustomGetResponse +- cloudflare.DLPProfileCustomReplaceResponse Methods: -- client.DLPs.Profiles.Customs.Update(ctx context.Context, accountID string, profileID string, body cloudflare.DLPProfileCustomUpdateParams) (cloudflare.DLPProfileCustomUpdateResponse, error) -- client.DLPs.Profiles.Customs.Delete(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileCustomDeleteResponse, error) -- client.DLPs.Profiles.Customs.DLPProfilesNewCustomProfiles(ctx context.Context, accountID string, body cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParams) ([]cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesResponse, error) -- client.DLPs.Profiles.Customs.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileCustomGetResponse, error) +- client.DLP.Profiles.Customs.New(ctx context.Context, accountID string, body cloudflare.DLPProfileCustomNewParams) ([]cloudflare.DLPProfileCustomNewResponse, error) +- client.DLP.Profiles.Customs.Delete(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileCustomDeleteResponse, error) +- client.DLP.Profiles.Customs.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfileCustomGetResponse, error) +- client.DLP.Profiles.Customs.Replace(ctx context.Context, accountID string, profileID string, body cloudflare.DLPProfileCustomReplaceParams) (cloudflare.DLPProfileCustomReplaceResponse, error) ### Predefineds Response Types: -- cloudflare.DLPProfilePredefinedUpdateResponse - cloudflare.DLPProfilePredefinedGetResponse +- cloudflare.DLPProfilePredefinedReplaceResponse Methods: -- client.DLPs.Profiles.Predefineds.Update(ctx context.Context, accountID string, profileID string, body cloudflare.DLPProfilePredefinedUpdateParams) (cloudflare.DLPProfilePredefinedUpdateResponse, error) -- client.DLPs.Profiles.Predefineds.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfilePredefinedGetResponse, error) +- client.DLP.Profiles.Predefineds.Get(ctx context.Context, accountID string, profileID string) (cloudflare.DLPProfilePredefinedGetResponse, error) +- client.DLP.Profiles.Predefineds.Replace(ctx context.Context, accountID string, profileID string, body cloudflare.DLPProfilePredefinedReplaceParams) (cloudflare.DLPProfilePredefinedReplaceResponse, error) -# DNSFirewalls +# DNSFirewall Response Types: @@ -3472,11 +3384,11 @@ Response Types: Methods: -- client.DNSFirewalls.New(ctx context.Context, accountID string, body cloudflare.DNSFirewallNewParams) (cloudflare.DNSFirewallNewResponse, error) -- client.DNSFirewalls.Update(ctx context.Context, accountID string, dnsFirewallID string, body cloudflare.DNSFirewallUpdateParams) (cloudflare.DNSFirewallUpdateResponse, error) -- client.DNSFirewalls.List(ctx context.Context, accountID string, query cloudflare.DNSFirewallListParams) (shared.V4PagePaginationArray[cloudflare.DNSFirewallListResponse], error) -- client.DNSFirewalls.Delete(ctx context.Context, accountID string, dnsFirewallID string) (cloudflare.DNSFirewallDeleteResponse, error) -- client.DNSFirewalls.Get(ctx context.Context, accountID string, dnsFirewallID string) (cloudflare.DNSFirewallGetResponse, error) +- client.DNSFirewall.New(ctx context.Context, accountID string, body cloudflare.DNSFirewallNewParams) (cloudflare.DNSFirewallNewResponse, error) +- client.DNSFirewall.Update(ctx context.Context, accountID string, dnsFirewallID string, body cloudflare.DNSFirewallUpdateParams) (cloudflare.DNSFirewallUpdateResponse, error) +- client.DNSFirewall.List(ctx context.Context, accountID string, query cloudflare.DNSFirewallListParams) (shared.V4PagePaginationArray[cloudflare.DNSFirewallListResponse], error) +- client.DNSFirewall.Delete(ctx context.Context, accountID string, dnsFirewallID string) (cloudflare.DNSFirewallDeleteResponse, error) +- client.DNSFirewall.Get(ctx context.Context, accountID string, dnsFirewallID string) (cloudflare.DNSFirewallGetResponse, error) ## DNSAnalytics @@ -3488,7 +3400,7 @@ Response Types: Methods: -- client.DNSFirewalls.DNSAnalytics.Reports.List(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallDNSAnalyticReportListParams) (cloudflare.DNSFirewallDNSAnalyticReportListResponse, error) +- client.DNSFirewall.DNSAnalytics.Reports.List(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallDNSAnalyticReportListParams) (cloudflare.DNSFirewallDNSAnalyticReportListResponse, error) #### Bytimes @@ -3498,7 +3410,7 @@ Response Types: Methods: -- client.DNSFirewalls.DNSAnalytics.Reports.Bytimes.List(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallDNSAnalyticReportBytimeListParams) (cloudflare.DNSFirewallDNSAnalyticReportBytimeListResponse, error) +- client.DNSFirewall.DNSAnalytics.Reports.Bytimes.List(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallDNSAnalyticReportBytimeListParams) (cloudflare.DNSFirewallDNSAnalyticReportBytimeListResponse, error) # Images @@ -3506,63 +3418,63 @@ Methods: Response Types: +- cloudflare.ImageV1NewResponse - cloudflare.ImageV1UpdateResponse +- cloudflare.ImageV1ListResponse - cloudflare.ImageV1DeleteResponse -- cloudflare.ImageV1CloudflareImagesListImagesResponse -- cloudflare.ImageV1CloudflareImagesUploadAnImageViaURLResponse - cloudflare.ImageV1GetResponse Methods: +- client.Images.V1s.New(ctx context.Context, accountID string, body cloudflare.ImageV1NewParams) (cloudflare.ImageV1NewResponse, error) - client.Images.V1s.Update(ctx context.Context, accountID string, imageID string, body cloudflare.ImageV1UpdateParams) (cloudflare.ImageV1UpdateResponse, error) +- client.Images.V1s.List(ctx context.Context, accountID string, query cloudflare.ImageV1ListParams) (shared.V4PagePagination[cloudflare.ImageV1ListResponse], error) - client.Images.V1s.Delete(ctx context.Context, accountID string, imageID string) (cloudflare.ImageV1DeleteResponse, error) -- client.Images.V1s.CloudflareImagesListImages(ctx context.Context, accountID string, query cloudflare.ImageV1CloudflareImagesListImagesParams) (cloudflare.ImageV1CloudflareImagesListImagesResponse, error) -- client.Images.V1s.CloudflareImagesUploadAnImageViaURL(ctx context.Context, accountID string, body cloudflare.ImageV1CloudflareImagesUploadAnImageViaURLParams) (cloudflare.ImageV1CloudflareImagesUploadAnImageViaURLResponse, error) - client.Images.V1s.Get(ctx context.Context, accountID string, imageID string) (cloudflare.ImageV1GetResponse, error) ### Keys Response Types: -- cloudflare.ImageV1KeyCloudflareImagesKeysListSigningKeysResponse +- cloudflare.ImageV1KeyListResponse Methods: -- client.Images.V1s.Keys.CloudflareImagesKeysListSigningKeys(ctx context.Context, accountID string) (cloudflare.ImageV1KeyCloudflareImagesKeysListSigningKeysResponse, error) +- client.Images.V1s.Keys.List(ctx context.Context, accountID string) (cloudflare.ImageV1KeyListResponse, error) ### Stats Response Types: -- cloudflare.ImageV1StatCloudflareImagesImagesUsageStatisticsResponse +- cloudflare.ImageV1StatGetResponse Methods: -- client.Images.V1s.Stats.CloudflareImagesImagesUsageStatistics(ctx context.Context, accountID string) (cloudflare.ImageV1StatCloudflareImagesImagesUsageStatisticsResponse, error) +- client.Images.V1s.Stats.Get(ctx context.Context, accountID string) (cloudflare.ImageV1StatGetResponse, error) ### Variants Response Types: +- cloudflare.ImageV1VariantNewResponse - cloudflare.ImageV1VariantUpdateResponse +- cloudflare.ImageV1VariantListResponse - cloudflare.ImageV1VariantDeleteResponse -- cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantResponse -- cloudflare.ImageV1VariantCloudflareImagesVariantsListVariantsResponse - cloudflare.ImageV1VariantGetResponse Methods: +- client.Images.V1s.Variants.New(ctx context.Context, accountID string, body cloudflare.ImageV1VariantNewParams) (cloudflare.ImageV1VariantNewResponse, error) - client.Images.V1s.Variants.Update(ctx context.Context, accountID string, variantID interface{}, body cloudflare.ImageV1VariantUpdateParams) (cloudflare.ImageV1VariantUpdateResponse, error) +- client.Images.V1s.Variants.List(ctx context.Context, accountID string) (cloudflare.ImageV1VariantListResponse, error) - client.Images.V1s.Variants.Delete(ctx context.Context, accountID string, variantID interface{}) (cloudflare.ImageV1VariantDeleteResponse, error) -- client.Images.V1s.Variants.CloudflareImagesVariantsNewAVariant(ctx context.Context, accountID string, body cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantParams) (cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantResponse, error) -- client.Images.V1s.Variants.CloudflareImagesVariantsListVariants(ctx context.Context, accountID string) (cloudflare.ImageV1VariantCloudflareImagesVariantsListVariantsResponse, error) - client.Images.V1s.Variants.Get(ctx context.Context, accountID string, variantID interface{}) (cloudflare.ImageV1VariantGetResponse, error) ### Blobs Methods: -- client.Images.V1s.Blobs.CloudflareImagesBaseImage(ctx context.Context, accountID string, imageID string) (http.Response, error) +- client.Images.V1s.Blobs.Get(ctx context.Context, accountID string, imageID string) (http.Response, error) ## V2s @@ -3579,19 +3491,19 @@ Methods: Response Types: -- cloudflare.ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response +- cloudflare.ImageV2DirectUploadNewResponse Methods: -- client.Images.V2s.DirectUploads.CloudflareImagesNewAuthenticatedDirectUploadURLV2(ctx context.Context, accountID string, body cloudflare.ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params) (cloudflare.ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response, error) +- client.Images.V2s.DirectUploads.New(ctx context.Context, accountID string, body cloudflare.ImageV2DirectUploadNewParams) (cloudflare.ImageV2DirectUploadNewResponse, error) -# Intels +# Intel ## Asn Methods: -- client.Intels.Asn.Get(ctx context.Context, accountID string, asn int64) (int64, error) +- client.Intel.Asn.Get(ctx context.Context, accountID string, asn int64) (int64, error) ### Subnets @@ -3601,37 +3513,37 @@ Response Types: Methods: -- client.Intels.Asn.Subnets.List(ctx context.Context, accountID string, asn int64) (cloudflare.IntelAsnSubnetListResponse, error) +- client.Intel.Asn.Subnets.List(ctx context.Context, accountID string, asn int64) (cloudflare.IntelAsnSubnetListResponse, error) ## DNS Response Types: -- cloudflare.IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse +- cloudflare.IntelDNSGetResponse Methods: -- client.Intels.DNS.PassiveDNSByIPGetPassiveDNSByIP(ctx context.Context, accountID string, query cloudflare.IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams) (cloudflare.IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse, error) +- client.Intel.DNS.Get(ctx context.Context, accountID string, query cloudflare.IntelDNSGetParams) (cloudflare.IntelDNSGetResponse, error) ## Domains Response Types: -- cloudflare.IntelDomainDomainIntelligenceGetDomainDetailsResponse +- cloudflare.IntelDomainGetResponse Methods: -- client.Intels.Domains.DomainIntelligenceGetDomainDetails(ctx context.Context, accountID string, query cloudflare.IntelDomainDomainIntelligenceGetDomainDetailsParams) (cloudflare.IntelDomainDomainIntelligenceGetDomainDetailsResponse, error) +- client.Intel.Domains.Get(ctx context.Context, accountID string, query cloudflare.IntelDomainGetParams) (cloudflare.IntelDomainGetResponse, error) ### Bulks Response Types: -- cloudflare.IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse +- cloudflare.IntelDomainBulkGetResponse Methods: -- client.Intels.Domains.Bulks.DomainIntelligenceGetMultipleDomainDetails(ctx context.Context, accountID string, query cloudflare.IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams) ([]cloudflare.IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse, error) +- client.Intel.Domains.Bulks.Get(ctx context.Context, accountID string, query cloudflare.IntelDomainBulkGetParams) ([]cloudflare.IntelDomainBulkGetResponse, error) ## DomainHistories @@ -3641,47 +3553,88 @@ Response Types: Methods: -- client.Intels.DomainHistories.List(ctx context.Context, accountID string, query cloudflare.IntelDomainHistoryListParams) ([]cloudflare.IntelDomainHistoryListResponse, error) +- client.Intel.DomainHistories.List(ctx context.Context, accountID string, query cloudflare.IntelDomainHistoryListParams) ([]cloudflare.IntelDomainHistoryListResponse, error) ## IPs Response Types: -- cloudflare.IntelIpipIntelligenceGetIPOverviewResponse +- cloudflare.IntelIPGetResponse Methods: -- client.Intels.IPs.IPIntelligenceGetIPOverview(ctx context.Context, accountID string, query cloudflare.IntelIPIPIntelligenceGetIPOverviewParams) ([]cloudflare.IntelIpipIntelligenceGetIPOverviewResponse, error) +- client.Intel.IPs.Get(ctx context.Context, accountID string, query cloudflare.IntelIPGetParams) ([]cloudflare.IntelIPGetResponse, error) ## IPLists Response Types: -- cloudflare.IntelIPListIPListGetIPListsResponse +- cloudflare.IntelIPListGetResponse Methods: -- client.Intels.IPLists.IPListGetIPLists(ctx context.Context, accountID string) ([]cloudflare.IntelIPListIPListGetIPListsResponse, error) +- client.Intel.IPLists.Get(ctx context.Context, accountID string) ([]cloudflare.IntelIPListGetResponse, error) ## Miscategorizations Response Types: -- cloudflare.IntelMiscategorizationMiscategorizationNewMiscategorizationResponse +- cloudflare.IntelMiscategorizationNewResponse Methods: -- client.Intels.Miscategorizations.MiscategorizationNewMiscategorization(ctx context.Context, accountID string, body cloudflare.IntelMiscategorizationMiscategorizationNewMiscategorizationParams) (cloudflare.IntelMiscategorizationMiscategorizationNewMiscategorizationResponse, error) +- client.Intel.Miscategorizations.New(ctx context.Context, accountID string, body cloudflare.IntelMiscategorizationNewParams) (cloudflare.IntelMiscategorizationNewResponse, error) ## Whois Response Types: -- cloudflare.IntelWhoisWhoisRecordGetWhoisRecordResponse +- cloudflare.IntelWhoisGetResponse Methods: -- client.Intels.Whois.WhoisRecordGetWhoisRecord(ctx context.Context, accountID string, query cloudflare.IntelWhoisWhoisRecordGetWhoisRecordParams) (cloudflare.IntelWhoisWhoisRecordGetWhoisRecordResponse, error) +- client.Intel.Whois.Get(ctx context.Context, accountID string, query cloudflare.IntelWhoisGetParams) (cloudflare.IntelWhoisGetResponse, error) + +## IndicatorFeeds + +Response Types: + +- cloudflare.IntelIndicatorFeedNewResponse +- cloudflare.IntelIndicatorFeedListResponse +- cloudflare.IntelIndicatorFeedGetResponse +- cloudflare.IntelIndicatorFeedReplaceResponse + +Methods: + +- client.Intel.IndicatorFeeds.New(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedNewParams) (cloudflare.IntelIndicatorFeedNewResponse, error) +- client.Intel.IndicatorFeeds.List(ctx context.Context, accountID string) ([]cloudflare.IntelIndicatorFeedListResponse, error) +- client.Intel.IndicatorFeeds.Data(ctx context.Context, accountID string, feedID int64) (string, error) +- client.Intel.IndicatorFeeds.Get(ctx context.Context, accountID string, feedID int64) (cloudflare.IntelIndicatorFeedGetResponse, error) +- client.Intel.IndicatorFeeds.Replace(ctx context.Context, accountID string, feedID int64, body cloudflare.IntelIndicatorFeedReplaceParams) (cloudflare.IntelIndicatorFeedReplaceResponse, error) + +### Permissions + +Response Types: + +- cloudflare.IntelIndicatorFeedPermissionNewResponse +- cloudflare.IntelIndicatorFeedPermissionListResponse +- cloudflare.IntelIndicatorFeedPermissionDeleteResponse + +Methods: + +- client.Intel.IndicatorFeeds.Permissions.New(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedPermissionNewParams) (cloudflare.IntelIndicatorFeedPermissionNewResponse, error) +- client.Intel.IndicatorFeeds.Permissions.List(ctx context.Context, accountID string) ([]cloudflare.IntelIndicatorFeedPermissionListResponse, error) +- client.Intel.IndicatorFeeds.Permissions.Delete(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedPermissionDeleteParams) (cloudflare.IntelIndicatorFeedPermissionDeleteResponse, error) + +## Sinkholes + +Response Types: + +- cloudflare.IntelSinkholeListResponse + +Methods: + +- client.Intel.Sinkholes.List(ctx context.Context, accountID string) ([]cloudflare.IntelSinkholeListResponse, error) # Magics @@ -3689,105 +3642,97 @@ Methods: Response Types: -- cloudflare.MagicCfInterconnectUpdateResponse +- cloudflare.MagicCfInterconnectListResponse - cloudflare.MagicCfInterconnectGetResponse -- cloudflare.MagicCfInterconnectMagicInterconnectsListInterconnectsResponse -- cloudflare.MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse +- cloudflare.MagicCfInterconnectReplaceResponse Methods: -- client.Magics.CfInterconnects.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicCfInterconnectUpdateParams) (cloudflare.MagicCfInterconnectUpdateResponse, error) +- client.Magics.CfInterconnects.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicCfInterconnectListResponse, error) - client.Magics.CfInterconnects.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicCfInterconnectGetResponse, error) -- client.Magics.CfInterconnects.MagicInterconnectsListInterconnects(ctx context.Context, accountIdentifier string) (cloudflare.MagicCfInterconnectMagicInterconnectsListInterconnectsResponse, error) -- client.Magics.CfInterconnects.MagicInterconnectsUpdateMultipleInterconnects(ctx context.Context, accountIdentifier string, body cloudflare.MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsParams) (cloudflare.MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse, error) +- client.Magics.CfInterconnects.Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicCfInterconnectReplaceParams) (cloudflare.MagicCfInterconnectReplaceResponse, error) ## GreTunnels Response Types: -- cloudflare.MagicGreTunnelUpdateResponse +- cloudflare.MagicGreTunnelNewResponse +- cloudflare.MagicGreTunnelListResponse - cloudflare.MagicGreTunnelDeleteResponse - cloudflare.MagicGreTunnelGetResponse -- cloudflare.MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse -- cloudflare.MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse -- cloudflare.MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse +- cloudflare.MagicGreTunnelReplaceResponse Methods: -- client.Magics.GreTunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicGreTunnelUpdateParams) (cloudflare.MagicGreTunnelUpdateResponse, error) +- client.Magics.GreTunnels.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicGreTunnelNewParams) (cloudflare.MagicGreTunnelNewResponse, error) +- client.Magics.GreTunnels.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicGreTunnelListResponse, error) - client.Magics.GreTunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicGreTunnelDeleteResponse, error) - client.Magics.GreTunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicGreTunnelGetResponse, error) -- client.Magics.GreTunnels.MagicGreTunnelsNewGreTunnels(ctx context.Context, accountIdentifier string, body cloudflare.MagicGreTunnelMagicGreTunnelsNewGreTunnelsParams) (cloudflare.MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse, error) -- client.Magics.GreTunnels.MagicGreTunnelsListGreTunnels(ctx context.Context, accountIdentifier string) (cloudflare.MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse, error) -- client.Magics.GreTunnels.MagicGreTunnelsUpdateMultipleGreTunnels(ctx context.Context, accountIdentifier string, body cloudflare.MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsParams) (cloudflare.MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse, error) +- client.Magics.GreTunnels.Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicGreTunnelReplaceParams) (cloudflare.MagicGreTunnelReplaceResponse, error) ## IpsecTunnels Response Types: -- cloudflare.MagicIpsecTunnelUpdateResponse +- cloudflare.MagicIpsecTunnelNewResponse +- cloudflare.MagicIpsecTunnelListResponse - cloudflare.MagicIpsecTunnelDeleteResponse - cloudflare.MagicIpsecTunnelGetResponse -- cloudflare.MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse -- cloudflare.MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse -- cloudflare.MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse +- cloudflare.MagicIpsecTunnelReplaceResponse Methods: -- client.Magics.IpsecTunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicIpsecTunnelUpdateParams) (cloudflare.MagicIpsecTunnelUpdateResponse, error) +- client.Magics.IpsecTunnels.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicIpsecTunnelNewParams) (cloudflare.MagicIpsecTunnelNewResponse, error) +- client.Magics.IpsecTunnels.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicIpsecTunnelListResponse, error) - client.Magics.IpsecTunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicIpsecTunnelDeleteResponse, error) - client.Magics.IpsecTunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicIpsecTunnelGetResponse, error) -- client.Magics.IpsecTunnels.MagicIPsecTunnelsNewIPsecTunnels(ctx context.Context, accountIdentifier string, body cloudflare.MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams) (cloudflare.MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse, error) -- client.Magics.IpsecTunnels.MagicIPsecTunnelsListIPsecTunnels(ctx context.Context, accountIdentifier string) (cloudflare.MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse, error) -- client.Magics.IpsecTunnels.MagicIPsecTunnelsUpdateMultipleIPsecTunnels(ctx context.Context, accountIdentifier string, body cloudflare.MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsParams) (cloudflare.MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse, error) +- client.Magics.IpsecTunnels.Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicIpsecTunnelReplaceParams) (cloudflare.MagicIpsecTunnelReplaceResponse, error) ### PskGenerates Response Types: -- cloudflare.MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse +- cloudflare.MagicIpsecTunnelPskGenerateNewResponse Methods: -- client.Magics.IpsecTunnels.PskGenerates.MagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnels(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse, error) +- client.Magics.IpsecTunnels.PskGenerates.New(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicIpsecTunnelPskGenerateNewResponse, error) ## Routes Response Types: -- cloudflare.MagicRouteUpdateResponse +- cloudflare.MagicRouteNewResponse - cloudflare.MagicRouteDeleteResponse - cloudflare.MagicRouteGetResponse -- cloudflare.MagicRouteMagicStaticRoutesNewRoutesResponse - cloudflare.MagicRouteMagicStaticRoutesListRoutesResponse -- cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesResponse +- cloudflare.MagicRouteReplaceResponse Methods: -- client.Magics.Routes.Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body cloudflare.MagicRouteUpdateParams) (cloudflare.MagicRouteUpdateResponse, error) +- client.Magics.Routes.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicRouteNewParams) (cloudflare.MagicRouteNewResponse, error) - client.Magics.Routes.Delete(ctx context.Context, accountIdentifier string, routeIdentifier string) (cloudflare.MagicRouteDeleteResponse, error) - client.Magics.Routes.Get(ctx context.Context, accountIdentifier string, routeIdentifier string) (cloudflare.MagicRouteGetResponse, error) -- client.Magics.Routes.MagicStaticRoutesNewRoutes(ctx context.Context, accountIdentifier string, body cloudflare.MagicRouteMagicStaticRoutesNewRoutesParams) (cloudflare.MagicRouteMagicStaticRoutesNewRoutesResponse, error) - client.Magics.Routes.MagicStaticRoutesListRoutes(ctx context.Context, accountIdentifier string) (cloudflare.MagicRouteMagicStaticRoutesListRoutesResponse, error) -- client.Magics.Routes.MagicStaticRoutesUpdateManyRoutes(ctx context.Context, accountIdentifier string, body cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParams) (cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesResponse, error) +- client.Magics.Routes.Replace(ctx context.Context, accountIdentifier string, routeIdentifier string, body cloudflare.MagicRouteReplaceParams) (cloudflare.MagicRouteReplaceResponse, error) # AccountMembers Response Types: - cloudflare.AccountMemberNewResponse -- cloudflare.AccountMemberUpdateResponse - cloudflare.AccountMemberListResponse - cloudflare.AccountMemberDeleteResponse - cloudflare.AccountMemberGetResponse +- cloudflare.AccountMemberReplaceResponse Methods: - client.AccountMembers.New(ctx context.Context, accountID interface{}, body cloudflare.AccountMemberNewParams) (cloudflare.AccountMemberNewResponse, error) -- client.AccountMembers.Update(ctx context.Context, accountID interface{}, memberID string, body cloudflare.AccountMemberUpdateParams) (cloudflare.AccountMemberUpdateResponse, error) - client.AccountMembers.List(ctx context.Context, accountID interface{}, query cloudflare.AccountMemberListParams) (shared.V4PagePaginationArray[cloudflare.AccountMemberListResponse], error) - client.AccountMembers.Delete(ctx context.Context, accountID interface{}, memberID string) (cloudflare.AccountMemberDeleteResponse, error) - client.AccountMembers.Get(ctx context.Context, accountID interface{}, memberID string) (cloudflare.AccountMemberGetResponse, error) +- client.AccountMembers.Replace(ctx context.Context, accountID interface{}, memberID string, body cloudflare.AccountMemberReplaceParams) (cloudflare.AccountMemberReplaceResponse, error) # Mnms @@ -3795,72 +3740,72 @@ Methods: Response Types: +- cloudflare.MnmConfigNewResponse +- cloudflare.MnmConfigUpdateResponse +- cloudflare.MnmConfigListResponse - cloudflare.MnmConfigDeleteResponse -- cloudflare.MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse -- cloudflare.MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse -- cloudflare.MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse -- cloudflare.MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse +- cloudflare.MnmConfigReplaceResponse Methods: +- client.Mnms.Configs.New(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigNewResponse, error) +- client.Mnms.Configs.Update(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigUpdateResponse, error) +- client.Mnms.Configs.List(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigListResponse, error) - client.Mnms.Configs.Delete(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigDeleteResponse, error) -- client.Mnms.Configs.MagicNetworkMonitoringConfigurationNewAccountConfiguration(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse, error) -- client.Mnms.Configs.MagicNetworkMonitoringConfigurationListAccountConfiguration(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse, error) -- client.Mnms.Configs.MagicNetworkMonitoringConfigurationUpdateAccountConfigurationFields(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse, error) -- client.Mnms.Configs.MagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfiguration(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse, error) +- client.Mnms.Configs.Replace(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigReplaceResponse, error) ### Fulls Response Types: -- cloudflare.MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse +- cloudflare.MnmConfigFullListResponse Methods: -- client.Mnms.Configs.Fulls.MagicNetworkMonitoringConfigurationListRulesAndAccountConfiguration(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse, error) +- client.Mnms.Configs.Fulls.List(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmConfigFullListResponse, error) ## Rules Response Types: +- cloudflare.MnmRuleNewResponse - cloudflare.MnmRuleUpdateResponse +- cloudflare.MnmRuleListResponse - cloudflare.MnmRuleDeleteResponse - cloudflare.MnmRuleGetResponse -- cloudflare.MnmRuleMagicNetworkMonitoringRulesNewRulesResponse -- cloudflare.MnmRuleMagicNetworkMonitoringRulesListRulesResponse -- cloudflare.MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse +- cloudflare.MnmRuleReplaceResponse Methods: +- client.Mnms.Rules.New(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmRuleNewResponse, error) - client.Mnms.Rules.Update(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MnmRuleUpdateResponse, error) +- client.Mnms.Rules.List(ctx context.Context, accountIdentifier interface{}) ([]cloudflare.MnmRuleListResponse, error) - client.Mnms.Rules.Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MnmRuleDeleteResponse, error) - client.Mnms.Rules.Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MnmRuleGetResponse, error) -- client.Mnms.Rules.MagicNetworkMonitoringRulesNewRules(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmRuleMagicNetworkMonitoringRulesNewRulesResponse, error) -- client.Mnms.Rules.MagicNetworkMonitoringRulesListRules(ctx context.Context, accountIdentifier interface{}) ([]cloudflare.MnmRuleMagicNetworkMonitoringRulesListRulesResponse, error) -- client.Mnms.Rules.MagicNetworkMonitoringRulesUpdateRules(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse, error) +- client.Mnms.Rules.Replace(ctx context.Context, accountIdentifier interface{}) (cloudflare.MnmRuleReplaceResponse, error) ### Advertisements Response Types: -- cloudflare.MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse +- cloudflare.MnmRuleAdvertisementUpdateResponse Methods: -- client.Mnms.Rules.Advertisements.MagicNetworkMonitoringRulesUpdateAdvertisementForRule(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse, error) +- client.Mnms.Rules.Advertisements.Update(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MnmRuleAdvertisementUpdateResponse, error) # MtlsCertificates Response Types: -- cloudflare.MtlsCertificateUpdateResponse +- cloudflare.MtlsCertificateNewResponse - cloudflare.MtlsCertificateListResponse - cloudflare.MtlsCertificateDeleteResponse - cloudflare.MtlsCertificateGetResponse Methods: -- client.MtlsCertificates.Update(ctx context.Context, accountID string, body cloudflare.MtlsCertificateUpdateParams) (cloudflare.MtlsCertificateUpdateResponse, error) +- client.MtlsCertificates.New(ctx context.Context, accountID string, body cloudflare.MtlsCertificateNewParams) (cloudflare.MtlsCertificateNewResponse, error) - client.MtlsCertificates.List(ctx context.Context, accountID string) ([]cloudflare.MtlsCertificateListResponse, error) - client.MtlsCertificates.Delete(ctx context.Context, accountID string, mtlsCertificateID string) (cloudflare.MtlsCertificateDeleteResponse, error) - client.MtlsCertificates.Get(ctx context.Context, accountID string, mtlsCertificateID string) (cloudflare.MtlsCertificateGetResponse, error) @@ -3905,6 +3850,8 @@ Response Types: - cloudflare.PageProjectDeploymentListResponse - cloudflare.PageProjectDeploymentDeleteResponse - cloudflare.PageProjectDeploymentGetResponse +- cloudflare.PageProjectDeploymentRetryResponse +- cloudflare.PageProjectDeploymentRollbackResponse Methods: @@ -3912,99 +3859,73 @@ Methods: - client.Pages.Projects.Deployments.List(ctx context.Context, accountID string, projectName string) ([]cloudflare.PageProjectDeploymentListResponse, error) - client.Pages.Projects.Deployments.Delete(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentDeleteResponse, error) - client.Pages.Projects.Deployments.Get(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentGetResponse, error) +- client.Pages.Projects.Deployments.Retry(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentRetryResponse, error) +- client.Pages.Projects.Deployments.Rollback(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentRollbackResponse, error) -#### Histories +#### History ##### Logs Response Types: -- cloudflare.PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse - -Methods: - -- client.Pages.Projects.Deployments.Histories.Logs.PagesDeploymentGetDeploymentLogs(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse, error) - -#### Retries - -Response Types: - -- cloudflare.PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse - -Methods: - -- client.Pages.Projects.Deployments.Retries.PagesDeploymentRetryDeployment(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse, error) - -#### Rollbacks - -Response Types: - -- cloudflare.PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse +- cloudflare.PageProjectDeploymentHistoryLogListResponse Methods: -- client.Pages.Projects.Deployments.Rollbacks.PagesDeploymentRollbackDeployment(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse, error) +- client.Pages.Projects.Deployments.History.Logs.List(ctx context.Context, accountID string, projectName string, deploymentID string) (cloudflare.PageProjectDeploymentHistoryLogListResponse, error) ### Domains Response Types: +- cloudflare.PageProjectDomainNewResponse - cloudflare.PageProjectDomainUpdateResponse +- cloudflare.PageProjectDomainListResponse - cloudflare.PageProjectDomainDeleteResponse - cloudflare.PageProjectDomainGetResponse -- cloudflare.PageProjectDomainPagesDomainsAddDomainResponse -- cloudflare.PageProjectDomainPagesDomainsGetDomainsResponse Methods: +- client.Pages.Projects.Domains.New(ctx context.Context, accountID string, projectName string, body cloudflare.PageProjectDomainNewParams) (cloudflare.PageProjectDomainNewResponse, error) - client.Pages.Projects.Domains.Update(ctx context.Context, accountID string, projectName string, domainName string) (cloudflare.PageProjectDomainUpdateResponse, error) +- client.Pages.Projects.Domains.List(ctx context.Context, accountID string, projectName string) ([]cloudflare.PageProjectDomainListResponse, error) - client.Pages.Projects.Domains.Delete(ctx context.Context, accountID string, projectName string, domainName string) (cloudflare.PageProjectDomainDeleteResponse, error) - client.Pages.Projects.Domains.Get(ctx context.Context, accountID string, projectName string, domainName string) (cloudflare.PageProjectDomainGetResponse, error) -- client.Pages.Projects.Domains.PagesDomainsAddDomain(ctx context.Context, accountID string, projectName string, body cloudflare.PageProjectDomainPagesDomainsAddDomainParams) (cloudflare.PageProjectDomainPagesDomainsAddDomainResponse, error) -- client.Pages.Projects.Domains.PagesDomainsGetDomains(ctx context.Context, accountID string, projectName string) ([]cloudflare.PageProjectDomainPagesDomainsGetDomainsResponse, error) # Pcaps Response Types: +- cloudflare.PcapNewResponse +- cloudflare.PcapListResponse - cloudflare.PcapGetResponse -- cloudflare.PcapMagicPcapCollectionNewPcapRequestResponse -- cloudflare.PcapMagicPcapCollectionListPacketCaptureRequestsResponse Methods: +- client.Pcaps.New(ctx context.Context, accountIdentifier string, body cloudflare.PcapNewParams) (cloudflare.PcapNewResponse, error) +- client.Pcaps.List(ctx context.Context, accountIdentifier string) ([]cloudflare.PcapListResponse, error) - client.Pcaps.Get(ctx context.Context, accountIdentifier string, identifier string) (cloudflare.PcapGetResponse, error) -- client.Pcaps.MagicPcapCollectionNewPcapRequest(ctx context.Context, accountIdentifier string, body cloudflare.PcapMagicPcapCollectionNewPcapRequestParams) (cloudflare.PcapMagicPcapCollectionNewPcapRequestResponse, error) -- client.Pcaps.MagicPcapCollectionListPacketCaptureRequests(ctx context.Context, accountIdentifier string) ([]cloudflare.PcapMagicPcapCollectionListPacketCaptureRequestsResponse, error) ## Ownerships Response Types: -- cloudflare.PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse -- cloudflare.PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse +- cloudflare.PcapOwnershipNewResponse +- cloudflare.PcapOwnershipGetResponse +- cloudflare.PcapOwnershipValidateResponse Methods: +- client.Pcaps.Ownerships.New(ctx context.Context, accountIdentifier string, body cloudflare.PcapOwnershipNewParams) (cloudflare.PcapOwnershipNewResponse, error) - client.Pcaps.Ownerships.Delete(ctx context.Context, accountIdentifier string, identifier string) error -- client.Pcaps.Ownerships.MagicPcapCollectionAddBucketsForFullPacketCaptures(ctx context.Context, accountIdentifier string, body cloudflare.PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesParams) (cloudflare.PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse, error) -- client.Pcaps.Ownerships.MagicPcapCollectionListPcaPsBucketOwnership(ctx context.Context, accountIdentifier string) ([]cloudflare.PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse, error) - -### Validates - -Response Types: - -- cloudflare.PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse - -Methods: - -- client.Pcaps.Ownerships.Validates.MagicPcapCollectionValidateBucketsForFullPacketCaptures(ctx context.Context, accountIdentifier string, body cloudflare.PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesParams) (cloudflare.PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse, error) +- client.Pcaps.Ownerships.Get(ctx context.Context, accountIdentifier string) ([]cloudflare.PcapOwnershipGetResponse, error) +- client.Pcaps.Ownerships.Validate(ctx context.Context, accountIdentifier string, body cloudflare.PcapOwnershipValidateParams) (cloudflare.PcapOwnershipValidateResponse, error) ## Downloads Methods: -- client.Pcaps.Downloads.List(ctx context.Context, accountIdentifier string, identifier string) (http.Response, error) +- client.Pcaps.Downloads.Get(ctx context.Context, accountIdentifier string, identifier string) (http.Response, error) # Registrar @@ -4012,15 +3933,15 @@ Methods: Response Types: -- cloudflare.RegistrarDomainUpdateResponse - cloudflare.RegistrarDomainListResponse - cloudflare.RegistrarDomainGetResponse +- cloudflare.RegistrarDomainReplaceResponse Methods: -- client.Registrar.Domains.Update(ctx context.Context, accountID string, domainName string, body cloudflare.RegistrarDomainUpdateParams) (cloudflare.RegistrarDomainUpdateResponse, error) - client.Registrar.Domains.List(ctx context.Context, accountID string) ([]cloudflare.RegistrarDomainListResponse, error) - client.Registrar.Domains.Get(ctx context.Context, accountID string, domainName string) (cloudflare.RegistrarDomainGetResponse, error) +- client.Registrar.Domains.Replace(ctx context.Context, accountID string, domainName string, body cloudflare.RegistrarDomainReplaceParams) (cloudflare.RegistrarDomainReplaceResponse, error) # RequestTracers @@ -4028,6 +3949,7 @@ Methods: Response Types: +- cloudflare.9301c7QsTrace - cloudflare.RequestTracerTraceNewResponse Methods: @@ -4038,12 +3960,12 @@ Methods: Response Types: -- cloudflare.RoleAccountRolesListRolesResponse +- cloudflare.RoleListResponse - cloudflare.RoleGetResponse Methods: -- client.Roles.AccountRolesListRoles(ctx context.Context, accountID interface{}) ([]cloudflare.RoleAccountRolesListRolesResponse, error) +- client.Roles.List(ctx context.Context, accountID interface{}) ([]cloudflare.RoleListResponse, error) - client.Roles.Get(ctx context.Context, accountID interface{}, roleID interface{}) (cloudflare.RoleGetResponse, error) # Rules @@ -4052,19 +3974,19 @@ Methods: Response Types: -- cloudflare.RuleListUpdateResponse +- cloudflare.RuleListNewResponse +- cloudflare.RuleListListResponse - cloudflare.RuleListDeleteResponse - cloudflare.RuleListGetResponse -- cloudflare.RuleListListsNewAListResponse -- cloudflare.RuleListListsGetListsResponse +- cloudflare.RuleListReplaceResponse Methods: -- client.Rules.Lists.Update(ctx context.Context, accountID string, listID string, body cloudflare.RuleListUpdateParams) ([]cloudflare.RuleListUpdateResponse, error) +- client.Rules.Lists.New(ctx context.Context, accountID string, body cloudflare.RuleListNewParams) ([]cloudflare.RuleListNewResponse, error) +- client.Rules.Lists.List(ctx context.Context, accountID string) ([]cloudflare.RuleListListResponse, error) - client.Rules.Lists.Delete(ctx context.Context, accountID string, listID string) (cloudflare.RuleListDeleteResponse, error) - client.Rules.Lists.Get(ctx context.Context, accountID string, listID string) ([]cloudflare.RuleListGetResponse, error) -- client.Rules.Lists.ListsNewAList(ctx context.Context, accountID string, body cloudflare.RuleListListsNewAListParams) ([]cloudflare.RuleListListsNewAListResponse, error) -- client.Rules.Lists.ListsGetLists(ctx context.Context, accountID string) ([]cloudflare.RuleListListsGetListsResponse, error) +- client.Rules.Lists.Replace(ctx context.Context, accountID string, listID string, body cloudflare.RuleListReplaceParams) ([]cloudflare.RuleListReplaceResponse, error) ### BulkOperations @@ -4080,19 +4002,19 @@ Methods: Response Types: +- cloudflare.RuleListItemNewResponse +- cloudflare.RuleListItemListResponse - cloudflare.RuleListItemDeleteResponse - cloudflare.RuleListItemGetResponse -- cloudflare.RuleListItemListsNewListItemsResponse -- cloudflare.RuleListItemListsGetListItemsResponse -- cloudflare.RuleListItemListsUpdateAllListItemsResponse +- cloudflare.RuleListItemReplaceResponse Methods: +- client.Rules.Lists.Items.New(ctx context.Context, accountID string, listID string, body cloudflare.RuleListItemNewParams) (cloudflare.RuleListItemNewResponse, error) +- client.Rules.Lists.Items.List(ctx context.Context, accountID string, listID string, query cloudflare.RuleListItemListParams) ([]cloudflare.RuleListItemListResponse, error) - client.Rules.Lists.Items.Delete(ctx context.Context, accountID string, listID string, body cloudflare.RuleListItemDeleteParams) (cloudflare.RuleListItemDeleteResponse, error) - client.Rules.Lists.Items.Get(ctx context.Context, accountIdentifier string, listID string, itemID string) (cloudflare.RuleListItemGetResponse, error) -- client.Rules.Lists.Items.ListsNewListItems(ctx context.Context, accountID string, listID string, body cloudflare.RuleListItemListsNewListItemsParams) (cloudflare.RuleListItemListsNewListItemsResponse, error) -- client.Rules.Lists.Items.ListsGetListItems(ctx context.Context, accountID string, listID string, query cloudflare.RuleListItemListsGetListItemsParams) ([]cloudflare.RuleListItemListsGetListItemsResponse, error) -- client.Rules.Lists.Items.ListsUpdateAllListItems(ctx context.Context, accountID string, listID string, body cloudflare.RuleListItemListsUpdateAllListItemsParams) (cloudflare.RuleListItemListsUpdateAllListItemsResponse, error) +- client.Rules.Lists.Items.Replace(ctx context.Context, accountID string, listID string, body cloudflare.RuleListItemReplaceParams) (cloudflare.RuleListItemReplaceResponse, error) # Storage @@ -4114,29 +4036,29 @@ Methods: Response Types: -- cloudflare.StorageKvNamespaceUpdateResponse +- cloudflare.StorageKvNamespaceNewResponse - cloudflare.StorageKvNamespaceListResponse - cloudflare.StorageKvNamespaceDeleteResponse -- cloudflare.StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse +- cloudflare.StorageKvNamespaceReplaceResponse Methods: -- client.Storage.Kv.Namespaces.Update(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceUpdateParams) (cloudflare.StorageKvNamespaceUpdateResponse, error) +- client.Storage.Kv.Namespaces.New(ctx context.Context, accountID string, body cloudflare.StorageKvNamespaceNewParams) (cloudflare.StorageKvNamespaceNewResponse, error) - client.Storage.Kv.Namespaces.List(ctx context.Context, accountID string, query cloudflare.StorageKvNamespaceListParams) (shared.V4PagePaginationArray[cloudflare.StorageKvNamespaceListResponse], error) - client.Storage.Kv.Namespaces.Delete(ctx context.Context, accountID string, namespaceID string) (cloudflare.StorageKvNamespaceDeleteResponse, error) -- client.Storage.Kv.Namespaces.WorkersKvNamespaceNewANamespace(ctx context.Context, accountID string, body cloudflare.StorageKvNamespaceWorkersKvNamespaceNewANamespaceParams) (cloudflare.StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse, error) +- client.Storage.Kv.Namespaces.Replace(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceReplaceParams) (cloudflare.StorageKvNamespaceReplaceResponse, error) -#### Bulks +#### Bulk Response Types: - cloudflare.StorageKvNamespaceBulkDeleteResponse -- cloudflare.StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse +- cloudflare.StorageKvNamespaceBulkReplaceResponse Methods: -- client.Storage.Kv.Namespaces.Bulks.Delete(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceBulkDeleteParams) (cloudflare.StorageKvNamespaceBulkDeleteResponse, error) -- client.Storage.Kv.Namespaces.Bulks.WorkersKvNamespaceWriteMultipleKeyValuePairs(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParams) (cloudflare.StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse, error) +- client.Storage.Kv.Namespaces.Bulk.Delete(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceBulkDeleteParams) (cloudflare.StorageKvNamespaceBulkDeleteResponse, error) +- client.Storage.Kv.Namespaces.Bulk.Replace(ctx context.Context, accountID string, namespaceID string, body cloudflare.StorageKvNamespaceBulkReplaceParams) (cloudflare.StorageKvNamespaceBulkReplaceResponse, error) #### Keys @@ -4162,46 +4084,44 @@ Methods: Response Types: -- cloudflare.StorageKvNamespaceValueUpdateResponse - cloudflare.StorageKvNamespaceValueDeleteResponse +- cloudflare.StorageKvNamespaceValueReplaceResponse Methods: -- client.Storage.Kv.Namespaces.Values.Update(ctx context.Context, accountID string, namespaceID string, keyName string, body cloudflare.StorageKvNamespaceValueUpdateParams) (cloudflare.StorageKvNamespaceValueUpdateResponse, error) - client.Storage.Kv.Namespaces.Values.Delete(ctx context.Context, accountID string, namespaceID string, keyName string) (cloudflare.StorageKvNamespaceValueDeleteResponse, error) - client.Storage.Kv.Namespaces.Values.Get(ctx context.Context, accountID string, namespaceID string, keyName string) (string, error) +- client.Storage.Kv.Namespaces.Values.Replace(ctx context.Context, accountID string, namespaceID string, keyName string, body cloudflare.StorageKvNamespaceValueReplaceParams) (cloudflare.StorageKvNamespaceValueReplaceResponse, error) # Stream Response Types: -- cloudflare.StreamUpdateResponse +- cloudflare.StreamListResponse - cloudflare.StreamGetResponse -- cloudflare.StreamStreamVideosListVideosResponse Methods: -- client.Stream.Update(ctx context.Context, accountID string, identifier string, body cloudflare.StreamUpdateParams) (cloudflare.StreamUpdateResponse, error) +- client.Stream.New(ctx context.Context, accountID string, body cloudflare.StreamNewParams) error +- client.Stream.List(ctx context.Context, accountID string, query cloudflare.StreamListParams) ([]cloudflare.StreamListResponse, error) - client.Stream.Delete(ctx context.Context, accountID string, identifier string) error - client.Stream.Get(ctx context.Context, accountID string, identifier string) (cloudflare.StreamGetResponse, error) -- client.Stream.StreamVideosInitiateVideoUploadsUsingTus(ctx context.Context, accountID string, body cloudflare.StreamStreamVideosInitiateVideoUploadsUsingTusParams) error -- client.Stream.StreamVideosListVideos(ctx context.Context, accountID string, query cloudflare.StreamStreamVideosListVideosParams) ([]cloudflare.StreamStreamVideosListVideosResponse, error) ## AudioTracks Response Types: +- cloudflare.StreamAudioTrackNewResponse - cloudflare.StreamAudioTrackUpdateResponse - cloudflare.StreamAudioTrackListResponse - cloudflare.StreamAudioTrackDeleteResponse -- cloudflare.StreamAudioTrackCopyResponse Methods: +- client.Stream.AudioTracks.New(ctx context.Context, accountID string, identifier string, body cloudflare.StreamAudioTrackNewParams) (cloudflare.StreamAudioTrackNewResponse, error) - client.Stream.AudioTracks.Update(ctx context.Context, accountID string, identifier string, audioIdentifier string, body cloudflare.StreamAudioTrackUpdateParams) (cloudflare.StreamAudioTrackUpdateResponse, error) - client.Stream.AudioTracks.List(ctx context.Context, accountID string, identifier string) ([]cloudflare.StreamAudioTrackListResponse, error) - client.Stream.AudioTracks.Delete(ctx context.Context, accountID string, identifier string, audioIdentifier string) (cloudflare.StreamAudioTrackDeleteResponse, error) -- client.Stream.AudioTracks.Copy(ctx context.Context, accountID string, identifier string, body cloudflare.StreamAudioTrackCopyParams) (cloudflare.StreamAudioTrackCopyResponse, error) ## Videos @@ -4217,135 +4137,135 @@ Methods: Response Types: -- cloudflare.StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse +- cloudflare.StreamClipNewResponse Methods: -- client.Stream.Clips.StreamVideoClippingClipVideosGivenAStartAndEndTime(ctx context.Context, accountID string, body cloudflare.StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams) (cloudflare.StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse, error) +- client.Stream.Clips.New(ctx context.Context, accountID string, body cloudflare.StreamClipNewParams) (cloudflare.StreamClipNewResponse, error) ## Copies Response Types: -- cloudflare.StreamCopyStreamVideosUploadVideosFromAurlResponse +- cloudflare.StreamCopyNewResponse Methods: -- client.Stream.Copies.StreamVideosUploadVideosFromAURL(ctx context.Context, accountID string, params cloudflare.StreamCopyStreamVideosUploadVideosFromAURLParams) (cloudflare.StreamCopyStreamVideosUploadVideosFromAurlResponse, error) +- client.Stream.Copies.New(ctx context.Context, accountID string, params cloudflare.StreamCopyNewParams) (cloudflare.StreamCopyNewResponse, error) ## DirectUploads Response Types: -- cloudflare.StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse +- cloudflare.StreamDirectUploadNewResponse Methods: -- client.Stream.DirectUploads.StreamVideosUploadVideosViaDirectUploadURLs(ctx context.Context, accountID string, params cloudflare.StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams) (cloudflare.StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse, error) +- client.Stream.DirectUploads.New(ctx context.Context, accountID string, params cloudflare.StreamDirectUploadNewParams) (cloudflare.StreamDirectUploadNewResponse, error) ## Keys Response Types: +- cloudflare.StreamKeyNewResponse +- cloudflare.StreamKeyListResponse - cloudflare.StreamKeyDeleteResponse -- cloudflare.StreamKeyStreamSigningKeysNewSigningKeysResponse -- cloudflare.StreamKeyStreamSigningKeysListSigningKeysResponse Methods: +- client.Stream.Keys.New(ctx context.Context, accountID string) (cloudflare.StreamKeyNewResponse, error) +- client.Stream.Keys.List(ctx context.Context, accountID string) ([]cloudflare.StreamKeyListResponse, error) - client.Stream.Keys.Delete(ctx context.Context, accountID string, identifier string) (cloudflare.StreamKeyDeleteResponse, error) -- client.Stream.Keys.StreamSigningKeysNewSigningKeys(ctx context.Context, accountID string) (cloudflare.StreamKeyStreamSigningKeysNewSigningKeysResponse, error) -- client.Stream.Keys.StreamSigningKeysListSigningKeys(ctx context.Context, accountID string) ([]cloudflare.StreamKeyStreamSigningKeysListSigningKeysResponse, error) ## LiveInputs Response Types: -- cloudflare.StreamLiveInputUpdateResponse +- cloudflare.StreamLiveInputNewResponse +- cloudflare.StreamLiveInputListResponse - cloudflare.StreamLiveInputGetResponse -- cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputResponse -- cloudflare.StreamLiveInputStreamLiveInputsListLiveInputsResponse +- cloudflare.StreamLiveInputReplaceResponse Methods: -- client.Stream.LiveInputs.Update(ctx context.Context, accountID string, liveInputIdentifier string, body cloudflare.StreamLiveInputUpdateParams) (cloudflare.StreamLiveInputUpdateResponse, error) +- client.Stream.LiveInputs.New(ctx context.Context, accountID string, body cloudflare.StreamLiveInputNewParams) (cloudflare.StreamLiveInputNewResponse, error) +- client.Stream.LiveInputs.List(ctx context.Context, accountID string, query cloudflare.StreamLiveInputListParams) (cloudflare.StreamLiveInputListResponse, error) - client.Stream.LiveInputs.Delete(ctx context.Context, accountID string, liveInputIdentifier string) error - client.Stream.LiveInputs.Get(ctx context.Context, accountID string, liveInputIdentifier string) (cloudflare.StreamLiveInputGetResponse, error) -- client.Stream.LiveInputs.StreamLiveInputsNewALiveInput(ctx context.Context, accountID string, body cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputParams) (cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputResponse, error) -- client.Stream.LiveInputs.StreamLiveInputsListLiveInputs(ctx context.Context, accountID string, query cloudflare.StreamLiveInputStreamLiveInputsListLiveInputsParams) (cloudflare.StreamLiveInputStreamLiveInputsListLiveInputsResponse, error) +- client.Stream.LiveInputs.Replace(ctx context.Context, accountID string, liveInputIdentifier string, body cloudflare.StreamLiveInputReplaceParams) (cloudflare.StreamLiveInputReplaceResponse, error) ### Outputs Response Types: -- cloudflare.StreamLiveInputOutputUpdateResponse -- cloudflare.StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse -- cloudflare.StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse +- cloudflare.StreamLiveInputOutputNewResponse +- cloudflare.StreamLiveInputOutputListResponse +- cloudflare.StreamLiveInputOutputReplaceResponse Methods: -- client.Stream.LiveInputs.Outputs.Update(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, body cloudflare.StreamLiveInputOutputUpdateParams) (cloudflare.StreamLiveInputOutputUpdateResponse, error) +- client.Stream.LiveInputs.Outputs.New(ctx context.Context, accountID string, liveInputIdentifier string, body cloudflare.StreamLiveInputOutputNewParams) (cloudflare.StreamLiveInputOutputNewResponse, error) +- client.Stream.LiveInputs.Outputs.List(ctx context.Context, accountID string, liveInputIdentifier string) ([]cloudflare.StreamLiveInputOutputListResponse, error) - client.Stream.LiveInputs.Outputs.Delete(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string) error -- client.Stream.LiveInputs.Outputs.StreamLiveInputsNewANewOutputConnectedToALiveInput(ctx context.Context, accountID string, liveInputIdentifier string, body cloudflare.StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputParams) (cloudflare.StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse, error) -- client.Stream.LiveInputs.Outputs.StreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInput(ctx context.Context, accountID string, liveInputIdentifier string) ([]cloudflare.StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse, error) +- client.Stream.LiveInputs.Outputs.Replace(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, body cloudflare.StreamLiveInputOutputReplaceParams) (cloudflare.StreamLiveInputOutputReplaceResponse, error) ## Watermarks Response Types: +- cloudflare.StreamWatermarkNewResponse +- cloudflare.StreamWatermarkListResponse - cloudflare.StreamWatermarkDeleteResponse - cloudflare.StreamWatermarkGetResponse -- cloudflare.StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse -- cloudflare.StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse Methods: +- client.Stream.Watermarks.New(ctx context.Context, accountID string, body cloudflare.StreamWatermarkNewParams) (cloudflare.StreamWatermarkNewResponse, error) +- client.Stream.Watermarks.List(ctx context.Context, accountID string) ([]cloudflare.StreamWatermarkListResponse, error) - client.Stream.Watermarks.Delete(ctx context.Context, accountID string, identifier string) (cloudflare.StreamWatermarkDeleteResponse, error) - client.Stream.Watermarks.Get(ctx context.Context, accountID string, identifier string) (cloudflare.StreamWatermarkGetResponse, error) -- client.Stream.Watermarks.StreamWatermarkProfileNewWatermarkProfilesViaBasicUpload(ctx context.Context, accountID string, body cloudflare.StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadParams) (cloudflare.StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse, error) -- client.Stream.Watermarks.StreamWatermarkProfileListWatermarkProfiles(ctx context.Context, accountID string) ([]cloudflare.StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse, error) ## Webhooks Response Types: - cloudflare.StreamWebhookDeleteResponse -- cloudflare.StreamWebhookStreamWebhookNewWebhooksResponse -- cloudflare.StreamWebhookStreamWebhookViewWebhooksResponse +- cloudflare.StreamWebhookGetResponse +- cloudflare.StreamWebhookReplaceResponse Methods: - client.Stream.Webhooks.Delete(ctx context.Context, accountID string) (cloudflare.StreamWebhookDeleteResponse, error) -- client.Stream.Webhooks.StreamWebhookNewWebhooks(ctx context.Context, accountID string, body cloudflare.StreamWebhookStreamWebhookNewWebhooksParams) (cloudflare.StreamWebhookStreamWebhookNewWebhooksResponse, error) -- client.Stream.Webhooks.StreamWebhookViewWebhooks(ctx context.Context, accountID string) (cloudflare.StreamWebhookStreamWebhookViewWebhooksResponse, error) +- client.Stream.Webhooks.Get(ctx context.Context, accountID string) (cloudflare.StreamWebhookGetResponse, error) +- client.Stream.Webhooks.Replace(ctx context.Context, accountID string, body cloudflare.StreamWebhookReplaceParams) (cloudflare.StreamWebhookReplaceResponse, error) ## Captions Response Types: -- cloudflare.StreamCaptionUpdateResponse +- cloudflare.StreamCaptionListResponse - cloudflare.StreamCaptionDeleteResponse -- cloudflare.StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse +- cloudflare.StreamCaptionReplaceResponse Methods: -- client.Stream.Captions.Update(ctx context.Context, accountID string, identifier string, language string, body cloudflare.StreamCaptionUpdateParams) (cloudflare.StreamCaptionUpdateResponse, error) +- client.Stream.Captions.List(ctx context.Context, accountID string, identifier string) ([]cloudflare.StreamCaptionListResponse, error) - client.Stream.Captions.Delete(ctx context.Context, accountID string, identifier string, language string) (cloudflare.StreamCaptionDeleteResponse, error) -- client.Stream.Captions.StreamSubtitlesCaptionsListCaptionsOrSubtitles(ctx context.Context, accountID string, identifier string) ([]cloudflare.StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse, error) +- client.Stream.Captions.Replace(ctx context.Context, accountID string, identifier string, language string, body cloudflare.StreamCaptionReplaceParams) (cloudflare.StreamCaptionReplaceResponse, error) ## Downloads Response Types: +- cloudflare.StreamDownloadNewResponse +- cloudflare.StreamDownloadListResponse - cloudflare.StreamDownloadDeleteResponse -- cloudflare.StreamDownloadStreamMP4DownloadsNewDownloadsResponse -- cloudflare.StreamDownloadStreamMP4DownloadsListDownloadsResponse Methods: +- client.Stream.Downloads.New(ctx context.Context, accountID string, identifier string) (cloudflare.StreamDownloadNewResponse, error) +- client.Stream.Downloads.List(ctx context.Context, accountID string, identifier string) (cloudflare.StreamDownloadListResponse, error) - client.Stream.Downloads.Delete(ctx context.Context, accountID string, identifier string) (cloudflare.StreamDownloadDeleteResponse, error) -- client.Stream.Downloads.StreamMP4DownloadsNewDownloads(ctx context.Context, accountID string, identifier string) (cloudflare.StreamDownloadStreamMP4DownloadsNewDownloadsResponse, error) -- client.Stream.Downloads.StreamMP4DownloadsListDownloads(ctx context.Context, accountID string, identifier string) (cloudflare.StreamDownloadStreamMP4DownloadsListDownloadsResponse, error) ## Embeds @@ -4361,11 +4281,11 @@ Methods: Response Types: -- cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosResponse +- cloudflare.StreamTokenNewResponse Methods: -- client.Stream.Tokens.StreamVideosNewSignedURLTokensForVideos(ctx context.Context, accountID string, identifier string, body cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParams) (cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosResponse, error) +- client.Stream.Tokens.New(ctx context.Context, accountID string, identifier string, body cloudflare.StreamTokenNewParams) (cloudflare.StreamTokenNewResponse, error) # Teamnets @@ -4373,11 +4293,11 @@ Methods: Response Types: -- cloudflare.TeamnetRouteTunnelRouteListTunnelRoutesResponse +- cloudflare.TeamnetRouteListResponse Methods: -- client.Teamnets.Routes.TunnelRouteListTunnelRoutes(ctx context.Context, accountID string, query cloudflare.TeamnetRouteTunnelRouteListTunnelRoutesParams) ([]cloudflare.TeamnetRouteTunnelRouteListTunnelRoutesResponse, error) +- client.Teamnets.Routes.List(ctx context.Context, accountID string, query cloudflare.TeamnetRouteListParams) (shared.V4PagePaginationArray[cloudflare.TeamnetRouteListResponse], error) ### IPs @@ -4393,297 +4313,267 @@ Methods: Response Types: -- cloudflare.TeamnetRouteNetworkUpdateResponse +- cloudflare.TeamnetRouteNetworkNewResponse - cloudflare.TeamnetRouteNetworkDeleteResponse Methods: -- client.Teamnets.Routes.Networks.Update(ctx context.Context, accountID string, ipNetworkEncoded string, body cloudflare.TeamnetRouteNetworkUpdateParams) (cloudflare.TeamnetRouteNetworkUpdateResponse, error) +- client.Teamnets.Routes.Networks.New(ctx context.Context, accountID string, ipNetworkEncoded string, body cloudflare.TeamnetRouteNetworkNewParams) (cloudflare.TeamnetRouteNetworkNewResponse, error) - client.Teamnets.Routes.Networks.Delete(ctx context.Context, accountID string, ipNetworkEncoded string, body cloudflare.TeamnetRouteNetworkDeleteParams) (cloudflare.TeamnetRouteNetworkDeleteResponse, error) ## VirtualNetworks Response Types: +- cloudflare.TeamnetVirtualNetworkNewResponse - cloudflare.TeamnetVirtualNetworkUpdateResponse +- cloudflare.TeamnetVirtualNetworkListResponse - cloudflare.TeamnetVirtualNetworkDeleteResponse -- cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse -- cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse Methods: +- client.Teamnets.VirtualNetworks.New(ctx context.Context, accountID string, body cloudflare.TeamnetVirtualNetworkNewParams) (cloudflare.TeamnetVirtualNetworkNewResponse, error) - client.Teamnets.VirtualNetworks.Update(ctx context.Context, accountID string, virtualNetworkID string, body cloudflare.TeamnetVirtualNetworkUpdateParams) (cloudflare.TeamnetVirtualNetworkUpdateResponse, error) +- client.Teamnets.VirtualNetworks.List(ctx context.Context, accountID string, query cloudflare.TeamnetVirtualNetworkListParams) ([]cloudflare.TeamnetVirtualNetworkListResponse, error) - client.Teamnets.VirtualNetworks.Delete(ctx context.Context, accountID string, virtualNetworkID string) (cloudflare.TeamnetVirtualNetworkDeleteResponse, error) -- client.Teamnets.VirtualNetworks.TunnelVirtualNetworkNewAVirtualNetwork(ctx context.Context, accountID string, body cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkParams) (cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse, error) -- client.Teamnets.VirtualNetworks.TunnelVirtualNetworkListVirtualNetworks(ctx context.Context, accountID string, query cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams) ([]cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse, error) - -# Tunnels - -Response Types: - -- cloudflare.TunnelDeleteResponse -- cloudflare.TunnelArgoTunnelNewAnArgoTunnelResponse -- cloudflare.TunnelArgoTunnelListArgoTunnelsResponse -- cloudflare.TunnelGetResponse -Methods: - -- client.Tunnels.Delete(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelDeleteParams) (cloudflare.TunnelDeleteResponse, error) -- client.Tunnels.ArgoTunnelNewAnArgoTunnel(ctx context.Context, accountID string, body cloudflare.TunnelArgoTunnelNewAnArgoTunnelParams) (cloudflare.TunnelArgoTunnelNewAnArgoTunnelResponse, error) -- client.Tunnels.ArgoTunnelListArgoTunnels(ctx context.Context, accountID string, query cloudflare.TunnelArgoTunnelListArgoTunnelsParams) ([]cloudflare.TunnelArgoTunnelListArgoTunnelsResponse, error) -- client.Tunnels.Get(ctx context.Context, accountID string, tunnelID string) (cloudflare.TunnelGetResponse, error) - -## Connections +# Gateways Response Types: -- cloudflare.TunnelConnectionDeleteResponse +- cloudflare.GatewayNewResponse +- cloudflare.GatewayListResponse Methods: -- client.Tunnels.Connections.Delete(ctx context.Context, accountID string, tunnelID string, body cloudflare.TunnelConnectionDeleteParams) (cloudflare.TunnelConnectionDeleteResponse, error) +- client.Gateways.New(ctx context.Context, accountID interface{}) (cloudflare.GatewayNewResponse, error) +- client.Gateways.List(ctx context.Context, accountID interface{}) (cloudflare.GatewayListResponse, error) -# Gateways +## AuditSSHSettings Response Types: -- cloudflare.GatewayZeroTrustAccountsNewZeroTrustAccountResponse -- cloudflare.GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse +- cloudflare.GatewayAuditSSHSettingGetResponse +- cloudflare.GatewayAuditSSHSettingReplaceResponse Methods: -- client.Gateways.ZeroTrustAccountsNewZeroTrustAccount(ctx context.Context, accountID interface{}) (cloudflare.GatewayZeroTrustAccountsNewZeroTrustAccountResponse, error) -- client.Gateways.ZeroTrustAccountsGetZeroTrustAccountInformation(ctx context.Context, accountID interface{}) (cloudflare.GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse, error) +- client.Gateways.AuditSSHSettings.Get(ctx context.Context, accountID interface{}) (cloudflare.GatewayAuditSSHSettingGetResponse, error) +- client.Gateways.AuditSSHSettings.Replace(ctx context.Context, accountID interface{}, body cloudflare.GatewayAuditSSHSettingReplaceParams) (cloudflare.GatewayAuditSSHSettingReplaceResponse, error) ## Categories Response Types: -- cloudflare.GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse +- cloudflare.GatewayCategoryListResponse Methods: -- client.Gateways.Categories.ZeroTrustGatewayCategoriesListCategories(ctx context.Context, accountID string) ([]cloudflare.GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse, error) +- client.Gateways.Categories.List(ctx context.Context, accountID string) ([]cloudflare.GatewayCategoryListResponse, error) ## AppTypes Response Types: -- cloudflare.GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse +- cloudflare.GatewayAppTypeListResponse Methods: -- client.Gateways.AppTypes.ZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappings(ctx context.Context, accountID string) ([]cloudflare.GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse, error) +- client.Gateways.AppTypes.List(ctx context.Context, accountID string) ([]cloudflare.GatewayAppTypeListResponse, error) ## Configurations Response Types: -- cloudflare.GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse -- cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse -- cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse +- cloudflare.GatewayConfigurationUpdateResponse +- cloudflare.GatewayConfigurationGetResponse +- cloudflare.GatewayConfigurationReplaceResponse Methods: -- client.Gateways.Configurations.ZeroTrustAccountsGetZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}) (cloudflare.GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse, error) -- client.Gateways.Configurations.ZeroTrustAccountsPatchZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}, body cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParams) (cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse, error) -- client.Gateways.Configurations.ZeroTrustAccountsUpdateZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}, body cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParams) (cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse, error) +- client.Gateways.Configurations.Update(ctx context.Context, accountID interface{}, body cloudflare.GatewayConfigurationUpdateParams) (cloudflare.GatewayConfigurationUpdateResponse, error) +- client.Gateways.Configurations.Get(ctx context.Context, accountID interface{}) (cloudflare.GatewayConfigurationGetResponse, error) +- client.Gateways.Configurations.Replace(ctx context.Context, accountID interface{}, body cloudflare.GatewayConfigurationReplaceParams) (cloudflare.GatewayConfigurationReplaceResponse, error) ## Lists Response Types: -- cloudflare.GatewayListUpdateResponse +- cloudflare.GatewayListNewResponse +- cloudflare.GatewayListListResponse - cloudflare.GatewayListDeleteResponse - cloudflare.GatewayListGetResponse -- cloudflare.GatewayListZeroTrustListsNewZeroTrustListResponse -- cloudflare.GatewayListZeroTrustListsListZeroTrustListsResponse +- cloudflare.GatewayListReplaceResponse Methods: -- client.Gateways.Lists.Update(ctx context.Context, accountID interface{}, listID string, body cloudflare.GatewayListUpdateParams) (cloudflare.GatewayListUpdateResponse, error) +- client.Gateways.Lists.New(ctx context.Context, accountID interface{}, body cloudflare.GatewayListNewParams) (cloudflare.GatewayListNewResponse, error) +- client.Gateways.Lists.List(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayListListResponse, error) - client.Gateways.Lists.Delete(ctx context.Context, accountID interface{}, listID string) (cloudflare.GatewayListDeleteResponse, error) - client.Gateways.Lists.Get(ctx context.Context, accountID interface{}, listID string) (cloudflare.GatewayListGetResponse, error) -- client.Gateways.Lists.ZeroTrustListsNewZeroTrustList(ctx context.Context, accountID interface{}, body cloudflare.GatewayListZeroTrustListsNewZeroTrustListParams) (cloudflare.GatewayListZeroTrustListsNewZeroTrustListResponse, error) -- client.Gateways.Lists.ZeroTrustListsListZeroTrustLists(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayListZeroTrustListsListZeroTrustListsResponse, error) +- client.Gateways.Lists.Replace(ctx context.Context, accountID interface{}, listID string, body cloudflare.GatewayListReplaceParams) (cloudflare.GatewayListReplaceResponse, error) ### Items Response Types: -- cloudflare.GatewayListItemZeroTrustListsZeroTrustListItemsResponse +- cloudflare.GatewayListItemListResponse Methods: -- client.Gateways.Lists.Items.ZeroTrustListsZeroTrustListItems(ctx context.Context, accountID interface{}, listID string) ([][]cloudflare.GatewayListItemZeroTrustListsZeroTrustListItemsResponse, error) +- client.Gateways.Lists.Items.List(ctx context.Context, accountID interface{}, listID string) ([][]cloudflare.GatewayListItemListResponse, error) ## Locations Response Types: -- cloudflare.GatewayLocationUpdateResponse +- cloudflare.GatewayLocationNewResponse +- cloudflare.GatewayLocationListResponse - cloudflare.GatewayLocationDeleteResponse - cloudflare.GatewayLocationGetResponse -- cloudflare.GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse -- cloudflare.GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse +- cloudflare.GatewayLocationReplaceResponse Methods: -- client.Gateways.Locations.Update(ctx context.Context, accountID interface{}, locationID interface{}, body cloudflare.GatewayLocationUpdateParams) (cloudflare.GatewayLocationUpdateResponse, error) +- client.Gateways.Locations.New(ctx context.Context, accountID interface{}, body cloudflare.GatewayLocationNewParams) (cloudflare.GatewayLocationNewResponse, error) +- client.Gateways.Locations.List(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayLocationListResponse, error) - client.Gateways.Locations.Delete(ctx context.Context, accountID interface{}, locationID interface{}) (cloudflare.GatewayLocationDeleteResponse, error) - client.Gateways.Locations.Get(ctx context.Context, accountID interface{}, locationID interface{}) (cloudflare.GatewayLocationGetResponse, error) -- client.Gateways.Locations.ZeroTrustGatewayLocationsNewZeroTrustGatewayLocation(ctx context.Context, accountID interface{}, body cloudflare.GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams) (cloudflare.GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse, error) -- client.Gateways.Locations.ZeroTrustGatewayLocationsListZeroTrustGatewayLocations(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse, error) +- client.Gateways.Locations.Replace(ctx context.Context, accountID interface{}, locationID interface{}, body cloudflare.GatewayLocationReplaceParams) (cloudflare.GatewayLocationReplaceResponse, error) ## Loggings Response Types: -- cloudflare.GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse -- cloudflare.GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse +- cloudflare.GatewayLoggingGetResponse +- cloudflare.GatewayLoggingReplaceResponse Methods: -- client.Gateways.Loggings.ZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount(ctx context.Context, accountID interface{}) (cloudflare.GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse, error) -- client.Gateways.Loggings.ZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccount(ctx context.Context, accountID interface{}, body cloudflare.GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParams) (cloudflare.GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse, error) +- client.Gateways.Loggings.Get(ctx context.Context, accountID interface{}) (cloudflare.GatewayLoggingGetResponse, error) +- client.Gateways.Loggings.Replace(ctx context.Context, accountID interface{}, body cloudflare.GatewayLoggingReplaceParams) (cloudflare.GatewayLoggingReplaceResponse, error) ## ProxyEndpoints Response Types: +- cloudflare.GatewayProxyEndpointNewResponse - cloudflare.GatewayProxyEndpointUpdateResponse - cloudflare.GatewayProxyEndpointListResponse - cloudflare.GatewayProxyEndpointDeleteResponse - cloudflare.GatewayProxyEndpointGetResponse -- cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse -- cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse Methods: +- client.Gateways.ProxyEndpoints.New(ctx context.Context, accountID interface{}, body cloudflare.GatewayProxyEndpointNewParams) (cloudflare.GatewayProxyEndpointNewResponse, error) - client.Gateways.ProxyEndpoints.Update(ctx context.Context, accountID interface{}, proxyEndpointID interface{}, body cloudflare.GatewayProxyEndpointUpdateParams) (cloudflare.GatewayProxyEndpointUpdateResponse, error) -- client.Gateways.ProxyEndpoints.List(ctx context.Context, accountID interface{}, proxyEndpointID interface{}) (cloudflare.GatewayProxyEndpointListResponse, error) +- client.Gateways.ProxyEndpoints.List(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayProxyEndpointListResponse, error) - client.Gateways.ProxyEndpoints.Delete(ctx context.Context, accountID interface{}, proxyEndpointID interface{}) (cloudflare.GatewayProxyEndpointDeleteResponse, error) - client.Gateways.ProxyEndpoints.Get(ctx context.Context, accountID interface{}, proxyEndpointID interface{}) (cloudflare.GatewayProxyEndpointGetResponse, error) -- client.Gateways.ProxyEndpoints.ZeroTrustGatewayProxyEndpointsNewProxyEndpoint(ctx context.Context, accountID interface{}, body cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointParams) (cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse, error) -- client.Gateways.ProxyEndpoints.ZeroTrustGatewayProxyEndpointsListProxyEndpoints(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse, error) ## Rules Response Types: -- cloudflare.GatewayRuleUpdateResponse +- cloudflare.GatewayRuleNewResponse +- cloudflare.GatewayRuleListResponse - cloudflare.GatewayRuleDeleteResponse - cloudflare.GatewayRuleGetResponse -- cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse -- cloudflare.GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse +- cloudflare.GatewayRuleReplaceResponse Methods: -- client.Gateways.Rules.Update(ctx context.Context, accountID interface{}, ruleID string, body cloudflare.GatewayRuleUpdateParams) (cloudflare.GatewayRuleUpdateResponse, error) +- client.Gateways.Rules.New(ctx context.Context, accountID interface{}, body cloudflare.GatewayRuleNewParams) (cloudflare.GatewayRuleNewResponse, error) +- client.Gateways.Rules.List(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayRuleListResponse, error) - client.Gateways.Rules.Delete(ctx context.Context, accountID interface{}, ruleID string) (cloudflare.GatewayRuleDeleteResponse, error) - client.Gateways.Rules.Get(ctx context.Context, accountID interface{}, ruleID string) (cloudflare.GatewayRuleGetResponse, error) -- client.Gateways.Rules.ZeroTrustGatewayRulesNewZeroTrustGatewayRule(ctx context.Context, accountID interface{}, body cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams) (cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse, error) -- client.Gateways.Rules.ZeroTrustGatewayRulesListZeroTrustGatewayRules(ctx context.Context, accountID interface{}) ([]cloudflare.GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse, error) +- client.Gateways.Rules.Replace(ctx context.Context, accountID interface{}, ruleID string, body cloudflare.GatewayRuleReplaceParams) (cloudflare.GatewayRuleReplaceResponse, error) # Alerting -## V3s +## V3 + +Response Types: + +- cloudflare.AlertingV3ListResponse + +Methods: + +- client.Alerting.V3.List(ctx context.Context, accountID string) (cloudflare.AlertingV3ListResponse, error) ### Destinations -#### Eligibles +#### Eligible Response Types: -- cloudflare.AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse +- cloudflare.AlertingV3DestinationEligibleGetResponse Methods: -- client.Alerting.V3s.Destinations.Eligibles.NotificationMechanismEligibilityGetDeliveryMechanismEligibility(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse, error) +- client.Alerting.V3.Destinations.Eligible.Get(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationEligibleGetResponse, error) -#### Pagerduties +#### Pagerduty Response Types: -- cloudflare.AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse +- cloudflare.AlertingV3DestinationPagerdutyNewResponse +- cloudflare.AlertingV3DestinationPagerdutyDeleteResponse +- cloudflare.AlertingV3DestinationPagerdutyGetResponse +- cloudflare.AlertingV3DestinationPagerdutyLinkResponse Methods: -- client.Alerting.V3s.Destinations.Pagerduties.NotificationDestinationsWithPagerDutyListPagerDutyServices(ctx context.Context, accountID string) ([]cloudflare.AlertingV3DestinationPagerdutyNotificationDestinationsWithPagerDutyListPagerDutyServicesResponse, error) +- client.Alerting.V3.Destinations.Pagerduty.New(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationPagerdutyNewResponse, error) +- client.Alerting.V3.Destinations.Pagerduty.Delete(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationPagerdutyDeleteResponse, error) +- client.Alerting.V3.Destinations.Pagerduty.Get(ctx context.Context, accountID string) ([]cloudflare.AlertingV3DestinationPagerdutyGetResponse, error) +- client.Alerting.V3.Destinations.Pagerduty.Link(ctx context.Context, accountID string, tokenID string) (cloudflare.AlertingV3DestinationPagerdutyLinkResponse, error) #### Webhooks Response Types: -- cloudflare.AlertingV3DestinationWebhookUpdateResponse +- cloudflare.AlertingV3DestinationWebhookNewResponse +- cloudflare.AlertingV3DestinationWebhookListResponse - cloudflare.AlertingV3DestinationWebhookDeleteResponse - cloudflare.AlertingV3DestinationWebhookGetResponse -- cloudflare.AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse -- cloudflare.AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse +- cloudflare.AlertingV3DestinationWebhookReplaceResponse Methods: -- client.Alerting.V3s.Destinations.Webhooks.Update(ctx context.Context, accountID string, webhookID string, body cloudflare.AlertingV3DestinationWebhookUpdateParams) (cloudflare.AlertingV3DestinationWebhookUpdateResponse, error) -- client.Alerting.V3s.Destinations.Webhooks.Delete(ctx context.Context, accountID string, webhookID string) (cloudflare.AlertingV3DestinationWebhookDeleteResponse, error) -- client.Alerting.V3s.Destinations.Webhooks.Get(ctx context.Context, accountID string, webhookID string) (cloudflare.AlertingV3DestinationWebhookGetResponse, error) -- client.Alerting.V3s.Destinations.Webhooks.NotificationWebhooksNewAWebhook(ctx context.Context, accountID string, body cloudflare.AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookParams) (cloudflare.AlertingV3DestinationWebhookNotificationWebhooksNewAWebhookResponse, error) -- client.Alerting.V3s.Destinations.Webhooks.NotificationWebhooksListWebhooks(ctx context.Context, accountID string) ([]cloudflare.AlertingV3DestinationWebhookNotificationWebhooksListWebhooksResponse, error) +- client.Alerting.V3.Destinations.Webhooks.New(ctx context.Context, accountID string, body cloudflare.AlertingV3DestinationWebhookNewParams) (cloudflare.AlertingV3DestinationWebhookNewResponse, error) +- client.Alerting.V3.Destinations.Webhooks.List(ctx context.Context, accountID string) ([]cloudflare.AlertingV3DestinationWebhookListResponse, error) +- client.Alerting.V3.Destinations.Webhooks.Delete(ctx context.Context, accountID string, webhookID string) (cloudflare.AlertingV3DestinationWebhookDeleteResponse, error) +- client.Alerting.V3.Destinations.Webhooks.Get(ctx context.Context, accountID string, webhookID string) (cloudflare.AlertingV3DestinationWebhookGetResponse, error) +- client.Alerting.V3.Destinations.Webhooks.Replace(ctx context.Context, accountID string, webhookID string, body cloudflare.AlertingV3DestinationWebhookReplaceParams) (cloudflare.AlertingV3DestinationWebhookReplaceResponse, error) ### Histories Response Types: -- cloudflare.AlertingV3HistoryNotificationHistoryListHistoryResponse +- cloudflare.AlertingV3HistoryListResponse Methods: -- client.Alerting.V3s.Histories.NotificationHistoryListHistory(ctx context.Context, accountID string, query cloudflare.AlertingV3HistoryNotificationHistoryListHistoryParams) ([]cloudflare.AlertingV3HistoryNotificationHistoryListHistoryResponse, error) +- client.Alerting.V3.Histories.List(ctx context.Context, accountID string, query cloudflare.AlertingV3HistoryListParams) (shared.V4PagePaginationArray[cloudflare.AlertingV3HistoryListResponse], error) ### Policies Response Types: -- cloudflare.AlertingV3PolicyUpdateResponse +- cloudflare.AlertingV3PolicyNewResponse +- cloudflare.AlertingV3PolicyListResponse - cloudflare.AlertingV3PolicyDeleteResponse - cloudflare.AlertingV3PolicyGetResponse -- cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse -- cloudflare.AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse - -Methods: - -- client.Alerting.V3s.Policies.Update(ctx context.Context, accountID string, policyID string, body cloudflare.AlertingV3PolicyUpdateParams) (cloudflare.AlertingV3PolicyUpdateResponse, error) -- client.Alerting.V3s.Policies.Delete(ctx context.Context, accountID string, policyID string) (cloudflare.AlertingV3PolicyDeleteResponse, error) -- client.Alerting.V3s.Policies.Get(ctx context.Context, accountID string, policyID string) (cloudflare.AlertingV3PolicyGetResponse, error) -- client.Alerting.V3s.Policies.NotificationPoliciesNewANotificationPolicy(ctx context.Context, accountID string, body cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyParams) (cloudflare.AlertingV3PolicyNotificationPoliciesNewANotificationPolicyResponse, error) -- client.Alerting.V3s.Policies.NotificationPoliciesListNotificationPolicies(ctx context.Context, accountID string) ([]cloudflare.AlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponse, error) - -## V3 - -### AvailableAlerts - -Response Types: - -- cloudflare.AlertingV3AvailableAlertListResponse +- cloudflare.AlertingV3PolicyReplaceResponse Methods: -- client.Alerting.V3.AvailableAlerts.List(ctx context.Context, accountID string) (cloudflare.AlertingV3AvailableAlertListResponse, error) - -### Destinations - -#### Pagerduty - -Response Types: - -- cloudflare.AlertingV3DestinationPagerdutyNewTokenResponse -- cloudflare.AlertingV3DestinationPagerdutyDeleteAllResponse -- cloudflare.AlertingV3DestinationPagerdutyLinkResponse - -Methods: - -- client.Alerting.V3.Destinations.Pagerduty.NewToken(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationPagerdutyNewTokenResponse, error) -- client.Alerting.V3.Destinations.Pagerduty.DeleteAll(ctx context.Context, accountID string) (cloudflare.AlertingV3DestinationPagerdutyDeleteAllResponse, error) -- client.Alerting.V3.Destinations.Pagerduty.Link(ctx context.Context, accountID string, tokenID string) (cloudflare.AlertingV3DestinationPagerdutyLinkResponse, error) +- client.Alerting.V3.Policies.New(ctx context.Context, accountID string, body cloudflare.AlertingV3PolicyNewParams) (cloudflare.AlertingV3PolicyNewResponse, error) +- client.Alerting.V3.Policies.List(ctx context.Context, accountID string) ([]cloudflare.AlertingV3PolicyListResponse, error) +- client.Alerting.V3.Policies.Delete(ctx context.Context, accountID string, policyID string) (cloudflare.AlertingV3PolicyDeleteResponse, error) +- client.Alerting.V3.Policies.Get(ctx context.Context, accountID string, policyID string) (cloudflare.AlertingV3PolicyGetResponse, error) +- client.Alerting.V3.Policies.Replace(ctx context.Context, accountID string, policyID string, body cloudflare.AlertingV3PolicyReplaceParams) (cloudflare.AlertingV3PolicyReplaceResponse, error) # Devices @@ -4701,185 +4591,177 @@ Methods: Response Types: -- cloudflare.DeviceDEXTestUpdateResponse +- cloudflare.DeviceDEXTestNewResponse +- cloudflare.DeviceDEXTestListResponse - cloudflare.DeviceDEXTestDeleteResponse -- cloudflare.DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse -- cloudflare.DeviceDEXTestDeviceDEXTestDetailsResponse - cloudflare.DeviceDEXTestGetResponse +- cloudflare.DeviceDEXTestReplaceResponse Methods: -- client.Devices.DEXTests.Update(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DeviceDEXTestUpdateParams) (cloudflare.DeviceDEXTestUpdateResponse, error) +- client.Devices.DEXTests.New(ctx context.Context, identifier interface{}, body cloudflare.DeviceDEXTestNewParams) (cloudflare.DeviceDEXTestNewResponse, error) +- client.Devices.DEXTests.List(ctx context.Context, identifier interface{}) ([]cloudflare.DeviceDEXTestListResponse, error) - client.Devices.DEXTests.Delete(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DeviceDEXTestDeleteResponse, error) -- client.Devices.DEXTests.DeviceDEXTestNewDeviceDEXTest(ctx context.Context, identifier interface{}, body cloudflare.DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParams) (cloudflare.DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse, error) -- client.Devices.DEXTests.DeviceDEXTestDetails(ctx context.Context, identifier interface{}) ([]cloudflare.DeviceDEXTestDeviceDEXTestDetailsResponse, error) - client.Devices.DEXTests.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DeviceDEXTestGetResponse, error) +- client.Devices.DEXTests.Replace(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DeviceDEXTestReplaceParams) (cloudflare.DeviceDEXTestReplaceResponse, error) ## Networks Response Types: -- cloudflare.DeviceNetworkUpdateResponse +- cloudflare.DeviceNetworkNewResponse +- cloudflare.DeviceNetworkListResponse - cloudflare.DeviceNetworkDeleteResponse -- cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse -- cloudflare.DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse - cloudflare.DeviceNetworkGetResponse +- cloudflare.DeviceNetworkReplaceResponse Methods: -- client.Devices.Networks.Update(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DeviceNetworkUpdateParams) (cloudflare.DeviceNetworkUpdateResponse, error) +- client.Devices.Networks.New(ctx context.Context, identifier interface{}, body cloudflare.DeviceNetworkNewParams) (cloudflare.DeviceNetworkNewResponse, error) +- client.Devices.Networks.List(ctx context.Context, identifier interface{}) ([]cloudflare.DeviceNetworkListResponse, error) - client.Devices.Networks.Delete(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DeviceNetworkDeleteResponse, error) -- client.Devices.Networks.DeviceManagedNetworksNewDeviceManagedNetwork(ctx context.Context, identifier interface{}, body cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParams) (cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse, error) -- client.Devices.Networks.DeviceManagedNetworksListDeviceManagedNetworks(ctx context.Context, identifier interface{}) ([]cloudflare.DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse, error) - client.Devices.Networks.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DeviceNetworkGetResponse, error) +- client.Devices.Networks.Replace(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DeviceNetworkReplaceParams) (cloudflare.DeviceNetworkReplaceResponse, error) ## Policies Response Types: +- cloudflare.DevicePolicyNewResponse - cloudflare.DevicePolicyUpdateResponse +- cloudflare.DevicePolicyListResponse - cloudflare.DevicePolicyDeleteResponse -- cloudflare.DevicePolicyDevicesNewDeviceSettingsPolicyResponse -- cloudflare.DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponse -- cloudflare.DevicePolicyDevicesListDeviceSettingsPoliciesResponse -- cloudflare.DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponse - cloudflare.DevicePolicyGetResponse Methods: +- client.Devices.Policies.New(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyNewParams) ([]cloudflare.DevicePolicyNewResponse, error) - client.Devices.Policies.Update(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePolicyUpdateParams) ([]cloudflare.DevicePolicyUpdateResponse, error) +- client.Devices.Policies.List(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyListResponse, error) - client.Devices.Policies.Delete(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyDeleteResponse, error) -- client.Devices.Policies.DevicesNewDeviceSettingsPolicy(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyDevicesNewDeviceSettingsPolicyParams) ([]cloudflare.DevicePolicyDevicesNewDeviceSettingsPolicyResponse, error) -- client.Devices.Policies.DevicesGetDefaultDeviceSettingsPolicy(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponse, error) -- client.Devices.Policies.DevicesListDeviceSettingsPolicies(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyDevicesListDeviceSettingsPoliciesResponse, error) -- client.Devices.Policies.DevicesUpdateDefaultDeviceSettingsPolicy(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParams) ([]cloudflare.DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponse, error) - client.Devices.Policies.Get(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyGetResponse, error) +### DefaultPolicy + +Response Types: + +- cloudflare.DevicePolicyDefaultPolicyGetResponse + +Methods: + +- client.Devices.Policies.DefaultPolicy.Get(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyDefaultPolicyGetResponse, error) + ### Excludes Response Types: -- cloudflare.DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse -- cloudflare.DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse -- cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse -- cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse +- cloudflare.DevicePolicyExcludeListResponse +- cloudflare.DevicePolicyExcludeReplaceResponse Methods: -- client.Devices.Policies.Excludes.DevicesGetSplitTunnelExcludeList(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse, error) -- client.Devices.Policies.Excludes.DevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse, error) -- client.Devices.Policies.Excludes.DevicesSetSplitTunnelExcludeList(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParams) ([]cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse, error) -- client.Devices.Policies.Excludes.DevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParams) ([]cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse, error) +- client.Devices.Policies.Excludes.List(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyExcludeListResponse, error) +- client.Devices.Policies.Excludes.Replace(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyExcludeReplaceParams) ([]cloudflare.DevicePolicyExcludeReplaceResponse, error) ### FallbackDomains Response Types: -- cloudflare.DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse -- cloudflare.DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse -- cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse -- cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse +- cloudflare.DevicePolicyFallbackDomainListResponse +- cloudflare.DevicePolicyFallbackDomainReplaceResponse Methods: -- client.Devices.Policies.FallbackDomains.DevicesGetLocalDomainFallbackList(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse, error) -- client.Devices.Policies.FallbackDomains.DevicesGetLocalDomainFallbackListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse, error) -- client.Devices.Policies.FallbackDomains.DevicesSetLocalDomainFallbackList(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParams) ([]cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse, error) -- client.Devices.Policies.FallbackDomains.DevicesSetLocalDomainFallbackListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParams) ([]cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse, error) +- client.Devices.Policies.FallbackDomains.List(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyFallbackDomainListResponse, error) +- client.Devices.Policies.FallbackDomains.Replace(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePolicyFallbackDomainReplaceParams) ([]cloudflare.DevicePolicyFallbackDomainReplaceResponse, error) ### Includes Response Types: -- cloudflare.DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse -- cloudflare.DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse -- cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse -- cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse +- cloudflare.DevicePolicyIncludeListResponse +- cloudflare.DevicePolicyIncludeReplaceResponse Methods: -- client.Devices.Policies.Includes.DevicesGetSplitTunnelIncludeList(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse, error) -- client.Devices.Policies.Includes.DevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string) ([]cloudflare.DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse, error) -- client.Devices.Policies.Includes.DevicesSetSplitTunnelIncludeList(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParams) ([]cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse, error) -- client.Devices.Policies.Includes.DevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParams) ([]cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse, error) +- client.Devices.Policies.Includes.List(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePolicyIncludeListResponse, error) +- client.Devices.Policies.Includes.Replace(ctx context.Context, identifier interface{}, body cloudflare.DevicePolicyIncludeReplaceParams) ([]cloudflare.DevicePolicyIncludeReplaceResponse, error) ## Postures Response Types: -- cloudflare.DevicePostureUpdateResponse +- cloudflare.DevicePostureNewResponse +- cloudflare.DevicePostureListResponse - cloudflare.DevicePostureDeleteResponse -- cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleResponse -- cloudflare.DevicePostureDevicePostureRulesListDevicePostureRulesResponse - cloudflare.DevicePostureGetResponse +- cloudflare.DevicePostureReplaceResponse Methods: -- client.Devices.Postures.Update(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePostureUpdateParams) (cloudflare.DevicePostureUpdateResponse, error) +- client.Devices.Postures.New(ctx context.Context, identifier interface{}, body cloudflare.DevicePostureNewParams) (cloudflare.DevicePostureNewResponse, error) +- client.Devices.Postures.List(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePostureListResponse, error) - client.Devices.Postures.Delete(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DevicePostureDeleteResponse, error) -- client.Devices.Postures.DevicePostureRulesNewDevicePostureRule(ctx context.Context, identifier interface{}, body cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParams) (cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleResponse, error) -- client.Devices.Postures.DevicePostureRulesListDevicePostureRules(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePostureDevicePostureRulesListDevicePostureRulesResponse, error) - client.Devices.Postures.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DevicePostureGetResponse, error) +- client.Devices.Postures.Replace(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePostureReplaceParams) (cloudflare.DevicePostureReplaceResponse, error) ### Integrations Response Types: +- cloudflare.DevicePostureIntegrationNewResponse - cloudflare.DevicePostureIntegrationUpdateResponse - cloudflare.DevicePostureIntegrationDeleteResponse -- cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse -- cloudflare.DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse - cloudflare.DevicePostureIntegrationGetResponse Methods: +- client.Devices.Postures.Integrations.New(ctx context.Context, identifier interface{}, body cloudflare.DevicePostureIntegrationNewParams) (cloudflare.DevicePostureIntegrationNewResponse, error) - client.Devices.Postures.Integrations.Update(ctx context.Context, identifier interface{}, uuid string, body cloudflare.DevicePostureIntegrationUpdateParams) (cloudflare.DevicePostureIntegrationUpdateResponse, error) - client.Devices.Postures.Integrations.Delete(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DevicePostureIntegrationDeleteResponse, error) -- client.Devices.Postures.Integrations.DevicePostureIntegrationsNewDevicePostureIntegration(ctx context.Context, identifier interface{}, body cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParams) (cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse, error) -- client.Devices.Postures.Integrations.DevicePostureIntegrationsListDevicePostureIntegrations(ctx context.Context, identifier interface{}) ([]cloudflare.DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse, error) - client.Devices.Postures.Integrations.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DevicePostureIntegrationGetResponse, error) ## Revokes Response Types: -- cloudflare.DeviceRevokeDevicesRevokeDevicesResponse +- cloudflare.DeviceRevokeNewResponse Methods: -- client.Devices.Revokes.DevicesRevokeDevices(ctx context.Context, identifier interface{}, body cloudflare.DeviceRevokeDevicesRevokeDevicesParams) (cloudflare.DeviceRevokeDevicesRevokeDevicesResponse, error) +- client.Devices.Revokes.New(ctx context.Context, identifier interface{}, body cloudflare.DeviceRevokeNewParams) (cloudflare.DeviceRevokeNewResponse, error) ## Settings Response Types: -- cloudflare.DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse -- cloudflare.DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse +- cloudflare.DeviceSettingListResponse +- cloudflare.DeviceSettingReplaceResponse Methods: -- client.Devices.Settings.ZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(ctx context.Context, identifier interface{}) (cloudflare.DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse, error) -- client.Devices.Settings.ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccount(ctx context.Context, identifier interface{}, body cloudflare.DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountParams) (cloudflare.DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse, error) +- client.Devices.Settings.List(ctx context.Context, identifier interface{}) (cloudflare.DeviceSettingListResponse, error) +- client.Devices.Settings.Replace(ctx context.Context, identifier interface{}, body cloudflare.DeviceSettingReplaceParams) (cloudflare.DeviceSettingReplaceResponse, error) ## Unrevokes Response Types: -- cloudflare.DeviceUnrevokeDevicesUnrevokeDevicesResponse +- cloudflare.DeviceUnrevokeNewResponse Methods: -- client.Devices.Unrevokes.DevicesUnrevokeDevices(ctx context.Context, identifier interface{}, body cloudflare.DeviceUnrevokeDevicesUnrevokeDevicesParams) (cloudflare.DeviceUnrevokeDevicesUnrevokeDevicesResponse, error) +- client.Devices.Unrevokes.New(ctx context.Context, identifier interface{}, body cloudflare.DeviceUnrevokeNewParams) (cloudflare.DeviceUnrevokeNewResponse, error) ## OverrideCodes Response Types: -- cloudflare.DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse +- cloudflare.DeviceOverrideCodeListResponse Methods: -- client.Devices.OverrideCodes.DevicesListAdminOverrideCodeForDevice(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse, error) +- client.Devices.OverrideCodes.List(ctx context.Context, identifier interface{}, uuid string) (cloudflare.DeviceOverrideCodeListResponse, error) # D1 @@ -4899,15 +4781,15 @@ Methods: Response Types: +- cloudflare.D1DatabaseNewResponse - cloudflare.D1DatabaseDeleteResponse - cloudflare.D1DatabaseGetResponse -- cloudflare.D1DatabaseQueryResponse Methods: +- client.D1.Database.New(ctx context.Context, accountIdentifier string, databaseIdentifier string, body cloudflare.D1DatabaseNewParams) ([]cloudflare.D1DatabaseNewResponse, error) - client.D1.Database.Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string) (cloudflare.D1DatabaseDeleteResponse, error) - client.D1.Database.Get(ctx context.Context, accountIdentifier string, databaseIdentifier string) (cloudflare.D1DatabaseGetResponse, error) -- client.D1.Database.Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body cloudflare.D1DatabaseQueryParams) ([]cloudflare.D1DatabaseQueryResponse, error) # DEX @@ -5073,14 +4955,14 @@ Methods: Response Types: -- cloudflare.DispatcherScriptUpdateResponse - cloudflare.DispatcherScriptGetResponse +- cloudflare.DispatcherScriptReplaceResponse Methods: -- client.Dispatchers.Scripts.Update(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body cloudflare.DispatcherScriptUpdateParams) (cloudflare.DispatcherScriptUpdateResponse, error) - client.Dispatchers.Scripts.Delete(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body cloudflare.DispatcherScriptDeleteParams) error - client.Dispatchers.Scripts.Get(ctx context.Context, accountID string, dispatchNamespace string, scriptName string) (cloudflare.DispatcherScriptGetResponse, error) +- client.Dispatchers.Scripts.Replace(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body cloudflare.DispatcherScriptReplaceParams) (cloudflare.DispatcherScriptReplaceResponse, error) # WorkersForPlatforms @@ -5094,12 +4976,12 @@ Methods: Response Types: -- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse +- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse Methods: -- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Update(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptContentUpdateParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse, error) - client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Get(ctx context.Context, accountID string, dispatchNamespace string, scriptName string) (http.Response, error) +- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Replace(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptContentReplaceParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse, error) ##### Settings @@ -5130,11 +5012,11 @@ Methods: Response Types: -- cloudflare.WorkerScriptContentUpdateResponse +- cloudflare.WorkerScriptContentReplaceResponse Methods: -- client.WorkerScripts.Content.Update(ctx context.Context, accountID string, scriptName string, params cloudflare.WorkerScriptContentUpdateParams) (cloudflare.WorkerScriptContentUpdateResponse, error) +- client.WorkerScripts.Content.Replace(ctx context.Context, accountID string, scriptName string, params cloudflare.WorkerScriptContentReplaceParams) (cloudflare.WorkerScriptContentReplaceResponse, error) ## ContentV2 @@ -5219,19 +5101,19 @@ Methods: Response Types: - cloudflare.ChallengeWidgetNewResponse -- cloudflare.ChallengeWidgetUpdateResponse - cloudflare.ChallengeWidgetListResponse - cloudflare.ChallengeWidgetDeleteResponse - cloudflare.ChallengeWidgetGetResponse +- cloudflare.ChallengeWidgetReplaceResponse - cloudflare.ChallengeWidgetRotateSecretResponse Methods: - client.Challenges.Widgets.New(ctx context.Context, accountIdentifier string, params cloudflare.ChallengeWidgetNewParams) (cloudflare.ChallengeWidgetNewResponse, error) -- client.Challenges.Widgets.Update(ctx context.Context, accountIdentifier string, sitekey string, body cloudflare.ChallengeWidgetUpdateParams) (cloudflare.ChallengeWidgetUpdateResponse, error) - client.Challenges.Widgets.List(ctx context.Context, accountIdentifier string, query cloudflare.ChallengeWidgetListParams) (shared.V4PagePaginationArray[cloudflare.ChallengeWidgetListResponse], error) - client.Challenges.Widgets.Delete(ctx context.Context, accountIdentifier string, sitekey string) (cloudflare.ChallengeWidgetDeleteResponse, error) - client.Challenges.Widgets.Get(ctx context.Context, accountIdentifier string, sitekey string) (cloudflare.ChallengeWidgetGetResponse, error) +- client.Challenges.Widgets.Replace(ctx context.Context, accountIdentifier string, sitekey string, body cloudflare.ChallengeWidgetReplaceParams) (cloudflare.ChallengeWidgetReplaceResponse, error) - client.Challenges.Widgets.RotateSecret(ctx context.Context, accountIdentifier string, sitekey string, body cloudflare.ChallengeWidgetRotateSecretParams) (cloudflare.ChallengeWidgetRotateSecretResponse, error) # Hyperdrive @@ -5241,53 +5123,18 @@ Methods: Response Types: - cloudflare.HyperdriveConfigNewResponse -- cloudflare.HyperdriveConfigUpdateResponse - cloudflare.HyperdriveConfigListResponse - cloudflare.HyperdriveConfigDeleteResponse - cloudflare.HyperdriveConfigGetResponse +- cloudflare.HyperdriveConfigReplaceResponse Methods: - client.Hyperdrive.Configs.New(ctx context.Context, accountID string, body cloudflare.HyperdriveConfigNewParams) (cloudflare.HyperdriveConfigNewResponse, error) -- client.Hyperdrive.Configs.Update(ctx context.Context, accountID string, hyperdriveID string, body cloudflare.HyperdriveConfigUpdateParams) (cloudflare.HyperdriveConfigUpdateResponse, error) - client.Hyperdrive.Configs.List(ctx context.Context, accountID string) ([]cloudflare.HyperdriveConfigListResponse, error) - client.Hyperdrive.Configs.Delete(ctx context.Context, accountID string, hyperdriveID string) (cloudflare.HyperdriveConfigDeleteResponse, error) - client.Hyperdrive.Configs.Get(ctx context.Context, accountID string, hyperdriveID string) (cloudflare.HyperdriveConfigGetResponse, error) - -# Intel - -## IndicatorFeeds - -Response Types: - -- cloudflare.IntelIndicatorFeedNewResponse -- cloudflare.IntelIndicatorFeedListResponse -- cloudflare.IntelIndicatorFeedGetResponse -- cloudflare.IntelIndicatorFeedPermissionsAddResponse -- cloudflare.IntelIndicatorFeedPermissionsRemoveResponse -- cloudflare.IntelIndicatorFeedPermissionsViewResponse -- cloudflare.IntelIndicatorFeedSnapshotResponse - -Methods: - -- client.Intel.IndicatorFeeds.New(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedNewParams) (cloudflare.IntelIndicatorFeedNewResponse, error) -- client.Intel.IndicatorFeeds.List(ctx context.Context, accountID string) ([]cloudflare.IntelIndicatorFeedListResponse, error) -- client.Intel.IndicatorFeeds.Data(ctx context.Context, accountID string, feedID int64) (string, error) -- client.Intel.IndicatorFeeds.Get(ctx context.Context, accountID string, feedID int64) (cloudflare.IntelIndicatorFeedGetResponse, error) -- client.Intel.IndicatorFeeds.PermissionsAdd(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedPermissionsAddParams) (cloudflare.IntelIndicatorFeedPermissionsAddResponse, error) -- client.Intel.IndicatorFeeds.PermissionsRemove(ctx context.Context, accountID string, body cloudflare.IntelIndicatorFeedPermissionsRemoveParams) (cloudflare.IntelIndicatorFeedPermissionsRemoveResponse, error) -- client.Intel.IndicatorFeeds.PermissionsView(ctx context.Context, accountID string) ([]cloudflare.IntelIndicatorFeedPermissionsViewResponse, error) -- client.Intel.IndicatorFeeds.Snapshot(ctx context.Context, accountID string, feedID int64, body cloudflare.IntelIndicatorFeedSnapshotParams) (cloudflare.IntelIndicatorFeedSnapshotResponse, error) - -## Sinkholes - -Response Types: - -- cloudflare.IntelSinkholeListResponse - -Methods: - -- client.Intel.Sinkholes.List(ctx context.Context, accountID string) ([]cloudflare.IntelSinkholeListResponse, error) +- client.Hyperdrive.Configs.Replace(ctx context.Context, accountID string, hyperdriveID string, body cloudflare.HyperdriveConfigReplaceParams) (cloudflare.HyperdriveConfigReplaceResponse, error) # Rum @@ -5296,34 +5143,34 @@ Methods: Response Types: - cloudflare.RumSiteInfoNewResponse -- cloudflare.RumSiteInfoUpdateResponse - cloudflare.RumSiteInfoListResponse - cloudflare.RumSiteInfoDeleteResponse - cloudflare.RumSiteInfoGetResponse +- cloudflare.RumSiteInfoReplaceResponse Methods: - client.Rum.SiteInfos.New(ctx context.Context, accountID string, body cloudflare.RumSiteInfoNewParams) (cloudflare.RumSiteInfoNewResponse, error) -- client.Rum.SiteInfos.Update(ctx context.Context, accountID string, siteID string, body cloudflare.RumSiteInfoUpdateParams) (cloudflare.RumSiteInfoUpdateResponse, error) - client.Rum.SiteInfos.List(ctx context.Context, accountID string, query cloudflare.RumSiteInfoListParams) (shared.V4PagePaginationArray[cloudflare.RumSiteInfoListResponse], error) - client.Rum.SiteInfos.Delete(ctx context.Context, accountID string, siteID string) (cloudflare.RumSiteInfoDeleteResponse, error) - client.Rum.SiteInfos.Get(ctx context.Context, accountID string, siteID string) (cloudflare.RumSiteInfoGetResponse, error) +- client.Rum.SiteInfos.Replace(ctx context.Context, accountID string, siteID string, body cloudflare.RumSiteInfoReplaceParams) (cloudflare.RumSiteInfoReplaceResponse, error) ## Rules Response Types: - cloudflare.RumRuleNewResponse -- cloudflare.RumRuleUpdateResponse - cloudflare.RumRuleListResponse - cloudflare.RumRuleDeleteResponse +- cloudflare.RumRuleReplaceResponse Methods: - client.Rum.Rules.New(ctx context.Context, accountID string, rulesetID string, body cloudflare.RumRuleNewParams) (cloudflare.RumRuleNewResponse, error) -- client.Rum.Rules.Update(ctx context.Context, accountID string, rulesetID string, ruleID string, body cloudflare.RumRuleUpdateParams) (cloudflare.RumRuleUpdateResponse, error) - client.Rum.Rules.List(ctx context.Context, accountID string, rulesetID string) (cloudflare.RumRuleListResponse, error) - client.Rum.Rules.Delete(ctx context.Context, accountID string, rulesetID string, ruleID string) (cloudflare.RumRuleDeleteResponse, error) +- client.Rum.Rules.Replace(ctx context.Context, accountID string, rulesetID string, ruleID string, body cloudflare.RumRuleReplaceParams) (cloudflare.RumRuleReplaceResponse, error) # Vectorize @@ -5332,27 +5179,23 @@ Methods: Response Types: - cloudflare.VectorizeIndexNewResponse -- cloudflare.VectorizeIndexUpdateResponse - cloudflare.VectorizeIndexListResponse - cloudflare.VectorizeIndexDeleteResponse -- cloudflare.VectorizeIndexDeleteByIDsResponse - cloudflare.VectorizeIndexGetResponse -- cloudflare.VectorizeIndexGetByIDsResponse - cloudflare.VectorizeIndexInsertResponse - cloudflare.VectorizeIndexQueryResponse +- cloudflare.VectorizeIndexReplaceResponse - cloudflare.VectorizeIndexUpsertResponse Methods: - client.Vectorize.Indexes.New(ctx context.Context, accountIdentifier string, body cloudflare.VectorizeIndexNewParams) (cloudflare.VectorizeIndexNewResponse, error) -- client.Vectorize.Indexes.Update(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexUpdateParams) (cloudflare.VectorizeIndexUpdateResponse, error) - client.Vectorize.Indexes.List(ctx context.Context, accountIdentifier string) ([]cloudflare.VectorizeIndexListResponse, error) - client.Vectorize.Indexes.Delete(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexDeleteResponse, error) -- client.Vectorize.Indexes.DeleteByIDs(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexDeleteByIDsParams) (cloudflare.VectorizeIndexDeleteByIDsResponse, error) - client.Vectorize.Indexes.Get(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexGetResponse, error) -- client.Vectorize.Indexes.GetByIDs(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexGetByIDsParams) (cloudflare.VectorizeIndexGetByIDsResponse, error) - client.Vectorize.Indexes.Insert(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexInsertResponse, error) - client.Vectorize.Indexes.Query(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexQueryParams) (cloudflare.VectorizeIndexQueryResponse, error) +- client.Vectorize.Indexes.Replace(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexReplaceParams) (cloudflare.VectorizeIndexReplaceResponse, error) - client.Vectorize.Indexes.Upsert(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexUpsertResponse, error) # URLScanner @@ -5435,12 +5278,20 @@ Methods: Response Types: - cloudflare.RadarBGPTopAseListResponse -- cloudflare.RadarBGPTopAsePrefixesResponse Methods: - client.Radar.BGP.Tops.Ases.List(ctx context.Context, query cloudflare.RadarBGPTopAseListParams) (cloudflare.RadarBGPTopAseListResponse, error) -- client.Radar.BGP.Tops.Ases.Prefixes(ctx context.Context, query cloudflare.RadarBGPTopAsePrefixesParams) (cloudflare.RadarBGPTopAsePrefixesResponse, error) + +##### Prefixes + +Response Types: + +- cloudflare.RadarBGPTopAsePrefixListResponse + +Methods: + +- client.Radar.BGP.Tops.Ases.Prefixes.List(ctx context.Context, query cloudflare.RadarBGPTopAsePrefixListParams) (cloudflare.RadarBGPTopAsePrefixListResponse, error) #### Prefixes @@ -5456,25 +5307,43 @@ Methods: Response Types: -- cloudflare.RadarBGPHijackEventsResponse +- cloudflare.RadarBGPHijackListResponse Methods: -- client.Radar.BGP.Hijacks.Events(ctx context.Context, query cloudflare.RadarBGPHijackEventsParams) (cloudflare.RadarBGPHijackEventsResponse, error) +- client.Radar.BGP.Hijacks.List(ctx context.Context, query cloudflare.RadarBGPHijackListParams) (shared.V4PagePagination[cloudflare.RadarBGPHijackListResponse], error) ### Routes +#### Moas + +Response Types: + +- cloudflare.RadarBGPRouteMoaListResponse + +Methods: + +- client.Radar.BGP.Routes.Moas.List(ctx context.Context, query cloudflare.RadarBGPRouteMoaListParams) (cloudflare.RadarBGPRouteMoaListResponse, error) + +#### Pfx2as + Response Types: -- cloudflare.RadarBGPRouteMoasResponse -- cloudflare.RadarBGPRoutePfx2asResponse -- cloudflare.RadarBGPRouteStatsResponse +- cloudflare.RadarBGPRoutePfx2aListResponse Methods: -- client.Radar.BGP.Routes.Moas(ctx context.Context, query cloudflare.RadarBGPRouteMoasParams) (cloudflare.RadarBGPRouteMoasResponse, error) -- client.Radar.BGP.Routes.Pfx2as(ctx context.Context, query cloudflare.RadarBGPRoutePfx2asParams) (cloudflare.RadarBGPRoutePfx2asResponse, error) -- client.Radar.BGP.Routes.Stats(ctx context.Context, query cloudflare.RadarBGPRouteStatsParams) (cloudflare.RadarBGPRouteStatsResponse, error) +- client.Radar.BGP.Routes.Pfx2as.List(ctx context.Context, query cloudflare.RadarBGPRoutePfx2aListParams) (cloudflare.RadarBGPRoutePfx2aListResponse, error) + +#### Stats + +Response Types: + +- cloudflare.RadarBGPRouteStatListResponse + +Methods: + +- client.Radar.BGP.Routes.Stats.List(ctx context.Context, query cloudflare.RadarBGPRouteStatListParams) (cloudflare.RadarBGPRouteStatListResponse, error) ## Datasets @@ -5491,11 +5360,11 @@ Methods: Response Types: -- cloudflare.RadarDatasetDownloadRadarPostDatasetDownloadResponse +- cloudflare.RadarDatasetDownloadNewResponse Methods: -- client.Radar.Datasets.Downloads.RadarPostDatasetDownload(ctx context.Context, params cloudflare.RadarDatasetDownloadRadarPostDatasetDownloadParams) (cloudflare.RadarDatasetDownloadRadarPostDatasetDownloadResponse, error) +- client.Radar.Datasets.Downloads.New(ctx context.Context, params cloudflare.RadarDatasetDownloadNewParams) (cloudflare.RadarDatasetDownloadNewResponse, error) ## DNS @@ -5629,11 +5498,11 @@ Methods: Response Types: -- cloudflare.RadarConnectionTamperingSummaryResponse +- cloudflare.RadarConnectionTamperingListResponse Methods: -- client.Radar.ConnectionTampering.Summary(ctx context.Context, query cloudflare.RadarConnectionTamperingSummaryParams) (cloudflare.RadarConnectionTamperingSummaryResponse, error) +- client.Radar.ConnectionTampering.List(ctx context.Context, query cloudflare.RadarConnectionTamperingListParams) (cloudflare.RadarConnectionTamperingListResponse, error) ### TimeseriesGroups @@ -5695,11 +5564,11 @@ Methods: Response Types: -- cloudflare.RadarEmailSecuritySummarySpamGetResponse +- cloudflare.RadarEmailSecuritySummarySpamListResponse Methods: -- client.Radar.Email.Security.Summaries.Spams.Get(ctx context.Context, query cloudflare.RadarEmailSecuritySummarySpamGetParams) (cloudflare.RadarEmailSecuritySummarySpamGetResponse, error) +- client.Radar.Email.Security.Summaries.Spams.List(ctx context.Context, query cloudflare.RadarEmailSecuritySummarySpamListParams) (cloudflare.RadarEmailSecuritySummarySpamListResponse, error) ##### SPFs @@ -5953,11 +5822,11 @@ Methods: Response Types: -- cloudflare.RadarEntityIPsResponse +- cloudflare.RadarEntityListResponse Methods: -- client.Radar.Entities.IPs(ctx context.Context, query cloudflare.RadarEntityIPsParams) (cloudflare.RadarEntityIPsResponse, error) +- client.Radar.Entities.List(ctx context.Context, query cloudflare.RadarEntityListParams) (cloudflare.RadarEntityListResponse, error) ### Asns @@ -5971,28 +5840,6 @@ Methods: ## HTTP -Response Types: - -- cloudflare.RadarHTTPBotClassesResponse -- cloudflare.RadarHTTPBrowserFamiliesResponse -- cloudflare.RadarHTTPBrowsersResponse -- cloudflare.RadarHTTPDeviceTypesResponse -- cloudflare.RadarHttphttpProtocolsResponse -- cloudflare.RadarHttphttpVersionsResponse -- cloudflare.RadarHttpipVersionsResponse -- cloudflare.RadarHTTPOssResponse - -Methods: - -- client.Radar.HTTP.BotClasses(ctx context.Context, query cloudflare.RadarHTTPBotClassesParams) (cloudflare.RadarHTTPBotClassesResponse, error) -- client.Radar.HTTP.BrowserFamilies(ctx context.Context, query cloudflare.RadarHTTPBrowserFamiliesParams) (cloudflare.RadarHTTPBrowserFamiliesResponse, error) -- client.Radar.HTTP.Browsers(ctx context.Context, query cloudflare.RadarHTTPBrowsersParams) (cloudflare.RadarHTTPBrowsersResponse, error) -- client.Radar.HTTP.DeviceTypes(ctx context.Context, query cloudflare.RadarHTTPDeviceTypesParams) (cloudflare.RadarHTTPDeviceTypesResponse, error) -- client.Radar.HTTP.HTTPProtocols(ctx context.Context, query cloudflare.RadarHTTPHTTPProtocolsParams) (cloudflare.RadarHttphttpProtocolsResponse, error) -- client.Radar.HTTP.HTTPVersions(ctx context.Context, query cloudflare.RadarHTTPHTTPVersionsParams) (cloudflare.RadarHttphttpVersionsResponse, error) -- client.Radar.HTTP.IPVersions(ctx context.Context, query cloudflare.RadarHTTPIPVersionsParams) (cloudflare.RadarHttpipVersionsResponse, error) -- client.Radar.HTTP.Oss(ctx context.Context, query cloudflare.RadarHTTPOssParams) (cloudflare.RadarHTTPOssResponse, error) - ### TLSVersion Response Types: @@ -6009,11 +5856,11 @@ Methods: Response Types: -- cloudflare.RadarQualityIqiGetResponse +- cloudflare.RadarQualityIqiListResponse Methods: -- client.Radar.Quality.Iqi.Get(ctx context.Context, query cloudflare.RadarQualityIqiGetParams) (cloudflare.RadarQualityIqiGetResponse, error) +- client.Radar.Quality.Iqi.List(ctx context.Context, query cloudflare.RadarQualityIqiListParams) (cloudflare.RadarQualityIqiListResponse, error) #### TimeseriesGroups @@ -6031,21 +5878,21 @@ Methods: Response Types: -- cloudflare.RadarQualitySpeedHistogramGetResponse +- cloudflare.RadarQualitySpeedHistogramListResponse Methods: -- client.Radar.Quality.Speed.Histogram.Get(ctx context.Context, query cloudflare.RadarQualitySpeedHistogramGetParams) (cloudflare.RadarQualitySpeedHistogramGetResponse, error) +- client.Radar.Quality.Speed.Histogram.List(ctx context.Context, query cloudflare.RadarQualitySpeedHistogramListParams) (cloudflare.RadarQualitySpeedHistogramListResponse, error) #### Summary Response Types: -- cloudflare.RadarQualitySpeedSummaryGetResponse +- cloudflare.RadarQualitySpeedSummaryListResponse Methods: -- client.Radar.Quality.Speed.Summary.Get(ctx context.Context, query cloudflare.RadarQualitySpeedSummaryGetParams) (cloudflare.RadarQualitySpeedSummaryGetResponse, error) +- client.Radar.Quality.Speed.Summary.List(ctx context.Context, query cloudflare.RadarQualitySpeedSummaryListParams) (cloudflare.RadarQualitySpeedSummaryListResponse, error) #### Top @@ -6101,53 +5948,41 @@ Methods: - client.Radar.TrafficAnomalies.Locations.List(ctx context.Context, query cloudflare.RadarTrafficAnomalyLocationListParams) (cloudflare.RadarTrafficAnomalyLocationListResponse, error) -# BotManagements +# BotManagement Response Types: -- cloudflare.BotManagementUpdateResponse - cloudflare.BotManagementGetResponse +- cloudflare.BotManagementReplaceResponse Methods: -- client.BotManagements.Update(ctx context.Context, zoneID string, body cloudflare.BotManagementUpdateParams) (cloudflare.BotManagementUpdateResponse, error) -- client.BotManagements.Get(ctx context.Context, zoneID string) (cloudflare.BotManagementGetResponse, error) +- client.BotManagement.Get(ctx context.Context, zoneID string) (cloudflare.BotManagementGetResponse, error) +- client.BotManagement.Replace(ctx context.Context, zoneID string, body cloudflare.BotManagementReplaceParams) (cloudflare.BotManagementReplaceResponse, error) -# CacheReserves +# CacheReserve Response Types: - cloudflare.CacheReserveNewResponse -- cloudflare.CacheReserveClearResponse +- cloudflare.CacheReserveGetResponse Methods: -- client.CacheReserves.New(ctx context.Context, zoneID string) (cloudflare.CacheReserveNewResponse, error) -- client.CacheReserves.Clear(ctx context.Context, zoneID string) (cloudflare.CacheReserveClearResponse, error) +- client.CacheReserve.New(ctx context.Context, zoneID string) (cloudflare.CacheReserveNewResponse, error) +- client.CacheReserve.Get(ctx context.Context, zoneID string) (cloudflare.CacheReserveGetResponse, error) -# OriginPostQuantumEncryptions +# OriginPostQuantumEncryption Response Types: -- cloudflare.OriginPostQuantumEncryptionUpdateResponse - cloudflare.OriginPostQuantumEncryptionGetResponse +- cloudflare.OriginPostQuantumEncryptionReplaceResponse Methods: -- client.OriginPostQuantumEncryptions.Update(ctx context.Context, zoneID string, body cloudflare.OriginPostQuantumEncryptionUpdateParams) (cloudflare.OriginPostQuantumEncryptionUpdateResponse, error) -- client.OriginPostQuantumEncryptions.Get(ctx context.Context, zoneID string) (cloudflare.OriginPostQuantumEncryptionGetResponse, error) - -# Cache - -Response Types: - -- cloudflare.CacheRegionalTieredCachesResponse -- cloudflare.CacheUpdateRegionalTieredCacheResponse - -Methods: - -- client.Cache.RegionalTieredCaches(ctx context.Context, zoneID string) (cloudflare.CacheRegionalTieredCachesResponse, error) -- client.Cache.UpdateRegionalTieredCache(ctx context.Context, zoneID string, body cloudflare.CacheUpdateRegionalTieredCacheParams) (cloudflare.CacheUpdateRegionalTieredCacheResponse, error) +- client.OriginPostQuantumEncryption.Get(ctx context.Context, zoneID string) (cloudflare.OriginPostQuantumEncryptionGetResponse, error) +- client.OriginPostQuantumEncryption.Replace(ctx context.Context, zoneID string, body cloudflare.OriginPostQuantumEncryptionReplaceParams) (cloudflare.OriginPostQuantumEncryptionReplaceResponse, error) # Firewall @@ -6185,23 +6020,23 @@ Methods: Response Types: -- cloudflare.ZarazWorkflowUpdateResponse +- cloudflare.ZarazReplaceResponse Methods: -- client.Zaraz.WorkflowUpdate(ctx context.Context, zoneID string, body cloudflare.ZarazWorkflowUpdateParams) (cloudflare.ZarazWorkflowUpdateResponse, error) +- client.Zaraz.Replace(ctx context.Context, zoneID string, body cloudflare.ZarazReplaceParams) (cloudflare.ZarazReplaceResponse, error) ## Config Response Types: -- cloudflare.ZarazConfigUpdateResponse - cloudflare.ZarazConfigGetResponse +- cloudflare.ZarazConfigReplaceResponse Methods: -- client.Zaraz.Config.Update(ctx context.Context, zoneID string, body cloudflare.ZarazConfigUpdateParams) (cloudflare.ZarazConfigUpdateResponse, error) - client.Zaraz.Config.Get(ctx context.Context, zoneID string) (cloudflare.ZarazConfigGetResponse, error) +- client.Zaraz.Config.Replace(ctx context.Context, zoneID string, body cloudflare.ZarazConfigReplaceParams) (cloudflare.ZarazConfigReplaceResponse, error) ## Default @@ -6227,13 +6062,13 @@ Methods: Response Types: -- cloudflare.ZarazHistoryUpdateResponse - cloudflare.ZarazHistoryListResponse +- cloudflare.ZarazHistoryReplaceResponse Methods: -- client.Zaraz.History.Update(ctx context.Context, zoneID string, body cloudflare.ZarazHistoryUpdateParams) (cloudflare.ZarazHistoryUpdateResponse, error) - client.Zaraz.History.List(ctx context.Context, zoneID string, query cloudflare.ZarazHistoryListParams) ([]cloudflare.ZarazHistoryListResponse, error) +- client.Zaraz.History.Replace(ctx context.Context, zoneID string, body cloudflare.ZarazHistoryReplaceParams) (cloudflare.ZarazHistoryReplaceResponse, error) ### Configs @@ -6261,128 +6096,109 @@ Methods: - client.Zaraz.Workflow.Get(ctx context.Context, zoneID string) (cloudflare.ZarazWorkflowGetResponse, error) -# SpeedAPI +# Speed Response Types: -- cloudflare.SpeedAPIAvailabilitiesListResponse -- cloudflare.SpeedAPIPagesListResponse -- cloudflare.SpeedAPIScheduleDeleteResponse -- cloudflare.SpeedAPIScheduleGetResponse -- cloudflare.SpeedAPITestsNewResponse -- cloudflare.SpeedAPITestsDeleteResponse -- cloudflare.SpeedAPITestsGetResponse -- cloudflare.SpeedAPITestsListResponse -- cloudflare.SpeedAPITrendsListResponse +- cloudflare.SpeedNewResponse +- cloudflare.SpeedDeleteResponse +- cloudflare.SpeedScheduleGetResponse +- cloudflare.SpeedTestsGetResponse +- cloudflare.SpeedTrendsListResponse Methods: -- client.SpeedAPI.AvailabilitiesList(ctx context.Context, zoneID string) (cloudflare.SpeedAPIAvailabilitiesListResponse, error) -- client.SpeedAPI.PagesList(ctx context.Context, zoneID string) ([]cloudflare.SpeedAPIPagesListResponse, error) -- client.SpeedAPI.ScheduleDelete(ctx context.Context, zoneID string, url string, body cloudflare.SpeedAPIScheduleDeleteParams) (cloudflare.SpeedAPIScheduleDeleteResponse, error) -- client.SpeedAPI.ScheduleGet(ctx context.Context, zoneID string, url string, query cloudflare.SpeedAPIScheduleGetParams) (cloudflare.SpeedAPIScheduleGetResponse, error) -- client.SpeedAPI.TestsNew(ctx context.Context, zoneID string, url string, body cloudflare.SpeedAPITestsNewParams) (cloudflare.SpeedAPITestsNewResponse, error) -- client.SpeedAPI.TestsDelete(ctx context.Context, zoneID string, url string, body cloudflare.SpeedAPITestsDeleteParams) (cloudflare.SpeedAPITestsDeleteResponse, error) -- client.SpeedAPI.TestsGet(ctx context.Context, zoneID string, url string, testID string) (cloudflare.SpeedAPITestsGetResponse, error) -- client.SpeedAPI.TestsList(ctx context.Context, zoneID string, url string, query cloudflare.SpeedAPITestsListParams) (cloudflare.SpeedAPITestsListResponse, error) -- client.SpeedAPI.TrendsList(ctx context.Context, zoneID string, url string, query cloudflare.SpeedAPITrendsListParams) (cloudflare.SpeedAPITrendsListResponse, error) +- client.Speed.New(ctx context.Context, zoneID string, url string, body cloudflare.SpeedNewParams) (cloudflare.SpeedNewResponse, error) +- client.Speed.Delete(ctx context.Context, zoneID string, url string, body cloudflare.SpeedDeleteParams) (cloudflare.SpeedDeleteResponse, error) +- client.Speed.ScheduleGet(ctx context.Context, zoneID string, url string, query cloudflare.SpeedScheduleGetParams) (cloudflare.SpeedScheduleGetResponse, error) +- client.Speed.TestsGet(ctx context.Context, zoneID string, url string, testID string) (cloudflare.SpeedTestsGetResponse, error) +- client.Speed.TrendsList(ctx context.Context, zoneID string, url string, query cloudflare.SpeedTrendsListParams) (cloudflare.SpeedTrendsListResponse, error) ## Schedule Response Types: -- cloudflare.SpeedAPIScheduleNewResponse +- cloudflare.SpeedScheduleNewResponse Methods: -- client.SpeedAPI.Schedule.New(ctx context.Context, zoneID string, url string, body cloudflare.SpeedAPIScheduleNewParams) (cloudflare.SpeedAPIScheduleNewResponse, error) - -# DcvDelegation +- client.Speed.Schedule.New(ctx context.Context, zoneID string, url string, body cloudflare.SpeedScheduleNewParams) (cloudflare.SpeedScheduleNewResponse, error) -## Uuid +## Availabilities Response Types: -- cloudflare.DcvDelegationUuidGetResponse +- cloudflare.SpeedAvailabilityListResponse Methods: -- client.DcvDelegation.Uuid.Get(ctx context.Context, zoneID string) (cloudflare.DcvDelegationUuidGetResponse, error) - -# Hostnames - -## Settings +- client.Speed.Availabilities.List(ctx context.Context, zoneID string) (cloudflare.SpeedAvailabilityListResponse, error) -### TLS +## Pages Response Types: -- cloudflare.HostnameSettingTLSUpdateResponse -- cloudflare.HostnameSettingTLSDeleteResponse -- cloudflare.HostnameSettingTLSGetResponse +- cloudflare.SpeedPageListResponse Methods: -- client.Hostnames.Settings.TLS.Update(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSUpdateParamsSettingID, hostname string, body cloudflare.HostnameSettingTLSUpdateParams) (cloudflare.HostnameSettingTLSUpdateResponse, error) -- client.Hostnames.Settings.TLS.Delete(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSDeleteParamsSettingID, hostname string) (cloudflare.HostnameSettingTLSDeleteResponse, error) -- client.Hostnames.Settings.TLS.Get(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSGetParamsSettingID) ([]cloudflare.HostnameSettingTLSGetResponse, error) - -# PageShield +- client.Speed.Pages.List(ctx context.Context, zoneID string) ([]cloudflare.SpeedPageListResponse, error) -## Connections +## Tests Response Types: -- cloudflare.PageShieldConnectionGetResponse +- cloudflare.SpeedTestListResponse Methods: -- client.PageShield.Connections.Get(ctx context.Context, zoneID string, connectionID string) (cloudflare.PageShieldConnectionGetResponse, error) +- client.Speed.Tests.List(ctx context.Context, zoneID string, url string, query cloudflare.SpeedTestListParams) (cloudflare.SpeedTestListResponse, error) -## Policies +# DcvDelegation + +## Uuid Response Types: -- cloudflare.PageShieldPolicyNewResponse -- cloudflare.PageShieldPolicyUpdateResponse -- cloudflare.PageShieldPolicyListResponse -- cloudflare.PageShieldPolicyGetResponse +- cloudflare.DcvDelegationUuidGetResponse Methods: -- client.PageShield.Policies.New(ctx context.Context, zoneID string, body cloudflare.PageShieldPolicyNewParams) (cloudflare.PageShieldPolicyNewResponse, error) -- client.PageShield.Policies.Update(ctx context.Context, zoneID string, policyID string, body cloudflare.PageShieldPolicyUpdateParams) (cloudflare.PageShieldPolicyUpdateResponse, error) -- client.PageShield.Policies.List(ctx context.Context, zoneID string) ([]cloudflare.PageShieldPolicyListResponse, error) -- client.PageShield.Policies.Delete(ctx context.Context, zoneID string, policyID string) error -- client.PageShield.Policies.Get(ctx context.Context, zoneID string, policyID string) (cloudflare.PageShieldPolicyGetResponse, error) +- client.DcvDelegation.Uuid.Get(ctx context.Context, zoneID string) (cloudflare.DcvDelegationUuidGetResponse, error) + +# Hostnames -# FontSettings +## Settings + +### TLS Response Types: -- cloudflare.FontSettingUpdateResponse -- cloudflare.FontSettingGetResponse +- cloudflare.HostnameSettingTLSDeleteResponse +- cloudflare.HostnameSettingTLSGetResponse +- cloudflare.HostnameSettingTLSReplaceResponse Methods: -- client.FontSettings.Update(ctx context.Context, zoneID string, body cloudflare.FontSettingUpdateParams) (cloudflare.FontSettingUpdateResponse, error) -- client.FontSettings.Get(ctx context.Context, zoneID string) (cloudflare.FontSettingGetResponse, error) +- client.Hostnames.Settings.TLS.Delete(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSDeleteParamsSettingID, hostname string) (cloudflare.HostnameSettingTLSDeleteResponse, error) +- client.Hostnames.Settings.TLS.Get(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSGetParamsSettingID) ([]cloudflare.HostnameSettingTLSGetResponse, error) +- client.Hostnames.Settings.TLS.Replace(ctx context.Context, zoneID string, settingID cloudflare.HostnameSettingTLSReplaceParamsSettingID, hostname string, body cloudflare.HostnameSettingTLSReplaceParams) (cloudflare.HostnameSettingTLSReplaceResponse, error) # Snippets Response Types: -- cloudflare.SnippetUpdateResponse - cloudflare.SnippetListResponse - cloudflare.SnippetDeleteResponse - cloudflare.SnippetGetResponse +- cloudflare.SnippetReplaceResponse Methods: -- client.Snippets.Update(ctx context.Context, zoneIdentifier string, snippetName string, body cloudflare.SnippetUpdateParams) (cloudflare.SnippetUpdateResponse, error) - client.Snippets.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.SnippetListResponse, error) - client.Snippets.Delete(ctx context.Context, zoneIdentifier string, snippetName string) (cloudflare.SnippetDeleteResponse, error) - client.Snippets.Get(ctx context.Context, zoneIdentifier string, snippetName string) (cloudflare.SnippetGetResponse, error) +- client.Snippets.Replace(ctx context.Context, zoneIdentifier string, snippetName string, body cloudflare.SnippetReplaceParams) (cloudflare.SnippetReplaceResponse, error) ## Content @@ -6394,81 +6210,28 @@ Methods: Response Types: -- cloudflare.SnippetSnippetRuleUpdateResponse - cloudflare.SnippetSnippetRuleListResponse +- cloudflare.SnippetSnippetRuleReplaceResponse Methods: -- client.Snippets.SnippetRules.Update(ctx context.Context, zoneIdentifier string, body cloudflare.SnippetSnippetRuleUpdateParams) ([]cloudflare.SnippetSnippetRuleUpdateResponse, error) - client.Snippets.SnippetRules.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.SnippetSnippetRuleListResponse, error) - -# DLP - -## Datasets - -Response Types: - -- cloudflare.DLPDatasetNewResponse -- cloudflare.DLPDatasetUpdateResponse -- cloudflare.DLPDatasetListResponse -- cloudflare.DLPDatasetGetResponse -- cloudflare.DLPDatasetUploadResponse -- cloudflare.DLPDatasetUploadPrepareResponse - -Methods: - -- client.DLP.Datasets.New(ctx context.Context, accountID string, body cloudflare.DLPDatasetNewParams) (cloudflare.DLPDatasetNewResponse, error) -- client.DLP.Datasets.Update(ctx context.Context, accountID string, datasetID string, body cloudflare.DLPDatasetUpdateParams) (cloudflare.DLPDatasetUpdateResponse, error) -- client.DLP.Datasets.List(ctx context.Context, accountID string) ([]cloudflare.DLPDatasetListResponse, error) -- client.DLP.Datasets.Delete(ctx context.Context, accountID string, datasetID string) error -- client.DLP.Datasets.Get(ctx context.Context, accountID string, datasetID string) (cloudflare.DLPDatasetGetResponse, error) -- client.DLP.Datasets.Upload(ctx context.Context, accountID string, datasetID string, version int64) (cloudflare.DLPDatasetUploadResponse, error) -- client.DLP.Datasets.UploadPrepare(ctx context.Context, accountID string, datasetID string) (cloudflare.DLPDatasetUploadPrepareResponse, error) - -# Gateway - -## AuditSSHSettings - -Response Types: - -- cloudflare.GatewayAuditSSHSettingUpdateResponse -- cloudflare.GatewayAuditSSHSettingGetResponse - -Methods: - -- client.Gateway.AuditSSHSettings.Update(ctx context.Context, accountID interface{}, body cloudflare.GatewayAuditSSHSettingUpdateParams) (cloudflare.GatewayAuditSSHSettingUpdateResponse, error) -- client.Gateway.AuditSSHSettings.Get(ctx context.Context, accountID interface{}) (cloudflare.GatewayAuditSSHSettingGetResponse, error) - -# AccessTags - -Response Types: - -- cloudflare.AccessTagNewResponse -- cloudflare.AccessTagUpdateResponse -- cloudflare.AccessTagDeleteResponse -- cloudflare.AccessTagGetResponse - -Methods: - -- client.AccessTags.New(ctx context.Context, identifier string, body cloudflare.AccessTagNewParams) (cloudflare.AccessTagNewResponse, error) -- client.AccessTags.Update(ctx context.Context, identifier string, tagName string, body cloudflare.AccessTagUpdateParams) (cloudflare.AccessTagUpdateResponse, error) -- client.AccessTags.Delete(ctx context.Context, identifier string, name string) (cloudflare.AccessTagDeleteResponse, error) -- client.AccessTags.Get(ctx context.Context, identifier string, name string) (cloudflare.AccessTagGetResponse, error) +- client.Snippets.SnippetRules.Replace(ctx context.Context, zoneIdentifier string, body cloudflare.SnippetSnippetRuleReplaceParams) ([]cloudflare.SnippetSnippetRuleReplaceResponse, error) # Calls Response Types: - cloudflare.CallNewResponse -- cloudflare.CallUpdateResponse - cloudflare.CallListResponse - cloudflare.CallDeleteResponse - cloudflare.CallGetResponse +- cloudflare.CallReplaceResponse Methods: - client.Calls.New(ctx context.Context, accountID string, body cloudflare.CallNewParams) (cloudflare.CallNewResponse, error) -- client.Calls.Update(ctx context.Context, accountID string, appID string, body cloudflare.CallUpdateParams) (cloudflare.CallUpdateResponse, error) - client.Calls.List(ctx context.Context, accountID string) ([]cloudflare.CallListResponse, error) - client.Calls.Delete(ctx context.Context, accountID string, appID string) (cloudflare.CallDeleteResponse, error) - client.Calls.Get(ctx context.Context, accountID string, appID string) (cloudflare.CallGetResponse, error) +- client.Calls.Replace(ctx context.Context, accountID string, appID string, body cloudflare.CallReplaceParams) (cloudflare.CallReplaceResponse, error) diff --git a/argotieredcaching.go b/argotieredcaching.go index b02ee75210c..d4f72da16ce 100644 --- a/argotieredcaching.go +++ b/argotieredcaching.go @@ -34,12 +34,12 @@ func NewArgoTieredCachingService(opts ...option.RequestOption) (r *ArgoTieredCac return } -// Get Tiered Caching setting -func (r *ArgoTieredCachingService) TieredCachingGetTieredCachingSetting(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse, err error) { +// Updates enablement of Tiered Caching +func (r *ArgoTieredCachingService) Update(ctx context.Context, zoneID string, body ArgoTieredCachingUpdateParams, opts ...option.RequestOption) (res *ArgoTieredCachingUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelope + var env ArgoTieredCachingUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/argo/tiered_caching", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *ArgoTieredCachingService) TieredCachingGetTieredCachingSetting(ctx cont return } -// Updates enablement of Tiered Caching -func (r *ArgoTieredCachingService) TieredCachingPatchTieredCachingSetting(ctx context.Context, zoneID string, body ArgoTieredCachingTieredCachingPatchTieredCachingSettingParams, opts ...option.RequestOption) (res *ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse, err error) { +// Get Tiered Caching setting +func (r *ArgoTieredCachingService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ArgoTieredCachingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelope + var env ArgoTieredCachingGetResponseEnvelope path := fmt.Sprintf("zones/%s/argo/tiered_caching", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -60,16 +60,15 @@ func (r *ArgoTieredCachingService) TieredCachingPatchTieredCachingSetting(ctx co return } -// Union satisfied by -// [ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseUnknown] or +// Union satisfied by [ArgoTieredCachingUpdateResponseUnknown] or // [shared.UnionString]. -type ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse interface { - ImplementsArgoTieredCachingTieredCachingGetTieredCachingSettingResponse() +type ArgoTieredCachingUpdateResponse interface { + ImplementsArgoTieredCachingUpdateResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse)(nil)).Elem(), + reflect.TypeOf((*ArgoTieredCachingUpdateResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -78,16 +77,15 @@ func init() { ) } -// Union satisfied by -// [ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseUnknown] or +// Union satisfied by [ArgoTieredCachingGetResponseUnknown] or // [shared.UnionString]. -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse interface { - ImplementsArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse() +type ArgoTieredCachingGetResponse interface { + ImplementsArgoTieredCachingGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse)(nil)).Elem(), + reflect.TypeOf((*ArgoTieredCachingGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -96,19 +94,35 @@ func init() { ) } -type ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelope struct { - Errors []ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessages `json:"messages,required"` - Result ArgoTieredCachingTieredCachingGetTieredCachingSettingResponse `json:"result,required"` +type ArgoTieredCachingUpdateParams struct { + // Enables Tiered Caching. + Value param.Field[ArgoTieredCachingUpdateParamsValue] `json:"value,required"` +} + +func (r ArgoTieredCachingUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enables Tiered Caching. +type ArgoTieredCachingUpdateParamsValue string + +const ( + ArgoTieredCachingUpdateParamsValueOn ArgoTieredCachingUpdateParamsValue = "on" + ArgoTieredCachingUpdateParamsValueOff ArgoTieredCachingUpdateParamsValue = "off" +) + +type ArgoTieredCachingUpdateResponseEnvelope struct { + Errors []ArgoTieredCachingUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []ArgoTieredCachingUpdateResponseEnvelopeMessages `json:"messages,required"` + Result ArgoTieredCachingUpdateResponse `json:"result,required"` // Whether the API call was successful - Success ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeSuccess `json:"success,required"` - JSON argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeJSON `json:"-"` + Success ArgoTieredCachingUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON argoTieredCachingUpdateResponseEnvelopeJSON `json:"-"` } -// argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelope] -type argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeJSON struct { +// argoTieredCachingUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [ArgoTieredCachingUpdateResponseEnvelope] +type argoTieredCachingUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -117,87 +131,67 @@ type argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeJSON s ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrorsJSON `json:"-"` +type ArgoTieredCachingUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON argoTieredCachingUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrors] -type argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrorsJSON struct { +// argoTieredCachingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ArgoTieredCachingUpdateResponseEnvelopeErrors] +type argoTieredCachingUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessagesJSON `json:"-"` +type ArgoTieredCachingUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON argoTieredCachingUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessages] -type argoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessagesJSON struct { +// argoTieredCachingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ArgoTieredCachingUpdateResponseEnvelopeMessages] +type argoTieredCachingUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeSuccess bool - -const ( - ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeSuccessTrue ArgoTieredCachingTieredCachingGetTieredCachingSettingResponseEnvelopeSuccess = true -) - -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingParams struct { - // Enables Tiered Caching. - Value param.Field[ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValue] `json:"value,required"` -} - -func (r ArgoTieredCachingTieredCachingPatchTieredCachingSettingParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enables Tiered Caching. -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValue string +type ArgoTieredCachingUpdateResponseEnvelopeSuccess bool const ( - ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValueOn ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValue = "on" - ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValueOff ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValue = "off" + ArgoTieredCachingUpdateResponseEnvelopeSuccessTrue ArgoTieredCachingUpdateResponseEnvelopeSuccess = true ) -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelope struct { - Errors []ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessages `json:"messages,required"` - Result ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse `json:"result,required"` +type ArgoTieredCachingGetResponseEnvelope struct { + Errors []ArgoTieredCachingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []ArgoTieredCachingGetResponseEnvelopeMessages `json:"messages,required"` + Result ArgoTieredCachingGetResponse `json:"result,required"` // Whether the API call was successful - Success ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeSuccess `json:"success,required"` - JSON argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeJSON `json:"-"` + Success ArgoTieredCachingGetResponseEnvelopeSuccess `json:"success,required"` + JSON argoTieredCachingGetResponseEnvelopeJSON `json:"-"` } -// argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelope] -type argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeJSON struct { +// argoTieredCachingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [ArgoTieredCachingGetResponseEnvelope] +type argoTieredCachingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -206,53 +200,51 @@ type argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrorsJSON `json:"-"` +type ArgoTieredCachingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON argoTieredCachingGetResponseEnvelopeErrorsJSON `json:"-"` } -// argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrors] -type argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrorsJSON struct { +// argoTieredCachingGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ArgoTieredCachingGetResponseEnvelopeErrors] +type argoTieredCachingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessagesJSON `json:"-"` +type ArgoTieredCachingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON argoTieredCachingGetResponseEnvelopeMessagesJSON `json:"-"` } -// argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessages] -type argoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessagesJSON struct { +// argoTieredCachingGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ArgoTieredCachingGetResponseEnvelopeMessages] +type argoTieredCachingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ArgoTieredCachingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeSuccess bool +type ArgoTieredCachingGetResponseEnvelopeSuccess bool const ( - ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeSuccessTrue ArgoTieredCachingTieredCachingPatchTieredCachingSettingResponseEnvelopeSuccess = true + ArgoTieredCachingGetResponseEnvelopeSuccessTrue ArgoTieredCachingGetResponseEnvelopeSuccess = true ) diff --git a/argotieredcaching_test.go b/argotieredcaching_test.go index 8f83c382e1f..744786ef160 100644 --- a/argotieredcaching_test.go +++ b/argotieredcaching_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestArgoTieredCachingTieredCachingGetTieredCachingSetting(t *testing.T) { +func TestArgoTieredCachingUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,13 @@ func TestArgoTieredCachingTieredCachingGetTieredCachingSetting(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Argo.TieredCaching.TieredCachingGetTieredCachingSetting(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Argo.TieredCaching.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.ArgoTieredCachingUpdateParams{ + Value: cloudflare.F(cloudflare.ArgoTieredCachingUpdateParamsValueOn), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +45,7 @@ func TestArgoTieredCachingTieredCachingGetTieredCachingSetting(t *testing.T) { } } -func TestArgoTieredCachingTieredCachingPatchTieredCachingSetting(t *testing.T) { +func TestArgoTieredCachingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,13 +61,7 @@ func TestArgoTieredCachingTieredCachingPatchTieredCachingSetting(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Argo.TieredCaching.TieredCachingPatchTieredCachingSetting( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ArgoTieredCachingTieredCachingPatchTieredCachingSettingParams{ - Value: cloudflare.F(cloudflare.ArgoTieredCachingTieredCachingPatchTieredCachingSettingParamsValueOn), - }, - ) + _, err := client.Argo.TieredCaching.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/auditlog.go b/auditlog.go index adcbd24e34c..ae161f13f7a 100644 --- a/auditlog.go +++ b/auditlog.go @@ -7,7 +7,6 @@ import ( "fmt" "net/http" "net/url" - "reflect" "time" "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" @@ -16,7 +15,6 @@ import ( "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" ) // AuditLogService contains methods and other services that help with interacting @@ -38,54 +36,34 @@ func NewAuditLogService(opts ...option.RequestOption) (r *AuditLogService) { // Gets a list of audit logs for an account. Can be filtered by who made the // change, on which zone, and the timeframe of the change. -func (r *AuditLogService) AuditLogsGetAccountAuditLogs(ctx context.Context, accountIdentifier string, query AuditLogAuditLogsGetAccountAuditLogsParams, opts ...option.RequestOption) (res *AuditLogAuditLogsGetAccountAuditLogsResponse, err error) { - opts = append(r.Options[:], opts...) +func (r *AuditLogService) List(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AuditLogListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/audit_logs", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) - return -} - -// Union satisfied by [AuditLogAuditLogsGetAccountAuditLogsResponseObject] or -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommon]. -type AuditLogAuditLogsGetAccountAuditLogsResponse interface { - implementsAuditLogAuditLogsGetAccountAuditLogsResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*AuditLogAuditLogsGetAccountAuditLogsResponse)(nil)).Elem(), "") -} - -type AuditLogAuditLogsGetAccountAuditLogsResponseObject struct { - Errors interface{} `json:"errors,nullable"` - Messages []interface{} `json:"messages"` - Result []AuditLogAuditLogsGetAccountAuditLogsResponseObjectResult `json:"result"` - Success bool `json:"success"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectJSON `json:"-"` -} - -// auditLogAuditLogsGetAccountAuditLogsResponseObjectJSON contains the JSON -// metadata for the struct [AuditLogAuditLogsGetAccountAuditLogsResponseObject] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObject) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } -func (r AuditLogAuditLogsGetAccountAuditLogsResponseObject) implementsAuditLogAuditLogsGetAccountAuditLogsResponse() { +// Gets a list of audit logs for an account. Can be filtered by who made the +// change, on which zone, and the timeframe of the change. +func (r *AuditLogService) ListAutoPaging(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AuditLogListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...)) } -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResult struct { +type AuditLogListResponse struct { // A string that uniquely identifies the audit log. - ID string `json:"id"` - Action AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultAction `json:"action"` - Actor AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActor `json:"actor"` + ID string `json:"id"` + Action AuditLogListResponseAction `json:"action"` + Actor AuditLogListResponseActor `json:"actor"` // The source of the event. Interface string `json:"interface"` // An object which can lend more context to the action being logged. This is a @@ -94,18 +72,17 @@ type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResult struct { // The new value of the resource that was modified. NewValue string `json:"newValue"` // The value of the resource before it was modified. - OldValue string `json:"oldValue"` - Owner AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwner `json:"owner"` - Resource AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultResource `json:"resource"` + OldValue string `json:"oldValue"` + Owner AuditLogListResponseOwner `json:"owner"` + Resource AuditLogListResponseResource `json:"resource"` // A UTC RFC3339 timestamp that specifies when the action being logged occured. - When time.Time `json:"when" format:"date-time"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectResultJSON `json:"-"` + When time.Time `json:"when" format:"date-time"` + JSON auditLogListResponseJSON `json:"-"` } -// auditLogAuditLogsGetAccountAuditLogsResponseObjectResultJSON contains the JSON -// metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseObjectResult] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultJSON struct { +// auditLogListResponseJSON contains the JSON metadata for the struct +// [AuditLogListResponse] +type auditLogListResponseJSON struct { ID apijson.Field Action apijson.Field Actor apijson.Field @@ -120,33 +97,32 @@ type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultJSON struct { ExtraFields map[string]apijson.Field } -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResult) UnmarshalJSON(data []byte) (err error) { +func (r *AuditLogListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultAction struct { +type AuditLogListResponseAction struct { // A boolean that indicates if the action attempted was successful. Result bool `json:"result"` // A short string that describes the action that was performed. - Type string `json:"type"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActionJSON `json:"-"` + Type string `json:"type"` + JSON auditLogListResponseActionJSON `json:"-"` } -// auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActionJSON contains the -// JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultAction] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActionJSON struct { +// auditLogListResponseActionJSON contains the JSON metadata for the struct +// [AuditLogListResponseAction] +type auditLogListResponseActionJSON struct { Result apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultAction) UnmarshalJSON(data []byte) (err error) { +func (r *AuditLogListResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActor struct { +type AuditLogListResponseActor struct { // The ID of the actor that performed the action. If a user performed the action, // this will be their User ID. ID string `json:"id"` @@ -155,14 +131,13 @@ type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActor struct { // The IP address of the request that performed the action. IP string `json:"ip"` // The type of actor, whether a User, Cloudflare Admin, or an Automated System. - Type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorType `json:"type"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorJSON `json:"-"` + Type AuditLogListResponseActorType `json:"type"` + JSON auditLogListResponseActorJSON `json:"-"` } -// auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorJSON contains the -// JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActor] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorJSON struct { +// auditLogListResponseActorJSON contains the JSON metadata for the struct +// [AuditLogListResponseActor] +type auditLogListResponseActorJSON struct { ID apijson.Field Email apijson.Field IP apijson.Field @@ -171,169 +146,68 @@ type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorJSON struct { ExtraFields map[string]apijson.Field } -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActor) UnmarshalJSON(data []byte) (err error) { +func (r *AuditLogListResponseActor) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of actor, whether a User, Cloudflare Admin, or an Automated System. -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorType string +type AuditLogListResponseActorType string const ( - AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorTypeUser AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorType = "user" - AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorTypeAdmin AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorType = "admin" - AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorTypeCloudflare AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultActorType = "Cloudflare" + AuditLogListResponseActorTypeUser AuditLogListResponseActorType = "user" + AuditLogListResponseActorTypeAdmin AuditLogListResponseActorType = "admin" + AuditLogListResponseActorTypeCloudflare AuditLogListResponseActorType = "Cloudflare" ) -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwner struct { +type AuditLogListResponseOwner struct { // Identifier - ID string `json:"id"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwnerJSON `json:"-"` + ID string `json:"id"` + JSON auditLogListResponseOwnerJSON `json:"-"` } -// auditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwnerJSON contains the -// JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwner] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwnerJSON struct { +// auditLogListResponseOwnerJSON contains the JSON metadata for the struct +// [AuditLogListResponseOwner] +type auditLogListResponseOwnerJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultOwner) UnmarshalJSON(data []byte) (err error) { +func (r *AuditLogListResponseOwner) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultResource struct { +type AuditLogListResponseResource struct { // An identifier for the resource that was affected by the action. ID string `json:"id"` // A short string that describes the resource that was affected by the action. - Type string `json:"type"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseObjectResultResourceJSON `json:"-"` + Type string `json:"type"` + JSON auditLogListResponseResourceJSON `json:"-"` } -// auditLogAuditLogsGetAccountAuditLogsResponseObjectResultResourceJSON contains -// the JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultResource] -type auditLogAuditLogsGetAccountAuditLogsResponseObjectResultResourceJSON struct { +// auditLogListResponseResourceJSON contains the JSON metadata for the struct +// [AuditLogListResponseResource] +type auditLogListResponseResourceJSON struct { ID apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultResource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommon struct { - Errors []AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonError `json:"errors,required"` - Messages []AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessage `json:"messages,required"` - Result AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult `json:"result,required"` - // Whether the API call was successful - Success AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonSuccess `json:"success,required"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonJSON `json:"-"` -} - -// auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonJSON -// contains the JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommon] -type auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommon) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommon) implementsAuditLogAuditLogsGetAccountAuditLogsResponse() { -} - -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonError struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonErrorJSON `json:"-"` -} - -// auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonErrorJSON -// contains the JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonError] -type auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonErrorJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonError) UnmarshalJSON(data []byte) (err error) { +func (r *AuditLogListResponseResource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessage struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessageJSON `json:"-"` -} - -// auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessageJSON -// contains the JSON metadata for the struct -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessage] -type auditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessageJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonMessage) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResultUnknown], -// [AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResultArray] -// or [shared.UnionString]. -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult interface { - ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResultArray []interface{} - -func (r AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResultArray) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult() { -} - -// Whether the API call was successful -type AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonSuccess bool - -const ( - AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonSuccessTrue AuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonSuccess = true -) - -type AuditLogAuditLogsGetAccountAuditLogsParams struct { +type AuditLogListParams struct { // Finds a specific log by its ID. - ID param.Field[string] `query:"id"` - Action param.Field[AuditLogAuditLogsGetAccountAuditLogsParamsAction] `query:"action"` - Actor param.Field[AuditLogAuditLogsGetAccountAuditLogsParamsActor] `query:"actor"` + ID param.Field[string] `query:"id"` + Action param.Field[AuditLogListParamsAction] `query:"action"` + Actor param.Field[AuditLogListParamsActor] `query:"actor"` // Limits the returned results to logs older than the specified date. This can be a // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339. Before param.Field[time.Time] `query:"before" format:"date-time"` // Changes the direction of the chronological sorting. - Direction param.Field[AuditLogAuditLogsGetAccountAuditLogsParamsDirection] `query:"direction"` + Direction param.Field[AuditLogListParamsDirection] `query:"direction"` // Indicates that this request is an export of logs in CSV format. Export param.Field[bool] `query:"export"` // Indicates whether or not to hide user level audit logs. @@ -344,34 +218,33 @@ type AuditLogAuditLogsGetAccountAuditLogsParams struct { PerPage param.Field[float64] `query:"per_page"` // Limits the returned results to logs newer than the specified date. This can be a // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339. - Since param.Field[time.Time] `query:"since" format:"date-time"` - Zone param.Field[AuditLogAuditLogsGetAccountAuditLogsParamsZone] `query:"zone"` + Since param.Field[time.Time] `query:"since" format:"date-time"` + Zone param.Field[AuditLogListParamsZone] `query:"zone"` } -// URLQuery serializes [AuditLogAuditLogsGetAccountAuditLogsParams]'s query -// parameters as `url.Values`. -func (r AuditLogAuditLogsGetAccountAuditLogsParams) URLQuery() (v url.Values) { +// URLQuery serializes [AuditLogListParams]'s query parameters as `url.Values`. +func (r AuditLogListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type AuditLogAuditLogsGetAccountAuditLogsParamsAction struct { +type AuditLogListParamsAction struct { // Filters by the action type. Type param.Field[string] `query:"type"` } -// URLQuery serializes [AuditLogAuditLogsGetAccountAuditLogsParamsAction]'s query -// parameters as `url.Values`. -func (r AuditLogAuditLogsGetAccountAuditLogsParamsAction) URLQuery() (v url.Values) { +// URLQuery serializes [AuditLogListParamsAction]'s query parameters as +// `url.Values`. +func (r AuditLogListParamsAction) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type AuditLogAuditLogsGetAccountAuditLogsParamsActor struct { +type AuditLogListParamsActor struct { // Filters by the email address of the actor that made the change. Email param.Field[string] `query:"email" format:"email"` // Filters by the IP address of the request that made the change by specific IP @@ -379,9 +252,9 @@ type AuditLogAuditLogsGetAccountAuditLogsParamsActor struct { IP param.Field[string] `query:"ip"` } -// URLQuery serializes [AuditLogAuditLogsGetAccountAuditLogsParamsActor]'s query -// parameters as `url.Values`. -func (r AuditLogAuditLogsGetAccountAuditLogsParamsActor) URLQuery() (v url.Values) { +// URLQuery serializes [AuditLogListParamsActor]'s query parameters as +// `url.Values`. +func (r AuditLogListParamsActor) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -389,21 +262,20 @@ func (r AuditLogAuditLogsGetAccountAuditLogsParamsActor) URLQuery() (v url.Value } // Changes the direction of the chronological sorting. -type AuditLogAuditLogsGetAccountAuditLogsParamsDirection string +type AuditLogListParamsDirection string const ( - AuditLogAuditLogsGetAccountAuditLogsParamsDirectionDesc AuditLogAuditLogsGetAccountAuditLogsParamsDirection = "desc" - AuditLogAuditLogsGetAccountAuditLogsParamsDirectionAsc AuditLogAuditLogsGetAccountAuditLogsParamsDirection = "asc" + AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc" + AuditLogListParamsDirectionAsc AuditLogListParamsDirection = "asc" ) -type AuditLogAuditLogsGetAccountAuditLogsParamsZone struct { +type AuditLogListParamsZone struct { // Filters by the name of the zone associated to the change. Name param.Field[string] `query:"name"` } -// URLQuery serializes [AuditLogAuditLogsGetAccountAuditLogsParamsZone]'s query -// parameters as `url.Values`. -func (r AuditLogAuditLogsGetAccountAuditLogsParamsZone) URLQuery() (v url.Values) { +// URLQuery serializes [AuditLogListParamsZone]'s query parameters as `url.Values`. +func (r AuditLogListParamsZone) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, diff --git a/auditlog_test.go b/auditlog_test.go index 9c0751adb54..66921ff522b 100644 --- a/auditlog_test.go +++ b/auditlog_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAuditLogAuditLogsGetAccountAuditLogsWithOptionalParams(t *testing.T) { +func TestAuditLogListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,26 +30,26 @@ func TestAuditLogAuditLogsGetAccountAuditLogsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AuditLogs.AuditLogsGetAccountAuditLogs( + _, err := client.AuditLogs.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.AuditLogAuditLogsGetAccountAuditLogsParams{ + cloudflare.AuditLogListParams{ ID: cloudflare.F("f174be97-19b1-40d6-954d-70cd5fbd52db"), - Action: cloudflare.F(cloudflare.AuditLogAuditLogsGetAccountAuditLogsParamsAction{ + Action: cloudflare.F(cloudflare.AuditLogListParamsAction{ Type: cloudflare.F("add"), }), - Actor: cloudflare.F(cloudflare.AuditLogAuditLogsGetAccountAuditLogsParamsActor{ + Actor: cloudflare.F(cloudflare.AuditLogListParamsActor{ IP: cloudflare.F("17.168.228.63"), Email: cloudflare.F("alice@example.com"), }), Before: cloudflare.F(time.Now()), - Direction: cloudflare.F(cloudflare.AuditLogAuditLogsGetAccountAuditLogsParamsDirectionDesc), + Direction: cloudflare.F(cloudflare.AuditLogListParamsDirectionDesc), Export: cloudflare.F(true), HideUserLogs: cloudflare.F(true), Page: cloudflare.F(50.000000), PerPage: cloudflare.F(25.000000), Since: cloudflare.F(time.Now()), - Zone: cloudflare.F(cloudflare.AuditLogAuditLogsGetAccountAuditLogsParamsZone{ + Zone: cloudflare.F(cloudflare.AuditLogListParamsZone{ Name: cloudflare.F("example.com"), }), }, diff --git a/availablerateplan.go b/availablerateplan.go index 1fa3a463d65..be437915781 100644 --- a/availablerateplan.go +++ b/availablerateplan.go @@ -31,9 +31,9 @@ func NewAvailableRatePlanService(opts ...option.RequestOption) (r *AvailableRate } // Lists all rate plans the zone can subscribe to. -func (r *AvailableRatePlanService) ZoneRatePlanListAvailableRatePlans(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse, err error) { +func (r *AvailableRatePlanService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]AvailableRatePlanListResponse, err error) { opts = append(r.Options[:], opts...) - var env AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelope + var env AvailableRatePlanListResponseEnvelope path := fmt.Sprintf("zones/%s/available_rate_plans", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,26 +43,25 @@ func (r *AvailableRatePlanService) ZoneRatePlanListAvailableRatePlans(ctx contex return } -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse struct { +type AvailableRatePlanListResponse struct { // Plan identifier tag. ID string `json:"id"` // Array of available components values for the plan. - Components []AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponent `json:"components"` + Components []AvailableRatePlanListResponseComponent `json:"components"` // The monetary unit in which pricing information is displayed. Currency string `json:"currency"` // The duration of the plan subscription. Duration float64 `json:"duration"` // The frequency at which you will be billed for this plan. - Frequency AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency `json:"frequency"` + Frequency AvailableRatePlanListResponseFrequency `json:"frequency"` // The plan name. - Name string `json:"name"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseJSON `json:"-"` + Name string `json:"name"` + JSON availableRatePlanListResponseJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseJSON contains the -// JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseJSON struct { +// availableRatePlanListResponseJSON contains the JSON metadata for the struct +// [AvailableRatePlanListResponse] +type availableRatePlanListResponseJSON struct { ID apijson.Field Components apijson.Field Currency apijson.Field @@ -73,24 +72,23 @@ type availableRatePlanZoneRatePlanListAvailableRatePlansResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponent struct { +type AvailableRatePlanListResponseComponent struct { // The default amount allocated. Default float64 `json:"default"` // The unique component. - Name AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName `json:"name"` + Name AvailableRatePlanListResponseComponentsName `json:"name"` // The unit price of the addon. - UnitPrice float64 `json:"unit_price"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentJSON `json:"-"` + UnitPrice float64 `json:"unit_price"` + JSON availableRatePlanListResponseComponentJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentJSON -// contains the JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponent] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentJSON struct { +// availableRatePlanListResponseComponentJSON contains the JSON metadata for the +// struct [AvailableRatePlanListResponseComponent] +type availableRatePlanListResponseComponentJSON struct { Default apijson.Field Name apijson.Field UnitPrice apijson.Field @@ -98,44 +96,43 @@ type availableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentJSON st ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponent) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponseComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The unique component. -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName string +type AvailableRatePlanListResponseComponentsName string const ( - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsNameZones AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName = "zones" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsNamePageRules AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName = "page_rules" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsNameDedicatedCertificates AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName = "dedicated_certificates" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsNameDedicatedCertificatesCustom AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseComponentsName = "dedicated_certificates_custom" + AvailableRatePlanListResponseComponentsNameZones AvailableRatePlanListResponseComponentsName = "zones" + AvailableRatePlanListResponseComponentsNamePageRules AvailableRatePlanListResponseComponentsName = "page_rules" + AvailableRatePlanListResponseComponentsNameDedicatedCertificates AvailableRatePlanListResponseComponentsName = "dedicated_certificates" + AvailableRatePlanListResponseComponentsNameDedicatedCertificatesCustom AvailableRatePlanListResponseComponentsName = "dedicated_certificates_custom" ) // The frequency at which you will be billed for this plan. -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency string +type AvailableRatePlanListResponseFrequency string const ( - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequencyWeekly AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency = "weekly" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequencyMonthly AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency = "monthly" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequencyQuarterly AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency = "quarterly" - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequencyYearly AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseFrequency = "yearly" + AvailableRatePlanListResponseFrequencyWeekly AvailableRatePlanListResponseFrequency = "weekly" + AvailableRatePlanListResponseFrequencyMonthly AvailableRatePlanListResponseFrequency = "monthly" + AvailableRatePlanListResponseFrequencyQuarterly AvailableRatePlanListResponseFrequency = "quarterly" + AvailableRatePlanListResponseFrequencyYearly AvailableRatePlanListResponseFrequency = "yearly" ) -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelope struct { - Errors []AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrors `json:"errors,required"` - Messages []AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessages `json:"messages,required"` - Result []AvailableRatePlanZoneRatePlanListAvailableRatePlansResponse `json:"result,required,nullable"` +type AvailableRatePlanListResponseEnvelope struct { + Errors []AvailableRatePlanListResponseEnvelopeErrors `json:"errors,required"` + Messages []AvailableRatePlanListResponseEnvelopeMessages `json:"messages,required"` + Result []AvailableRatePlanListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeSuccess `json:"success,required"` - ResultInfo AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfo `json:"result_info"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeJSON `json:"-"` + Success AvailableRatePlanListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo AvailableRatePlanListResponseEnvelopeResultInfo `json:"result_info"` + JSON availableRatePlanListResponseEnvelopeJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelope] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeJSON struct { +// availableRatePlanListResponseEnvelopeJSON contains the JSON metadata for the +// struct [AvailableRatePlanListResponseEnvelope] +type availableRatePlanListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -145,58 +142,56 @@ type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeJSON str ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrorsJSON `json:"-"` +type AvailableRatePlanListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON availableRatePlanListResponseEnvelopeErrorsJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrors] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrorsJSON struct { +// availableRatePlanListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [AvailableRatePlanListResponseEnvelopeErrors] +type availableRatePlanListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessagesJSON `json:"-"` +type AvailableRatePlanListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON availableRatePlanListResponseEnvelopeMessagesJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessages] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessagesJSON struct { +// availableRatePlanListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [AvailableRatePlanListResponseEnvelopeMessages] +type availableRatePlanListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeSuccess bool +type AvailableRatePlanListResponseEnvelopeSuccess bool const ( - AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeSuccessTrue AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeSuccess = true + AvailableRatePlanListResponseEnvelopeSuccessTrue AvailableRatePlanListResponseEnvelopeSuccess = true ) -type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfo struct { +type AvailableRatePlanListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -204,14 +199,13 @@ type AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultIn // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON availableRatePlanListResponseEnvelopeResultInfoJSON `json:"-"` } -// availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfo] -type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfoJSON struct { +// availableRatePlanListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [AvailableRatePlanListResponseEnvelopeResultInfo] +type availableRatePlanListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -220,6 +214,6 @@ type availableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultIn ExtraFields map[string]apijson.Field } -func (r *AvailableRatePlanZoneRatePlanListAvailableRatePlansResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *AvailableRatePlanListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/availablerateplan_test.go b/availablerateplan_test.go index fb129d76a26..832f71413b7 100644 --- a/availablerateplan_test.go +++ b/availablerateplan_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAvailableRatePlanZoneRatePlanListAvailableRatePlans(t *testing.T) { +func TestAvailableRatePlanList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAvailableRatePlanZoneRatePlanListAvailableRatePlans(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.AvailableRatePlans.ZoneRatePlanListAvailableRatePlans(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.AvailableRatePlans.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/billingprofile.go b/billingprofile.go index 5e60ea89b79..b76c7e7a4c7 100644 --- a/billingprofile.go +++ b/billingprofile.go @@ -34,9 +34,9 @@ func NewBillingProfileService(opts ...option.RequestOption) (r *BillingProfileSe } // Gets the current billing profile for the account. -func (r *BillingProfileService) AccountBillingProfileBillingProfileDetails(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *BillingProfileAccountBillingProfileBillingProfileDetailsResponse, err error) { +func (r *BillingProfileService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *BillingProfileGetResponse, err error) { opts = append(r.Options[:], opts...) - var env BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelope + var env BillingProfileGetResponseEnvelope path := fmt.Sprintf("accounts/%v/billing/profile", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,16 +46,14 @@ func (r *BillingProfileService) AccountBillingProfileBillingProfileDetails(ctx c return } -// Union satisfied by -// [BillingProfileAccountBillingProfileBillingProfileDetailsResponseUnknown] or -// [shared.UnionString]. -type BillingProfileAccountBillingProfileBillingProfileDetailsResponse interface { - ImplementsBillingProfileAccountBillingProfileBillingProfileDetailsResponse() +// Union satisfied by [BillingProfileGetResponseUnknown] or [shared.UnionString]. +type BillingProfileGetResponse interface { + ImplementsBillingProfileGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*BillingProfileAccountBillingProfileBillingProfileDetailsResponse)(nil)).Elem(), + reflect.TypeOf((*BillingProfileGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -64,19 +62,18 @@ func init() { ) } -type BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelope struct { - Errors []BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessages `json:"messages,required"` - Result BillingProfileAccountBillingProfileBillingProfileDetailsResponse `json:"result,required"` +type BillingProfileGetResponseEnvelope struct { + Errors []BillingProfileGetResponseEnvelopeErrors `json:"errors,required"` + Messages []BillingProfileGetResponseEnvelopeMessages `json:"messages,required"` + Result BillingProfileGetResponse `json:"result,required"` // Whether the API call was successful - Success BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeJSON `json:"-"` + Success BillingProfileGetResponseEnvelopeSuccess `json:"success,required"` + JSON billingProfileGetResponseEnvelopeJSON `json:"-"` } -// billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelope] -type billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeJSON struct { +// billingProfileGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [BillingProfileGetResponseEnvelope] +type billingProfileGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -85,53 +82,51 @@ type billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeJSO ExtraFields map[string]apijson.Field } -func (r *BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *BillingProfileGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON `json:"-"` +type BillingProfileGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON billingProfileGetResponseEnvelopeErrorsJSON `json:"-"` } -// billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrors] -type billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON struct { +// billingProfileGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [BillingProfileGetResponseEnvelopeErrors] +type billingProfileGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *BillingProfileGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON `json:"-"` +type BillingProfileGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON billingProfileGetResponseEnvelopeMessagesJSON `json:"-"` } -// billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessages] -type billingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON struct { +// billingProfileGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [BillingProfileGetResponseEnvelopeMessages] +type billingProfileGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *BillingProfileGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeSuccess bool +type BillingProfileGetResponseEnvelopeSuccess bool const ( - BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeSuccessTrue BillingProfileAccountBillingProfileBillingProfileDetailsResponseEnvelopeSuccess = true + BillingProfileGetResponseEnvelopeSuccessTrue BillingProfileGetResponseEnvelopeSuccess = true ) diff --git a/billingprofile_test.go b/billingprofile_test.go index 07447513c3b..e60ae984cc2 100644 --- a/billingprofile_test.go +++ b/billingprofile_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestBillingProfileAccountBillingProfileBillingProfileDetails(t *testing.T) { +func TestBillingProfileGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestBillingProfileAccountBillingProfileBillingProfileDetails(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Billings.Profiles.AccountBillingProfileBillingProfileDetails(context.TODO(), map[string]interface{}{}) + _, err := client.Billings.Profiles.Get(context.TODO(), map[string]interface{}{}) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/botmanagement.go b/botmanagement.go index d9ca4d9433f..a88d0c3fa3e 100644 --- a/botmanagement.go +++ b/botmanagement.go @@ -32,6 +32,19 @@ func NewBotManagementService(opts ...option.RequestOption) (r *BotManagementServ return } +// Retrieve a zone's Bot Management Config +func (r *BotManagementService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *BotManagementGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env BotManagementGetResponseEnvelope + path := fmt.Sprintf("zones/%s/bot_management", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Updates the Bot Management configuration for a zone. // // This API is used to update: @@ -42,9 +55,9 @@ func NewBotManagementService(opts ...option.RequestOption) (r *BotManagementServ // // See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more // information on the different plans -func (r *BotManagementService) Update(ctx context.Context, zoneID string, body BotManagementUpdateParams, opts ...option.RequestOption) (res *BotManagementUpdateResponse, err error) { +func (r *BotManagementService) Replace(ctx context.Context, zoneID string, body BotManagementReplaceParams, opts ...option.RequestOption) (res *BotManagementReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env BotManagementUpdateResponseEnvelope + var env BotManagementReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/bot_management", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -54,32 +67,19 @@ func (r *BotManagementService) Update(ctx context.Context, zoneID string, body B return } -// Retrieve a zone's Bot Management Config -func (r *BotManagementService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *BotManagementGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env BotManagementGetResponseEnvelope - path := fmt.Sprintf("zones/%s/bot_management", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [BotManagementUpdateResponseBotManagementBotFightModeConfig], -// [BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig], -// [BotManagementUpdateResponseBotManagementSbfmLikelyConfig] or -// [BotManagementUpdateResponseBotManagementBmSubscriptionConfig]. -type BotManagementUpdateResponse interface { - implementsBotManagementUpdateResponse() +// Union satisfied by [BotManagementGetResponseBotManagementBotFightModeConfig], +// [BotManagementGetResponseBotManagementSbfmDefinitelyConfig], +// [BotManagementGetResponseBotManagementSbfmLikelyConfig] or +// [BotManagementGetResponseBotManagementBmSubscriptionConfig]. +type BotManagementGetResponse interface { + implementsBotManagementGetResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*BotManagementUpdateResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*BotManagementGetResponse)(nil)).Elem(), "") } -type BotManagementUpdateResponseBotManagementBotFightModeConfig struct { +type BotManagementGetResponseBotManagementBotFightModeConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` @@ -87,14 +87,14 @@ type BotManagementUpdateResponseBotManagementBotFightModeConfig struct { FightMode bool `json:"fight_mode"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementUpdateResponseBotManagementBotFightModeConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementGetResponseBotManagementBotFightModeConfigJSON `json:"-"` } -// botManagementUpdateResponseBotManagementBotFightModeConfigJSON contains the JSON +// botManagementGetResponseBotManagementBotFightModeConfigJSON contains the JSON // metadata for the struct -// [BotManagementUpdateResponseBotManagementBotFightModeConfig] -type botManagementUpdateResponseBotManagementBotFightModeConfigJSON struct { +// [BotManagementGetResponseBotManagementBotFightModeConfig] +type botManagementGetResponseBotManagementBotFightModeConfigJSON struct { EnableJs apijson.Field FightMode apijson.Field UsingLatestModel apijson.Field @@ -102,37 +102,37 @@ type botManagementUpdateResponseBotManagementBotFightModeConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseBotManagementBotFightModeConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementGetResponseBotManagementBotFightModeConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementUpdateResponseBotManagementBotFightModeConfig) implementsBotManagementUpdateResponse() { +func (r BotManagementGetResponseBotManagementBotFightModeConfig) implementsBotManagementGetResponse() { } -type BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig struct { +type BotManagementGetResponseBotManagementSbfmDefinitelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress bool `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection bool `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` + SbfmVerifiedBots BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementUpdateResponseBotManagementSbfmDefinitelyConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON `json:"-"` } -// botManagementUpdateResponseBotManagementSbfmDefinitelyConfigJSON contains the -// JSON metadata for the struct -// [BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig] -type botManagementUpdateResponseBotManagementSbfmDefinitelyConfigJSON struct { +// botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON contains the JSON +// metadata for the struct +// [BotManagementGetResponseBotManagementSbfmDefinitelyConfig] +type botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON struct { EnableJs apijson.Field OptimizeWordpress apijson.Field SbfmDefinitelyAutomated apijson.Field @@ -143,56 +143,55 @@ type botManagementUpdateResponseBotManagementSbfmDefinitelyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementGetResponseBotManagementSbfmDefinitelyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementUpdateResponse() { +func (r BotManagementGetResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementGetResponse() { } // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string +type BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string const ( - BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" - BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" + BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string +type BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string const ( - BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" - BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementUpdateResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" + BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" + BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" ) -type BotManagementUpdateResponseBotManagementSbfmLikelyConfig struct { +type BotManagementGetResponseBotManagementSbfmLikelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress bool `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) action to take on likely automated requests. - SbfmLikelyAutomated BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated `json:"sbfm_likely_automated"` + SbfmLikelyAutomated BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated `json:"sbfm_likely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection bool `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` + SbfmVerifiedBots BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementUpdateResponseBotManagementSbfmLikelyConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementGetResponseBotManagementSbfmLikelyConfigJSON `json:"-"` } -// botManagementUpdateResponseBotManagementSbfmLikelyConfigJSON contains the JSON -// metadata for the struct -// [BotManagementUpdateResponseBotManagementSbfmLikelyConfig] -type botManagementUpdateResponseBotManagementSbfmLikelyConfigJSON struct { +// botManagementGetResponseBotManagementSbfmLikelyConfigJSON contains the JSON +// metadata for the struct [BotManagementGetResponseBotManagementSbfmLikelyConfig] +type botManagementGetResponseBotManagementSbfmLikelyConfigJSON struct { EnableJs apijson.Field OptimizeWordpress apijson.Field SbfmDefinitelyAutomated apijson.Field @@ -204,40 +203,39 @@ type botManagementUpdateResponseBotManagementSbfmLikelyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseBotManagementSbfmLikelyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementGetResponseBotManagementSbfmLikelyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementUpdateResponseBotManagementSbfmLikelyConfig) implementsBotManagementUpdateResponse() { -} +func (r BotManagementGetResponseBotManagementSbfmLikelyConfig) implementsBotManagementGetResponse() {} // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string +type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string const ( - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on likely automated requests. -type BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated string +type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated string const ( - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots string +type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots string const ( - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" - BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementUpdateResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" + BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" ) -type BotManagementUpdateResponseBotManagementBmSubscriptionConfig struct { +type BotManagementGetResponseBotManagementBmSubscriptionConfig struct { // Automatically update to the newest bot detection models created by Cloudflare as // they are released. // [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) @@ -250,14 +248,14 @@ type BotManagementUpdateResponseBotManagementBmSubscriptionConfig struct { SuppressSessionScore bool `json:"suppress_session_score"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementUpdateResponseBotManagementBmSubscriptionConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementGetResponseBotManagementBmSubscriptionConfigJSON `json:"-"` } -// botManagementUpdateResponseBotManagementBmSubscriptionConfigJSON contains the -// JSON metadata for the struct -// [BotManagementUpdateResponseBotManagementBmSubscriptionConfig] -type botManagementUpdateResponseBotManagementBmSubscriptionConfigJSON struct { +// botManagementGetResponseBotManagementBmSubscriptionConfigJSON contains the JSON +// metadata for the struct +// [BotManagementGetResponseBotManagementBmSubscriptionConfig] +type botManagementGetResponseBotManagementBmSubscriptionConfigJSON struct { AutoUpdateModel apijson.Field EnableJs apijson.Field SuppressSessionScore apijson.Field @@ -266,26 +264,27 @@ type botManagementUpdateResponseBotManagementBmSubscriptionConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseBotManagementBmSubscriptionConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementGetResponseBotManagementBmSubscriptionConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementUpdateResponseBotManagementBmSubscriptionConfig) implementsBotManagementUpdateResponse() { +func (r BotManagementGetResponseBotManagementBmSubscriptionConfig) implementsBotManagementGetResponse() { } -// Union satisfied by [BotManagementGetResponseBotManagementBotFightModeConfig], -// [BotManagementGetResponseBotManagementSbfmDefinitelyConfig], -// [BotManagementGetResponseBotManagementSbfmLikelyConfig] or -// [BotManagementGetResponseBotManagementBmSubscriptionConfig]. -type BotManagementGetResponse interface { - implementsBotManagementGetResponse() +// Union satisfied by +// [BotManagementReplaceResponseBotManagementBotFightModeConfig], +// [BotManagementReplaceResponseBotManagementSbfmDefinitelyConfig], +// [BotManagementReplaceResponseBotManagementSbfmLikelyConfig] or +// [BotManagementReplaceResponseBotManagementBmSubscriptionConfig]. +type BotManagementReplaceResponse interface { + implementsBotManagementReplaceResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*BotManagementGetResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*BotManagementReplaceResponse)(nil)).Elem(), "") } -type BotManagementGetResponseBotManagementBotFightModeConfig struct { +type BotManagementReplaceResponseBotManagementBotFightModeConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` @@ -293,14 +292,14 @@ type BotManagementGetResponseBotManagementBotFightModeConfig struct { FightMode bool `json:"fight_mode"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementGetResponseBotManagementBotFightModeConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementReplaceResponseBotManagementBotFightModeConfigJSON `json:"-"` } -// botManagementGetResponseBotManagementBotFightModeConfigJSON contains the JSON -// metadata for the struct -// [BotManagementGetResponseBotManagementBotFightModeConfig] -type botManagementGetResponseBotManagementBotFightModeConfigJSON struct { +// botManagementReplaceResponseBotManagementBotFightModeConfigJSON contains the +// JSON metadata for the struct +// [BotManagementReplaceResponseBotManagementBotFightModeConfig] +type botManagementReplaceResponseBotManagementBotFightModeConfigJSON struct { EnableJs apijson.Field FightMode apijson.Field UsingLatestModel apijson.Field @@ -308,37 +307,37 @@ type botManagementGetResponseBotManagementBotFightModeConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementGetResponseBotManagementBotFightModeConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseBotManagementBotFightModeConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementGetResponseBotManagementBotFightModeConfig) implementsBotManagementGetResponse() { +func (r BotManagementReplaceResponseBotManagementBotFightModeConfig) implementsBotManagementReplaceResponse() { } -type BotManagementGetResponseBotManagementSbfmDefinitelyConfig struct { +type BotManagementReplaceResponseBotManagementSbfmDefinitelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress bool `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection bool `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` + SbfmVerifiedBots BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementReplaceResponseBotManagementSbfmDefinitelyConfigJSON `json:"-"` } -// botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON contains the JSON -// metadata for the struct -// [BotManagementGetResponseBotManagementSbfmDefinitelyConfig] -type botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON struct { +// botManagementReplaceResponseBotManagementSbfmDefinitelyConfigJSON contains the +// JSON metadata for the struct +// [BotManagementReplaceResponseBotManagementSbfmDefinitelyConfig] +type botManagementReplaceResponseBotManagementSbfmDefinitelyConfigJSON struct { EnableJs apijson.Field OptimizeWordpress apijson.Field SbfmDefinitelyAutomated apijson.Field @@ -349,55 +348,56 @@ type botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementGetResponseBotManagementSbfmDefinitelyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseBotManagementSbfmDefinitelyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementGetResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementGetResponse() { +func (r BotManagementReplaceResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementReplaceResponse() { } // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string +type BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string const ( - BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" - BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" + BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string +type BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string const ( - BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" - BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementGetResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" + BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" + BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementReplaceResponseBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" ) -type BotManagementGetResponseBotManagementSbfmLikelyConfig struct { +type BotManagementReplaceResponseBotManagementSbfmLikelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs bool `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress bool `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) action to take on likely automated requests. - SbfmLikelyAutomated BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated `json:"sbfm_likely_automated"` + SbfmLikelyAutomated BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated `json:"sbfm_likely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection bool `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` + SbfmVerifiedBots BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots `json:"sbfm_verified_bots"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementGetResponseBotManagementSbfmLikelyConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementReplaceResponseBotManagementSbfmLikelyConfigJSON `json:"-"` } -// botManagementGetResponseBotManagementSbfmLikelyConfigJSON contains the JSON -// metadata for the struct [BotManagementGetResponseBotManagementSbfmLikelyConfig] -type botManagementGetResponseBotManagementSbfmLikelyConfigJSON struct { +// botManagementReplaceResponseBotManagementSbfmLikelyConfigJSON contains the JSON +// metadata for the struct +// [BotManagementReplaceResponseBotManagementSbfmLikelyConfig] +type botManagementReplaceResponseBotManagementSbfmLikelyConfigJSON struct { EnableJs apijson.Field OptimizeWordpress apijson.Field SbfmDefinitelyAutomated apijson.Field @@ -409,39 +409,40 @@ type botManagementGetResponseBotManagementSbfmLikelyConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementGetResponseBotManagementSbfmLikelyConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseBotManagementSbfmLikelyConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementGetResponseBotManagementSbfmLikelyConfig) implementsBotManagementGetResponse() {} +func (r BotManagementReplaceResponseBotManagementSbfmLikelyConfig) implementsBotManagementReplaceResponse() { +} // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string +type BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string const ( - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on likely automated requests. -type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated string +type BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated string const ( - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots string +type BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots string const ( - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" - BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" + BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementReplaceResponseBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" ) -type BotManagementGetResponseBotManagementBmSubscriptionConfig struct { +type BotManagementReplaceResponseBotManagementBmSubscriptionConfig struct { // Automatically update to the newest bot detection models created by Cloudflare as // they are released. // [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) @@ -454,14 +455,14 @@ type BotManagementGetResponseBotManagementBmSubscriptionConfig struct { SuppressSessionScore bool `json:"suppress_session_score"` // A read-only field that indicates whether the zone currently is running the // latest ML model. - UsingLatestModel bool `json:"using_latest_model"` - JSON botManagementGetResponseBotManagementBmSubscriptionConfigJSON `json:"-"` + UsingLatestModel bool `json:"using_latest_model"` + JSON botManagementReplaceResponseBotManagementBmSubscriptionConfigJSON `json:"-"` } -// botManagementGetResponseBotManagementBmSubscriptionConfigJSON contains the JSON -// metadata for the struct -// [BotManagementGetResponseBotManagementBmSubscriptionConfig] -type botManagementGetResponseBotManagementBmSubscriptionConfigJSON struct { +// botManagementReplaceResponseBotManagementBmSubscriptionConfigJSON contains the +// JSON metadata for the struct +// [BotManagementReplaceResponseBotManagementBmSubscriptionConfig] +type botManagementReplaceResponseBotManagementBmSubscriptionConfigJSON struct { AutoUpdateModel apijson.Field EnableJs apijson.Field SuppressSessionScore apijson.Field @@ -470,23 +471,92 @@ type botManagementGetResponseBotManagementBmSubscriptionConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementGetResponseBotManagementBmSubscriptionConfig) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseBotManagementBmSubscriptionConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r BotManagementGetResponseBotManagementBmSubscriptionConfig) implementsBotManagementGetResponse() { +func (r BotManagementReplaceResponseBotManagementBmSubscriptionConfig) implementsBotManagementReplaceResponse() { +} + +type BotManagementGetResponseEnvelope struct { + Errors []BotManagementGetResponseEnvelopeErrors `json:"errors,required"` + Messages []BotManagementGetResponseEnvelopeMessages `json:"messages,required"` + Result BotManagementGetResponse `json:"result,required"` + // Whether the API call was successful + Success BotManagementGetResponseEnvelopeSuccess `json:"success,required"` + JSON botManagementGetResponseEnvelopeJSON `json:"-"` +} + +// botManagementGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [BotManagementGetResponseEnvelope] +type botManagementGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *BotManagementGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type BotManagementGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON botManagementGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// botManagementGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [BotManagementGetResponseEnvelopeErrors] +type botManagementGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *BotManagementGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type BotManagementGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON botManagementGetResponseEnvelopeMessagesJSON `json:"-"` } +// botManagementGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [BotManagementGetResponseEnvelopeMessages] +type botManagementGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *BotManagementGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type BotManagementGetResponseEnvelopeSuccess bool + +const ( + BotManagementGetResponseEnvelopeSuccessTrue BotManagementGetResponseEnvelopeSuccess = true +) + // This interface is a union satisfied by one of the following: -// [BotManagementUpdateParamsBotManagementBotFightModeConfig], -// [BotManagementUpdateParamsBotManagementSbfmDefinitelyConfig], -// [BotManagementUpdateParamsBotManagementSbfmLikelyConfig], -// [BotManagementUpdateParamsBotManagementBmSubscriptionConfig]. -type BotManagementUpdateParams interface { - ImplementsBotManagementUpdateParams() +// [BotManagementReplaceParamsBotManagementBotFightModeConfig], +// [BotManagementReplaceParamsBotManagementSbfmDefinitelyConfig], +// [BotManagementReplaceParamsBotManagementSbfmLikelyConfig], +// [BotManagementReplaceParamsBotManagementBmSubscriptionConfig]. +type BotManagementReplaceParams interface { + ImplementsBotManagementReplaceParams() } -type BotManagementUpdateParamsBotManagementBotFightModeConfig struct { +type BotManagementReplaceParamsBotManagementBotFightModeConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs param.Field[bool] `json:"enable_js"` @@ -494,108 +564,108 @@ type BotManagementUpdateParamsBotManagementBotFightModeConfig struct { FightMode param.Field[bool] `json:"fight_mode"` } -func (r BotManagementUpdateParamsBotManagementBotFightModeConfig) MarshalJSON() (data []byte, err error) { +func (r BotManagementReplaceParamsBotManagementBotFightModeConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (BotManagementUpdateParamsBotManagementBotFightModeConfig) ImplementsBotManagementUpdateParams() { +func (BotManagementReplaceParamsBotManagementBotFightModeConfig) ImplementsBotManagementReplaceParams() { } -type BotManagementUpdateParamsBotManagementSbfmDefinitelyConfig struct { +type BotManagementReplaceParamsBotManagementSbfmDefinitelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs param.Field[bool] `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress param.Field[bool] `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated param.Field[BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated] `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated param.Field[BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated] `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection param.Field[bool] `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots param.Field[BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots] `json:"sbfm_verified_bots"` + SbfmVerifiedBots param.Field[BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots] `json:"sbfm_verified_bots"` } -func (r BotManagementUpdateParamsBotManagementSbfmDefinitelyConfig) MarshalJSON() (data []byte, err error) { +func (r BotManagementReplaceParamsBotManagementSbfmDefinitelyConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (BotManagementUpdateParamsBotManagementSbfmDefinitelyConfig) ImplementsBotManagementUpdateParams() { +func (BotManagementReplaceParamsBotManagementSbfmDefinitelyConfig) ImplementsBotManagementReplaceParams() { } // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string +type BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated string const ( - BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" - BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedAllow BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedBlock BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "block" + BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string +type BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots string const ( - BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" - BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementUpdateParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" + BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsAllow BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "allow" + BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBotsBlock BotManagementReplaceParamsBotManagementSbfmDefinitelyConfigSbfmVerifiedBots = "block" ) -type BotManagementUpdateParamsBotManagementSbfmLikelyConfig struct { +type BotManagementReplaceParamsBotManagementSbfmLikelyConfig struct { // Use lightweight, invisible JavaScript detections to improve Bot Management. // [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). EnableJs param.Field[bool] `json:"enable_js"` // Whether to optimize Super Bot Fight Mode protections for Wordpress. OptimizeWordpress param.Field[bool] `json:"optimize_wordpress"` // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. - SbfmDefinitelyAutomated param.Field[BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated] `json:"sbfm_definitely_automated"` + SbfmDefinitelyAutomated param.Field[BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated] `json:"sbfm_definitely_automated"` // Super Bot Fight Mode (SBFM) action to take on likely automated requests. - SbfmLikelyAutomated param.Field[BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated] `json:"sbfm_likely_automated"` + SbfmLikelyAutomated param.Field[BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated] `json:"sbfm_likely_automated"` // Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if // static resources on your application need bot protection. Note: Static resource // protection can also result in legitimate traffic being blocked. SbfmStaticResourceProtection param.Field[bool] `json:"sbfm_static_resource_protection"` // Super Bot Fight Mode (SBFM) action to take on verified bots requests. - SbfmVerifiedBots param.Field[BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots] `json:"sbfm_verified_bots"` + SbfmVerifiedBots param.Field[BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots] `json:"sbfm_verified_bots"` } -func (r BotManagementUpdateParamsBotManagementSbfmLikelyConfig) MarshalJSON() (data []byte, err error) { +func (r BotManagementReplaceParamsBotManagementSbfmLikelyConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (BotManagementUpdateParamsBotManagementSbfmLikelyConfig) ImplementsBotManagementUpdateParams() { +func (BotManagementReplaceParamsBotManagementSbfmLikelyConfig) ImplementsBotManagementReplaceParams() { } // Super Bot Fight Mode (SBFM) action to take on definitely automated requests. -type BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string +type BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string const ( - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedAllow BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "allow" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedBlock BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "block" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomatedManagedChallenge BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on likely automated requests. -type BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated string +type BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated string const ( - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedAllow BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "allow" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedBlock BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "block" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomatedManagedChallenge BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmLikelyAutomated = "managed_challenge" ) // Super Bot Fight Mode (SBFM) action to take on verified bots requests. -type BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots string +type BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots string const ( - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" - BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementUpdateParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBotsAllow BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots = "allow" + BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBotsBlock BotManagementReplaceParamsBotManagementSbfmLikelyConfigSbfmVerifiedBots = "block" ) -type BotManagementUpdateParamsBotManagementBmSubscriptionConfig struct { +type BotManagementReplaceParamsBotManagementBmSubscriptionConfig struct { // Automatically update to the newest bot detection models created by Cloudflare as // they are released. // [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) @@ -608,26 +678,26 @@ type BotManagementUpdateParamsBotManagementBmSubscriptionConfig struct { SuppressSessionScore param.Field[bool] `json:"suppress_session_score"` } -func (r BotManagementUpdateParamsBotManagementBmSubscriptionConfig) MarshalJSON() (data []byte, err error) { +func (r BotManagementReplaceParamsBotManagementBmSubscriptionConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (BotManagementUpdateParamsBotManagementBmSubscriptionConfig) ImplementsBotManagementUpdateParams() { +func (BotManagementReplaceParamsBotManagementBmSubscriptionConfig) ImplementsBotManagementReplaceParams() { } -type BotManagementUpdateResponseEnvelope struct { - Errors []BotManagementUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []BotManagementUpdateResponseEnvelopeMessages `json:"messages,required"` - Result BotManagementUpdateResponse `json:"result,required"` +type BotManagementReplaceResponseEnvelope struct { + Errors []BotManagementReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []BotManagementReplaceResponseEnvelopeMessages `json:"messages,required"` + Result BotManagementReplaceResponse `json:"result,required"` // Whether the API call was successful - Success BotManagementUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON botManagementUpdateResponseEnvelopeJSON `json:"-"` + Success BotManagementReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON botManagementReplaceResponseEnvelopeJSON `json:"-"` } -// botManagementUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [BotManagementUpdateResponseEnvelope] -type botManagementUpdateResponseEnvelopeJSON struct { +// botManagementReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [BotManagementReplaceResponseEnvelope] +type botManagementReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -636,120 +706,51 @@ type botManagementUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BotManagementUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON botManagementUpdateResponseEnvelopeErrorsJSON `json:"-"` +type BotManagementReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON botManagementReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// botManagementUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [BotManagementUpdateResponseEnvelopeErrors] -type botManagementUpdateResponseEnvelopeErrorsJSON struct { +// botManagementReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [BotManagementReplaceResponseEnvelopeErrors] +type botManagementReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BotManagementUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON botManagementUpdateResponseEnvelopeMessagesJSON `json:"-"` +type BotManagementReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON botManagementReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// botManagementUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [BotManagementUpdateResponseEnvelopeMessages] -type botManagementUpdateResponseEnvelopeMessagesJSON struct { +// botManagementReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [BotManagementReplaceResponseEnvelopeMessages] +type botManagementReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BotManagementUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *BotManagementReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type BotManagementUpdateResponseEnvelopeSuccess bool +type BotManagementReplaceResponseEnvelopeSuccess bool const ( - BotManagementUpdateResponseEnvelopeSuccessTrue BotManagementUpdateResponseEnvelopeSuccess = true -) - -type BotManagementGetResponseEnvelope struct { - Errors []BotManagementGetResponseEnvelopeErrors `json:"errors,required"` - Messages []BotManagementGetResponseEnvelopeMessages `json:"messages,required"` - Result BotManagementGetResponse `json:"result,required"` - // Whether the API call was successful - Success BotManagementGetResponseEnvelopeSuccess `json:"success,required"` - JSON botManagementGetResponseEnvelopeJSON `json:"-"` -} - -// botManagementGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [BotManagementGetResponseEnvelope] -type botManagementGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *BotManagementGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type BotManagementGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON botManagementGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// botManagementGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [BotManagementGetResponseEnvelopeErrors] -type botManagementGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *BotManagementGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type BotManagementGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON botManagementGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// botManagementGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [BotManagementGetResponseEnvelopeMessages] -type botManagementGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *BotManagementGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type BotManagementGetResponseEnvelopeSuccess bool - -const ( - BotManagementGetResponseEnvelopeSuccessTrue BotManagementGetResponseEnvelopeSuccess = true + BotManagementReplaceResponseEnvelopeSuccessTrue BotManagementReplaceResponseEnvelopeSuccess = true ) diff --git a/botmanagement_test.go b/botmanagement_test.go index a906e29676e..cf3063849d4 100644 --- a/botmanagement_test.go +++ b/botmanagement_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestBotManagementUpdateWithOptionalParams(t *testing.T) { +func TestBotManagementGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,7 @@ func TestBotManagementUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.BotManagements.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.BotManagementUpdateParamsBotManagementBotFightModeConfig{ - EnableJs: cloudflare.F(true), - FightMode: cloudflare.F(true), - }, - ) + _, err := client.BotManagement.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -46,7 +39,7 @@ func TestBotManagementUpdateWithOptionalParams(t *testing.T) { } } -func TestBotManagementGet(t *testing.T) { +func TestBotManagementReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,7 +55,14 @@ func TestBotManagementGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.BotManagements.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.BotManagement.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.BotManagementReplaceParamsBotManagementBotFightModeConfig{ + EnableJs: cloudflare.F(true), + FightMode: cloudflare.F(true), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/brandprotectionsubmit.go b/brandprotectionsubmit.go index 17daaf6fee5..3324d76b38f 100644 --- a/brandprotectionsubmit.go +++ b/brandprotectionsubmit.go @@ -32,9 +32,9 @@ func NewBrandProtectionSubmitService(opts ...option.RequestOption) (r *BrandProt } // Submit suspicious URL for scanning -func (r *BrandProtectionSubmitService) PhishingURLScannerSubmitSuspiciousURLForScanning(ctx context.Context, accountID string, body BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningParams, opts ...option.RequestOption) (res *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse, err error) { +func (r *BrandProtectionSubmitService) New(ctx context.Context, accountID string, body BrandProtectionSubmitNewParams, opts ...option.RequestOption) (res *BrandProtectionSubmitNewResponse, err error) { opts = append(r.Options[:], opts...) - var env BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelope + var env BrandProtectionSubmitNewResponseEnvelope path := fmt.Sprintf("accounts/%s/brand-protection/submit", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -44,21 +44,20 @@ func (r *BrandProtectionSubmitService) PhishingURLScannerSubmitSuspiciousURLForS return } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse struct { +type BrandProtectionSubmitNewResponse struct { // URLs that were excluded from scanning because their domain is in our no-scan // list. - ExcludedURLs []BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURL `json:"excluded_urls"` + ExcludedURLs []BrandProtectionSubmitNewResponseExcludedURL `json:"excluded_urls"` // URLs that were skipped because the same URL is currently being scanned - SkippedURLs []BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURL `json:"skipped_urls"` + SkippedURLs []BrandProtectionSubmitNewResponseSkippedURL `json:"skipped_urls"` // URLs that were successfully submitted for scanning. - SubmittedURLs []BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURL `json:"submitted_urls"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseJSON `json:"-"` + SubmittedURLs []BrandProtectionSubmitNewResponseSubmittedURL `json:"submitted_urls"` + JSON brandProtectionSubmitNewResponseJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseJSON struct { +// brandProtectionSubmitNewResponseJSON contains the JSON metadata for the struct +// [BrandProtectionSubmitNewResponse] +type brandProtectionSubmitNewResponseJSON struct { ExcludedURLs apijson.Field SkippedURLs apijson.Field SubmittedURLs apijson.Field @@ -66,95 +65,91 @@ type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningRespon ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURL struct { +type BrandProtectionSubmitNewResponseExcludedURL struct { // URL that was excluded. - URL string `json:"url"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURLJSON `json:"-"` + URL string `json:"url"` + JSON brandProtectionSubmitNewResponseExcludedURLJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURLJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURL] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURLJSON struct { +// brandProtectionSubmitNewResponseExcludedURLJSON contains the JSON metadata for +// the struct [BrandProtectionSubmitNewResponseExcludedURL] +type brandProtectionSubmitNewResponseExcludedURLJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseExcludedURL) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseExcludedURL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURL struct { +type BrandProtectionSubmitNewResponseSkippedURL struct { // URL that was skipped. URL string `json:"url"` // ID of the submission of that URL that is currently scanning. - URLID int64 `json:"url_id"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURLJSON `json:"-"` + URLID int64 `json:"url_id"` + JSON brandProtectionSubmitNewResponseSkippedURLJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURLJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURL] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURLJSON struct { +// brandProtectionSubmitNewResponseSkippedURLJSON contains the JSON metadata for +// the struct [BrandProtectionSubmitNewResponseSkippedURL] +type brandProtectionSubmitNewResponseSkippedURLJSON struct { URL apijson.Field URLID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSkippedURL) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseSkippedURL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURL struct { +type BrandProtectionSubmitNewResponseSubmittedURL struct { // URL that was submitted. URL string `json:"url"` // ID assigned to this URL submission. Used to retrieve scanning results. - URLID int64 `json:"url_id"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURLJSON `json:"-"` + URLID int64 `json:"url_id"` + JSON brandProtectionSubmitNewResponseSubmittedURLJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURLJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURL] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURLJSON struct { +// brandProtectionSubmitNewResponseSubmittedURLJSON contains the JSON metadata for +// the struct [BrandProtectionSubmitNewResponseSubmittedURL] +type brandProtectionSubmitNewResponseSubmittedURLJSON struct { URL apijson.Field URLID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseSubmittedURL) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseSubmittedURL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningParams struct { +type BrandProtectionSubmitNewParams struct { // URL(s) to filter submissions results by URL param.Field[string] `json:"url" format:"uri"` } -func (r BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningParams) MarshalJSON() (data []byte, err error) { +func (r BrandProtectionSubmitNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelope struct { - Errors []BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrors `json:"errors,required"` - Messages []BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessages `json:"messages,required"` - Result BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponse `json:"result,required"` +type BrandProtectionSubmitNewResponseEnvelope struct { + Errors []BrandProtectionSubmitNewResponseEnvelopeErrors `json:"errors,required"` + Messages []BrandProtectionSubmitNewResponseEnvelopeMessages `json:"messages,required"` + Result BrandProtectionSubmitNewResponse `json:"result,required"` // Whether the API call was successful - Success BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeSuccess `json:"success,required"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeJSON `json:"-"` + Success BrandProtectionSubmitNewResponseEnvelopeSuccess `json:"success,required"` + JSON brandProtectionSubmitNewResponseEnvelopeJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelope] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeJSON struct { +// brandProtectionSubmitNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [BrandProtectionSubmitNewResponseEnvelope] +type brandProtectionSubmitNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -163,53 +158,51 @@ type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningRespon ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrorsJSON `json:"-"` +type BrandProtectionSubmitNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON brandProtectionSubmitNewResponseEnvelopeErrorsJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrors] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrorsJSON struct { +// brandProtectionSubmitNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [BrandProtectionSubmitNewResponseEnvelopeErrors] +type brandProtectionSubmitNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessagesJSON `json:"-"` +type BrandProtectionSubmitNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON brandProtectionSubmitNewResponseEnvelopeMessagesJSON `json:"-"` } -// brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessages] -type brandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessagesJSON struct { +// brandProtectionSubmitNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [BrandProtectionSubmitNewResponseEnvelopeMessages] +type brandProtectionSubmitNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionSubmitNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeSuccess bool +type BrandProtectionSubmitNewResponseEnvelopeSuccess bool const ( - BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeSuccessTrue BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningResponseEnvelopeSuccess = true + BrandProtectionSubmitNewResponseEnvelopeSuccessTrue BrandProtectionSubmitNewResponseEnvelopeSuccess = true ) diff --git a/brandprotectionsubmit_test.go b/brandprotectionsubmit_test.go index 3ee7622108d..53432ce75a1 100644 --- a/brandprotectionsubmit_test.go +++ b/brandprotectionsubmit_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestBrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningWithOptionalParams(t *testing.T) { +func TestBrandProtectionSubmitNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestBrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningWi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.BrandProtections.Submits.PhishingURLScannerSubmitSuspiciousURLForScanning( + _, err := client.BrandProtection.Submits.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.BrandProtectionSubmitPhishingURLScannerSubmitSuspiciousURLForScanningParams{ + cloudflare.BrandProtectionSubmitNewParams{ URL: cloudflare.F("https://www.cloudflare.com"), }, ) diff --git a/brandprotectionurlinfo.go b/brandprotectionurlinfo.go index fdafe189d1c..35210541691 100644 --- a/brandprotectionurlinfo.go +++ b/brandprotectionurlinfo.go @@ -34,9 +34,9 @@ func NewBrandProtectionURLInfoService(opts ...option.RequestOption) (r *BrandPro } // Get results for a URL scan -func (r *BrandProtectionURLInfoService) PhishingURLInformationGetResultsForAURLScan(ctx context.Context, accountID string, query BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams, opts ...option.RequestOption) (res *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse, err error) { +func (r *BrandProtectionURLInfoService) Get(ctx context.Context, accountID string, query BrandProtectionURLInfoGetParams, opts ...option.RequestOption) (res *BrandProtectionURLInfoGetResponse, err error) { opts = append(r.Options[:], opts...) - var env BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelope + var env BrandProtectionURLInfoGetResponseEnvelope path := fmt.Sprintf("accounts/%s/brand-protection/url-info", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,29 +46,28 @@ func (r *BrandProtectionURLInfoService) PhishingURLInformationGetResultsForAURLS return } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse struct { +type BrandProtectionURLInfoGetResponse struct { // List of categorizations applied to this submission. - Categorizations []BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorization `json:"categorizations"` + Categorizations []BrandProtectionURLInfoGetResponseCategorization `json:"categorizations"` // List of model results for completed scans. - ModelResults []BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResult `json:"model_results"` + ModelResults []BrandProtectionURLInfoGetResponseModelResult `json:"model_results"` // List of signatures that matched against site content found when crawling the // URL. - RuleMatches []BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatch `json:"rule_matches"` + RuleMatches []BrandProtectionURLInfoGetResponseRuleMatch `json:"rule_matches"` // Status of the most recent scan found. - ScanStatus BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatus `json:"scan_status"` + ScanStatus BrandProtectionURLInfoGetResponseScanStatus `json:"scan_status"` // For internal use. ScreenshotDownloadSignature string `json:"screenshot_download_signature"` // For internal use. ScreenshotPath string `json:"screenshot_path"` // URL that was submitted. - URL string `json:"url"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseJSON `json:"-"` + URL string `json:"url"` + JSON brandProtectionURLInfoGetResponseJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseJSON struct { +// brandProtectionURLInfoGetResponseJSON contains the JSON metadata for the struct +// [BrandProtectionURLInfoGetResponse] +type brandProtectionURLInfoGetResponseJSON struct { Categorizations apijson.Field ModelResults apijson.Field RuleMatches apijson.Field @@ -80,55 +79,53 @@ type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseJS ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorization struct { +type BrandProtectionURLInfoGetResponseCategorization struct { // Name of the category applied. Category string `json:"category"` // Result of human review for this categorization. - VerificationStatus string `json:"verification_status"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorizationJSON `json:"-"` + VerificationStatus string `json:"verification_status"` + JSON brandProtectionURLInfoGetResponseCategorizationJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorizationJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorization] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorizationJSON struct { +// brandProtectionURLInfoGetResponseCategorizationJSON contains the JSON metadata +// for the struct [BrandProtectionURLInfoGetResponseCategorization] +type brandProtectionURLInfoGetResponseCategorizationJSON struct { Category apijson.Field VerificationStatus apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseCategorization) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseCategorization) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResult struct { +type BrandProtectionURLInfoGetResponseModelResult struct { // Name of the model. ModelName string `json:"model_name"` // Score output by the model for this submission. - ModelScore float64 `json:"model_score"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResultJSON `json:"-"` + ModelScore float64 `json:"model_score"` + JSON brandProtectionURLInfoGetResponseModelResultJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResultJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResult] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResultJSON struct { +// brandProtectionURLInfoGetResponseModelResultJSON contains the JSON metadata for +// the struct [BrandProtectionURLInfoGetResponseModelResult] +type brandProtectionURLInfoGetResponseModelResultJSON struct { ModelName apijson.Field ModelScore apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseModelResult) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseModelResult) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatch struct { +type BrandProtectionURLInfoGetResponseRuleMatch struct { // For internal use. Banning bool `json:"banning"` // For internal use. @@ -136,14 +133,13 @@ type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRu // Description of the signature that matched. Description string `json:"description"` // Name of the signature that matched. - Name string `json:"name"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatchJSON `json:"-"` + Name string `json:"name"` + JSON brandProtectionURLInfoGetResponseRuleMatchJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatchJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatch] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatchJSON struct { +// brandProtectionURLInfoGetResponseRuleMatchJSON contains the JSON metadata for +// the struct [BrandProtectionURLInfoGetResponseRuleMatch] +type brandProtectionURLInfoGetResponseRuleMatchJSON struct { Banning apijson.Field Blocking apijson.Field Description apijson.Field @@ -152,12 +148,12 @@ type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRu ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseRuleMatch) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseRuleMatch) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the most recent scan found. -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatus struct { +type BrandProtectionURLInfoGetResponseScanStatus struct { // Timestamp of when the submission was processed. LastProcessed string `json:"last_processed"` // For internal use. @@ -165,14 +161,13 @@ type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseSc // Status code that the crawler received when loading the submitted URL. StatusCode int64 `json:"status_code"` // ID of the most recent submission. - SubmissionID int64 `json:"submission_id"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatusJSON `json:"-"` + SubmissionID int64 `json:"submission_id"` + JSON brandProtectionURLInfoGetResponseScanStatusJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatusJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatus] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatusJSON struct { +// brandProtectionURLInfoGetResponseScanStatusJSON contains the JSON metadata for +// the struct [BrandProtectionURLInfoGetResponseScanStatus] +type brandProtectionURLInfoGetResponseScanStatusJSON struct { LastProcessed apijson.Field ScanComplete apijson.Field StatusCode apijson.Field @@ -181,53 +176,50 @@ type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseSc ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseScanStatus) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseScanStatus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams struct { - URL param.Field[string] `query:"url"` - URLIDParam param.Field[BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanParamsURLIDParam] `query:"url_id_param"` +type BrandProtectionURLInfoGetParams struct { + URL param.Field[string] `query:"url"` + URLIDParam param.Field[BrandProtectionURLInfoGetParamsURLIDParam] `query:"url_id_param"` } -// URLQuery serializes -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams]'s -// query parameters as `url.Values`. -func (r BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams) URLQuery() (v url.Values) { +// URLQuery serializes [BrandProtectionURLInfoGetParams]'s query parameters as +// `url.Values`. +func (r BrandProtectionURLInfoGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanParamsURLIDParam struct { +type BrandProtectionURLInfoGetParamsURLIDParam struct { // Submission ID(s) to filter submission results by. URLID param.Field[int64] `query:"url_id"` } -// URLQuery serializes -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanParamsURLIDParam]'s -// query parameters as `url.Values`. -func (r BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanParamsURLIDParam) URLQuery() (v url.Values) { +// URLQuery serializes [BrandProtectionURLInfoGetParamsURLIDParam]'s query +// parameters as `url.Values`. +func (r BrandProtectionURLInfoGetParamsURLIDParam) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelope struct { - Errors []BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrors `json:"errors,required"` - Messages []BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessages `json:"messages,required"` - Result BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponse `json:"result,required"` +type BrandProtectionURLInfoGetResponseEnvelope struct { + Errors []BrandProtectionURLInfoGetResponseEnvelopeErrors `json:"errors,required"` + Messages []BrandProtectionURLInfoGetResponseEnvelopeMessages `json:"messages,required"` + Result BrandProtectionURLInfoGetResponse `json:"result,required"` // Whether the API call was successful - Success BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeSuccess `json:"success,required"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeJSON `json:"-"` + Success BrandProtectionURLInfoGetResponseEnvelopeSuccess `json:"success,required"` + JSON brandProtectionURLInfoGetResponseEnvelopeJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelope] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeJSON struct { +// brandProtectionURLInfoGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [BrandProtectionURLInfoGetResponseEnvelope] +type brandProtectionURLInfoGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -236,53 +228,51 @@ type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEn ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrorsJSON `json:"-"` +type BrandProtectionURLInfoGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON brandProtectionURLInfoGetResponseEnvelopeErrorsJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrors] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrorsJSON struct { +// brandProtectionURLInfoGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [BrandProtectionURLInfoGetResponseEnvelopeErrors] +type brandProtectionURLInfoGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessagesJSON `json:"-"` +type BrandProtectionURLInfoGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON brandProtectionURLInfoGetResponseEnvelopeMessagesJSON `json:"-"` } -// brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessages] -type brandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessagesJSON struct { +// brandProtectionURLInfoGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [BrandProtectionURLInfoGetResponseEnvelopeMessages] +type brandProtectionURLInfoGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *BrandProtectionURLInfoGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeSuccess bool +type BrandProtectionURLInfoGetResponseEnvelopeSuccess bool const ( - BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeSuccessTrue BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanResponseEnvelopeSuccess = true + BrandProtectionURLInfoGetResponseEnvelopeSuccessTrue BrandProtectionURLInfoGetResponseEnvelopeSuccess = true ) diff --git a/brandprotectionurlinfo_test.go b/brandprotectionurlinfo_test.go index cf29f1d215c..fdda380a15b 100644 --- a/brandprotectionurlinfo_test.go +++ b/brandprotectionurlinfo_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestBrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanWithOptionalParams(t *testing.T) { +func TestBrandProtectionURLInfoGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,12 @@ func TestBrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanWithOp option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.BrandProtections.URLInfos.PhishingURLInformationGetResultsForAURLScan( + _, err := client.BrandProtection.URLInfos.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.BrandProtectionURLInfoPhishingURLInformationGetResultsForAURLScanParams{ + cloudflare.BrandProtectionURLInfoGetParams{ URL: cloudflare.F("string"), - URLIDParam: cloudflare.F(cloudflare.BrandProtectionURLInfoPhishingURLInformationGetResultsForAurlScanParamsURLIDParam{ + URLIDParam: cloudflare.F(cloudflare.BrandProtectionURLInfoGetParamsURLIDParam{ URLID: cloudflare.F(int64(0)), }), }, diff --git a/cach.go b/cach.go deleted file mode 100644 index 2f4525e894e..00000000000 --- a/cach.go +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// CachService contains methods and other services that help with interacting with -// the cloudflare API. Note, unlike clients, this service does not read variables -// from the environment automatically. You should not instantiate this service -// directly, and instead use the [NewCachService] method instead. -type CachService struct { - Options []option.RequestOption - CacheReserves *CachCacheReserveService - TieredCacheSmartTopologyEnables *CachTieredCacheSmartTopologyEnableService - Variants *CachVariantService -} - -// NewCachService generates a new service that applies the given options to each -// request. These options are applied after the parent client's options (if there -// is one), and before any request-specific options. -func NewCachService(opts ...option.RequestOption) (r *CachService) { - r = &CachService{} - r.Options = opts - r.CacheReserves = NewCachCacheReserveService(opts...) - r.TieredCacheSmartTopologyEnables = NewCachTieredCacheSmartTopologyEnableService(opts...) - r.Variants = NewCachVariantService(opts...) - return -} diff --git a/cachcachereserve.go b/cachcachereserve.go deleted file mode 100644 index f59420bf12d..00000000000 --- a/cachcachereserve.go +++ /dev/null @@ -1,330 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "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/option" -) - -// CachCacheReserveService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCachCacheReserveService] method -// instead. -type CachCacheReserveService struct { - Options []option.RequestOption -} - -// NewCachCacheReserveService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCachCacheReserveService(opts ...option.RequestOption) (r *CachCacheReserveService) { - r = &CachCacheReserveService{} - r.Options = opts - return -} - -// Increase cache lifetimes by automatically storing all cacheable files into -// Cloudflare's persistent object storage buckets. Requires Cache Reserve -// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended -// to reduce Reserve operations costs. See the -// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) -// for more information. -func (r *CachCacheReserveService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CachCacheReserveListResponse, err error) { - opts = append(r.Options[:], opts...) - var env CachCacheReserveListResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/cache_reserve", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Increase cache lifetimes by automatically storing all cacheable files into -// Cloudflare's persistent object storage buckets. Requires Cache Reserve -// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended -// to reduce Reserve operations costs. See the -// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) -// for more information. -func (r *CachCacheReserveService) ZoneCacheSettingsChangeCacheReserveSetting(ctx context.Context, zoneID string, body CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParams, opts ...option.RequestOption) (res *CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse, err error) { - opts = append(r.Options[:], opts...) - var env CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/cache_reserve", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Increase cache lifetimes by automatically storing all cacheable files into -// Cloudflare's persistent object storage buckets. Requires Cache Reserve -// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended -// to reduce Reserve operations costs. See the -// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) -// for more information. -type CachCacheReserveListResponse struct { - // ID of the zone setting. - ID CachCacheReserveListResponseID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - // Value of the Cache Reserve zone setting. - Value CachCacheReserveListResponseValue `json:"value,required"` - JSON cachCacheReserveListResponseJSON `json:"-"` -} - -// cachCacheReserveListResponseJSON contains the JSON metadata for the struct -// [CachCacheReserveListResponse] -type cachCacheReserveListResponseJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// ID of the zone setting. -type CachCacheReserveListResponseID string - -const ( - CachCacheReserveListResponseIDCacheReserve CachCacheReserveListResponseID = "cache_reserve" -) - -// Value of the Cache Reserve zone setting. -type CachCacheReserveListResponseValue string - -const ( - CachCacheReserveListResponseValueOn CachCacheReserveListResponseValue = "on" - CachCacheReserveListResponseValueOff CachCacheReserveListResponseValue = "off" -) - -// Increase cache lifetimes by automatically storing all cacheable files into -// Cloudflare's persistent object storage buckets. Requires Cache Reserve -// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended -// to reduce Reserve operations costs. See the -// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) -// for more information. -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse struct { - // ID of the zone setting. - ID CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - // Value of the Cache Reserve zone setting. - Value CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValue `json:"value,required"` - JSON cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseJSON `json:"-"` -} - -// cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseJSON contains -// the JSON metadata for the struct -// [CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse] -type cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// ID of the zone setting. -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseID string - -const ( - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseIDCacheReserve CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseID = "cache_reserve" -) - -// Value of the Cache Reserve zone setting. -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValue string - -const ( - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValueOn CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValue = "on" - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValueOff CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseValue = "off" -) - -type CachCacheReserveListResponseEnvelope struct { - Errors []CachCacheReserveListResponseEnvelopeErrors `json:"errors,required"` - Messages []CachCacheReserveListResponseEnvelopeMessages `json:"messages,required"` - // Increase cache lifetimes by automatically storing all cacheable files into - // Cloudflare's persistent object storage buckets. Requires Cache Reserve - // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended - // to reduce Reserve operations costs. See the - // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) - // for more information. - Result CachCacheReserveListResponse `json:"result,required"` - // Whether the API call was successful - Success CachCacheReserveListResponseEnvelopeSuccess `json:"success,required"` - JSON cachCacheReserveListResponseEnvelopeJSON `json:"-"` -} - -// cachCacheReserveListResponseEnvelopeJSON contains the JSON metadata for the -// struct [CachCacheReserveListResponseEnvelope] -type cachCacheReserveListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachCacheReserveListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachCacheReserveListResponseEnvelopeErrorsJSON `json:"-"` -} - -// cachCacheReserveListResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [CachCacheReserveListResponseEnvelopeErrors] -type cachCacheReserveListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachCacheReserveListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachCacheReserveListResponseEnvelopeMessagesJSON `json:"-"` -} - -// cachCacheReserveListResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [CachCacheReserveListResponseEnvelopeMessages] -type cachCacheReserveListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CachCacheReserveListResponseEnvelopeSuccess bool - -const ( - CachCacheReserveListResponseEnvelopeSuccessTrue CachCacheReserveListResponseEnvelopeSuccess = true -) - -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParams struct { - // Value of the Cache Reserve zone setting. - Value param.Field[CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValue] `json:"value,required"` -} - -func (r CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Value of the Cache Reserve zone setting. -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValue string - -const ( - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValueOn CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValue = "on" - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValueOff CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValue = "off" -) - -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelope struct { - Errors []CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessages `json:"messages,required"` - // Increase cache lifetimes by automatically storing all cacheable files into - // Cloudflare's persistent object storage buckets. Requires Cache Reserve - // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended - // to reduce Reserve operations costs. See the - // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) - // for more information. - Result CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponse `json:"result,required"` - // Whether the API call was successful - Success CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeSuccess `json:"success,required"` - JSON cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeJSON `json:"-"` -} - -// cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelope] -type cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrorsJSON `json:"-"` -} - -// cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrors] -type cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessagesJSON `json:"-"` -} - -// cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessages] -type cachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeSuccess bool - -const ( - CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeSuccessTrue CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingResponseEnvelopeSuccess = true -) diff --git a/cache.go b/cache.go index 534d16fa14d..076b0ccd868 100644 --- a/cache.go +++ b/cache.go @@ -6,7 +6,6 @@ import ( "context" "fmt" "net/http" - "time" "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" "github.com/cloudflare/cloudflare-sdk-go/internal/param" @@ -19,7 +18,11 @@ import ( // from the environment automatically. You should not instantiate this service // directly, and instead use the [NewCacheService] method instead. type CacheService struct { - Options []option.RequestOption + Options []option.RequestOption + CacheReserves *CacheCacheReserveService + TieredCacheSmartTopology *CacheTieredCacheSmartTopologyService + Variants *CacheVariantService + RegionalTieredCache *CacheRegionalTieredCacheService } // NewCacheService generates a new service that applies the given options to each @@ -28,17 +31,46 @@ type CacheService struct { func NewCacheService(opts ...option.RequestOption) (r *CacheService) { r = &CacheService{} r.Options = opts + r.CacheReserves = NewCacheCacheReserveService(opts...) + r.TieredCacheSmartTopology = NewCacheTieredCacheSmartTopologyService(opts...) + r.Variants = NewCacheVariantService(opts...) + r.RegionalTieredCache = NewCacheRegionalTieredCacheService(opts...) return } -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -func (r *CacheService) RegionalTieredCaches(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheRegionalTieredCachesResponse, err error) { +// ### Purge All Cached Content +// +// Removes ALL files from Cloudflare's cache. All tiers can purge everything. +// +// ### Purge Cached Content by URL +// +// Granularly removes one or more files from Cloudflare's cache by specifying URLs. +// All tiers can purge by URL. +// +// To purge files with custom cache keys, include the headers used to compute the +// cache key as in the example. If you have a device type or geo in your cache key, +// you will need to include the CF-Device-Type or CF-IPCountry headers. If you have +// lang in your cache key, you will need to include the Accept-Language header. +// +// **NB:** When including the Origin header, be sure to include the **scheme** and +// **hostname**. The port number can be omitted if it is the default port (80 for +// http, 443 for https), but must be included otherwise. +// +// ### Purge Cached Content by Tag, Host or Prefix +// +// Granularly removes one or more files from Cloudflare's cache either by +// specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise +// customers are permitted to purge by Tag, Host or Prefix. +// +// **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 +// purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or +// prefixes in one API call. This rate limit can be raised for customers who need +// to purge at higher volume. +func (r *CacheService) Purge(ctx context.Context, identifier string, body CachePurgeParams, opts ...option.RequestOption) (res *CachePurgeResponse, err error) { opts = append(r.Options[:], opts...) - var env CacheRegionalTieredCachesResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env CachePurgeResponseEnvelope + path := fmt.Sprintf("zones/%s/purge_cache", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -46,259 +78,99 @@ func (r *CacheService) RegionalTieredCaches(ctx context.Context, zoneID string, return } -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -func (r *CacheService) UpdateRegionalTieredCache(ctx context.Context, zoneID string, body CacheUpdateRegionalTieredCacheParams, opts ...option.RequestOption) (res *CacheUpdateRegionalTieredCacheResponse, err error) { - opts = append(r.Options[:], opts...) - var env CacheUpdateRegionalTieredCacheResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -type CacheRegionalTieredCachesResponse struct { - // ID of the zone setting. - ID CacheRegionalTieredCachesResponseID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - // Instructs Cloudflare to check a regional hub data center on the way to your - // upper tier. This can help improve performance for smart and custom tiered cache - // topologies. - Value CacheRegionalTieredCachesResponseValue `json:"value,required"` - JSON cacheRegionalTieredCachesResponseJSON `json:"-"` +type CachePurgeResponse struct { + // Identifier + ID string `json:"id,required"` + JSON cachePurgeResponseJSON `json:"-"` } -// cacheRegionalTieredCachesResponseJSON contains the JSON metadata for the struct -// [CacheRegionalTieredCachesResponse] -type cacheRegionalTieredCachesResponseJSON struct { +// cachePurgeResponseJSON contains the JSON metadata for the struct +// [CachePurgeResponse] +type cachePurgeResponseJSON struct { ID apijson.Field - ModifiedOn apijson.Field - Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CacheRegionalTieredCachesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CachePurgeResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// ID of the zone setting. -type CacheRegionalTieredCachesResponseID string - -const ( - CacheRegionalTieredCachesResponseIDTcRegional CacheRegionalTieredCachesResponseID = "tc_regional" -) - -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -type CacheRegionalTieredCachesResponseValue struct { - // ID of the zone setting. - ID CacheRegionalTieredCachesResponseValueID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - JSON cacheRegionalTieredCachesResponseValueJSON `json:"-"` -} - -// cacheRegionalTieredCachesResponseValueJSON contains the JSON metadata for the -// struct [CacheRegionalTieredCachesResponseValue] -type cacheRegionalTieredCachesResponseValueJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field +// This interface is a union satisfied by one of the following: +// [CachePurgeParamsKtBnhzJvFlex], [CachePurgeParamsKtBnhzJvEverything], +// [CachePurgeParamsKtBnhzJvFiles]. +type CachePurgeParams interface { + ImplementsCachePurgeParams() } -func (r *CacheRegionalTieredCachesResponseValue) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +type CachePurgeParamsKtBnhzJvFlex struct { + Hosts param.Field[[]string] `json:"hosts"` + Prefixes param.Field[[]string] `json:"prefixes"` + Tags param.Field[[]string] `json:"tags"` } -// ID of the zone setting. -type CacheRegionalTieredCachesResponseValueID string - -const ( - CacheRegionalTieredCachesResponseValueIDTcRegional CacheRegionalTieredCachesResponseValueID = "tc_regional" -) - -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -type CacheUpdateRegionalTieredCacheResponse struct { - // ID of the zone setting. - ID CacheUpdateRegionalTieredCacheResponseID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - // Instructs Cloudflare to check a regional hub data center on the way to your - // upper tier. This can help improve performance for smart and custom tiered cache - // topologies. - Value CacheUpdateRegionalTieredCacheResponseValue `json:"value,required"` - JSON cacheUpdateRegionalTieredCacheResponseJSON `json:"-"` -} - -// cacheUpdateRegionalTieredCacheResponseJSON contains the JSON metadata for the -// struct [CacheUpdateRegionalTieredCacheResponse] -type cacheUpdateRegionalTieredCacheResponseJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CacheUpdateRegionalTieredCacheResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r CachePurgeParamsKtBnhzJvFlex) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// ID of the zone setting. -type CacheUpdateRegionalTieredCacheResponseID string +func (CachePurgeParamsKtBnhzJvFlex) ImplementsCachePurgeParams() { -const ( - CacheUpdateRegionalTieredCacheResponseIDTcRegional CacheUpdateRegionalTieredCacheResponseID = "tc_regional" -) - -// Instructs Cloudflare to check a regional hub data center on the way to your -// upper tier. This can help improve performance for smart and custom tiered cache -// topologies. -type CacheUpdateRegionalTieredCacheResponseValue struct { - // ID of the zone setting. - ID CacheUpdateRegionalTieredCacheResponseValueID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - JSON cacheUpdateRegionalTieredCacheResponseValueJSON `json:"-"` } -// cacheUpdateRegionalTieredCacheResponseValueJSON contains the JSON metadata for -// the struct [CacheUpdateRegionalTieredCacheResponseValue] -type cacheUpdateRegionalTieredCacheResponseValueJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field +type CachePurgeParamsKtBnhzJvEverything struct { + PurgeEverything param.Field[bool] `json:"purge_everything"` } -func (r *CacheUpdateRegionalTieredCacheResponseValue) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// ID of the zone setting. -type CacheUpdateRegionalTieredCacheResponseValueID string - -const ( - CacheUpdateRegionalTieredCacheResponseValueIDTcRegional CacheUpdateRegionalTieredCacheResponseValueID = "tc_regional" -) - -type CacheRegionalTieredCachesResponseEnvelope struct { - Errors []CacheRegionalTieredCachesResponseEnvelopeErrors `json:"errors,required"` - Messages []CacheRegionalTieredCachesResponseEnvelopeMessages `json:"messages,required"` - // Instructs Cloudflare to check a regional hub data center on the way to your - // upper tier. This can help improve performance for smart and custom tiered cache - // topologies. - Result CacheRegionalTieredCachesResponse `json:"result,required"` - // Whether the API call was successful - Success CacheRegionalTieredCachesResponseEnvelopeSuccess `json:"success,required"` - JSON cacheRegionalTieredCachesResponseEnvelopeJSON `json:"-"` -} - -// cacheRegionalTieredCachesResponseEnvelopeJSON contains the JSON metadata for the -// struct [CacheRegionalTieredCachesResponseEnvelope] -type cacheRegionalTieredCachesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r CachePurgeParamsKtBnhzJvEverything) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *CacheRegionalTieredCachesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +func (CachePurgeParamsKtBnhzJvEverything) ImplementsCachePurgeParams() { -type CacheRegionalTieredCachesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheRegionalTieredCachesResponseEnvelopeErrorsJSON `json:"-"` } -// cacheRegionalTieredCachesResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [CacheRegionalTieredCachesResponseEnvelopeErrors] -type cacheRegionalTieredCachesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type CachePurgeParamsKtBnhzJvFiles struct { + Files param.Field[[]CachePurgeParamsKtBnhzJvFilesFile] `json:"files"` } -func (r *CacheRegionalTieredCachesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r CachePurgeParamsKtBnhzJvFiles) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type CacheRegionalTieredCachesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheRegionalTieredCachesResponseEnvelopeMessagesJSON `json:"-"` -} +func (CachePurgeParamsKtBnhzJvFiles) ImplementsCachePurgeParams() { -// cacheRegionalTieredCachesResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [CacheRegionalTieredCachesResponseEnvelopeMessages] -type cacheRegionalTieredCachesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field } -func (r *CacheRegionalTieredCachesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// Satisfied by [shared.UnionString], +// [CachePurgeParamsKtBnhzJvFilesFilesKtBnhzJvURLAndHeaders]. +type CachePurgeParamsKtBnhzJvFilesFile interface { + ImplementsCachePurgeParamsKtBnhzJvFilesFile() } -// Whether the API call was successful -type CacheRegionalTieredCachesResponseEnvelopeSuccess bool - -const ( - CacheRegionalTieredCachesResponseEnvelopeSuccessTrue CacheRegionalTieredCachesResponseEnvelopeSuccess = true -) - -type CacheUpdateRegionalTieredCacheParams struct { - // Value of the Regional Tiered Cache zone setting. - Value param.Field[CacheUpdateRegionalTieredCacheParamsValue] `json:"value,required"` +type CachePurgeParamsKtBnhzJvFilesFilesKtBnhzJvURLAndHeaders struct { + Headers param.Field[interface{}] `json:"headers"` + URL param.Field[string] `json:"url"` } -func (r CacheUpdateRegionalTieredCacheParams) MarshalJSON() (data []byte, err error) { +func (r CachePurgeParamsKtBnhzJvFilesFilesKtBnhzJvURLAndHeaders) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Value of the Regional Tiered Cache zone setting. -type CacheUpdateRegionalTieredCacheParamsValue string - -const ( - CacheUpdateRegionalTieredCacheParamsValueOn CacheUpdateRegionalTieredCacheParamsValue = "on" - CacheUpdateRegionalTieredCacheParamsValueOff CacheUpdateRegionalTieredCacheParamsValue = "off" -) +func (r CachePurgeParamsKtBnhzJvFilesFilesKtBnhzJvURLAndHeaders) ImplementsCachePurgeParamsKtBnhzJvFilesFile() { +} -type CacheUpdateRegionalTieredCacheResponseEnvelope struct { - Errors []CacheUpdateRegionalTieredCacheResponseEnvelopeErrors `json:"errors,required"` - Messages []CacheUpdateRegionalTieredCacheResponseEnvelopeMessages `json:"messages,required"` - // Instructs Cloudflare to check a regional hub data center on the way to your - // upper tier. This can help improve performance for smart and custom tiered cache - // topologies. - Result CacheUpdateRegionalTieredCacheResponse `json:"result,required"` +type CachePurgeResponseEnvelope struct { + Errors []CachePurgeResponseEnvelopeErrors `json:"errors,required"` + Messages []CachePurgeResponseEnvelopeMessages `json:"messages,required"` + Result CachePurgeResponse `json:"result,required,nullable"` // Whether the API call was successful - Success CacheUpdateRegionalTieredCacheResponseEnvelopeSuccess `json:"success,required"` - JSON cacheUpdateRegionalTieredCacheResponseEnvelopeJSON `json:"-"` + Success CachePurgeResponseEnvelopeSuccess `json:"success,required"` + JSON cachePurgeResponseEnvelopeJSON `json:"-"` } -// cacheUpdateRegionalTieredCacheResponseEnvelopeJSON contains the JSON metadata -// for the struct [CacheUpdateRegionalTieredCacheResponseEnvelope] -type cacheUpdateRegionalTieredCacheResponseEnvelopeJSON struct { +// cachePurgeResponseEnvelopeJSON contains the JSON metadata for the struct +// [CachePurgeResponseEnvelope] +type cachePurgeResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -307,51 +179,51 @@ type cacheUpdateRegionalTieredCacheResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CacheUpdateRegionalTieredCacheResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CachePurgeResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CacheUpdateRegionalTieredCacheResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheUpdateRegionalTieredCacheResponseEnvelopeErrorsJSON `json:"-"` +type CachePurgeResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cachePurgeResponseEnvelopeErrorsJSON `json:"-"` } -// cacheUpdateRegionalTieredCacheResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [CacheUpdateRegionalTieredCacheResponseEnvelopeErrors] -type cacheUpdateRegionalTieredCacheResponseEnvelopeErrorsJSON struct { +// cachePurgeResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [CachePurgeResponseEnvelopeErrors] +type cachePurgeResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CacheUpdateRegionalTieredCacheResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CachePurgeResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CacheUpdateRegionalTieredCacheResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheUpdateRegionalTieredCacheResponseEnvelopeMessagesJSON `json:"-"` +type CachePurgeResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cachePurgeResponseEnvelopeMessagesJSON `json:"-"` } -// cacheUpdateRegionalTieredCacheResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [CacheUpdateRegionalTieredCacheResponseEnvelopeMessages] -type cacheUpdateRegionalTieredCacheResponseEnvelopeMessagesJSON struct { +// cachePurgeResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [CachePurgeResponseEnvelopeMessages] +type cachePurgeResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CacheUpdateRegionalTieredCacheResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CachePurgeResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CacheUpdateRegionalTieredCacheResponseEnvelopeSuccess bool +type CachePurgeResponseEnvelopeSuccess bool const ( - CacheUpdateRegionalTieredCacheResponseEnvelopeSuccessTrue CacheUpdateRegionalTieredCacheResponseEnvelopeSuccess = true + CachePurgeResponseEnvelopeSuccessTrue CachePurgeResponseEnvelopeSuccess = true ) diff --git a/cache_test.go b/cache_test.go index a0fb9311bd9..193b1e69619 100644 --- a/cache_test.go +++ b/cache_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCacheRegionalTieredCaches(t *testing.T) { +func TestCachePurgeWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,37 +29,13 @@ func TestCacheRegionalTieredCaches(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Cache.RegionalTieredCaches(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestCacheUpdateRegionalTieredCache(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Cache.UpdateRegionalTieredCache( + _, err := client.Cache.Purge( context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CacheUpdateRegionalTieredCacheParams{ - Value: cloudflare.F(cloudflare.CacheUpdateRegionalTieredCacheParamsValueOn), + "string", + cloudflare.CachePurgeParamsKtBnhzJvFlex{ + Hosts: cloudflare.F([]string{"www.example.com", "images.example.com"}), + Prefixes: cloudflare.F([]string{"www.example.com/foo", "images.example.com/bar/baz"}), + Tags: cloudflare.F([]string{"some-tag", "another-tag"}), }, ) if err != nil { diff --git a/cachecachereserve.go b/cachecachereserve.go new file mode 100644 index 00000000000..a9689789004 --- /dev/null +++ b/cachecachereserve.go @@ -0,0 +1,326 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "time" + + "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/option" +) + +// CacheCacheReserveService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewCacheCacheReserveService] method +// instead. +type CacheCacheReserveService struct { + Options []option.RequestOption +} + +// NewCacheCacheReserveService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewCacheCacheReserveService(opts ...option.RequestOption) (r *CacheCacheReserveService) { + r = &CacheCacheReserveService{} + r.Options = opts + return +} + +// Increase cache lifetimes by automatically storing all cacheable files into +// Cloudflare's persistent object storage buckets. Requires Cache Reserve +// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended +// to reduce Reserve operations costs. See the +// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) +// for more information. +func (r *CacheCacheReserveService) Update(ctx context.Context, zoneID string, body CacheCacheReserveUpdateParams, opts ...option.RequestOption) (res *CacheCacheReserveUpdateResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheCacheReserveUpdateResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/cache_reserve", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Increase cache lifetimes by automatically storing all cacheable files into +// Cloudflare's persistent object storage buckets. Requires Cache Reserve +// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended +// to reduce Reserve operations costs. See the +// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) +// for more information. +func (r *CacheCacheReserveService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheCacheReserveListResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheCacheReserveListResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/cache_reserve", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Increase cache lifetimes by automatically storing all cacheable files into +// Cloudflare's persistent object storage buckets. Requires Cache Reserve +// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended +// to reduce Reserve operations costs. See the +// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) +// for more information. +type CacheCacheReserveUpdateResponse struct { + // ID of the zone setting. + ID CacheCacheReserveUpdateResponseID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + // Value of the Cache Reserve zone setting. + Value CacheCacheReserveUpdateResponseValue `json:"value,required"` + JSON cacheCacheReserveUpdateResponseJSON `json:"-"` +} + +// cacheCacheReserveUpdateResponseJSON contains the JSON metadata for the struct +// [CacheCacheReserveUpdateResponse] +type cacheCacheReserveUpdateResponseJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveUpdateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheCacheReserveUpdateResponseID string + +const ( + CacheCacheReserveUpdateResponseIDCacheReserve CacheCacheReserveUpdateResponseID = "cache_reserve" +) + +// Value of the Cache Reserve zone setting. +type CacheCacheReserveUpdateResponseValue string + +const ( + CacheCacheReserveUpdateResponseValueOn CacheCacheReserveUpdateResponseValue = "on" + CacheCacheReserveUpdateResponseValueOff CacheCacheReserveUpdateResponseValue = "off" +) + +// Increase cache lifetimes by automatically storing all cacheable files into +// Cloudflare's persistent object storage buckets. Requires Cache Reserve +// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended +// to reduce Reserve operations costs. See the +// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) +// for more information. +type CacheCacheReserveListResponse struct { + // ID of the zone setting. + ID CacheCacheReserveListResponseID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + // Value of the Cache Reserve zone setting. + Value CacheCacheReserveListResponseValue `json:"value,required"` + JSON cacheCacheReserveListResponseJSON `json:"-"` +} + +// cacheCacheReserveListResponseJSON contains the JSON metadata for the struct +// [CacheCacheReserveListResponse] +type cacheCacheReserveListResponseJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheCacheReserveListResponseID string + +const ( + CacheCacheReserveListResponseIDCacheReserve CacheCacheReserveListResponseID = "cache_reserve" +) + +// Value of the Cache Reserve zone setting. +type CacheCacheReserveListResponseValue string + +const ( + CacheCacheReserveListResponseValueOn CacheCacheReserveListResponseValue = "on" + CacheCacheReserveListResponseValueOff CacheCacheReserveListResponseValue = "off" +) + +type CacheCacheReserveUpdateParams struct { + // Value of the Cache Reserve zone setting. + Value param.Field[CacheCacheReserveUpdateParamsValue] `json:"value,required"` +} + +func (r CacheCacheReserveUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Value of the Cache Reserve zone setting. +type CacheCacheReserveUpdateParamsValue string + +const ( + CacheCacheReserveUpdateParamsValueOn CacheCacheReserveUpdateParamsValue = "on" + CacheCacheReserveUpdateParamsValueOff CacheCacheReserveUpdateParamsValue = "off" +) + +type CacheCacheReserveUpdateResponseEnvelope struct { + Errors []CacheCacheReserveUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheCacheReserveUpdateResponseEnvelopeMessages `json:"messages,required"` + // Increase cache lifetimes by automatically storing all cacheable files into + // Cloudflare's persistent object storage buckets. Requires Cache Reserve + // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended + // to reduce Reserve operations costs. See the + // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) + // for more information. + Result CacheCacheReserveUpdateResponse `json:"result,required"` + // Whether the API call was successful + Success CacheCacheReserveUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON cacheCacheReserveUpdateResponseEnvelopeJSON `json:"-"` +} + +// cacheCacheReserveUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [CacheCacheReserveUpdateResponseEnvelope] +type cacheCacheReserveUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheCacheReserveUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheCacheReserveUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheCacheReserveUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CacheCacheReserveUpdateResponseEnvelopeErrors] +type cacheCacheReserveUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheCacheReserveUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheCacheReserveUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheCacheReserveUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [CacheCacheReserveUpdateResponseEnvelopeMessages] +type cacheCacheReserveUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheCacheReserveUpdateResponseEnvelopeSuccess bool + +const ( + CacheCacheReserveUpdateResponseEnvelopeSuccessTrue CacheCacheReserveUpdateResponseEnvelopeSuccess = true +) + +type CacheCacheReserveListResponseEnvelope struct { + Errors []CacheCacheReserveListResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheCacheReserveListResponseEnvelopeMessages `json:"messages,required"` + // Increase cache lifetimes by automatically storing all cacheable files into + // Cloudflare's persistent object storage buckets. Requires Cache Reserve + // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended + // to reduce Reserve operations costs. See the + // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) + // for more information. + Result CacheCacheReserveListResponse `json:"result,required"` + // Whether the API call was successful + Success CacheCacheReserveListResponseEnvelopeSuccess `json:"success,required"` + JSON cacheCacheReserveListResponseEnvelopeJSON `json:"-"` +} + +// cacheCacheReserveListResponseEnvelopeJSON contains the JSON metadata for the +// struct [CacheCacheReserveListResponseEnvelope] +type cacheCacheReserveListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheCacheReserveListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheCacheReserveListResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheCacheReserveListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CacheCacheReserveListResponseEnvelopeErrors] +type cacheCacheReserveListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheCacheReserveListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheCacheReserveListResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheCacheReserveListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CacheCacheReserveListResponseEnvelopeMessages] +type cacheCacheReserveListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheCacheReserveListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheCacheReserveListResponseEnvelopeSuccess bool + +const ( + CacheCacheReserveListResponseEnvelopeSuccessTrue CacheCacheReserveListResponseEnvelopeSuccess = true +) diff --git a/fontsetting_test.go b/cachecachereserve_test.go similarity index 83% rename from fontsetting_test.go rename to cachecachereserve_test.go index 3044a61197c..6287ddfee86 100644 --- a/fontsetting_test.go +++ b/cachecachereserve_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFontSettingUpdate(t *testing.T) { +func TestCacheCacheReserveUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestFontSettingUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.FontSettings.Update( + _, err := client.Cache.CacheReserves.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FontSettingUpdateParams{ - Value: cloudflare.F(cloudflare.FontSettingUpdateParamsValueOn), + cloudflare.CacheCacheReserveUpdateParams{ + Value: cloudflare.F(cloudflare.CacheCacheReserveUpdateParamsValueOn), }, ) if err != nil { @@ -45,7 +45,7 @@ func TestFontSettingUpdate(t *testing.T) { } } -func TestFontSettingGet(t *testing.T) { +func TestCacheCacheReserveList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +61,7 @@ func TestFontSettingGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.FontSettings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Cache.CacheReserves.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/cacheregionaltieredcache.go b/cacheregionaltieredcache.go new file mode 100644 index 00000000000..8fbe18de674 --- /dev/null +++ b/cacheregionaltieredcache.go @@ -0,0 +1,358 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "time" + + "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/option" +) + +// CacheRegionalTieredCacheService contains methods and other services that help +// with interacting with the cloudflare API. Note, unlike clients, this service +// does not read variables from the environment automatically. You should not +// instantiate this service directly, and instead use the +// [NewCacheRegionalTieredCacheService] method instead. +type CacheRegionalTieredCacheService struct { + Options []option.RequestOption +} + +// NewCacheRegionalTieredCacheService generates a new service that applies the +// given options to each request. These options are applied after the parent +// client's options (if there is one), and before any request-specific options. +func NewCacheRegionalTieredCacheService(opts ...option.RequestOption) (r *CacheRegionalTieredCacheService) { + r = &CacheRegionalTieredCacheService{} + r.Options = opts + return +} + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +func (r *CacheRegionalTieredCacheService) Update(ctx context.Context, zoneID string, body CacheRegionalTieredCacheUpdateParams, opts ...option.RequestOption) (res *CacheRegionalTieredCacheUpdateResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheRegionalTieredCacheUpdateResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +func (r *CacheRegionalTieredCacheService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheRegionalTieredCacheGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheRegionalTieredCacheGetResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +type CacheRegionalTieredCacheUpdateResponse struct { + // ID of the zone setting. + ID CacheRegionalTieredCacheUpdateResponseID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + // Instructs Cloudflare to check a regional hub data center on the way to your + // upper tier. This can help improve performance for smart and custom tiered cache + // topologies. + Value CacheRegionalTieredCacheUpdateResponseValue `json:"value,required"` + JSON cacheRegionalTieredCacheUpdateResponseJSON `json:"-"` +} + +// cacheRegionalTieredCacheUpdateResponseJSON contains the JSON metadata for the +// struct [CacheRegionalTieredCacheUpdateResponse] +type cacheRegionalTieredCacheUpdateResponseJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheUpdateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheRegionalTieredCacheUpdateResponseID string + +const ( + CacheRegionalTieredCacheUpdateResponseIDTcRegional CacheRegionalTieredCacheUpdateResponseID = "tc_regional" +) + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +type CacheRegionalTieredCacheUpdateResponseValue struct { + // ID of the zone setting. + ID CacheRegionalTieredCacheUpdateResponseValueID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + JSON cacheRegionalTieredCacheUpdateResponseValueJSON `json:"-"` +} + +// cacheRegionalTieredCacheUpdateResponseValueJSON contains the JSON metadata for +// the struct [CacheRegionalTieredCacheUpdateResponseValue] +type cacheRegionalTieredCacheUpdateResponseValueJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheUpdateResponseValue) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheRegionalTieredCacheUpdateResponseValueID string + +const ( + CacheRegionalTieredCacheUpdateResponseValueIDTcRegional CacheRegionalTieredCacheUpdateResponseValueID = "tc_regional" +) + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +type CacheRegionalTieredCacheGetResponse struct { + // ID of the zone setting. + ID CacheRegionalTieredCacheGetResponseID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + // Instructs Cloudflare to check a regional hub data center on the way to your + // upper tier. This can help improve performance for smart and custom tiered cache + // topologies. + Value CacheRegionalTieredCacheGetResponseValue `json:"value,required"` + JSON cacheRegionalTieredCacheGetResponseJSON `json:"-"` +} + +// cacheRegionalTieredCacheGetResponseJSON contains the JSON metadata for the +// struct [CacheRegionalTieredCacheGetResponse] +type cacheRegionalTieredCacheGetResponseJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheRegionalTieredCacheGetResponseID string + +const ( + CacheRegionalTieredCacheGetResponseIDTcRegional CacheRegionalTieredCacheGetResponseID = "tc_regional" +) + +// Instructs Cloudflare to check a regional hub data center on the way to your +// upper tier. This can help improve performance for smart and custom tiered cache +// topologies. +type CacheRegionalTieredCacheGetResponseValue struct { + // ID of the zone setting. + ID CacheRegionalTieredCacheGetResponseValueID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + JSON cacheRegionalTieredCacheGetResponseValueJSON `json:"-"` +} + +// cacheRegionalTieredCacheGetResponseValueJSON contains the JSON metadata for the +// struct [CacheRegionalTieredCacheGetResponseValue] +type cacheRegionalTieredCacheGetResponseValueJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheGetResponseValue) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheRegionalTieredCacheGetResponseValueID string + +const ( + CacheRegionalTieredCacheGetResponseValueIDTcRegional CacheRegionalTieredCacheGetResponseValueID = "tc_regional" +) + +type CacheRegionalTieredCacheUpdateParams struct { + // Value of the Regional Tiered Cache zone setting. + Value param.Field[CacheRegionalTieredCacheUpdateParamsValue] `json:"value,required"` +} + +func (r CacheRegionalTieredCacheUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Value of the Regional Tiered Cache zone setting. +type CacheRegionalTieredCacheUpdateParamsValue string + +const ( + CacheRegionalTieredCacheUpdateParamsValueOn CacheRegionalTieredCacheUpdateParamsValue = "on" + CacheRegionalTieredCacheUpdateParamsValueOff CacheRegionalTieredCacheUpdateParamsValue = "off" +) + +type CacheRegionalTieredCacheUpdateResponseEnvelope struct { + Errors []CacheRegionalTieredCacheUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheRegionalTieredCacheUpdateResponseEnvelopeMessages `json:"messages,required"` + // Instructs Cloudflare to check a regional hub data center on the way to your + // upper tier. This can help improve performance for smart and custom tiered cache + // topologies. + Result CacheRegionalTieredCacheUpdateResponse `json:"result,required"` + // Whether the API call was successful + Success CacheRegionalTieredCacheUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON cacheRegionalTieredCacheUpdateResponseEnvelopeJSON `json:"-"` +} + +// cacheRegionalTieredCacheUpdateResponseEnvelopeJSON contains the JSON metadata +// for the struct [CacheRegionalTieredCacheUpdateResponseEnvelope] +type cacheRegionalTieredCacheUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheRegionalTieredCacheUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheRegionalTieredCacheUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheRegionalTieredCacheUpdateResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [CacheRegionalTieredCacheUpdateResponseEnvelopeErrors] +type cacheRegionalTieredCacheUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheRegionalTieredCacheUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheRegionalTieredCacheUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheRegionalTieredCacheUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [CacheRegionalTieredCacheUpdateResponseEnvelopeMessages] +type cacheRegionalTieredCacheUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheRegionalTieredCacheUpdateResponseEnvelopeSuccess bool + +const ( + CacheRegionalTieredCacheUpdateResponseEnvelopeSuccessTrue CacheRegionalTieredCacheUpdateResponseEnvelopeSuccess = true +) + +type CacheRegionalTieredCacheGetResponseEnvelope struct { + Errors []CacheRegionalTieredCacheGetResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheRegionalTieredCacheGetResponseEnvelopeMessages `json:"messages,required"` + // Instructs Cloudflare to check a regional hub data center on the way to your + // upper tier. This can help improve performance for smart and custom tiered cache + // topologies. + Result CacheRegionalTieredCacheGetResponse `json:"result,required"` + // Whether the API call was successful + Success CacheRegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"` + JSON cacheRegionalTieredCacheGetResponseEnvelopeJSON `json:"-"` +} + +// cacheRegionalTieredCacheGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [CacheRegionalTieredCacheGetResponseEnvelope] +type cacheRegionalTieredCacheGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheRegionalTieredCacheGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [CacheRegionalTieredCacheGetResponseEnvelopeErrors] +type cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheRegionalTieredCacheGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [CacheRegionalTieredCacheGetResponseEnvelopeMessages] +type cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheRegionalTieredCacheGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheRegionalTieredCacheGetResponseEnvelopeSuccess bool + +const ( + CacheRegionalTieredCacheGetResponseEnvelopeSuccessTrue CacheRegionalTieredCacheGetResponseEnvelopeSuccess = true +) diff --git a/cacheregionaltieredcache_test.go b/cacheregionaltieredcache_test.go new file mode 100644 index 00000000000..8fc0f6bf1c1 --- /dev/null +++ b/cacheregionaltieredcache_test.go @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare_test + +import ( + "context" + "errors" + "os" + "testing" + + "github.com/cloudflare/cloudflare-sdk-go" + "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +func TestCacheRegionalTieredCacheUpdate(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Cache.RegionalTieredCache.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.CacheRegionalTieredCacheUpdateParams{ + Value: cloudflare.F(cloudflare.CacheRegionalTieredCacheUpdateParamsValueOn), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestCacheRegionalTieredCacheGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Cache.RegionalTieredCache.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/cachereserve.go b/cachereserve.go index 7d75fb40e51..2b97d5a0c22 100644 --- a/cachereserve.go +++ b/cachereserve.go @@ -51,9 +51,9 @@ func (r *CacheReserveService) New(ctx context.Context, zoneID string, opts ...op // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. -func (r *CacheReserveService) Clear(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheReserveClearResponse, err error) { +func (r *CacheReserveService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheReserveGetResponse, err error) { opts = append(r.Options[:], opts...) - var env CacheReserveClearResponseEnvelope + var env CacheReserveGetResponseEnvelope path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -116,23 +116,23 @@ const ( // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. -type CacheReserveClearResponse struct { +type CacheReserveGetResponse struct { // ID of the zone setting. - ID CacheReserveClearResponseID `json:"id,required"` + ID CacheReserveGetResponseID `json:"id,required"` // last time this setting was modified. ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` // The time that the latest Cache Reserve Clear operation started. StartTs time.Time `json:"start_ts,required" format:"date-time"` // The current state of the Cache Reserve Clear operation. - State CacheReserveClearResponseState `json:"state,required"` + State CacheReserveGetResponseState `json:"state,required"` // The time that the latest Cache Reserve Clear operation completed. - EndTs time.Time `json:"end_ts" format:"date-time"` - JSON cacheReserveClearResponseJSON `json:"-"` + EndTs time.Time `json:"end_ts" format:"date-time"` + JSON cacheReserveGetResponseJSON `json:"-"` } -// cacheReserveClearResponseJSON contains the JSON metadata for the struct -// [CacheReserveClearResponse] -type cacheReserveClearResponseJSON struct { +// cacheReserveGetResponseJSON contains the JSON metadata for the struct +// [CacheReserveGetResponse] +type cacheReserveGetResponseJSON struct { ID apijson.Field ModifiedOn apijson.Field StartTs apijson.Field @@ -142,23 +142,23 @@ type cacheReserveClearResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CacheReserveClearResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CacheReserveGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // ID of the zone setting. -type CacheReserveClearResponseID string +type CacheReserveGetResponseID string const ( - CacheReserveClearResponseIDCacheReserveClear CacheReserveClearResponseID = "cache_reserve_clear" + CacheReserveGetResponseIDCacheReserveClear CacheReserveGetResponseID = "cache_reserve_clear" ) // The current state of the Cache Reserve Clear operation. -type CacheReserveClearResponseState string +type CacheReserveGetResponseState string const ( - CacheReserveClearResponseStateInProgress CacheReserveClearResponseState = "In-progress" - CacheReserveClearResponseStateCompleted CacheReserveClearResponseState = "Completed" + CacheReserveGetResponseStateInProgress CacheReserveGetResponseState = "In-progress" + CacheReserveGetResponseStateCompleted CacheReserveGetResponseState = "Completed" ) type CacheReserveNewResponseEnvelope struct { @@ -234,22 +234,22 @@ const ( CacheReserveNewResponseEnvelopeSuccessTrue CacheReserveNewResponseEnvelopeSuccess = true ) -type CacheReserveClearResponseEnvelope struct { - Errors []CacheReserveClearResponseEnvelopeErrors `json:"errors,required"` - Messages []CacheReserveClearResponseEnvelopeMessages `json:"messages,required"` +type CacheReserveGetResponseEnvelope struct { + Errors []CacheReserveGetResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheReserveGetResponseEnvelopeMessages `json:"messages,required"` // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. - Result CacheReserveClearResponse `json:"result,required"` + Result CacheReserveGetResponse `json:"result,required"` // Whether the API call was successful - Success CacheReserveClearResponseEnvelopeSuccess `json:"success,required"` - JSON cacheReserveClearResponseEnvelopeJSON `json:"-"` + Success CacheReserveGetResponseEnvelopeSuccess `json:"success,required"` + JSON cacheReserveGetResponseEnvelopeJSON `json:"-"` } -// cacheReserveClearResponseEnvelopeJSON contains the JSON metadata for the struct -// [CacheReserveClearResponseEnvelope] -type cacheReserveClearResponseEnvelopeJSON struct { +// cacheReserveGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [CacheReserveGetResponseEnvelope] +type cacheReserveGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -258,51 +258,51 @@ type cacheReserveClearResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CacheReserveClearResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CacheReserveGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CacheReserveClearResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheReserveClearResponseEnvelopeErrorsJSON `json:"-"` +type CacheReserveGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheReserveGetResponseEnvelopeErrorsJSON `json:"-"` } -// cacheReserveClearResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CacheReserveClearResponseEnvelopeErrors] -type cacheReserveClearResponseEnvelopeErrorsJSON struct { +// cacheReserveGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CacheReserveGetResponseEnvelopeErrors] +type cacheReserveGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CacheReserveClearResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CacheReserveGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CacheReserveClearResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cacheReserveClearResponseEnvelopeMessagesJSON `json:"-"` +type CacheReserveGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheReserveGetResponseEnvelopeMessagesJSON `json:"-"` } -// cacheReserveClearResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CacheReserveClearResponseEnvelopeMessages] -type cacheReserveClearResponseEnvelopeMessagesJSON struct { +// cacheReserveGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CacheReserveGetResponseEnvelopeMessages] +type cacheReserveGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CacheReserveClearResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CacheReserveGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CacheReserveClearResponseEnvelopeSuccess bool +type CacheReserveGetResponseEnvelopeSuccess bool const ( - CacheReserveClearResponseEnvelopeSuccessTrue CacheReserveClearResponseEnvelopeSuccess = true + CacheReserveGetResponseEnvelopeSuccessTrue CacheReserveGetResponseEnvelopeSuccess = true ) diff --git a/cachereserve_test.go b/cachereserve_test.go index dd7b4c2a8c1..db4b34afcbc 100644 --- a/cachereserve_test.go +++ b/cachereserve_test.go @@ -29,7 +29,7 @@ func TestCacheReserveNew(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CacheReserves.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.CacheReserve.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestCacheReserveNew(t *testing.T) { } } -func TestCacheReserveClear(t *testing.T) { +func TestCacheReserveGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +55,7 @@ func TestCacheReserveClear(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CacheReserves.Clear(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.CacheReserve.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/cachetieredcachesmarttopology.go b/cachetieredcachesmarttopology.go new file mode 100644 index 00000000000..509d427b0c8 --- /dev/null +++ b/cachetieredcachesmarttopology.go @@ -0,0 +1,354 @@ +// File generated from our OpenAPI spec by Stainless. + +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" +) + +// CacheTieredCacheSmartTopologyService contains methods and other services that +// help with interacting with the cloudflare API. Note, unlike clients, this +// service does not read variables from the environment automatically. You should +// not instantiate this service directly, and instead use the +// [NewCacheTieredCacheSmartTopologyService] method instead. +type CacheTieredCacheSmartTopologyService struct { + Options []option.RequestOption +} + +// NewCacheTieredCacheSmartTopologyService generates a new service that applies the +// given options to each request. These options are applied after the parent +// client's options (if there is one), and before any request-specific options. +func NewCacheTieredCacheSmartTopologyService(opts ...option.RequestOption) (r *CacheTieredCacheSmartTopologyService) { + r = &CacheTieredCacheSmartTopologyService{} + r.Options = opts + return +} + +// Updates enablement of Tiered Cache +func (r *CacheTieredCacheSmartTopologyService) Update(ctx context.Context, zoneID string, body CacheTieredCacheSmartTopologyUpdateParams, opts ...option.RequestOption) (res *CacheTieredCacheSmartTopologyUpdateResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheTieredCacheSmartTopologyUpdateResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Remvoves enablement of Smart Tiered Cache +func (r *CacheTieredCacheSmartTopologyService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheTieredCacheSmartTopologyDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheTieredCacheSmartTopologyDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Get Smart Tiered Cache setting +func (r *CacheTieredCacheSmartTopologyService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheTieredCacheSmartTopologyGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env CacheTieredCacheSmartTopologyGetResponseEnvelope + path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [CacheTieredCacheSmartTopologyUpdateResponseUnknown] or +// [shared.UnionString]. +type CacheTieredCacheSmartTopologyUpdateResponse interface { + ImplementsCacheTieredCacheSmartTopologyUpdateResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CacheTieredCacheSmartTopologyUpdateResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +// Union satisfied by [CacheTieredCacheSmartTopologyDeleteResponseUnknown] or +// [shared.UnionString]. +type CacheTieredCacheSmartTopologyDeleteResponse interface { + ImplementsCacheTieredCacheSmartTopologyDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CacheTieredCacheSmartTopologyDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +// Union satisfied by [CacheTieredCacheSmartTopologyGetResponseUnknown] or +// [shared.UnionString]. +type CacheTieredCacheSmartTopologyGetResponse interface { + ImplementsCacheTieredCacheSmartTopologyGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CacheTieredCacheSmartTopologyGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type CacheTieredCacheSmartTopologyUpdateParams struct { + // Enables Tiered Cache. + Value param.Field[CacheTieredCacheSmartTopologyUpdateParamsValue] `json:"value,required"` +} + +func (r CacheTieredCacheSmartTopologyUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enables Tiered Cache. +type CacheTieredCacheSmartTopologyUpdateParamsValue string + +const ( + CacheTieredCacheSmartTopologyUpdateParamsValueOn CacheTieredCacheSmartTopologyUpdateParamsValue = "on" + CacheTieredCacheSmartTopologyUpdateParamsValueOff CacheTieredCacheSmartTopologyUpdateParamsValue = "off" +) + +type CacheTieredCacheSmartTopologyUpdateResponseEnvelope struct { + Errors []CacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessages `json:"messages,required"` + Result CacheTieredCacheSmartTopologyUpdateResponse `json:"result,required"` + // Whether the API call was successful + Success CacheTieredCacheSmartTopologyUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON cacheTieredCacheSmartTopologyUpdateResponseEnvelopeJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyUpdateResponseEnvelopeJSON contains the JSON +// metadata for the struct [CacheTieredCacheSmartTopologyUpdateResponseEnvelope] +type cacheTieredCacheSmartTopologyUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [CacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrors] +type cacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [CacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessages] +type cacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheTieredCacheSmartTopologyUpdateResponseEnvelopeSuccess bool + +const ( + CacheTieredCacheSmartTopologyUpdateResponseEnvelopeSuccessTrue CacheTieredCacheSmartTopologyUpdateResponseEnvelopeSuccess = true +) + +type CacheTieredCacheSmartTopologyDeleteResponseEnvelope struct { + Errors []CacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessages `json:"messages,required"` + Result CacheTieredCacheSmartTopologyDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success CacheTieredCacheSmartTopologyDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON cacheTieredCacheSmartTopologyDeleteResponseEnvelopeJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyDeleteResponseEnvelopeJSON contains the JSON +// metadata for the struct [CacheTieredCacheSmartTopologyDeleteResponseEnvelope] +type cacheTieredCacheSmartTopologyDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [CacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrors] +type cacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [CacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessages] +type cacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheTieredCacheSmartTopologyDeleteResponseEnvelopeSuccess bool + +const ( + CacheTieredCacheSmartTopologyDeleteResponseEnvelopeSuccessTrue CacheTieredCacheSmartTopologyDeleteResponseEnvelopeSuccess = true +) + +type CacheTieredCacheSmartTopologyGetResponseEnvelope struct { + Errors []CacheTieredCacheSmartTopologyGetResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheTieredCacheSmartTopologyGetResponseEnvelopeMessages `json:"messages,required"` + Result CacheTieredCacheSmartTopologyGetResponse `json:"result,required"` + // Whether the API call was successful + Success CacheTieredCacheSmartTopologyGetResponseEnvelopeSuccess `json:"success,required"` + JSON cacheTieredCacheSmartTopologyGetResponseEnvelopeJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [CacheTieredCacheSmartTopologyGetResponseEnvelope] +type cacheTieredCacheSmartTopologyGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [CacheTieredCacheSmartTopologyGetResponseEnvelopeErrors] +type cacheTieredCacheSmartTopologyGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CacheTieredCacheSmartTopologyGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheTieredCacheSmartTopologyGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// cacheTieredCacheSmartTopologyGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [CacheTieredCacheSmartTopologyGetResponseEnvelopeMessages] +type cacheTieredCacheSmartTopologyGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheTieredCacheSmartTopologyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CacheTieredCacheSmartTopologyGetResponseEnvelopeSuccess bool + +const ( + CacheTieredCacheSmartTopologyGetResponseEnvelopeSuccessTrue CacheTieredCacheSmartTopologyGetResponseEnvelopeSuccess = true +) diff --git a/customn_test.go b/cachetieredcachesmarttopology_test.go similarity index 79% rename from customn_test.go rename to cachetieredcachesmarttopology_test.go index bf928175841..f62149ff2b1 100644 --- a/customn_test.go +++ b/cachetieredcachesmarttopology_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomNNewWithOptionalParams(t *testing.T) { +func TestCacheTieredCacheSmartTopologyUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,11 @@ func TestCustomNNewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomNs.New( + _, err := client.Cache.TieredCacheSmartTopology.Update( context.TODO(), - "372e67954025e0ba6aaa6d586b9e0b59", - cloudflare.CustomNNewParams{ - NsName: cloudflare.F("ns1.example.com"), - NsSet: cloudflare.F(1.000000), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.CacheTieredCacheSmartTopologyUpdateParams{ + Value: cloudflare.F(cloudflare.CacheTieredCacheSmartTopologyUpdateParamsValueOn), }, ) if err != nil { @@ -46,7 +45,7 @@ func TestCustomNNewWithOptionalParams(t *testing.T) { } } -func TestCustomNList(t *testing.T) { +func TestCacheTieredCacheSmartTopologyDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,7 +61,7 @@ func TestCustomNList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomNs.List(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + _, err := client.Cache.TieredCacheSmartTopology.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -72,7 +71,7 @@ func TestCustomNList(t *testing.T) { } } -func TestCustomNDelete(t *testing.T) { +func TestCacheTieredCacheSmartTopologyGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -88,11 +87,7 @@ func TestCustomNDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomNs.Delete( - context.TODO(), - "372e67954025e0ba6aaa6d586b9e0b59", - "ns1.example.com", - ) + _, err := client.Cache.TieredCacheSmartTopology.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/cachvariant.go b/cachevariant.go similarity index 54% rename from cachvariant.go rename to cachevariant.go index 5f33b1d6296..0fe6873a1e2 100644 --- a/cachvariant.go +++ b/cachevariant.go @@ -14,20 +14,20 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -// CachVariantService contains methods and other services that help with +// CacheVariantService contains methods and other services that help with // interacting with the cloudflare API. Note, unlike clients, this service does not // read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCachVariantService] method +// this service directly, and instead use the [NewCacheVariantService] method // instead. -type CachVariantService struct { +type CacheVariantService struct { Options []option.RequestOption } -// NewCachVariantService generates a new service that applies the given options to +// NewCacheVariantService generates a new service that applies the given options to // each request. These options are applied after the parent client's options (if // there is one), and before any request-specific options. -func NewCachVariantService(opts ...option.RequestOption) (r *CachVariantService) { - r = &CachVariantService{} +func NewCacheVariantService(opts ...option.RequestOption) (r *CacheVariantService) { + r = &CacheVariantService{} r.Options = opts return } @@ -37,11 +37,11 @@ func NewCachVariantService(opts ...option.RequestOption) (r *CachVariantService) // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -func (r *CachVariantService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CachVariantListResponse, err error) { +func (r *CacheVariantService) Update(ctx context.Context, zoneID string, body CacheVariantUpdateParams, opts ...option.RequestOption) (res *CacheVariantUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env CachVariantListResponseEnvelope + var env CacheVariantUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/cache/variants", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -54,11 +54,11 @@ func (r *CachVariantService) List(ctx context.Context, zoneID string, opts ...op // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -func (r *CachVariantService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CachVariantDeleteResponse, err error) { +func (r *CacheVariantService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheVariantListResponse, err error) { opts = append(r.Options[:], opts...) - var env CachVariantDeleteResponseEnvelope + var env CacheVariantListResponseEnvelope path := fmt.Sprintf("zones/%s/cache/variants", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -71,11 +71,11 @@ func (r *CachVariantService) Delete(ctx context.Context, zoneID string, opts ... // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -func (r *CachVariantService) ZoneCacheSettingsChangeVariantsSetting(ctx context.Context, zoneID string, body CachVariantZoneCacheSettingsChangeVariantsSettingParams, opts ...option.RequestOption) (res *CachVariantZoneCacheSettingsChangeVariantsSettingResponse, err error) { +func (r *CacheVariantService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CacheVariantDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelope + var env CacheVariantDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/cache/variants", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -88,19 +88,19 @@ func (r *CachVariantService) ZoneCacheSettingsChangeVariantsSetting(ctx context. // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -type CachVariantListResponse struct { +type CacheVariantUpdateResponse struct { // ID of the zone setting. - ID CachVariantListResponseID `json:"id,required"` + ID CacheVariantUpdateResponseID `json:"id,required"` // last time this setting was modified. ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` // Value of the zone setting. - Value CachVariantListResponseValue `json:"value,required"` - JSON cachVariantListResponseJSON `json:"-"` + Value CacheVariantUpdateResponseValue `json:"value,required"` + JSON cacheVariantUpdateResponseJSON `json:"-"` } -// cachVariantListResponseJSON contains the JSON metadata for the struct -// [CachVariantListResponse] -type cachVariantListResponseJSON struct { +// cacheVariantUpdateResponseJSON contains the JSON metadata for the struct +// [CacheVariantUpdateResponse] +type cacheVariantUpdateResponseJSON struct { ID apijson.Field ModifiedOn apijson.Field Value apijson.Field @@ -108,19 +108,19 @@ type cachVariantListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // ID of the zone setting. -type CachVariantListResponseID string +type CacheVariantUpdateResponseID string const ( - CachVariantListResponseIDVariants CachVariantListResponseID = "variants" + CacheVariantUpdateResponseIDVariants CacheVariantUpdateResponseID = "variants" ) // Value of the zone setting. -type CachVariantListResponseValue struct { +type CacheVariantUpdateResponseValue struct { // List of strings with the MIME types of all the variants that should be served // for avif. Avif []interface{} `json:"avif"` @@ -153,13 +153,13 @@ type CachVariantListResponseValue struct { Tiff []interface{} `json:"tiff"` // List of strings with the MIME types of all the variants that should be served // for webp. - Webp []interface{} `json:"webp"` - JSON cachVariantListResponseValueJSON `json:"-"` + Webp []interface{} `json:"webp"` + JSON cacheVariantUpdateResponseValueJSON `json:"-"` } -// cachVariantListResponseValueJSON contains the JSON metadata for the struct -// [CachVariantListResponseValue] -type cachVariantListResponseValueJSON struct { +// cacheVariantUpdateResponseValueJSON contains the JSON metadata for the struct +// [CacheVariantUpdateResponseValue] +type cacheVariantUpdateResponseValueJSON struct { Avif apijson.Field Bmp apijson.Field Gif apijson.Field @@ -175,62 +175,28 @@ type cachVariantListResponseValueJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantListResponseValue) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Variant support enables caching variants of images with certain file extensions -// in addition to the original. This only applies when the origin server sends the -// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but -// does not serve the variant requested, the response will not be cached. This will -// be indicated with BYPASS cache status in the response headers. -type CachVariantDeleteResponse struct { - // ID of the zone setting. - ID CachVariantDeleteResponseID `json:"id,required"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` - JSON cachVariantDeleteResponseJSON `json:"-"` -} - -// cachVariantDeleteResponseJSON contains the JSON metadata for the struct -// [CachVariantDeleteResponse] -type cachVariantDeleteResponseJSON struct { - ID apijson.Field - ModifiedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachVariantDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantUpdateResponseValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// ID of the zone setting. -type CachVariantDeleteResponseID string - -const ( - CachVariantDeleteResponseIDVariants CachVariantDeleteResponseID = "variants" -) - // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -type CachVariantZoneCacheSettingsChangeVariantsSettingResponse struct { +type CacheVariantListResponse struct { // ID of the zone setting. - ID CachVariantZoneCacheSettingsChangeVariantsSettingResponseID `json:"id,required"` + ID CacheVariantListResponseID `json:"id,required"` // last time this setting was modified. ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` // Value of the zone setting. - Value CachVariantZoneCacheSettingsChangeVariantsSettingResponseValue `json:"value,required"` - JSON cachVariantZoneCacheSettingsChangeVariantsSettingResponseJSON `json:"-"` + Value CacheVariantListResponseValue `json:"value,required"` + JSON cacheVariantListResponseJSON `json:"-"` } -// cachVariantZoneCacheSettingsChangeVariantsSettingResponseJSON contains the JSON -// metadata for the struct -// [CachVariantZoneCacheSettingsChangeVariantsSettingResponse] -type cachVariantZoneCacheSettingsChangeVariantsSettingResponseJSON struct { +// cacheVariantListResponseJSON contains the JSON metadata for the struct +// [CacheVariantListResponse] +type cacheVariantListResponseJSON struct { ID apijson.Field ModifiedOn apijson.Field Value apijson.Field @@ -238,19 +204,19 @@ type cachVariantZoneCacheSettingsChangeVariantsSettingResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantZoneCacheSettingsChangeVariantsSettingResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // ID of the zone setting. -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseID string +type CacheVariantListResponseID string const ( - CachVariantZoneCacheSettingsChangeVariantsSettingResponseIDVariants CachVariantZoneCacheSettingsChangeVariantsSettingResponseID = "variants" + CacheVariantListResponseIDVariants CacheVariantListResponseID = "variants" ) // Value of the zone setting. -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseValue struct { +type CacheVariantListResponseValue struct { // List of strings with the MIME types of all the variants that should be served // for avif. Avif []interface{} `json:"avif"` @@ -283,14 +249,13 @@ type CachVariantZoneCacheSettingsChangeVariantsSettingResponseValue struct { Tiff []interface{} `json:"tiff"` // List of strings with the MIME types of all the variants that should be served // for webp. - Webp []interface{} `json:"webp"` - JSON cachVariantZoneCacheSettingsChangeVariantsSettingResponseValueJSON `json:"-"` + Webp []interface{} `json:"webp"` + JSON cacheVariantListResponseValueJSON `json:"-"` } -// cachVariantZoneCacheSettingsChangeVariantsSettingResponseValueJSON contains the -// JSON metadata for the struct -// [CachVariantZoneCacheSettingsChangeVariantsSettingResponseValue] -type cachVariantZoneCacheSettingsChangeVariantsSettingResponseValueJSON struct { +// cacheVariantListResponseValueJSON contains the JSON metadata for the struct +// [CacheVariantListResponseValue] +type cacheVariantListResponseValueJSON struct { Avif apijson.Field Bmp apijson.Field Gif apijson.Field @@ -306,27 +271,110 @@ type cachVariantZoneCacheSettingsChangeVariantsSettingResponseValueJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantZoneCacheSettingsChangeVariantsSettingResponseValue) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantListResponseValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantListResponseEnvelope struct { - Errors []CachVariantListResponseEnvelopeErrors `json:"errors,required"` - Messages []CachVariantListResponseEnvelopeMessages `json:"messages,required"` +// Variant support enables caching variants of images with certain file extensions +// in addition to the original. This only applies when the origin server sends the +// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but +// does not serve the variant requested, the response will not be cached. This will +// be indicated with BYPASS cache status in the response headers. +type CacheVariantDeleteResponse struct { + // ID of the zone setting. + ID CacheVariantDeleteResponseID `json:"id,required"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"` + JSON cacheVariantDeleteResponseJSON `json:"-"` +} + +// cacheVariantDeleteResponseJSON contains the JSON metadata for the struct +// [CacheVariantDeleteResponse] +type cacheVariantDeleteResponseJSON struct { + ID apijson.Field + ModifiedOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CacheVariantDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type CacheVariantDeleteResponseID string + +const ( + CacheVariantDeleteResponseIDVariants CacheVariantDeleteResponseID = "variants" +) + +type CacheVariantUpdateParams struct { + // Value of the zone setting. + Value param.Field[CacheVariantUpdateParamsValue] `json:"value,required"` +} + +func (r CacheVariantUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Value of the zone setting. +type CacheVariantUpdateParamsValue struct { + // List of strings with the MIME types of all the variants that should be served + // for avif. + Avif param.Field[[]interface{}] `json:"avif"` + // List of strings with the MIME types of all the variants that should be served + // for bmp. + Bmp param.Field[[]interface{}] `json:"bmp"` + // List of strings with the MIME types of all the variants that should be served + // for gif. + Gif param.Field[[]interface{}] `json:"gif"` + // List of strings with the MIME types of all the variants that should be served + // for jp2. + Jp2 param.Field[[]interface{}] `json:"jp2"` + // List of strings with the MIME types of all the variants that should be served + // for jpeg. + Jpeg param.Field[[]interface{}] `json:"jpeg"` + // List of strings with the MIME types of all the variants that should be served + // for jpg. + Jpg param.Field[[]interface{}] `json:"jpg"` + // List of strings with the MIME types of all the variants that should be served + // for jpg2. + Jpg2 param.Field[[]interface{}] `json:"jpg2"` + // List of strings with the MIME types of all the variants that should be served + // for png. + Png param.Field[[]interface{}] `json:"png"` + // List of strings with the MIME types of all the variants that should be served + // for tif. + Tif param.Field[[]interface{}] `json:"tif"` + // List of strings with the MIME types of all the variants that should be served + // for tiff. + Tiff param.Field[[]interface{}] `json:"tiff"` + // List of strings with the MIME types of all the variants that should be served + // for webp. + Webp param.Field[[]interface{}] `json:"webp"` +} + +func (r CacheVariantUpdateParamsValue) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CacheVariantUpdateResponseEnvelope struct { + Errors []CacheVariantUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheVariantUpdateResponseEnvelopeMessages `json:"messages,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result CachVariantListResponse `json:"result,required"` + Result CacheVariantUpdateResponse `json:"result,required"` // Whether the API call was successful - Success CachVariantListResponseEnvelopeSuccess `json:"success,required"` - JSON cachVariantListResponseEnvelopeJSON `json:"-"` + Success CacheVariantUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON cacheVariantUpdateResponseEnvelopeJSON `json:"-"` } -// cachVariantListResponseEnvelopeJSON contains the JSON metadata for the struct -// [CachVariantListResponseEnvelope] -type cachVariantListResponseEnvelopeJSON struct { +// cacheVariantUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [CacheVariantUpdateResponseEnvelope] +type cacheVariantUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -335,72 +383,72 @@ type cachVariantListResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantListResponseEnvelopeErrorsJSON `json:"-"` +type CacheVariantUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// cachVariantListResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CachVariantListResponseEnvelopeErrors] -type cachVariantListResponseEnvelopeErrorsJSON struct { +// cacheVariantUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CacheVariantUpdateResponseEnvelopeErrors] +type cacheVariantUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantListResponseEnvelopeMessagesJSON `json:"-"` +type CacheVariantUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// cachVariantListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CachVariantListResponseEnvelopeMessages] -type cachVariantListResponseEnvelopeMessagesJSON struct { +// cacheVariantUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CacheVariantUpdateResponseEnvelopeMessages] +type cacheVariantUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CachVariantListResponseEnvelopeSuccess bool +type CacheVariantUpdateResponseEnvelopeSuccess bool const ( - CachVariantListResponseEnvelopeSuccessTrue CachVariantListResponseEnvelopeSuccess = true + CacheVariantUpdateResponseEnvelopeSuccessTrue CacheVariantUpdateResponseEnvelopeSuccess = true ) -type CachVariantDeleteResponseEnvelope struct { - Errors []CachVariantDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CachVariantDeleteResponseEnvelopeMessages `json:"messages,required"` +type CacheVariantListResponseEnvelope struct { + Errors []CacheVariantListResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheVariantListResponseEnvelopeMessages `json:"messages,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result CachVariantDeleteResponse `json:"result,required"` + Result CacheVariantListResponse `json:"result,required"` // Whether the API call was successful - Success CachVariantDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON cachVariantDeleteResponseEnvelopeJSON `json:"-"` + Success CacheVariantListResponseEnvelopeSuccess `json:"success,required"` + JSON cacheVariantListResponseEnvelopeJSON `json:"-"` } -// cachVariantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [CachVariantDeleteResponseEnvelope] -type cachVariantDeleteResponseEnvelopeJSON struct { +// cacheVariantListResponseEnvelopeJSON contains the JSON metadata for the struct +// [CacheVariantListResponseEnvelope] +type cacheVariantListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -409,123 +457,72 @@ type cachVariantDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CachVariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantDeleteResponseEnvelopeErrorsJSON `json:"-"` +type CacheVariantListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantListResponseEnvelopeErrorsJSON `json:"-"` } -// cachVariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CachVariantDeleteResponseEnvelopeErrors] -type cachVariantDeleteResponseEnvelopeErrorsJSON struct { +// cacheVariantListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CacheVariantListResponseEnvelopeErrors] +type cacheVariantListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantDeleteResponseEnvelopeMessagesJSON `json:"-"` +type CacheVariantListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantListResponseEnvelopeMessagesJSON `json:"-"` } -// cachVariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CachVariantDeleteResponseEnvelopeMessages] -type cachVariantDeleteResponseEnvelopeMessagesJSON struct { +// cacheVariantListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CacheVariantListResponseEnvelopeMessages] +type cacheVariantListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CachVariantDeleteResponseEnvelopeSuccess bool +type CacheVariantListResponseEnvelopeSuccess bool const ( - CachVariantDeleteResponseEnvelopeSuccessTrue CachVariantDeleteResponseEnvelopeSuccess = true + CacheVariantListResponseEnvelopeSuccessTrue CacheVariantListResponseEnvelopeSuccess = true ) -type CachVariantZoneCacheSettingsChangeVariantsSettingParams struct { - // Value of the zone setting. - Value param.Field[CachVariantZoneCacheSettingsChangeVariantsSettingParamsValue] `json:"value,required"` -} - -func (r CachVariantZoneCacheSettingsChangeVariantsSettingParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Value of the zone setting. -type CachVariantZoneCacheSettingsChangeVariantsSettingParamsValue struct { - // List of strings with the MIME types of all the variants that should be served - // for avif. - Avif param.Field[[]interface{}] `json:"avif"` - // List of strings with the MIME types of all the variants that should be served - // for bmp. - Bmp param.Field[[]interface{}] `json:"bmp"` - // List of strings with the MIME types of all the variants that should be served - // for gif. - Gif param.Field[[]interface{}] `json:"gif"` - // List of strings with the MIME types of all the variants that should be served - // for jp2. - Jp2 param.Field[[]interface{}] `json:"jp2"` - // List of strings with the MIME types of all the variants that should be served - // for jpeg. - Jpeg param.Field[[]interface{}] `json:"jpeg"` - // List of strings with the MIME types of all the variants that should be served - // for jpg. - Jpg param.Field[[]interface{}] `json:"jpg"` - // List of strings with the MIME types of all the variants that should be served - // for jpg2. - Jpg2 param.Field[[]interface{}] `json:"jpg2"` - // List of strings with the MIME types of all the variants that should be served - // for png. - Png param.Field[[]interface{}] `json:"png"` - // List of strings with the MIME types of all the variants that should be served - // for tif. - Tif param.Field[[]interface{}] `json:"tif"` - // List of strings with the MIME types of all the variants that should be served - // for tiff. - Tiff param.Field[[]interface{}] `json:"tiff"` - // List of strings with the MIME types of all the variants that should be served - // for webp. - Webp param.Field[[]interface{}] `json:"webp"` -} - -func (r CachVariantZoneCacheSettingsChangeVariantsSettingParamsValue) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelope struct { - Errors []CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessages `json:"messages,required"` +type CacheVariantDeleteResponseEnvelope struct { + Errors []CacheVariantDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []CacheVariantDeleteResponseEnvelopeMessages `json:"messages,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result CachVariantZoneCacheSettingsChangeVariantsSettingResponse `json:"result,required"` + Result CacheVariantDeleteResponse `json:"result,required"` // Whether the API call was successful - Success CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeSuccess `json:"success,required"` - JSON cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeJSON `json:"-"` + Success CacheVariantDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON cacheVariantDeleteResponseEnvelopeJSON `json:"-"` } -// cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelope] -type cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeJSON struct { +// cacheVariantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [CacheVariantDeleteResponseEnvelope] +type cacheVariantDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -534,53 +531,51 @@ type cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrorsJSON `json:"-"` +type CacheVariantDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrors] -type cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrorsJSON struct { +// cacheVariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CacheVariantDeleteResponseEnvelopeErrors] +type cacheVariantDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessagesJSON `json:"-"` +type CacheVariantDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON cacheVariantDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessages] -type cachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessagesJSON struct { +// cacheVariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CacheVariantDeleteResponseEnvelopeMessages] +type cacheVariantDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CacheVariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeSuccess bool +type CacheVariantDeleteResponseEnvelopeSuccess bool const ( - CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeSuccessTrue CachVariantZoneCacheSettingsChangeVariantsSettingResponseEnvelopeSuccess = true + CacheVariantDeleteResponseEnvelopeSuccessTrue CacheVariantDeleteResponseEnvelopeSuccess = true ) diff --git a/cachvariant_test.go b/cachevariant_test.go similarity index 84% rename from cachvariant_test.go rename to cachevariant_test.go index f0121c5451e..adf0be35d7a 100644 --- a/cachvariant_test.go +++ b/cachevariant_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCachVariantList(t *testing.T) { +func TestCacheVariantUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,25 @@ func TestCachVariantList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.Variants.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Cache.Variants.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.CacheVariantUpdateParams{ + Value: cloudflare.F(cloudflare.CacheVariantUpdateParamsValue{ + Avif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), + Bmp: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), + Gif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), + Jp2: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Jpeg: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Jpg: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Jpg2: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Png: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Tif: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Tiff: cloudflare.F([]interface{}{"image/webp", "image/avif"}), + Webp: cloudflare.F([]interface{}{"image/jpeg", "image/avif"}), + }), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +57,7 @@ func TestCachVariantList(t *testing.T) { } } -func TestCachVariantDelete(t *testing.T) { +func TestCacheVariantList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +73,7 @@ func TestCachVariantDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.Variants.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Cache.Variants.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +83,7 @@ func TestCachVariantDelete(t *testing.T) { } } -func TestCachVariantZoneCacheSettingsChangeVariantsSettingWithOptionalParams(t *testing.T) { +func TestCacheVariantDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,25 +99,7 @@ func TestCachVariantZoneCacheSettingsChangeVariantsSettingWithOptionalParams(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.Variants.ZoneCacheSettingsChangeVariantsSetting( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CachVariantZoneCacheSettingsChangeVariantsSettingParams{ - Value: cloudflare.F(cloudflare.CachVariantZoneCacheSettingsChangeVariantsSettingParamsValue{ - Avif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), - Bmp: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), - Gif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}), - Jp2: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Jpeg: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Jpg: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Jpg2: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Png: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Tif: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Tiff: cloudflare.F([]interface{}{"image/webp", "image/avif"}), - Webp: cloudflare.F([]interface{}{"image/jpeg", "image/avif"}), - }), - }, - ) + _, err := client.Cache.Variants.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/cachtieredcachesmarttopologyenable.go b/cachtieredcachesmarttopologyenable.go deleted file mode 100644 index 3403a5368bb..00000000000 --- a/cachtieredcachesmarttopologyenable.go +++ /dev/null @@ -1,361 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -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" -) - -// CachTieredCacheSmartTopologyEnableService contains methods and other services -// that help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewCachTieredCacheSmartTopologyEnableService] method instead. -type CachTieredCacheSmartTopologyEnableService struct { - Options []option.RequestOption -} - -// NewCachTieredCacheSmartTopologyEnableService generates a new service that -// applies the given options to each request. These options are applied after the -// parent client's options (if there is one), and before any request-specific -// options. -func NewCachTieredCacheSmartTopologyEnableService(opts ...option.RequestOption) (r *CachTieredCacheSmartTopologyEnableService) { - r = &CachTieredCacheSmartTopologyEnableService{} - r.Options = opts - return -} - -// Remvoves enablement of Smart Tiered Cache -func (r *CachTieredCacheSmartTopologyEnableService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CachTieredCacheSmartTopologyEnableDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env CachTieredCacheSmartTopologyEnableDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get Smart Tiered Cache setting -func (r *CachTieredCacheSmartTopologyEnableService) SmartTieredCacheGetSmartTieredCacheSetting(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse, err error) { - opts = append(r.Options[:], opts...) - var env CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Updates enablement of Tiered Cache -func (r *CachTieredCacheSmartTopologyEnableService) SmartTieredCachePatchSmartTieredCacheSetting(ctx context.Context, zoneID string, body CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParams, opts ...option.RequestOption) (res *CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse, err error) { - opts = append(r.Options[:], opts...) - var env CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [CachTieredCacheSmartTopologyEnableDeleteResponseUnknown] or -// [shared.UnionString]. -type CachTieredCacheSmartTopologyEnableDeleteResponse interface { - ImplementsCachTieredCacheSmartTopologyEnableDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CachTieredCacheSmartTopologyEnableDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -// Union satisfied by -// [CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseUnknown] -// or [shared.UnionString]. -type CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse interface { - ImplementsCachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -// Union satisfied by -// [CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseUnknown] -// or [shared.UnionString]. -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse interface { - ImplementsCachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CachTieredCacheSmartTopologyEnableDeleteResponseEnvelope struct { - Errors []CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessages `json:"messages,required"` - Result CachTieredCacheSmartTopologyEnableDeleteResponse `json:"result,required"` - // Whether the API call was successful - Success CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [CachTieredCacheSmartTopologyEnableDeleteResponseEnvelope] -type cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrors] -type cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessages] -type cachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeSuccess bool - -const ( - CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeSuccessTrue CachTieredCacheSmartTopologyEnableDeleteResponseEnvelopeSuccess = true -) - -type CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelope struct { - Errors []CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessages `json:"messages,required"` - Result CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse `json:"result,required"` - // Whether the API call was successful - Success CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeSuccess `json:"success,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelope] -type cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrorsJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrors] -type cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessagesJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessages] -type cachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeSuccess bool - -const ( - CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeSuccessTrue CachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponseEnvelopeSuccess = true -) - -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParams struct { - // Enables Tiered Cache. - Value param.Field[CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValue] `json:"value,required"` -} - -func (r CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enables Tiered Cache. -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValue string - -const ( - CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValueOn CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValue = "on" - CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValueOff CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValue = "off" -) - -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelope struct { - Errors []CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessages `json:"messages,required"` - Result CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse `json:"result,required"` - // Whether the API call was successful - Success CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeSuccess `json:"success,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelope] -type cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrorsJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrors] -type cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessagesJSON `json:"-"` -} - -// cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessages] -type cachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeSuccess bool - -const ( - CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeSuccessTrue CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponseEnvelopeSuccess = true -) diff --git a/call.go b/call.go index 7dd0f9c2d09..6bd67073f0c 100644 --- a/call.go +++ b/call.go @@ -45,19 +45,6 @@ func (r *CallService) New(ctx context.Context, accountID string, body CallNewPar return } -// Edit details for a single app. -func (r *CallService) Update(ctx context.Context, accountID string, appID string, body CallUpdateParams, opts ...option.RequestOption) (res *CallUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env CallUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/calls/apps/%s", accountID, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists all apps in the Cloudflare account func (r *CallService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]CallListResponse, err error) { opts = append(r.Options[:], opts...) @@ -97,6 +84,19 @@ func (r *CallService) Get(ctx context.Context, accountID string, appID string, o return } +// Edit details for a single app. +func (r *CallService) Replace(ctx context.Context, accountID string, appID string, body CallReplaceParams, opts ...option.RequestOption) (res *CallReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env CallReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/calls/apps/%s", accountID, appID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type CallNewResponse struct { // The date and time the item was created. Created time.Time `json:"created" format:"date-time"` @@ -126,33 +126,6 @@ func (r *CallNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CallUpdateResponse struct { - // The date and time the item was created. - Created time.Time `json:"created" format:"date-time"` - // The date and time the item was last modified. - Modified time.Time `json:"modified" format:"date-time"` - // A short description of Calls app, not shown to end users. - Name string `json:"name"` - // A Cloudflare-generated unique identifier for a item. - Uid string `json:"uid"` - JSON callUpdateResponseJSON `json:"-"` -} - -// callUpdateResponseJSON contains the JSON metadata for the struct -// [CallUpdateResponse] -type callUpdateResponseJSON struct { - Created apijson.Field - Modified apijson.Field - Name apijson.Field - Uid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CallUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type CallListResponse struct { // The date and time the item was created. Created time.Time `json:"created" format:"date-time"` @@ -233,6 +206,33 @@ func (r *CallGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type CallReplaceResponse struct { + // The date and time the item was created. + Created time.Time `json:"created" format:"date-time"` + // The date and time the item was last modified. + Modified time.Time `json:"modified" format:"date-time"` + // A short description of Calls app, not shown to end users. + Name string `json:"name"` + // A Cloudflare-generated unique identifier for a item. + Uid string `json:"uid"` + JSON callReplaceResponseJSON `json:"-"` +} + +// callReplaceResponseJSON contains the JSON metadata for the struct +// [CallReplaceResponse] +type callReplaceResponseJSON struct { + Created apijson.Field + Modified apijson.Field + Name apijson.Field + Uid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CallReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type CallNewParams struct { // A short description of Calls app, not shown to end users. Name param.Field[string] `json:"name"` @@ -311,84 +311,6 @@ const ( CallNewResponseEnvelopeSuccessTrue CallNewResponseEnvelopeSuccess = true ) -type CallUpdateParams struct { - // A short description of Calls app, not shown to end users. - Name param.Field[string] `json:"name"` -} - -func (r CallUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CallUpdateResponseEnvelope struct { - Errors []CallUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []CallUpdateResponseEnvelopeMessages `json:"messages,required"` - Result CallUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success CallUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON callUpdateResponseEnvelopeJSON `json:"-"` -} - -// callUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [CallUpdateResponseEnvelope] -type callUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CallUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CallUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON callUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// callUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [CallUpdateResponseEnvelopeErrors] -type callUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CallUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CallUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON callUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// callUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [CallUpdateResponseEnvelopeMessages] -type callUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CallUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CallUpdateResponseEnvelopeSuccess bool - -const ( - CallUpdateResponseEnvelopeSuccessTrue CallUpdateResponseEnvelopeSuccess = true -) - type CallListResponseEnvelope struct { Errors []CallListResponseEnvelopeErrors `json:"errors,required"` Messages []CallListResponseEnvelopeMessages `json:"messages,required"` @@ -595,3 +517,81 @@ type CallGetResponseEnvelopeSuccess bool const ( CallGetResponseEnvelopeSuccessTrue CallGetResponseEnvelopeSuccess = true ) + +type CallReplaceParams struct { + // A short description of Calls app, not shown to end users. + Name param.Field[string] `json:"name"` +} + +func (r CallReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CallReplaceResponseEnvelope struct { + Errors []CallReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []CallReplaceResponseEnvelopeMessages `json:"messages,required"` + Result CallReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success CallReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON callReplaceResponseEnvelopeJSON `json:"-"` +} + +// callReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [CallReplaceResponseEnvelope] +type callReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CallReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CallReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON callReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// callReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [CallReplaceResponseEnvelopeErrors] +type callReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CallReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CallReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON callReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// callReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CallReplaceResponseEnvelopeMessages] +type callReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CallReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CallReplaceResponseEnvelopeSuccess bool + +const ( + CallReplaceResponseEnvelopeSuccessTrue CallReplaceResponseEnvelopeSuccess = true +) diff --git a/call_test.go b/call_test.go index 91b95aa6bd2..36cd05232f9 100644 --- a/call_test.go +++ b/call_test.go @@ -45,7 +45,7 @@ func TestCallNewWithOptionalParams(t *testing.T) { } } -func TestCallUpdateWithOptionalParams(t *testing.T) { +func TestCallList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,14 +61,7 @@ func TestCallUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Calls.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "2a95132c15732412d22c1476fa83f27a", - cloudflare.CallUpdateParams{ - Name: cloudflare.F("production-realtime-app"), - }, - ) + _, err := client.Calls.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -78,7 +71,7 @@ func TestCallUpdateWithOptionalParams(t *testing.T) { } } -func TestCallList(t *testing.T) { +func TestCallDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,7 +87,11 @@ func TestCallList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Calls.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Calls.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "2a95132c15732412d22c1476fa83f27a", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -104,7 +101,7 @@ func TestCallList(t *testing.T) { } } -func TestCallDelete(t *testing.T) { +func TestCallGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -120,7 +117,7 @@ func TestCallDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Calls.Delete( + _, err := client.Calls.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2a95132c15732412d22c1476fa83f27a", @@ -134,7 +131,7 @@ func TestCallDelete(t *testing.T) { } } -func TestCallGet(t *testing.T) { +func TestCallReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -150,10 +147,13 @@ func TestCallGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Calls.Get( + _, err := client.Calls.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2a95132c15732412d22c1476fa83f27a", + cloudflare.CallReplaceParams{ + Name: cloudflare.F("production-realtime-app"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/certificate.go b/certificate.go index 158c1c2591c..58ed9caa0fa 100644 --- a/certificate.go +++ b/certificate.go @@ -35,14 +35,13 @@ func NewCertificateService(opts ...option.RequestOption) (r *CertificateService) return } -// Revoke an existing Origin CA certificate by its serial number. Use your Origin -// CA Key as your User Service Key when calling this endpoint -// ([see above](#requests)). -func (r *CertificateService) Delete(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *CertificateDeleteResponse, err error) { +// Create an Origin CA certificate. Use your Origin CA Key as your User Service Key +// when calling this endpoint ([see above](#requests)). +func (r *CertificateService) New(ctx context.Context, body CertificateNewParams, opts ...option.RequestOption) (res *CertificateNewResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateDeleteResponseEnvelope - path := fmt.Sprintf("certificates/%s", certificateID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env CertificateNewResponseEnvelope + path := "certificates" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -50,14 +49,14 @@ func (r *CertificateService) Delete(ctx context.Context, certificateID string, o return } -// Get an existing Origin CA certificate by its serial number. Use your Origin CA +// List all existing Origin CA certificates for a given zone. Use your Origin CA // Key as your User Service Key when calling this endpoint // ([see above](#requests)). -func (r *CertificateService) Get(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *CertificateGetResponse, err error) { +func (r *CertificateService) List(ctx context.Context, query CertificateListParams, opts ...option.RequestOption) (res *[]CertificateListResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateGetResponseEnvelope - path := fmt.Sprintf("certificates/%s", certificateID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env CertificateListResponseEnvelope + path := "certificates" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -65,13 +64,14 @@ func (r *CertificateService) Get(ctx context.Context, certificateID string, opts return } -// Create an Origin CA certificate. Use your Origin CA Key as your User Service Key -// when calling this endpoint ([see above](#requests)). -func (r *CertificateService) OriginCaNewCertificate(ctx context.Context, body CertificateOriginCaNewCertificateParams, opts ...option.RequestOption) (res *CertificateOriginCaNewCertificateResponse, err error) { +// Revoke an existing Origin CA certificate by its serial number. Use your Origin +// CA Key as your User Service Key when calling this endpoint +// ([see above](#requests)). +func (r *CertificateService) Delete(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *CertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateOriginCaNewCertificateResponseEnvelope - path := "certificates" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env CertificateDeleteResponseEnvelope + path := fmt.Sprintf("certificates/%s", certificateID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -79,14 +79,14 @@ func (r *CertificateService) OriginCaNewCertificate(ctx context.Context, body Ce return } -// List all existing Origin CA certificates for a given zone. Use your Origin CA +// Get an existing Origin CA certificate by its serial number. Use your Origin CA // Key as your User Service Key when calling this endpoint // ([see above](#requests)). -func (r *CertificateService) OriginCaListCertificates(ctx context.Context, query CertificateOriginCaListCertificatesParams, opts ...option.RequestOption) (res *[]CertificateOriginCaListCertificatesResponse, err error) { +func (r *CertificateService) Get(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *CertificateGetResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateOriginCaListCertificatesResponseEnvelope - path := "certificates" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env CertificateGetResponseEnvelope + path := fmt.Sprintf("certificates/%s", certificateID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -94,6 +94,83 @@ func (r *CertificateService) OriginCaListCertificates(ctx context.Context, query return } +// Union satisfied by [CertificateNewResponseUnknown] or [shared.UnionString]. +type CertificateNewResponse interface { + ImplementsCertificateNewResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CertificateNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type CertificateListResponse struct { + // The Certificate Signing Request (CSR). Must be newline-encoded. + Csr string `json:"csr,required"` + // Array of hostnames or wildcard names (e.g., \*.example.com) bound to the + // certificate. + Hostnames []interface{} `json:"hostnames,required"` + // Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), + // or "keyless-certificate" (for Keyless SSL servers). + RequestType CertificateListResponseRequestType `json:"request_type,required"` + // The number of days for which the certificate should be valid. + RequestedValidity CertificateListResponseRequestedValidity `json:"requested_validity,required"` + // Identifier + ID string `json:"id"` + // The Origin CA certificate. Will be newline-encoded. + Certificate string `json:"certificate"` + // When the certificate will expire. + ExpiresOn time.Time `json:"expires_on" format:"date-time"` + JSON certificateListResponseJSON `json:"-"` +} + +// certificateListResponseJSON contains the JSON metadata for the struct +// [CertificateListResponse] +type certificateListResponseJSON struct { + Csr apijson.Field + Hostnames apijson.Field + RequestType apijson.Field + RequestedValidity apijson.Field + ID apijson.Field + Certificate apijson.Field + ExpiresOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CertificateListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), +// or "keyless-certificate" (for Keyless SSL servers). +type CertificateListResponseRequestType string + +const ( + CertificateListResponseRequestTypeOriginRsa CertificateListResponseRequestType = "origin-rsa" + CertificateListResponseRequestTypeOriginEcc CertificateListResponseRequestType = "origin-ecc" + CertificateListResponseRequestTypeKeylessCertificate CertificateListResponseRequestType = "keyless-certificate" +) + +// The number of days for which the certificate should be valid. +type CertificateListResponseRequestedValidity float64 + +const ( + CertificateListResponseRequestedValidity7 CertificateListResponseRequestedValidity = 7 + CertificateListResponseRequestedValidity30 CertificateListResponseRequestedValidity = 30 + CertificateListResponseRequestedValidity90 CertificateListResponseRequestedValidity = 90 + CertificateListResponseRequestedValidity365 CertificateListResponseRequestedValidity = 365 + CertificateListResponseRequestedValidity730 CertificateListResponseRequestedValidity = 730 + CertificateListResponseRequestedValidity1095 CertificateListResponseRequestedValidity = 1095 + CertificateListResponseRequestedValidity5475 CertificateListResponseRequestedValidity = 5475 +) + type CertificateDeleteResponse struct { // Identifier ID string `json:"id"` @@ -128,96 +205,58 @@ func init() { ) } -// Union satisfied by [CertificateOriginCaNewCertificateResponseUnknown] or -// [shared.UnionString]. -type CertificateOriginCaNewCertificateResponse interface { - ImplementsCertificateOriginCaNewCertificateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CertificateOriginCaNewCertificateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CertificateOriginCaListCertificatesResponse struct { +type CertificateNewParams struct { // The Certificate Signing Request (CSR). Must be newline-encoded. - Csr string `json:"csr,required"` + Csr param.Field[string] `json:"csr"` // Array of hostnames or wildcard names (e.g., \*.example.com) bound to the // certificate. - Hostnames []interface{} `json:"hostnames,required"` + Hostnames param.Field[[]interface{}] `json:"hostnames"` // Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), // or "keyless-certificate" (for Keyless SSL servers). - RequestType CertificateOriginCaListCertificatesResponseRequestType `json:"request_type,required"` + RequestType param.Field[CertificateNewParamsRequestType] `json:"request_type"` // The number of days for which the certificate should be valid. - RequestedValidity CertificateOriginCaListCertificatesResponseRequestedValidity `json:"requested_validity,required"` - // Identifier - ID string `json:"id"` - // The Origin CA certificate. Will be newline-encoded. - Certificate string `json:"certificate"` - // When the certificate will expire. - ExpiresOn time.Time `json:"expires_on" format:"date-time"` - JSON certificateOriginCaListCertificatesResponseJSON `json:"-"` + RequestedValidity param.Field[CertificateNewParamsRequestedValidity] `json:"requested_validity"` } -// certificateOriginCaListCertificatesResponseJSON contains the JSON metadata for -// the struct [CertificateOriginCaListCertificatesResponse] -type certificateOriginCaListCertificatesResponseJSON struct { - Csr apijson.Field - Hostnames apijson.Field - RequestType apijson.Field - RequestedValidity apijson.Field - ID apijson.Field - Certificate apijson.Field - ExpiresOn apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CertificateOriginCaListCertificatesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r CertificateNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), // or "keyless-certificate" (for Keyless SSL servers). -type CertificateOriginCaListCertificatesResponseRequestType string +type CertificateNewParamsRequestType string const ( - CertificateOriginCaListCertificatesResponseRequestTypeOriginRsa CertificateOriginCaListCertificatesResponseRequestType = "origin-rsa" - CertificateOriginCaListCertificatesResponseRequestTypeOriginEcc CertificateOriginCaListCertificatesResponseRequestType = "origin-ecc" - CertificateOriginCaListCertificatesResponseRequestTypeKeylessCertificate CertificateOriginCaListCertificatesResponseRequestType = "keyless-certificate" + CertificateNewParamsRequestTypeOriginRsa CertificateNewParamsRequestType = "origin-rsa" + CertificateNewParamsRequestTypeOriginEcc CertificateNewParamsRequestType = "origin-ecc" + CertificateNewParamsRequestTypeKeylessCertificate CertificateNewParamsRequestType = "keyless-certificate" ) // The number of days for which the certificate should be valid. -type CertificateOriginCaListCertificatesResponseRequestedValidity float64 +type CertificateNewParamsRequestedValidity float64 const ( - CertificateOriginCaListCertificatesResponseRequestedValidity7 CertificateOriginCaListCertificatesResponseRequestedValidity = 7 - CertificateOriginCaListCertificatesResponseRequestedValidity30 CertificateOriginCaListCertificatesResponseRequestedValidity = 30 - CertificateOriginCaListCertificatesResponseRequestedValidity90 CertificateOriginCaListCertificatesResponseRequestedValidity = 90 - CertificateOriginCaListCertificatesResponseRequestedValidity365 CertificateOriginCaListCertificatesResponseRequestedValidity = 365 - CertificateOriginCaListCertificatesResponseRequestedValidity730 CertificateOriginCaListCertificatesResponseRequestedValidity = 730 - CertificateOriginCaListCertificatesResponseRequestedValidity1095 CertificateOriginCaListCertificatesResponseRequestedValidity = 1095 - CertificateOriginCaListCertificatesResponseRequestedValidity5475 CertificateOriginCaListCertificatesResponseRequestedValidity = 5475 + CertificateNewParamsRequestedValidity7 CertificateNewParamsRequestedValidity = 7 + CertificateNewParamsRequestedValidity30 CertificateNewParamsRequestedValidity = 30 + CertificateNewParamsRequestedValidity90 CertificateNewParamsRequestedValidity = 90 + CertificateNewParamsRequestedValidity365 CertificateNewParamsRequestedValidity = 365 + CertificateNewParamsRequestedValidity730 CertificateNewParamsRequestedValidity = 730 + CertificateNewParamsRequestedValidity1095 CertificateNewParamsRequestedValidity = 1095 + CertificateNewParamsRequestedValidity5475 CertificateNewParamsRequestedValidity = 5475 ) -type CertificateDeleteResponseEnvelope struct { - Errors []CertificateDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateDeleteResponseEnvelopeMessages `json:"messages,required"` - Result CertificateDeleteResponse `json:"result,required"` +type CertificateNewResponseEnvelope struct { + Errors []CertificateNewResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateNewResponseEnvelopeMessages `json:"messages,required"` + Result CertificateNewResponse `json:"result,required"` // Whether the API call was successful - Success CertificateDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON certificateDeleteResponseEnvelopeJSON `json:"-"` + Success CertificateNewResponseEnvelopeSuccess `json:"success,required"` + JSON certificateNewResponseEnvelopeJSON `json:"-"` } -// certificateDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [CertificateDeleteResponseEnvelope] -type certificateDeleteResponseEnvelopeJSON struct { +// certificateNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [CertificateNewResponseEnvelope] +type certificateNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -226,176 +265,168 @@ type certificateDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateDeleteResponseEnvelopeErrorsJSON `json:"-"` +type CertificateNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateNewResponseEnvelopeErrorsJSON `json:"-"` } -// certificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CertificateDeleteResponseEnvelopeErrors] -type certificateDeleteResponseEnvelopeErrorsJSON struct { +// certificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CertificateNewResponseEnvelopeErrors] +type certificateNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateDeleteResponseEnvelopeMessagesJSON `json:"-"` +type CertificateNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateNewResponseEnvelopeMessagesJSON `json:"-"` } -// certificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CertificateDeleteResponseEnvelopeMessages] -type certificateDeleteResponseEnvelopeMessagesJSON struct { +// certificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CertificateNewResponseEnvelopeMessages] +type certificateNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateDeleteResponseEnvelopeSuccess bool +type CertificateNewResponseEnvelopeSuccess bool const ( - CertificateDeleteResponseEnvelopeSuccessTrue CertificateDeleteResponseEnvelopeSuccess = true + CertificateNewResponseEnvelopeSuccessTrue CertificateNewResponseEnvelopeSuccess = true ) -type CertificateGetResponseEnvelope struct { - Errors []CertificateGetResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateGetResponseEnvelopeMessages `json:"messages,required"` - Result CertificateGetResponse `json:"result,required"` +type CertificateListParams struct { +} + +type CertificateListResponseEnvelope struct { + Errors []CertificateListResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateListResponseEnvelopeMessages `json:"messages,required"` + Result []CertificateListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success CertificateGetResponseEnvelopeSuccess `json:"success,required"` - JSON certificateGetResponseEnvelopeJSON `json:"-"` + Success CertificateListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CertificateListResponseEnvelopeResultInfo `json:"result_info"` + JSON certificateListResponseEnvelopeJSON `json:"-"` } -// certificateGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [CertificateGetResponseEnvelope] -type certificateGetResponseEnvelopeJSON struct { +// certificateListResponseEnvelopeJSON contains the JSON metadata for the struct +// [CertificateListResponseEnvelope] +type certificateListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateGetResponseEnvelopeErrorsJSON `json:"-"` +type CertificateListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateListResponseEnvelopeErrorsJSON `json:"-"` } -// certificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CertificateGetResponseEnvelopeErrors] -type certificateGetResponseEnvelopeErrorsJSON struct { +// certificateListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CertificateListResponseEnvelopeErrors] +type certificateListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateGetResponseEnvelopeMessagesJSON `json:"-"` +type CertificateListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateListResponseEnvelopeMessagesJSON `json:"-"` } -// certificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CertificateGetResponseEnvelopeMessages] -type certificateGetResponseEnvelopeMessagesJSON struct { +// certificateListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CertificateListResponseEnvelopeMessages] +type certificateListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateGetResponseEnvelopeSuccess bool +type CertificateListResponseEnvelopeSuccess bool const ( - CertificateGetResponseEnvelopeSuccessTrue CertificateGetResponseEnvelopeSuccess = true + CertificateListResponseEnvelopeSuccessTrue CertificateListResponseEnvelopeSuccess = true ) -type CertificateOriginCaNewCertificateParams struct { - // The Certificate Signing Request (CSR). Must be newline-encoded. - Csr param.Field[string] `json:"csr"` - // Array of hostnames or wildcard names (e.g., \*.example.com) bound to the - // certificate. - Hostnames param.Field[[]interface{}] `json:"hostnames"` - // Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), - // or "keyless-certificate" (for Keyless SSL servers). - RequestType param.Field[CertificateOriginCaNewCertificateParamsRequestType] `json:"request_type"` - // The number of days for which the certificate should be valid. - RequestedValidity param.Field[CertificateOriginCaNewCertificateParamsRequestedValidity] `json:"requested_validity"` +type CertificateListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON certificateListResponseEnvelopeResultInfoJSON `json:"-"` } -func (r CertificateOriginCaNewCertificateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// certificateListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [CertificateListResponseEnvelopeResultInfo] +type certificateListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), -// or "keyless-certificate" (for Keyless SSL servers). -type CertificateOriginCaNewCertificateParamsRequestType string - -const ( - CertificateOriginCaNewCertificateParamsRequestTypeOriginRsa CertificateOriginCaNewCertificateParamsRequestType = "origin-rsa" - CertificateOriginCaNewCertificateParamsRequestTypeOriginEcc CertificateOriginCaNewCertificateParamsRequestType = "origin-ecc" - CertificateOriginCaNewCertificateParamsRequestTypeKeylessCertificate CertificateOriginCaNewCertificateParamsRequestType = "keyless-certificate" -) - -// The number of days for which the certificate should be valid. -type CertificateOriginCaNewCertificateParamsRequestedValidity float64 - -const ( - CertificateOriginCaNewCertificateParamsRequestedValidity7 CertificateOriginCaNewCertificateParamsRequestedValidity = 7 - CertificateOriginCaNewCertificateParamsRequestedValidity30 CertificateOriginCaNewCertificateParamsRequestedValidity = 30 - CertificateOriginCaNewCertificateParamsRequestedValidity90 CertificateOriginCaNewCertificateParamsRequestedValidity = 90 - CertificateOriginCaNewCertificateParamsRequestedValidity365 CertificateOriginCaNewCertificateParamsRequestedValidity = 365 - CertificateOriginCaNewCertificateParamsRequestedValidity730 CertificateOriginCaNewCertificateParamsRequestedValidity = 730 - CertificateOriginCaNewCertificateParamsRequestedValidity1095 CertificateOriginCaNewCertificateParamsRequestedValidity = 1095 - CertificateOriginCaNewCertificateParamsRequestedValidity5475 CertificateOriginCaNewCertificateParamsRequestedValidity = 5475 -) +func (r *CertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -type CertificateOriginCaNewCertificateResponseEnvelope struct { - Errors []CertificateOriginCaNewCertificateResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateOriginCaNewCertificateResponseEnvelopeMessages `json:"messages,required"` - Result CertificateOriginCaNewCertificateResponse `json:"result,required"` +type CertificateDeleteResponseEnvelope struct { + Errors []CertificateDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateDeleteResponseEnvelopeMessages `json:"messages,required"` + Result CertificateDeleteResponse `json:"result,required"` // Whether the API call was successful - Success CertificateOriginCaNewCertificateResponseEnvelopeSuccess `json:"success,required"` - JSON certificateOriginCaNewCertificateResponseEnvelopeJSON `json:"-"` + Success CertificateDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON certificateDeleteResponseEnvelopeJSON `json:"-"` } -// certificateOriginCaNewCertificateResponseEnvelopeJSON contains the JSON metadata -// for the struct [CertificateOriginCaNewCertificateResponseEnvelope] -type certificateOriginCaNewCertificateResponseEnvelopeJSON struct { +// certificateDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [CertificateDeleteResponseEnvelope] +type certificateDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -404,157 +435,120 @@ type certificateOriginCaNewCertificateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaNewCertificateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateOriginCaNewCertificateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateOriginCaNewCertificateResponseEnvelopeErrorsJSON `json:"-"` +type CertificateDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// certificateOriginCaNewCertificateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [CertificateOriginCaNewCertificateResponseEnvelopeErrors] -type certificateOriginCaNewCertificateResponseEnvelopeErrorsJSON struct { +// certificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CertificateDeleteResponseEnvelopeErrors] +type certificateDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaNewCertificateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateOriginCaNewCertificateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateOriginCaNewCertificateResponseEnvelopeMessagesJSON `json:"-"` +type CertificateDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// certificateOriginCaNewCertificateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [CertificateOriginCaNewCertificateResponseEnvelopeMessages] -type certificateOriginCaNewCertificateResponseEnvelopeMessagesJSON struct { +// certificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CertificateDeleteResponseEnvelopeMessages] +type certificateDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaNewCertificateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateOriginCaNewCertificateResponseEnvelopeSuccess bool +type CertificateDeleteResponseEnvelopeSuccess bool const ( - CertificateOriginCaNewCertificateResponseEnvelopeSuccessTrue CertificateOriginCaNewCertificateResponseEnvelopeSuccess = true + CertificateDeleteResponseEnvelopeSuccessTrue CertificateDeleteResponseEnvelopeSuccess = true ) -type CertificateOriginCaListCertificatesParams struct { -} - -type CertificateOriginCaListCertificatesResponseEnvelope struct { - Errors []CertificateOriginCaListCertificatesResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateOriginCaListCertificatesResponseEnvelopeMessages `json:"messages,required"` - Result []CertificateOriginCaListCertificatesResponse `json:"result,required,nullable"` +type CertificateGetResponseEnvelope struct { + Errors []CertificateGetResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateGetResponseEnvelopeMessages `json:"messages,required"` + Result CertificateGetResponse `json:"result,required"` // Whether the API call was successful - Success CertificateOriginCaListCertificatesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CertificateOriginCaListCertificatesResponseEnvelopeResultInfo `json:"result_info"` - JSON certificateOriginCaListCertificatesResponseEnvelopeJSON `json:"-"` + Success CertificateGetResponseEnvelopeSuccess `json:"success,required"` + JSON certificateGetResponseEnvelopeJSON `json:"-"` } -// certificateOriginCaListCertificatesResponseEnvelopeJSON contains the JSON -// metadata for the struct [CertificateOriginCaListCertificatesResponseEnvelope] -type certificateOriginCaListCertificatesResponseEnvelopeJSON struct { +// certificateGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [CertificateGetResponseEnvelope] +type certificateGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaListCertificatesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateOriginCaListCertificatesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateOriginCaListCertificatesResponseEnvelopeErrorsJSON `json:"-"` +type CertificateGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateGetResponseEnvelopeErrorsJSON `json:"-"` } -// certificateOriginCaListCertificatesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [CertificateOriginCaListCertificatesResponseEnvelopeErrors] -type certificateOriginCaListCertificatesResponseEnvelopeErrorsJSON struct { +// certificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CertificateGetResponseEnvelopeErrors] +type certificateGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaListCertificatesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateOriginCaListCertificatesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateOriginCaListCertificatesResponseEnvelopeMessagesJSON `json:"-"` +type CertificateGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateGetResponseEnvelopeMessagesJSON `json:"-"` } -// certificateOriginCaListCertificatesResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [CertificateOriginCaListCertificatesResponseEnvelopeMessages] -type certificateOriginCaListCertificatesResponseEnvelopeMessagesJSON struct { +// certificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CertificateGetResponseEnvelopeMessages] +type certificateGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateOriginCaListCertificatesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateOriginCaListCertificatesResponseEnvelopeSuccess bool +type CertificateGetResponseEnvelopeSuccess bool const ( - CertificateOriginCaListCertificatesResponseEnvelopeSuccessTrue CertificateOriginCaListCertificatesResponseEnvelopeSuccess = true + CertificateGetResponseEnvelopeSuccessTrue CertificateGetResponseEnvelopeSuccess = true ) - -type CertificateOriginCaListCertificatesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON certificateOriginCaListCertificatesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// certificateOriginCaListCertificatesResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [CertificateOriginCaListCertificatesResponseEnvelopeResultInfo] -type certificateOriginCaListCertificatesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CertificateOriginCaListCertificatesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/certificate_test.go b/certificate_test.go index 479ba77a2ee..2fbab57e549 100644 --- a/certificate_test.go +++ b/certificate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCertificateDelete(t *testing.T) { +func TestCertificateNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,12 @@ func TestCertificateDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Certificates.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Certificates.New(context.TODO(), cloudflare.CertificateNewParams{ + Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----"), + Hostnames: cloudflare.F([]interface{}{"example.com", "*.example.com"}), + RequestType: cloudflare.F(cloudflare.CertificateNewParamsRequestTypeOriginRsa), + RequestedValidity: cloudflare.F(cloudflare.CertificateNewParamsRequestedValidity5475), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +44,7 @@ func TestCertificateDelete(t *testing.T) { } } -func TestCertificateGet(t *testing.T) { +func TestCertificateList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +60,7 @@ func TestCertificateGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Certificates.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Certificates.List(context.TODO(), cloudflare.CertificateListParams{}) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +70,7 @@ func TestCertificateGet(t *testing.T) { } } -func TestCertificateOriginCaNewCertificateWithOptionalParams(t *testing.T) { +func TestCertificateDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,12 +86,7 @@ func TestCertificateOriginCaNewCertificateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Certificates.OriginCaNewCertificate(context.TODO(), cloudflare.CertificateOriginCaNewCertificateParams{ - Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----"), - Hostnames: cloudflare.F([]interface{}{"example.com", "*.example.com"}), - RequestType: cloudflare.F(cloudflare.CertificateOriginCaNewCertificateParamsRequestTypeOriginRsa), - RequestedValidity: cloudflare.F(cloudflare.CertificateOriginCaNewCertificateParamsRequestedValidity5475), - }) + _, err := client.Certificates.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -96,7 +96,7 @@ func TestCertificateOriginCaNewCertificateWithOptionalParams(t *testing.T) { } } -func TestCertificateOriginCaListCertificates(t *testing.T) { +func TestCertificateGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -112,7 +112,7 @@ func TestCertificateOriginCaListCertificates(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Certificates.OriginCaListCertificates(context.TODO(), cloudflare.CertificateOriginCaListCertificatesParams{}) + _, err := client.Certificates.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/certificateauthorityhostnameassociation.go b/certificateauthorityhostnameassociation.go index 2dd662ac279..0542d482c03 100644 --- a/certificateauthorityhostnameassociation.go +++ b/certificateauthorityhostnameassociation.go @@ -35,9 +35,9 @@ func NewCertificateAuthorityHostnameAssociationService(opts ...option.RequestOpt } // List Hostname Associations -func (r *CertificateAuthorityHostnameAssociationService) ClientCertificateForAZoneListHostnameAssociations(ctx context.Context, zoneID string, query CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse, err error) { +func (r *CertificateAuthorityHostnameAssociationService) List(ctx context.Context, zoneID string, query CertificateAuthorityHostnameAssociationListParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationListResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelope + var env CertificateAuthorityHostnameAssociationListResponseEnvelope path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -48,9 +48,9 @@ func (r *CertificateAuthorityHostnameAssociationService) ClientCertificateForAZo } // Replace Hostname Associations -func (r *CertificateAuthorityHostnameAssociationService) ClientCertificateForAZonePutHostnameAssociations(ctx context.Context, zoneID string, body CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse, err error) { +func (r *CertificateAuthorityHostnameAssociationService) Replace(ctx context.Context, zoneID string, body CertificateAuthorityHostnameAssociationReplaceParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelope + var env CertificateAuthorityHostnameAssociationReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -60,82 +60,79 @@ func (r *CertificateAuthorityHostnameAssociationService) ClientCertificateForAZo return } -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse struct { +type CertificateAuthorityHostnameAssociationListResponse struct { Hostnames []string `json:"hostnames"` // The UUID for a certificate that was uploaded to the mTLS Certificate Management // endpoint. If no mtls_certificate_id is given, the hostnames will be associated // to your active Cloudflare Managed CA. - MtlsCertificateID string `json:"mtls_certificate_id"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseJSON `json:"-"` + MtlsCertificateID string `json:"mtls_certificate_id"` + JSON certificateAuthorityHostnameAssociationListResponseJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse] -type certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseJSON struct { +// certificateAuthorityHostnameAssociationListResponseJSON contains the JSON +// metadata for the struct [CertificateAuthorityHostnameAssociationListResponse] +type certificateAuthorityHostnameAssociationListResponseJSON struct { Hostnames apijson.Field MtlsCertificateID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse struct { +type CertificateAuthorityHostnameAssociationReplaceResponse struct { Hostnames []string `json:"hostnames"` // The UUID for a certificate that was uploaded to the mTLS Certificate Management // endpoint. If no mtls_certificate_id is given, the hostnames will be associated // to your active Cloudflare Managed CA. - MtlsCertificateID string `json:"mtls_certificate_id"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseJSON `json:"-"` + MtlsCertificateID string `json:"mtls_certificate_id"` + JSON certificateAuthorityHostnameAssociationReplaceResponseJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse] -type certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseJSON struct { +// certificateAuthorityHostnameAssociationReplaceResponseJSON contains the JSON +// metadata for the struct [CertificateAuthorityHostnameAssociationReplaceResponse] +type certificateAuthorityHostnameAssociationReplaceResponseJSON struct { Hostnames apijson.Field MtlsCertificateID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams struct { +type CertificateAuthorityHostnameAssociationListParams struct { // The UUID to match against for a certificate that was uploaded to the mTLS // Certificate Management endpoint. If no mtls_certificate_id is given, the results // will be the hostnames associated to your active Cloudflare Managed CA. MtlsCertificateID param.Field[string] `query:"mtls_certificate_id"` } -// URLQuery serializes -// [CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams]'s -// query parameters as `url.Values`. -func (r CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams) URLQuery() (v url.Values) { +// URLQuery serializes [CertificateAuthorityHostnameAssociationListParams]'s query +// parameters as `url.Values`. +func (r CertificateAuthorityHostnameAssociationListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelope struct { - Errors []CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessages `json:"messages,required"` - Result CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponse `json:"result,required"` +type CertificateAuthorityHostnameAssociationListResponseEnvelope struct { + Errors []CertificateAuthorityHostnameAssociationListResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateAuthorityHostnameAssociationListResponseEnvelopeMessages `json:"messages,required"` + Result CertificateAuthorityHostnameAssociationListResponse `json:"result,required"` // Whether the API call was successful - Success CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeSuccess `json:"success,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeJSON `json:"-"` + Success CertificateAuthorityHostnameAssociationListResponseEnvelopeSuccess `json:"success,required"` + JSON certificateAuthorityHostnameAssociationListResponseEnvelopeJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelope] -type certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeJSON struct { +// certificateAuthorityHostnameAssociationListResponseEnvelopeJSON contains the +// JSON metadata for the struct +// [CertificateAuthorityHostnameAssociationListResponseEnvelope] +type certificateAuthorityHostnameAssociationListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -144,58 +141,58 @@ type certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnam ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrorsJSON `json:"-"` +type CertificateAuthorityHostnameAssociationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateAuthorityHostnameAssociationListResponseEnvelopeErrorsJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrors] -type certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrorsJSON struct { +// certificateAuthorityHostnameAssociationListResponseEnvelopeErrorsJSON contains +// the JSON metadata for the struct +// [CertificateAuthorityHostnameAssociationListResponseEnvelopeErrors] +type certificateAuthorityHostnameAssociationListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessagesJSON `json:"-"` +type CertificateAuthorityHostnameAssociationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateAuthorityHostnameAssociationListResponseEnvelopeMessagesJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessages] -type certificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessagesJSON struct { +// certificateAuthorityHostnameAssociationListResponseEnvelopeMessagesJSON contains +// the JSON metadata for the struct +// [CertificateAuthorityHostnameAssociationListResponseEnvelopeMessages] +type certificateAuthorityHostnameAssociationListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeSuccess bool +type CertificateAuthorityHostnameAssociationListResponseEnvelopeSuccess bool const ( - CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsResponseEnvelopeSuccess = true + CertificateAuthorityHostnameAssociationListResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationListResponseEnvelopeSuccess = true ) -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsParams struct { +type CertificateAuthorityHostnameAssociationReplaceParams struct { Hostnames param.Field[[]string] `json:"hostnames"` // The UUID for a certificate that was uploaded to the mTLS Certificate Management // endpoint. If no mtls_certificate_id is given, the hostnames will be associated @@ -203,23 +200,23 @@ type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostname MtlsCertificateID param.Field[string] `json:"mtls_certificate_id"` } -func (r CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsParams) MarshalJSON() (data []byte, err error) { +func (r CertificateAuthorityHostnameAssociationReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelope struct { - Errors []CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrors `json:"errors,required"` - Messages []CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessages `json:"messages,required"` - Result CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponse `json:"result,required"` +type CertificateAuthorityHostnameAssociationReplaceResponseEnvelope struct { + Errors []CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessages `json:"messages,required"` + Result CertificateAuthorityHostnameAssociationReplaceResponse `json:"result,required"` // Whether the API call was successful - Success CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeSuccess `json:"success,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeJSON `json:"-"` + Success CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON certificateAuthorityHostnameAssociationReplaceResponseEnvelopeJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelope] -type certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeJSON struct { +// certificateAuthorityHostnameAssociationReplaceResponseEnvelopeJSON contains the +// JSON metadata for the struct +// [CertificateAuthorityHostnameAssociationReplaceResponseEnvelope] +type certificateAuthorityHostnameAssociationReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -228,53 +225,53 @@ type certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostname ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrorsJSON `json:"-"` +type CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrorsJSON +// certificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrors] -type certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrorsJSON struct { +// [CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrors] +type certificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessagesJSON `json:"-"` +type CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON certificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessagesJSON +// certificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessages] -type certificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessagesJSON struct { +// [CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessages] +type certificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeSuccess bool +type CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeSuccess bool const ( - CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsResponseEnvelopeSuccess = true + CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationReplaceResponseEnvelopeSuccess = true ) diff --git a/certificateauthorityhostnameassociation_test.go b/certificateauthorityhostnameassociation_test.go index 9653df50f63..043114c9542 100644 --- a/certificateauthorityhostnameassociation_test.go +++ b/certificateauthorityhostnameassociation_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsWithOptionalParams(t *testing.T) { +func TestCertificateAuthorityHostnameAssociationListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestCertificateAuthorityHostnameAssociationClientCertificateForAZoneListHos option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CertificateAuthorities.HostnameAssociations.ClientCertificateForAZoneListHostnameAssociations( + _, err := client.CertificateAuthorities.HostnameAssociations.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZoneListHostnameAssociationsParams{ + cloudflare.CertificateAuthorityHostnameAssociationListParams{ MtlsCertificateID: cloudflare.F("b2134436-2555-4acf-be5b-26c48136575e"), }, ) @@ -45,7 +45,7 @@ func TestCertificateAuthorityHostnameAssociationClientCertificateForAZoneListHos } } -func TestCertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsWithOptionalParams(t *testing.T) { +func TestCertificateAuthorityHostnameAssociationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,10 +61,10 @@ func TestCertificateAuthorityHostnameAssociationClientCertificateForAZonePutHost option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CertificateAuthorities.HostnameAssociations.ClientCertificateForAZonePutHostnameAssociations( + _, err := client.CertificateAuthorities.HostnameAssociations.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CertificateAuthorityHostnameAssociationClientCertificateForAZonePutHostnameAssociationsParams{ + cloudflare.CertificateAuthorityHostnameAssociationReplaceParams{ Hostnames: cloudflare.F([]string{"api.example.com", "api.example.com", "api.example.com"}), MtlsCertificateID: cloudflare.F("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), }, diff --git a/cfdtunnel.go b/cfdtunnel.go deleted file mode 100644 index 930f752e4b6..00000000000 --- a/cfdtunnel.go +++ /dev/null @@ -1,1770 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "reflect" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// CfdTunnelService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewCfdTunnelService] method instead. -type CfdTunnelService struct { - Options []option.RequestOption - Configurations *CfdTunnelConfigurationService - Connections *CfdTunnelConnectionService - Tokens *CfdTunnelTokenService - Connectors *CfdTunnelConnectorService - Management *CfdTunnelManagementService -} - -// NewCfdTunnelService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewCfdTunnelService(opts ...option.RequestOption) (r *CfdTunnelService) { - r = &CfdTunnelService{} - r.Options = opts - r.Configurations = NewCfdTunnelConfigurationService(opts...) - r.Connections = NewCfdTunnelConnectionService(opts...) - r.Tokens = NewCfdTunnelTokenService(opts...) - r.Connectors = NewCfdTunnelConnectorService(opts...) - r.Management = NewCfdTunnelManagementService(opts...) - return -} - -// Updates an existing Cloudflare Tunnel. -func (r *CfdTunnelService) Update(ctx context.Context, accountID string, tunnelID string, body CfdTunnelUpdateParams, opts ...option.RequestOption) (res *CfdTunnelUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes a Cloudflare Tunnel from an account. -func (r *CfdTunnelService) Delete(ctx context.Context, accountID string, tunnelID string, body CfdTunnelDeleteParams, opts ...option.RequestOption) (res *CfdTunnelDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Creates a new Cloudflare Tunnel in an account. -func (r *CfdTunnelService) CloudflareTunnelNewACloudflareTunnel(ctx context.Context, accountID string, body CfdTunnelCloudflareTunnelNewACloudflareTunnelParams, opts ...option.RequestOption) (res *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists and filters Cloudflare Tunnels in an account. -func (r *CfdTunnelService) CloudflareTunnelListCloudflareTunnels(ctx context.Context, accountID string, query CfdTunnelCloudflareTunnelListCloudflareTunnelsParams, opts ...option.RequestOption) (res *[]CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches a single Cloudflare Tunnel. -func (r *CfdTunnelService) Get(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *CfdTunnelGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -// -// Union satisfied by [CfdTunnelUpdateResponseTunnelCfdTunnel] or -// [CfdTunnelUpdateResponseTunnelWarpConnectorTunnel]. -type CfdTunnelUpdateResponse interface { - implementsCfdTunnelUpdateResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*CfdTunnelUpdateResponse)(nil)).Elem(), "") -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelUpdateResponseTunnelCfdTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelUpdateResponseTunnelCfdTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - // If `false`, the tunnel must be configured locally on the origin machine. - RemoteConfig bool `json:"remote_config"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelUpdateResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON cfdTunnelUpdateResponseTunnelCfdTunnelJSON `json:"-"` -} - -// cfdTunnelUpdateResponseTunnelCfdTunnelJSON contains the JSON metadata for the -// struct [CfdTunnelUpdateResponseTunnelCfdTunnel] -type cfdTunnelUpdateResponseTunnelCfdTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - RemoteConfig apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelUpdateResponseTunnelCfdTunnel) implementsCfdTunnelUpdateResponse() {} - -type CfdTunnelUpdateResponseTunnelCfdTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelUpdateResponseTunnelCfdTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelUpdateResponseTunnelCfdTunnelConnectionJSON contains the JSON metadata -// for the struct [CfdTunnelUpdateResponseTunnelCfdTunnelConnection] -type cfdTunnelUpdateResponseTunnelCfdTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelUpdateResponseTunnelCfdTunnelTunType string - -const ( - CfdTunnelUpdateResponseTunnelCfdTunnelTunTypeCfdTunnel CfdTunnelUpdateResponseTunnelCfdTunnelTunType = "cfd_tunnel" - CfdTunnelUpdateResponseTunnelCfdTunnelTunTypeWarpConnector CfdTunnelUpdateResponseTunnelCfdTunnelTunType = "warp_connector" - CfdTunnelUpdateResponseTunnelCfdTunnelTunTypeIPSec CfdTunnelUpdateResponseTunnelCfdTunnelTunType = "ip_sec" - CfdTunnelUpdateResponseTunnelCfdTunnelTunTypeGre CfdTunnelUpdateResponseTunnelCfdTunnelTunType = "gre" - CfdTunnelUpdateResponseTunnelCfdTunnelTunTypeCni CfdTunnelUpdateResponseTunnelCfdTunnelTunType = "cni" -) - -// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelUpdateResponseTunnelWarpConnectorTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON cfdTunnelUpdateResponseTunnelWarpConnectorTunnelJSON `json:"-"` -} - -// cfdTunnelUpdateResponseTunnelWarpConnectorTunnelJSON contains the JSON metadata -// for the struct [CfdTunnelUpdateResponseTunnelWarpConnectorTunnel] -type cfdTunnelUpdateResponseTunnelWarpConnectorTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelUpdateResponseTunnelWarpConnectorTunnel) implementsCfdTunnelUpdateResponse() {} - -type CfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON contains the JSON -// metadata for the struct -// [CfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnection] -type cfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType string - -const ( - CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeWarpConnector CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeIPSec CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeGre CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "gre" - CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeCni CfdTunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "cni" -) - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -// -// Union satisfied by [CfdTunnelDeleteResponseTunnelCfdTunnel] or -// [CfdTunnelDeleteResponseTunnelWarpConnectorTunnel]. -type CfdTunnelDeleteResponse interface { - implementsCfdTunnelDeleteResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*CfdTunnelDeleteResponse)(nil)).Elem(), "") -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelDeleteResponseTunnelCfdTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelDeleteResponseTunnelCfdTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - // If `false`, the tunnel must be configured locally on the origin machine. - RemoteConfig bool `json:"remote_config"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelDeleteResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON cfdTunnelDeleteResponseTunnelCfdTunnelJSON `json:"-"` -} - -// cfdTunnelDeleteResponseTunnelCfdTunnelJSON contains the JSON metadata for the -// struct [CfdTunnelDeleteResponseTunnelCfdTunnel] -type cfdTunnelDeleteResponseTunnelCfdTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - RemoteConfig apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelDeleteResponseTunnelCfdTunnel) implementsCfdTunnelDeleteResponse() {} - -type CfdTunnelDeleteResponseTunnelCfdTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelDeleteResponseTunnelCfdTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelDeleteResponseTunnelCfdTunnelConnectionJSON contains the JSON metadata -// for the struct [CfdTunnelDeleteResponseTunnelCfdTunnelConnection] -type cfdTunnelDeleteResponseTunnelCfdTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelDeleteResponseTunnelCfdTunnelTunType string - -const ( - CfdTunnelDeleteResponseTunnelCfdTunnelTunTypeCfdTunnel CfdTunnelDeleteResponseTunnelCfdTunnelTunType = "cfd_tunnel" - CfdTunnelDeleteResponseTunnelCfdTunnelTunTypeWarpConnector CfdTunnelDeleteResponseTunnelCfdTunnelTunType = "warp_connector" - CfdTunnelDeleteResponseTunnelCfdTunnelTunTypeIPSec CfdTunnelDeleteResponseTunnelCfdTunnelTunType = "ip_sec" - CfdTunnelDeleteResponseTunnelCfdTunnelTunTypeGre CfdTunnelDeleteResponseTunnelCfdTunnelTunType = "gre" - CfdTunnelDeleteResponseTunnelCfdTunnelTunTypeCni CfdTunnelDeleteResponseTunnelCfdTunnelTunType = "cni" -) - -// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelDeleteResponseTunnelWarpConnectorTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON cfdTunnelDeleteResponseTunnelWarpConnectorTunnelJSON `json:"-"` -} - -// cfdTunnelDeleteResponseTunnelWarpConnectorTunnelJSON contains the JSON metadata -// for the struct [CfdTunnelDeleteResponseTunnelWarpConnectorTunnel] -type cfdTunnelDeleteResponseTunnelWarpConnectorTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelDeleteResponseTunnelWarpConnectorTunnel) implementsCfdTunnelDeleteResponse() {} - -type CfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnectionJSON contains the JSON -// metadata for the struct -// [CfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnection] -type cfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType string - -const ( - CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunTypeWarpConnector CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunTypeIPSec CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunTypeGre CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType = "gre" - CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunTypeCni CfdTunnelDeleteResponseTunnelWarpConnectorTunnelTunType = "cni" -) - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -// -// Union satisfied by -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnel] or -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnel]. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse interface { - implementsCfdTunnelCloudflareTunnelNewACloudflareTunnelResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse)(nil)).Elem(), "") -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - // If `false`, the tunnel must be configured locally on the origin machine. - RemoteConfig bool `json:"remote_config"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnel] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - RemoteConfig apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnel) implementsCfdTunnelCloudflareTunnelNewACloudflareTunnelResponse() { -} - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnectionJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnection] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType string - -const ( - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunTypeCfdTunnel CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType = "cfd_tunnel" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunTypeWarpConnector CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType = "warp_connector" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunTypeIPSec CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType = "ip_sec" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunTypeGre CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType = "gre" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunTypeCni CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelCfdTunnelTunType = "cni" -) - -// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnel] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnel) implementsCfdTunnelCloudflareTunnelNewACloudflareTunnelResponse() { -} - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnectionJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnection] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType string - -const ( - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunTypeWarpConnector CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunTypeIPSec CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunTypeGre CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType = "gre" - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunTypeCni CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseTunnelWarpConnectorTunnelTunType = "cni" -) - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -// -// Union satisfied by -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnel] or -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnel]. -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse interface { - implementsCfdTunnelCloudflareTunnelListCloudflareTunnelsResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse)(nil)).Elem(), "") -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - // If `false`, the tunnel must be configured locally on the origin machine. - RemoteConfig bool `json:"remote_config"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnel] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - RemoteConfig apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnel) implementsCfdTunnelCloudflareTunnelListCloudflareTunnelsResponse() { -} - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnectionJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnection] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType string - -const ( - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunTypeCfdTunnel CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType = "cfd_tunnel" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunTypeWarpConnector CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType = "warp_connector" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunTypeIPSec CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType = "ip_sec" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunTypeGre CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType = "gre" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunTypeCni CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelCfdTunnelTunType = "cni" -) - -// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnel] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnel) implementsCfdTunnelCloudflareTunnelListCloudflareTunnelsResponse() { -} - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnection] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType string - -const ( - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunTypeWarpConnector CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunTypeIPSec CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunTypeGre CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType = "gre" - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunTypeCni CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseTunnelWarpConnectorTunnelTunType = "cni" -) - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -// -// Union satisfied by [CfdTunnelGetResponseTunnelCfdTunnel] or -// [CfdTunnelGetResponseTunnelWarpConnectorTunnel]. -type CfdTunnelGetResponse interface { - implementsCfdTunnelGetResponse() -} - -func init() { - apijson.RegisterUnion(reflect.TypeOf((*CfdTunnelGetResponse)(nil)).Elem(), "") -} - -// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelGetResponseTunnelCfdTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelGetResponseTunnelCfdTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - // If `false`, the tunnel must be configured locally on the origin machine. - RemoteConfig bool `json:"remote_config"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelGetResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON cfdTunnelGetResponseTunnelCfdTunnelJSON `json:"-"` -} - -// cfdTunnelGetResponseTunnelCfdTunnelJSON contains the JSON metadata for the -// struct [CfdTunnelGetResponseTunnelCfdTunnel] -type cfdTunnelGetResponseTunnelCfdTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - RemoteConfig apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelGetResponseTunnelCfdTunnel) implementsCfdTunnelGetResponse() {} - -type CfdTunnelGetResponseTunnelCfdTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelGetResponseTunnelCfdTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelGetResponseTunnelCfdTunnelConnectionJSON contains the JSON metadata for -// the struct [CfdTunnelGetResponseTunnelCfdTunnelConnection] -type cfdTunnelGetResponseTunnelCfdTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelGetResponseTunnelCfdTunnelTunType string - -const ( - CfdTunnelGetResponseTunnelCfdTunnelTunTypeCfdTunnel CfdTunnelGetResponseTunnelCfdTunnelTunType = "cfd_tunnel" - CfdTunnelGetResponseTunnelCfdTunnelTunTypeWarpConnector CfdTunnelGetResponseTunnelCfdTunnelTunType = "warp_connector" - CfdTunnelGetResponseTunnelCfdTunnelTunTypeIPSec CfdTunnelGetResponseTunnelCfdTunnelTunType = "ip_sec" - CfdTunnelGetResponseTunnelCfdTunnelTunTypeGre CfdTunnelGetResponseTunnelCfdTunnelTunType = "gre" - CfdTunnelGetResponseTunnelCfdTunnelTunTypeCni CfdTunnelGetResponseTunnelCfdTunnelTunType = "cni" -) - -// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type CfdTunnelGetResponseTunnelWarpConnectorTunnel struct { - // UUID of the tunnel. - ID string `json:"id"` - // Cloudflare account ID - AccountTag string `json:"account_tag"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []CfdTunnelGetResponseTunnelWarpConnectorTunnelConnection `json:"connections"` - // Timestamp of when the tunnel established at least one connection to Cloudflare's - // edge. If `null`, the tunnel is inactive. - ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` - // Timestamp of when the tunnel became inactive (no connections to Cloudflare's - // edge). If `null`, the tunnel is active. - ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` - // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - // Metadata associated with the tunnel. - Metadata interface{} `json:"metadata"` - // A user-friendly name for the tunnel. - Name string `json:"name"` - // The status of the tunnel. Valid values are `inactive` (tunnel has never been - // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy - // state), `healthy` (tunnel is active and able to serve traffic), or `down` - // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - Status string `json:"status"` - // The type of tunnel. - TunType CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON cfdTunnelGetResponseTunnelWarpConnectorTunnelJSON `json:"-"` -} - -// cfdTunnelGetResponseTunnelWarpConnectorTunnelJSON contains the JSON metadata for -// the struct [CfdTunnelGetResponseTunnelWarpConnectorTunnel] -type cfdTunnelGetResponseTunnelWarpConnectorTunnelJSON struct { - ID apijson.Field - AccountTag apijson.Field - Connections apijson.Field - ConnsActiveAt apijson.Field - ConnsInactiveAt apijson.Field - CreatedAt apijson.Field - DeletedAt apijson.Field - Metadata apijson.Field - Name apijson.Field - Status apijson.Field - TunType apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r CfdTunnelGetResponseTunnelWarpConnectorTunnel) implementsCfdTunnelGetResponse() {} - -type CfdTunnelGetResponseTunnelWarpConnectorTunnelConnection struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelGetResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` -} - -// cfdTunnelGetResponseTunnelWarpConnectorTunnelConnectionJSON contains the JSON -// metadata for the struct -// [CfdTunnelGetResponseTunnelWarpConnectorTunnelConnection] -type cfdTunnelGetResponseTunnelWarpConnectorTunnelConnectionJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of tunnel. -type CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType string - -const ( - CfdTunnelGetResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - CfdTunnelGetResponseTunnelWarpConnectorTunnelTunTypeWarpConnector CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - CfdTunnelGetResponseTunnelWarpConnectorTunnelTunTypeIPSec CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - CfdTunnelGetResponseTunnelWarpConnectorTunnelTunTypeGre CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType = "gre" - CfdTunnelGetResponseTunnelWarpConnectorTunnelTunTypeCni CfdTunnelGetResponseTunnelWarpConnectorTunnelTunType = "cni" -) - -type CfdTunnelUpdateParams struct { - // A user-friendly name for the tunnel. - Name param.Field[string] `json:"name"` - // Sets the password required to run a locally-managed tunnel. Must be at least 32 - // bytes and encoded as a base64 string. - TunnelSecret param.Field[string] `json:"tunnel_secret"` -} - -func (r CfdTunnelUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CfdTunnelUpdateResponseEnvelope struct { - Errors []CfdTunnelUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelUpdateResponseEnvelopeMessages `json:"messages,required"` - // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - Result CfdTunnelUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelUpdateResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [CfdTunnelUpdateResponseEnvelope] -type cfdTunnelUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CfdTunnelUpdateResponseEnvelopeErrors] -type cfdTunnelUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CfdTunnelUpdateResponseEnvelopeMessages] -type cfdTunnelUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelUpdateResponseEnvelopeSuccess bool - -const ( - CfdTunnelUpdateResponseEnvelopeSuccessTrue CfdTunnelUpdateResponseEnvelopeSuccess = true -) - -type CfdTunnelDeleteParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r CfdTunnelDeleteParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type CfdTunnelDeleteResponseEnvelope struct { - Errors []CfdTunnelDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelDeleteResponseEnvelopeMessages `json:"messages,required"` - // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - Result CfdTunnelDeleteResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelDeleteResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [CfdTunnelDeleteResponseEnvelope] -type cfdTunnelDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CfdTunnelDeleteResponseEnvelopeErrors] -type cfdTunnelDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CfdTunnelDeleteResponseEnvelopeMessages] -type cfdTunnelDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelDeleteResponseEnvelopeSuccess bool - -const ( - CfdTunnelDeleteResponseEnvelopeSuccessTrue CfdTunnelDeleteResponseEnvelopeSuccess = true -) - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelParams struct { - // A user-friendly name for the tunnel. - Name param.Field[string] `json:"name,required"` - // Indicates if this is a locally or remotely configured tunnel. If `local`, manage - // the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the - // tunnel on the Zero Trust dashboard or using the - // [Cloudflare Tunnel configuration](https://api.cloudflare.com/#cloudflare-tunnel-configuration-properties) - // endpoint. - ConfigSrc param.Field[CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrc] `json:"config_src"` - // Sets the password required to run a locally-managed tunnel. Must be at least 32 - // bytes and encoded as a base64 string. - TunnelSecret param.Field[string] `json:"tunnel_secret"` -} - -func (r CfdTunnelCloudflareTunnelNewACloudflareTunnelParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Indicates if this is a locally or remotely configured tunnel. If `local`, manage -// the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the -// tunnel on the Zero Trust dashboard or using the -// [Cloudflare Tunnel configuration](https://api.cloudflare.com/#cloudflare-tunnel-configuration-properties) -// endpoint. -type CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrc string - -const ( - CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrcLocal CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrc = "local" - CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrcCloudflare CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrc = "cloudflare" -) - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelope struct { - Errors []CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessages `json:"messages,required"` - // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - Result CfdTunnelCloudflareTunnelNewACloudflareTunnelResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelope] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrors] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessages] -type cfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeSuccess bool - -const ( - CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeSuccessTrue CfdTunnelCloudflareTunnelNewACloudflareTunnelResponseEnvelopeSuccess = true -) - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsParams struct { - ExcludePrefix param.Field[string] `query:"exclude_prefix"` - // If provided, include only tunnels that were created (and not deleted) before - // this time. - ExistedAt param.Field[time.Time] `query:"existed_at" format:"date-time"` - IncludePrefix param.Field[string] `query:"include_prefix"` - // If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If - // empty, all tunnels will be included. - IsDeleted param.Field[bool] `query:"is_deleted"` - // A user-friendly name for the tunnel. - Name param.Field[string] `query:"name"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Number of results to display. - PerPage param.Field[float64] `query:"per_page"` - WasActiveAt param.Field[time.Time] `query:"was_active_at" format:"date-time"` - WasInactiveAt param.Field[time.Time] `query:"was_inactive_at" format:"date-time"` -} - -// URLQuery serializes [CfdTunnelCloudflareTunnelListCloudflareTunnelsParams]'s -// query parameters as `url.Values`. -func (r CfdTunnelCloudflareTunnelListCloudflareTunnelsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelope struct { - Errors []CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result []CfdTunnelCloudflareTunnelListCloudflareTunnelsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfo `json:"result_info"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelope] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrors] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessages] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeSuccess bool - -const ( - CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeSuccessTrue CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeSuccess = true -) - -type CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfo] -type cfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelCloudflareTunnelListCloudflareTunnelsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelGetResponseEnvelope struct { - Errors []CfdTunnelGetResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelGetResponseEnvelopeMessages `json:"messages,required"` - // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - Result CfdTunnelGetResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelGetResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelGetResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [CfdTunnelGetResponseEnvelope] -type cfdTunnelGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [CfdTunnelGetResponseEnvelopeErrors] -type cfdTunnelGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CfdTunnelGetResponseEnvelopeMessages] -type cfdTunnelGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelGetResponseEnvelopeSuccess bool - -const ( - CfdTunnelGetResponseEnvelopeSuccessTrue CfdTunnelGetResponseEnvelopeSuccess = true -) diff --git a/cfdtunnelconfiguration.go b/cfdtunnelconfiguration.go deleted file mode 100644 index 0cdd6b72f84..00000000000 --- a/cfdtunnelconfiguration.go +++ /dev/null @@ -1,429 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -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" -) - -// CfdTunnelConfigurationService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCfdTunnelConfigurationService] -// method instead. -type CfdTunnelConfigurationService struct { - Options []option.RequestOption -} - -// NewCfdTunnelConfigurationService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCfdTunnelConfigurationService(opts ...option.RequestOption) (r *CfdTunnelConfigurationService) { - r = &CfdTunnelConfigurationService{} - r.Options = opts - return -} - -// Gets the configuration for a remotely-managed tunnel -func (r *CfdTunnelConfigurationService) CloudflareTunnelConfigurationGetConfiguration(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/configurations", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Adds or updates the configuration for a remotely-managed tunnel. -func (r *CfdTunnelConfigurationService) CloudflareTunnelConfigurationPutConfiguration(ctx context.Context, accountID string, tunnelID string, body CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParams, opts ...option.RequestOption) (res *CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/configurations", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by -// [CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseUnknown], -// [CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseArray] -// or [shared.UnionString]. -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse interface { - ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseArray []interface{} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseArray) ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse() { -} - -// Union satisfied by -// [CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseUnknown], -// [CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseArray] -// or [shared.UnionString]. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse interface { - ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseArray []interface{} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseArray) ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse() { -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelope struct { - Errors []CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelope] -type cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrors] -type cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessages] -type cfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeSuccess bool - -const ( - CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeSuccessTrue CfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponseEnvelopeSuccess = true -) - -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParams struct { - // The tunnel configuration and ingress rules. - Config param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfig] `json:"config"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The tunnel configuration and ingress rules. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfig struct { - // List of public hostname definitions - Ingress param.Field[[]CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngress] `json:"ingress"` - // Configuration parameters of connection between cloudflared and origin server. - OriginRequest param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequest] `json:"originRequest"` - // Enable private network access from WARP users to private network routes - WarpRouting param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigWarpRouting] `json:"warp-routing"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Public hostname -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngress struct { - // Public hostname for this service. - Hostname param.Field[string] `json:"hostname,required"` - // Protocol and address of destination server. Supported protocols: http://, - // https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively - // can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - Service param.Field[string] `json:"service,required"` - // Configuration parameters of connection between cloudflared and origin server. - OriginRequest param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest] `json:"originRequest"` - // Requests with this path route to this public hostname. - Path param.Field[string] `json:"path"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngress) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Configuration parameters of connection between cloudflared and origin server. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest struct { - // For all L7 requests to this hostname, cloudflared will validate each request's - // Cf-Access-Jwt-Assertion request header. - Access param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess] `json:"access"` - // Path to the certificate authority (CA) for the certificate of your origin. This - // option should be used only if your certificate is not signed by Cloudflare. - CaPool param.Field[string] `json:"caPool"` - // Timeout for establishing a new TCP connection to your origin server. This - // excludes the time taken to establish TLS, which is controlled by tlsTimeout. - ConnectTimeout param.Field[int64] `json:"connectTimeout"` - // Disables chunked transfer encoding. Useful if you are running a WSGI server. - DisableChunkedEncoding param.Field[bool] `json:"disableChunkedEncoding"` - // Attempt to connect to origin using HTTP2. Origin must be configured as https. - HTTP2Origin param.Field[bool] `json:"http2Origin"` - // Sets the HTTP Host header on requests sent to the local service. - HTTPHostHeader param.Field[string] `json:"httpHostHeader"` - // Maximum number of idle keepalive connections between Tunnel and your origin. - // This does not restrict the total number of concurrent connections. - KeepAliveConnections param.Field[int64] `json:"keepAliveConnections"` - // Timeout after which an idle keepalive connection can be discarded. - KeepAliveTimeout param.Field[int64] `json:"keepAliveTimeout"` - // Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local - // network has misconfigured one of the protocols. - NoHappyEyeballs param.Field[bool] `json:"noHappyEyeballs"` - // Disables TLS verification of the certificate presented by your origin. Will - // allow any certificate from the origin to be accepted. - NoTLSVerify param.Field[bool] `json:"noTLSVerify"` - // Hostname that cloudflared should expect from your origin server certificate. - OriginServerName param.Field[string] `json:"originServerName"` - // cloudflared starts a proxy server to translate HTTP traffic into TCP when - // proxying, for example, SSH or RDP. This configures what type of proxy will be - // started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 - // proxy. - ProxyType param.Field[string] `json:"proxyType"` - // The timeout after which a TCP keepalive packet is sent on a connection between - // Tunnel and the origin server. - TcpKeepAlive param.Field[int64] `json:"tcpKeepAlive"` - // Timeout for completing a TLS handshake to your origin server, if you have chosen - // to connect Tunnel to an HTTPS server. - TLSTimeout param.Field[int64] `json:"tlsTimeout"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// For all L7 requests to this hostname, cloudflared will validate each request's -// Cf-Access-Jwt-Assertion request header. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess struct { - // Access applications that are allowed to reach this hostname for this Tunnel. - // Audience tags can be identified in the dashboard or via the List Access policies - // API. - AudTag param.Field[[]string] `json:"audTag,required"` - TeamName param.Field[string] `json:"teamName,required"` - // Deny traffic that has not fulfilled Access authorization. - Required param.Field[bool] `json:"required"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Configuration parameters of connection between cloudflared and origin server. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequest struct { - // For all L7 requests to this hostname, cloudflared will validate each request's - // Cf-Access-Jwt-Assertion request header. - Access param.Field[CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequestAccess] `json:"access"` - // Path to the certificate authority (CA) for the certificate of your origin. This - // option should be used only if your certificate is not signed by Cloudflare. - CaPool param.Field[string] `json:"caPool"` - // Timeout for establishing a new TCP connection to your origin server. This - // excludes the time taken to establish TLS, which is controlled by tlsTimeout. - ConnectTimeout param.Field[int64] `json:"connectTimeout"` - // Disables chunked transfer encoding. Useful if you are running a WSGI server. - DisableChunkedEncoding param.Field[bool] `json:"disableChunkedEncoding"` - // Attempt to connect to origin using HTTP2. Origin must be configured as https. - HTTP2Origin param.Field[bool] `json:"http2Origin"` - // Sets the HTTP Host header on requests sent to the local service. - HTTPHostHeader param.Field[string] `json:"httpHostHeader"` - // Maximum number of idle keepalive connections between Tunnel and your origin. - // This does not restrict the total number of concurrent connections. - KeepAliveConnections param.Field[int64] `json:"keepAliveConnections"` - // Timeout after which an idle keepalive connection can be discarded. - KeepAliveTimeout param.Field[int64] `json:"keepAliveTimeout"` - // Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local - // network has misconfigured one of the protocols. - NoHappyEyeballs param.Field[bool] `json:"noHappyEyeballs"` - // Disables TLS verification of the certificate presented by your origin. Will - // allow any certificate from the origin to be accepted. - NoTLSVerify param.Field[bool] `json:"noTLSVerify"` - // Hostname that cloudflared should expect from your origin server certificate. - OriginServerName param.Field[string] `json:"originServerName"` - // cloudflared starts a proxy server to translate HTTP traffic into TCP when - // proxying, for example, SSH or RDP. This configures what type of proxy will be - // started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 - // proxy. - ProxyType param.Field[string] `json:"proxyType"` - // The timeout after which a TCP keepalive packet is sent on a connection between - // Tunnel and the origin server. - TcpKeepAlive param.Field[int64] `json:"tcpKeepAlive"` - // Timeout for completing a TLS handshake to your origin server, if you have chosen - // to connect Tunnel to an HTTPS server. - TLSTimeout param.Field[int64] `json:"tlsTimeout"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequest) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// For all L7 requests to this hostname, cloudflared will validate each request's -// Cf-Access-Jwt-Assertion request header. -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequestAccess struct { - // Access applications that are allowed to reach this hostname for this Tunnel. - // Audience tags can be identified in the dashboard or via the List Access policies - // API. - AudTag param.Field[[]string] `json:"audTag,required"` - TeamName param.Field[string] `json:"teamName,required"` - // Deny traffic that has not fulfilled Access authorization. - Required param.Field[bool] `json:"required"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequestAccess) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Enable private network access from WARP users to private network routes -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigWarpRouting struct { - Enabled param.Field[bool] `json:"enabled"` -} - -func (r CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigWarpRouting) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelope struct { - Errors []CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelope] -type cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrors] -type cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessages] -type cfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeSuccess bool - -const ( - CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeSuccessTrue CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponseEnvelopeSuccess = true -) diff --git a/cfdtunnelconnection.go b/cfdtunnelconnection.go deleted file mode 100644 index 05939ab9801..00000000000 --- a/cfdtunnelconnection.go +++ /dev/null @@ -1,361 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "reflect" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "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" -) - -// CfdTunnelConnectionService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCfdTunnelConnectionService] -// method instead. -type CfdTunnelConnectionService struct { - Options []option.RequestOption -} - -// NewCfdTunnelConnectionService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCfdTunnelConnectionService(opts ...option.RequestOption) (r *CfdTunnelConnectionService) { - r = &CfdTunnelConnectionService{} - r.Options = opts - return -} - -// Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel -// independently of its current state. If no connector id (client_id) is provided -// all connectors will be removed. We recommend running this command after rotating -// tokens. -func (r *CfdTunnelConnectionService) Delete(ctx context.Context, accountID string, tunnelID string, params CfdTunnelConnectionDeleteParams, opts ...option.RequestOption) (res *CfdTunnelConnectionDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelConnectionDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/connections", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches connection details for a Cloudflare Tunnel. -func (r *CfdTunnelConnectionService) CloudflareTunnelListCloudflareTunnelConnections(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *[]CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/connections", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [CfdTunnelConnectionDeleteResponseUnknown], -// [CfdTunnelConnectionDeleteResponseArray] or [shared.UnionString]. -type CfdTunnelConnectionDeleteResponse interface { - ImplementsCfdTunnelConnectionDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CfdTunnelConnectionDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CfdTunnelConnectionDeleteResponseArray []interface{} - -func (r CfdTunnelConnectionDeleteResponseArray) ImplementsCfdTunnelConnectionDeleteResponse() {} - -// A client (typically cloudflared) that maintains connections to a Cloudflare data -// center. -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // The cloudflared OS architecture used to establish this connection. - Arch string `json:"arch"` - // The version of the remote tunnel configuration. Used internally to sync - // cloudflared with the Zero Trust dashboard. - ConfigVersion int64 `json:"config_version"` - // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Conns []CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConn `json:"conns"` - // Features enabled for the Cloudflare Tunnel. - Features []string `json:"features"` - // Timestamp of when the tunnel connection was started. - RunAt time.Time `json:"run_at" format:"date-time"` - // The cloudflared version used to establish this connection. - Version string `json:"version"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseJSON struct { - ID apijson.Field - Arch apijson.Field - ConfigVersion apijson.Field - Conns apijson.Field - Features apijson.Field - RunAt apijson.Field - Version apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConn struct { - // UUID of the Cloudflare Tunnel connection. - ID string `json:"id"` - // UUID of the cloudflared instance. - ClientID interface{} `json:"client_id"` - // The cloudflared version used to establish this connection. - ClientVersion string `json:"client_version"` - // The Cloudflare data center used for this connection. - ColoName string `json:"colo_name"` - // Cloudflare continues to track connections for several minutes after they - // disconnect. This is an optimization to improve latency and reliability of - // reconnecting. If `true`, the connection has disconnected but is still being - // tracked. If `false`, the connection is actively serving traffic. - IsPendingReconnect bool `json:"is_pending_reconnect"` - // Timestamp of when the connection was established. - OpenedAt time.Time `json:"opened_at" format:"date-time"` - // The public IP address of the host running cloudflared. - OriginIP string `json:"origin_ip"` - // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConnJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConnJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConn] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConnJSON struct { - ID apijson.Field - ClientID apijson.Field - ClientVersion apijson.Field - ColoName apijson.Field - IsPendingReconnect apijson.Field - OpenedAt apijson.Field - OriginIP apijson.Field - Uuid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseConn) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionDeleteParams struct { - Body param.Field[interface{}] `json:"body,required"` - // UUID of the Cloudflare Tunnel Connector to disconnect. - ClientID param.Field[string] `query:"client_id"` -} - -func (r CfdTunnelConnectionDeleteParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -// URLQuery serializes [CfdTunnelConnectionDeleteParams]'s query parameters as -// `url.Values`. -func (r CfdTunnelConnectionDeleteParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type CfdTunnelConnectionDeleteResponseEnvelope struct { - Errors []CfdTunnelConnectionDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelConnectionDeleteResponseEnvelopeMessages `json:"messages,required"` - Result CfdTunnelConnectionDeleteResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelConnectionDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelConnectionDeleteResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelConnectionDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [CfdTunnelConnectionDeleteResponseEnvelope] -type cfdTunnelConnectionDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectionDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelConnectionDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [CfdTunnelConnectionDeleteResponseEnvelopeErrors] -type cfdTunnelConnectionDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectionDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelConnectionDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [CfdTunnelConnectionDeleteResponseEnvelopeMessages] -type cfdTunnelConnectionDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelConnectionDeleteResponseEnvelopeSuccess bool - -const ( - CfdTunnelConnectionDeleteResponseEnvelopeSuccessTrue CfdTunnelConnectionDeleteResponseEnvelopeSuccess = true -) - -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelope struct { - Errors []CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessages `json:"messages,required"` - Result []CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfo `json:"result_info"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelope] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrors] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessages] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeSuccess bool - -const ( - CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeSuccessTrue CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeSuccess = true -) - -type CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfo] -type cfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnectionsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/cfdtunnelmanagement.go b/cfdtunnelmanagement.go deleted file mode 100644 index 1b73dd546cc..00000000000 --- a/cfdtunnelmanagement.go +++ /dev/null @@ -1,154 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -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" -) - -// CfdTunnelManagementService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCfdTunnelManagementService] -// method instead. -type CfdTunnelManagementService struct { - Options []option.RequestOption -} - -// NewCfdTunnelManagementService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCfdTunnelManagementService(opts ...option.RequestOption) (r *CfdTunnelManagementService) { - r = &CfdTunnelManagementService{} - r.Options = opts - return -} - -// Gets a management token used to access the management resources (i.e. Streaming -// Logs) of a tunnel. -func (r *CfdTunnelManagementService) New(ctx context.Context, accountID string, tunnelID string, body CfdTunnelManagementNewParams, opts ...option.RequestOption) (res *CfdTunnelManagementNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelManagementNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/management", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by [CfdTunnelManagementNewResponseUnknown], -// [CfdTunnelManagementNewResponseArray] or [shared.UnionString]. -type CfdTunnelManagementNewResponse interface { - ImplementsCfdTunnelManagementNewResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CfdTunnelManagementNewResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CfdTunnelManagementNewResponseArray []interface{} - -func (r CfdTunnelManagementNewResponseArray) ImplementsCfdTunnelManagementNewResponse() {} - -type CfdTunnelManagementNewParams struct { - Resources param.Field[[]CfdTunnelManagementNewParamsResource] `json:"resources,required"` -} - -func (r CfdTunnelManagementNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Management resources the token will have access to. -type CfdTunnelManagementNewParamsResource string - -const ( - CfdTunnelManagementNewParamsResourceLogs CfdTunnelManagementNewParamsResource = "logs" -) - -type CfdTunnelManagementNewResponseEnvelope struct { - Errors []CfdTunnelManagementNewResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelManagementNewResponseEnvelopeMessages `json:"messages,required"` - Result CfdTunnelManagementNewResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelManagementNewResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelManagementNewResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelManagementNewResponseEnvelopeJSON contains the JSON metadata for the -// struct [CfdTunnelManagementNewResponseEnvelope] -type cfdTunnelManagementNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelManagementNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelManagementNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelManagementNewResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelManagementNewResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [CfdTunnelManagementNewResponseEnvelopeErrors] -type cfdTunnelManagementNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelManagementNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelManagementNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelManagementNewResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelManagementNewResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [CfdTunnelManagementNewResponseEnvelopeMessages] -type cfdTunnelManagementNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelManagementNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelManagementNewResponseEnvelopeSuccess bool - -const ( - CfdTunnelManagementNewResponseEnvelopeSuccessTrue CfdTunnelManagementNewResponseEnvelopeSuccess = true -) diff --git a/cfdtunneltoken.go b/cfdtunneltoken.go deleted file mode 100644 index cf543e48a05..00000000000 --- a/cfdtunneltoken.go +++ /dev/null @@ -1,143 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -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" -) - -// CfdTunnelTokenService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCfdTunnelTokenService] method -// instead. -type CfdTunnelTokenService struct { - Options []option.RequestOption -} - -// NewCfdTunnelTokenService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewCfdTunnelTokenService(opts ...option.RequestOption) (r *CfdTunnelTokenService) { - r = &CfdTunnelTokenService{} - r.Options = opts - return -} - -// Gets the token used to associate cloudflared with a specific tunnel. -func (r *CfdTunnelTokenService) CloudflareTunnelGetACloudflareTunnelToken(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse, err error) { - opts = append(r.Options[:], opts...) - var env CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelope - path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/token", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Union satisfied by -// [CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseUnknown], -// [CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseArray] or -// [shared.UnionString]. -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse interface { - ImplementsCfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseArray []interface{} - -func (r CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseArray) ImplementsCfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse() { -} - -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelope struct { - Errors []CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessages `json:"messages,required"` - Result CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse `json:"result,required"` - // Whether the API call was successful - Success CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeJSON `json:"-"` -} - -// cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelope] -type cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrorsJSON `json:"-"` -} - -// cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrors] -type cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessagesJSON `json:"-"` -} - -// cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessages] -type cfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeSuccess bool - -const ( - CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeSuccessTrue CfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponseEnvelopeSuccess = true -) diff --git a/challengewidget.go b/challengewidget.go index 76e6e8e17ed..f8be1e2f363 100644 --- a/challengewidget.go +++ b/challengewidget.go @@ -48,19 +48,6 @@ func (r *ChallengeWidgetService) New(ctx context.Context, accountIdentifier stri return } -// Update the configuration of a widget. -func (r *ChallengeWidgetService) Update(ctx context.Context, accountIdentifier string, sitekey string, body ChallengeWidgetUpdateParams, opts ...option.RequestOption) (res *ChallengeWidgetUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env ChallengeWidgetUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists all turnstile widgets of an account. func (r *ChallengeWidgetService) List(ctx context.Context, accountIdentifier string, query ChallengeWidgetListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[ChallengeWidgetListResponse], err error) { var raw *http.Response @@ -110,6 +97,19 @@ func (r *ChallengeWidgetService) Get(ctx context.Context, accountIdentifier stri return } +// Update the configuration of a widget. +func (r *ChallengeWidgetService) Replace(ctx context.Context, accountIdentifier string, sitekey string, body ChallengeWidgetReplaceParams, opts ...option.RequestOption) (res *ChallengeWidgetReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env ChallengeWidgetReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Generate a new secret key for this widget. If `invalidate_immediately` is set to // `false`, the previous secret remains valid for 2 hours. // @@ -205,85 +205,6 @@ const ( ChallengeWidgetNewResponseRegionWorld ChallengeWidgetNewResponseRegion = "world" ) -// A Turnstile widget's detailed configuration -type ChallengeWidgetUpdateResponse struct { - // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive - // challenges in response to malicious bots (ENT only). - BotFightMode bool `json:"bot_fight_mode,required"` - // If Turnstile is embedded on a Cloudflare site and the widget should grant - // challenge clearance, this setting can determine the clearance level to be set - ClearanceLevel ChallengeWidgetUpdateResponseClearanceLevel `json:"clearance_level,required"` - // When the widget was created. - CreatedOn time.Time `json:"created_on,required" format:"date-time"` - Domains []string `json:"domains,required"` - // Widget Mode - Mode ChallengeWidgetUpdateResponseMode `json:"mode,required"` - // When the widget was modified. - ModifiedOn time.Time `json:"modified_on,required" format:"date-time"` - // Human readable widget name. Not unique. Cloudflare suggests that you set this to - // a meaningful string to make it easier to identify your widget, and where it is - // used. - Name string `json:"name,required"` - // Do not show any Cloudflare branding on the widget (ENT only). - Offlabel bool `json:"offlabel,required"` - // Region where this widget can be used. - Region ChallengeWidgetUpdateResponseRegion `json:"region,required"` - // Secret key for this widget. - Secret string `json:"secret,required"` - // Widget item identifier tag. - Sitekey string `json:"sitekey,required"` - JSON challengeWidgetUpdateResponseJSON `json:"-"` -} - -// challengeWidgetUpdateResponseJSON contains the JSON metadata for the struct -// [ChallengeWidgetUpdateResponse] -type challengeWidgetUpdateResponseJSON struct { - BotFightMode apijson.Field - ClearanceLevel apijson.Field - CreatedOn apijson.Field - Domains apijson.Field - Mode apijson.Field - ModifiedOn apijson.Field - Name apijson.Field - Offlabel apijson.Field - Region apijson.Field - Secret apijson.Field - Sitekey apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ChallengeWidgetUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// If Turnstile is embedded on a Cloudflare site and the widget should grant -// challenge clearance, this setting can determine the clearance level to be set -type ChallengeWidgetUpdateResponseClearanceLevel string - -const ( - ChallengeWidgetUpdateResponseClearanceLevelNoClearance ChallengeWidgetUpdateResponseClearanceLevel = "no_clearance" - ChallengeWidgetUpdateResponseClearanceLevelJschallenge ChallengeWidgetUpdateResponseClearanceLevel = "jschallenge" - ChallengeWidgetUpdateResponseClearanceLevelManaged ChallengeWidgetUpdateResponseClearanceLevel = "managed" - ChallengeWidgetUpdateResponseClearanceLevelInteractive ChallengeWidgetUpdateResponseClearanceLevel = "interactive" -) - -// Widget Mode -type ChallengeWidgetUpdateResponseMode string - -const ( - ChallengeWidgetUpdateResponseModeNonInteractive ChallengeWidgetUpdateResponseMode = "non-interactive" - ChallengeWidgetUpdateResponseModeInvisible ChallengeWidgetUpdateResponseMode = "invisible" - ChallengeWidgetUpdateResponseModeManaged ChallengeWidgetUpdateResponseMode = "managed" -) - -// Region where this widget can be used. -type ChallengeWidgetUpdateResponseRegion string - -const ( - ChallengeWidgetUpdateResponseRegionWorld ChallengeWidgetUpdateResponseRegion = "world" -) - // A Turnstile Widgets configuration as it appears in listings type ChallengeWidgetListResponse struct { // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive @@ -518,6 +439,85 @@ const ( ChallengeWidgetGetResponseRegionWorld ChallengeWidgetGetResponseRegion = "world" ) +// A Turnstile widget's detailed configuration +type ChallengeWidgetReplaceResponse struct { + // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive + // challenges in response to malicious bots (ENT only). + BotFightMode bool `json:"bot_fight_mode,required"` + // If Turnstile is embedded on a Cloudflare site and the widget should grant + // challenge clearance, this setting can determine the clearance level to be set + ClearanceLevel ChallengeWidgetReplaceResponseClearanceLevel `json:"clearance_level,required"` + // When the widget was created. + CreatedOn time.Time `json:"created_on,required" format:"date-time"` + Domains []string `json:"domains,required"` + // Widget Mode + Mode ChallengeWidgetReplaceResponseMode `json:"mode,required"` + // When the widget was modified. + ModifiedOn time.Time `json:"modified_on,required" format:"date-time"` + // Human readable widget name. Not unique. Cloudflare suggests that you set this to + // a meaningful string to make it easier to identify your widget, and where it is + // used. + Name string `json:"name,required"` + // Do not show any Cloudflare branding on the widget (ENT only). + Offlabel bool `json:"offlabel,required"` + // Region where this widget can be used. + Region ChallengeWidgetReplaceResponseRegion `json:"region,required"` + // Secret key for this widget. + Secret string `json:"secret,required"` + // Widget item identifier tag. + Sitekey string `json:"sitekey,required"` + JSON challengeWidgetReplaceResponseJSON `json:"-"` +} + +// challengeWidgetReplaceResponseJSON contains the JSON metadata for the struct +// [ChallengeWidgetReplaceResponse] +type challengeWidgetReplaceResponseJSON struct { + BotFightMode apijson.Field + ClearanceLevel apijson.Field + CreatedOn apijson.Field + Domains apijson.Field + Mode apijson.Field + ModifiedOn apijson.Field + Name apijson.Field + Offlabel apijson.Field + Region apijson.Field + Secret apijson.Field + Sitekey apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ChallengeWidgetReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// If Turnstile is embedded on a Cloudflare site and the widget should grant +// challenge clearance, this setting can determine the clearance level to be set +type ChallengeWidgetReplaceResponseClearanceLevel string + +const ( + ChallengeWidgetReplaceResponseClearanceLevelNoClearance ChallengeWidgetReplaceResponseClearanceLevel = "no_clearance" + ChallengeWidgetReplaceResponseClearanceLevelJschallenge ChallengeWidgetReplaceResponseClearanceLevel = "jschallenge" + ChallengeWidgetReplaceResponseClearanceLevelManaged ChallengeWidgetReplaceResponseClearanceLevel = "managed" + ChallengeWidgetReplaceResponseClearanceLevelInteractive ChallengeWidgetReplaceResponseClearanceLevel = "interactive" +) + +// Widget Mode +type ChallengeWidgetReplaceResponseMode string + +const ( + ChallengeWidgetReplaceResponseModeNonInteractive ChallengeWidgetReplaceResponseMode = "non-interactive" + ChallengeWidgetReplaceResponseModeInvisible ChallengeWidgetReplaceResponseMode = "invisible" + ChallengeWidgetReplaceResponseModeManaged ChallengeWidgetReplaceResponseMode = "managed" +) + +// Region where this widget can be used. +type ChallengeWidgetReplaceResponseRegion string + +const ( + ChallengeWidgetReplaceResponseRegionWorld ChallengeWidgetReplaceResponseRegion = "world" +) + // A Turnstile widget's detailed configuration type ChallengeWidgetRotateSecretResponse struct { // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive @@ -776,111 +776,6 @@ func (r *ChallengeWidgetNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte return apijson.UnmarshalRoot(data, r) } -type ChallengeWidgetUpdateParams struct { - Domains param.Field[[]string] `json:"domains,required"` - // Widget Mode - Mode param.Field[ChallengeWidgetUpdateParamsMode] `json:"mode,required"` - // Human readable widget name. Not unique. Cloudflare suggests that you set this to - // a meaningful string to make it easier to identify your widget, and where it is - // used. - Name param.Field[string] `json:"name,required"` - // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive - // challenges in response to malicious bots (ENT only). - BotFightMode param.Field[bool] `json:"bot_fight_mode"` - // If Turnstile is embedded on a Cloudflare site and the widget should grant - // challenge clearance, this setting can determine the clearance level to be set - ClearanceLevel param.Field[ChallengeWidgetUpdateParamsClearanceLevel] `json:"clearance_level"` - // Do not show any Cloudflare branding on the widget (ENT only). - Offlabel param.Field[bool] `json:"offlabel"` -} - -func (r ChallengeWidgetUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Widget Mode -type ChallengeWidgetUpdateParamsMode string - -const ( - ChallengeWidgetUpdateParamsModeNonInteractive ChallengeWidgetUpdateParamsMode = "non-interactive" - ChallengeWidgetUpdateParamsModeInvisible ChallengeWidgetUpdateParamsMode = "invisible" - ChallengeWidgetUpdateParamsModeManaged ChallengeWidgetUpdateParamsMode = "managed" -) - -// If Turnstile is embedded on a Cloudflare site and the widget should grant -// challenge clearance, this setting can determine the clearance level to be set -type ChallengeWidgetUpdateParamsClearanceLevel string - -const ( - ChallengeWidgetUpdateParamsClearanceLevelNoClearance ChallengeWidgetUpdateParamsClearanceLevel = "no_clearance" - ChallengeWidgetUpdateParamsClearanceLevelJschallenge ChallengeWidgetUpdateParamsClearanceLevel = "jschallenge" - ChallengeWidgetUpdateParamsClearanceLevelManaged ChallengeWidgetUpdateParamsClearanceLevel = "managed" - ChallengeWidgetUpdateParamsClearanceLevelInteractive ChallengeWidgetUpdateParamsClearanceLevel = "interactive" -) - -type ChallengeWidgetUpdateResponseEnvelope struct { - Errors []ChallengeWidgetUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ChallengeWidgetUpdateResponseEnvelopeMessages `json:"messages,required"` - // Whether the API call was successful - Success bool `json:"success,required"` - // A Turnstile widget's detailed configuration - Result ChallengeWidgetUpdateResponse `json:"result"` - JSON challengeWidgetUpdateResponseEnvelopeJSON `json:"-"` -} - -// challengeWidgetUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [ChallengeWidgetUpdateResponseEnvelope] -type challengeWidgetUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ChallengeWidgetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ChallengeWidgetUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON challengeWidgetUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// challengeWidgetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [ChallengeWidgetUpdateResponseEnvelopeErrors] -type challengeWidgetUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ChallengeWidgetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ChallengeWidgetUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON challengeWidgetUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// challengeWidgetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [ChallengeWidgetUpdateResponseEnvelopeMessages] -type challengeWidgetUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ChallengeWidgetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type ChallengeWidgetListParams struct { // Direction to order widgets. Direction param.Field[ChallengeWidgetListParamsDirection] `query:"direction"` @@ -1046,6 +941,111 @@ func (r *ChallengeWidgetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) return apijson.UnmarshalRoot(data, r) } +type ChallengeWidgetReplaceParams struct { + Domains param.Field[[]string] `json:"domains,required"` + // Widget Mode + Mode param.Field[ChallengeWidgetReplaceParamsMode] `json:"mode,required"` + // Human readable widget name. Not unique. Cloudflare suggests that you set this to + // a meaningful string to make it easier to identify your widget, and where it is + // used. + Name param.Field[string] `json:"name,required"` + // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive + // challenges in response to malicious bots (ENT only). + BotFightMode param.Field[bool] `json:"bot_fight_mode"` + // If Turnstile is embedded on a Cloudflare site and the widget should grant + // challenge clearance, this setting can determine the clearance level to be set + ClearanceLevel param.Field[ChallengeWidgetReplaceParamsClearanceLevel] `json:"clearance_level"` + // Do not show any Cloudflare branding on the widget (ENT only). + Offlabel param.Field[bool] `json:"offlabel"` +} + +func (r ChallengeWidgetReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Widget Mode +type ChallengeWidgetReplaceParamsMode string + +const ( + ChallengeWidgetReplaceParamsModeNonInteractive ChallengeWidgetReplaceParamsMode = "non-interactive" + ChallengeWidgetReplaceParamsModeInvisible ChallengeWidgetReplaceParamsMode = "invisible" + ChallengeWidgetReplaceParamsModeManaged ChallengeWidgetReplaceParamsMode = "managed" +) + +// If Turnstile is embedded on a Cloudflare site and the widget should grant +// challenge clearance, this setting can determine the clearance level to be set +type ChallengeWidgetReplaceParamsClearanceLevel string + +const ( + ChallengeWidgetReplaceParamsClearanceLevelNoClearance ChallengeWidgetReplaceParamsClearanceLevel = "no_clearance" + ChallengeWidgetReplaceParamsClearanceLevelJschallenge ChallengeWidgetReplaceParamsClearanceLevel = "jschallenge" + ChallengeWidgetReplaceParamsClearanceLevelManaged ChallengeWidgetReplaceParamsClearanceLevel = "managed" + ChallengeWidgetReplaceParamsClearanceLevelInteractive ChallengeWidgetReplaceParamsClearanceLevel = "interactive" +) + +type ChallengeWidgetReplaceResponseEnvelope struct { + Errors []ChallengeWidgetReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []ChallengeWidgetReplaceResponseEnvelopeMessages `json:"messages,required"` + // Whether the API call was successful + Success bool `json:"success,required"` + // A Turnstile widget's detailed configuration + Result ChallengeWidgetReplaceResponse `json:"result"` + JSON challengeWidgetReplaceResponseEnvelopeJSON `json:"-"` +} + +// challengeWidgetReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [ChallengeWidgetReplaceResponseEnvelope] +type challengeWidgetReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ChallengeWidgetReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ChallengeWidgetReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON challengeWidgetReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// challengeWidgetReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ChallengeWidgetReplaceResponseEnvelopeErrors] +type challengeWidgetReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ChallengeWidgetReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ChallengeWidgetReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON challengeWidgetReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// challengeWidgetReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ChallengeWidgetReplaceResponseEnvelopeMessages] +type challengeWidgetReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ChallengeWidgetReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type ChallengeWidgetRotateSecretParams struct { // If `invalidate_immediately` is set to `false`, the previous secret will remain // valid for two hours. Otherwise, the secret is immediately invalidated, and diff --git a/challengewidget_test.go b/challengewidget_test.go index 6867aa50350..853a5e107f8 100644 --- a/challengewidget_test.go +++ b/challengewidget_test.go @@ -55,7 +55,7 @@ func TestChallengeWidgetNewWithOptionalParams(t *testing.T) { } } -func TestChallengeWidgetUpdateWithOptionalParams(t *testing.T) { +func TestChallengeWidgetListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -71,17 +71,14 @@ func TestChallengeWidgetUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Challenges.Widgets.Update( + _, err := client.Challenges.Widgets.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "0x4AAF00AAAABn0R22HWm-YUc", - cloudflare.ChallengeWidgetUpdateParams{ - Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}), - Mode: cloudflare.F(cloudflare.ChallengeWidgetUpdateParamsModeInvisible), - Name: cloudflare.F("blog.cloudflare.com login form"), - BotFightMode: cloudflare.F(true), - ClearanceLevel: cloudflare.F(cloudflare.ChallengeWidgetUpdateParamsClearanceLevelInteractive), - Offlabel: cloudflare.F(true), + cloudflare.ChallengeWidgetListParams{ + Direction: cloudflare.F(cloudflare.ChallengeWidgetListParamsDirectionAsc), + Order: cloudflare.F(cloudflare.ChallengeWidgetListParamsOrderID), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), }, ) if err != nil { @@ -93,7 +90,7 @@ func TestChallengeWidgetUpdateWithOptionalParams(t *testing.T) { } } -func TestChallengeWidgetListWithOptionalParams(t *testing.T) { +func TestChallengeWidgetDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -109,15 +106,10 @@ func TestChallengeWidgetListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Challenges.Widgets.List( + _, err := client.Challenges.Widgets.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ChallengeWidgetListParams{ - Direction: cloudflare.F(cloudflare.ChallengeWidgetListParamsDirectionAsc), - Order: cloudflare.F(cloudflare.ChallengeWidgetListParamsOrderID), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - }, + "0x4AAF00AAAABn0R22HWm-YUc", ) if err != nil { var apierr *cloudflare.Error @@ -128,7 +120,7 @@ func TestChallengeWidgetListWithOptionalParams(t *testing.T) { } } -func TestChallengeWidgetDelete(t *testing.T) { +func TestChallengeWidgetGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -144,7 +136,7 @@ func TestChallengeWidgetDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Challenges.Widgets.Delete( + _, err := client.Challenges.Widgets.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0x4AAF00AAAABn0R22HWm-YUc", @@ -158,7 +150,7 @@ func TestChallengeWidgetDelete(t *testing.T) { } } -func TestChallengeWidgetGet(t *testing.T) { +func TestChallengeWidgetReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -174,10 +166,18 @@ func TestChallengeWidgetGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Challenges.Widgets.Get( + _, err := client.Challenges.Widgets.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0x4AAF00AAAABn0R22HWm-YUc", + cloudflare.ChallengeWidgetReplaceParams{ + Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}), + Mode: cloudflare.F(cloudflare.ChallengeWidgetReplaceParamsModeInvisible), + Name: cloudflare.F("blog.cloudflare.com login form"), + BotFightMode: cloudflare.F(true), + ClearanceLevel: cloudflare.F(cloudflare.ChallengeWidgetReplaceParamsClearanceLevelInteractive), + Offlabel: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/client.go b/client.go index d0a4b83e6b3..a4753d21281 100644 --- a/client.go +++ b/client.go @@ -12,115 +12,105 @@ import ( // interacting with the cloudflare API. You should not instantiate this client // directly, and instead use the [NewClient] method instead. type Client struct { - Options []option.RequestOption - Accounts *AccountService - Certificates *CertificateService - IPs *IPService - Memberships *MembershipService - Users *UserService - Zones *ZoneService - AI *AIService - LoadBalancers *LoadBalancerService - Access *AccessService - DNSAnalytics *DNSAnalyticService - PurgeCaches *PurgeCachService - SSLs *SSLService - Subscriptions *SubscriptionService - Acms *AcmService - Analytics *AnalyticsService - Argo *ArgoService - AvailablePlans *AvailablePlanService - AvailableRatePlans *AvailableRatePlanService - Caches *CachService - CertificateAuthorities *CertificateAuthorityService - ClientCertificates *ClientCertificateService - CustomCertificates *CustomCertificateService - CustomHostnames *CustomHostnameService - CustomNs *CustomNService - DNSRecords *DNSRecordService - DNSSECs *DNSSECService - Emails *EmailService - Filters *FilterService - Firewalls *FirewallService - Healthchecks *HealthcheckService - KeylessCertificates *KeylessCertificateService - Logpush *LogpushService - Logs *LogService - OriginTLSClientAuth *OriginTLSClientAuthService - Pagerules *PageruleService - RateLimits *RateLimitService - SecondaryDNS *SecondaryDNSService - Settings *SettingService - WaitingRooms *WaitingRoomService - Web3s *Web3Service - Workers *WorkerService - ActivationChecks *ActivationCheckService - ManagedHeaders *ManagedHeaderService - PageShields *PageShieldService - Rulesets *RulesetService - URLNormalizations *URLNormalizationService - Spectrums *SpectrumService - Addresses *AddressService - AuditLogs *AuditLogService - Billings *BillingService - BrandProtections *BrandProtectionService - CfdTunnels *CfdTunnelService - Diagnostics *DiagnosticService - DLPs *DLPService - DNSFirewalls *DNSFirewallService - Images *ImageService - Intels *IntelService - Magics *MagicService - AccountMembers *AccountMemberService - Mnms *MnmService - MtlsCertificates *MtlsCertificateService - Pages *PageService - Pcaps *PcapService - Registrar *RegistrarService - RequestTracers *RequestTracerService - Roles *RoleService - Rules *RuleService - Storage *StorageService - Stream *StreamService - Teamnets *TeamnetService - Tunnels *TunnelService - Gateways *GatewayService - Alerting *AlertingService - Devices *DeviceService - D1 *D1Service - DEX *DEXService - R2 *R2Service - Teamnet *TeamnetService - WarpConnector *WarpConnectorService - Dispatchers *DispatcherService - WorkersForPlatforms *WorkersForPlatformService - WorkerDomains *WorkerDomainService - WorkerScripts *WorkerScriptService - Zerotrust *ZerotrustService - Addressing *AddressingService - Challenges *ChallengeService - Hyperdrive *HyperdriveService - Intel *IntelService - Rum *RumService - Vectorize *VectorizeService - URLScanner *URLScannerService - Radar *RadarService - BotManagements *BotManagementService - CacheReserves *CacheReserveService - OriginPostQuantumEncryptions *OriginPostQuantumEncryptionService - Cache *CacheService - Firewall *FirewallService - Zaraz *ZarazService - SpeedAPI *SpeedAPIService - DcvDelegation *DcvDelegationService - Hostnames *HostnameService - PageShield *PageShieldService - FontSettings *FontSettingService - Snippets *SnippetService - DLP *DLPService - Gateway *GatewayService - AccessTags *AccessTagService - Calls *CallService + Options []option.RequestOption + Accounts *AccountService + Certificates *CertificateService + IPs *IPService + Memberships *MembershipService + Users *UserService + Zones *ZoneService + AI *AIService + LoadBalancers *LoadBalancerService + Access *AccessService + DNSAnalytics *DNSAnalyticService + Cache *CacheService + SSL *SSLService + Subscriptions *SubscriptionService + Acm *AcmService + Argo *ArgoService + AvailablePlans *AvailablePlanService + AvailableRatePlans *AvailableRatePlanService + CertificateAuthorities *CertificateAuthorityService + ClientCertificates *ClientCertificateService + CustomCertificates *CustomCertificateService + CustomHostnames *CustomHostnameService + CustomNameservers *CustomNameserverService + DNSRecords *DNSRecordService + DNSSEC *DNSSECService + Emails *EmailService + Filters *FilterService + Firewalls *FirewallService + Healthchecks *HealthcheckService + KeylessCertificates *KeylessCertificateService + Logpush *LogpushService + Logs *LogService + OriginTLSClientAuth *OriginTLSClientAuthService + Pagerules *PageruleService + RateLimits *RateLimitService + SecondaryDNS *SecondaryDNSService + Settings *SettingService + WaitingRooms *WaitingRoomService + Web3 *Web3Service + Workers *WorkerService + ActivationChecks *ActivationCheckService + ManagedHeaders *ManagedHeaderService + PageShield *PageShieldService + Rulesets *RulesetService + URLNormalizations *URLNormalizationService + Spectrum *SpectrumService + Addresses *AddressService + AuditLogs *AuditLogService + Billings *BillingService + BrandProtection *BrandProtectionService + Tunnels *TunnelService + Diagnostics *DiagnosticService + DLP *DLPService + DNSFirewall *DNSFirewallService + Images *ImageService + Intel *IntelService + Magics *MagicService + AccountMembers *AccountMemberService + Mnms *MnmService + MtlsCertificates *MtlsCertificateService + Pages *PageService + Pcaps *PcapService + Registrar *RegistrarService + RequestTracers *RequestTracerService + Roles *RoleService + Rules *RuleService + Storage *StorageService + Stream *StreamService + Teamnets *TeamnetService + Gateways *GatewayService + Alerting *AlertingService + Devices *DeviceService + D1 *D1Service + DEX *DEXService + R2 *R2Service + Teamnet *TeamnetService + WarpConnector *WarpConnectorService + Dispatchers *DispatcherService + WorkersForPlatforms *WorkersForPlatformService + WorkerDomains *WorkerDomainService + WorkerScripts *WorkerScriptService + Zerotrust *ZerotrustService + Addressing *AddressingService + Challenges *ChallengeService + Hyperdrive *HyperdriveService + Rum *RumService + Vectorize *VectorizeService + URLScanner *URLScannerService + Radar *RadarService + BotManagement *BotManagementService + CacheReserve *CacheReserveService + OriginPostQuantumEncryption *OriginPostQuantumEncryptionService + Firewall *FirewallService + Zaraz *ZarazService + Speed *SpeedService + DcvDelegation *DcvDelegationService + Hostnames *HostnameService + Snippets *SnippetService + Calls *CallService } // NewClient generates a new client with the default option read from the @@ -156,22 +146,20 @@ func NewClient(opts ...option.RequestOption) (r *Client) { r.LoadBalancers = NewLoadBalancerService(opts...) r.Access = NewAccessService(opts...) r.DNSAnalytics = NewDNSAnalyticService(opts...) - r.PurgeCaches = NewPurgeCachService(opts...) - r.SSLs = NewSSLService(opts...) + r.Cache = NewCacheService(opts...) + r.SSL = NewSSLService(opts...) r.Subscriptions = NewSubscriptionService(opts...) - r.Acms = NewAcmService(opts...) - r.Analytics = NewAnalyticsService(opts...) + r.Acm = NewAcmService(opts...) r.Argo = NewArgoService(opts...) r.AvailablePlans = NewAvailablePlanService(opts...) r.AvailableRatePlans = NewAvailableRatePlanService(opts...) - r.Caches = NewCachService(opts...) r.CertificateAuthorities = NewCertificateAuthorityService(opts...) r.ClientCertificates = NewClientCertificateService(opts...) r.CustomCertificates = NewCustomCertificateService(opts...) r.CustomHostnames = NewCustomHostnameService(opts...) - r.CustomNs = NewCustomNService(opts...) + r.CustomNameservers = NewCustomNameserverService(opts...) r.DNSRecords = NewDNSRecordService(opts...) - r.DNSSECs = NewDNSSECService(opts...) + r.DNSSEC = NewDNSSECService(opts...) r.Emails = NewEmailService(opts...) r.Filters = NewFilterService(opts...) r.Firewalls = NewFirewallService(opts...) @@ -185,24 +173,24 @@ func NewClient(opts ...option.RequestOption) (r *Client) { r.SecondaryDNS = NewSecondaryDNSService(opts...) r.Settings = NewSettingService(opts...) r.WaitingRooms = NewWaitingRoomService(opts...) - r.Web3s = NewWeb3Service(opts...) + r.Web3 = NewWeb3Service(opts...) r.Workers = NewWorkerService(opts...) r.ActivationChecks = NewActivationCheckService(opts...) r.ManagedHeaders = NewManagedHeaderService(opts...) - r.PageShields = NewPageShieldService(opts...) + r.PageShield = NewPageShieldService(opts...) r.Rulesets = NewRulesetService(opts...) r.URLNormalizations = NewURLNormalizationService(opts...) - r.Spectrums = NewSpectrumService(opts...) + r.Spectrum = NewSpectrumService(opts...) r.Addresses = NewAddressService(opts...) r.AuditLogs = NewAuditLogService(opts...) r.Billings = NewBillingService(opts...) - r.BrandProtections = NewBrandProtectionService(opts...) - r.CfdTunnels = NewCfdTunnelService(opts...) + r.BrandProtection = NewBrandProtectionService(opts...) + r.Tunnels = NewTunnelService(opts...) r.Diagnostics = NewDiagnosticService(opts...) - r.DLPs = NewDLPService(opts...) - r.DNSFirewalls = NewDNSFirewallService(opts...) + r.DLP = NewDLPService(opts...) + r.DNSFirewall = NewDNSFirewallService(opts...) r.Images = NewImageService(opts...) - r.Intels = NewIntelService(opts...) + r.Intel = NewIntelService(opts...) r.Magics = NewMagicService(opts...) r.AccountMembers = NewAccountMemberService(opts...) r.Mnms = NewMnmService(opts...) @@ -216,7 +204,6 @@ func NewClient(opts ...option.RequestOption) (r *Client) { r.Storage = NewStorageService(opts...) r.Stream = NewStreamService(opts...) r.Teamnets = NewTeamnetService(opts...) - r.Tunnels = NewTunnelService(opts...) r.Gateways = NewGatewayService(opts...) r.Alerting = NewAlertingService(opts...) r.Devices = NewDeviceService(opts...) @@ -233,26 +220,19 @@ func NewClient(opts ...option.RequestOption) (r *Client) { r.Addressing = NewAddressingService(opts...) r.Challenges = NewChallengeService(opts...) r.Hyperdrive = NewHyperdriveService(opts...) - r.Intel = NewIntelService(opts...) r.Rum = NewRumService(opts...) r.Vectorize = NewVectorizeService(opts...) r.URLScanner = NewURLScannerService(opts...) r.Radar = NewRadarService(opts...) - r.BotManagements = NewBotManagementService(opts...) - r.CacheReserves = NewCacheReserveService(opts...) - r.OriginPostQuantumEncryptions = NewOriginPostQuantumEncryptionService(opts...) - r.Cache = NewCacheService(opts...) + r.BotManagement = NewBotManagementService(opts...) + r.CacheReserve = NewCacheReserveService(opts...) + r.OriginPostQuantumEncryption = NewOriginPostQuantumEncryptionService(opts...) r.Firewall = NewFirewallService(opts...) r.Zaraz = NewZarazService(opts...) - r.SpeedAPI = NewSpeedAPIService(opts...) + r.Speed = NewSpeedService(opts...) r.DcvDelegation = NewDcvDelegationService(opts...) r.Hostnames = NewHostnameService(opts...) - r.PageShield = NewPageShieldService(opts...) - r.FontSettings = NewFontSettingService(opts...) r.Snippets = NewSnippetService(opts...) - r.DLP = NewDLPService(opts...) - r.Gateway = NewGatewayService(opts...) - r.AccessTags = NewAccessTagService(opts...) r.Calls = NewCallService(opts...) return diff --git a/clientcertificate.go b/clientcertificate.go index fa86017380e..590c06c68c1 100644 --- a/clientcertificate.go +++ b/clientcertificate.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -33,13 +34,12 @@ func NewClientCertificateService(opts ...option.RequestOption) (r *ClientCertifi return } -// If a API Shield mTLS Client Certificate is in a pending_revocation state, you -// may reactivate it with this endpoint. -func (r *ClientCertificateService) Update(ctx context.Context, zoneID string, clientCertificateID string, opts ...option.RequestOption) (res *ClientCertificateUpdateResponse, err error) { +// Create a new API Shield mTLS Client Certificate +func (r *ClientCertificateService) New(ctx context.Context, zoneID string, body ClientCertificateNewParams, opts ...option.RequestOption) (res *ClientCertificateNewResponse, err error) { opts = append(r.Options[:], opts...) - var env ClientCertificateUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/client_certificates/%s", zoneID, clientCertificateID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + var env ClientCertificateNewResponseEnvelope + path := fmt.Sprintf("zones/%s/client_certificates", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,13 +47,13 @@ func (r *ClientCertificateService) Update(ctx context.Context, zoneID string, cl return } -// Set a API Shield mTLS Client Certificate to pending_revocation status for -// processing to revoked status. -func (r *ClientCertificateService) Delete(ctx context.Context, zoneID string, clientCertificateID string, opts ...option.RequestOption) (res *ClientCertificateDeleteResponse, err error) { +// If a API Shield mTLS Client Certificate is in a pending_revocation state, you +// may reactivate it with this endpoint. +func (r *ClientCertificateService) Update(ctx context.Context, zoneID string, clientCertificateID string, opts ...option.RequestOption) (res *ClientCertificateUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env ClientCertificateDeleteResponseEnvelope + var env ClientCertificateUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/client_certificates/%s", zoneID, clientCertificateID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return } @@ -61,26 +61,38 @@ func (r *ClientCertificateService) Delete(ctx context.Context, zoneID string, cl return } -// Create a new API Shield mTLS Client Certificate -func (r *ClientCertificateService) ClientCertificateForAZoneNewClientCertificate(ctx context.Context, zoneID string, body ClientCertificateClientCertificateForAZoneNewClientCertificateParams, opts ...option.RequestOption) (res *ClientCertificateClientCertificateForAZoneNewClientCertificateResponse, err error) { - opts = append(r.Options[:], opts...) - var env ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelope +// List all of your Zone's API Shield mTLS Client Certificates by Status and/or +// using Pagination +func (r *ClientCertificateService) List(ctx context.Context, zoneID string, query ClientCertificateListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[ClientCertificateListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/client_certificates", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } // List all of your Zone's API Shield mTLS Client Certificates by Status and/or // using Pagination -func (r *ClientCertificateService) ClientCertificateForAZoneListClientCertificates(ctx context.Context, zoneID string, query ClientCertificateClientCertificateForAZoneListClientCertificatesParams, opts ...option.RequestOption) (res *[]ClientCertificateClientCertificateForAZoneListClientCertificatesResponse, err error) { +func (r *ClientCertificateService) ListAutoPaging(ctx context.Context, zoneID string, query ClientCertificateListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[ClientCertificateListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneID, query, opts...)) +} + +// Set a API Shield mTLS Client Certificate to pending_revocation status for +// processing to revoked status. +func (r *ClientCertificateService) Delete(ctx context.Context, zoneID string, clientCertificateID string, opts ...option.RequestOption) (res *ClientCertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelope - path := fmt.Sprintf("zones/%s/client_certificates", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env ClientCertificateDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/client_certificates/%s", zoneID, clientCertificateID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -101,13 +113,13 @@ func (r *ClientCertificateService) Get(ctx context.Context, zoneID string, clien return } -type ClientCertificateUpdateResponse struct { +type ClientCertificateNewResponse struct { // Identifier ID string `json:"id"` // The Client Certificate PEM Certificate string `json:"certificate"` // Certificate Authority used to issue the Client Certificate - CertificateAuthority ClientCertificateUpdateResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority ClientCertificateNewResponseCertificateAuthority `json:"certificate_authority"` // Common Name of the Client Certificate CommonName string `json:"common_name"` // Country, provided by the CSR @@ -136,15 +148,15 @@ type ClientCertificateUpdateResponse struct { State string `json:"state"` // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions - Status ClientCertificateUpdateResponseStatus `json:"status"` + Status ClientCertificateNewResponseStatus `json:"status"` // The number of days the Client Certificate will be valid after the issued_on date - ValidityDays int64 `json:"validity_days"` - JSON clientCertificateUpdateResponseJSON `json:"-"` + ValidityDays int64 `json:"validity_days"` + JSON clientCertificateNewResponseJSON `json:"-"` } -// clientCertificateUpdateResponseJSON contains the JSON metadata for the struct -// [ClientCertificateUpdateResponse] -type clientCertificateUpdateResponseJSON struct { +// clientCertificateNewResponseJSON contains the JSON metadata for the struct +// [ClientCertificateNewResponse] +type clientCertificateNewResponseJSON struct { ID apijson.Field Certificate apijson.Field CertificateAuthority apijson.Field @@ -167,48 +179,48 @@ type clientCertificateUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ClientCertificateUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate Authority used to issue the Client Certificate -type ClientCertificateUpdateResponseCertificateAuthority struct { - ID string `json:"id"` - Name string `json:"name"` - JSON clientCertificateUpdateResponseCertificateAuthorityJSON `json:"-"` +type ClientCertificateNewResponseCertificateAuthority struct { + ID string `json:"id"` + Name string `json:"name"` + JSON clientCertificateNewResponseCertificateAuthorityJSON `json:"-"` } -// clientCertificateUpdateResponseCertificateAuthorityJSON contains the JSON -// metadata for the struct [ClientCertificateUpdateResponseCertificateAuthority] -type clientCertificateUpdateResponseCertificateAuthorityJSON struct { +// clientCertificateNewResponseCertificateAuthorityJSON contains the JSON metadata +// for the struct [ClientCertificateNewResponseCertificateAuthority] +type clientCertificateNewResponseCertificateAuthorityJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateUpdateResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateNewResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions -type ClientCertificateUpdateResponseStatus string +type ClientCertificateNewResponseStatus string const ( - ClientCertificateUpdateResponseStatusActive ClientCertificateUpdateResponseStatus = "active" - ClientCertificateUpdateResponseStatusPendingReactivation ClientCertificateUpdateResponseStatus = "pending_reactivation" - ClientCertificateUpdateResponseStatusPendingRevocation ClientCertificateUpdateResponseStatus = "pending_revocation" - ClientCertificateUpdateResponseStatusRevoked ClientCertificateUpdateResponseStatus = "revoked" + ClientCertificateNewResponseStatusActive ClientCertificateNewResponseStatus = "active" + ClientCertificateNewResponseStatusPendingReactivation ClientCertificateNewResponseStatus = "pending_reactivation" + ClientCertificateNewResponseStatusPendingRevocation ClientCertificateNewResponseStatus = "pending_revocation" + ClientCertificateNewResponseStatusRevoked ClientCertificateNewResponseStatus = "revoked" ) -type ClientCertificateDeleteResponse struct { +type ClientCertificateUpdateResponse struct { // Identifier ID string `json:"id"` // The Client Certificate PEM Certificate string `json:"certificate"` // Certificate Authority used to issue the Client Certificate - CertificateAuthority ClientCertificateDeleteResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority ClientCertificateUpdateResponseCertificateAuthority `json:"certificate_authority"` // Common Name of the Client Certificate CommonName string `json:"common_name"` // Country, provided by the CSR @@ -237,15 +249,15 @@ type ClientCertificateDeleteResponse struct { State string `json:"state"` // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions - Status ClientCertificateDeleteResponseStatus `json:"status"` + Status ClientCertificateUpdateResponseStatus `json:"status"` // The number of days the Client Certificate will be valid after the issued_on date ValidityDays int64 `json:"validity_days"` - JSON clientCertificateDeleteResponseJSON `json:"-"` + JSON clientCertificateUpdateResponseJSON `json:"-"` } -// clientCertificateDeleteResponseJSON contains the JSON metadata for the struct -// [ClientCertificateDeleteResponse] -type clientCertificateDeleteResponseJSON struct { +// clientCertificateUpdateResponseJSON contains the JSON metadata for the struct +// [ClientCertificateUpdateResponse] +type clientCertificateUpdateResponseJSON struct { ID apijson.Field Certificate apijson.Field CertificateAuthority apijson.Field @@ -268,48 +280,48 @@ type clientCertificateDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ClientCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate Authority used to issue the Client Certificate -type ClientCertificateDeleteResponseCertificateAuthority struct { +type ClientCertificateUpdateResponseCertificateAuthority struct { ID string `json:"id"` Name string `json:"name"` - JSON clientCertificateDeleteResponseCertificateAuthorityJSON `json:"-"` + JSON clientCertificateUpdateResponseCertificateAuthorityJSON `json:"-"` } -// clientCertificateDeleteResponseCertificateAuthorityJSON contains the JSON -// metadata for the struct [ClientCertificateDeleteResponseCertificateAuthority] -type clientCertificateDeleteResponseCertificateAuthorityJSON struct { +// clientCertificateUpdateResponseCertificateAuthorityJSON contains the JSON +// metadata for the struct [ClientCertificateUpdateResponseCertificateAuthority] +type clientCertificateUpdateResponseCertificateAuthorityJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateDeleteResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateUpdateResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions -type ClientCertificateDeleteResponseStatus string +type ClientCertificateUpdateResponseStatus string const ( - ClientCertificateDeleteResponseStatusActive ClientCertificateDeleteResponseStatus = "active" - ClientCertificateDeleteResponseStatusPendingReactivation ClientCertificateDeleteResponseStatus = "pending_reactivation" - ClientCertificateDeleteResponseStatusPendingRevocation ClientCertificateDeleteResponseStatus = "pending_revocation" - ClientCertificateDeleteResponseStatusRevoked ClientCertificateDeleteResponseStatus = "revoked" + ClientCertificateUpdateResponseStatusActive ClientCertificateUpdateResponseStatus = "active" + ClientCertificateUpdateResponseStatusPendingReactivation ClientCertificateUpdateResponseStatus = "pending_reactivation" + ClientCertificateUpdateResponseStatusPendingRevocation ClientCertificateUpdateResponseStatus = "pending_revocation" + ClientCertificateUpdateResponseStatusRevoked ClientCertificateUpdateResponseStatus = "revoked" ) -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponse struct { +type ClientCertificateListResponse struct { // Identifier ID string `json:"id"` // The Client Certificate PEM Certificate string `json:"certificate"` // Certificate Authority used to issue the Client Certificate - CertificateAuthority ClientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority ClientCertificateListResponseCertificateAuthority `json:"certificate_authority"` // Common Name of the Client Certificate CommonName string `json:"common_name"` // Country, provided by the CSR @@ -338,16 +350,15 @@ type ClientCertificateClientCertificateForAZoneNewClientCertificateResponse stru State string `json:"state"` // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions - Status ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus `json:"status"` + Status ClientCertificateListResponseStatus `json:"status"` // The number of days the Client Certificate will be valid after the issued_on date - ValidityDays int64 `json:"validity_days"` - JSON clientCertificateClientCertificateForAZoneNewClientCertificateResponseJSON `json:"-"` + ValidityDays int64 `json:"validity_days"` + JSON clientCertificateListResponseJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneNewClientCertificateResponseJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneNewClientCertificateResponse] -type clientCertificateClientCertificateForAZoneNewClientCertificateResponseJSON struct { +// clientCertificateListResponseJSON contains the JSON metadata for the struct +// [ClientCertificateListResponse] +type clientCertificateListResponseJSON struct { ID apijson.Field Certificate apijson.Field CertificateAuthority apijson.Field @@ -370,49 +381,48 @@ type clientCertificateClientCertificateForAZoneNewClientCertificateResponseJSON ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneNewClientCertificateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate Authority used to issue the Client Certificate -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthority struct { - ID string `json:"id"` - Name string `json:"name"` - JSON clientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthorityJSON `json:"-"` +type ClientCertificateListResponseCertificateAuthority struct { + ID string `json:"id"` + Name string `json:"name"` + JSON clientCertificateListResponseCertificateAuthorityJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthorityJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthority] -type clientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthorityJSON struct { +// clientCertificateListResponseCertificateAuthorityJSON contains the JSON metadata +// for the struct [ClientCertificateListResponseCertificateAuthority] +type clientCertificateListResponseCertificateAuthorityJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneNewClientCertificateResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateListResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus string +type ClientCertificateListResponseStatus string const ( - ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatusActive ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus = "active" - ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatusPendingReactivation ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus = "pending_reactivation" - ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatusPendingRevocation ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus = "pending_revocation" - ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatusRevoked ClientCertificateClientCertificateForAZoneNewClientCertificateResponseStatus = "revoked" + ClientCertificateListResponseStatusActive ClientCertificateListResponseStatus = "active" + ClientCertificateListResponseStatusPendingReactivation ClientCertificateListResponseStatus = "pending_reactivation" + ClientCertificateListResponseStatusPendingRevocation ClientCertificateListResponseStatus = "pending_revocation" + ClientCertificateListResponseStatusRevoked ClientCertificateListResponseStatus = "revoked" ) -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponse struct { +type ClientCertificateDeleteResponse struct { // Identifier ID string `json:"id"` // The Client Certificate PEM Certificate string `json:"certificate"` // Certificate Authority used to issue the Client Certificate - CertificateAuthority ClientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority ClientCertificateDeleteResponseCertificateAuthority `json:"certificate_authority"` // Common Name of the Client Certificate CommonName string `json:"common_name"` // Country, provided by the CSR @@ -441,16 +451,15 @@ type ClientCertificateClientCertificateForAZoneListClientCertificatesResponse st State string `json:"state"` // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions - Status ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus `json:"status"` + Status ClientCertificateDeleteResponseStatus `json:"status"` // The number of days the Client Certificate will be valid after the issued_on date - ValidityDays int64 `json:"validity_days"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseJSON `json:"-"` + ValidityDays int64 `json:"validity_days"` + JSON clientCertificateDeleteResponseJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponse] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseJSON struct { +// clientCertificateDeleteResponseJSON contains the JSON metadata for the struct +// [ClientCertificateDeleteResponse] +type clientCertificateDeleteResponseJSON struct { ID apijson.Field Certificate apijson.Field CertificateAuthority apijson.Field @@ -473,40 +482,39 @@ type clientCertificateClientCertificateForAZoneListClientCertificatesResponseJSO ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate Authority used to issue the Client Certificate -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthority struct { - ID string `json:"id"` - Name string `json:"name"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthorityJSON `json:"-"` +type ClientCertificateDeleteResponseCertificateAuthority struct { + ID string `json:"id"` + Name string `json:"name"` + JSON clientCertificateDeleteResponseCertificateAuthorityJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthorityJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthority] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthorityJSON struct { +// clientCertificateDeleteResponseCertificateAuthorityJSON contains the JSON +// metadata for the struct [ClientCertificateDeleteResponseCertificateAuthority] +type clientCertificateDeleteResponseCertificateAuthorityJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateDeleteResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Client Certificates may be active or revoked, and the pending_reactivation or // pending_revocation represent in-progress asynchronous transitions -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus string +type ClientCertificateDeleteResponseStatus string const ( - ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatusActive ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus = "active" - ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatusPendingReactivation ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus = "pending_reactivation" - ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatusPendingRevocation ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus = "pending_revocation" - ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatusRevoked ClientCertificateClientCertificateForAZoneListClientCertificatesResponseStatus = "revoked" + ClientCertificateDeleteResponseStatusActive ClientCertificateDeleteResponseStatus = "active" + ClientCertificateDeleteResponseStatusPendingReactivation ClientCertificateDeleteResponseStatus = "pending_reactivation" + ClientCertificateDeleteResponseStatusPendingRevocation ClientCertificateDeleteResponseStatus = "pending_revocation" + ClientCertificateDeleteResponseStatusRevoked ClientCertificateDeleteResponseStatus = "revoked" ) type ClientCertificateGetResponse struct { @@ -610,87 +618,29 @@ const ( ClientCertificateGetResponseStatusRevoked ClientCertificateGetResponseStatus = "revoked" ) -type ClientCertificateUpdateResponseEnvelope struct { - Errors []ClientCertificateUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ClientCertificateUpdateResponseEnvelopeMessages `json:"messages,required"` - Result ClientCertificateUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success ClientCertificateUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON clientCertificateUpdateResponseEnvelopeJSON `json:"-"` -} - -// clientCertificateUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [ClientCertificateUpdateResponseEnvelope] -type clientCertificateUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ClientCertificateUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ClientCertificateUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// clientCertificateUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [ClientCertificateUpdateResponseEnvelopeErrors] -type clientCertificateUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ClientCertificateUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ClientCertificateUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// clientCertificateUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [ClientCertificateUpdateResponseEnvelopeMessages] -type clientCertificateUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type ClientCertificateNewParams struct { + // The Certificate Signing Request (CSR). Must be newline-encoded. + Csr param.Field[string] `json:"csr,required"` + // The number of days the Client Certificate will be valid after the issued_on date + ValidityDays param.Field[int64] `json:"validity_days,required"` } -func (r *ClientCertificateUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r ClientCertificateNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type ClientCertificateUpdateResponseEnvelopeSuccess bool - -const ( - ClientCertificateUpdateResponseEnvelopeSuccessTrue ClientCertificateUpdateResponseEnvelopeSuccess = true -) - -type ClientCertificateDeleteResponseEnvelope struct { - Errors []ClientCertificateDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []ClientCertificateDeleteResponseEnvelopeMessages `json:"messages,required"` - Result ClientCertificateDeleteResponse `json:"result,required"` +type ClientCertificateNewResponseEnvelope struct { + Errors []ClientCertificateNewResponseEnvelopeErrors `json:"errors,required"` + Messages []ClientCertificateNewResponseEnvelopeMessages `json:"messages,required"` + Result ClientCertificateNewResponse `json:"result,required"` // Whether the API call was successful - Success ClientCertificateDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON clientCertificateDeleteResponseEnvelopeJSON `json:"-"` + Success ClientCertificateNewResponseEnvelopeSuccess `json:"success,required"` + JSON clientCertificateNewResponseEnvelopeJSON `json:"-"` } -// clientCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [ClientCertificateDeleteResponseEnvelope] -type clientCertificateDeleteResponseEnvelopeJSON struct { +// clientCertificateNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [ClientCertificateNewResponseEnvelope] +type clientCertificateNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -699,79 +649,67 @@ type clientCertificateDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ClientCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"` +type ClientCertificateNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateNewResponseEnvelopeErrorsJSON `json:"-"` } -// clientCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [ClientCertificateDeleteResponseEnvelopeErrors] -type clientCertificateDeleteResponseEnvelopeErrorsJSON struct { +// clientCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ClientCertificateNewResponseEnvelopeErrors] +type clientCertificateNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"` +type ClientCertificateNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateNewResponseEnvelopeMessagesJSON `json:"-"` } -// clientCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [ClientCertificateDeleteResponseEnvelopeMessages] -type clientCertificateDeleteResponseEnvelopeMessagesJSON struct { +// clientCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ClientCertificateNewResponseEnvelopeMessages] +type clientCertificateNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ClientCertificateDeleteResponseEnvelopeSuccess bool +type ClientCertificateNewResponseEnvelopeSuccess bool const ( - ClientCertificateDeleteResponseEnvelopeSuccessTrue ClientCertificateDeleteResponseEnvelopeSuccess = true + ClientCertificateNewResponseEnvelopeSuccessTrue ClientCertificateNewResponseEnvelopeSuccess = true ) -type ClientCertificateClientCertificateForAZoneNewClientCertificateParams struct { - // The Certificate Signing Request (CSR). Must be newline-encoded. - Csr param.Field[string] `json:"csr,required"` - // The number of days the Client Certificate will be valid after the issued_on date - ValidityDays param.Field[int64] `json:"validity_days,required"` -} - -func (r ClientCertificateClientCertificateForAZoneNewClientCertificateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelope struct { - Errors []ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrors `json:"errors,required"` - Messages []ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessages `json:"messages,required"` - Result ClientCertificateClientCertificateForAZoneNewClientCertificateResponse `json:"result,required"` +type ClientCertificateUpdateResponseEnvelope struct { + Errors []ClientCertificateUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []ClientCertificateUpdateResponseEnvelopeMessages `json:"messages,required"` + Result ClientCertificateUpdateResponse `json:"result,required"` // Whether the API call was successful - Success ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeSuccess `json:"success,required"` - JSON clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeJSON `json:"-"` + Success ClientCertificateUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON clientCertificateUpdateResponseEnvelopeJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelope] -type clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeJSON struct { +// clientCertificateUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [ClientCertificateUpdateResponseEnvelope] +type clientCertificateUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -780,58 +718,56 @@ type clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvel ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrorsJSON `json:"-"` +type ClientCertificateUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrors] -type clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrorsJSON struct { +// clientCertificateUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ClientCertificateUpdateResponseEnvelopeErrors] +type clientCertificateUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessagesJSON `json:"-"` +type ClientCertificateUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessages] -type clientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessagesJSON struct { +// clientCertificateUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ClientCertificateUpdateResponseEnvelopeMessages] +type clientCertificateUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeSuccess bool +type ClientCertificateUpdateResponseEnvelopeSuccess bool const ( - ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeSuccessTrue ClientCertificateClientCertificateForAZoneNewClientCertificateResponseEnvelopeSuccess = true + ClientCertificateUpdateResponseEnvelopeSuccessTrue ClientCertificateUpdateResponseEnvelopeSuccess = true ) -type ClientCertificateClientCertificateForAZoneListClientCertificatesParams struct { +type ClientCertificateListParams struct { // Limit to the number of records returned. Limit param.Field[int64] `query:"limit"` // Offset the results @@ -841,13 +777,12 @@ type ClientCertificateClientCertificateForAZoneListClientCertificatesParams stru // Number of records per page. PerPage param.Field[float64] `query:"per_page"` // Client Certitifcate Status to filter results by. - Status param.Field[ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus] `query:"status"` + Status param.Field[ClientCertificateListParamsStatus] `query:"status"` } -// URLQuery serializes -// [ClientCertificateClientCertificateForAZoneListClientCertificatesParams]'s query -// parameters as `url.Values`. -func (r ClientCertificateClientCertificateForAZoneListClientCertificatesParams) URLQuery() (v url.Values) { +// URLQuery serializes [ClientCertificateListParams]'s query parameters as +// `url.Values`. +func (r ClientCertificateListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -855,118 +790,85 @@ func (r ClientCertificateClientCertificateForAZoneListClientCertificatesParams) } // Client Certitifcate Status to filter results by. -type ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus string +type ClientCertificateListParamsStatus string const ( - ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusAll ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus = "all" - ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusActive ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus = "active" - ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusPendingReactivation ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus = "pending_reactivation" - ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusPendingRevocation ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus = "pending_revocation" - ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusRevoked ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatus = "revoked" + ClientCertificateListParamsStatusAll ClientCertificateListParamsStatus = "all" + ClientCertificateListParamsStatusActive ClientCertificateListParamsStatus = "active" + ClientCertificateListParamsStatusPendingReactivation ClientCertificateListParamsStatus = "pending_reactivation" + ClientCertificateListParamsStatusPendingRevocation ClientCertificateListParamsStatus = "pending_revocation" + ClientCertificateListParamsStatusRevoked ClientCertificateListParamsStatus = "revoked" ) -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelope struct { - Errors []ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrors `json:"errors,required"` - Messages []ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessages `json:"messages,required"` - Result []ClientCertificateClientCertificateForAZoneListClientCertificatesResponse `json:"result,required,nullable"` +type ClientCertificateDeleteResponseEnvelope struct { + Errors []ClientCertificateDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []ClientCertificateDeleteResponseEnvelopeMessages `json:"messages,required"` + Result ClientCertificateDeleteResponse `json:"result,required"` // Whether the API call was successful - Success ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfo `json:"result_info"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeJSON `json:"-"` + Success ClientCertificateDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON clientCertificateDeleteResponseEnvelopeJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelope] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeJSON struct { +// clientCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [ClientCertificateDeleteResponseEnvelope] +type clientCertificateDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrorsJSON `json:"-"` +type ClientCertificateDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrors] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrorsJSON struct { +// clientCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ClientCertificateDeleteResponseEnvelopeErrors] +type clientCertificateDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessagesJSON `json:"-"` +type ClientCertificateDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON clientCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessages] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessagesJSON struct { +// clientCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ClientCertificateDeleteResponseEnvelopeMessages] +type clientCertificateDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ClientCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeSuccess bool +type ClientCertificateDeleteResponseEnvelopeSuccess bool const ( - ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeSuccessTrue ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeSuccess = true + ClientCertificateDeleteResponseEnvelopeSuccessTrue ClientCertificateDeleteResponseEnvelopeSuccess = true ) -type ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfo] -type clientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ClientCertificateClientCertificateForAZoneListClientCertificatesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type ClientCertificateGetResponseEnvelope struct { Errors []ClientCertificateGetResponseEnvelopeErrors `json:"errors,required"` Messages []ClientCertificateGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/clientcertificate_test.go b/clientcertificate_test.go index 77e7de0ac34..f845903417b 100644 --- a/clientcertificate_test.go +++ b/clientcertificate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestClientCertificateUpdate(t *testing.T) { +func TestClientCertificateNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,13 @@ func TestClientCertificateUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ClientCertificates.Update( + _, err := client.ClientCertificates.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.ClientCertificateNewParams{ + Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n"), + ValidityDays: cloudflare.F(int64(3650)), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +46,7 @@ func TestClientCertificateUpdate(t *testing.T) { } } -func TestClientCertificateDelete(t *testing.T) { +func TestClientCertificateUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +62,7 @@ func TestClientCertificateDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ClientCertificates.Delete( + _, err := client.ClientCertificates.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -73,7 +76,7 @@ func TestClientCertificateDelete(t *testing.T) { } } -func TestClientCertificateClientCertificateForAZoneNewClientCertificate(t *testing.T) { +func TestClientCertificateListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,12 +92,15 @@ func TestClientCertificateClientCertificateForAZoneNewClientCertificate(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ClientCertificates.ClientCertificateForAZoneNewClientCertificate( + _, err := client.ClientCertificates.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ClientCertificateClientCertificateForAZoneNewClientCertificateParams{ - Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n"), - ValidityDays: cloudflare.F(int64(3650)), + cloudflare.ClientCertificateListParams{ + Limit: cloudflare.F(int64(10)), + Offset: cloudflare.F(int64(10)), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Status: cloudflare.F(cloudflare.ClientCertificateListParamsStatusAll), }, ) if err != nil { @@ -106,7 +112,7 @@ func TestClientCertificateClientCertificateForAZoneNewClientCertificate(t *testi } } -func TestClientCertificateClientCertificateForAZoneListClientCertificatesWithOptionalParams(t *testing.T) { +func TestClientCertificateDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,16 +128,10 @@ func TestClientCertificateClientCertificateForAZoneListClientCertificatesWithOpt option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ClientCertificates.ClientCertificateForAZoneListClientCertificates( + _, err := client.ClientCertificates.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ClientCertificateClientCertificateForAZoneListClientCertificatesParams{ - Limit: cloudflare.F(int64(10)), - Offset: cloudflare.F(int64(10)), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - Status: cloudflare.F(cloudflare.ClientCertificateClientCertificateForAZoneListClientCertificatesParamsStatusAll), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error diff --git a/customcertificate.go b/customcertificate.go index 2a232dfbbbb..2b4989a5441 100644 --- a/customcertificate.go +++ b/customcertificate.go @@ -25,8 +25,8 @@ import ( // this service directly, and instead use the [NewCustomCertificateService] method // instead. type CustomCertificateService struct { - Options []option.RequestOption - Prioritizes *CustomCertificatePrioritizeService + Options []option.RequestOption + Prioritize *CustomCertificatePrioritizeService } // NewCustomCertificateService generates a new service that applies the given @@ -35,7 +35,7 @@ type CustomCertificateService struct { func NewCustomCertificateService(opts ...option.RequestOption) (r *CustomCertificateService) { r = &CustomCertificateService{} r.Options = opts - r.Prioritizes = NewCustomCertificatePrioritizeService(opts...) + r.Prioritize = NewCustomCertificatePrioritizeService(opts...) return } diff --git a/customcertificateprioritize.go b/customcertificateprioritize.go index 2f1a308415b..9d218c53a6d 100644 --- a/customcertificateprioritize.go +++ b/customcertificateprioritize.go @@ -35,9 +35,9 @@ func NewCustomCertificatePrioritizeService(opts ...option.RequestOption) (r *Cus // If a zone has multiple SSL certificates, you can set the order in which they // should be used during a request. The higher priority will break ties across // overlapping 'legacy_custom' certificates. -func (r *CustomCertificatePrioritizeService) CustomSSLForAZoneRePrioritizeSSLCertificates(ctx context.Context, zoneID string, body CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParams, opts ...option.RequestOption) (res *[]CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse, err error) { +func (r *CustomCertificatePrioritizeService) Replace(ctx context.Context, zoneID string, body CustomCertificatePrioritizeReplaceParams, opts ...option.RequestOption) (res *[]CustomCertificatePrioritizeReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelope + var env CustomCertificatePrioritizeReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/custom_certificates/prioritize", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -47,14 +47,14 @@ func (r *CustomCertificatePrioritizeService) CustomSSLForAZoneRePrioritizeSSLCer return } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse struct { +type CustomCertificatePrioritizeReplaceResponse struct { // Identifier ID string `json:"id,required"` // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethod `json:"bundle_method,required"` + BundleMethod CustomCertificatePrioritizeReplaceResponseBundleMethod `json:"bundle_method,required"` // When the certificate from the authority expires. ExpiresOn time.Time `json:"expires_on,required" format:"date-time"` Hosts []string `json:"hosts,required"` @@ -70,7 +70,7 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp // The type of hash used for the certificate. Signature string `json:"signature,required"` // Status of the zone's custom SSL. - Status CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus `json:"status,required"` + Status CustomCertificatePrioritizeReplaceResponseStatus `json:"status,required"` // When the certificate was uploaded to Cloudflare. UploadedOn time.Time `json:"uploaded_on,required" format:"date-time"` // Identifier @@ -82,8 +82,8 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp // only to U.S. data centers, only to E.U. data centers, or only to highest // security data centers. Default distribution is to all Cloudflare datacenters, // for optimal performance. - GeoRestrictions CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictions `json:"geo_restrictions"` - KeylessServer CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServer `json:"keyless_server"` + GeoRestrictions CustomCertificatePrioritizeReplaceResponseGeoRestrictions `json:"geo_restrictions"` + KeylessServer CustomCertificatePrioritizeReplaceResponseKeylessServer `json:"keyless_server"` // Specify the policy that determines the region where your private key will be // held locally. HTTPS connections to any excluded data center will still be fully // encrypted, but will incur some latency while Keyless SSL is used to complete the @@ -93,14 +93,13 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp // can be chosen, such as 'country: IN', as well as 'region: EU' which refers to // the EU region. If there are too few data centers satisfying the policy, it will // be rejected. - Policy string `json:"policy"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseJSON `json:"-"` + Policy string `json:"policy"` + JSON customCertificatePrioritizeReplaceResponseJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseJSON struct { +// customCertificatePrioritizeReplaceResponseJSON contains the JSON metadata for +// the struct [CustomCertificatePrioritizeReplaceResponse] +type customCertificatePrioritizeReplaceResponseJSON struct { ID apijson.Field BundleMethod apijson.Field ExpiresOn apijson.Field @@ -119,7 +118,7 @@ type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -127,23 +126,23 @@ func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificates // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethod string +type CustomCertificatePrioritizeReplaceResponseBundleMethod string const ( - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethodUbiquitous CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethod = "ubiquitous" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethodOptimal CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethod = "optimal" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethodForce CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseBundleMethod = "force" + CustomCertificatePrioritizeReplaceResponseBundleMethodUbiquitous CustomCertificatePrioritizeReplaceResponseBundleMethod = "ubiquitous" + CustomCertificatePrioritizeReplaceResponseBundleMethodOptimal CustomCertificatePrioritizeReplaceResponseBundleMethod = "optimal" + CustomCertificatePrioritizeReplaceResponseBundleMethodForce CustomCertificatePrioritizeReplaceResponseBundleMethod = "force" ) // Status of the zone's custom SSL. -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus string +type CustomCertificatePrioritizeReplaceResponseStatus string const ( - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatusActive CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus = "active" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatusExpired CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus = "expired" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatusDeleted CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus = "deleted" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatusPending CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus = "pending" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatusInitializing CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseStatus = "initializing" + CustomCertificatePrioritizeReplaceResponseStatusActive CustomCertificatePrioritizeReplaceResponseStatus = "active" + CustomCertificatePrioritizeReplaceResponseStatusExpired CustomCertificatePrioritizeReplaceResponseStatus = "expired" + CustomCertificatePrioritizeReplaceResponseStatusDeleted CustomCertificatePrioritizeReplaceResponseStatus = "deleted" + CustomCertificatePrioritizeReplaceResponseStatusPending CustomCertificatePrioritizeReplaceResponseStatus = "pending" + CustomCertificatePrioritizeReplaceResponseStatusInitializing CustomCertificatePrioritizeReplaceResponseStatus = "initializing" ) // Specify the region where your private key can be held locally for optimal TLS @@ -153,33 +152,33 @@ const ( // only to U.S. data centers, only to E.U. data centers, or only to highest // security data centers. Default distribution is to all Cloudflare datacenters, // for optimal performance. -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictions struct { - Label CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabel `json:"label"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsJSON `json:"-"` +type CustomCertificatePrioritizeReplaceResponseGeoRestrictions struct { + Label CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabel `json:"label"` + JSON customCertificatePrioritizeReplaceResponseGeoRestrictionsJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictions] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsJSON struct { +// customCertificatePrioritizeReplaceResponseGeoRestrictionsJSON contains the JSON +// metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseGeoRestrictions] +type customCertificatePrioritizeReplaceResponseGeoRestrictionsJSON struct { Label apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictions) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseGeoRestrictions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabel string +type CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabel string const ( - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabelUs CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabel = "us" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabelEu CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabel = "eu" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabelHighestSecurity CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseGeoRestrictionsLabel = "highest_security" + CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabelUs CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabel = "us" + CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabelEu CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabel = "eu" + CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabelHighestSecurity CustomCertificatePrioritizeReplaceResponseGeoRestrictionsLabel = "highest_security" ) -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServer struct { +type CustomCertificatePrioritizeReplaceResponseKeylessServer struct { // Keyless certificate identifier tag. ID string `json:"id,required"` // When the Keyless SSL was created. @@ -199,16 +198,16 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp // Keyless SSL server. Port float64 `json:"port,required"` // Status of the Keyless SSL. - Status CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatus `json:"status,required"` + Status CustomCertificatePrioritizeReplaceResponseKeylessServerStatus `json:"status,required"` // Configuration for using Keyless SSL through a Cloudflare Tunnel - Tunnel CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnel `json:"tunnel"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerJSON `json:"-"` + Tunnel CustomCertificatePrioritizeReplaceResponseKeylessServerTunnel `json:"tunnel"` + JSON customCertificatePrioritizeReplaceResponseKeylessServerJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServer] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerJSON struct { +// customCertificatePrioritizeReplaceResponseKeylessServerJSON contains the JSON +// metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseKeylessServer] +type customCertificatePrioritizeReplaceResponseKeylessServerJSON struct { ID apijson.Field CreatedOn apijson.Field Enabled apijson.Field @@ -223,51 +222,51 @@ type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServer) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseKeylessServer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the Keyless SSL. -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatus string +type CustomCertificatePrioritizeReplaceResponseKeylessServerStatus string const ( - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatusActive CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatus = "active" - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatusDeleted CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerStatus = "deleted" + CustomCertificatePrioritizeReplaceResponseKeylessServerStatusActive CustomCertificatePrioritizeReplaceResponseKeylessServerStatus = "active" + CustomCertificatePrioritizeReplaceResponseKeylessServerStatusDeleted CustomCertificatePrioritizeReplaceResponseKeylessServerStatus = "deleted" ) // Configuration for using Keyless SSL through a Cloudflare Tunnel -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnel struct { +type CustomCertificatePrioritizeReplaceResponseKeylessServerTunnel struct { // Private IP of the Key Server Host PrivateIP string `json:"private_ip,required"` // Cloudflare Tunnel Virtual Network ID - VnetID string `json:"vnet_id,required"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnelJSON `json:"-"` + VnetID string `json:"vnet_id,required"` + JSON customCertificatePrioritizeReplaceResponseKeylessServerTunnelJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnelJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnel] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnelJSON struct { +// customCertificatePrioritizeReplaceResponseKeylessServerTunnelJSON contains the +// JSON metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseKeylessServerTunnel] +type customCertificatePrioritizeReplaceResponseKeylessServerTunnelJSON struct { PrivateIP apijson.Field VnetID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseKeylessServerTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseKeylessServerTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParams struct { +type CustomCertificatePrioritizeReplaceParams struct { // Array of ordered certificates. - Certificates param.Field[[]CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParamsCertificate] `json:"certificates,required"` + Certificates param.Field[[]CustomCertificatePrioritizeReplaceParamsCertificate] `json:"certificates,required"` } -func (r CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParams) MarshalJSON() (data []byte, err error) { +func (r CustomCertificatePrioritizeReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParamsCertificate struct { +type CustomCertificatePrioritizeReplaceParamsCertificate struct { // The order/priority in which the certificate will be used in a request. The // higher priority will break ties across overlapping 'legacy_custom' certificates, // but 'legacy_custom' certificates will always supercede 'sni_custom' @@ -275,24 +274,23 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesPara Priority param.Field[float64] `json:"priority"` } -func (r CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParamsCertificate) MarshalJSON() (data []byte, err error) { +func (r CustomCertificatePrioritizeReplaceParamsCertificate) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelope struct { - Errors []CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessages `json:"messages,required"` - Result []CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponse `json:"result,required,nullable"` +type CustomCertificatePrioritizeReplaceResponseEnvelope struct { + Errors []CustomCertificatePrioritizeReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomCertificatePrioritizeReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []CustomCertificatePrioritizeReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfo `json:"result_info"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeJSON `json:"-"` + Success CustomCertificatePrioritizeReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CustomCertificatePrioritizeReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON customCertificatePrioritizeReplaceResponseEnvelopeJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelope] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeJSON struct { +// customCertificatePrioritizeReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [CustomCertificatePrioritizeReplaceResponseEnvelope] +type customCertificatePrioritizeReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -302,58 +300,58 @@ type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrorsJSON `json:"-"` +type CustomCertificatePrioritizeReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customCertificatePrioritizeReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrors] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrorsJSON struct { +// customCertificatePrioritizeReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseEnvelopeErrors] +type customCertificatePrioritizeReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessagesJSON `json:"-"` +type CustomCertificatePrioritizeReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customCertificatePrioritizeReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessages] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessagesJSON struct { +// customCertificatePrioritizeReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseEnvelopeMessages] +type customCertificatePrioritizeReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeSuccess bool +type CustomCertificatePrioritizeReplaceResponseEnvelopeSuccess bool const ( - CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeSuccessTrue CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeSuccess = true + CustomCertificatePrioritizeReplaceResponseEnvelopeSuccessTrue CustomCertificatePrioritizeReplaceResponseEnvelopeSuccess = true ) -type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfo struct { +type CustomCertificatePrioritizeReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -361,14 +359,14 @@ type CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON customCertificatePrioritizeReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfo] -type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfoJSON struct { +// customCertificatePrioritizeReplaceResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [CustomCertificatePrioritizeReplaceResponseEnvelopeResultInfo] +type customCertificatePrioritizeReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -377,6 +375,6 @@ type customCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResp ExtraFields map[string]apijson.Field } -func (r *CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *CustomCertificatePrioritizeReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/customcertificateprioritize_test.go b/customcertificateprioritize_test.go index 73519199061..7fb39ece207 100644 --- a/customcertificateprioritize_test.go +++ b/customcertificateprioritize_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificates(t *testing.T) { +func TestCustomCertificatePrioritizeReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestCustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificates option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomCertificates.Prioritizes.CustomSSLForAZoneRePrioritizeSSLCertificates( + _, err := client.CustomCertificates.Prioritize.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParams{ - Certificates: cloudflare.F([]cloudflare.CustomCertificatePrioritizeCustomSSLForAZoneRePrioritizeSSLCertificatesParamsCertificate{{ + cloudflare.CustomCertificatePrioritizeReplaceParams{ + Certificates: cloudflare.F([]cloudflare.CustomCertificatePrioritizeReplaceParamsCertificate{{ Priority: cloudflare.F(2.000000), }, { Priority: cloudflare.F(1.000000), diff --git a/customhostname.go b/customhostname.go index b1143cac9b1..bb8c9d0515e 100644 --- a/customhostname.go +++ b/customhostname.go @@ -13,6 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -22,8 +23,8 @@ import ( // this service directly, and instead use the [NewCustomHostnameService] method // instead. type CustomHostnameService struct { - Options []option.RequestOption - FallbackOrigins *CustomHostnameFallbackOriginService + Options []option.RequestOption + FallbackOrigin *CustomHostnameFallbackOriginService } // NewCustomHostnameService generates a new service that applies the given options @@ -32,7 +33,26 @@ type CustomHostnameService struct { func NewCustomHostnameService(opts ...option.RequestOption) (r *CustomHostnameService) { r = &CustomHostnameService{} r.Options = opts - r.FallbackOrigins = NewCustomHostnameFallbackOriginService(opts...) + r.FallbackOrigin = NewCustomHostnameFallbackOriginService(opts...) + return +} + +// Add a new custom hostname and request that an SSL certificate be issued for it. +// One of three validation methods—http, txt, email—should be used, with 'http' +// recommended if the CNAME is already in place (or will be soon). Specifying +// 'email' will send an email to the WHOIS contacts on file for the base domain +// plus hostmaster, postmaster, webmaster, admin, administrator. If http is used +// and the domain is not already pointing to the Managed CNAME host, the PATCH +// method must be used once it is (to complete validation). +func (r *CustomHostnameService) New(ctx context.Context, zoneID string, body CustomHostnameNewParams, opts ...option.RequestOption) (res *CustomHostnameNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomHostnameNewResponseEnvelope + path := fmt.Sprintf("zones/%s/custom_hostnames", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result return } @@ -52,43 +72,34 @@ func (r *CustomHostnameService) Update(ctx context.Context, zoneID string, custo return } -// Delete Custom Hostname (and any issued SSL certificates) -func (r *CustomHostnameService) Delete(ctx context.Context, zoneID string, customHostnameID string, opts ...option.RequestOption) (res *CustomHostnameDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/custom_hostnames/%s", zoneID, customHostnameID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) - return -} - -// Add a new custom hostname and request that an SSL certificate be issued for it. -// One of three validation methods—http, txt, email—should be used, with 'http' -// recommended if the CNAME is already in place (or will be soon). Specifying -// 'email' will send an email to the WHOIS contacts on file for the base domain -// plus hostmaster, postmaster, webmaster, admin, administrator. If http is used -// and the domain is not already pointing to the Managed CNAME host, the PATCH -// method must be used once it is (to complete validation). -func (r *CustomHostnameService) CustomHostnameForAZoneNewCustomHostname(ctx context.Context, zoneID string, body CustomHostnameCustomHostnameForAZoneNewCustomHostnameParams, opts ...option.RequestOption) (res *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelope +// List, search, sort, and filter all of your custom hostnames. +func (r *CustomHostnameService) List(ctx context.Context, zoneID string, query CustomHostnameListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[CustomHostnameListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/custom_hostnames", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } // List, search, sort, and filter all of your custom hostnames. -func (r *CustomHostnameService) CustomHostnameForAZoneListCustomHostnames(ctx context.Context, zoneID string, query CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams, opts ...option.RequestOption) (res *[]CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse, err error) { +func (r *CustomHostnameService) ListAutoPaging(ctx context.Context, zoneID string, query CustomHostnameListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[CustomHostnameListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneID, query, opts...)) +} + +// Delete Custom Hostname (and any issued SSL certificates) +func (r *CustomHostnameService) Delete(ctx context.Context, zoneID string, customHostnameID string, opts ...option.RequestOption) (res *CustomHostnameDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelope - path := fmt.Sprintf("zones/%s/custom_hostnames", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result + path := fmt.Sprintf("zones/%s/custom_hostnames/%s", zoneID, customHostnameID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) return } @@ -105,19 +116,19 @@ func (r *CustomHostnameService) Get(ctx context.Context, zoneID string, customHo return } -type CustomHostnameUpdateResponse struct { +type CustomHostnameNewResponse struct { // Identifier ID string `json:"id,required"` // The custom hostname that will point to your hostname via CNAME. Hostname string `json:"hostname,required"` // SSL properties for the custom hostname. - SSL CustomHostnameUpdateResponseSSL `json:"ssl,required"` - JSON customHostnameUpdateResponseJSON `json:"-"` + SSL CustomHostnameNewResponseSSL `json:"ssl,required"` + JSON customHostnameNewResponseJSON `json:"-"` } -// customHostnameUpdateResponseJSON contains the JSON metadata for the struct -// [CustomHostnameUpdateResponse] -type customHostnameUpdateResponseJSON struct { +// customHostnameNewResponseJSON contains the JSON metadata for the struct +// [CustomHostnameNewResponse] +type customHostnameNewResponseJSON struct { ID apijson.Field Hostname apijson.Field SSL apijson.Field @@ -125,21 +136,21 @@ type customHostnameUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // SSL properties for the custom hostname. -type CustomHostnameUpdateResponseSSL struct { +type CustomHostnameNewResponseSSL struct { // Custom hostname SSL identifier tag. ID string `json:"id"` // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod CustomHostnameUpdateResponseSSLBundleMethod `json:"bundle_method"` + BundleMethod CustomHostnameNewResponseSSLBundleMethod `json:"bundle_method"` // The Certificate Authority that will issue the certificate - CertificateAuthority CustomHostnameUpdateResponseSSLCertificateAuthority `json:"certificate_authority"` + CertificateAuthority CustomHostnameNewResponseSSLCertificateAuthority `json:"certificate_authority"` // If a custom uploaded certificate is used. CustomCertificate string `json:"custom_certificate"` // The identifier for the Custom CSR that was used. @@ -153,32 +164,32 @@ type CustomHostnameUpdateResponseSSL struct { // The issuer on a custom uploaded certificate. Issuer string `json:"issuer"` // Domain control validation (DCV) method used for this hostname. - Method CustomHostnameUpdateResponseSSLMethod `json:"method"` + Method CustomHostnameNewResponseSSLMethod `json:"method"` // The serial number on a custom uploaded certificate. SerialNumber string `json:"serial_number"` // SSL specific settings. - Settings CustomHostnameUpdateResponseSSLSettings `json:"settings"` + Settings CustomHostnameNewResponseSSLSettings `json:"settings"` // The signature on a custom uploaded certificate. Signature string `json:"signature"` // Status of the hostname's SSL certificates. - Status CustomHostnameUpdateResponseSSLStatus `json:"status"` + Status CustomHostnameNewResponseSSLStatus `json:"status"` // Level of validation to be used for this hostname. Domain validation (dv) must be // used. - Type CustomHostnameUpdateResponseSSLType `json:"type"` + Type CustomHostnameNewResponseSSLType `json:"type"` // The time the custom certificate was uploaded. UploadedOn time.Time `json:"uploaded_on" format:"date-time"` // Domain validation errors that have been received by the certificate authority // (CA). - ValidationErrors []CustomHostnameUpdateResponseSSLValidationError `json:"validation_errors"` - ValidationRecords []CustomHostnameUpdateResponseSSLValidationRecord `json:"validation_records"` + ValidationErrors []CustomHostnameNewResponseSSLValidationError `json:"validation_errors"` + ValidationRecords []CustomHostnameNewResponseSSLValidationRecord `json:"validation_records"` // Indicates whether the certificate covers a wildcard. - Wildcard bool `json:"wildcard"` - JSON customHostnameUpdateResponseSSLJSON `json:"-"` + Wildcard bool `json:"wildcard"` + JSON customHostnameNewResponseSSLJSON `json:"-"` } -// customHostnameUpdateResponseSSLJSON contains the JSON metadata for the struct -// [CustomHostnameUpdateResponseSSL] -type customHostnameUpdateResponseSSLJSON struct { +// customHostnameNewResponseSSLJSON contains the JSON metadata for the struct +// [CustomHostnameNewResponseSSL] +type customHostnameNewResponseSSLJSON struct { ID apijson.Field BundleMethod apijson.Field CertificateAuthority apijson.Field @@ -202,7 +213,7 @@ type customHostnameUpdateResponseSSLJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseSSL) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseSSL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -210,51 +221,51 @@ func (r *CustomHostnameUpdateResponseSSL) UnmarshalJSON(data []byte) (err error) // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomHostnameUpdateResponseSSLBundleMethod string +type CustomHostnameNewResponseSSLBundleMethod string const ( - CustomHostnameUpdateResponseSSLBundleMethodUbiquitous CustomHostnameUpdateResponseSSLBundleMethod = "ubiquitous" - CustomHostnameUpdateResponseSSLBundleMethodOptimal CustomHostnameUpdateResponseSSLBundleMethod = "optimal" - CustomHostnameUpdateResponseSSLBundleMethodForce CustomHostnameUpdateResponseSSLBundleMethod = "force" + CustomHostnameNewResponseSSLBundleMethodUbiquitous CustomHostnameNewResponseSSLBundleMethod = "ubiquitous" + CustomHostnameNewResponseSSLBundleMethodOptimal CustomHostnameNewResponseSSLBundleMethod = "optimal" + CustomHostnameNewResponseSSLBundleMethodForce CustomHostnameNewResponseSSLBundleMethod = "force" ) // The Certificate Authority that will issue the certificate -type CustomHostnameUpdateResponseSSLCertificateAuthority string +type CustomHostnameNewResponseSSLCertificateAuthority string const ( - CustomHostnameUpdateResponseSSLCertificateAuthorityDigicert CustomHostnameUpdateResponseSSLCertificateAuthority = "digicert" - CustomHostnameUpdateResponseSSLCertificateAuthorityGoogle CustomHostnameUpdateResponseSSLCertificateAuthority = "google" - CustomHostnameUpdateResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameUpdateResponseSSLCertificateAuthority = "lets_encrypt" + CustomHostnameNewResponseSSLCertificateAuthorityDigicert CustomHostnameNewResponseSSLCertificateAuthority = "digicert" + CustomHostnameNewResponseSSLCertificateAuthorityGoogle CustomHostnameNewResponseSSLCertificateAuthority = "google" + CustomHostnameNewResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameNewResponseSSLCertificateAuthority = "lets_encrypt" ) // Domain control validation (DCV) method used for this hostname. -type CustomHostnameUpdateResponseSSLMethod string +type CustomHostnameNewResponseSSLMethod string const ( - CustomHostnameUpdateResponseSSLMethodHTTP CustomHostnameUpdateResponseSSLMethod = "http" - CustomHostnameUpdateResponseSSLMethodTxt CustomHostnameUpdateResponseSSLMethod = "txt" - CustomHostnameUpdateResponseSSLMethodEmail CustomHostnameUpdateResponseSSLMethod = "email" + CustomHostnameNewResponseSSLMethodHTTP CustomHostnameNewResponseSSLMethod = "http" + CustomHostnameNewResponseSSLMethodTxt CustomHostnameNewResponseSSLMethod = "txt" + CustomHostnameNewResponseSSLMethodEmail CustomHostnameNewResponseSSLMethod = "email" ) // SSL specific settings. -type CustomHostnameUpdateResponseSSLSettings struct { +type CustomHostnameNewResponseSSLSettings struct { // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. Ciphers []string `json:"ciphers"` // Whether or not Early Hints is enabled. - EarlyHints CustomHostnameUpdateResponseSSLSettingsEarlyHints `json:"early_hints"` + EarlyHints CustomHostnameNewResponseSSLSettingsEarlyHints `json:"early_hints"` // Whether or not HTTP2 is enabled. - HTTP2 CustomHostnameUpdateResponseSSLSettingsHTTP2 `json:"http2"` + HTTP2 CustomHostnameNewResponseSSLSettingsHTTP2 `json:"http2"` // The minimum TLS version supported. - MinTLSVersion CustomHostnameUpdateResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` + MinTLSVersion CustomHostnameNewResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` // Whether or not TLS 1.3 is enabled. - TLS1_3 CustomHostnameUpdateResponseSSLSettingsTLS1_3 `json:"tls_1_3"` - JSON customHostnameUpdateResponseSSLSettingsJSON `json:"-"` + TLS1_3 CustomHostnameNewResponseSSLSettingsTLS1_3 `json:"tls_1_3"` + JSON customHostnameNewResponseSSLSettingsJSON `json:"-"` } -// customHostnameUpdateResponseSSLSettingsJSON contains the JSON metadata for the -// struct [CustomHostnameUpdateResponseSSLSettings] -type customHostnameUpdateResponseSSLSettingsJSON struct { +// customHostnameNewResponseSSLSettingsJSON contains the JSON metadata for the +// struct [CustomHostnameNewResponseSSLSettings] +type customHostnameNewResponseSSLSettingsJSON struct { Ciphers apijson.Field EarlyHints apijson.Field HTTP2 apijson.Field @@ -264,99 +275,99 @@ type customHostnameUpdateResponseSSLSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether or not Early Hints is enabled. -type CustomHostnameUpdateResponseSSLSettingsEarlyHints string +type CustomHostnameNewResponseSSLSettingsEarlyHints string const ( - CustomHostnameUpdateResponseSSLSettingsEarlyHintsOn CustomHostnameUpdateResponseSSLSettingsEarlyHints = "on" - CustomHostnameUpdateResponseSSLSettingsEarlyHintsOff CustomHostnameUpdateResponseSSLSettingsEarlyHints = "off" + CustomHostnameNewResponseSSLSettingsEarlyHintsOn CustomHostnameNewResponseSSLSettingsEarlyHints = "on" + CustomHostnameNewResponseSSLSettingsEarlyHintsOff CustomHostnameNewResponseSSLSettingsEarlyHints = "off" ) // Whether or not HTTP2 is enabled. -type CustomHostnameUpdateResponseSSLSettingsHTTP2 string +type CustomHostnameNewResponseSSLSettingsHTTP2 string const ( - CustomHostnameUpdateResponseSSLSettingsHTTP2On CustomHostnameUpdateResponseSSLSettingsHTTP2 = "on" - CustomHostnameUpdateResponseSSLSettingsHTTP2Off CustomHostnameUpdateResponseSSLSettingsHTTP2 = "off" + CustomHostnameNewResponseSSLSettingsHTTP2On CustomHostnameNewResponseSSLSettingsHTTP2 = "on" + CustomHostnameNewResponseSSLSettingsHTTP2Off CustomHostnameNewResponseSSLSettingsHTTP2 = "off" ) // The minimum TLS version supported. -type CustomHostnameUpdateResponseSSLSettingsMinTLSVersion string +type CustomHostnameNewResponseSSLSettingsMinTLSVersion string const ( - CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_0 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.0" - CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_1 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.1" - CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_2 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.2" - CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_3 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.3" + CustomHostnameNewResponseSSLSettingsMinTLSVersion1_0 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.0" + CustomHostnameNewResponseSSLSettingsMinTLSVersion1_1 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.1" + CustomHostnameNewResponseSSLSettingsMinTLSVersion1_2 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.2" + CustomHostnameNewResponseSSLSettingsMinTLSVersion1_3 CustomHostnameNewResponseSSLSettingsMinTLSVersion = "1.3" ) // Whether or not TLS 1.3 is enabled. -type CustomHostnameUpdateResponseSSLSettingsTLS1_3 string +type CustomHostnameNewResponseSSLSettingsTLS1_3 string const ( - CustomHostnameUpdateResponseSSLSettingsTLS1_3On CustomHostnameUpdateResponseSSLSettingsTLS1_3 = "on" - CustomHostnameUpdateResponseSSLSettingsTLS1_3Off CustomHostnameUpdateResponseSSLSettingsTLS1_3 = "off" + CustomHostnameNewResponseSSLSettingsTLS1_3On CustomHostnameNewResponseSSLSettingsTLS1_3 = "on" + CustomHostnameNewResponseSSLSettingsTLS1_3Off CustomHostnameNewResponseSSLSettingsTLS1_3 = "off" ) // Status of the hostname's SSL certificates. -type CustomHostnameUpdateResponseSSLStatus string +type CustomHostnameNewResponseSSLStatus string const ( - CustomHostnameUpdateResponseSSLStatusInitializing CustomHostnameUpdateResponseSSLStatus = "initializing" - CustomHostnameUpdateResponseSSLStatusPendingValidation CustomHostnameUpdateResponseSSLStatus = "pending_validation" - CustomHostnameUpdateResponseSSLStatusDeleted CustomHostnameUpdateResponseSSLStatus = "deleted" - CustomHostnameUpdateResponseSSLStatusPendingIssuance CustomHostnameUpdateResponseSSLStatus = "pending_issuance" - CustomHostnameUpdateResponseSSLStatusPendingDeployment CustomHostnameUpdateResponseSSLStatus = "pending_deployment" - CustomHostnameUpdateResponseSSLStatusPendingDeletion CustomHostnameUpdateResponseSSLStatus = "pending_deletion" - CustomHostnameUpdateResponseSSLStatusPendingExpiration CustomHostnameUpdateResponseSSLStatus = "pending_expiration" - CustomHostnameUpdateResponseSSLStatusExpired CustomHostnameUpdateResponseSSLStatus = "expired" - CustomHostnameUpdateResponseSSLStatusActive CustomHostnameUpdateResponseSSLStatus = "active" - CustomHostnameUpdateResponseSSLStatusInitializingTimedOut CustomHostnameUpdateResponseSSLStatus = "initializing_timed_out" - CustomHostnameUpdateResponseSSLStatusValidationTimedOut CustomHostnameUpdateResponseSSLStatus = "validation_timed_out" - CustomHostnameUpdateResponseSSLStatusIssuanceTimedOut CustomHostnameUpdateResponseSSLStatus = "issuance_timed_out" - CustomHostnameUpdateResponseSSLStatusDeploymentTimedOut CustomHostnameUpdateResponseSSLStatus = "deployment_timed_out" - CustomHostnameUpdateResponseSSLStatusDeletionTimedOut CustomHostnameUpdateResponseSSLStatus = "deletion_timed_out" - CustomHostnameUpdateResponseSSLStatusPendingCleanup CustomHostnameUpdateResponseSSLStatus = "pending_cleanup" - CustomHostnameUpdateResponseSSLStatusStagingDeployment CustomHostnameUpdateResponseSSLStatus = "staging_deployment" - CustomHostnameUpdateResponseSSLStatusStagingActive CustomHostnameUpdateResponseSSLStatus = "staging_active" - CustomHostnameUpdateResponseSSLStatusDeactivating CustomHostnameUpdateResponseSSLStatus = "deactivating" - CustomHostnameUpdateResponseSSLStatusInactive CustomHostnameUpdateResponseSSLStatus = "inactive" - CustomHostnameUpdateResponseSSLStatusBackupIssued CustomHostnameUpdateResponseSSLStatus = "backup_issued" - CustomHostnameUpdateResponseSSLStatusHoldingDeployment CustomHostnameUpdateResponseSSLStatus = "holding_deployment" + CustomHostnameNewResponseSSLStatusInitializing CustomHostnameNewResponseSSLStatus = "initializing" + CustomHostnameNewResponseSSLStatusPendingValidation CustomHostnameNewResponseSSLStatus = "pending_validation" + CustomHostnameNewResponseSSLStatusDeleted CustomHostnameNewResponseSSLStatus = "deleted" + CustomHostnameNewResponseSSLStatusPendingIssuance CustomHostnameNewResponseSSLStatus = "pending_issuance" + CustomHostnameNewResponseSSLStatusPendingDeployment CustomHostnameNewResponseSSLStatus = "pending_deployment" + CustomHostnameNewResponseSSLStatusPendingDeletion CustomHostnameNewResponseSSLStatus = "pending_deletion" + CustomHostnameNewResponseSSLStatusPendingExpiration CustomHostnameNewResponseSSLStatus = "pending_expiration" + CustomHostnameNewResponseSSLStatusExpired CustomHostnameNewResponseSSLStatus = "expired" + CustomHostnameNewResponseSSLStatusActive CustomHostnameNewResponseSSLStatus = "active" + CustomHostnameNewResponseSSLStatusInitializingTimedOut CustomHostnameNewResponseSSLStatus = "initializing_timed_out" + CustomHostnameNewResponseSSLStatusValidationTimedOut CustomHostnameNewResponseSSLStatus = "validation_timed_out" + CustomHostnameNewResponseSSLStatusIssuanceTimedOut CustomHostnameNewResponseSSLStatus = "issuance_timed_out" + CustomHostnameNewResponseSSLStatusDeploymentTimedOut CustomHostnameNewResponseSSLStatus = "deployment_timed_out" + CustomHostnameNewResponseSSLStatusDeletionTimedOut CustomHostnameNewResponseSSLStatus = "deletion_timed_out" + CustomHostnameNewResponseSSLStatusPendingCleanup CustomHostnameNewResponseSSLStatus = "pending_cleanup" + CustomHostnameNewResponseSSLStatusStagingDeployment CustomHostnameNewResponseSSLStatus = "staging_deployment" + CustomHostnameNewResponseSSLStatusStagingActive CustomHostnameNewResponseSSLStatus = "staging_active" + CustomHostnameNewResponseSSLStatusDeactivating CustomHostnameNewResponseSSLStatus = "deactivating" + CustomHostnameNewResponseSSLStatusInactive CustomHostnameNewResponseSSLStatus = "inactive" + CustomHostnameNewResponseSSLStatusBackupIssued CustomHostnameNewResponseSSLStatus = "backup_issued" + CustomHostnameNewResponseSSLStatusHoldingDeployment CustomHostnameNewResponseSSLStatus = "holding_deployment" ) // Level of validation to be used for this hostname. Domain validation (dv) must be // used. -type CustomHostnameUpdateResponseSSLType string +type CustomHostnameNewResponseSSLType string const ( - CustomHostnameUpdateResponseSSLTypeDv CustomHostnameUpdateResponseSSLType = "dv" + CustomHostnameNewResponseSSLTypeDv CustomHostnameNewResponseSSLType = "dv" ) -type CustomHostnameUpdateResponseSSLValidationError struct { +type CustomHostnameNewResponseSSLValidationError struct { // A domain validation error. - Message string `json:"message"` - JSON customHostnameUpdateResponseSSLValidationErrorJSON `json:"-"` + Message string `json:"message"` + JSON customHostnameNewResponseSSLValidationErrorJSON `json:"-"` } -// customHostnameUpdateResponseSSLValidationErrorJSON contains the JSON metadata -// for the struct [CustomHostnameUpdateResponseSSLValidationError] -type customHostnameUpdateResponseSSLValidationErrorJSON struct { +// customHostnameNewResponseSSLValidationErrorJSON contains the JSON metadata for +// the struct [CustomHostnameNewResponseSSLValidationError] +type customHostnameNewResponseSSLValidationErrorJSON struct { Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate's required validation record. -type CustomHostnameUpdateResponseSSLValidationRecord struct { +type CustomHostnameNewResponseSSLValidationRecord struct { // The set of email addresses that the certificate authority (CA) will use to // complete domain validation. Emails []interface{} `json:"emails"` @@ -370,13 +381,13 @@ type CustomHostnameUpdateResponseSSLValidationRecord struct { TxtName string `json:"txt_name"` // The TXT record that the certificate authority (CA) will check during domain // validation. - TxtValue string `json:"txt_value"` - JSON customHostnameUpdateResponseSSLValidationRecordJSON `json:"-"` + TxtValue string `json:"txt_value"` + JSON customHostnameNewResponseSSLValidationRecordJSON `json:"-"` } -// customHostnameUpdateResponseSSLValidationRecordJSON contains the JSON metadata -// for the struct [CustomHostnameUpdateResponseSSLValidationRecord] -type customHostnameUpdateResponseSSLValidationRecordJSON struct { +// customHostnameNewResponseSSLValidationRecordJSON contains the JSON metadata for +// the struct [CustomHostnameNewResponseSSLValidationRecord] +type customHostnameNewResponseSSLValidationRecordJSON struct { Emails apijson.Field HTTPBody apijson.Field HTTPURL apijson.Field @@ -386,42 +397,23 @@ type customHostnameUpdateResponseSSLValidationRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomHostnameDeleteResponse struct { - // Identifier - ID string `json:"id"` - JSON customHostnameDeleteResponseJSON `json:"-"` -} - -// customHostnameDeleteResponseJSON contains the JSON metadata for the struct -// [CustomHostnameDeleteResponse] -type customHostnameDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse struct { +type CustomHostnameUpdateResponse struct { // Identifier ID string `json:"id,required"` // The custom hostname that will point to your hostname via CNAME. Hostname string `json:"hostname,required"` // SSL properties for the custom hostname. - SSL CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL `json:"ssl,required"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseJSON `json:"-"` + SSL CustomHostnameUpdateResponseSSL `json:"ssl,required"` + JSON customHostnameUpdateResponseJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseJSON contains the -// JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseJSON struct { +// customHostnameUpdateResponseJSON contains the JSON metadata for the struct +// [CustomHostnameUpdateResponse] +type customHostnameUpdateResponseJSON struct { ID apijson.Field Hostname apijson.Field SSL apijson.Field @@ -429,21 +421,21 @@ type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // SSL properties for the custom hostname. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL struct { +type CustomHostnameUpdateResponseSSL struct { // Custom hostname SSL identifier tag. ID string `json:"id"` // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethod `json:"bundle_method"` + BundleMethod CustomHostnameUpdateResponseSSLBundleMethod `json:"bundle_method"` // The Certificate Authority that will issue the certificate - CertificateAuthority CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthority `json:"certificate_authority"` + CertificateAuthority CustomHostnameUpdateResponseSSLCertificateAuthority `json:"certificate_authority"` // If a custom uploaded certificate is used. CustomCertificate string `json:"custom_certificate"` // The identifier for the Custom CSR that was used. @@ -457,33 +449,32 @@ type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL struct { // The issuer on a custom uploaded certificate. Issuer string `json:"issuer"` // Domain control validation (DCV) method used for this hostname. - Method CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethod `json:"method"` + Method CustomHostnameUpdateResponseSSLMethod `json:"method"` // The serial number on a custom uploaded certificate. SerialNumber string `json:"serial_number"` // SSL specific settings. - Settings CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettings `json:"settings"` + Settings CustomHostnameUpdateResponseSSLSettings `json:"settings"` // The signature on a custom uploaded certificate. Signature string `json:"signature"` // Status of the hostname's SSL certificates. - Status CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus `json:"status"` + Status CustomHostnameUpdateResponseSSLStatus `json:"status"` // Level of validation to be used for this hostname. Domain validation (dv) must be // used. - Type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLType `json:"type"` + Type CustomHostnameUpdateResponseSSLType `json:"type"` // The time the custom certificate was uploaded. UploadedOn time.Time `json:"uploaded_on" format:"date-time"` // Domain validation errors that have been received by the certificate authority // (CA). - ValidationErrors []CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationError `json:"validation_errors"` - ValidationRecords []CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecord `json:"validation_records"` + ValidationErrors []CustomHostnameUpdateResponseSSLValidationError `json:"validation_errors"` + ValidationRecords []CustomHostnameUpdateResponseSSLValidationRecord `json:"validation_records"` // Indicates whether the certificate covers a wildcard. - Wildcard bool `json:"wildcard"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLJSON `json:"-"` + Wildcard bool `json:"wildcard"` + JSON customHostnameUpdateResponseSSLJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLJSON contains -// the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLJSON struct { +// customHostnameUpdateResponseSSLJSON contains the JSON metadata for the struct +// [CustomHostnameUpdateResponseSSL] +type customHostnameUpdateResponseSSLJSON struct { ID apijson.Field BundleMethod apijson.Field CertificateAuthority apijson.Field @@ -507,7 +498,7 @@ type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLJSON struct ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseSSL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -515,52 +506,51 @@ func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSL) Unmar // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethod string +type CustomHostnameUpdateResponseSSLBundleMethod string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethodUbiquitous CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethod = "ubiquitous" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethodOptimal CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethod = "optimal" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethodForce CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLBundleMethod = "force" + CustomHostnameUpdateResponseSSLBundleMethodUbiquitous CustomHostnameUpdateResponseSSLBundleMethod = "ubiquitous" + CustomHostnameUpdateResponseSSLBundleMethodOptimal CustomHostnameUpdateResponseSSLBundleMethod = "optimal" + CustomHostnameUpdateResponseSSLBundleMethodForce CustomHostnameUpdateResponseSSLBundleMethod = "force" ) // The Certificate Authority that will issue the certificate -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthority string +type CustomHostnameUpdateResponseSSLCertificateAuthority string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthorityDigicert CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthority = "digicert" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthorityGoogle CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthority = "google" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLCertificateAuthority = "lets_encrypt" + CustomHostnameUpdateResponseSSLCertificateAuthorityDigicert CustomHostnameUpdateResponseSSLCertificateAuthority = "digicert" + CustomHostnameUpdateResponseSSLCertificateAuthorityGoogle CustomHostnameUpdateResponseSSLCertificateAuthority = "google" + CustomHostnameUpdateResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameUpdateResponseSSLCertificateAuthority = "lets_encrypt" ) // Domain control validation (DCV) method used for this hostname. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethod string +type CustomHostnameUpdateResponseSSLMethod string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethodHTTP CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethod = "http" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethodTxt CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethod = "txt" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethodEmail CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLMethod = "email" + CustomHostnameUpdateResponseSSLMethodHTTP CustomHostnameUpdateResponseSSLMethod = "http" + CustomHostnameUpdateResponseSSLMethodTxt CustomHostnameUpdateResponseSSLMethod = "txt" + CustomHostnameUpdateResponseSSLMethodEmail CustomHostnameUpdateResponseSSLMethod = "email" ) // SSL specific settings. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettings struct { +type CustomHostnameUpdateResponseSSLSettings struct { // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. Ciphers []string `json:"ciphers"` // Whether or not Early Hints is enabled. - EarlyHints CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHints `json:"early_hints"` + EarlyHints CustomHostnameUpdateResponseSSLSettingsEarlyHints `json:"early_hints"` // Whether or not HTTP2 is enabled. - HTTP2 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2 `json:"http2"` + HTTP2 CustomHostnameUpdateResponseSSLSettingsHTTP2 `json:"http2"` // The minimum TLS version supported. - MinTLSVersion CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` + MinTLSVersion CustomHostnameUpdateResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` // Whether or not TLS 1.3 is enabled. - TLS1_3 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3 `json:"tls_1_3"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsJSON `json:"-"` + TLS1_3 CustomHostnameUpdateResponseSSLSettingsTLS1_3 `json:"tls_1_3"` + JSON customHostnameUpdateResponseSSLSettingsJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettings] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsJSON struct { +// customHostnameUpdateResponseSSLSettingsJSON contains the JSON metadata for the +// struct [CustomHostnameUpdateResponseSSLSettings] +type customHostnameUpdateResponseSSLSettingsJSON struct { Ciphers apijson.Field EarlyHints apijson.Field HTTP2 apijson.Field @@ -570,100 +560,99 @@ type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsJSO ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether or not Early Hints is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHints string +type CustomHostnameUpdateResponseSSLSettingsEarlyHints string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHintsOn CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHints = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHintsOff CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsEarlyHints = "off" + CustomHostnameUpdateResponseSSLSettingsEarlyHintsOn CustomHostnameUpdateResponseSSLSettingsEarlyHints = "on" + CustomHostnameUpdateResponseSSLSettingsEarlyHintsOff CustomHostnameUpdateResponseSSLSettingsEarlyHints = "off" ) // Whether or not HTTP2 is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2 string +type CustomHostnameUpdateResponseSSLSettingsHTTP2 string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2On CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2 = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2Off CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsHTTP2 = "off" + CustomHostnameUpdateResponseSSLSettingsHTTP2On CustomHostnameUpdateResponseSSLSettingsHTTP2 = "on" + CustomHostnameUpdateResponseSSLSettingsHTTP2Off CustomHostnameUpdateResponseSSLSettingsHTTP2 = "off" ) // The minimum TLS version supported. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion string +type CustomHostnameUpdateResponseSSLSettingsMinTLSVersion string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion1_0 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion = "1.0" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion1_1 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion = "1.1" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion1_2 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion = "1.2" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion1_3 CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsMinTLSVersion = "1.3" + CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_0 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.0" + CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_1 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.1" + CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_2 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.2" + CustomHostnameUpdateResponseSSLSettingsMinTLSVersion1_3 CustomHostnameUpdateResponseSSLSettingsMinTLSVersion = "1.3" ) // Whether or not TLS 1.3 is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3 string +type CustomHostnameUpdateResponseSSLSettingsTLS1_3 string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3On CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3 = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3Off CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLSettingsTLS1_3 = "off" + CustomHostnameUpdateResponseSSLSettingsTLS1_3On CustomHostnameUpdateResponseSSLSettingsTLS1_3 = "on" + CustomHostnameUpdateResponseSSLSettingsTLS1_3Off CustomHostnameUpdateResponseSSLSettingsTLS1_3 = "off" ) // Status of the hostname's SSL certificates. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus string +type CustomHostnameUpdateResponseSSLStatus string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusInitializing CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "initializing" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingValidation CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_validation" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusDeleted CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "deleted" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingIssuance CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_issuance" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingDeployment CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_deployment" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingDeletion CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_deletion" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingExpiration CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_expiration" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusExpired CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "expired" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusActive CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "active" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusInitializingTimedOut CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "initializing_timed_out" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusValidationTimedOut CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "validation_timed_out" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusIssuanceTimedOut CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "issuance_timed_out" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusDeploymentTimedOut CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "deployment_timed_out" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusDeletionTimedOut CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "deletion_timed_out" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusPendingCleanup CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "pending_cleanup" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusStagingDeployment CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "staging_deployment" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusStagingActive CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "staging_active" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusDeactivating CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "deactivating" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusInactive CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "inactive" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusBackupIssued CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "backup_issued" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatusHoldingDeployment CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLStatus = "holding_deployment" + CustomHostnameUpdateResponseSSLStatusInitializing CustomHostnameUpdateResponseSSLStatus = "initializing" + CustomHostnameUpdateResponseSSLStatusPendingValidation CustomHostnameUpdateResponseSSLStatus = "pending_validation" + CustomHostnameUpdateResponseSSLStatusDeleted CustomHostnameUpdateResponseSSLStatus = "deleted" + CustomHostnameUpdateResponseSSLStatusPendingIssuance CustomHostnameUpdateResponseSSLStatus = "pending_issuance" + CustomHostnameUpdateResponseSSLStatusPendingDeployment CustomHostnameUpdateResponseSSLStatus = "pending_deployment" + CustomHostnameUpdateResponseSSLStatusPendingDeletion CustomHostnameUpdateResponseSSLStatus = "pending_deletion" + CustomHostnameUpdateResponseSSLStatusPendingExpiration CustomHostnameUpdateResponseSSLStatus = "pending_expiration" + CustomHostnameUpdateResponseSSLStatusExpired CustomHostnameUpdateResponseSSLStatus = "expired" + CustomHostnameUpdateResponseSSLStatusActive CustomHostnameUpdateResponseSSLStatus = "active" + CustomHostnameUpdateResponseSSLStatusInitializingTimedOut CustomHostnameUpdateResponseSSLStatus = "initializing_timed_out" + CustomHostnameUpdateResponseSSLStatusValidationTimedOut CustomHostnameUpdateResponseSSLStatus = "validation_timed_out" + CustomHostnameUpdateResponseSSLStatusIssuanceTimedOut CustomHostnameUpdateResponseSSLStatus = "issuance_timed_out" + CustomHostnameUpdateResponseSSLStatusDeploymentTimedOut CustomHostnameUpdateResponseSSLStatus = "deployment_timed_out" + CustomHostnameUpdateResponseSSLStatusDeletionTimedOut CustomHostnameUpdateResponseSSLStatus = "deletion_timed_out" + CustomHostnameUpdateResponseSSLStatusPendingCleanup CustomHostnameUpdateResponseSSLStatus = "pending_cleanup" + CustomHostnameUpdateResponseSSLStatusStagingDeployment CustomHostnameUpdateResponseSSLStatus = "staging_deployment" + CustomHostnameUpdateResponseSSLStatusStagingActive CustomHostnameUpdateResponseSSLStatus = "staging_active" + CustomHostnameUpdateResponseSSLStatusDeactivating CustomHostnameUpdateResponseSSLStatus = "deactivating" + CustomHostnameUpdateResponseSSLStatusInactive CustomHostnameUpdateResponseSSLStatus = "inactive" + CustomHostnameUpdateResponseSSLStatusBackupIssued CustomHostnameUpdateResponseSSLStatus = "backup_issued" + CustomHostnameUpdateResponseSSLStatusHoldingDeployment CustomHostnameUpdateResponseSSLStatus = "holding_deployment" ) // Level of validation to be used for this hostname. Domain validation (dv) must be // used. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLType string +type CustomHostnameUpdateResponseSSLType string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLTypeDv CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLType = "dv" + CustomHostnameUpdateResponseSSLTypeDv CustomHostnameUpdateResponseSSLType = "dv" ) -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationError struct { +type CustomHostnameUpdateResponseSSLValidationError struct { // A domain validation error. - Message string `json:"message"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationErrorJSON `json:"-"` + Message string `json:"message"` + JSON customHostnameUpdateResponseSSLValidationErrorJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationErrorJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationError] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationErrorJSON struct { +// customHostnameUpdateResponseSSLValidationErrorJSON contains the JSON metadata +// for the struct [CustomHostnameUpdateResponseSSLValidationError] +type customHostnameUpdateResponseSSLValidationErrorJSON struct { Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate's required validation record. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecord struct { +type CustomHostnameUpdateResponseSSLValidationRecord struct { // The set of email addresses that the certificate authority (CA) will use to // complete domain validation. Emails []interface{} `json:"emails"` @@ -677,14 +666,13 @@ type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationR TxtName string `json:"txt_name"` // The TXT record that the certificate authority (CA) will check during domain // validation. - TxtValue string `json:"txt_value"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecordJSON `json:"-"` + TxtValue string `json:"txt_value"` + JSON customHostnameUpdateResponseSSLValidationRecordJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecordJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecord] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecordJSON struct { +// customHostnameUpdateResponseSSLValidationRecordJSON contains the JSON metadata +// for the struct [CustomHostnameUpdateResponseSSLValidationRecord] +type customHostnameUpdateResponseSSLValidationRecordJSON struct { Emails apijson.Field HTTPBody apijson.Field HTTPURL apijson.Field @@ -694,24 +682,23 @@ type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationR ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse struct { +type CustomHostnameListResponse struct { // Identifier ID string `json:"id,required"` // The custom hostname that will point to your hostname via CNAME. Hostname string `json:"hostname,required"` // SSL properties for the custom hostname. - SSL CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL `json:"ssl,required"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseJSON `json:"-"` + SSL CustomHostnameListResponseSSL `json:"ssl,required"` + JSON customHostnameListResponseJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseJSON contains the -// JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseJSON struct { +// customHostnameListResponseJSON contains the JSON metadata for the struct +// [CustomHostnameListResponse] +type customHostnameListResponseJSON struct { ID apijson.Field Hostname apijson.Field SSL apijson.Field @@ -719,21 +706,21 @@ type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // SSL properties for the custom hostname. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL struct { +type CustomHostnameListResponseSSL struct { // Custom hostname SSL identifier tag. ID string `json:"id"` // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethod `json:"bundle_method"` + BundleMethod CustomHostnameListResponseSSLBundleMethod `json:"bundle_method"` // The Certificate Authority that will issue the certificate - CertificateAuthority CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthority `json:"certificate_authority"` + CertificateAuthority CustomHostnameListResponseSSLCertificateAuthority `json:"certificate_authority"` // If a custom uploaded certificate is used. CustomCertificate string `json:"custom_certificate"` // The identifier for the Custom CSR that was used. @@ -747,33 +734,32 @@ type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL struct { // The issuer on a custom uploaded certificate. Issuer string `json:"issuer"` // Domain control validation (DCV) method used for this hostname. - Method CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethod `json:"method"` + Method CustomHostnameListResponseSSLMethod `json:"method"` // The serial number on a custom uploaded certificate. SerialNumber string `json:"serial_number"` // SSL specific settings. - Settings CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettings `json:"settings"` + Settings CustomHostnameListResponseSSLSettings `json:"settings"` // The signature on a custom uploaded certificate. Signature string `json:"signature"` // Status of the hostname's SSL certificates. - Status CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus `json:"status"` + Status CustomHostnameListResponseSSLStatus `json:"status"` // Level of validation to be used for this hostname. Domain validation (dv) must be // used. - Type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLType `json:"type"` + Type CustomHostnameListResponseSSLType `json:"type"` // The time the custom certificate was uploaded. UploadedOn time.Time `json:"uploaded_on" format:"date-time"` // Domain validation errors that have been received by the certificate authority // (CA). - ValidationErrors []CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationError `json:"validation_errors"` - ValidationRecords []CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecord `json:"validation_records"` + ValidationErrors []CustomHostnameListResponseSSLValidationError `json:"validation_errors"` + ValidationRecords []CustomHostnameListResponseSSLValidationRecord `json:"validation_records"` // Indicates whether the certificate covers a wildcard. - Wildcard bool `json:"wildcard"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLJSON `json:"-"` + Wildcard bool `json:"wildcard"` + JSON customHostnameListResponseSSLJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLJSON contains -// the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLJSON struct { +// customHostnameListResponseSSLJSON contains the JSON metadata for the struct +// [CustomHostnameListResponseSSL] +type customHostnameListResponseSSLJSON struct { ID apijson.Field BundleMethod apijson.Field CertificateAuthority apijson.Field @@ -797,7 +783,7 @@ type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLJSON stru ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameListResponseSSL) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -805,52 +791,51 @@ func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSL) Unm // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethod string +type CustomHostnameListResponseSSLBundleMethod string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethodUbiquitous CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethod = "ubiquitous" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethodOptimal CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethod = "optimal" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethodForce CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLBundleMethod = "force" + CustomHostnameListResponseSSLBundleMethodUbiquitous CustomHostnameListResponseSSLBundleMethod = "ubiquitous" + CustomHostnameListResponseSSLBundleMethodOptimal CustomHostnameListResponseSSLBundleMethod = "optimal" + CustomHostnameListResponseSSLBundleMethodForce CustomHostnameListResponseSSLBundleMethod = "force" ) // The Certificate Authority that will issue the certificate -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthority string +type CustomHostnameListResponseSSLCertificateAuthority string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthorityDigicert CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthority = "digicert" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthorityGoogle CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthority = "google" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLCertificateAuthority = "lets_encrypt" + CustomHostnameListResponseSSLCertificateAuthorityDigicert CustomHostnameListResponseSSLCertificateAuthority = "digicert" + CustomHostnameListResponseSSLCertificateAuthorityGoogle CustomHostnameListResponseSSLCertificateAuthority = "google" + CustomHostnameListResponseSSLCertificateAuthorityLetsEncrypt CustomHostnameListResponseSSLCertificateAuthority = "lets_encrypt" ) // Domain control validation (DCV) method used for this hostname. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethod string +type CustomHostnameListResponseSSLMethod string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethodHTTP CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethod = "http" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethodTxt CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethod = "txt" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethodEmail CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLMethod = "email" + CustomHostnameListResponseSSLMethodHTTP CustomHostnameListResponseSSLMethod = "http" + CustomHostnameListResponseSSLMethodTxt CustomHostnameListResponseSSLMethod = "txt" + CustomHostnameListResponseSSLMethodEmail CustomHostnameListResponseSSLMethod = "email" ) // SSL specific settings. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettings struct { +type CustomHostnameListResponseSSLSettings struct { // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. Ciphers []string `json:"ciphers"` // Whether or not Early Hints is enabled. - EarlyHints CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHints `json:"early_hints"` + EarlyHints CustomHostnameListResponseSSLSettingsEarlyHints `json:"early_hints"` // Whether or not HTTP2 is enabled. - HTTP2 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2 `json:"http2"` + HTTP2 CustomHostnameListResponseSSLSettingsHTTP2 `json:"http2"` // The minimum TLS version supported. - MinTLSVersion CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` + MinTLSVersion CustomHostnameListResponseSSLSettingsMinTLSVersion `json:"min_tls_version"` // Whether or not TLS 1.3 is enabled. - TLS1_3 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3 `json:"tls_1_3"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsJSON `json:"-"` + TLS1_3 CustomHostnameListResponseSSLSettingsTLS1_3 `json:"tls_1_3"` + JSON customHostnameListResponseSSLSettingsJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettings] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsJSON struct { +// customHostnameListResponseSSLSettingsJSON contains the JSON metadata for the +// struct [CustomHostnameListResponseSSLSettings] +type customHostnameListResponseSSLSettingsJSON struct { Ciphers apijson.Field EarlyHints apijson.Field HTTP2 apijson.Field @@ -860,100 +845,99 @@ type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsJ ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameListResponseSSLSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether or not Early Hints is enabled. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHints string +type CustomHostnameListResponseSSLSettingsEarlyHints string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHintsOn CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHints = "on" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHintsOff CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsEarlyHints = "off" + CustomHostnameListResponseSSLSettingsEarlyHintsOn CustomHostnameListResponseSSLSettingsEarlyHints = "on" + CustomHostnameListResponseSSLSettingsEarlyHintsOff CustomHostnameListResponseSSLSettingsEarlyHints = "off" ) // Whether or not HTTP2 is enabled. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2 string +type CustomHostnameListResponseSSLSettingsHTTP2 string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2On CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2 = "on" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2Off CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsHTTP2 = "off" + CustomHostnameListResponseSSLSettingsHTTP2On CustomHostnameListResponseSSLSettingsHTTP2 = "on" + CustomHostnameListResponseSSLSettingsHTTP2Off CustomHostnameListResponseSSLSettingsHTTP2 = "off" ) // The minimum TLS version supported. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion string +type CustomHostnameListResponseSSLSettingsMinTLSVersion string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion1_0 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion = "1.0" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion1_1 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion = "1.1" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion1_2 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion = "1.2" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion1_3 CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsMinTLSVersion = "1.3" + CustomHostnameListResponseSSLSettingsMinTLSVersion1_0 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.0" + CustomHostnameListResponseSSLSettingsMinTLSVersion1_1 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.1" + CustomHostnameListResponseSSLSettingsMinTLSVersion1_2 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.2" + CustomHostnameListResponseSSLSettingsMinTLSVersion1_3 CustomHostnameListResponseSSLSettingsMinTLSVersion = "1.3" ) // Whether or not TLS 1.3 is enabled. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3 string +type CustomHostnameListResponseSSLSettingsTLS1_3 string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3On CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3 = "on" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3Off CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLSettingsTLS1_3 = "off" + CustomHostnameListResponseSSLSettingsTLS1_3On CustomHostnameListResponseSSLSettingsTLS1_3 = "on" + CustomHostnameListResponseSSLSettingsTLS1_3Off CustomHostnameListResponseSSLSettingsTLS1_3 = "off" ) // Status of the hostname's SSL certificates. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus string +type CustomHostnameListResponseSSLStatus string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusInitializing CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "initializing" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingValidation CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_validation" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusDeleted CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "deleted" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingIssuance CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_issuance" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingDeployment CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_deployment" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingDeletion CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_deletion" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingExpiration CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_expiration" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusExpired CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "expired" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusActive CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "active" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusInitializingTimedOut CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "initializing_timed_out" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusValidationTimedOut CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "validation_timed_out" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusIssuanceTimedOut CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "issuance_timed_out" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusDeploymentTimedOut CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "deployment_timed_out" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusDeletionTimedOut CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "deletion_timed_out" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusPendingCleanup CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "pending_cleanup" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusStagingDeployment CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "staging_deployment" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusStagingActive CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "staging_active" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusDeactivating CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "deactivating" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusInactive CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "inactive" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusBackupIssued CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "backup_issued" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatusHoldingDeployment CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLStatus = "holding_deployment" + CustomHostnameListResponseSSLStatusInitializing CustomHostnameListResponseSSLStatus = "initializing" + CustomHostnameListResponseSSLStatusPendingValidation CustomHostnameListResponseSSLStatus = "pending_validation" + CustomHostnameListResponseSSLStatusDeleted CustomHostnameListResponseSSLStatus = "deleted" + CustomHostnameListResponseSSLStatusPendingIssuance CustomHostnameListResponseSSLStatus = "pending_issuance" + CustomHostnameListResponseSSLStatusPendingDeployment CustomHostnameListResponseSSLStatus = "pending_deployment" + CustomHostnameListResponseSSLStatusPendingDeletion CustomHostnameListResponseSSLStatus = "pending_deletion" + CustomHostnameListResponseSSLStatusPendingExpiration CustomHostnameListResponseSSLStatus = "pending_expiration" + CustomHostnameListResponseSSLStatusExpired CustomHostnameListResponseSSLStatus = "expired" + CustomHostnameListResponseSSLStatusActive CustomHostnameListResponseSSLStatus = "active" + CustomHostnameListResponseSSLStatusInitializingTimedOut CustomHostnameListResponseSSLStatus = "initializing_timed_out" + CustomHostnameListResponseSSLStatusValidationTimedOut CustomHostnameListResponseSSLStatus = "validation_timed_out" + CustomHostnameListResponseSSLStatusIssuanceTimedOut CustomHostnameListResponseSSLStatus = "issuance_timed_out" + CustomHostnameListResponseSSLStatusDeploymentTimedOut CustomHostnameListResponseSSLStatus = "deployment_timed_out" + CustomHostnameListResponseSSLStatusDeletionTimedOut CustomHostnameListResponseSSLStatus = "deletion_timed_out" + CustomHostnameListResponseSSLStatusPendingCleanup CustomHostnameListResponseSSLStatus = "pending_cleanup" + CustomHostnameListResponseSSLStatusStagingDeployment CustomHostnameListResponseSSLStatus = "staging_deployment" + CustomHostnameListResponseSSLStatusStagingActive CustomHostnameListResponseSSLStatus = "staging_active" + CustomHostnameListResponseSSLStatusDeactivating CustomHostnameListResponseSSLStatus = "deactivating" + CustomHostnameListResponseSSLStatusInactive CustomHostnameListResponseSSLStatus = "inactive" + CustomHostnameListResponseSSLStatusBackupIssued CustomHostnameListResponseSSLStatus = "backup_issued" + CustomHostnameListResponseSSLStatusHoldingDeployment CustomHostnameListResponseSSLStatus = "holding_deployment" ) // Level of validation to be used for this hostname. Domain validation (dv) must be // used. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLType string +type CustomHostnameListResponseSSLType string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLTypeDv CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLType = "dv" + CustomHostnameListResponseSSLTypeDv CustomHostnameListResponseSSLType = "dv" ) -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationError struct { +type CustomHostnameListResponseSSLValidationError struct { // A domain validation error. - Message string `json:"message"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationErrorJSON `json:"-"` + Message string `json:"message"` + JSON customHostnameListResponseSSLValidationErrorJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationErrorJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationError] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationErrorJSON struct { +// customHostnameListResponseSSLValidationErrorJSON contains the JSON metadata for +// the struct [CustomHostnameListResponseSSLValidationError] +type customHostnameListResponseSSLValidationErrorJSON struct { Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameListResponseSSLValidationError) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate's required validation record. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecord struct { +type CustomHostnameListResponseSSLValidationRecord struct { // The set of email addresses that the certificate authority (CA) will use to // complete domain validation. Emails []interface{} `json:"emails"` @@ -967,14 +951,13 @@ type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidatio TxtName string `json:"txt_name"` // The TXT record that the certificate authority (CA) will check during domain // validation. - TxtValue string `json:"txt_value"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecordJSON `json:"-"` + TxtValue string `json:"txt_value"` + JSON customHostnameListResponseSSLValidationRecordJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecordJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecord] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecordJSON struct { +// customHostnameListResponseSSLValidationRecordJSON contains the JSON metadata for +// the struct [CustomHostnameListResponseSSLValidationRecord] +type customHostnameListResponseSSLValidationRecordJSON struct { Emails apijson.Field HTTPBody apijson.Field HTTPURL apijson.Field @@ -984,7 +967,25 @@ type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidatio ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameListResponseSSLValidationRecord) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomHostnameDeleteResponse struct { + // Identifier + ID string `json:"id"` + JSON customHostnameDeleteResponseJSON `json:"-"` +} + +// customHostnameDeleteResponseJSON contains the JSON metadata for the struct +// [CustomHostnameDeleteResponse] +type customHostnameDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomHostnameDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1273,61 +1274,44 @@ func (r *CustomHostnameGetResponseSSLValidationRecord) UnmarshalJSON(data []byte return apijson.UnmarshalRoot(data, r) } -type CustomHostnameUpdateParams struct { - // These are per-hostname (customer) settings. - CustomMetadata param.Field[CustomHostnameUpdateParamsCustomMetadata] `json:"custom_metadata"` - // a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME - // record. - CustomOriginServer param.Field[string] `json:"custom_origin_server"` - // A hostname that will be sent to your custom origin server as SNI for TLS - // handshake. This can be a valid subdomain of the zone or custom origin server - // name or the string ':request_host_header:' which will cause the host header in - // the request to be used as SNI. Not configurable with default/fallback origin - // server. - CustomOriginSni param.Field[string] `json:"custom_origin_sni"` +type CustomHostnameNewParams struct { + // The custom hostname that will point to your hostname via CNAME. + Hostname param.Field[string] `json:"hostname,required"` // SSL properties used when creating the custom hostname. - SSL param.Field[CustomHostnameUpdateParamsSSL] `json:"ssl"` -} - -func (r CustomHostnameUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// These are per-hostname (customer) settings. -type CustomHostnameUpdateParamsCustomMetadata struct { - // Unique metadata for this hostname. - Key param.Field[string] `json:"key"` + SSL param.Field[CustomHostnameNewParamsSSL] `json:"ssl,required"` + // These are per-hostname (customer) settings. + CustomMetadata param.Field[CustomHostnameNewParamsCustomMetadata] `json:"custom_metadata"` } -func (r CustomHostnameUpdateParamsCustomMetadata) MarshalJSON() (data []byte, err error) { +func (r CustomHostnameNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // SSL properties used when creating the custom hostname. -type CustomHostnameUpdateParamsSSL struct { +type CustomHostnameNewParamsSSL struct { // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod param.Field[CustomHostnameUpdateParamsSSLBundleMethod] `json:"bundle_method"` + BundleMethod param.Field[CustomHostnameNewParamsSSLBundleMethod] `json:"bundle_method"` // The Certificate Authority that will issue the certificate - CertificateAuthority param.Field[CustomHostnameUpdateParamsSSLCertificateAuthority] `json:"certificate_authority"` + CertificateAuthority param.Field[CustomHostnameNewParamsSSLCertificateAuthority] `json:"certificate_authority"` // If a custom uploaded certificate is used. CustomCertificate param.Field[string] `json:"custom_certificate"` // The key for a custom uploaded certificate. CustomKey param.Field[string] `json:"custom_key"` // Domain control validation (DCV) method used for this hostname. - Method param.Field[CustomHostnameUpdateParamsSSLMethod] `json:"method"` + Method param.Field[CustomHostnameNewParamsSSLMethod] `json:"method"` // SSL specific settings. - Settings param.Field[CustomHostnameUpdateParamsSSLSettings] `json:"settings"` + Settings param.Field[CustomHostnameNewParamsSSLSettings] `json:"settings"` // Level of validation to be used for this hostname. Domain validation (dv) must be // used. - Type param.Field[CustomHostnameUpdateParamsSSLType] `json:"type"` + Type param.Field[CustomHostnameNewParamsSSLType] `json:"type"` // Indicates whether the certificate covers a wildcard. Wildcard param.Field[bool] `json:"wildcard"` } -func (r CustomHostnameUpdateParamsSSL) MarshalJSON() (data []byte, err error) { +func (r CustomHostnameNewParamsSSL) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -1335,105 +1319,115 @@ func (r CustomHostnameUpdateParamsSSL) MarshalJSON() (data []byte, err error) { // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomHostnameUpdateParamsSSLBundleMethod string +type CustomHostnameNewParamsSSLBundleMethod string const ( - CustomHostnameUpdateParamsSSLBundleMethodUbiquitous CustomHostnameUpdateParamsSSLBundleMethod = "ubiquitous" - CustomHostnameUpdateParamsSSLBundleMethodOptimal CustomHostnameUpdateParamsSSLBundleMethod = "optimal" - CustomHostnameUpdateParamsSSLBundleMethodForce CustomHostnameUpdateParamsSSLBundleMethod = "force" + CustomHostnameNewParamsSSLBundleMethodUbiquitous CustomHostnameNewParamsSSLBundleMethod = "ubiquitous" + CustomHostnameNewParamsSSLBundleMethodOptimal CustomHostnameNewParamsSSLBundleMethod = "optimal" + CustomHostnameNewParamsSSLBundleMethodForce CustomHostnameNewParamsSSLBundleMethod = "force" ) // The Certificate Authority that will issue the certificate -type CustomHostnameUpdateParamsSSLCertificateAuthority string +type CustomHostnameNewParamsSSLCertificateAuthority string const ( - CustomHostnameUpdateParamsSSLCertificateAuthorityDigicert CustomHostnameUpdateParamsSSLCertificateAuthority = "digicert" - CustomHostnameUpdateParamsSSLCertificateAuthorityGoogle CustomHostnameUpdateParamsSSLCertificateAuthority = "google" - CustomHostnameUpdateParamsSSLCertificateAuthorityLetsEncrypt CustomHostnameUpdateParamsSSLCertificateAuthority = "lets_encrypt" + CustomHostnameNewParamsSSLCertificateAuthorityDigicert CustomHostnameNewParamsSSLCertificateAuthority = "digicert" + CustomHostnameNewParamsSSLCertificateAuthorityGoogle CustomHostnameNewParamsSSLCertificateAuthority = "google" + CustomHostnameNewParamsSSLCertificateAuthorityLetsEncrypt CustomHostnameNewParamsSSLCertificateAuthority = "lets_encrypt" ) // Domain control validation (DCV) method used for this hostname. -type CustomHostnameUpdateParamsSSLMethod string +type CustomHostnameNewParamsSSLMethod string const ( - CustomHostnameUpdateParamsSSLMethodHTTP CustomHostnameUpdateParamsSSLMethod = "http" - CustomHostnameUpdateParamsSSLMethodTxt CustomHostnameUpdateParamsSSLMethod = "txt" - CustomHostnameUpdateParamsSSLMethodEmail CustomHostnameUpdateParamsSSLMethod = "email" + CustomHostnameNewParamsSSLMethodHTTP CustomHostnameNewParamsSSLMethod = "http" + CustomHostnameNewParamsSSLMethodTxt CustomHostnameNewParamsSSLMethod = "txt" + CustomHostnameNewParamsSSLMethodEmail CustomHostnameNewParamsSSLMethod = "email" ) // SSL specific settings. -type CustomHostnameUpdateParamsSSLSettings struct { +type CustomHostnameNewParamsSSLSettings struct { // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. Ciphers param.Field[[]string] `json:"ciphers"` // Whether or not Early Hints is enabled. - EarlyHints param.Field[CustomHostnameUpdateParamsSSLSettingsEarlyHints] `json:"early_hints"` + EarlyHints param.Field[CustomHostnameNewParamsSSLSettingsEarlyHints] `json:"early_hints"` // Whether or not HTTP2 is enabled. - HTTP2 param.Field[CustomHostnameUpdateParamsSSLSettingsHTTP2] `json:"http2"` + HTTP2 param.Field[CustomHostnameNewParamsSSLSettingsHTTP2] `json:"http2"` // The minimum TLS version supported. - MinTLSVersion param.Field[CustomHostnameUpdateParamsSSLSettingsMinTLSVersion] `json:"min_tls_version"` + MinTLSVersion param.Field[CustomHostnameNewParamsSSLSettingsMinTLSVersion] `json:"min_tls_version"` // Whether or not TLS 1.3 is enabled. - TLS1_3 param.Field[CustomHostnameUpdateParamsSSLSettingsTLS1_3] `json:"tls_1_3"` + TLS1_3 param.Field[CustomHostnameNewParamsSSLSettingsTLS1_3] `json:"tls_1_3"` } -func (r CustomHostnameUpdateParamsSSLSettings) MarshalJSON() (data []byte, err error) { +func (r CustomHostnameNewParamsSSLSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Whether or not Early Hints is enabled. -type CustomHostnameUpdateParamsSSLSettingsEarlyHints string +type CustomHostnameNewParamsSSLSettingsEarlyHints string const ( - CustomHostnameUpdateParamsSSLSettingsEarlyHintsOn CustomHostnameUpdateParamsSSLSettingsEarlyHints = "on" - CustomHostnameUpdateParamsSSLSettingsEarlyHintsOff CustomHostnameUpdateParamsSSLSettingsEarlyHints = "off" + CustomHostnameNewParamsSSLSettingsEarlyHintsOn CustomHostnameNewParamsSSLSettingsEarlyHints = "on" + CustomHostnameNewParamsSSLSettingsEarlyHintsOff CustomHostnameNewParamsSSLSettingsEarlyHints = "off" ) // Whether or not HTTP2 is enabled. -type CustomHostnameUpdateParamsSSLSettingsHTTP2 string +type CustomHostnameNewParamsSSLSettingsHTTP2 string const ( - CustomHostnameUpdateParamsSSLSettingsHTTP2On CustomHostnameUpdateParamsSSLSettingsHTTP2 = "on" - CustomHostnameUpdateParamsSSLSettingsHTTP2Off CustomHostnameUpdateParamsSSLSettingsHTTP2 = "off" + CustomHostnameNewParamsSSLSettingsHTTP2On CustomHostnameNewParamsSSLSettingsHTTP2 = "on" + CustomHostnameNewParamsSSLSettingsHTTP2Off CustomHostnameNewParamsSSLSettingsHTTP2 = "off" ) // The minimum TLS version supported. -type CustomHostnameUpdateParamsSSLSettingsMinTLSVersion string +type CustomHostnameNewParamsSSLSettingsMinTLSVersion string const ( - CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_0 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.0" - CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_1 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.1" - CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_2 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.2" - CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_3 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.3" + CustomHostnameNewParamsSSLSettingsMinTLSVersion1_0 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.0" + CustomHostnameNewParamsSSLSettingsMinTLSVersion1_1 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.1" + CustomHostnameNewParamsSSLSettingsMinTLSVersion1_2 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.2" + CustomHostnameNewParamsSSLSettingsMinTLSVersion1_3 CustomHostnameNewParamsSSLSettingsMinTLSVersion = "1.3" ) // Whether or not TLS 1.3 is enabled. -type CustomHostnameUpdateParamsSSLSettingsTLS1_3 string +type CustomHostnameNewParamsSSLSettingsTLS1_3 string const ( - CustomHostnameUpdateParamsSSLSettingsTLS1_3On CustomHostnameUpdateParamsSSLSettingsTLS1_3 = "on" - CustomHostnameUpdateParamsSSLSettingsTLS1_3Off CustomHostnameUpdateParamsSSLSettingsTLS1_3 = "off" + CustomHostnameNewParamsSSLSettingsTLS1_3On CustomHostnameNewParamsSSLSettingsTLS1_3 = "on" + CustomHostnameNewParamsSSLSettingsTLS1_3Off CustomHostnameNewParamsSSLSettingsTLS1_3 = "off" ) // Level of validation to be used for this hostname. Domain validation (dv) must be // used. -type CustomHostnameUpdateParamsSSLType string +type CustomHostnameNewParamsSSLType string const ( - CustomHostnameUpdateParamsSSLTypeDv CustomHostnameUpdateParamsSSLType = "dv" + CustomHostnameNewParamsSSLTypeDv CustomHostnameNewParamsSSLType = "dv" ) -type CustomHostnameUpdateResponseEnvelope struct { - Errors []CustomHostnameUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomHostnameUpdateResponseEnvelopeMessages `json:"messages,required"` - Result CustomHostnameUpdateResponse `json:"result,required"` +// These are per-hostname (customer) settings. +type CustomHostnameNewParamsCustomMetadata struct { + // Unique metadata for this hostname. + Key param.Field[string] `json:"key"` +} + +func (r CustomHostnameNewParamsCustomMetadata) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomHostnameNewResponseEnvelope struct { + Errors []CustomHostnameNewResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomHostnameNewResponseEnvelopeMessages `json:"messages,required"` + Result CustomHostnameNewResponse `json:"result,required"` // Whether the API call was successful - Success CustomHostnameUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON customHostnameUpdateResponseEnvelopeJSON `json:"-"` + Success CustomHostnameNewResponseEnvelopeSuccess `json:"success,required"` + JSON customHostnameNewResponseEnvelopeJSON `json:"-"` } -// customHostnameUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [CustomHostnameUpdateResponseEnvelope] -type customHostnameUpdateResponseEnvelopeJSON struct { +// customHostnameNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [CustomHostnameNewResponseEnvelope] +type customHostnameNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1442,93 +1436,110 @@ type customHostnameUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameUpdateResponseEnvelopeErrorsJSON `json:"-"` +type CustomHostnameNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameNewResponseEnvelopeErrorsJSON `json:"-"` } -// customHostnameUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [CustomHostnameUpdateResponseEnvelopeErrors] -type customHostnameUpdateResponseEnvelopeErrorsJSON struct { +// customHostnameNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CustomHostnameNewResponseEnvelopeErrors] +type customHostnameNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameUpdateResponseEnvelopeMessagesJSON `json:"-"` +type CustomHostnameNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameNewResponseEnvelopeMessagesJSON `json:"-"` } -// customHostnameUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [CustomHostnameUpdateResponseEnvelopeMessages] -type customHostnameUpdateResponseEnvelopeMessagesJSON struct { +// customHostnameNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [CustomHostnameNewResponseEnvelopeMessages] +type customHostnameNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CustomHostnameUpdateResponseEnvelopeSuccess bool +type CustomHostnameNewResponseEnvelopeSuccess bool const ( - CustomHostnameUpdateResponseEnvelopeSuccessTrue CustomHostnameUpdateResponseEnvelopeSuccess = true + CustomHostnameNewResponseEnvelopeSuccessTrue CustomHostnameNewResponseEnvelopeSuccess = true ) -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParams struct { - // The custom hostname that will point to your hostname via CNAME. - Hostname param.Field[string] `json:"hostname,required"` - // SSL properties used when creating the custom hostname. - SSL param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSL] `json:"ssl,required"` +type CustomHostnameUpdateParams struct { // These are per-hostname (customer) settings. - CustomMetadata param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsCustomMetadata] `json:"custom_metadata"` + CustomMetadata param.Field[CustomHostnameUpdateParamsCustomMetadata] `json:"custom_metadata"` + // a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME + // record. + CustomOriginServer param.Field[string] `json:"custom_origin_server"` + // A hostname that will be sent to your custom origin server as SNI for TLS + // handshake. This can be a valid subdomain of the zone or custom origin server + // name or the string ':request_host_header:' which will cause the host header in + // the request to be used as SNI. Not configurable with default/fallback origin + // server. + CustomOriginSni param.Field[string] `json:"custom_origin_sni"` + // SSL properties used when creating the custom hostname. + SSL param.Field[CustomHostnameUpdateParamsSSL] `json:"ssl"` +} + +func (r CustomHostnameUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r CustomHostnameCustomHostnameForAZoneNewCustomHostnameParams) MarshalJSON() (data []byte, err error) { +// These are per-hostname (customer) settings. +type CustomHostnameUpdateParamsCustomMetadata struct { + // Unique metadata for this hostname. + Key param.Field[string] `json:"key"` +} + +func (r CustomHostnameUpdateParamsCustomMetadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // SSL properties used when creating the custom hostname. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSL struct { +type CustomHostnameUpdateParamsSSL struct { // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethod] `json:"bundle_method"` + BundleMethod param.Field[CustomHostnameUpdateParamsSSLBundleMethod] `json:"bundle_method"` // The Certificate Authority that will issue the certificate - CertificateAuthority param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthority] `json:"certificate_authority"` + CertificateAuthority param.Field[CustomHostnameUpdateParamsSSLCertificateAuthority] `json:"certificate_authority"` // If a custom uploaded certificate is used. CustomCertificate param.Field[string] `json:"custom_certificate"` // The key for a custom uploaded certificate. CustomKey param.Field[string] `json:"custom_key"` // Domain control validation (DCV) method used for this hostname. - Method param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethod] `json:"method"` + Method param.Field[CustomHostnameUpdateParamsSSLMethod] `json:"method"` // SSL specific settings. - Settings param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettings] `json:"settings"` + Settings param.Field[CustomHostnameUpdateParamsSSLSettings] `json:"settings"` // Level of validation to be used for this hostname. Domain validation (dv) must be // used. - Type param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLType] `json:"type"` + Type param.Field[CustomHostnameUpdateParamsSSLType] `json:"type"` // Indicates whether the certificate covers a wildcard. Wildcard param.Field[bool] `json:"wildcard"` } -func (r CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSL) MarshalJSON() (data []byte, err error) { +func (r CustomHostnameUpdateParamsSSL) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -1536,116 +1547,105 @@ func (r CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSL) MarshalJ // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethod string +type CustomHostnameUpdateParamsSSLBundleMethod string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethodUbiquitous CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethod = "ubiquitous" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethodOptimal CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethod = "optimal" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethodForce CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethod = "force" + CustomHostnameUpdateParamsSSLBundleMethodUbiquitous CustomHostnameUpdateParamsSSLBundleMethod = "ubiquitous" + CustomHostnameUpdateParamsSSLBundleMethodOptimal CustomHostnameUpdateParamsSSLBundleMethod = "optimal" + CustomHostnameUpdateParamsSSLBundleMethodForce CustomHostnameUpdateParamsSSLBundleMethod = "force" ) // The Certificate Authority that will issue the certificate -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthority string +type CustomHostnameUpdateParamsSSLCertificateAuthority string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthorityDigicert CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthority = "digicert" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthorityGoogle CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthority = "google" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthorityLetsEncrypt CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthority = "lets_encrypt" + CustomHostnameUpdateParamsSSLCertificateAuthorityDigicert CustomHostnameUpdateParamsSSLCertificateAuthority = "digicert" + CustomHostnameUpdateParamsSSLCertificateAuthorityGoogle CustomHostnameUpdateParamsSSLCertificateAuthority = "google" + CustomHostnameUpdateParamsSSLCertificateAuthorityLetsEncrypt CustomHostnameUpdateParamsSSLCertificateAuthority = "lets_encrypt" ) // Domain control validation (DCV) method used for this hostname. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethod string +type CustomHostnameUpdateParamsSSLMethod string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethodHTTP CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethod = "http" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethodTxt CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethod = "txt" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethodEmail CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethod = "email" + CustomHostnameUpdateParamsSSLMethodHTTP CustomHostnameUpdateParamsSSLMethod = "http" + CustomHostnameUpdateParamsSSLMethodTxt CustomHostnameUpdateParamsSSLMethod = "txt" + CustomHostnameUpdateParamsSSLMethodEmail CustomHostnameUpdateParamsSSLMethod = "email" ) // SSL specific settings. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettings struct { +type CustomHostnameUpdateParamsSSLSettings struct { // An allowlist of ciphers for TLS termination. These ciphers must be in the // BoringSSL format. Ciphers param.Field[[]string] `json:"ciphers"` // Whether or not Early Hints is enabled. - EarlyHints param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHints] `json:"early_hints"` + EarlyHints param.Field[CustomHostnameUpdateParamsSSLSettingsEarlyHints] `json:"early_hints"` // Whether or not HTTP2 is enabled. - HTTP2 param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2] `json:"http2"` + HTTP2 param.Field[CustomHostnameUpdateParamsSSLSettingsHTTP2] `json:"http2"` // The minimum TLS version supported. - MinTLSVersion param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion] `json:"min_tls_version"` + MinTLSVersion param.Field[CustomHostnameUpdateParamsSSLSettingsMinTLSVersion] `json:"min_tls_version"` // Whether or not TLS 1.3 is enabled. - TLS1_3 param.Field[CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3] `json:"tls_1_3"` + TLS1_3 param.Field[CustomHostnameUpdateParamsSSLSettingsTLS1_3] `json:"tls_1_3"` } -func (r CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettings) MarshalJSON() (data []byte, err error) { +func (r CustomHostnameUpdateParamsSSLSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Whether or not Early Hints is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHints string +type CustomHostnameUpdateParamsSSLSettingsEarlyHints string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHintsOn CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHints = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHintsOff CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHints = "off" + CustomHostnameUpdateParamsSSLSettingsEarlyHintsOn CustomHostnameUpdateParamsSSLSettingsEarlyHints = "on" + CustomHostnameUpdateParamsSSLSettingsEarlyHintsOff CustomHostnameUpdateParamsSSLSettingsEarlyHints = "off" ) // Whether or not HTTP2 is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2 string +type CustomHostnameUpdateParamsSSLSettingsHTTP2 string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2On CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2 = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2Off CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2 = "off" + CustomHostnameUpdateParamsSSLSettingsHTTP2On CustomHostnameUpdateParamsSSLSettingsHTTP2 = "on" + CustomHostnameUpdateParamsSSLSettingsHTTP2Off CustomHostnameUpdateParamsSSLSettingsHTTP2 = "off" ) // The minimum TLS version supported. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion string +type CustomHostnameUpdateParamsSSLSettingsMinTLSVersion string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion1_0 CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion = "1.0" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion1_1 CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion = "1.1" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion1_2 CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion = "1.2" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion1_3 CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion = "1.3" + CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_0 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.0" + CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_1 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.1" + CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_2 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.2" + CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_3 CustomHostnameUpdateParamsSSLSettingsMinTLSVersion = "1.3" ) // Whether or not TLS 1.3 is enabled. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3 string +type CustomHostnameUpdateParamsSSLSettingsTLS1_3 string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3On CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3 = "on" - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3Off CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3 = "off" + CustomHostnameUpdateParamsSSLSettingsTLS1_3On CustomHostnameUpdateParamsSSLSettingsTLS1_3 = "on" + CustomHostnameUpdateParamsSSLSettingsTLS1_3Off CustomHostnameUpdateParamsSSLSettingsTLS1_3 = "off" ) // Level of validation to be used for this hostname. Domain validation (dv) must be // used. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLType string +type CustomHostnameUpdateParamsSSLType string const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLTypeDv CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLType = "dv" + CustomHostnameUpdateParamsSSLTypeDv CustomHostnameUpdateParamsSSLType = "dv" ) -// These are per-hostname (customer) settings. -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsCustomMetadata struct { - // Unique metadata for this hostname. - Key param.Field[string] `json:"key"` -} - -func (r CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsCustomMetadata) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelope struct { - Errors []CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessages `json:"messages,required"` - Result CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponse `json:"result,required"` +type CustomHostnameUpdateResponseEnvelope struct { + Errors []CustomHostnameUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomHostnameUpdateResponseEnvelopeMessages `json:"messages,required"` + Result CustomHostnameUpdateResponse `json:"result,required"` // Whether the API call was successful - Success CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeSuccess `json:"success,required"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeJSON `json:"-"` + Success CustomHostnameUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON customHostnameUpdateResponseEnvelopeJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelope] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeJSON struct { +// customHostnameUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [CustomHostnameUpdateResponseEnvelope] +type customHostnameUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1654,81 +1654,78 @@ type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeJSON s ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrorsJSON `json:"-"` +type CustomHostnameUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrors] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrorsJSON struct { +// customHostnameUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CustomHostnameUpdateResponseEnvelopeErrors] +type customHostnameUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessagesJSON `json:"-"` +type CustomHostnameUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessages] -type customHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessagesJSON struct { +// customHostnameUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CustomHostnameUpdateResponseEnvelopeMessages] +type customHostnameUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *CustomHostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeSuccess bool +type CustomHostnameUpdateResponseEnvelopeSuccess bool const ( - CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeSuccessTrue CustomHostnameCustomHostnameForAZoneNewCustomHostnameResponseEnvelopeSuccess = true + CustomHostnameUpdateResponseEnvelopeSuccessTrue CustomHostnameUpdateResponseEnvelopeSuccess = true ) -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams struct { +type CustomHostnameListParams struct { // Hostname ID to match against. This ID was generated and returned during the // initial custom_hostname creation. This parameter cannot be used with the // 'hostname' parameter. ID param.Field[string] `query:"id"` // Direction to order hostnames. - Direction param.Field[CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirection] `query:"direction"` + Direction param.Field[CustomHostnameListParamsDirection] `query:"direction"` // Fully qualified domain name to match against. This parameter cannot be used with // the 'id' parameter. Hostname param.Field[string] `query:"hostname"` // Field to order hostnames by. - Order param.Field[CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrder] `query:"order"` + Order param.Field[CustomHostnameListParamsOrder] `query:"order"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of hostnames per page. PerPage param.Field[float64] `query:"per_page"` // Whether to filter hostnames based on if they have SSL enabled. - SSL param.Field[CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL] `query:"ssl"` + SSL param.Field[CustomHostnameListParamsSSL] `query:"ssl"` } -// URLQuery serializes -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams]'s query -// parameters as `url.Values`. -func (r CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams) URLQuery() (v url.Values) { +// URLQuery serializes [CustomHostnameListParams]'s query parameters as +// `url.Values`. +func (r CustomHostnameListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -1736,131 +1733,29 @@ func (r CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams) URLQuery( } // Direction to order hostnames. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirection string +type CustomHostnameListParamsDirection string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirectionAsc CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirection = "asc" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirectionDesc CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirection = "desc" + CustomHostnameListParamsDirectionAsc CustomHostnameListParamsDirection = "asc" + CustomHostnameListParamsDirectionDesc CustomHostnameListParamsDirection = "desc" ) // Field to order hostnames by. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrder string +type CustomHostnameListParamsOrder string const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrderSSL CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrder = "ssl" - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrderSSLStatus CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrder = "ssl_status" + CustomHostnameListParamsOrderSSL CustomHostnameListParamsOrder = "ssl" + CustomHostnameListParamsOrderSSLStatus CustomHostnameListParamsOrder = "ssl_status" ) // Whether to filter hostnames based on if they have SSL enabled. -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL float64 +type CustomHostnameListParamsSSL float64 const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL0 CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL = 0 - CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL1 CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL = 1 + CustomHostnameListParamsSSL0 CustomHostnameListParamsSSL = 0 + CustomHostnameListParamsSSL1 CustomHostnameListParamsSSL = 1 ) -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelope struct { - Errors []CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessages `json:"messages,required"` - Result []CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfo `json:"result_info"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeJSON `json:"-"` -} - -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelope] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrorsJSON `json:"-"` -} - -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrors] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessagesJSON `json:"-"` -} - -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessages] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeSuccess bool - -const ( - CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeSuccessTrue CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeSuccess = true -) - -type CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfo] -type customHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameCustomHostnameForAZoneListCustomHostnamesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type CustomHostnameGetResponseEnvelope struct { Errors []CustomHostnameGetResponseEnvelopeErrors `json:"errors,required"` Messages []CustomHostnameGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/customhostname_test.go b/customhostname_test.go index 230549801d7..086646f6f63 100644 --- a/customhostname_test.go +++ b/customhostname_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomHostnameUpdateWithOptionalParams(t *testing.T) { +func TestCustomHostnameNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,32 +29,30 @@ func TestCustomHostnameUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.Update( + _, err := client.CustomHostnames.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CustomHostnameUpdateParams{ - CustomMetadata: cloudflare.F(cloudflare.CustomHostnameUpdateParamsCustomMetadata{ - Key: cloudflare.F("value"), - }), - CustomOriginServer: cloudflare.F("origin2.example.com"), - CustomOriginSni: cloudflare.F("sni.example.com"), - SSL: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSL{ - BundleMethod: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLBundleMethodUbiquitous), - CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLCertificateAuthorityGoogle), + cloudflare.CustomHostnameNewParams{ + Hostname: cloudflare.F("app.example.com"), + SSL: cloudflare.F(cloudflare.CustomHostnameNewParamsSSL{ + BundleMethod: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLBundleMethodUbiquitous), + CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLCertificateAuthorityGoogle), CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"), CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"), - Method: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLMethodHTTP), - Settings: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettings{ + Method: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLMethodHTTP), + Settings: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettings{ Ciphers: cloudflare.F([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"}), - EarlyHints: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsEarlyHintsOn), - HTTP2: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsHTTP2On), - MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_2), - TLS1_3: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsTLS1_3On), + EarlyHints: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsEarlyHintsOn), + HTTP2: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsHTTP2On), + MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsMinTLSVersion1_2), + TLS1_3: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsTLS1_3On), }), - Type: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLTypeDv), + Type: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLTypeDv), Wildcard: cloudflare.F(false), }), + CustomMetadata: cloudflare.F(cloudflare.CustomHostnameNewParamsCustomMetadata{ + Key: cloudflare.F("value"), + }), }, ) if err != nil { @@ -66,7 +64,7 @@ func TestCustomHostnameUpdateWithOptionalParams(t *testing.T) { } } -func TestCustomHostnameDelete(t *testing.T) { +func TestCustomHostnameUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -82,10 +80,33 @@ func TestCustomHostnameDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.Delete( + _, err := client.CustomHostnames.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.CustomHostnameUpdateParams{ + CustomMetadata: cloudflare.F(cloudflare.CustomHostnameUpdateParamsCustomMetadata{ + Key: cloudflare.F("value"), + }), + CustomOriginServer: cloudflare.F("origin2.example.com"), + CustomOriginSni: cloudflare.F("sni.example.com"), + SSL: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSL{ + BundleMethod: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLBundleMethodUbiquitous), + CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLCertificateAuthorityGoogle), + CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"), + CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"), + Method: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLMethodHTTP), + Settings: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettings{ + Ciphers: cloudflare.F([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"}), + EarlyHints: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsEarlyHintsOn), + HTTP2: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsHTTP2On), + MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsMinTLSVersion1_2), + TLS1_3: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLSettingsTLS1_3On), + }), + Type: cloudflare.F(cloudflare.CustomHostnameUpdateParamsSSLTypeDv), + Wildcard: cloudflare.F(false), + }), + }, ) if err != nil { var apierr *cloudflare.Error @@ -96,7 +117,7 @@ func TestCustomHostnameDelete(t *testing.T) { } } -func TestCustomHostnameCustomHostnameForAZoneNewCustomHostnameWithOptionalParams(t *testing.T) { +func TestCustomHostnameListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -112,30 +133,17 @@ func TestCustomHostnameCustomHostnameForAZoneNewCustomHostnameWithOptionalParams option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.CustomHostnameForAZoneNewCustomHostname( + _, err := client.CustomHostnames.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParams{ - Hostname: cloudflare.F("app.example.com"), - SSL: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSL{ - BundleMethod: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLBundleMethodUbiquitous), - CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLCertificateAuthorityGoogle), - CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"), - CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"), - Method: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLMethodHTTP), - Settings: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettings{ - Ciphers: cloudflare.F([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"}), - EarlyHints: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsEarlyHintsOn), - HTTP2: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsHTTP2On), - MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsMinTLSVersion1_2), - TLS1_3: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLSettingsTLS1_3On), - }), - Type: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsSSLTypeDv), - Wildcard: cloudflare.F(false), - }), - CustomMetadata: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneNewCustomHostnameParamsCustomMetadata{ - Key: cloudflare.F("value"), - }), + cloudflare.CustomHostnameListParams{ + ID: cloudflare.F("0d89c70d-ad9f-4843-b99f-6cc0252067e9"), + Direction: cloudflare.F(cloudflare.CustomHostnameListParamsDirectionDesc), + Hostname: cloudflare.F("app.example.com"), + Order: cloudflare.F(cloudflare.CustomHostnameListParamsOrderSSL), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + SSL: cloudflare.F(cloudflare.CustomHostnameListParamsSSL0), }, ) if err != nil { @@ -147,7 +155,7 @@ func TestCustomHostnameCustomHostnameForAZoneNewCustomHostnameWithOptionalParams } } -func TestCustomHostnameCustomHostnameForAZoneListCustomHostnamesWithOptionalParams(t *testing.T) { +func TestCustomHostnameDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -163,18 +171,10 @@ func TestCustomHostnameCustomHostnameForAZoneListCustomHostnamesWithOptionalPara option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.CustomHostnameForAZoneListCustomHostnames( + _, err := client.CustomHostnames.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesParams{ - ID: cloudflare.F("0d89c70d-ad9f-4843-b99f-6cc0252067e9"), - Direction: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsDirectionDesc), - Hostname: cloudflare.F("app.example.com"), - Order: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsOrderSSL), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - SSL: cloudflare.F(cloudflare.CustomHostnameCustomHostnameForAZoneListCustomHostnamesParamsSSL0), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error diff --git a/customhostnamefallbackorigin.go b/customhostnamefallbackorigin.go index 94942eb74cb..f86780413b9 100644 --- a/customhostnamefallbackorigin.go +++ b/customhostnamefallbackorigin.go @@ -34,19 +34,6 @@ func NewCustomHostnameFallbackOriginService(opts ...option.RequestOption) (r *Cu return } -// Update Fallback Origin for Custom Hostnames -func (r *CustomHostnameFallbackOriginService) Update(ctx context.Context, zoneID string, body CustomHostnameFallbackOriginUpdateParams, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomHostnameFallbackOriginUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Delete Fallback Origin for Custom Hostnames func (r *CustomHostnameFallbackOriginService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -73,21 +60,17 @@ func (r *CustomHostnameFallbackOriginService) Get(ctx context.Context, zoneID st return } -// Union satisfied by [CustomHostnameFallbackOriginUpdateResponseUnknown] or -// [shared.UnionString]. -type CustomHostnameFallbackOriginUpdateResponse interface { - ImplementsCustomHostnameFallbackOriginUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CustomHostnameFallbackOriginUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Update Fallback Origin for Custom Hostnames +func (r *CustomHostnameFallbackOriginService) Replace(ctx context.Context, zoneID string, body CustomHostnameFallbackOriginReplaceParams, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomHostnameFallbackOriginReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } // Union satisfied by [CustomHostnameFallbackOriginDeleteResponseUnknown] or @@ -124,86 +107,23 @@ func init() { ) } -type CustomHostnameFallbackOriginUpdateParams struct { - // Your origin hostname that requests to your custom hostnames will be sent to. - Origin param.Field[string] `json:"origin,required"` -} - -func (r CustomHostnameFallbackOriginUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CustomHostnameFallbackOriginUpdateResponseEnvelope struct { - Errors []CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages `json:"messages,required"` - Result CustomHostnameFallbackOriginUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON customHostnameFallbackOriginUpdateResponseEnvelopeJSON `json:"-"` -} - -// customHostnameFallbackOriginUpdateResponseEnvelopeJSON contains the JSON -// metadata for the struct [CustomHostnameFallbackOriginUpdateResponseEnvelope] -type customHostnameFallbackOriginUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameFallbackOriginUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors] -type customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages] -type customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Union satisfied by [CustomHostnameFallbackOriginReplaceResponseUnknown] or +// [shared.UnionString]. +type CustomHostnameFallbackOriginReplaceResponse interface { + ImplementsCustomHostnameFallbackOriginReplaceResponse() } -func (r *CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CustomHostnameFallbackOriginReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// Whether the API call was successful -type CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess bool - -const ( - CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess = true -) - type CustomHostnameFallbackOriginDeleteResponseEnvelope struct { Errors []CustomHostnameFallbackOriginDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []CustomHostnameFallbackOriginDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -344,3 +264,83 @@ type CustomHostnameFallbackOriginGetResponseEnvelopeSuccess bool const ( CustomHostnameFallbackOriginGetResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginGetResponseEnvelopeSuccess = true ) + +type CustomHostnameFallbackOriginReplaceParams struct { + // Your origin hostname that requests to your custom hostnames will be sent to. + Origin param.Field[string] `json:"origin,required"` +} + +func (r CustomHostnameFallbackOriginReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomHostnameFallbackOriginReplaceResponseEnvelope struct { + Errors []CustomHostnameFallbackOriginReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomHostnameFallbackOriginReplaceResponseEnvelopeMessages `json:"messages,required"` + Result CustomHostnameFallbackOriginReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success CustomHostnameFallbackOriginReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON customHostnameFallbackOriginReplaceResponseEnvelopeJSON `json:"-"` +} + +// customHostnameFallbackOriginReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [CustomHostnameFallbackOriginReplaceResponseEnvelope] +type customHostnameFallbackOriginReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomHostnameFallbackOriginReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomHostnameFallbackOriginReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameFallbackOriginReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// customHostnameFallbackOriginReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [CustomHostnameFallbackOriginReplaceResponseEnvelopeErrors] +type customHostnameFallbackOriginReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomHostnameFallbackOriginReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomHostnameFallbackOriginReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customHostnameFallbackOriginReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// customHostnameFallbackOriginReplaceResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [CustomHostnameFallbackOriginReplaceResponseEnvelopeMessages] +type customHostnameFallbackOriginReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomHostnameFallbackOriginReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomHostnameFallbackOriginReplaceResponseEnvelopeSuccess bool + +const ( + CustomHostnameFallbackOriginReplaceResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginReplaceResponseEnvelopeSuccess = true +) diff --git a/customhostnamefallbackorigin_test.go b/customhostnamefallbackorigin_test.go index dce24fb6918..7540c60c8f9 100644 --- a/customhostnamefallbackorigin_test.go +++ b/customhostnamefallbackorigin_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomHostnameFallbackOriginUpdate(t *testing.T) { +func TestCustomHostnameFallbackOriginDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,7 @@ func TestCustomHostnameFallbackOriginUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.FallbackOrigins.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CustomHostnameFallbackOriginUpdateParams{ - Origin: cloudflare.F("fallback.example.com"), - }, - ) + _, err := client.CustomHostnames.FallbackOrigin.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -45,7 +39,7 @@ func TestCustomHostnameFallbackOriginUpdate(t *testing.T) { } } -func TestCustomHostnameFallbackOriginDelete(t *testing.T) { +func TestCustomHostnameFallbackOriginGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +55,7 @@ func TestCustomHostnameFallbackOriginDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.FallbackOrigins.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.CustomHostnames.FallbackOrigin.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -71,7 +65,7 @@ func TestCustomHostnameFallbackOriginDelete(t *testing.T) { } } -func TestCustomHostnameFallbackOriginGet(t *testing.T) { +func TestCustomHostnameFallbackOriginReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -87,7 +81,13 @@ func TestCustomHostnameFallbackOriginGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomHostnames.FallbackOrigins.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.CustomHostnames.FallbackOrigin.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.CustomHostnameFallbackOriginReplaceParams{ + Origin: cloudflare.F("fallback.example.com"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/customn.go b/customn.go deleted file mode 100644 index 9ce0da0d71b..00000000000 --- a/customn.go +++ /dev/null @@ -1,513 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -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" -) - -// CustomNService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewCustomNService] method instead. -type CustomNService struct { - Options []option.RequestOption - Availabilities *CustomNAvailabilityService - Verifies *CustomNVerifyService -} - -// NewCustomNService generates a new service that applies the given options to each -// request. These options are applied after the parent client's options (if there -// is one), and before any request-specific options. -func NewCustomNService(opts ...option.RequestOption) (r *CustomNService) { - r = &CustomNService{} - r.Options = opts - r.Availabilities = NewCustomNAvailabilityService(opts...) - r.Verifies = NewCustomNVerifyService(opts...) - return -} - -// Add Account Custom Nameserver -func (r *CustomNService) New(ctx context.Context, accountID string, body CustomNNewParams, opts ...option.RequestOption) (res *CustomNNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomNNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// List an account's custom nameservers. -func (r *CustomNService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]CustomNListResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomNListResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Delete Account Custom Nameserver -func (r *CustomNService) Delete(ctx context.Context, accountID string, customNsID string, opts ...option.RequestOption) (res *CustomNDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomNDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns/%s", accountID, customNsID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// A single account custom nameserver. -type CustomNNewResponse struct { - // A and AAAA records associated with the nameserver. - DNSRecords []CustomNNewResponseDNSRecord `json:"dns_records,required"` - // The FQDN of the name server. - NsName string `json:"ns_name,required" format:"hostname"` - // Verification status of the nameserver. - Status CustomNNewResponseStatus `json:"status,required"` - // Identifier - ZoneTag string `json:"zone_tag,required"` - // The number of the set that this name server belongs to. - NsSet float64 `json:"ns_set"` - JSON customNNewResponseJSON `json:"-"` -} - -// customNNewResponseJSON contains the JSON metadata for the struct -// [CustomNNewResponse] -type customNNewResponseJSON struct { - DNSRecords apijson.Field - NsName apijson.Field - Status apijson.Field - ZoneTag apijson.Field - NsSet apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNNewResponseDNSRecord struct { - // DNS record type. - Type CustomNNewResponseDNSRecordsType `json:"type"` - // DNS record contents (an IPv4 or IPv6 address). - Value string `json:"value"` - JSON customNNewResponseDNSRecordJSON `json:"-"` -} - -// customNNewResponseDNSRecordJSON contains the JSON metadata for the struct -// [CustomNNewResponseDNSRecord] -type customNNewResponseDNSRecordJSON struct { - Type apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNNewResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// DNS record type. -type CustomNNewResponseDNSRecordsType string - -const ( - CustomNNewResponseDNSRecordsTypeA CustomNNewResponseDNSRecordsType = "A" - CustomNNewResponseDNSRecordsTypeAaaa CustomNNewResponseDNSRecordsType = "AAAA" -) - -// Verification status of the nameserver. -type CustomNNewResponseStatus string - -const ( - CustomNNewResponseStatusMoved CustomNNewResponseStatus = "moved" - CustomNNewResponseStatusPending CustomNNewResponseStatus = "pending" - CustomNNewResponseStatusVerified CustomNNewResponseStatus = "verified" -) - -// A single account custom nameserver. -type CustomNListResponse struct { - // A and AAAA records associated with the nameserver. - DNSRecords []CustomNListResponseDNSRecord `json:"dns_records,required"` - // The FQDN of the name server. - NsName string `json:"ns_name,required" format:"hostname"` - // Verification status of the nameserver. - Status CustomNListResponseStatus `json:"status,required"` - // Identifier - ZoneTag string `json:"zone_tag,required"` - // The number of the set that this name server belongs to. - NsSet float64 `json:"ns_set"` - JSON customNListResponseJSON `json:"-"` -} - -// customNListResponseJSON contains the JSON metadata for the struct -// [CustomNListResponse] -type customNListResponseJSON struct { - DNSRecords apijson.Field - NsName apijson.Field - Status apijson.Field - ZoneTag apijson.Field - NsSet apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNListResponseDNSRecord struct { - // DNS record type. - Type CustomNListResponseDNSRecordsType `json:"type"` - // DNS record contents (an IPv4 or IPv6 address). - Value string `json:"value"` - JSON customNListResponseDNSRecordJSON `json:"-"` -} - -// customNListResponseDNSRecordJSON contains the JSON metadata for the struct -// [CustomNListResponseDNSRecord] -type customNListResponseDNSRecordJSON struct { - Type apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// DNS record type. -type CustomNListResponseDNSRecordsType string - -const ( - CustomNListResponseDNSRecordsTypeA CustomNListResponseDNSRecordsType = "A" - CustomNListResponseDNSRecordsTypeAaaa CustomNListResponseDNSRecordsType = "AAAA" -) - -// Verification status of the nameserver. -type CustomNListResponseStatus string - -const ( - CustomNListResponseStatusMoved CustomNListResponseStatus = "moved" - CustomNListResponseStatusPending CustomNListResponseStatus = "pending" - CustomNListResponseStatusVerified CustomNListResponseStatus = "verified" -) - -// Union satisfied by [CustomNDeleteResponseUnknown], [CustomNDeleteResponseArray] -// or [shared.UnionString]. -type CustomNDeleteResponse interface { - ImplementsCustomNDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*CustomNDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type CustomNDeleteResponseArray []interface{} - -func (r CustomNDeleteResponseArray) ImplementsCustomNDeleteResponse() {} - -type CustomNNewParams struct { - // The FQDN of the name server. - NsName param.Field[string] `json:"ns_name,required" format:"hostname"` - // The number of the set that this name server belongs to. - NsSet param.Field[float64] `json:"ns_set"` -} - -func (r CustomNNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type CustomNNewResponseEnvelope struct { - Errors []CustomNNewResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomNNewResponseEnvelopeMessages `json:"messages,required"` - // A single account custom nameserver. - Result CustomNNewResponse `json:"result,required"` - // Whether the API call was successful - Success CustomNNewResponseEnvelopeSuccess `json:"success,required"` - JSON customNNewResponseEnvelopeJSON `json:"-"` -} - -// customNNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [CustomNNewResponseEnvelope] -type customNNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNNewResponseEnvelopeErrorsJSON `json:"-"` -} - -// customNNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [CustomNNewResponseEnvelopeErrors] -type customNNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNNewResponseEnvelopeMessagesJSON `json:"-"` -} - -// customNNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [CustomNNewResponseEnvelopeMessages] -type customNNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomNNewResponseEnvelopeSuccess bool - -const ( - CustomNNewResponseEnvelopeSuccessTrue CustomNNewResponseEnvelopeSuccess = true -) - -type CustomNListResponseEnvelope struct { - Errors []CustomNListResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomNListResponseEnvelopeMessages `json:"messages,required"` - Result []CustomNListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CustomNListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomNListResponseEnvelopeResultInfo `json:"result_info"` - JSON customNListResponseEnvelopeJSON `json:"-"` -} - -// customNListResponseEnvelopeJSON contains the JSON metadata for the struct -// [CustomNListResponseEnvelope] -type customNListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNListResponseEnvelopeErrorsJSON `json:"-"` -} - -// customNListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [CustomNListResponseEnvelopeErrors] -type customNListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNListResponseEnvelopeMessagesJSON `json:"-"` -} - -// customNListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CustomNListResponseEnvelopeMessages] -type customNListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomNListResponseEnvelopeSuccess bool - -const ( - CustomNListResponseEnvelopeSuccessTrue CustomNListResponseEnvelopeSuccess = true -) - -type CustomNListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customNListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// customNListResponseEnvelopeResultInfoJSON contains the JSON metadata for the -// struct [CustomNListResponseEnvelopeResultInfo] -type customNListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNDeleteResponseEnvelope struct { - Errors []CustomNDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomNDeleteResponseEnvelopeMessages `json:"messages,required"` - Result CustomNDeleteResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CustomNDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomNDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON customNDeleteResponseEnvelopeJSON `json:"-"` -} - -// customNDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [CustomNDeleteResponseEnvelope] -type customNDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// customNDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CustomNDeleteResponseEnvelopeErrors] -type customNDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// customNDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [CustomNDeleteResponseEnvelopeMessages] -type customNDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomNDeleteResponseEnvelopeSuccess bool - -const ( - CustomNDeleteResponseEnvelopeSuccessTrue CustomNDeleteResponseEnvelopeSuccess = true -) - -type CustomNDeleteResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customNDeleteResponseEnvelopeResultInfoJSON `json:"-"` -} - -// customNDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for the -// struct [CustomNDeleteResponseEnvelopeResultInfo] -type customNDeleteResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/customnameserver.go b/customnameserver.go new file mode 100644 index 00000000000..f9c91858bf0 --- /dev/null +++ b/customnameserver.go @@ -0,0 +1,801 @@ +// File generated from our OpenAPI spec by Stainless. + +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" +) + +// CustomNameserverService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewCustomNameserverService] method +// instead. +type CustomNameserverService struct { + Options []option.RequestOption +} + +// NewCustomNameserverService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewCustomNameserverService(opts ...option.RequestOption) (r *CustomNameserverService) { + r = &CustomNameserverService{} + r.Options = opts + return +} + +// Add Account Custom Nameserver +func (r *CustomNameserverService) New(ctx context.Context, accountID string, body CustomNameserverNewParams, opts ...option.RequestOption) (res *CustomNameserverNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomNameserverNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/custom_ns", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List an account's custom nameservers. +func (r *CustomNameserverService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]CustomNameserverListResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomNameserverListResponseEnvelope + path := fmt.Sprintf("accounts/%s/custom_ns", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Delete Account Custom Nameserver +func (r *CustomNameserverService) Delete(ctx context.Context, accountID string, customNsID string, opts ...option.RequestOption) (res *CustomNameserverDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomNameserverDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/custom_ns/%s", accountID, customNsID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Get Eligible Zones for Account Custom Nameservers +func (r *CustomNameserverService) Availabilty(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]string, err error) { + opts = append(r.Options[:], opts...) + var env CustomNameserverAvailabiltyResponseEnvelope + path := fmt.Sprintf("accounts/%s/custom_ns/availability", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Verify Account Custom Nameserver Glue Records +func (r *CustomNameserverService) Verify(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]CustomNameserverVerifyResponse, err error) { + opts = append(r.Options[:], opts...) + var env CustomNameserverVerifyResponseEnvelope + path := fmt.Sprintf("accounts/%s/custom_ns/verify", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// A single account custom nameserver. +type CustomNameserverNewResponse struct { + // A and AAAA records associated with the nameserver. + DNSRecords []CustomNameserverNewResponseDNSRecord `json:"dns_records,required"` + // The FQDN of the name server. + NsName string `json:"ns_name,required" format:"hostname"` + // Verification status of the nameserver. + Status CustomNameserverNewResponseStatus `json:"status,required"` + // Identifier + ZoneTag string `json:"zone_tag,required"` + // The number of the set that this name server belongs to. + NsSet float64 `json:"ns_set"` + JSON customNameserverNewResponseJSON `json:"-"` +} + +// customNameserverNewResponseJSON contains the JSON metadata for the struct +// [CustomNameserverNewResponse] +type customNameserverNewResponseJSON struct { + DNSRecords apijson.Field + NsName apijson.Field + Status apijson.Field + ZoneTag apijson.Field + NsSet apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverNewResponseDNSRecord struct { + // DNS record type. + Type CustomNameserverNewResponseDNSRecordsType `json:"type"` + // DNS record contents (an IPv4 or IPv6 address). + Value string `json:"value"` + JSON customNameserverNewResponseDNSRecordJSON `json:"-"` +} + +// customNameserverNewResponseDNSRecordJSON contains the JSON metadata for the +// struct [CustomNameserverNewResponseDNSRecord] +type customNameserverNewResponseDNSRecordJSON struct { + Type apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverNewResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// DNS record type. +type CustomNameserverNewResponseDNSRecordsType string + +const ( + CustomNameserverNewResponseDNSRecordsTypeA CustomNameserverNewResponseDNSRecordsType = "A" + CustomNameserverNewResponseDNSRecordsTypeAaaa CustomNameserverNewResponseDNSRecordsType = "AAAA" +) + +// Verification status of the nameserver. +type CustomNameserverNewResponseStatus string + +const ( + CustomNameserverNewResponseStatusMoved CustomNameserverNewResponseStatus = "moved" + CustomNameserverNewResponseStatusPending CustomNameserverNewResponseStatus = "pending" + CustomNameserverNewResponseStatusVerified CustomNameserverNewResponseStatus = "verified" +) + +// A single account custom nameserver. +type CustomNameserverListResponse struct { + // A and AAAA records associated with the nameserver. + DNSRecords []CustomNameserverListResponseDNSRecord `json:"dns_records,required"` + // The FQDN of the name server. + NsName string `json:"ns_name,required" format:"hostname"` + // Verification status of the nameserver. + Status CustomNameserverListResponseStatus `json:"status,required"` + // Identifier + ZoneTag string `json:"zone_tag,required"` + // The number of the set that this name server belongs to. + NsSet float64 `json:"ns_set"` + JSON customNameserverListResponseJSON `json:"-"` +} + +// customNameserverListResponseJSON contains the JSON metadata for the struct +// [CustomNameserverListResponse] +type customNameserverListResponseJSON struct { + DNSRecords apijson.Field + NsName apijson.Field + Status apijson.Field + ZoneTag apijson.Field + NsSet apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverListResponseDNSRecord struct { + // DNS record type. + Type CustomNameserverListResponseDNSRecordsType `json:"type"` + // DNS record contents (an IPv4 or IPv6 address). + Value string `json:"value"` + JSON customNameserverListResponseDNSRecordJSON `json:"-"` +} + +// customNameserverListResponseDNSRecordJSON contains the JSON metadata for the +// struct [CustomNameserverListResponseDNSRecord] +type customNameserverListResponseDNSRecordJSON struct { + Type apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// DNS record type. +type CustomNameserverListResponseDNSRecordsType string + +const ( + CustomNameserverListResponseDNSRecordsTypeA CustomNameserverListResponseDNSRecordsType = "A" + CustomNameserverListResponseDNSRecordsTypeAaaa CustomNameserverListResponseDNSRecordsType = "AAAA" +) + +// Verification status of the nameserver. +type CustomNameserverListResponseStatus string + +const ( + CustomNameserverListResponseStatusMoved CustomNameserverListResponseStatus = "moved" + CustomNameserverListResponseStatusPending CustomNameserverListResponseStatus = "pending" + CustomNameserverListResponseStatusVerified CustomNameserverListResponseStatus = "verified" +) + +// Union satisfied by [CustomNameserverDeleteResponseUnknown], +// [CustomNameserverDeleteResponseArray] or [shared.UnionString]. +type CustomNameserverDeleteResponse interface { + ImplementsCustomNameserverDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*CustomNameserverDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type CustomNameserverDeleteResponseArray []interface{} + +func (r CustomNameserverDeleteResponseArray) ImplementsCustomNameserverDeleteResponse() {} + +// A single account custom nameserver. +type CustomNameserverVerifyResponse struct { + // A and AAAA records associated with the nameserver. + DNSRecords []CustomNameserverVerifyResponseDNSRecord `json:"dns_records,required"` + // The FQDN of the name server. + NsName string `json:"ns_name,required" format:"hostname"` + // Verification status of the nameserver. + Status CustomNameserverVerifyResponseStatus `json:"status,required"` + // Identifier + ZoneTag string `json:"zone_tag,required"` + // The number of the set that this name server belongs to. + NsSet float64 `json:"ns_set"` + JSON customNameserverVerifyResponseJSON `json:"-"` +} + +// customNameserverVerifyResponseJSON contains the JSON metadata for the struct +// [CustomNameserverVerifyResponse] +type customNameserverVerifyResponseJSON struct { + DNSRecords apijson.Field + NsName apijson.Field + Status apijson.Field + ZoneTag apijson.Field + NsSet apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverVerifyResponseDNSRecord struct { + // DNS record type. + Type CustomNameserverVerifyResponseDNSRecordsType `json:"type"` + // DNS record contents (an IPv4 or IPv6 address). + Value string `json:"value"` + JSON customNameserverVerifyResponseDNSRecordJSON `json:"-"` +} + +// customNameserverVerifyResponseDNSRecordJSON contains the JSON metadata for the +// struct [CustomNameserverVerifyResponseDNSRecord] +type customNameserverVerifyResponseDNSRecordJSON struct { + Type apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// DNS record type. +type CustomNameserverVerifyResponseDNSRecordsType string + +const ( + CustomNameserverVerifyResponseDNSRecordsTypeA CustomNameserverVerifyResponseDNSRecordsType = "A" + CustomNameserverVerifyResponseDNSRecordsTypeAaaa CustomNameserverVerifyResponseDNSRecordsType = "AAAA" +) + +// Verification status of the nameserver. +type CustomNameserverVerifyResponseStatus string + +const ( + CustomNameserverVerifyResponseStatusMoved CustomNameserverVerifyResponseStatus = "moved" + CustomNameserverVerifyResponseStatusPending CustomNameserverVerifyResponseStatus = "pending" + CustomNameserverVerifyResponseStatusVerified CustomNameserverVerifyResponseStatus = "verified" +) + +type CustomNameserverNewParams struct { + // The FQDN of the name server. + NsName param.Field[string] `json:"ns_name,required" format:"hostname"` + // The number of the set that this name server belongs to. + NsSet param.Field[float64] `json:"ns_set"` +} + +func (r CustomNameserverNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomNameserverNewResponseEnvelope struct { + Errors []CustomNameserverNewResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomNameserverNewResponseEnvelopeMessages `json:"messages,required"` + // A single account custom nameserver. + Result CustomNameserverNewResponse `json:"result,required"` + // Whether the API call was successful + Success CustomNameserverNewResponseEnvelopeSuccess `json:"success,required"` + JSON customNameserverNewResponseEnvelopeJSON `json:"-"` +} + +// customNameserverNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [CustomNameserverNewResponseEnvelope] +type customNameserverNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// customNameserverNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [CustomNameserverNewResponseEnvelopeErrors] +type customNameserverNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// customNameserverNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CustomNameserverNewResponseEnvelopeMessages] +type customNameserverNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomNameserverNewResponseEnvelopeSuccess bool + +const ( + CustomNameserverNewResponseEnvelopeSuccessTrue CustomNameserverNewResponseEnvelopeSuccess = true +) + +type CustomNameserverListResponseEnvelope struct { + Errors []CustomNameserverListResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomNameserverListResponseEnvelopeMessages `json:"messages,required"` + Result []CustomNameserverListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success CustomNameserverListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CustomNameserverListResponseEnvelopeResultInfo `json:"result_info"` + JSON customNameserverListResponseEnvelopeJSON `json:"-"` +} + +// customNameserverListResponseEnvelopeJSON contains the JSON metadata for the +// struct [CustomNameserverListResponseEnvelope] +type customNameserverListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverListResponseEnvelopeErrorsJSON `json:"-"` +} + +// customNameserverListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CustomNameserverListResponseEnvelopeErrors] +type customNameserverListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverListResponseEnvelopeMessagesJSON `json:"-"` +} + +// customNameserverListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [CustomNameserverListResponseEnvelopeMessages] +type customNameserverListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomNameserverListResponseEnvelopeSuccess bool + +const ( + CustomNameserverListResponseEnvelopeSuccessTrue CustomNameserverListResponseEnvelopeSuccess = true +) + +type CustomNameserverListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON customNameserverListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// customNameserverListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [CustomNameserverListResponseEnvelopeResultInfo] +type customNameserverListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverDeleteResponseEnvelope struct { + Errors []CustomNameserverDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomNameserverDeleteResponseEnvelopeMessages `json:"messages,required"` + Result CustomNameserverDeleteResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success CustomNameserverDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CustomNameserverDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON customNameserverDeleteResponseEnvelopeJSON `json:"-"` +} + +// customNameserverDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [CustomNameserverDeleteResponseEnvelope] +type customNameserverDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// customNameserverDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CustomNameserverDeleteResponseEnvelopeErrors] +type customNameserverDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// customNameserverDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [CustomNameserverDeleteResponseEnvelopeMessages] +type customNameserverDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomNameserverDeleteResponseEnvelopeSuccess bool + +const ( + CustomNameserverDeleteResponseEnvelopeSuccessTrue CustomNameserverDeleteResponseEnvelopeSuccess = true +) + +type CustomNameserverDeleteResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON customNameserverDeleteResponseEnvelopeResultInfoJSON `json:"-"` +} + +// customNameserverDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [CustomNameserverDeleteResponseEnvelopeResultInfo] +type customNameserverDeleteResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverAvailabiltyResponseEnvelope struct { + Errors []CustomNameserverAvailabiltyResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomNameserverAvailabiltyResponseEnvelopeMessages `json:"messages,required"` + Result []string `json:"result,required,nullable" format:"hostname"` + // Whether the API call was successful + Success CustomNameserverAvailabiltyResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CustomNameserverAvailabiltyResponseEnvelopeResultInfo `json:"result_info"` + JSON customNameserverAvailabiltyResponseEnvelopeJSON `json:"-"` +} + +// customNameserverAvailabiltyResponseEnvelopeJSON contains the JSON metadata for +// the struct [CustomNameserverAvailabiltyResponseEnvelope] +type customNameserverAvailabiltyResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverAvailabiltyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverAvailabiltyResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverAvailabiltyResponseEnvelopeErrorsJSON `json:"-"` +} + +// customNameserverAvailabiltyResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [CustomNameserverAvailabiltyResponseEnvelopeErrors] +type customNameserverAvailabiltyResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverAvailabiltyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverAvailabiltyResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverAvailabiltyResponseEnvelopeMessagesJSON `json:"-"` +} + +// customNameserverAvailabiltyResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeMessages] +type customNameserverAvailabiltyResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverAvailabiltyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomNameserverAvailabiltyResponseEnvelopeSuccess bool + +const ( + CustomNameserverAvailabiltyResponseEnvelopeSuccessTrue CustomNameserverAvailabiltyResponseEnvelopeSuccess = true +) + +type CustomNameserverAvailabiltyResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON customNameserverAvailabiltyResponseEnvelopeResultInfoJSON `json:"-"` +} + +// customNameserverAvailabiltyResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeResultInfo] +type customNameserverAvailabiltyResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverAvailabiltyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverVerifyResponseEnvelope struct { + Errors []CustomNameserverVerifyResponseEnvelopeErrors `json:"errors,required"` + Messages []CustomNameserverVerifyResponseEnvelopeMessages `json:"messages,required"` + Result []CustomNameserverVerifyResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success CustomNameserverVerifyResponseEnvelopeSuccess `json:"success,required"` + ResultInfo CustomNameserverVerifyResponseEnvelopeResultInfo `json:"result_info"` + JSON customNameserverVerifyResponseEnvelopeJSON `json:"-"` +} + +// customNameserverVerifyResponseEnvelopeJSON contains the JSON metadata for the +// struct [CustomNameserverVerifyResponseEnvelope] +type customNameserverVerifyResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverVerifyResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverVerifyResponseEnvelopeErrorsJSON `json:"-"` +} + +// customNameserverVerifyResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [CustomNameserverVerifyResponseEnvelopeErrors] +type customNameserverVerifyResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type CustomNameserverVerifyResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON customNameserverVerifyResponseEnvelopeMessagesJSON `json:"-"` +} + +// customNameserverVerifyResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [CustomNameserverVerifyResponseEnvelopeMessages] +type customNameserverVerifyResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type CustomNameserverVerifyResponseEnvelopeSuccess bool + +const ( + CustomNameserverVerifyResponseEnvelopeSuccessTrue CustomNameserverVerifyResponseEnvelopeSuccess = true +) + +type CustomNameserverVerifyResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON customNameserverVerifyResponseEnvelopeResultInfoJSON `json:"-"` +} + +// customNameserverVerifyResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [CustomNameserverVerifyResponseEnvelopeResultInfo] +type customNameserverVerifyResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomNameserverVerifyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/customnameserver_test.go b/customnameserver_test.go new file mode 100644 index 00000000000..942823c6fdc --- /dev/null +++ b/customnameserver_test.go @@ -0,0 +1,155 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare_test + +import ( + "context" + "errors" + "os" + "testing" + + "github.com/cloudflare/cloudflare-sdk-go" + "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +func TestCustomNameserverNewWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.CustomNameservers.New( + context.TODO(), + "372e67954025e0ba6aaa6d586b9e0b59", + cloudflare.CustomNameserverNewParams{ + NsName: cloudflare.F("ns1.example.com"), + NsSet: cloudflare.F(1.000000), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestCustomNameserverList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.CustomNameservers.List(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestCustomNameserverDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.CustomNameservers.Delete( + context.TODO(), + "372e67954025e0ba6aaa6d586b9e0b59", + "ns1.example.com", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestCustomNameserverAvailabilty(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.CustomNameservers.Availabilty(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestCustomNameserverVerify(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.CustomNameservers.Verify(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/customnavailability.go b/customnavailability.go deleted file mode 100644 index a5ab6f8cf31..00000000000 --- a/customnavailability.go +++ /dev/null @@ -1,142 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// CustomNAvailabilityService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCustomNAvailabilityService] -// method instead. -type CustomNAvailabilityService struct { - Options []option.RequestOption -} - -// NewCustomNAvailabilityService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCustomNAvailabilityService(opts ...option.RequestOption) (r *CustomNAvailabilityService) { - r = &CustomNAvailabilityService{} - r.Options = opts - return -} - -// Get Eligible Zones for Account Custom Nameservers -func (r *CustomNAvailabilityService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]string, err error) { - opts = append(r.Options[:], opts...) - var env CustomNAvailabilityGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns/availability", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type CustomNAvailabilityGetResponseEnvelope struct { - Errors []CustomNAvailabilityGetResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomNAvailabilityGetResponseEnvelopeMessages `json:"messages,required"` - Result []string `json:"result,required,nullable" format:"hostname"` - // Whether the API call was successful - Success CustomNAvailabilityGetResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomNAvailabilityGetResponseEnvelopeResultInfo `json:"result_info"` - JSON customNAvailabilityGetResponseEnvelopeJSON `json:"-"` -} - -// customNAvailabilityGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [CustomNAvailabilityGetResponseEnvelope] -type customNAvailabilityGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNAvailabilityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNAvailabilityGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNAvailabilityGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// customNAvailabilityGetResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [CustomNAvailabilityGetResponseEnvelopeErrors] -type customNAvailabilityGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNAvailabilityGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNAvailabilityGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNAvailabilityGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// customNAvailabilityGetResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [CustomNAvailabilityGetResponseEnvelopeMessages] -type customNAvailabilityGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNAvailabilityGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomNAvailabilityGetResponseEnvelopeSuccess bool - -const ( - CustomNAvailabilityGetResponseEnvelopeSuccessTrue CustomNAvailabilityGetResponseEnvelopeSuccess = true -) - -type CustomNAvailabilityGetResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customNAvailabilityGetResponseEnvelopeResultInfoJSON `json:"-"` -} - -// customNAvailabilityGetResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [CustomNAvailabilityGetResponseEnvelopeResultInfo] -type customNAvailabilityGetResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNAvailabilityGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/customnverify.go b/customnverify.go deleted file mode 100644 index f9c742e95fa..00000000000 --- a/customnverify.go +++ /dev/null @@ -1,211 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// CustomNVerifyService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCustomNVerifyService] method -// instead. -type CustomNVerifyService struct { - Options []option.RequestOption -} - -// NewCustomNVerifyService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewCustomNVerifyService(opts ...option.RequestOption) (r *CustomNVerifyService) { - r = &CustomNVerifyService{} - r.Options = opts - return -} - -// Verify Account Custom Nameserver Glue Records -func (r *CustomNVerifyService) Update(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]CustomNVerifyUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env CustomNVerifyUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns/verify", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// A single account custom nameserver. -type CustomNVerifyUpdateResponse struct { - // A and AAAA records associated with the nameserver. - DNSRecords []CustomNVerifyUpdateResponseDNSRecord `json:"dns_records,required"` - // The FQDN of the name server. - NsName string `json:"ns_name,required" format:"hostname"` - // Verification status of the nameserver. - Status CustomNVerifyUpdateResponseStatus `json:"status,required"` - // Identifier - ZoneTag string `json:"zone_tag,required"` - // The number of the set that this name server belongs to. - NsSet float64 `json:"ns_set"` - JSON customNVerifyUpdateResponseJSON `json:"-"` -} - -// customNVerifyUpdateResponseJSON contains the JSON metadata for the struct -// [CustomNVerifyUpdateResponse] -type customNVerifyUpdateResponseJSON struct { - DNSRecords apijson.Field - NsName apijson.Field - Status apijson.Field - ZoneTag apijson.Field - NsSet apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNVerifyUpdateResponseDNSRecord struct { - // DNS record type. - Type CustomNVerifyUpdateResponseDNSRecordsType `json:"type"` - // DNS record contents (an IPv4 or IPv6 address). - Value string `json:"value"` - JSON customNVerifyUpdateResponseDNSRecordJSON `json:"-"` -} - -// customNVerifyUpdateResponseDNSRecordJSON contains the JSON metadata for the -// struct [CustomNVerifyUpdateResponseDNSRecord] -type customNVerifyUpdateResponseDNSRecordJSON struct { - Type apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponseDNSRecord) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// DNS record type. -type CustomNVerifyUpdateResponseDNSRecordsType string - -const ( - CustomNVerifyUpdateResponseDNSRecordsTypeA CustomNVerifyUpdateResponseDNSRecordsType = "A" - CustomNVerifyUpdateResponseDNSRecordsTypeAaaa CustomNVerifyUpdateResponseDNSRecordsType = "AAAA" -) - -// Verification status of the nameserver. -type CustomNVerifyUpdateResponseStatus string - -const ( - CustomNVerifyUpdateResponseStatusMoved CustomNVerifyUpdateResponseStatus = "moved" - CustomNVerifyUpdateResponseStatusPending CustomNVerifyUpdateResponseStatus = "pending" - CustomNVerifyUpdateResponseStatusVerified CustomNVerifyUpdateResponseStatus = "verified" -) - -type CustomNVerifyUpdateResponseEnvelope struct { - Errors []CustomNVerifyUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []CustomNVerifyUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []CustomNVerifyUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success CustomNVerifyUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo CustomNVerifyUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON customNVerifyUpdateResponseEnvelopeJSON `json:"-"` -} - -// customNVerifyUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [CustomNVerifyUpdateResponseEnvelope] -type customNVerifyUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNVerifyUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNVerifyUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// customNVerifyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [CustomNVerifyUpdateResponseEnvelopeErrors] -type customNVerifyUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type CustomNVerifyUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON customNVerifyUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// customNVerifyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [CustomNVerifyUpdateResponseEnvelopeMessages] -type customNVerifyUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type CustomNVerifyUpdateResponseEnvelopeSuccess bool - -const ( - CustomNVerifyUpdateResponseEnvelopeSuccessTrue CustomNVerifyUpdateResponseEnvelopeSuccess = true -) - -type CustomNVerifyUpdateResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON customNVerifyUpdateResponseEnvelopeResultInfoJSON `json:"-"` -} - -// customNVerifyUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [CustomNVerifyUpdateResponseEnvelopeResultInfo] -type customNVerifyUpdateResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *CustomNVerifyUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/devicedextest.go b/devicedextest.go index 45af4980ed8..d5e81a6dd90 100644 --- a/devicedextest.go +++ b/devicedextest.go @@ -31,12 +31,12 @@ func NewDeviceDEXTestService(opts ...option.RequestOption) (r *DeviceDEXTestServ return } -// Update a DEX test. -func (r *DeviceDEXTestService) Update(ctx context.Context, identifier interface{}, uuid string, body DeviceDEXTestUpdateParams, opts ...option.RequestOption) (res *DeviceDEXTestUpdateResponse, err error) { +// Create a DEX test. +func (r *DeviceDEXTestService) New(ctx context.Context, identifier interface{}, body DeviceDEXTestNewParams, opts ...option.RequestOption) (res *DeviceDEXTestNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceDEXTestUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/dex_tests/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env DeviceDEXTestNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/dex_tests", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,13 +44,12 @@ func (r *DeviceDEXTestService) Update(ctx context.Context, identifier interface{ return } -// Delete a Device DEX test. Returns the remaining device dex tests for the -// account. -func (r *DeviceDEXTestService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DeviceDEXTestDeleteResponse, err error) { +// Fetch all DEX tests. +func (r *DeviceDEXTestService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DeviceDEXTestListResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceDEXTestDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/dex_tests/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env DeviceDEXTestListResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/dex_tests", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,12 +57,13 @@ func (r *DeviceDEXTestService) Delete(ctx context.Context, identifier interface{ return } -// Create a DEX test. -func (r *DeviceDEXTestService) DeviceDEXTestNewDeviceDEXTest(ctx context.Context, identifier interface{}, body DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParams, opts ...option.RequestOption) (res *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse, err error) { +// Delete a Device DEX test. Returns the remaining device dex tests for the +// account. +func (r *DeviceDEXTestService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DeviceDEXTestDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/dex_tests", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env DeviceDEXTestDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/dex_tests/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -71,11 +71,11 @@ func (r *DeviceDEXTestService) DeviceDEXTestNewDeviceDEXTest(ctx context.Context return } -// Fetch all DEX tests. -func (r *DeviceDEXTestService) DeviceDEXTestDetails(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DeviceDEXTestDeviceDEXTestDetailsResponse, err error) { +// Fetch a single DEX test. +func (r *DeviceDEXTestService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceDEXTestGetResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceDEXTestDeviceDEXTestDetailsResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/dex_tests", identifier) + var env DeviceDEXTestGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/dex_tests/%s", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -84,12 +84,12 @@ func (r *DeviceDEXTestService) DeviceDEXTestDetails(ctx context.Context, identif return } -// Fetch a single DEX test. -func (r *DeviceDEXTestService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceDEXTestGetResponse, err error) { +// Update a DEX test. +func (r *DeviceDEXTestService) Replace(ctx context.Context, identifier interface{}, uuid string, body DeviceDEXTestReplaceParams, opts ...option.RequestOption) (res *DeviceDEXTestReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceDEXTestGetResponseEnvelope + var env DeviceDEXTestReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/dex_tests/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -97,10 +97,10 @@ func (r *DeviceDEXTestService) Get(ctx context.Context, identifier interface{}, return } -type DeviceDEXTestUpdateResponse struct { +type DeviceDEXTestNewResponse struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data DeviceDEXTestUpdateResponseData `json:"data,required"` + Data DeviceDEXTestNewResponseData `json:"data,required"` // Determines whether or not the test is active. Enabled bool `json:"enabled,required"` // How often the test will run. @@ -108,13 +108,13 @@ type DeviceDEXTestUpdateResponse struct { // The name of the DEX test. Must be unique. Name string `json:"name,required"` // Additional details about the test. - Description string `json:"description"` - JSON deviceDEXTestUpdateResponseJSON `json:"-"` + Description string `json:"description"` + JSON deviceDEXTestNewResponseJSON `json:"-"` } -// deviceDEXTestUpdateResponseJSON contains the JSON metadata for the struct -// [DeviceDEXTestUpdateResponse] -type deviceDEXTestUpdateResponseJSON struct { +// deviceDEXTestNewResponseJSON contains the JSON metadata for the struct +// [DeviceDEXTestNewResponse] +type deviceDEXTestNewResponseJSON struct { Data apijson.Field Enabled apijson.Field Interval apijson.Field @@ -124,25 +124,25 @@ type deviceDEXTestUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestUpdateResponseData struct { +type DeviceDEXTestNewResponseData struct { // The desired endpoint to test. Host string `json:"host"` // The type of test. Kind string `json:"kind"` // The HTTP request method type. - Method string `json:"method"` - JSON deviceDEXTestUpdateResponseDataJSON `json:"-"` + Method string `json:"method"` + JSON deviceDEXTestNewResponseDataJSON `json:"-"` } -// deviceDEXTestUpdateResponseDataJSON contains the JSON metadata for the struct -// [DeviceDEXTestUpdateResponseData] -type deviceDEXTestUpdateResponseDataJSON struct { +// deviceDEXTestNewResponseDataJSON contains the JSON metadata for the struct +// [DeviceDEXTestNewResponseData] +type deviceDEXTestNewResponseDataJSON struct { Host apijson.Field Kind apijson.Field Method apijson.Field @@ -150,14 +150,14 @@ type deviceDEXTestUpdateResponseDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestUpdateResponseData) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestNewResponseData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeleteResponse struct { +type DeviceDEXTestListResponse struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data DeviceDEXTestDeleteResponseData `json:"data,required"` + Data DeviceDEXTestListResponseData `json:"data,required"` // Determines whether or not the test is active. Enabled bool `json:"enabled,required"` // How often the test will run. @@ -165,13 +165,13 @@ type DeviceDEXTestDeleteResponse struct { // The name of the DEX test. Must be unique. Name string `json:"name,required"` // Additional details about the test. - Description string `json:"description"` - JSON deviceDEXTestDeleteResponseJSON `json:"-"` + Description string `json:"description"` + JSON deviceDEXTestListResponseJSON `json:"-"` } -// deviceDEXTestDeleteResponseJSON contains the JSON metadata for the struct -// [DeviceDEXTestDeleteResponse] -type deviceDEXTestDeleteResponseJSON struct { +// deviceDEXTestListResponseJSON contains the JSON metadata for the struct +// [DeviceDEXTestListResponse] +type deviceDEXTestListResponseJSON struct { Data apijson.Field Enabled apijson.Field Interval apijson.Field @@ -181,25 +181,25 @@ type deviceDEXTestDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestDeleteResponseData struct { +type DeviceDEXTestListResponseData struct { // The desired endpoint to test. Host string `json:"host"` // The type of test. Kind string `json:"kind"` // The HTTP request method type. - Method string `json:"method"` - JSON deviceDEXTestDeleteResponseDataJSON `json:"-"` + Method string `json:"method"` + JSON deviceDEXTestListResponseDataJSON `json:"-"` } -// deviceDEXTestDeleteResponseDataJSON contains the JSON metadata for the struct -// [DeviceDEXTestDeleteResponseData] -type deviceDEXTestDeleteResponseDataJSON struct { +// deviceDEXTestListResponseDataJSON contains the JSON metadata for the struct +// [DeviceDEXTestListResponseData] +type deviceDEXTestListResponseDataJSON struct { Host apijson.Field Kind apijson.Field Method apijson.Field @@ -207,14 +207,14 @@ type deviceDEXTestDeleteResponseDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeleteResponseData) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestListResponseData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse struct { +type DeviceDEXTestDeleteResponse struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseData `json:"data,required"` + Data DeviceDEXTestDeleteResponseData `json:"data,required"` // Determines whether or not the test is active. Enabled bool `json:"enabled,required"` // How often the test will run. @@ -222,13 +222,13 @@ type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse struct { // The name of the DEX test. Must be unique. Name string `json:"name,required"` // Additional details about the test. - Description string `json:"description"` - JSON deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseJSON `json:"-"` + Description string `json:"description"` + JSON deviceDEXTestDeleteResponseJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseJSON contains the JSON -// metadata for the struct [DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse] -type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseJSON struct { +// deviceDEXTestDeleteResponseJSON contains the JSON metadata for the struct +// [DeviceDEXTestDeleteResponse] +type deviceDEXTestDeleteResponseJSON struct { Data apijson.Field Enabled apijson.Field Interval apijson.Field @@ -238,25 +238,25 @@ type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseData struct { +type DeviceDEXTestDeleteResponseData struct { // The desired endpoint to test. Host string `json:"host"` // The type of test. Kind string `json:"kind"` // The HTTP request method type. - Method string `json:"method"` - JSON deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseDataJSON `json:"-"` + Method string `json:"method"` + JSON deviceDEXTestDeleteResponseDataJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseDataJSON contains the JSON -// metadata for the struct [DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseData] -type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseDataJSON struct { +// deviceDEXTestDeleteResponseDataJSON contains the JSON metadata for the struct +// [DeviceDEXTestDeleteResponseData] +type deviceDEXTestDeleteResponseDataJSON struct { Host apijson.Field Kind apijson.Field Method apijson.Field @@ -264,14 +264,14 @@ type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseData) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestDeleteResponseData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestDetailsResponse struct { +type DeviceDEXTestGetResponse struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data DeviceDEXTestDeviceDEXTestDetailsResponseData `json:"data,required"` + Data DeviceDEXTestGetResponseData `json:"data,required"` // Determines whether or not the test is active. Enabled bool `json:"enabled,required"` // How often the test will run. @@ -279,13 +279,13 @@ type DeviceDEXTestDeviceDEXTestDetailsResponse struct { // The name of the DEX test. Must be unique. Name string `json:"name,required"` // Additional details about the test. - Description string `json:"description"` - JSON deviceDEXTestDeviceDEXTestDetailsResponseJSON `json:"-"` + Description string `json:"description"` + JSON deviceDEXTestGetResponseJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestDetailsResponseJSON contains the JSON metadata for the -// struct [DeviceDEXTestDeviceDEXTestDetailsResponse] -type deviceDEXTestDeviceDEXTestDetailsResponseJSON struct { +// deviceDEXTestGetResponseJSON contains the JSON metadata for the struct +// [DeviceDEXTestGetResponse] +type deviceDEXTestGetResponseJSON struct { Data apijson.Field Enabled apijson.Field Interval apijson.Field @@ -295,25 +295,25 @@ type deviceDEXTestDeviceDEXTestDetailsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestDeviceDEXTestDetailsResponseData struct { +type DeviceDEXTestGetResponseData struct { // The desired endpoint to test. Host string `json:"host"` // The type of test. Kind string `json:"kind"` // The HTTP request method type. - Method string `json:"method"` - JSON deviceDEXTestDeviceDEXTestDetailsResponseDataJSON `json:"-"` + Method string `json:"method"` + JSON deviceDEXTestGetResponseDataJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestDetailsResponseDataJSON contains the JSON metadata for -// the struct [DeviceDEXTestDeviceDEXTestDetailsResponseData] -type deviceDEXTestDeviceDEXTestDetailsResponseDataJSON struct { +// deviceDEXTestGetResponseDataJSON contains the JSON metadata for the struct +// [DeviceDEXTestGetResponseData] +type deviceDEXTestGetResponseDataJSON struct { Host apijson.Field Kind apijson.Field Method apijson.Field @@ -321,14 +321,14 @@ type deviceDEXTestDeviceDEXTestDetailsResponseDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestDetailsResponseData) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestGetResponseData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestGetResponse struct { +type DeviceDEXTestReplaceResponse struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data DeviceDEXTestGetResponseData `json:"data,required"` + Data DeviceDEXTestReplaceResponseData `json:"data,required"` // Determines whether or not the test is active. Enabled bool `json:"enabled,required"` // How often the test will run. @@ -336,13 +336,13 @@ type DeviceDEXTestGetResponse struct { // The name of the DEX test. Must be unique. Name string `json:"name,required"` // Additional details about the test. - Description string `json:"description"` - JSON deviceDEXTestGetResponseJSON `json:"-"` + Description string `json:"description"` + JSON deviceDEXTestReplaceResponseJSON `json:"-"` } -// deviceDEXTestGetResponseJSON contains the JSON metadata for the struct -// [DeviceDEXTestGetResponse] -type deviceDEXTestGetResponseJSON struct { +// deviceDEXTestReplaceResponseJSON contains the JSON metadata for the struct +// [DeviceDEXTestReplaceResponse] +type deviceDEXTestReplaceResponseJSON struct { Data apijson.Field Enabled apijson.Field Interval apijson.Field @@ -352,25 +352,25 @@ type deviceDEXTestGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestGetResponseData struct { +type DeviceDEXTestReplaceResponseData struct { // The desired endpoint to test. Host string `json:"host"` // The type of test. Kind string `json:"kind"` // The HTTP request method type. - Method string `json:"method"` - JSON deviceDEXTestGetResponseDataJSON `json:"-"` + Method string `json:"method"` + JSON deviceDEXTestReplaceResponseDataJSON `json:"-"` } -// deviceDEXTestGetResponseDataJSON contains the JSON metadata for the struct -// [DeviceDEXTestGetResponseData] -type deviceDEXTestGetResponseDataJSON struct { +// deviceDEXTestReplaceResponseDataJSON contains the JSON metadata for the struct +// [DeviceDEXTestReplaceResponseData] +type deviceDEXTestReplaceResponseDataJSON struct { Host apijson.Field Kind apijson.Field Method apijson.Field @@ -378,14 +378,14 @@ type deviceDEXTestGetResponseDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestGetResponseData) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestReplaceResponseData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestUpdateParams struct { +type DeviceDEXTestNewParams struct { // The configuration object which contains the details for the WARP client to // conduct the test. - Data param.Field[DeviceDEXTestUpdateParamsData] `json:"data,required"` + Data param.Field[DeviceDEXTestNewParamsData] `json:"data,required"` // Determines whether or not the test is active. Enabled param.Field[bool] `json:"enabled,required"` // How often the test will run. @@ -396,13 +396,13 @@ type DeviceDEXTestUpdateParams struct { Description param.Field[string] `json:"description"` } -func (r DeviceDEXTestUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DeviceDEXTestNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration object which contains the details for the WARP client to // conduct the test. -type DeviceDEXTestUpdateParamsData struct { +type DeviceDEXTestNewParamsData struct { // The desired endpoint to test. Host param.Field[string] `json:"host"` // The type of test. @@ -411,22 +411,22 @@ type DeviceDEXTestUpdateParamsData struct { Method param.Field[string] `json:"method"` } -func (r DeviceDEXTestUpdateParamsData) MarshalJSON() (data []byte, err error) { +func (r DeviceDEXTestNewParamsData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DeviceDEXTestUpdateResponseEnvelope struct { - Errors []DeviceDEXTestUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceDEXTestUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DeviceDEXTestUpdateResponse `json:"result,required,nullable"` +type DeviceDEXTestNewResponseEnvelope struct { + Errors []DeviceDEXTestNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceDEXTestNewResponseEnvelopeMessages `json:"messages,required"` + Result DeviceDEXTestNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceDEXTestUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON deviceDEXTestUpdateResponseEnvelopeJSON `json:"-"` + Success DeviceDEXTestNewResponseEnvelopeSuccess `json:"success,required"` + JSON deviceDEXTestNewResponseEnvelopeJSON `json:"-"` } -// deviceDEXTestUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [DeviceDEXTestUpdateResponseEnvelope] -type deviceDEXTestUpdateResponseEnvelopeJSON struct { +// deviceDEXTestNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceDEXTestNewResponseEnvelope] +type deviceDEXTestNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -435,67 +435,67 @@ type deviceDEXTestUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestUpdateResponseEnvelopeErrorsJSON `json:"-"` +type DeviceDEXTestNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestNewResponseEnvelopeErrorsJSON `json:"-"` } -// deviceDEXTestUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DeviceDEXTestUpdateResponseEnvelopeErrors] -type deviceDEXTestUpdateResponseEnvelopeErrorsJSON struct { +// deviceDEXTestNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceDEXTestNewResponseEnvelopeErrors] +type deviceDEXTestNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestUpdateResponseEnvelopeMessagesJSON `json:"-"` +type DeviceDEXTestNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestNewResponseEnvelopeMessagesJSON `json:"-"` } -// deviceDEXTestUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DeviceDEXTestUpdateResponseEnvelopeMessages] -type deviceDEXTestUpdateResponseEnvelopeMessagesJSON struct { +// deviceDEXTestNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceDEXTestNewResponseEnvelopeMessages] +type deviceDEXTestNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceDEXTestUpdateResponseEnvelopeSuccess bool +type DeviceDEXTestNewResponseEnvelopeSuccess bool const ( - DeviceDEXTestUpdateResponseEnvelopeSuccessTrue DeviceDEXTestUpdateResponseEnvelopeSuccess = true + DeviceDEXTestNewResponseEnvelopeSuccessTrue DeviceDEXTestNewResponseEnvelopeSuccess = true ) -type DeviceDEXTestDeleteResponseEnvelope struct { - Errors []DeviceDEXTestDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceDEXTestDeleteResponseEnvelopeMessages `json:"messages,required"` - Result []DeviceDEXTestDeleteResponse `json:"result,required,nullable"` +type DeviceDEXTestListResponseEnvelope struct { + Errors []DeviceDEXTestListResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceDEXTestListResponseEnvelopeMessages `json:"messages,required"` + Result []DeviceDEXTestListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceDEXTestDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON deviceDEXTestDeleteResponseEnvelopeJSON `json:"-"` + Success DeviceDEXTestListResponseEnvelopeSuccess `json:"success,required"` + JSON deviceDEXTestListResponseEnvelopeJSON `json:"-"` } -// deviceDEXTestDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [DeviceDEXTestDeleteResponseEnvelope] -type deviceDEXTestDeleteResponseEnvelopeJSON struct { +// deviceDEXTestListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceDEXTestListResponseEnvelope] +type deviceDEXTestListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -504,101 +504,67 @@ type deviceDEXTestDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeleteResponseEnvelopeErrorsJSON `json:"-"` +type DeviceDEXTestListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestListResponseEnvelopeErrorsJSON `json:"-"` } -// deviceDEXTestDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DeviceDEXTestDeleteResponseEnvelopeErrors] -type deviceDEXTestDeleteResponseEnvelopeErrorsJSON struct { +// deviceDEXTestListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceDEXTestListResponseEnvelopeErrors] +type deviceDEXTestListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeleteResponseEnvelopeMessagesJSON `json:"-"` +type DeviceDEXTestListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestListResponseEnvelopeMessagesJSON `json:"-"` } -// deviceDEXTestDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DeviceDEXTestDeleteResponseEnvelopeMessages] -type deviceDEXTestDeleteResponseEnvelopeMessagesJSON struct { +// deviceDEXTestListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceDEXTestListResponseEnvelopeMessages] +type deviceDEXTestListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceDEXTestDeleteResponseEnvelopeSuccess bool +type DeviceDEXTestListResponseEnvelopeSuccess bool const ( - DeviceDEXTestDeleteResponseEnvelopeSuccessTrue DeviceDEXTestDeleteResponseEnvelopeSuccess = true + DeviceDEXTestListResponseEnvelopeSuccessTrue DeviceDEXTestListResponseEnvelopeSuccess = true ) -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParams struct { - // The configuration object which contains the details for the WARP client to - // conduct the test. - Data param.Field[DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParamsData] `json:"data,required"` - // Determines whether or not the test is active. - Enabled param.Field[bool] `json:"enabled,required"` - // How often the test will run. - Interval param.Field[string] `json:"interval,required"` - // The name of the DEX test. Must be unique. - Name param.Field[string] `json:"name,required"` - // Additional details about the test. - Description param.Field[string] `json:"description"` -} - -func (r DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The configuration object which contains the details for the WARP client to -// conduct the test. -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParamsData struct { - // The desired endpoint to test. - Host param.Field[string] `json:"host"` - // The type of test. - Kind param.Field[string] `json:"kind"` - // The HTTP request method type. - Method param.Field[string] `json:"method"` -} - -func (r DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParamsData) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelope struct { - Errors []DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessages `json:"messages,required"` - Result DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponse `json:"result,required,nullable"` +type DeviceDEXTestDeleteResponseEnvelope struct { + Errors []DeviceDEXTestDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceDEXTestDeleteResponseEnvelopeMessages `json:"messages,required"` + Result []DeviceDEXTestDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeSuccess `json:"success,required"` - JSON deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeJSON `json:"-"` + Success DeviceDEXTestDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON deviceDEXTestDeleteResponseEnvelopeJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelope] -type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeJSON struct { +// deviceDEXTestDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceDEXTestDeleteResponseEnvelope] +type deviceDEXTestDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -607,69 +573,67 @@ type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrorsJSON `json:"-"` +type DeviceDEXTestDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrors] -type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrorsJSON struct { +// deviceDEXTestDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceDEXTestDeleteResponseEnvelopeErrors] +type deviceDEXTestDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessagesJSON `json:"-"` +type DeviceDEXTestDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessages] -type deviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessagesJSON struct { +// deviceDEXTestDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DeviceDEXTestDeleteResponseEnvelopeMessages] +type deviceDEXTestDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeSuccess bool +type DeviceDEXTestDeleteResponseEnvelopeSuccess bool const ( - DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeSuccessTrue DeviceDEXTestDeviceDEXTestNewDeviceDEXTestResponseEnvelopeSuccess = true + DeviceDEXTestDeleteResponseEnvelopeSuccessTrue DeviceDEXTestDeleteResponseEnvelopeSuccess = true ) -type DeviceDEXTestDeviceDEXTestDetailsResponseEnvelope struct { - Errors []DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessages `json:"messages,required"` - Result []DeviceDEXTestDeviceDEXTestDetailsResponse `json:"result,required,nullable"` +type DeviceDEXTestGetResponseEnvelope struct { + Errors []DeviceDEXTestGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceDEXTestGetResponseEnvelopeMessages `json:"messages,required"` + Result DeviceDEXTestGetResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeJSON `json:"-"` + Success DeviceDEXTestGetResponseEnvelopeSuccess `json:"success,required"` + JSON deviceDEXTestGetResponseEnvelopeJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeJSON contains the JSON metadata -// for the struct [DeviceDEXTestDeviceDEXTestDetailsResponseEnvelope] -type deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeJSON struct { +// deviceDEXTestGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceDEXTestGetResponseEnvelope] +type deviceDEXTestGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -678,69 +642,100 @@ type deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrorsJSON `json:"-"` +type DeviceDEXTestGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestGetResponseEnvelopeErrorsJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrors] -type deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrorsJSON struct { +// deviceDEXTestGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceDEXTestGetResponseEnvelopeErrors] +type deviceDEXTestGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessagesJSON `json:"-"` +type DeviceDEXTestGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestGetResponseEnvelopeMessagesJSON `json:"-"` } -// deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessages] -type deviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessagesJSON struct { +// deviceDEXTestGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceDEXTestGetResponseEnvelopeMessages] +type deviceDEXTestGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeSuccess bool +type DeviceDEXTestGetResponseEnvelopeSuccess bool const ( - DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeSuccessTrue DeviceDEXTestDeviceDEXTestDetailsResponseEnvelopeSuccess = true + DeviceDEXTestGetResponseEnvelopeSuccessTrue DeviceDEXTestGetResponseEnvelopeSuccess = true ) -type DeviceDEXTestGetResponseEnvelope struct { - Errors []DeviceDEXTestGetResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceDEXTestGetResponseEnvelopeMessages `json:"messages,required"` - Result DeviceDEXTestGetResponse `json:"result,required,nullable"` +type DeviceDEXTestReplaceParams struct { + // The configuration object which contains the details for the WARP client to + // conduct the test. + Data param.Field[DeviceDEXTestReplaceParamsData] `json:"data,required"` + // Determines whether or not the test is active. + Enabled param.Field[bool] `json:"enabled,required"` + // How often the test will run. + Interval param.Field[string] `json:"interval,required"` + // The name of the DEX test. Must be unique. + Name param.Field[string] `json:"name,required"` + // Additional details about the test. + Description param.Field[string] `json:"description"` +} + +func (r DeviceDEXTestReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The configuration object which contains the details for the WARP client to +// conduct the test. +type DeviceDEXTestReplaceParamsData struct { + // The desired endpoint to test. + Host param.Field[string] `json:"host"` + // The type of test. + Kind param.Field[string] `json:"kind"` + // The HTTP request method type. + Method param.Field[string] `json:"method"` +} + +func (r DeviceDEXTestReplaceParamsData) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DeviceDEXTestReplaceResponseEnvelope struct { + Errors []DeviceDEXTestReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceDEXTestReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DeviceDEXTestReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceDEXTestGetResponseEnvelopeSuccess `json:"success,required"` - JSON deviceDEXTestGetResponseEnvelopeJSON `json:"-"` + Success DeviceDEXTestReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON deviceDEXTestReplaceResponseEnvelopeJSON `json:"-"` } -// deviceDEXTestGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [DeviceDEXTestGetResponseEnvelope] -type deviceDEXTestGetResponseEnvelopeJSON struct { +// deviceDEXTestReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceDEXTestReplaceResponseEnvelope] +type deviceDEXTestReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -749,51 +744,51 @@ type deviceDEXTestGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestGetResponseEnvelopeErrorsJSON `json:"-"` +type DeviceDEXTestReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// deviceDEXTestGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DeviceDEXTestGetResponseEnvelopeErrors] -type deviceDEXTestGetResponseEnvelopeErrorsJSON struct { +// deviceDEXTestReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DeviceDEXTestReplaceResponseEnvelopeErrors] +type deviceDEXTestReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceDEXTestGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceDEXTestGetResponseEnvelopeMessagesJSON `json:"-"` +type DeviceDEXTestReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceDEXTestReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// deviceDEXTestGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DeviceDEXTestGetResponseEnvelopeMessages] -type deviceDEXTestGetResponseEnvelopeMessagesJSON struct { +// deviceDEXTestReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DeviceDEXTestReplaceResponseEnvelopeMessages] +type deviceDEXTestReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceDEXTestGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceDEXTestReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceDEXTestGetResponseEnvelopeSuccess bool +type DeviceDEXTestReplaceResponseEnvelopeSuccess bool const ( - DeviceDEXTestGetResponseEnvelopeSuccessTrue DeviceDEXTestGetResponseEnvelopeSuccess = true + DeviceDEXTestReplaceResponseEnvelopeSuccessTrue DeviceDEXTestReplaceResponseEnvelopeSuccess = true ) diff --git a/devicedextest_test.go b/devicedextest_test.go index 16306082d06..58a37906088 100644 --- a/devicedextest_test.go +++ b/devicedextest_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceDEXTestUpdateWithOptionalParams(t *testing.T) { +func TestDeviceDEXTestNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,11 @@ func TestDeviceDEXTestUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.DEXTests.Update( + _, err := client.Devices.DEXTests.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DeviceDEXTestUpdateParams{ - Data: cloudflare.F(cloudflare.DeviceDEXTestUpdateParamsData{ + cloudflare.DeviceDEXTestNewParams{ + Data: cloudflare.F(cloudflare.DeviceDEXTestNewParamsData{ Host: cloudflare.F("https://dash.cloudflare.com"), Kind: cloudflare.F("http"), Method: cloudflare.F("GET"), @@ -54,7 +53,7 @@ func TestDeviceDEXTestUpdateWithOptionalParams(t *testing.T) { } } -func TestDeviceDEXTestDelete(t *testing.T) { +func TestDeviceDEXTestList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -70,11 +69,7 @@ func TestDeviceDEXTestDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.DEXTests.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Devices.DEXTests.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -84,7 +79,7 @@ func TestDeviceDEXTestDelete(t *testing.T) { } } -func TestDeviceDEXTestDeviceDEXTestNewDeviceDEXTestWithOptionalParams(t *testing.T) { +func TestDeviceDEXTestDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -100,20 +95,10 @@ func TestDeviceDEXTestDeviceDEXTestNewDeviceDEXTestWithOptionalParams(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.DEXTests.DeviceDEXTestNewDeviceDEXTest( + _, err := client.Devices.DEXTests.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParams{ - Data: cloudflare.F(cloudflare.DeviceDEXTestDeviceDEXTestNewDeviceDEXTestParamsData{ - Host: cloudflare.F("https://dash.cloudflare.com"), - Kind: cloudflare.F("http"), - Method: cloudflare.F("GET"), - }), - Enabled: cloudflare.F(true), - Interval: cloudflare.F("30m"), - Name: cloudflare.F("HTTP dash health check"), - Description: cloudflare.F("Checks the dash endpoint every 30 minutes"), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -124,7 +109,7 @@ func TestDeviceDEXTestDeviceDEXTestNewDeviceDEXTestWithOptionalParams(t *testing } } -func TestDeviceDEXTestDeviceDEXTestDetails(t *testing.T) { +func TestDeviceDEXTestGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -140,7 +125,11 @@ func TestDeviceDEXTestDeviceDEXTestDetails(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.DEXTests.DeviceDEXTestDetails(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.DEXTests.Get( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -150,7 +139,7 @@ func TestDeviceDEXTestDeviceDEXTestDetails(t *testing.T) { } } -func TestDeviceDEXTestGet(t *testing.T) { +func TestDeviceDEXTestReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -166,10 +155,21 @@ func TestDeviceDEXTestGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.DEXTests.Get( + _, err := client.Devices.DEXTests.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.DeviceDEXTestReplaceParams{ + Data: cloudflare.F(cloudflare.DeviceDEXTestReplaceParamsData{ + Host: cloudflare.F("https://dash.cloudflare.com"), + Kind: cloudflare.F("http"), + Method: cloudflare.F("GET"), + }), + Enabled: cloudflare.F(true), + Interval: cloudflare.F("30m"), + Name: cloudflare.F("HTTP dash health check"), + Description: cloudflare.F("Checks the dash endpoint every 30 minutes"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/devicenetwork.go b/devicenetwork.go index e0ced141873..66bd55feb30 100644 --- a/devicenetwork.go +++ b/devicenetwork.go @@ -31,12 +31,12 @@ func NewDeviceNetworkService(opts ...option.RequestOption) (r *DeviceNetworkServ return } -// Updates a configured device managed network. -func (r *DeviceNetworkService) Update(ctx context.Context, identifier interface{}, uuid string, body DeviceNetworkUpdateParams, opts ...option.RequestOption) (res *DeviceNetworkUpdateResponse, err error) { +// Creates a new device managed network. +func (r *DeviceNetworkService) New(ctx context.Context, identifier interface{}, body DeviceNetworkNewParams, opts ...option.RequestOption) (res *DeviceNetworkNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceNetworkUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/networks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env DeviceNetworkNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/networks", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,13 +44,12 @@ func (r *DeviceNetworkService) Update(ctx context.Context, identifier interface{ return } -// Deletes a device managed network and fetches a list of the remaining device -// managed networks for an account. -func (r *DeviceNetworkService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DeviceNetworkDeleteResponse, err error) { +// Fetches a list of managed networks for an account. +func (r *DeviceNetworkService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DeviceNetworkListResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceNetworkDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/networks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env DeviceNetworkListResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/networks", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,12 +57,13 @@ func (r *DeviceNetworkService) Delete(ctx context.Context, identifier interface{ return } -// Creates a new device managed network. -func (r *DeviceNetworkService) DeviceManagedNetworksNewDeviceManagedNetwork(ctx context.Context, identifier interface{}, body DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParams, opts ...option.RequestOption) (res *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse, err error) { +// Deletes a device managed network and fetches a list of the remaining device +// managed networks for an account. +func (r *DeviceNetworkService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DeviceNetworkDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/networks", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env DeviceNetworkDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/networks/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -71,11 +71,11 @@ func (r *DeviceNetworkService) DeviceManagedNetworksNewDeviceManagedNetwork(ctx return } -// Fetches a list of managed networks for an account. -func (r *DeviceNetworkService) DeviceManagedNetworksListDeviceManagedNetworks(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse, err error) { +// Fetches details for a single managed network. +func (r *DeviceNetworkService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceNetworkGetResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/networks", identifier) + var env DeviceNetworkGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/networks/%s", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -84,12 +84,12 @@ func (r *DeviceNetworkService) DeviceManagedNetworksListDeviceManagedNetworks(ct return } -// Fetches details for a single managed network. -func (r *DeviceNetworkService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceNetworkGetResponse, err error) { +// Updates a configured device managed network. +func (r *DeviceNetworkService) Replace(ctx context.Context, identifier interface{}, uuid string, body DeviceNetworkReplaceParams, opts ...option.RequestOption) (res *DeviceNetworkReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceNetworkGetResponseEnvelope + var env DeviceNetworkReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/networks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -97,22 +97,22 @@ func (r *DeviceNetworkService) Get(ctx context.Context, identifier interface{}, return } -type DeviceNetworkUpdateResponse struct { +type DeviceNetworkNewResponse struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config DeviceNetworkUpdateResponseConfig `json:"config"` + Config DeviceNetworkNewResponseConfig `json:"config"` // The name of the device managed network. This name must be unique. Name string `json:"name"` // API UUID. NetworkID string `json:"network_id"` // The type of device managed network. - Type DeviceNetworkUpdateResponseType `json:"type"` - JSON deviceNetworkUpdateResponseJSON `json:"-"` + Type DeviceNetworkNewResponseType `json:"type"` + JSON deviceNetworkNewResponseJSON `json:"-"` } -// deviceNetworkUpdateResponseJSON contains the JSON metadata for the struct -// [DeviceNetworkUpdateResponse] -type deviceNetworkUpdateResponseJSON struct { +// deviceNetworkNewResponseJSON contains the JSON metadata for the struct +// [DeviceNetworkNewResponse] +type deviceNetworkNewResponseJSON struct { Config apijson.Field Name apijson.Field NetworkID apijson.Field @@ -121,59 +121,59 @@ type deviceNetworkUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkUpdateResponseConfig struct { +type DeviceNetworkNewResponseConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr string `json:"tls_sockaddr,required"` // The SHA-256 hash of the TLS certificate presented by the host found at // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid // timestamp, etc) will be used to validate the certificate. - Sha256 string `json:"sha256"` - JSON deviceNetworkUpdateResponseConfigJSON `json:"-"` + Sha256 string `json:"sha256"` + JSON deviceNetworkNewResponseConfigJSON `json:"-"` } -// deviceNetworkUpdateResponseConfigJSON contains the JSON metadata for the struct -// [DeviceNetworkUpdateResponseConfig] -type deviceNetworkUpdateResponseConfigJSON struct { +// deviceNetworkNewResponseConfigJSON contains the JSON metadata for the struct +// [DeviceNetworkNewResponseConfig] +type deviceNetworkNewResponseConfigJSON struct { TLSSockaddr apijson.Field Sha256 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkUpdateResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkNewResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device managed network. -type DeviceNetworkUpdateResponseType string +type DeviceNetworkNewResponseType string const ( - DeviceNetworkUpdateResponseTypeTLS DeviceNetworkUpdateResponseType = "tls" + DeviceNetworkNewResponseTypeTLS DeviceNetworkNewResponseType = "tls" ) -type DeviceNetworkDeleteResponse struct { +type DeviceNetworkListResponse struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config DeviceNetworkDeleteResponseConfig `json:"config"` + Config DeviceNetworkListResponseConfig `json:"config"` // The name of the device managed network. This name must be unique. Name string `json:"name"` // API UUID. NetworkID string `json:"network_id"` // The type of device managed network. - Type DeviceNetworkDeleteResponseType `json:"type"` - JSON deviceNetworkDeleteResponseJSON `json:"-"` + Type DeviceNetworkListResponseType `json:"type"` + JSON deviceNetworkListResponseJSON `json:"-"` } -// deviceNetworkDeleteResponseJSON contains the JSON metadata for the struct -// [DeviceNetworkDeleteResponse] -type deviceNetworkDeleteResponseJSON struct { +// deviceNetworkListResponseJSON contains the JSON metadata for the struct +// [DeviceNetworkListResponse] +type deviceNetworkListResponseJSON struct { Config apijson.Field Name apijson.Field NetworkID apijson.Field @@ -182,60 +182,59 @@ type deviceNetworkDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkDeleteResponseConfig struct { +type DeviceNetworkListResponseConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr string `json:"tls_sockaddr,required"` // The SHA-256 hash of the TLS certificate presented by the host found at // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid // timestamp, etc) will be used to validate the certificate. - Sha256 string `json:"sha256"` - JSON deviceNetworkDeleteResponseConfigJSON `json:"-"` + Sha256 string `json:"sha256"` + JSON deviceNetworkListResponseConfigJSON `json:"-"` } -// deviceNetworkDeleteResponseConfigJSON contains the JSON metadata for the struct -// [DeviceNetworkDeleteResponseConfig] -type deviceNetworkDeleteResponseConfigJSON struct { +// deviceNetworkListResponseConfigJSON contains the JSON metadata for the struct +// [DeviceNetworkListResponseConfig] +type deviceNetworkListResponseConfigJSON struct { TLSSockaddr apijson.Field Sha256 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device managed network. -type DeviceNetworkDeleteResponseType string +type DeviceNetworkListResponseType string const ( - DeviceNetworkDeleteResponseTypeTLS DeviceNetworkDeleteResponseType = "tls" + DeviceNetworkListResponseTypeTLS DeviceNetworkListResponseType = "tls" ) -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse struct { +type DeviceNetworkDeleteResponse struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfig `json:"config"` + Config DeviceNetworkDeleteResponseConfig `json:"config"` // The name of the device managed network. This name must be unique. Name string `json:"name"` // API UUID. NetworkID string `json:"network_id"` // The type of device managed network. - Type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseType `json:"type"` - JSON deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseJSON `json:"-"` + Type DeviceNetworkDeleteResponseType `json:"type"` + JSON deviceNetworkDeleteResponseJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseJSON contains -// the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse] -type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseJSON struct { +// deviceNetworkDeleteResponseJSON contains the JSON metadata for the struct +// [DeviceNetworkDeleteResponse] +type deviceNetworkDeleteResponseJSON struct { Config apijson.Field Name apijson.Field NetworkID apijson.Field @@ -244,61 +243,59 @@ type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseJSON struc ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfig struct { +type DeviceNetworkDeleteResponseConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr string `json:"tls_sockaddr,required"` // The SHA-256 hash of the TLS certificate presented by the host found at // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid // timestamp, etc) will be used to validate the certificate. - Sha256 string `json:"sha256"` - JSON deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfigJSON `json:"-"` + Sha256 string `json:"sha256"` + JSON deviceNetworkDeleteResponseConfigJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfigJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfig] -type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfigJSON struct { +// deviceNetworkDeleteResponseConfigJSON contains the JSON metadata for the struct +// [DeviceNetworkDeleteResponseConfig] +type deviceNetworkDeleteResponseConfigJSON struct { TLSSockaddr apijson.Field Sha256 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device managed network. -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseType string +type DeviceNetworkDeleteResponseType string const ( - DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseTypeTLS DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseType = "tls" + DeviceNetworkDeleteResponseTypeTLS DeviceNetworkDeleteResponseType = "tls" ) -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse struct { +type DeviceNetworkGetResponse struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfig `json:"config"` + Config DeviceNetworkGetResponseConfig `json:"config"` // The name of the device managed network. This name must be unique. Name string `json:"name"` // API UUID. NetworkID string `json:"network_id"` // The type of device managed network. - Type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseType `json:"type"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseJSON `json:"-"` + Type DeviceNetworkGetResponseType `json:"type"` + JSON deviceNetworkGetResponseJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseJSON contains -// the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseJSON struct { +// deviceNetworkGetResponseJSON contains the JSON metadata for the struct +// [DeviceNetworkGetResponse] +type deviceNetworkGetResponseJSON struct { Config apijson.Field Name apijson.Field NetworkID apijson.Field @@ -307,60 +304,59 @@ type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseJSON str ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfig struct { +type DeviceNetworkGetResponseConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr string `json:"tls_sockaddr,required"` // The SHA-256 hash of the TLS certificate presented by the host found at // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid // timestamp, etc) will be used to validate the certificate. - Sha256 string `json:"sha256"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfigJSON `json:"-"` + Sha256 string `json:"sha256"` + JSON deviceNetworkGetResponseConfigJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfigJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfig] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfigJSON struct { +// deviceNetworkGetResponseConfigJSON contains the JSON metadata for the struct +// [DeviceNetworkGetResponseConfig] +type deviceNetworkGetResponseConfigJSON struct { TLSSockaddr apijson.Field Sha256 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkGetResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device managed network. -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseType string +type DeviceNetworkGetResponseType string const ( - DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseTypeTLS DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseType = "tls" + DeviceNetworkGetResponseTypeTLS DeviceNetworkGetResponseType = "tls" ) -type DeviceNetworkGetResponse struct { +type DeviceNetworkReplaceResponse struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config DeviceNetworkGetResponseConfig `json:"config"` + Config DeviceNetworkReplaceResponseConfig `json:"config"` // The name of the device managed network. This name must be unique. Name string `json:"name"` // API UUID. NetworkID string `json:"network_id"` // The type of device managed network. - Type DeviceNetworkGetResponseType `json:"type"` - JSON deviceNetworkGetResponseJSON `json:"-"` + Type DeviceNetworkReplaceResponseType `json:"type"` + JSON deviceNetworkReplaceResponseJSON `json:"-"` } -// deviceNetworkGetResponseJSON contains the JSON metadata for the struct -// [DeviceNetworkGetResponse] -type deviceNetworkGetResponseJSON struct { +// deviceNetworkReplaceResponseJSON contains the JSON metadata for the struct +// [DeviceNetworkReplaceResponse] +type deviceNetworkReplaceResponseJSON struct { Config apijson.Field Name apijson.Field NetworkID apijson.Field @@ -369,60 +365,60 @@ type deviceNetworkGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkGetResponseConfig struct { +type DeviceNetworkReplaceResponseConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr string `json:"tls_sockaddr,required"` // The SHA-256 hash of the TLS certificate presented by the host found at // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid // timestamp, etc) will be used to validate the certificate. - Sha256 string `json:"sha256"` - JSON deviceNetworkGetResponseConfigJSON `json:"-"` + Sha256 string `json:"sha256"` + JSON deviceNetworkReplaceResponseConfigJSON `json:"-"` } -// deviceNetworkGetResponseConfigJSON contains the JSON metadata for the struct -// [DeviceNetworkGetResponseConfig] -type deviceNetworkGetResponseConfigJSON struct { +// deviceNetworkReplaceResponseConfigJSON contains the JSON metadata for the struct +// [DeviceNetworkReplaceResponseConfig] +type deviceNetworkReplaceResponseConfigJSON struct { TLSSockaddr apijson.Field Sha256 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkGetResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkReplaceResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device managed network. -type DeviceNetworkGetResponseType string +type DeviceNetworkReplaceResponseType string const ( - DeviceNetworkGetResponseTypeTLS DeviceNetworkGetResponseType = "tls" + DeviceNetworkReplaceResponseTypeTLS DeviceNetworkReplaceResponseType = "tls" ) -type DeviceNetworkUpdateParams struct { +type DeviceNetworkNewParams struct { // The configuration object containing information for the WARP client to detect // the managed network. - Config param.Field[DeviceNetworkUpdateParamsConfig] `json:"config"` + Config param.Field[DeviceNetworkNewParamsConfig] `json:"config,required"` // The name of the device managed network. This name must be unique. - Name param.Field[string] `json:"name"` + Name param.Field[string] `json:"name,required"` // The type of device managed network. - Type param.Field[DeviceNetworkUpdateParamsType] `json:"type"` + Type param.Field[DeviceNetworkNewParamsType] `json:"type,required"` } -func (r DeviceNetworkUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DeviceNetworkNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration object containing information for the WARP client to detect // the managed network. -type DeviceNetworkUpdateParamsConfig struct { +type DeviceNetworkNewParamsConfig struct { // A network address of the form "host:port" that the WARP client will use to // detect the presence of a TLS host. TLSSockaddr param.Field[string] `json:"tls_sockaddr,required"` @@ -432,29 +428,29 @@ type DeviceNetworkUpdateParamsConfig struct { Sha256 param.Field[string] `json:"sha256"` } -func (r DeviceNetworkUpdateParamsConfig) MarshalJSON() (data []byte, err error) { +func (r DeviceNetworkNewParamsConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of device managed network. -type DeviceNetworkUpdateParamsType string +type DeviceNetworkNewParamsType string const ( - DeviceNetworkUpdateParamsTypeTLS DeviceNetworkUpdateParamsType = "tls" + DeviceNetworkNewParamsTypeTLS DeviceNetworkNewParamsType = "tls" ) -type DeviceNetworkUpdateResponseEnvelope struct { - Errors []DeviceNetworkUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceNetworkUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DeviceNetworkUpdateResponse `json:"result,required,nullable"` +type DeviceNetworkNewResponseEnvelope struct { + Errors []DeviceNetworkNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceNetworkNewResponseEnvelopeMessages `json:"messages,required"` + Result DeviceNetworkNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceNetworkUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON deviceNetworkUpdateResponseEnvelopeJSON `json:"-"` + Success DeviceNetworkNewResponseEnvelopeSuccess `json:"success,required"` + JSON deviceNetworkNewResponseEnvelopeJSON `json:"-"` } -// deviceNetworkUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [DeviceNetworkUpdateResponseEnvelope] -type deviceNetworkUpdateResponseEnvelopeJSON struct { +// deviceNetworkNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceNetworkNewResponseEnvelope] +type deviceNetworkNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -463,68 +459,68 @@ type deviceNetworkUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkUpdateResponseEnvelopeErrorsJSON `json:"-"` +type DeviceNetworkNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkNewResponseEnvelopeErrorsJSON `json:"-"` } -// deviceNetworkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DeviceNetworkUpdateResponseEnvelopeErrors] -type deviceNetworkUpdateResponseEnvelopeErrorsJSON struct { +// deviceNetworkNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceNetworkNewResponseEnvelopeErrors] +type deviceNetworkNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkUpdateResponseEnvelopeMessagesJSON `json:"-"` +type DeviceNetworkNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkNewResponseEnvelopeMessagesJSON `json:"-"` } -// deviceNetworkUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DeviceNetworkUpdateResponseEnvelopeMessages] -type deviceNetworkUpdateResponseEnvelopeMessagesJSON struct { +// deviceNetworkNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceNetworkNewResponseEnvelopeMessages] +type deviceNetworkNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceNetworkUpdateResponseEnvelopeSuccess bool +type DeviceNetworkNewResponseEnvelopeSuccess bool const ( - DeviceNetworkUpdateResponseEnvelopeSuccessTrue DeviceNetworkUpdateResponseEnvelopeSuccess = true + DeviceNetworkNewResponseEnvelopeSuccessTrue DeviceNetworkNewResponseEnvelopeSuccess = true ) -type DeviceNetworkDeleteResponseEnvelope struct { - Errors []DeviceNetworkDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceNetworkDeleteResponseEnvelopeMessages `json:"messages,required"` - Result []DeviceNetworkDeleteResponse `json:"result,required,nullable"` +type DeviceNetworkListResponseEnvelope struct { + Errors []DeviceNetworkListResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceNetworkListResponseEnvelopeMessages `json:"messages,required"` + Result []DeviceNetworkListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceNetworkDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DeviceNetworkDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON deviceNetworkDeleteResponseEnvelopeJSON `json:"-"` + Success DeviceNetworkListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DeviceNetworkListResponseEnvelopeResultInfo `json:"result_info"` + JSON deviceNetworkListResponseEnvelopeJSON `json:"-"` } -// deviceNetworkDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [DeviceNetworkDeleteResponseEnvelope] -type deviceNetworkDeleteResponseEnvelopeJSON struct { +// deviceNetworkListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceNetworkListResponseEnvelope] +type deviceNetworkListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -534,56 +530,56 @@ type deviceNetworkDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeleteResponseEnvelopeErrorsJSON `json:"-"` +type DeviceNetworkListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkListResponseEnvelopeErrorsJSON `json:"-"` } -// deviceNetworkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DeviceNetworkDeleteResponseEnvelopeErrors] -type deviceNetworkDeleteResponseEnvelopeErrorsJSON struct { +// deviceNetworkListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceNetworkListResponseEnvelopeErrors] +type deviceNetworkListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeleteResponseEnvelopeMessagesJSON `json:"-"` +type DeviceNetworkListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkListResponseEnvelopeMessagesJSON `json:"-"` } -// deviceNetworkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DeviceNetworkDeleteResponseEnvelopeMessages] -type deviceNetworkDeleteResponseEnvelopeMessagesJSON struct { +// deviceNetworkListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceNetworkListResponseEnvelopeMessages] +type deviceNetworkListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceNetworkDeleteResponseEnvelopeSuccess bool +type DeviceNetworkListResponseEnvelopeSuccess bool const ( - DeviceNetworkDeleteResponseEnvelopeSuccessTrue DeviceNetworkDeleteResponseEnvelopeSuccess = true + DeviceNetworkListResponseEnvelopeSuccessTrue DeviceNetworkListResponseEnvelopeSuccess = true ) -type DeviceNetworkDeleteResponseEnvelopeResultInfo struct { +type DeviceNetworkListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -591,13 +587,13 @@ type DeviceNetworkDeleteResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON deviceNetworkDeleteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON deviceNetworkListResponseEnvelopeResultInfoJSON `json:"-"` } -// deviceNetworkDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [DeviceNetworkDeleteResponseEnvelopeResultInfo] -type deviceNetworkDeleteResponseEnvelopeResultInfoJSON struct { +// deviceNetworkListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DeviceNetworkListResponseEnvelopeResultInfo] +type deviceNetworkListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -606,133 +602,23 @@ type deviceNetworkDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParams struct { - // The configuration object containing information for the WARP client to detect - // the managed network. - Config param.Field[DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsConfig] `json:"config,required"` - // The name of the device managed network. This name must be unique. - Name param.Field[string] `json:"name,required"` - // The type of device managed network. - Type param.Field[DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsType] `json:"type,required"` -} - -func (r DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The configuration object containing information for the WARP client to detect -// the managed network. -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsConfig struct { - // A network address of the form "host:port" that the WARP client will use to - // detect the presence of a TLS host. - TLSSockaddr param.Field[string] `json:"tls_sockaddr,required"` - // The SHA-256 hash of the TLS certificate presented by the host found at - // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid - // timestamp, etc) will be used to validate the certificate. - Sha256 param.Field[string] `json:"sha256"` -} - -func (r DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The type of device managed network. -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsType string - -const ( - DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsTypeTLS DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsType = "tls" -) - -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelope struct { - Errors []DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessages `json:"messages,required"` - Result DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeSuccess `json:"success,required"` - JSON deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeJSON `json:"-"` -} - -// deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelope] -type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrorsJSON `json:"-"` -} - -// deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrors] -type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessagesJSON `json:"-"` -} - -// deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessages] -type deviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeSuccess bool - -const ( - DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeSuccessTrue DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkResponseEnvelopeSuccess = true -) - -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope struct { - Errors []DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessages `json:"messages,required"` - Result []DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponse `json:"result,required,nullable"` +type DeviceNetworkDeleteResponseEnvelope struct { + Errors []DeviceNetworkDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceNetworkDeleteResponseEnvelopeMessages `json:"messages,required"` + Result []DeviceNetworkDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfo `json:"result_info"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeJSON `json:"-"` + Success DeviceNetworkDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DeviceNetworkDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON deviceNetworkDeleteResponseEnvelopeJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeJSON struct { +// deviceNetworkDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceNetworkDeleteResponseEnvelope] +type deviceNetworkDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -742,58 +628,56 @@ type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrorsJSON `json:"-"` +type DeviceNetworkDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrors] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrorsJSON struct { +// deviceNetworkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceNetworkDeleteResponseEnvelopeErrors] +type deviceNetworkDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessagesJSON `json:"-"` +type DeviceNetworkDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessages] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessagesJSON struct { +// deviceNetworkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DeviceNetworkDeleteResponseEnvelopeMessages] +type deviceNetworkDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeSuccess bool +type DeviceNetworkDeleteResponseEnvelopeSuccess bool const ( - DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeSuccessTrue DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeSuccess = true + DeviceNetworkDeleteResponseEnvelopeSuccessTrue DeviceNetworkDeleteResponseEnvelopeSuccess = true ) -type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfo struct { +type DeviceNetworkDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -801,14 +685,13 @@ type DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON deviceNetworkDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfo] -type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfoJSON struct { +// deviceNetworkDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DeviceNetworkDeleteResponseEnvelopeResultInfo] +type deviceNetworkDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -817,7 +700,7 @@ type deviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *DeviceNetworkDeviceManagedNetworksListDeviceManagedNetworksResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceNetworkDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -889,3 +772,109 @@ type DeviceNetworkGetResponseEnvelopeSuccess bool const ( DeviceNetworkGetResponseEnvelopeSuccessTrue DeviceNetworkGetResponseEnvelopeSuccess = true ) + +type DeviceNetworkReplaceParams struct { + // The configuration object containing information for the WARP client to detect + // the managed network. + Config param.Field[DeviceNetworkReplaceParamsConfig] `json:"config"` + // The name of the device managed network. This name must be unique. + Name param.Field[string] `json:"name"` + // The type of device managed network. + Type param.Field[DeviceNetworkReplaceParamsType] `json:"type"` +} + +func (r DeviceNetworkReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The configuration object containing information for the WARP client to detect +// the managed network. +type DeviceNetworkReplaceParamsConfig struct { + // A network address of the form "host:port" that the WARP client will use to + // detect the presence of a TLS host. + TLSSockaddr param.Field[string] `json:"tls_sockaddr,required"` + // The SHA-256 hash of the TLS certificate presented by the host found at + // tls_sockaddr. If absent, regular certificate verification (trusted roots, valid + // timestamp, etc) will be used to validate the certificate. + Sha256 param.Field[string] `json:"sha256"` +} + +func (r DeviceNetworkReplaceParamsConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The type of device managed network. +type DeviceNetworkReplaceParamsType string + +const ( + DeviceNetworkReplaceParamsTypeTLS DeviceNetworkReplaceParamsType = "tls" +) + +type DeviceNetworkReplaceResponseEnvelope struct { + Errors []DeviceNetworkReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceNetworkReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DeviceNetworkReplaceResponse `json:"result,required,nullable"` + // Whether the API call was successful. + Success DeviceNetworkReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON deviceNetworkReplaceResponseEnvelopeJSON `json:"-"` +} + +// deviceNetworkReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceNetworkReplaceResponseEnvelope] +type deviceNetworkReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DeviceNetworkReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DeviceNetworkReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// deviceNetworkReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DeviceNetworkReplaceResponseEnvelopeErrors] +type deviceNetworkReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DeviceNetworkReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DeviceNetworkReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceNetworkReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// deviceNetworkReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DeviceNetworkReplaceResponseEnvelopeMessages] +type deviceNetworkReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DeviceNetworkReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type DeviceNetworkReplaceResponseEnvelopeSuccess bool + +const ( + DeviceNetworkReplaceResponseEnvelopeSuccessTrue DeviceNetworkReplaceResponseEnvelopeSuccess = true +) diff --git a/devicenetwork_test.go b/devicenetwork_test.go index be831b6e2ea..261b1569581 100644 --- a/devicenetwork_test.go +++ b/devicenetwork_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceNetworkUpdateWithOptionalParams(t *testing.T) { +func TestDeviceNetworkNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,17 +29,16 @@ func TestDeviceNetworkUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Networks.Update( + _, err := client.Devices.Networks.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DeviceNetworkUpdateParams{ - Config: cloudflare.F(cloudflare.DeviceNetworkUpdateParamsConfig{ + cloudflare.DeviceNetworkNewParams{ + Config: cloudflare.F(cloudflare.DeviceNetworkNewParamsConfig{ Sha256: cloudflare.F("b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"), TLSSockaddr: cloudflare.F("foo.bar:1234"), }), Name: cloudflare.F("managed-network-1"), - Type: cloudflare.F(cloudflare.DeviceNetworkUpdateParamsTypeTLS), + Type: cloudflare.F(cloudflare.DeviceNetworkNewParamsTypeTLS), }, ) if err != nil { @@ -51,7 +50,7 @@ func TestDeviceNetworkUpdateWithOptionalParams(t *testing.T) { } } -func TestDeviceNetworkDelete(t *testing.T) { +func TestDeviceNetworkList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -67,11 +66,7 @@ func TestDeviceNetworkDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Networks.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Devices.Networks.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -81,7 +76,7 @@ func TestDeviceNetworkDelete(t *testing.T) { } } -func TestDeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkWithOptionalParams(t *testing.T) { +func TestDeviceNetworkDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -97,17 +92,10 @@ func TestDeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkWithOptionalPa option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Networks.DeviceManagedNetworksNewDeviceManagedNetwork( + _, err := client.Devices.Networks.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParams{ - Config: cloudflare.F(cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsConfig{ - Sha256: cloudflare.F("b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"), - TLSSockaddr: cloudflare.F("foo.bar:1234"), - }), - Name: cloudflare.F("managed-network-1"), - Type: cloudflare.F(cloudflare.DeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkParamsTypeTLS), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -118,7 +106,7 @@ func TestDeviceNetworkDeviceManagedNetworksNewDeviceManagedNetworkWithOptionalPa } } -func TestDeviceNetworkDeviceManagedNetworksListDeviceManagedNetworks(t *testing.T) { +func TestDeviceNetworkGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -134,7 +122,11 @@ func TestDeviceNetworkDeviceManagedNetworksListDeviceManagedNetworks(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Networks.DeviceManagedNetworksListDeviceManagedNetworks(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Networks.Get( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -144,7 +136,7 @@ func TestDeviceNetworkDeviceManagedNetworksListDeviceManagedNetworks(t *testing. } } -func TestDeviceNetworkGet(t *testing.T) { +func TestDeviceNetworkReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -160,10 +152,18 @@ func TestDeviceNetworkGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Networks.Get( + _, err := client.Devices.Networks.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.DeviceNetworkReplaceParams{ + Config: cloudflare.F(cloudflare.DeviceNetworkReplaceParamsConfig{ + Sha256: cloudflare.F("b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"), + TLSSockaddr: cloudflare.F("foo.bar:1234"), + }), + Name: cloudflare.F("managed-network-1"), + Type: cloudflare.F(cloudflare.DeviceNetworkReplaceParamsTypeTLS), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/deviceoverridecode.go b/deviceoverridecode.go index bb9898370bf..b161c82cac5 100644 --- a/deviceoverridecode.go +++ b/deviceoverridecode.go @@ -32,9 +32,9 @@ func NewDeviceOverrideCodeService(opts ...option.RequestOption) (r *DeviceOverri // Fetches a one-time use admin override code for a device. This relies on the // **Admin Override** setting being enabled in your device configuration. -func (r *DeviceOverrideCodeService) DevicesListAdminOverrideCodeForDevice(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse, err error) { +func (r *DeviceOverrideCodeService) List(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DeviceOverrideCodeListResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelope + var env DeviceOverrideCodeListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/%s/override_codes", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,25 +44,24 @@ func (r *DeviceOverrideCodeService) DevicesListAdminOverrideCodeForDevice(ctx co return } -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse struct { - DisableForTime DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTime `json:"disable_for_time"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseJSON `json:"-"` +type DeviceOverrideCodeListResponse struct { + DisableForTime DeviceOverrideCodeListResponseDisableForTime `json:"disable_for_time"` + JSON deviceOverrideCodeListResponseJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseJSON contains the -// JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseJSON struct { +// deviceOverrideCodeListResponseJSON contains the JSON metadata for the struct +// [DeviceOverrideCodeListResponse] +type deviceOverrideCodeListResponseJSON struct { DisableForTime apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTime struct { +type DeviceOverrideCodeListResponseDisableForTime struct { // Override code that is valid for 1 hour. Number1 interface{} `json:"1"` // Override code that is valid for 12 hour2. @@ -72,14 +71,13 @@ type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTi // Override code that is valid for 3 hours. Number3 interface{} `json:"3"` // Override code that is valid for 6 hours. - Number6 interface{} `json:"6"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTimeJSON `json:"-"` + Number6 interface{} `json:"6"` + JSON deviceOverrideCodeListResponseDisableForTimeJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTimeJSON -// contains the JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTime] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTimeJSON struct { +// deviceOverrideCodeListResponseDisableForTimeJSON contains the JSON metadata for +// the struct [DeviceOverrideCodeListResponseDisableForTime] +type deviceOverrideCodeListResponseDisableForTimeJSON struct { Number1 apijson.Field Number12 apijson.Field Number24 apijson.Field @@ -89,24 +87,23 @@ type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTi ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseDisableForTime) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponseDisableForTime) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelope struct { - Errors []DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessages `json:"messages,required"` - Result DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponse `json:"result,required,nullable"` +type DeviceOverrideCodeListResponseEnvelope struct { + Errors []DeviceOverrideCodeListResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceOverrideCodeListResponseEnvelopeMessages `json:"messages,required"` + Result DeviceOverrideCodeListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfo `json:"result_info"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeJSON `json:"-"` + Success DeviceOverrideCodeListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DeviceOverrideCodeListResponseEnvelopeResultInfo `json:"result_info"` + JSON deviceOverrideCodeListResponseEnvelopeJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelope] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeJSON struct { +// deviceOverrideCodeListResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceOverrideCodeListResponseEnvelope] +type deviceOverrideCodeListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -116,58 +113,56 @@ type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrorsJSON `json:"-"` +type DeviceOverrideCodeListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceOverrideCodeListResponseEnvelopeErrorsJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrors] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrorsJSON struct { +// deviceOverrideCodeListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DeviceOverrideCodeListResponseEnvelopeErrors] +type deviceOverrideCodeListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessagesJSON `json:"-"` +type DeviceOverrideCodeListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceOverrideCodeListResponseEnvelopeMessagesJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessages] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessagesJSON struct { +// deviceOverrideCodeListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DeviceOverrideCodeListResponseEnvelopeMessages] +type deviceOverrideCodeListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeSuccess bool +type DeviceOverrideCodeListResponseEnvelopeSuccess bool const ( - DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeSuccessTrue DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeSuccess = true + DeviceOverrideCodeListResponseEnvelopeSuccessTrue DeviceOverrideCodeListResponseEnvelopeSuccess = true ) -type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfo struct { +type DeviceOverrideCodeListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -175,14 +170,13 @@ type DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResu // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON deviceOverrideCodeListResponseEnvelopeResultInfoJSON `json:"-"` } -// deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfo] -type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfoJSON struct { +// deviceOverrideCodeListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [DeviceOverrideCodeListResponseEnvelopeResultInfo] +type deviceOverrideCodeListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -191,6 +185,6 @@ type deviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResu ExtraFields map[string]apijson.Field } -func (r *DeviceOverrideCodeDevicesListAdminOverrideCodeForDeviceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceOverrideCodeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/deviceoverridecode_test.go b/deviceoverridecode_test.go index d8c7c1fe96f..870412ff116 100644 --- a/deviceoverridecode_test.go +++ b/deviceoverridecode_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceOverrideCodeDevicesListAdminOverrideCodeForDevice(t *testing.T) { +func TestDeviceOverrideCodeList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDeviceOverrideCodeDevicesListAdminOverrideCodeForDevice(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.OverrideCodes.DevicesListAdminOverrideCodeForDevice( + _, err := client.Devices.OverrideCodes.List( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/devicepolicy.go b/devicepolicy.go index e6a8649d013..b5345ed8274 100644 --- a/devicepolicy.go +++ b/devicepolicy.go @@ -20,6 +20,7 @@ import ( // instead. type DevicePolicyService struct { Options []option.RequestOption + DefaultPolicy *DevicePolicyDefaultPolicyService Excludes *DevicePolicyExcludeService FallbackDomains *DevicePolicyFallbackDomainService Includes *DevicePolicyIncludeService @@ -31,44 +32,18 @@ type DevicePolicyService struct { func NewDevicePolicyService(opts ...option.RequestOption) (r *DevicePolicyService) { r = &DevicePolicyService{} r.Options = opts + r.DefaultPolicy = NewDevicePolicyDefaultPolicyService(opts...) r.Excludes = NewDevicePolicyExcludeService(opts...) r.FallbackDomains = NewDevicePolicyFallbackDomainService(opts...) r.Includes = NewDevicePolicyIncludeService(opts...) return } -// Updates a configured device settings profile. -func (r *DevicePolicyService) Update(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyUpdateParams, opts ...option.RequestOption) (res *[]DevicePolicyUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes a device settings profile and fetches a list of the remaining profiles -// for an account. -func (r *DevicePolicyService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Creates a device settings profile to be applied to certain devices matching the // criteria. -func (r *DevicePolicyService) DevicesNewDeviceSettingsPolicy(ctx context.Context, identifier interface{}, body DevicePolicyDevicesNewDeviceSettingsPolicyParams, opts ...option.RequestOption) (res *[]DevicePolicyDevicesNewDeviceSettingsPolicyResponse, err error) { +func (r *DevicePolicyService) New(ctx context.Context, identifier interface{}, body DevicePolicyNewParams, opts ...option.RequestOption) (res *[]DevicePolicyNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelope + var env DevicePolicyNewResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -78,12 +53,12 @@ func (r *DevicePolicyService) DevicesNewDeviceSettingsPolicy(ctx context.Context return } -// Fetches the default device settings profile for an account. -func (r *DevicePolicyService) DevicesGetDefaultDeviceSettingsPolicy(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponse, err error) { +// Updates a configured device settings profile. +func (r *DevicePolicyService) Update(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyUpdateParams, opts ...option.RequestOption) (res *[]DevicePolicyUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env DevicePolicyUpdateResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/policy/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -92,9 +67,9 @@ func (r *DevicePolicyService) DevicesGetDefaultDeviceSettingsPolicy(ctx context. } // Fetches a list of the device settings profiles for an account. -func (r *DevicePolicyService) DevicesListDeviceSettingsPolicies(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyDevicesListDeviceSettingsPoliciesResponse, err error) { +func (r *DevicePolicyService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyListResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelope + var env DevicePolicyListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policies", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -104,12 +79,13 @@ func (r *DevicePolicyService) DevicesListDeviceSettingsPolicies(ctx context.Cont return } -// Updates the default device settings profile for an account. -func (r *DevicePolicyService) DevicesUpdateDefaultDeviceSettingsPolicy(ctx context.Context, identifier interface{}, body DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParams, opts ...option.RequestOption) (res *[]DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponse, err error) { +// Deletes a device settings profile and fetches a list of the remaining profiles +// for an account. +func (r *DevicePolicyService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env DevicePolicyDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/policy/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -130,9 +106,11 @@ func (r *DevicePolicyService) Get(ctx context.Context, identifier interface{}, u return } +type DevicePolicyNewResponse = interface{} + type DevicePolicyUpdateResponse = interface{} -type DevicePolicyDeleteResponse struct { +type DevicePolicyListResponse struct { // Whether to allow the user to switch WARP between modes. AllowModeSwitch bool `json:"allow_mode_switch"` // Whether to receive update notifications when a new version of the client is @@ -153,13 +131,13 @@ type DevicePolicyDeleteResponse struct { // option is set to `true`. DisableAutoFallback bool `json:"disable_auto_fallback"` // Whether the policy will be applied to matching devices. - Enabled bool `json:"enabled"` - Exclude []DevicePolicyDeleteResponseExclude `json:"exclude"` + Enabled bool `json:"enabled"` + Exclude []DevicePolicyListResponseExclude `json:"exclude"` // Whether to add Microsoft IPs to Split Tunnel exclusions. - ExcludeOfficeIPs bool `json:"exclude_office_ips"` - FallbackDomains []DevicePolicyDeleteResponseFallbackDomain `json:"fallback_domains"` - GatewayUniqueID string `json:"gateway_unique_id"` - Include []DevicePolicyDeleteResponseInclude `json:"include"` + ExcludeOfficeIPs bool `json:"exclude_office_ips"` + FallbackDomains []DevicePolicyListResponseFallbackDomain `json:"fallback_domains"` + GatewayUniqueID string `json:"gateway_unique_id"` + Include []DevicePolicyListResponseInclude `json:"include"` // The amount of time in minutes a user is allowed access to their LAN. A value of // 0 will allow LAN access until the next WARP reconnection, such as a reboot or a // laptop waking from sleep. Note that this field is omitted from the response if @@ -176,18 +154,18 @@ type DevicePolicyDeleteResponse struct { PolicyID string `json:"policy_id"` // The precedence of the policy. Lower values indicate higher precedence. Policies // will be evaluated in ascending order of this field. - Precedence float64 `json:"precedence"` - ServiceModeV2 DevicePolicyDeleteResponseServiceModeV2 `json:"service_mode_v2"` + Precedence float64 `json:"precedence"` + ServiceModeV2 DevicePolicyListResponseServiceModeV2 `json:"service_mode_v2"` // The URL to launch when the Send Feedback button is clicked. SupportURL string `json:"support_url"` // Whether to allow the user to turn off the WARP switch and disconnect the client. - SwitchLocked bool `json:"switch_locked"` - JSON devicePolicyDeleteResponseJSON `json:"-"` + SwitchLocked bool `json:"switch_locked"` + JSON devicePolicyListResponseJSON `json:"-"` } -// devicePolicyDeleteResponseJSON contains the JSON metadata for the struct -// [DevicePolicyDeleteResponse] -type devicePolicyDeleteResponseJSON struct { +// devicePolicyListResponseJSON contains the JSON metadata for the struct +// [DevicePolicyListResponse] +type devicePolicyListResponseJSON struct { AllowModeSwitch apijson.Field AllowUpdates apijson.Field AllowedToLeave apijson.Field @@ -215,11 +193,11 @@ type devicePolicyDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDeleteResponseExclude struct { +type DevicePolicyListResponseExclude struct { // The address in CIDR format to exclude from the tunnel. If `address` is present, // `host` must not be present. Address string `json:"address,required"` @@ -227,13 +205,13 @@ type DevicePolicyDeleteResponseExclude struct { Description string `json:"description,required"` // The domain name to exclude from the tunnel. If `host` is present, `address` must // not be present. - Host string `json:"host"` - JSON devicePolicyDeleteResponseExcludeJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyListResponseExcludeJSON `json:"-"` } -// devicePolicyDeleteResponseExcludeJSON contains the JSON metadata for the struct -// [DevicePolicyDeleteResponseExclude] -type devicePolicyDeleteResponseExcludeJSON struct { +// devicePolicyListResponseExcludeJSON contains the JSON metadata for the struct +// [DevicePolicyListResponseExclude] +type devicePolicyListResponseExcludeJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -241,23 +219,23 @@ type devicePolicyDeleteResponseExcludeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseExclude) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseExclude) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDeleteResponseFallbackDomain struct { +type DevicePolicyListResponseFallbackDomain struct { // The domain suffix to match when resolving locally. Suffix string `json:"suffix,required"` // A description of the fallback domain, displayed in the client UI. Description string `json:"description"` // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyDeleteResponseFallbackDomainJSON `json:"-"` + DNSServer []interface{} `json:"dns_server"` + JSON devicePolicyListResponseFallbackDomainJSON `json:"-"` } -// devicePolicyDeleteResponseFallbackDomainJSON contains the JSON metadata for the -// struct [DevicePolicyDeleteResponseFallbackDomain] -type devicePolicyDeleteResponseFallbackDomainJSON struct { +// devicePolicyListResponseFallbackDomainJSON contains the JSON metadata for the +// struct [DevicePolicyListResponseFallbackDomain] +type devicePolicyListResponseFallbackDomainJSON struct { Suffix apijson.Field Description apijson.Field DNSServer apijson.Field @@ -265,11 +243,11 @@ type devicePolicyDeleteResponseFallbackDomainJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseFallbackDomain) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseFallbackDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDeleteResponseInclude struct { +type DevicePolicyListResponseInclude struct { // The address in CIDR format to include in the tunnel. If address is present, host // must not be present. Address string `json:"address,required"` @@ -277,13 +255,13 @@ type DevicePolicyDeleteResponseInclude struct { Description string `json:"description,required"` // The domain name to include in the tunnel. If host is present, address must not // be present. - Host string `json:"host"` - JSON devicePolicyDeleteResponseIncludeJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyListResponseIncludeJSON `json:"-"` } -// devicePolicyDeleteResponseIncludeJSON contains the JSON metadata for the struct -// [DevicePolicyDeleteResponseInclude] -type devicePolicyDeleteResponseIncludeJSON struct { +// devicePolicyListResponseIncludeJSON contains the JSON metadata for the struct +// [DevicePolicyListResponseInclude] +type devicePolicyListResponseIncludeJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -291,36 +269,32 @@ type devicePolicyDeleteResponseIncludeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseInclude) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseInclude) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDeleteResponseServiceModeV2 struct { +type DevicePolicyListResponseServiceModeV2 struct { // The mode to run the WARP client under. Mode string `json:"mode"` // The port number when used with proxy mode. - Port float64 `json:"port"` - JSON devicePolicyDeleteResponseServiceModeV2JSON `json:"-"` + Port float64 `json:"port"` + JSON devicePolicyListResponseServiceModeV2JSON `json:"-"` } -// devicePolicyDeleteResponseServiceModeV2JSON contains the JSON metadata for the -// struct [DevicePolicyDeleteResponseServiceModeV2] -type devicePolicyDeleteResponseServiceModeV2JSON struct { +// devicePolicyListResponseServiceModeV2JSON contains the JSON metadata for the +// struct [DevicePolicyListResponseServiceModeV2] +type devicePolicyListResponseServiceModeV2JSON struct { Mode apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseServiceModeV2) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseServiceModeV2) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesNewDeviceSettingsPolicyResponse = interface{} - -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponse = interface{} - -type DevicePolicyDevicesListDeviceSettingsPoliciesResponse struct { +type DevicePolicyDeleteResponse struct { // Whether to allow the user to switch WARP between modes. AllowModeSwitch bool `json:"allow_mode_switch"` // Whether to receive update notifications when a new version of the client is @@ -341,13 +315,13 @@ type DevicePolicyDevicesListDeviceSettingsPoliciesResponse struct { // option is set to `true`. DisableAutoFallback bool `json:"disable_auto_fallback"` // Whether the policy will be applied to matching devices. - Enabled bool `json:"enabled"` - Exclude []DevicePolicyDevicesListDeviceSettingsPoliciesResponseExclude `json:"exclude"` + Enabled bool `json:"enabled"` + Exclude []DevicePolicyDeleteResponseExclude `json:"exclude"` // Whether to add Microsoft IPs to Split Tunnel exclusions. - ExcludeOfficeIPs bool `json:"exclude_office_ips"` - FallbackDomains []DevicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomain `json:"fallback_domains"` - GatewayUniqueID string `json:"gateway_unique_id"` - Include []DevicePolicyDevicesListDeviceSettingsPoliciesResponseInclude `json:"include"` + ExcludeOfficeIPs bool `json:"exclude_office_ips"` + FallbackDomains []DevicePolicyDeleteResponseFallbackDomain `json:"fallback_domains"` + GatewayUniqueID string `json:"gateway_unique_id"` + Include []DevicePolicyDeleteResponseInclude `json:"include"` // The amount of time in minutes a user is allowed access to their LAN. A value of // 0 will allow LAN access until the next WARP reconnection, such as a reboot or a // laptop waking from sleep. Note that this field is omitted from the response if @@ -364,18 +338,18 @@ type DevicePolicyDevicesListDeviceSettingsPoliciesResponse struct { PolicyID string `json:"policy_id"` // The precedence of the policy. Lower values indicate higher precedence. Policies // will be evaluated in ascending order of this field. - Precedence float64 `json:"precedence"` - ServiceModeV2 DevicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2 `json:"service_mode_v2"` + Precedence float64 `json:"precedence"` + ServiceModeV2 DevicePolicyDeleteResponseServiceModeV2 `json:"service_mode_v2"` // The URL to launch when the Send Feedback button is clicked. SupportURL string `json:"support_url"` // Whether to allow the user to turn off the WARP switch and disconnect the client. - SwitchLocked bool `json:"switch_locked"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseJSON `json:"-"` + SwitchLocked bool `json:"switch_locked"` + JSON devicePolicyDeleteResponseJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseJSON contains the JSON -// metadata for the struct [DevicePolicyDevicesListDeviceSettingsPoliciesResponse] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseJSON struct { +// devicePolicyDeleteResponseJSON contains the JSON metadata for the struct +// [DevicePolicyDeleteResponse] +type devicePolicyDeleteResponseJSON struct { AllowModeSwitch apijson.Field AllowUpdates apijson.Field AllowedToLeave apijson.Field @@ -403,11 +377,11 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseExclude struct { +type DevicePolicyDeleteResponseExclude struct { // The address in CIDR format to exclude from the tunnel. If `address` is present, // `host` must not be present. Address string `json:"address,required"` @@ -415,14 +389,13 @@ type DevicePolicyDevicesListDeviceSettingsPoliciesResponseExclude struct { Description string `json:"description,required"` // The domain name to exclude from the tunnel. If `host` is present, `address` must // not be present. - Host string `json:"host"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseExcludeJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyDeleteResponseExcludeJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseExcludeJSON contains the -// JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseExclude] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseExcludeJSON struct { +// devicePolicyDeleteResponseExcludeJSON contains the JSON metadata for the struct +// [DevicePolicyDeleteResponseExclude] +type devicePolicyDeleteResponseExcludeJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -430,24 +403,23 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseExcludeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseExclude) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseExclude) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomain struct { +type DevicePolicyDeleteResponseFallbackDomain struct { // The domain suffix to match when resolving locally. Suffix string `json:"suffix,required"` // A description of the fallback domain, displayed in the client UI. Description string `json:"description"` // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomainJSON `json:"-"` + DNSServer []interface{} `json:"dns_server"` + JSON devicePolicyDeleteResponseFallbackDomainJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomainJSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomain] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomainJSON struct { +// devicePolicyDeleteResponseFallbackDomainJSON contains the JSON metadata for the +// struct [DevicePolicyDeleteResponseFallbackDomain] +type devicePolicyDeleteResponseFallbackDomainJSON struct { Suffix apijson.Field Description apijson.Field DNSServer apijson.Field @@ -455,11 +427,11 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomainJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseFallbackDomain) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseFallbackDomain) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseInclude struct { +type DevicePolicyDeleteResponseInclude struct { // The address in CIDR format to include in the tunnel. If address is present, host // must not be present. Address string `json:"address,required"` @@ -467,14 +439,13 @@ type DevicePolicyDevicesListDeviceSettingsPoliciesResponseInclude struct { Description string `json:"description,required"` // The domain name to include in the tunnel. If host is present, address must not // be present. - Host string `json:"host"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseIncludeJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyDeleteResponseIncludeJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseIncludeJSON contains the -// JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseInclude] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseIncludeJSON struct { +// devicePolicyDeleteResponseIncludeJSON contains the JSON metadata for the struct +// [DevicePolicyDeleteResponseInclude] +type devicePolicyDeleteResponseIncludeJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -482,37 +453,41 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseIncludeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseInclude) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseInclude) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2 struct { +type DevicePolicyDeleteResponseServiceModeV2 struct { // The mode to run the WARP client under. Mode string `json:"mode"` // The port number when used with proxy mode. - Port float64 `json:"port"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2JSON `json:"-"` + Port float64 `json:"port"` + JSON devicePolicyDeleteResponseServiceModeV2JSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2JSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2JSON struct { +// devicePolicyDeleteResponseServiceModeV2JSON contains the JSON metadata for the +// struct [DevicePolicyDeleteResponseServiceModeV2] +type devicePolicyDeleteResponseServiceModeV2JSON struct { Mode apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseServiceModeV2) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseServiceModeV2) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponse = interface{} - type DevicePolicyGetResponse = interface{} -type DevicePolicyUpdateParams struct { +type DevicePolicyNewParams struct { + // The wirefilter expression to match devices. + Match param.Field[string] `json:"match,required"` + // The name of the device settings profile. + Name param.Field[string] `json:"name,required"` + // The precedence of the policy. Lower values indicate higher precedence. Policies + // will be evaluated in ascending order of this field. + Precedence param.Field[float64] `json:"precedence,required"` // Whether to allow the user to switch WARP between modes. AllowModeSwitch param.Field[bool] `json:"allow_mode_switch"` // Whether to receive update notifications when a new version of the client is @@ -534,48 +509,49 @@ type DevicePolicyUpdateParams struct { Enabled param.Field[bool] `json:"enabled"` // Whether to add Microsoft IPs to Split Tunnel exclusions. ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"` - // The wirefilter expression to match devices. - Match param.Field[string] `json:"match"` - // The name of the device settings profile. - Name param.Field[string] `json:"name"` - // The precedence of the policy. Lower values indicate higher precedence. Policies - // will be evaluated in ascending order of this field. - Precedence param.Field[float64] `json:"precedence"` - ServiceModeV2 param.Field[DevicePolicyUpdateParamsServiceModeV2] `json:"service_mode_v2"` + // The amount of time in minutes a user is allowed access to their LAN. A value of + // 0 will allow LAN access until the next WARP reconnection, such as a reboot or a + // laptop waking from sleep. Note that this field is omitted from the response if + // null or unset. + LanAllowMinutes param.Field[float64] `json:"lan_allow_minutes"` + // The size of the subnet for the local access network. Note that this field is + // omitted from the response if null or unset. + LanAllowSubnetSize param.Field[float64] `json:"lan_allow_subnet_size"` + ServiceModeV2 param.Field[DevicePolicyNewParamsServiceModeV2] `json:"service_mode_v2"` // The URL to launch when the Send Feedback button is clicked. SupportURL param.Field[string] `json:"support_url"` // Whether to allow the user to turn off the WARP switch and disconnect the client. SwitchLocked param.Field[bool] `json:"switch_locked"` } -func (r DevicePolicyUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyUpdateParamsServiceModeV2 struct { +type DevicePolicyNewParamsServiceModeV2 struct { // The mode to run the WARP client under. Mode param.Field[string] `json:"mode"` // The port number when used with proxy mode. Port param.Field[float64] `json:"port"` } -func (r DevicePolicyUpdateParamsServiceModeV2) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyNewParamsServiceModeV2) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyUpdateResponseEnvelope struct { - Errors []DevicePolicyUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyUpdateResponse `json:"result,required,nullable"` +type DevicePolicyNewResponseEnvelope struct { + Errors []DevicePolicyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyNewResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyUpdateResponseEnvelopeJSON `json:"-"` + Success DevicePolicyNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyNewResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyNewResponseEnvelopeJSON `json:"-"` } -// devicePolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [DevicePolicyUpdateResponseEnvelope] -type devicePolicyUpdateResponseEnvelopeJSON struct { +// devicePolicyNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePolicyNewResponseEnvelope] +type devicePolicyNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -585,154 +561,56 @@ type devicePolicyUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DevicePolicyUpdateResponseEnvelopeErrors] -type devicePolicyUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DevicePolicyUpdateResponseEnvelopeMessages] -type devicePolicyUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyUpdateResponseEnvelopeSuccess bool - -const ( - DevicePolicyUpdateResponseEnvelopeSuccessTrue DevicePolicyUpdateResponseEnvelopeSuccess = true -) - -type DevicePolicyUpdateResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyUpdateResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [DevicePolicyUpdateResponseEnvelopeResultInfo] -type devicePolicyUpdateResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyDeleteResponseEnvelope struct { - Errors []DevicePolicyDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyDeleteResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyDeleteResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyDeleteResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [DevicePolicyDeleteResponseEnvelope] -type devicePolicyDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDeleteResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyNewResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DevicePolicyDeleteResponseEnvelopeErrors] -type devicePolicyDeleteResponseEnvelopeErrorsJSON struct { +// devicePolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePolicyNewResponseEnvelopeErrors] +type devicePolicyNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDeleteResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyNewResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DevicePolicyDeleteResponseEnvelopeMessages] -type devicePolicyDeleteResponseEnvelopeMessagesJSON struct { +// devicePolicyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DevicePolicyNewResponseEnvelopeMessages] +type devicePolicyNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyDeleteResponseEnvelopeSuccess bool +type DevicePolicyNewResponseEnvelopeSuccess bool const ( - DevicePolicyDeleteResponseEnvelopeSuccessTrue DevicePolicyDeleteResponseEnvelopeSuccess = true + DevicePolicyNewResponseEnvelopeSuccessTrue DevicePolicyNewResponseEnvelopeSuccess = true ) -type DevicePolicyDeleteResponseEnvelopeResultInfo struct { +type DevicePolicyNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -740,13 +618,13 @@ type DevicePolicyDeleteResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyDeleteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyNewResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [DevicePolicyDeleteResponseEnvelopeResultInfo] -type devicePolicyDeleteResponseEnvelopeResultInfoJSON struct { +// devicePolicyNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [DevicePolicyNewResponseEnvelopeResultInfo] +type devicePolicyNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -755,18 +633,11 @@ type devicePolicyDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesNewDeviceSettingsPolicyParams struct { - // The wirefilter expression to match devices. - Match param.Field[string] `json:"match,required"` - // The name of the device settings profile. - Name param.Field[string] `json:"name,required"` - // The precedence of the policy. Lower values indicate higher precedence. Policies - // will be evaluated in ascending order of this field. - Precedence param.Field[float64] `json:"precedence,required"` +type DevicePolicyUpdateParams struct { // Whether to allow the user to switch WARP between modes. AllowModeSwitch param.Field[bool] `json:"allow_mode_switch"` // Whether to receive update notifications when a new version of the client is @@ -788,152 +659,48 @@ type DevicePolicyDevicesNewDeviceSettingsPolicyParams struct { Enabled param.Field[bool] `json:"enabled"` // Whether to add Microsoft IPs to Split Tunnel exclusions. ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"` - // The amount of time in minutes a user is allowed access to their LAN. A value of - // 0 will allow LAN access until the next WARP reconnection, such as a reboot or a - // laptop waking from sleep. Note that this field is omitted from the response if - // null or unset. - LanAllowMinutes param.Field[float64] `json:"lan_allow_minutes"` - // The size of the subnet for the local access network. Note that this field is - // omitted from the response if null or unset. - LanAllowSubnetSize param.Field[float64] `json:"lan_allow_subnet_size"` - ServiceModeV2 param.Field[DevicePolicyDevicesNewDeviceSettingsPolicyParamsServiceModeV2] `json:"service_mode_v2"` + // The wirefilter expression to match devices. + Match param.Field[string] `json:"match"` + // The name of the device settings profile. + Name param.Field[string] `json:"name"` + // The precedence of the policy. Lower values indicate higher precedence. Policies + // will be evaluated in ascending order of this field. + Precedence param.Field[float64] `json:"precedence"` + ServiceModeV2 param.Field[DevicePolicyUpdateParamsServiceModeV2] `json:"service_mode_v2"` // The URL to launch when the Send Feedback button is clicked. SupportURL param.Field[string] `json:"support_url"` // Whether to allow the user to turn off the WARP switch and disconnect the client. SwitchLocked param.Field[bool] `json:"switch_locked"` } -func (r DevicePolicyDevicesNewDeviceSettingsPolicyParams) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyDevicesNewDeviceSettingsPolicyParamsServiceModeV2 struct { +type DevicePolicyUpdateParamsServiceModeV2 struct { // The mode to run the WARP client under. Mode param.Field[string] `json:"mode"` // The port number when used with proxy mode. Port param.Field[float64] `json:"port"` } -func (r DevicePolicyDevicesNewDeviceSettingsPolicyParamsServiceModeV2) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyUpdateParamsServiceModeV2) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyDevicesNewDeviceSettingsPolicyResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelope] -type devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeSuccess bool - -const ( - DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeSuccess = true -) - -type DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyDevicesNewDeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponse `json:"result,required,nullable"` +type DevicePolicyUpdateResponseEnvelope struct { + Errors []DevicePolicyUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyUpdateResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` + Success DevicePolicyUpdateResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyUpdateResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyUpdateResponseEnvelopeJSON `json:"-"` } -// devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelope] -type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeJSON struct { +// devicePolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePolicyUpdateResponseEnvelope] +type devicePolicyUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -943,58 +710,56 @@ type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { +// devicePolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePolicyUpdateResponseEnvelopeErrors] +type devicePolicyUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { +// devicePolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DevicePolicyUpdateResponseEnvelopeMessages] +type devicePolicyUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeSuccess bool +type DevicePolicyUpdateResponseEnvelopeSuccess bool const ( - DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeSuccess = true + DevicePolicyUpdateResponseEnvelopeSuccessTrue DevicePolicyUpdateResponseEnvelopeSuccess = true ) -type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo struct { +type DevicePolicyUpdateResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -1002,14 +767,13 @@ type DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyUpdateResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { +// devicePolicyUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DevicePolicyUpdateResponseEnvelopeResultInfo] +type devicePolicyUpdateResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -1018,24 +782,23 @@ type devicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesGetDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelope struct { - Errors []DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyDevicesListDeviceSettingsPoliciesResponse `json:"result,required,nullable"` +type DevicePolicyListResponseEnvelope struct { + Errors []DevicePolicyListResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyListResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeJSON `json:"-"` + Success DevicePolicyListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyListResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyListResponseEnvelopeJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelope] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeJSON struct { +// devicePolicyListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePolicyListResponseEnvelope] +type devicePolicyListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1045,58 +808,56 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyListResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrors] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrorsJSON struct { +// devicePolicyListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePolicyListResponseEnvelopeErrors] +type devicePolicyListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyListResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessages] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessagesJSON struct { +// devicePolicyListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DevicePolicyListResponseEnvelopeMessages] +type devicePolicyListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeSuccess bool +type DevicePolicyListResponseEnvelopeSuccess bool const ( - DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeSuccessTrue DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeSuccess = true + DevicePolicyListResponseEnvelopeSuccessTrue DevicePolicyListResponseEnvelopeSuccess = true ) -type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfo struct { +type DevicePolicyListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -1104,14 +865,13 @@ type DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfo str // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyListResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfo] -type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfoJSON struct { +// devicePolicyListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DevicePolicyListResponseEnvelopeResultInfo] +type devicePolicyListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -1120,64 +880,23 @@ type devicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfoJSON ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesListDeviceSettingsPoliciesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParams struct { - // Whether to allow the user to switch WARP between modes. - AllowModeSwitch param.Field[bool] `json:"allow_mode_switch"` - // Whether to receive update notifications when a new version of the client is - // available. - AllowUpdates param.Field[bool] `json:"allow_updates"` - // Whether to allow devices to leave the organization. - AllowedToLeave param.Field[bool] `json:"allowed_to_leave"` - // The amount of time in minutes to reconnect after having been disabled. - AutoConnect param.Field[float64] `json:"auto_connect"` - // Turn on the captive portal after the specified amount of time. - CaptivePortal param.Field[float64] `json:"captive_portal"` - // If the `dns_server` field of a fallback domain is not present, the client will - // fall back to a best guess of the default/system DNS resolvers unless this policy - // option is set to `true`. - DisableAutoFallback param.Field[bool] `json:"disable_auto_fallback"` - // Whether to add Microsoft IPs to Split Tunnel exclusions. - ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"` - ServiceModeV2 param.Field[DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParamsServiceModeV2] `json:"service_mode_v2"` - // The URL to launch when the Send Feedback button is clicked. - SupportURL param.Field[string] `json:"support_url"` - // Whether to allow the user to turn off the WARP switch and disconnect the client. - SwitchLocked param.Field[bool] `json:"switch_locked"` -} - -func (r DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParamsServiceModeV2 struct { - // The mode to run the WARP client under. - Mode param.Field[string] `json:"mode"` - // The port number when used with proxy mode. - Port param.Field[float64] `json:"port"` -} - -func (r DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParamsServiceModeV2) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponse `json:"result,required,nullable"` +type DevicePolicyDeleteResponseEnvelope struct { + Errors []DevicePolicyDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyDeleteResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` + Success DevicePolicyDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyDeleteResponseEnvelopeJSON `json:"-"` } -// devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelope] -type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeJSON struct { +// devicePolicyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePolicyDeleteResponseEnvelope] +type devicePolicyDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1187,58 +906,56 @@ type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeJSON st ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { +// devicePolicyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePolicyDeleteResponseEnvelopeErrors] +type devicePolicyDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { +// devicePolicyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DevicePolicyDeleteResponseEnvelopeMessages] +type devicePolicyDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeSuccess bool +type DevicePolicyDeleteResponseEnvelopeSuccess bool const ( - DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeSuccess = true + DevicePolicyDeleteResponseEnvelopeSuccessTrue DevicePolicyDeleteResponseEnvelopeSuccess = true ) -type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo struct { +type DevicePolicyDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -1246,14 +963,13 @@ type DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultI // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { +// devicePolicyDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DevicePolicyDeleteResponseEnvelopeResultInfo] +type devicePolicyDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -1262,7 +978,7 @@ type devicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultI ExtraFields map[string]apijson.Field } -func (r *DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/devicepolicy_test.go b/devicepolicy_test.go index 1d72e0d825b..68b64c7963b 100644 --- a/devicepolicy_test.go +++ b/devicepolicy_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePolicyUpdateWithOptionalParams(t *testing.T) { +func TestDevicePolicyNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,13 @@ func TestDevicePolicyUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Update( + _, err := client.Devices.Policies.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePolicyUpdateParams{ + cloudflare.DevicePolicyNewParams{ + Match: cloudflare.F("user.identity == \"test@cloudflare.com\""), + Name: cloudflare.F("Allow Developers"), + Precedence: cloudflare.F(100.000000), AllowModeSwitch: cloudflare.F(true), AllowUpdates: cloudflare.F(true), AllowedToLeave: cloudflare.F(true), @@ -43,10 +45,9 @@ func TestDevicePolicyUpdateWithOptionalParams(t *testing.T) { DisableAutoFallback: cloudflare.F(true), Enabled: cloudflare.F(true), ExcludeOfficeIPs: cloudflare.F(true), - Match: cloudflare.F("user.identity == \"test@cloudflare.com\""), - Name: cloudflare.F("Allow Developers"), - Precedence: cloudflare.F(100.000000), - ServiceModeV2: cloudflare.F(cloudflare.DevicePolicyUpdateParamsServiceModeV2{ + LanAllowMinutes: cloudflare.F(30.000000), + LanAllowSubnetSize: cloudflare.F(24.000000), + ServiceModeV2: cloudflare.F(cloudflare.DevicePolicyNewParamsServiceModeV2{ Mode: cloudflare.F("proxy"), Port: cloudflare.F(3000.000000), }), @@ -63,7 +64,7 @@ func TestDevicePolicyUpdateWithOptionalParams(t *testing.T) { } } -func TestDevicePolicyDelete(t *testing.T) { +func TestDevicePolicyUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -79,43 +80,11 @@ func TestDevicePolicyDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Delete( + _, err := client.Devices.Policies.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyDevicesNewDeviceSettingsPolicyWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.DevicesNewDeviceSettingsPolicy( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePolicyDevicesNewDeviceSettingsPolicyParams{ - Match: cloudflare.F("user.identity == \"test@cloudflare.com\""), - Name: cloudflare.F("Allow Developers"), - Precedence: cloudflare.F(100.000000), + cloudflare.DevicePolicyUpdateParams{ AllowModeSwitch: cloudflare.F(true), AllowUpdates: cloudflare.F(true), AllowedToLeave: cloudflare.F(true), @@ -125,9 +94,10 @@ func TestDevicePolicyDevicesNewDeviceSettingsPolicyWithOptionalParams(t *testing DisableAutoFallback: cloudflare.F(true), Enabled: cloudflare.F(true), ExcludeOfficeIPs: cloudflare.F(true), - LanAllowMinutes: cloudflare.F(30.000000), - LanAllowSubnetSize: cloudflare.F(24.000000), - ServiceModeV2: cloudflare.F(cloudflare.DevicePolicyDevicesNewDeviceSettingsPolicyParamsServiceModeV2{ + Match: cloudflare.F("user.identity == \"test@cloudflare.com\""), + Name: cloudflare.F("Allow Developers"), + Precedence: cloudflare.F(100.000000), + ServiceModeV2: cloudflare.F(cloudflare.DevicePolicyUpdateParamsServiceModeV2{ Mode: cloudflare.F("proxy"), Port: cloudflare.F(3000.000000), }), @@ -144,7 +114,7 @@ func TestDevicePolicyDevicesNewDeviceSettingsPolicyWithOptionalParams(t *testing } } -func TestDevicePolicyDevicesGetDefaultDeviceSettingsPolicy(t *testing.T) { +func TestDevicePolicyList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -160,7 +130,7 @@ func TestDevicePolicyDevicesGetDefaultDeviceSettingsPolicy(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.DevicesGetDefaultDeviceSettingsPolicy(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Policies.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -170,33 +140,7 @@ func TestDevicePolicyDevicesGetDefaultDeviceSettingsPolicy(t *testing.T) { } } -func TestDevicePolicyDevicesListDeviceSettingsPolicies(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.DevicesListDeviceSettingsPolicies(context.TODO(), "699d98642c564d2e855e9661899b7252") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyWithOptionalParams(t *testing.T) { +func TestDevicePolicyDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -212,24 +156,10 @@ func TestDevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyWithOptionalParams( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.DevicesUpdateDefaultDeviceSettingsPolicy( + _, err := client.Devices.Policies.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParams{ - AllowModeSwitch: cloudflare.F(true), - AllowUpdates: cloudflare.F(true), - AllowedToLeave: cloudflare.F(true), - AutoConnect: cloudflare.F(0.000000), - CaptivePortal: cloudflare.F(180.000000), - DisableAutoFallback: cloudflare.F(true), - ExcludeOfficeIPs: cloudflare.F(true), - ServiceModeV2: cloudflare.F(cloudflare.DevicePolicyDevicesUpdateDefaultDeviceSettingsPolicyParamsServiceModeV2{ - Mode: cloudflare.F("proxy"), - Port: cloudflare.F(3000.000000), - }), - SupportURL: cloudflare.F("https://1.1.1.1/help"), - SwitchLocked: cloudflare.F(true), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error diff --git a/devicepolicydefaultpolicy.go b/devicepolicydefaultpolicy.go new file mode 100644 index 00000000000..ca12f9974dc --- /dev/null +++ b/devicepolicydefaultpolicy.go @@ -0,0 +1,144 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// DevicePolicyDefaultPolicyService contains methods and other services that help +// with interacting with the cloudflare API. Note, unlike clients, this service +// does not read variables from the environment automatically. You should not +// instantiate this service directly, and instead use the +// [NewDevicePolicyDefaultPolicyService] method instead. +type DevicePolicyDefaultPolicyService struct { + Options []option.RequestOption +} + +// NewDevicePolicyDefaultPolicyService generates a new service that applies the +// given options to each request. These options are applied after the parent +// client's options (if there is one), and before any request-specific options. +func NewDevicePolicyDefaultPolicyService(opts ...option.RequestOption) (r *DevicePolicyDefaultPolicyService) { + r = &DevicePolicyDefaultPolicyService{} + r.Options = opts + return +} + +// Fetches the default device settings profile for an account. +func (r *DevicePolicyDefaultPolicyService) Get(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyDefaultPolicyGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env DevicePolicyDefaultPolicyGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/policy", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type DevicePolicyDefaultPolicyGetResponse = interface{} + +type DevicePolicyDefaultPolicyGetResponseEnvelope struct { + Errors []DevicePolicyDefaultPolicyGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyDefaultPolicyGetResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyDefaultPolicyGetResponse `json:"result,required,nullable"` + // Whether the API call was successful. + Success DevicePolicyDefaultPolicyGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyDefaultPolicyGetResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyDefaultPolicyGetResponseEnvelopeJSON `json:"-"` +} + +// devicePolicyDefaultPolicyGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [DevicePolicyDefaultPolicyGetResponseEnvelope] +type devicePolicyDefaultPolicyGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePolicyDefaultPolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePolicyDefaultPolicyGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyDefaultPolicyGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// devicePolicyDefaultPolicyGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [DevicePolicyDefaultPolicyGetResponseEnvelopeErrors] +type devicePolicyDefaultPolicyGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePolicyDefaultPolicyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePolicyDefaultPolicyGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyDefaultPolicyGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// devicePolicyDefaultPolicyGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePolicyDefaultPolicyGetResponseEnvelopeMessages] +type devicePolicyDefaultPolicyGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePolicyDefaultPolicyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type DevicePolicyDefaultPolicyGetResponseEnvelopeSuccess bool + +const ( + DevicePolicyDefaultPolicyGetResponseEnvelopeSuccessTrue DevicePolicyDefaultPolicyGetResponseEnvelopeSuccess = true +) + +type DevicePolicyDefaultPolicyGetResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON devicePolicyDefaultPolicyGetResponseEnvelopeResultInfoJSON `json:"-"` +} + +// devicePolicyDefaultPolicyGetResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [DevicePolicyDefaultPolicyGetResponseEnvelopeResultInfo] +type devicePolicyDefaultPolicyGetResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePolicyDefaultPolicyGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/alertingv3availablealert_test.go b/devicepolicydefaultpolicy_test.go similarity index 86% rename from alertingv3availablealert_test.go rename to devicepolicydefaultpolicy_test.go index 28ffdec1d03..ce425c15c80 100644 --- a/alertingv3availablealert_test.go +++ b/devicepolicydefaultpolicy_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAlertingV3AvailableAlertList(t *testing.T) { +func TestDevicePolicyDefaultPolicyGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestAlertingV3AvailableAlertList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Alerting.V3.AvailableAlerts.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Devices.Policies.DefaultPolicy.Get(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/devicepolicyexclude.go b/devicepolicyexclude.go index 2a508ff5ad6..5eac069fa59 100644 --- a/devicepolicyexclude.go +++ b/devicepolicyexclude.go @@ -32,9 +32,9 @@ func NewDevicePolicyExcludeService(opts ...option.RequestOption) (r *DevicePolic } // Fetches the list of routes excluded from the WARP client's tunnel. -func (r *DevicePolicyExcludeService) DevicesGetSplitTunnelExcludeList(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse, err error) { +func (r *DevicePolicyExcludeService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyExcludeListResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelope + var env DevicePolicyExcludeListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/exclude", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,24 +44,10 @@ func (r *DevicePolicyExcludeService) DevicesGetSplitTunnelExcludeList(ctx contex return } -// Fetches the list of routes excluded from the WARP client's tunnel for a specific -// device settings profile. -func (r *DevicePolicyExcludeService) DevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s/exclude", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Sets the list of routes excluded from the WARP client's tunnel. -func (r *DevicePolicyExcludeService) DevicesSetSplitTunnelExcludeList(ctx context.Context, identifier interface{}, body DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParams, opts ...option.RequestOption) (res *[]DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse, err error) { +func (r *DevicePolicyExcludeService) Replace(ctx context.Context, identifier interface{}, body DevicePolicyExcludeReplaceParams, opts ...option.RequestOption) (res *[]DevicePolicyExcludeReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelope + var env DevicePolicyExcludeReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/exclude", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -71,48 +57,7 @@ func (r *DevicePolicyExcludeService) DevicesSetSplitTunnelExcludeList(ctx contex return } -// Sets the list of routes excluded from the WARP client's tunnel for a specific -// device settings profile. -func (r *DevicePolicyExcludeService) DevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParams, opts ...option.RequestOption) (res *[]DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s/exclude", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse struct { - // The address in CIDR format to exclude from the tunnel. If `address` is present, - // `host` must not be present. - Address string `json:"address,required"` - // A description of the Split Tunnel item, displayed in the client UI. - Description string `json:"description,required"` - // The domain name to exclude from the tunnel. If `host` is present, `address` must - // not be present. - Host string `json:"host"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseJSON contains the -// JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseJSON struct { - Address apijson.Field - Description apijson.Field - Host apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse struct { +type DevicePolicyExcludeListResponse struct { // The address in CIDR format to exclude from the tunnel. If `address` is present, // `host` must not be present. Address string `json:"address,required"` @@ -120,14 +65,13 @@ type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy Description string `json:"description,required"` // The domain name to exclude from the tunnel. If `host` is present, `address` must // not be present. - Host string `json:"host"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyExcludeListResponseJSON `json:"-"` } -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON struct { +// devicePolicyExcludeListResponseJSON contains the JSON metadata for the struct +// [DevicePolicyExcludeListResponse] +type devicePolicyExcludeListResponseJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -135,11 +79,11 @@ type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse struct { +type DevicePolicyExcludeReplaceResponse struct { // The address in CIDR format to exclude from the tunnel. If `address` is present, // `host` must not be present. Address string `json:"address,required"` @@ -147,14 +91,13 @@ type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse struct { Description string `json:"description,required"` // The domain name to exclude from the tunnel. If `host` is present, `address` must // not be present. - Host string `json:"host"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyExcludeReplaceResponseJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseJSON contains the -// JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseJSON struct { +// devicePolicyExcludeReplaceResponseJSON contains the JSON metadata for the struct +// [DevicePolicyExcludeReplaceResponse] +type devicePolicyExcludeReplaceResponseJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -162,278 +105,23 @@ type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse struct { - // The address in CIDR format to exclude from the tunnel. If `address` is present, - // `host` must not be present. - Address string `json:"address,required"` - // A description of the Split Tunnel item, displayed in the client UI. - Description string `json:"description,required"` - // The domain name to exclude from the tunnel. If `host` is present, `address` must - // not be present. - Host string `json:"host"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON `json:"-"` -} - -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseJSON struct { - Address apijson.Field - Description apijson.Field - Host apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelope struct { - Errors []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelope] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrors] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessages] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeSuccess bool - -const ( - DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeSuccessTrue DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeSuccess = true -) - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfo] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess bool - -const ( - DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess = true -) - -type DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParams struct { - Body param.Field[[]DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParamsBody] `json:"body,required"` -} - -func (r DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParamsBody struct { - // The address in CIDR format to exclude from the tunnel. If `address` is present, - // `host` must not be present. - Address param.Field[string] `json:"address,required"` - // A description of the Split Tunnel item, displayed in the client UI. - Description param.Field[string] `json:"description,required"` - // The domain name to exclude from the tunnel. If `host` is present, `address` must - // not be present. - Host param.Field[string] `json:"host"` -} - -func (r DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParamsBody) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelope struct { - Errors []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponse `json:"result,required,nullable"` +type DevicePolicyExcludeListResponseEnvelope struct { + Errors []DevicePolicyExcludeListResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyExcludeListResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyExcludeListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeJSON `json:"-"` + Success DevicePolicyExcludeListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyExcludeListResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyExcludeListResponseEnvelopeJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelope] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeJSON struct { +// devicePolicyExcludeListResponseEnvelopeJSON contains the JSON metadata for the +// struct [DevicePolicyExcludeListResponseEnvelope] +type devicePolicyExcludeListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -443,58 +131,56 @@ type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyExcludeListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyExcludeListResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrors] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrorsJSON struct { +// devicePolicyExcludeListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DevicePolicyExcludeListResponseEnvelopeErrors] +type devicePolicyExcludeListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyExcludeListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyExcludeListResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessages] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessagesJSON struct { +// devicePolicyExcludeListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DevicePolicyExcludeListResponseEnvelopeMessages] +type devicePolicyExcludeListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeSuccess bool +type DevicePolicyExcludeListResponseEnvelopeSuccess bool const ( - DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeSuccessTrue DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeSuccess = true + DevicePolicyExcludeListResponseEnvelopeSuccessTrue DevicePolicyExcludeListResponseEnvelopeSuccess = true ) -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfo struct { +type DevicePolicyExcludeListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -502,14 +188,13 @@ type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultIn // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyExcludeListResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfo] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfoJSON struct { +// devicePolicyExcludeListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [DevicePolicyExcludeListResponseEnvelopeResultInfo] +type devicePolicyExcludeListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -518,19 +203,19 @@ type devicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultIn ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParams struct { - Body param.Field[[]DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParamsBody] `json:"body,required"` +type DevicePolicyExcludeReplaceParams struct { + Body param.Field[[]DevicePolicyExcludeReplaceParamsBody] `json:"body,required"` } -func (r DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParams) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyExcludeReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParamsBody struct { +type DevicePolicyExcludeReplaceParamsBody struct { // The address in CIDR format to exclude from the tunnel. If `address` is present, // `host` must not be present. Address param.Field[string] `json:"address,required"` @@ -541,24 +226,23 @@ type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy Host param.Field[string] `json:"host"` } -func (r DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParamsBody) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyExcludeReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` +type DevicePolicyExcludeReplaceResponseEnvelope struct { + Errors []DevicePolicyExcludeReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyExcludeReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyExcludeReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` + Success DevicePolicyExcludeReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyExcludeReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyExcludeReplaceResponseEnvelopeJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeJSON struct { +// devicePolicyExcludeReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [DevicePolicyExcludeReplaceResponseEnvelope] +type devicePolicyExcludeReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -568,58 +252,56 @@ type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyExcludeReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyExcludeReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { +// devicePolicyExcludeReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [DevicePolicyExcludeReplaceResponseEnvelopeErrors] +type devicePolicyExcludeReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyExcludeReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyExcludeReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { +// devicePolicyExcludeReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePolicyExcludeReplaceResponseEnvelopeMessages] +type devicePolicyExcludeReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess bool +type DevicePolicyExcludeReplaceResponseEnvelopeSuccess bool const ( - DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeSuccess = true + DevicePolicyExcludeReplaceResponseEnvelopeSuccessTrue DevicePolicyExcludeReplaceResponseEnvelopeSuccess = true ) -type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { +type DevicePolicyExcludeReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -627,14 +309,13 @@ type DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyExcludeReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { +// devicePolicyExcludeReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [DevicePolicyExcludeReplaceResponseEnvelopeResultInfo] +type devicePolicyExcludeReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -643,6 +324,6 @@ type devicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyExcludeReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/devicepolicyexclude_test.go b/devicepolicyexclude_test.go index 6279557d21e..1fd83a20f7d 100644 --- a/devicepolicyexclude_test.go +++ b/devicepolicyexclude_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePolicyExcludeDevicesGetSplitTunnelExcludeList(t *testing.T) { +func TestDevicePolicyExcludeList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDevicePolicyExcludeDevicesGetSplitTunnelExcludeList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Excludes.DevicesGetSplitTunnelExcludeList(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Policies.Excludes.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestDevicePolicyExcludeDevicesGetSplitTunnelExcludeList(t *testing.T) { } } -func TestDevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy(t *testing.T) { +func TestDevicePolicyExcludeReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,86 +55,11 @@ func TestDevicePolicyExcludeDevicesGetSplitTunnelExcludeListForADeviceSettingsPo option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Excludes.DevicesGetSplitTunnelExcludeListForADeviceSettingsPolicy( + _, err := client.Devices.Policies.Excludes.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyExcludeDevicesSetSplitTunnelExcludeList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.Excludes.DevicesSetSplitTunnelExcludeList( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListParamsBody{{ - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Exclude testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }, { - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Exclude testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }, { - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Exclude testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.Excludes.DevicesSetSplitTunnelExcludeListForADeviceSettingsPolicy( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyExcludeDevicesSetSplitTunnelExcludeListForADeviceSettingsPolicyParamsBody{{ + cloudflare.DevicePolicyExcludeReplaceParams{ + Body: cloudflare.F([]cloudflare.DevicePolicyExcludeReplaceParamsBody{{ Address: cloudflare.F("192.0.2.0/24"), Description: cloudflare.F("Exclude testing domains from the tunnel"), Host: cloudflare.F("*.example.com"), diff --git a/devicepolicyfallbackdomain.go b/devicepolicyfallbackdomain.go index 31cbda2bdfd..f3355c967eb 100644 --- a/devicepolicyfallbackdomain.go +++ b/devicepolicyfallbackdomain.go @@ -31,26 +31,12 @@ func NewDevicePolicyFallbackDomainService(opts ...option.RequestOption) (r *Devi return } -// Fetches a list of domains to bypass Gateway DNS resolution. These domains will -// use the specified local DNS resolver instead. -func (r *DevicePolicyFallbackDomainService) DevicesGetLocalDomainFallbackList(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/fallback_domains", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetches the list of domains to bypass Gateway DNS resolution from a specified // device settings profile. These domains will use the specified local DNS resolver // instead. -func (r *DevicePolicyFallbackDomainService) DevicesGetLocalDomainFallbackListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse, err error) { +func (r *DevicePolicyFallbackDomainService) List(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainListResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope + var env DevicePolicyFallbackDomainListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/%s/fallback_domains", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -60,26 +46,12 @@ func (r *DevicePolicyFallbackDomainService) DevicesGetLocalDomainFallbackListFor return } -// Sets the list of domains to bypass Gateway DNS resolution. These domains will -// use the specified local DNS resolver instead. -func (r *DevicePolicyFallbackDomainService) DevicesSetLocalDomainFallbackList(ctx context.Context, identifier interface{}, body DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParams, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/fallback_domains", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Sets the list of domains to bypass Gateway DNS resolution. These domains will // use the specified local DNS resolver instead. This will only apply to the // specified device settings profile. -func (r *DevicePolicyFallbackDomainService) DevicesSetLocalDomainFallbackListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParams, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse, err error) { +func (r *DevicePolicyFallbackDomainService) Replace(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyFallbackDomainReplaceParams, opts ...option.RequestOption) (res *[]DevicePolicyFallbackDomainReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope + var env DevicePolicyFallbackDomainReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/%s/fallback_domains", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -89,20 +61,19 @@ func (r *DevicePolicyFallbackDomainService) DevicesSetLocalDomainFallbackListFor return } -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse struct { +type DevicePolicyFallbackDomainListResponse struct { // The domain suffix to match when resolving locally. Suffix string `json:"suffix,required"` // A description of the fallback domain, displayed in the client UI. Description string `json:"description"` // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseJSON `json:"-"` + DNSServer []interface{} `json:"dns_server"` + JSON devicePolicyFallbackDomainListResponseJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseJSON contains -// the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseJSON struct { +// devicePolicyFallbackDomainListResponseJSON contains the JSON metadata for the +// struct [DevicePolicyFallbackDomainListResponse] +type devicePolicyFallbackDomainListResponseJSON struct { Suffix apijson.Field Description apijson.Field DNSServer apijson.Field @@ -110,24 +81,23 @@ type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse struct { +type DevicePolicyFallbackDomainReplaceResponse struct { // The domain suffix to match when resolving locally. Suffix string `json:"suffix,required"` // A description of the fallback domain, displayed in the client UI. Description string `json:"description"` // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON `json:"-"` + DNSServer []interface{} `json:"dns_server"` + JSON devicePolicyFallbackDomainReplaceResponseJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON struct { +// devicePolicyFallbackDomainReplaceResponseJSON contains the JSON metadata for the +// struct [DevicePolicyFallbackDomainReplaceResponse] +type devicePolicyFallbackDomainReplaceResponseJSON struct { Suffix apijson.Field Description apijson.Field DNSServer apijson.Field @@ -135,299 +105,23 @@ type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettin ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse struct { - // The domain suffix to match when resolving locally. - Suffix string `json:"suffix,required"` - // A description of the fallback domain, displayed in the client UI. - Description string `json:"description"` - // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseJSON contains -// the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseJSON struct { - Suffix apijson.Field - Description apijson.Field - DNSServer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse struct { - // The domain suffix to match when resolving locally. - Suffix string `json:"suffix,required"` - // A description of the fallback domain, displayed in the client UI. - Description string `json:"description"` - // A list of IP addresses to handle domain resolution. - DNSServer []interface{} `json:"dns_server"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseJSON struct { - Suffix apijson.Field - Description apijson.Field - DNSServer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelope struct { - Errors []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelope] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrors] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessages] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeSuccess bool - -const ( - DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeSuccess = true -) - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfo] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess bool - -const ( - DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess = true -) - -type DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParams struct { - Body param.Field[[]DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParamsBody] `json:"body,required"` -} - -func (r DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParamsBody struct { - // The domain suffix to match when resolving locally. - Suffix param.Field[string] `json:"suffix,required"` - // A description of the fallback domain, displayed in the client UI. - Description param.Field[string] `json:"description"` - // A list of IP addresses to handle domain resolution. - DNSServer param.Field[[]interface{}] `json:"dns_server"` -} - -func (r DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParamsBody) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope struct { - Errors []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponse `json:"result,required,nullable"` +type DevicePolicyFallbackDomainListResponseEnvelope struct { + Errors []DevicePolicyFallbackDomainListResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyFallbackDomainListResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyFallbackDomainListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeJSON `json:"-"` + Success DevicePolicyFallbackDomainListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyFallbackDomainListResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyFallbackDomainListResponseEnvelopeJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeJSON struct { +// devicePolicyFallbackDomainListResponseEnvelopeJSON contains the JSON metadata +// for the struct [DevicePolicyFallbackDomainListResponseEnvelope] +type devicePolicyFallbackDomainListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -437,58 +131,56 @@ type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyFallbackDomainListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyFallbackDomainListResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrors] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrorsJSON struct { +// devicePolicyFallbackDomainListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [DevicePolicyFallbackDomainListResponseEnvelopeErrors] +type devicePolicyFallbackDomainListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyFallbackDomainListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyFallbackDomainListResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessages] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessagesJSON struct { +// devicePolicyFallbackDomainListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePolicyFallbackDomainListResponseEnvelopeMessages] +type devicePolicyFallbackDomainListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeSuccess bool +type DevicePolicyFallbackDomainListResponseEnvelopeSuccess bool const ( - DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeSuccess = true + DevicePolicyFallbackDomainListResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainListResponseEnvelopeSuccess = true ) -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfo struct { +type DevicePolicyFallbackDomainListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -496,14 +188,14 @@ type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyFallbackDomainListResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfo] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfoJSON struct { +// devicePolicyFallbackDomainListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct +// [DevicePolicyFallbackDomainListResponseEnvelopeResultInfo] +type devicePolicyFallbackDomainListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -512,19 +204,19 @@ type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParams struct { - Body param.Field[[]DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParamsBody] `json:"body,required"` +type DevicePolicyFallbackDomainReplaceParams struct { + Body param.Field[[]DevicePolicyFallbackDomainReplaceParamsBody] `json:"body,required"` } -func (r DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParams) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyFallbackDomainReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParamsBody struct { +type DevicePolicyFallbackDomainReplaceParamsBody struct { // The domain suffix to match when resolving locally. Suffix param.Field[string] `json:"suffix,required"` // A description of the fallback domain, displayed in the client UI. @@ -533,24 +225,23 @@ type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettin DNSServer param.Field[[]interface{}] `json:"dns_server"` } -func (r DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParamsBody) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyFallbackDomainReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` +type DevicePolicyFallbackDomainReplaceResponseEnvelope struct { + Errors []DevicePolicyFallbackDomainReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyFallbackDomainReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyFallbackDomainReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` + Success DevicePolicyFallbackDomainReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyFallbackDomainReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyFallbackDomainReplaceResponseEnvelopeJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeJSON struct { +// devicePolicyFallbackDomainReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [DevicePolicyFallbackDomainReplaceResponseEnvelope] +type devicePolicyFallbackDomainReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -560,58 +251,58 @@ type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettin ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyFallbackDomainReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyFallbackDomainReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { +// devicePolicyFallbackDomainReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [DevicePolicyFallbackDomainReplaceResponseEnvelopeErrors] +type devicePolicyFallbackDomainReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyFallbackDomainReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyFallbackDomainReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { +// devicePolicyFallbackDomainReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [DevicePolicyFallbackDomainReplaceResponseEnvelopeMessages] +type devicePolicyFallbackDomainReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess bool +type DevicePolicyFallbackDomainReplaceResponseEnvelopeSuccess bool const ( - DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeSuccess = true + DevicePolicyFallbackDomainReplaceResponseEnvelopeSuccessTrue DevicePolicyFallbackDomainReplaceResponseEnvelopeSuccess = true ) -type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { +type DevicePolicyFallbackDomainReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -619,14 +310,14 @@ type DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettin // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyFallbackDomainReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { +// devicePolicyFallbackDomainReplaceResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [DevicePolicyFallbackDomainReplaceResponseEnvelopeResultInfo] +type devicePolicyFallbackDomainReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -635,6 +326,6 @@ type devicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettin ExtraFields map[string]apijson.Field } -func (r *DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyFallbackDomainReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/devicepolicyfallbackdomain_test.go b/devicepolicyfallbackdomain_test.go index 7dcd605875e..40dc266fbae 100644 --- a/devicepolicyfallbackdomain_test.go +++ b/devicepolicyfallbackdomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePolicyFallbackDomainDevicesGetLocalDomainFallbackList(t *testing.T) { +func TestDevicePolicyFallbackDomainList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,33 +29,7 @@ func TestDevicePolicyFallbackDomainDevicesGetLocalDomainFallbackList(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.FallbackDomains.DevicesGetLocalDomainFallbackList(context.TODO(), "699d98642c564d2e855e9661899b7252") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSettingsPolicy(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.FallbackDomains.DevicesGetLocalDomainFallbackListForADeviceSettingsPolicy( + _, err := client.Devices.Policies.FallbackDomains.List( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -69,51 +43,7 @@ func TestDevicePolicyFallbackDomainDevicesGetLocalDomainFallbackListForADeviceSe } } -func TestDevicePolicyFallbackDomainDevicesSetLocalDomainFallbackList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.FallbackDomains.DevicesSetLocalDomainFallbackList( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListParamsBody{{ - Description: cloudflare.F("Domain bypass for local development"), - DNSServer: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - Suffix: cloudflare.F("example.com"), - }, { - Description: cloudflare.F("Domain bypass for local development"), - DNSServer: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - Suffix: cloudflare.F("example.com"), - }, { - Description: cloudflare.F("Domain bypass for local development"), - DNSServer: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - Suffix: cloudflare.F("example.com"), - }}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicy(t *testing.T) { +func TestDevicePolicyFallbackDomainReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -129,12 +59,12 @@ func TestDevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSe option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.FallbackDomains.DevicesSetLocalDomainFallbackListForADeviceSettingsPolicy( + _, err := client.Devices.Policies.FallbackDomains.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyFallbackDomainDevicesSetLocalDomainFallbackListForADeviceSettingsPolicyParamsBody{{ + cloudflare.DevicePolicyFallbackDomainReplaceParams{ + Body: cloudflare.F([]cloudflare.DevicePolicyFallbackDomainReplaceParamsBody{{ Description: cloudflare.F("Domain bypass for local development"), DNSServer: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), Suffix: cloudflare.F("example.com"), diff --git a/devicepolicyinclude.go b/devicepolicyinclude.go index f62b3a38c72..5875445db94 100644 --- a/devicepolicyinclude.go +++ b/devicepolicyinclude.go @@ -32,9 +32,9 @@ func NewDevicePolicyIncludeService(opts ...option.RequestOption) (r *DevicePolic } // Fetches the list of routes included in the WARP client's tunnel. -func (r *DevicePolicyIncludeService) DevicesGetSplitTunnelIncludeList(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse, err error) { +func (r *DevicePolicyIncludeService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePolicyIncludeListResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelope + var env DevicePolicyIncludeListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/include", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,24 +44,10 @@ func (r *DevicePolicyIncludeService) DevicesGetSplitTunnelIncludeList(ctx contex return } -// Fetches the list of routes included in the WARP client's tunnel for a specific -// device settings profile. -func (r *DevicePolicyIncludeService) DevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *[]DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s/include", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Sets the list of routes included in the WARP client's tunnel. -func (r *DevicePolicyIncludeService) DevicesSetSplitTunnelIncludeList(ctx context.Context, identifier interface{}, body DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParams, opts ...option.RequestOption) (res *[]DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse, err error) { +func (r *DevicePolicyIncludeService) Replace(ctx context.Context, identifier interface{}, body DevicePolicyIncludeReplaceParams, opts ...option.RequestOption) (res *[]DevicePolicyIncludeReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelope + var env DevicePolicyIncludeReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/policy/include", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -71,48 +57,7 @@ func (r *DevicePolicyIncludeService) DevicesSetSplitTunnelIncludeList(ctx contex return } -// Sets the list of routes included in the WARP client's tunnel for a specific -// device settings profile. -func (r *DevicePolicyIncludeService) DevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy(ctx context.Context, identifier interface{}, uuid string, body DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParams, opts ...option.RequestOption) (res *[]DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/policy/%s/include", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse struct { - // The address in CIDR format to include in the tunnel. If address is present, host - // must not be present. - Address string `json:"address,required"` - // A description of the split tunnel item, displayed in the client UI. - Description string `json:"description,required"` - // The domain name to include in the tunnel. If host is present, address must not - // be present. - Host string `json:"host"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseJSON contains the -// JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseJSON struct { - Address apijson.Field - Description apijson.Field - Host apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse struct { +type DevicePolicyIncludeListResponse struct { // The address in CIDR format to include in the tunnel. If address is present, host // must not be present. Address string `json:"address,required"` @@ -120,14 +65,13 @@ type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy Description string `json:"description,required"` // The domain name to include in the tunnel. If host is present, address must not // be present. - Host string `json:"host"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyIncludeListResponseJSON `json:"-"` } -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON struct { +// devicePolicyIncludeListResponseJSON contains the JSON metadata for the struct +// [DevicePolicyIncludeListResponse] +type devicePolicyIncludeListResponseJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -135,11 +79,11 @@ type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse struct { +type DevicePolicyIncludeReplaceResponse struct { // The address in CIDR format to include in the tunnel. If address is present, host // must not be present. Address string `json:"address,required"` @@ -147,14 +91,13 @@ type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse struct { Description string `json:"description,required"` // The domain name to include in the tunnel. If host is present, address must not // be present. - Host string `json:"host"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseJSON `json:"-"` + Host string `json:"host"` + JSON devicePolicyIncludeReplaceResponseJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseJSON contains the -// JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseJSON struct { +// devicePolicyIncludeReplaceResponseJSON contains the JSON metadata for the struct +// [DevicePolicyIncludeReplaceResponse] +type devicePolicyIncludeReplaceResponseJSON struct { Address apijson.Field Description apijson.Field Host apijson.Field @@ -162,278 +105,23 @@ type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse struct { - // The address in CIDR format to include in the tunnel. If address is present, host - // must not be present. - Address string `json:"address,required"` - // A description of the split tunnel item, displayed in the client UI. - Description string `json:"description,required"` - // The domain name to include in the tunnel. If host is present, address must not - // be present. - Host string `json:"host"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON `json:"-"` -} - -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseJSON struct { - Address apijson.Field - Description apijson.Field - Host apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelope struct { - Errors []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelope] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrors] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessages] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeSuccess bool - -const ( - DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeSuccessTrue DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeSuccess = true -) - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfo] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess bool - -const ( - DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess = true -) - -type DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParams struct { - Body param.Field[[]DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParamsBody] `json:"body,required"` -} - -func (r DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParamsBody struct { - // The address in CIDR format to include in the tunnel. If address is present, host - // must not be present. - Address param.Field[string] `json:"address,required"` - // A description of the split tunnel item, displayed in the client UI. - Description param.Field[string] `json:"description,required"` - // The domain name to include in the tunnel. If host is present, address must not - // be present. - Host param.Field[string] `json:"host"` -} - -func (r DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParamsBody) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelope struct { - Errors []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponse `json:"result,required,nullable"` +type DevicePolicyIncludeListResponseEnvelope struct { + Errors []DevicePolicyIncludeListResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyIncludeListResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyIncludeListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeJSON `json:"-"` + Success DevicePolicyIncludeListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyIncludeListResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyIncludeListResponseEnvelopeJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelope] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeJSON struct { +// devicePolicyIncludeListResponseEnvelopeJSON contains the JSON metadata for the +// struct [DevicePolicyIncludeListResponseEnvelope] +type devicePolicyIncludeListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -443,58 +131,56 @@ type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyIncludeListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyIncludeListResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrors] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrorsJSON struct { +// devicePolicyIncludeListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DevicePolicyIncludeListResponseEnvelopeErrors] +type devicePolicyIncludeListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyIncludeListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyIncludeListResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessages] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessagesJSON struct { +// devicePolicyIncludeListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DevicePolicyIncludeListResponseEnvelopeMessages] +type devicePolicyIncludeListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeSuccess bool +type DevicePolicyIncludeListResponseEnvelopeSuccess bool const ( - DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeSuccessTrue DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeSuccess = true + DevicePolicyIncludeListResponseEnvelopeSuccessTrue DevicePolicyIncludeListResponseEnvelopeSuccess = true ) -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfo struct { +type DevicePolicyIncludeListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -502,14 +188,13 @@ type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultIn // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyIncludeListResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfo] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfoJSON struct { +// devicePolicyIncludeListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [DevicePolicyIncludeListResponseEnvelopeResultInfo] +type devicePolicyIncludeListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -518,19 +203,19 @@ type devicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultIn ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParams struct { - Body param.Field[[]DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParamsBody] `json:"body,required"` +type DevicePolicyIncludeReplaceParams struct { + Body param.Field[[]DevicePolicyIncludeReplaceParamsBody] `json:"body,required"` } -func (r DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParams) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyIncludeReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParamsBody struct { +type DevicePolicyIncludeReplaceParamsBody struct { // The address in CIDR format to include in the tunnel. If address is present, host // must not be present. Address param.Field[string] `json:"address,required"` @@ -541,24 +226,23 @@ type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy Host param.Field[string] `json:"host"` } -func (r DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParamsBody) MarshalJSON() (data []byte, err error) { +func (r DevicePolicyIncludeReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope struct { - Errors []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponse `json:"result,required,nullable"` +type DevicePolicyIncludeReplaceResponseEnvelope struct { + Errors []DevicePolicyIncludeReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePolicyIncludeReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePolicyIncludeReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON `json:"-"` + Success DevicePolicyIncludeReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePolicyIncludeReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePolicyIncludeReplaceResponseEnvelopeJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeJSON struct { +// devicePolicyIncludeReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [DevicePolicyIncludeReplaceResponseEnvelope] +type devicePolicyIncludeReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -568,58 +252,56 @@ type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON `json:"-"` +type DevicePolicyIncludeReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyIncludeReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrorsJSON struct { +// devicePolicyIncludeReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [DevicePolicyIncludeReplaceResponseEnvelopeErrors] +type devicePolicyIncludeReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON `json:"-"` +type DevicePolicyIncludeReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePolicyIncludeReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessagesJSON struct { +// devicePolicyIncludeReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePolicyIncludeReplaceResponseEnvelopeMessages] +type devicePolicyIncludeReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess bool +type DevicePolicyIncludeReplaceResponseEnvelopeSuccess bool const ( - DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccessTrue DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeSuccess = true + DevicePolicyIncludeReplaceResponseEnvelopeSuccessTrue DevicePolicyIncludeReplaceResponseEnvelopeSuccess = true ) -type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo struct { +type DevicePolicyIncludeReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -627,14 +309,13 @@ type DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON devicePolicyIncludeReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo] -type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfoJSON struct { +// devicePolicyIncludeReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [DevicePolicyIncludeReplaceResponseEnvelopeResultInfo] +type devicePolicyIncludeReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -643,6 +324,6 @@ type devicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy ExtraFields map[string]apijson.Field } -func (r *DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePolicyIncludeReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/devicepolicyinclude_test.go b/devicepolicyinclude_test.go index f20eb35ef99..9f3c9aed456 100644 --- a/devicepolicyinclude_test.go +++ b/devicepolicyinclude_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePolicyIncludeDevicesGetSplitTunnelIncludeList(t *testing.T) { +func TestDevicePolicyIncludeList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDevicePolicyIncludeDevicesGetSplitTunnelIncludeList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Includes.DevicesGetSplitTunnelIncludeList(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Policies.Includes.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestDevicePolicyIncludeDevicesGetSplitTunnelIncludeList(t *testing.T) { } } -func TestDevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy(t *testing.T) { +func TestDevicePolicyIncludeReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,86 +55,11 @@ func TestDevicePolicyIncludeDevicesGetSplitTunnelIncludeListForADeviceSettingsPo option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Policies.Includes.DevicesGetSplitTunnelIncludeListForADeviceSettingsPolicy( + _, err := client.Devices.Policies.Includes.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyIncludeDevicesSetSplitTunnelIncludeList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.Includes.DevicesSetSplitTunnelIncludeList( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListParamsBody{{ - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Include testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }, { - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Include testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }, { - Address: cloudflare.F("192.0.2.0/24"), - Description: cloudflare.F("Include testing domains from the tunnel"), - Host: cloudflare.F("*.example.com"), - }}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Policies.Includes.DevicesSetSplitTunnelIncludeListForADeviceSettingsPolicy( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParams{ - Body: cloudflare.F([]cloudflare.DevicePolicyIncludeDevicesSetSplitTunnelIncludeListForADeviceSettingsPolicyParamsBody{{ + cloudflare.DevicePolicyIncludeReplaceParams{ + Body: cloudflare.F([]cloudflare.DevicePolicyIncludeReplaceParamsBody{{ Address: cloudflare.F("192.0.2.0/24"), Description: cloudflare.F("Include testing domains from the tunnel"), Host: cloudflare.F("*.example.com"), diff --git a/deviceposture.go b/deviceposture.go index d6a7e8097fa..f820275c8f4 100644 --- a/deviceposture.go +++ b/deviceposture.go @@ -34,12 +34,12 @@ func NewDevicePostureService(opts ...option.RequestOption) (r *DevicePostureServ return } -// Updates a device posture rule. -func (r *DevicePostureService) Update(ctx context.Context, identifier interface{}, uuid string, body DevicePostureUpdateParams, opts ...option.RequestOption) (res *DevicePostureUpdateResponse, err error) { +// Creates a new device posture rule. +func (r *DevicePostureService) New(ctx context.Context, identifier interface{}, body DevicePostureNewParams, opts ...option.RequestOption) (res *DevicePostureNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePostureUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env DevicePostureNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/posture", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *DevicePostureService) Update(ctx context.Context, identifier interface{ return } -// Deletes a device posture rule. -func (r *DevicePostureService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DevicePostureDeleteResponse, err error) { +// Fetches device posture rules for a Zero Trust account. +func (r *DevicePostureService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePostureListResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePostureDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env DevicePostureListResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/posture", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -60,12 +60,12 @@ func (r *DevicePostureService) Delete(ctx context.Context, identifier interface{ return } -// Creates a new device posture rule. -func (r *DevicePostureService) DevicePostureRulesNewDevicePostureRule(ctx context.Context, identifier interface{}, body DevicePostureDevicePostureRulesNewDevicePostureRuleParams, opts ...option.RequestOption) (res *DevicePostureDevicePostureRulesNewDevicePostureRuleResponse, err error) { +// Deletes a device posture rule. +func (r *DevicePostureService) Delete(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DevicePostureDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env DevicePostureDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/posture/%s", identifier, uuid) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -73,11 +73,11 @@ func (r *DevicePostureService) DevicePostureRulesNewDevicePostureRule(ctx contex return } -// Fetches device posture rules for a Zero Trust account. -func (r *DevicePostureService) DevicePostureRulesListDevicePostureRules(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePostureDevicePostureRulesListDevicePostureRulesResponse, err error) { +// Fetches a single device posture rule. +func (r *DevicePostureService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DevicePostureGetResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture", identifier) + var env DevicePostureGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/posture/%s", identifier, uuid) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -86,12 +86,12 @@ func (r *DevicePostureService) DevicePostureRulesListDevicePostureRules(ctx cont return } -// Fetches a single device posture rule. -func (r *DevicePostureService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DevicePostureGetResponse, err error) { +// Updates a device posture rule. +func (r *DevicePostureService) Replace(ctx context.Context, identifier interface{}, uuid string, body DevicePostureReplaceParams, opts ...option.RequestOption) (res *DevicePostureReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DevicePostureGetResponseEnvelope + var env DevicePostureReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/posture/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -99,7 +99,7 @@ func (r *DevicePostureService) Get(ctx context.Context, identifier interface{}, return } -type DevicePostureUpdateResponse struct { +type DevicePostureNewResponse struct { // API UUID. ID string `json:"id"` // The description of the device posture rule. @@ -108,22 +108,22 @@ type DevicePostureUpdateResponse struct { // remains valid until it is overwritten by new data from the WARP client. Expiration string `json:"expiration"` // The value to be checked against. - Input DevicePostureUpdateResponseInput `json:"input"` + Input DevicePostureNewResponseInput `json:"input"` // The conditions that the client must match to run the rule. - Match []DevicePostureUpdateResponseMatch `json:"match"` + Match []DevicePostureNewResponseMatch `json:"match"` // The name of the device posture rule. Name string `json:"name"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule string `json:"schedule"` // The type of device posture rule. - Type DevicePostureUpdateResponseType `json:"type"` - JSON devicePostureUpdateResponseJSON `json:"-"` + Type DevicePostureNewResponseType `json:"type"` + JSON devicePostureNewResponseJSON `json:"-"` } -// devicePostureUpdateResponseJSON contains the JSON metadata for the struct -// [DevicePostureUpdateResponse] -type devicePostureUpdateResponseJSON struct { +// devicePostureNewResponseJSON contains the JSON metadata for the struct +// [DevicePostureNewResponse] +type devicePostureNewResponseJSON struct { ID apijson.Field Description apijson.Field Expiration apijson.Field @@ -136,40 +136,39 @@ type devicePostureUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The value to be checked against. // -// Union satisfied by -// [DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequest], -// [DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequest] or -// [DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureUpdateResponseInput interface { - implementsDevicePostureUpdateResponseInput() +// Union satisfied by [DevicePostureNewResponseInputTeamsDevicesFileInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesFirewallInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesApplicationInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesIntuneInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesKolideInputRequest], +// [DevicePostureNewResponseInputTeamsDevicesTaniumInputRequest] or +// [DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureNewResponseInput interface { + implementsDevicePostureNewResponseInput() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DevicePostureUpdateResponseInput)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DevicePostureNewResponseInput)(nil)).Elem(), "") } -type DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // Whether or not file exists @@ -177,14 +176,14 @@ type DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest struct { // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureUpdateResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureNewResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesFileInputRequestJSON contains the -// JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesFileInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesFileInputRequestJSON contains the JSON +// metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesFileInputRequest] +type devicePostureNewResponseInputTeamsDevicesFileInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Exists apijson.Field @@ -194,93 +193,93 @@ type devicePostureUpdateResponseInputTeamsDevicesFileInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureNewResponseInput() { } // Operating system -type DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureUpdateResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureNewResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID string `json:"id,required"` // Operating System - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequest] +type devicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { ID apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureNewResponseInput() { } // Operating System -type DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureUpdateResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureNewResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` // Domain - Domain string `json:"domain"` - JSON devicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` + Domain string `json:"domain"` + JSON devicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequest] +type devicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { OperatingSystem apijson.Field Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureNewResponseInput() { } // Operating System -type DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` // Operator - Operator DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` + Operator DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` // Version of OS Version string `json:"version,required"` // Operating System Distribution Name (linux only) @@ -289,14 +288,14 @@ type DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest struct { OsDistroRevision string `json:"os_distro_revision"` // Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, // the kernel release version. (Mac, iOS, and Linux only) - OsVersionExtra string `json:"os_version_extra"` - JSON devicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` + OsVersionExtra string `json:"os_version_extra"` + JSON devicePostureNewResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesOsVersionInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequest] +type devicePostureNewResponseInputTeamsDevicesOsVersionInputRequestJSON struct { OperatingSystem apijson.Field Operator apijson.Field Version apijson.Field @@ -307,80 +306,80 @@ type devicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestJSON struc ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureNewResponseInput() { } // Operating System -type DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown5 DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown6 DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown7 DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown8 DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown9 DevicePostureUpdateResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown5 DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown6 DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown7 DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown8 DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown9 DevicePostureNewResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled bool `json:"enabled,required"` // Operating System - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureNewResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesFirewallInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesFirewallInputRequest] +type devicePostureNewResponseInputTeamsDevicesFirewallInputRequestJSON struct { Enabled apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureNewResponseInput() { } // Operating System -type DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureUpdateResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureNewResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureNewResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestJSON contains +// devicePostureNewResponseInputTeamsDevicesSentineloneInputRequestJSON contains // the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequest] +type devicePostureNewResponseInputTeamsDevicesSentineloneInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -389,38 +388,38 @@ type devicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureNewResponseInput() { } // Operating system -type DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureUpdateResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureNewResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestJSON contains +// devicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestJSON contains // the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequest] +type devicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -429,63 +428,63 @@ type devicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureNewResponseInput() { } // Operating system -type DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureUpdateResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureNewResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks []string `json:"checkDisks"` // Whether to check all disks for encryption. - RequireAll bool `json:"requireAll"` - JSON devicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` + RequireAll bool `json:"requireAll"` + JSON devicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequest] +type devicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { CheckDisks apijson.Field RequireAll apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureNewResponseInput() { } -type DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` // Path for the application. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureNewResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestJSON contains +// devicePostureNewResponseInputTeamsDevicesApplicationInputRequestJSON contains // the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesApplicationInputRequest] +type devicePostureNewResponseInputTeamsDevicesApplicationInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -494,86 +493,86 @@ type devicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureNewResponseInput() { } // Operating system -type DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureUpdateResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureNewResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID string `json:"certificate_id,required"` // Common Name that is protected by the certificate - Cn string `json:"cn,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` + Cn string `json:"cn,required"` + JSON devicePostureNewResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequestJSON +// devicePostureNewResponseInputTeamsDevicesClientCertificateInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesClientCertificateInputRequest] +type devicePostureNewResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { CertificateID apijson.Field Cn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureNewResponseInput() { } -type DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequest] +type devicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureNewResponseInput() { } // Compliance Status -type DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureUpdateResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureNewResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Operator - Operator DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` + Operator DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` // Os Version Os string `json:"os"` // overall @@ -583,14 +582,14 @@ type DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest struct // Version Version string `json:"version"` // Version Operator - VersionOperator DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` - JSON devicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` + VersionOperator DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` + JSON devicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestJSON contains +// devicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestJSON contains // the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequest] +type devicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { ConnectionID apijson.Field Operator apijson.Field Os apijson.Field @@ -602,86 +601,86 @@ type devicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureNewResponseInput() { } // Operator -type DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown15 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown16 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown17 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown18 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown19 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown15 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown16 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown17 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown18 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown19 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown25 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown26 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown27 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown28 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown29 DevicePostureUpdateResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown25 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown26 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown27 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown28 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown29 DevicePostureNewResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureNewResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestJSON contains the +// devicePostureNewResponseInputTeamsDevicesIntuneInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesIntuneInputRequest] +type devicePostureNewResponseInputTeamsDevicesIntuneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureNewResponseInput() { } // Compliance Status -type DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureUpdateResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureNewResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Count Operator - CountOperator DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` + CountOperator DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` // The Number of Issues. - IssueCount string `json:"issue_count,required"` - JSON devicePostureUpdateResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` + IssueCount string `json:"issue_count,required"` + JSON devicePostureNewResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesKolideInputRequestJSON contains the +// devicePostureNewResponseInputTeamsDevicesKolideInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesKolideInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesKolideInputRequest] +type devicePostureNewResponseInputTeamsDevicesKolideInputRequestJSON struct { ConnectionID apijson.Field CountOperator apijson.Field IssueCount apijson.Field @@ -689,44 +688,44 @@ type devicePostureUpdateResponseInputTeamsDevicesKolideInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureNewResponseInput() { } // Count Operator -type DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown35 DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown36 DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown37 DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown38 DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown39 DevicePostureUpdateResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown35 DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown36 DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown37 DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown38 DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown39 DevicePostureNewResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen string `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` + Operator DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` + RiskLevel DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` // Score Operator - ScoreOperator DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` + ScoreOperator DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. - TotalScore float64 `json:"total_score"` - JSON devicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` + TotalScore float64 `json:"total_score"` + JSON devicePostureNewResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestJSON contains the +// devicePostureNewResponseInputTeamsDevicesTaniumInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestJSON struct { +// [DevicePostureNewResponseInputTeamsDevicesTaniumInputRequest] +type devicePostureNewResponseInputTeamsDevicesTaniumInputRequestJSON struct { ConnectionID apijson.Field EidLastSeen apijson.Field Operator apijson.Field @@ -737,46 +736,46 @@ type devicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureNewResponseInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown45 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown46 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown47 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown48 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown49 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown45 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown46 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown47 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown48 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown49 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown55 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown56 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown57 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown58 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown59 DevicePostureUpdateResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown55 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown56 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown57 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown58 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown59 DevicePostureNewResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // The Number of active threats. @@ -786,16 +785,16 @@ type DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest stru // Whether device is active. IsActive bool `json:"is_active"` // Network status of device. - NetworkStatus DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` + NetworkStatus DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` // operator - Operator DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` - JSON devicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` + Operator DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` + JSON devicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` } -// devicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest] -type devicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { +// devicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequest] +type devicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { ConnectionID apijson.Field ActiveThreats apijson.Field Infected apijson.Field @@ -806,105 +805,87 @@ type devicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestJSON ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureUpdateResponseInput() { +func (r DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureNewResponseInput() { } // Network status of device. -type DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string +type DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string const ( - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" ) // operator -type DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string +type DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string const ( - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown65 DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown66 DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown67 DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown68 DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown69 DevicePostureUpdateResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown65 DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown66 DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown67 DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown68 DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown69 DevicePostureNewResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" ) -type DevicePostureUpdateResponseMatch struct { - Platform DevicePostureUpdateResponseMatchPlatform `json:"platform"` - JSON devicePostureUpdateResponseMatchJSON `json:"-"` +type DevicePostureNewResponseMatch struct { + Platform DevicePostureNewResponseMatchPlatform `json:"platform"` + JSON devicePostureNewResponseMatchJSON `json:"-"` } -// devicePostureUpdateResponseMatchJSON contains the JSON metadata for the struct -// [DevicePostureUpdateResponseMatch] -type devicePostureUpdateResponseMatchJSON struct { +// devicePostureNewResponseMatchJSON contains the JSON metadata for the struct +// [DevicePostureNewResponseMatch] +type devicePostureNewResponseMatchJSON struct { Platform apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseMatch) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureNewResponseMatch) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureUpdateResponseMatchPlatform string +type DevicePostureNewResponseMatchPlatform string const ( - DevicePostureUpdateResponseMatchPlatformWindows DevicePostureUpdateResponseMatchPlatform = "windows" - DevicePostureUpdateResponseMatchPlatformMac DevicePostureUpdateResponseMatchPlatform = "mac" - DevicePostureUpdateResponseMatchPlatformLinux DevicePostureUpdateResponseMatchPlatform = "linux" - DevicePostureUpdateResponseMatchPlatformAndroid DevicePostureUpdateResponseMatchPlatform = "android" - DevicePostureUpdateResponseMatchPlatformIos DevicePostureUpdateResponseMatchPlatform = "ios" + DevicePostureNewResponseMatchPlatformWindows DevicePostureNewResponseMatchPlatform = "windows" + DevicePostureNewResponseMatchPlatformMac DevicePostureNewResponseMatchPlatform = "mac" + DevicePostureNewResponseMatchPlatformLinux DevicePostureNewResponseMatchPlatform = "linux" + DevicePostureNewResponseMatchPlatformAndroid DevicePostureNewResponseMatchPlatform = "android" + DevicePostureNewResponseMatchPlatformIos DevicePostureNewResponseMatchPlatform = "ios" ) // The type of device posture rule. -type DevicePostureUpdateResponseType string - -const ( - DevicePostureUpdateResponseTypeFile DevicePostureUpdateResponseType = "file" - DevicePostureUpdateResponseTypeApplication DevicePostureUpdateResponseType = "application" - DevicePostureUpdateResponseTypeTanium DevicePostureUpdateResponseType = "tanium" - DevicePostureUpdateResponseTypeGateway DevicePostureUpdateResponseType = "gateway" - DevicePostureUpdateResponseTypeWarp DevicePostureUpdateResponseType = "warp" - DevicePostureUpdateResponseTypeDiskEncryption DevicePostureUpdateResponseType = "disk_encryption" - DevicePostureUpdateResponseTypeSentinelone DevicePostureUpdateResponseType = "sentinelone" - DevicePostureUpdateResponseTypeCarbonblack DevicePostureUpdateResponseType = "carbonblack" - DevicePostureUpdateResponseTypeFirewall DevicePostureUpdateResponseType = "firewall" - DevicePostureUpdateResponseTypeOsVersion DevicePostureUpdateResponseType = "os_version" - DevicePostureUpdateResponseTypeDomainJoined DevicePostureUpdateResponseType = "domain_joined" - DevicePostureUpdateResponseTypeClientCertificate DevicePostureUpdateResponseType = "client_certificate" - DevicePostureUpdateResponseTypeUniqueClientID DevicePostureUpdateResponseType = "unique_client_id" - DevicePostureUpdateResponseTypeKolide DevicePostureUpdateResponseType = "kolide" - DevicePostureUpdateResponseTypeTaniumS2s DevicePostureUpdateResponseType = "tanium_s2s" - DevicePostureUpdateResponseTypeCrowdstrikeS2s DevicePostureUpdateResponseType = "crowdstrike_s2s" - DevicePostureUpdateResponseTypeIntune DevicePostureUpdateResponseType = "intune" - DevicePostureUpdateResponseTypeWorkspaceOne DevicePostureUpdateResponseType = "workspace_one" - DevicePostureUpdateResponseTypeSentineloneS2s DevicePostureUpdateResponseType = "sentinelone_s2s" -) - -type DevicePostureDeleteResponse struct { - // API UUID. - ID string `json:"id"` - JSON devicePostureDeleteResponseJSON `json:"-"` -} - -// devicePostureDeleteResponseJSON contains the JSON metadata for the struct -// [DevicePostureDeleteResponse] -type devicePostureDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponse struct { +type DevicePostureNewResponseType string + +const ( + DevicePostureNewResponseTypeFile DevicePostureNewResponseType = "file" + DevicePostureNewResponseTypeApplication DevicePostureNewResponseType = "application" + DevicePostureNewResponseTypeTanium DevicePostureNewResponseType = "tanium" + DevicePostureNewResponseTypeGateway DevicePostureNewResponseType = "gateway" + DevicePostureNewResponseTypeWarp DevicePostureNewResponseType = "warp" + DevicePostureNewResponseTypeDiskEncryption DevicePostureNewResponseType = "disk_encryption" + DevicePostureNewResponseTypeSentinelone DevicePostureNewResponseType = "sentinelone" + DevicePostureNewResponseTypeCarbonblack DevicePostureNewResponseType = "carbonblack" + DevicePostureNewResponseTypeFirewall DevicePostureNewResponseType = "firewall" + DevicePostureNewResponseTypeOsVersion DevicePostureNewResponseType = "os_version" + DevicePostureNewResponseTypeDomainJoined DevicePostureNewResponseType = "domain_joined" + DevicePostureNewResponseTypeClientCertificate DevicePostureNewResponseType = "client_certificate" + DevicePostureNewResponseTypeUniqueClientID DevicePostureNewResponseType = "unique_client_id" + DevicePostureNewResponseTypeKolide DevicePostureNewResponseType = "kolide" + DevicePostureNewResponseTypeTaniumS2s DevicePostureNewResponseType = "tanium_s2s" + DevicePostureNewResponseTypeCrowdstrikeS2s DevicePostureNewResponseType = "crowdstrike_s2s" + DevicePostureNewResponseTypeIntune DevicePostureNewResponseType = "intune" + DevicePostureNewResponseTypeWorkspaceOne DevicePostureNewResponseType = "workspace_one" + DevicePostureNewResponseTypeSentineloneS2s DevicePostureNewResponseType = "sentinelone_s2s" +) + +type DevicePostureListResponse struct { // API UUID. ID string `json:"id"` // The description of the device posture rule. @@ -913,23 +894,22 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleResponse struct { // remains valid until it is overwritten by new data from the WARP client. Expiration string `json:"expiration"` // The value to be checked against. - Input DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput `json:"input"` + Input DevicePostureListResponseInput `json:"input"` // The conditions that the client must match to run the rule. - Match []DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatch `json:"match"` + Match []DevicePostureListResponseMatch `json:"match"` // The name of the device posture rule. Name string `json:"name"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule string `json:"schedule"` // The type of device posture rule. - Type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType `json:"type"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseJSON `json:"-"` + Type DevicePostureListResponseType `json:"type"` + JSON devicePostureListResponseJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseJSON contains the -// JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponse] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseJSON struct { +// devicePostureListResponseJSON contains the JSON metadata for the struct +// [DevicePostureListResponse] +type devicePostureListResponseJSON struct { ID apijson.Field Description apijson.Field Expiration apijson.Field @@ -942,41 +922,39 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The value to be checked against. // -// Union satisfied by -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequest] -// or -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput interface { - implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() +// Union satisfied by [DevicePostureListResponseInputTeamsDevicesFileInputRequest], +// [DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureListResponseInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureListResponseInputTeamsDevicesFirewallInputRequest], +// [DevicePostureListResponseInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureListResponseInputTeamsDevicesApplicationInputRequest], +// [DevicePostureListResponseInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureListResponseInputTeamsDevicesIntuneInputRequest], +// [DevicePostureListResponseInputTeamsDevicesKolideInputRequest], +// [DevicePostureListResponseInputTeamsDevicesTaniumInputRequest] or +// [DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureListResponseInput interface { + implementsDevicePostureListResponseInput() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DevicePostureListResponseInput)(nil)).Elem(), "") } -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // Whether or not file exists @@ -984,14 +962,14 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureListResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesFileInputRequestJSON contains the JSON +// metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesFileInputRequest] +type devicePostureListResponseInputTeamsDevicesFileInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Exists apijson.Field @@ -1001,93 +979,93 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureListResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureListResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID string `json:"id,required"` // Operating System - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestJSON +// devicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { +// [DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequest] +type devicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { ID apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureListResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureListResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` // Domain - Domain string `json:"domain"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` + Domain string `json:"domain"` + JSON devicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequest] +type devicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { OperatingSystem apijson.Field Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureListResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` // Operator - Operator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` + Operator DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` // Version of OS Version string `json:"version,required"` // Operating System Distribution Name (linux only) @@ -1096,14 +1074,14 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice OsDistroRevision string `json:"os_distro_revision"` // Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, // the kernel release version. (Mac, iOS, and Linux only) - OsVersionExtra string `json:"os_version_extra"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` + OsVersionExtra string `json:"os_version_extra"` + JSON devicePostureListResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesOsVersionInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesOsVersionInputRequest] +type devicePostureListResponseInputTeamsDevicesOsVersionInputRequestJSON struct { OperatingSystem apijson.Field Operator apijson.Field Version apijson.Field @@ -1114,80 +1092,80 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureListResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown75 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown76 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown77 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown78 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown79 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown75 DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown76 DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown77 DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown78 DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown79 DevicePostureListResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled bool `json:"enabled,required"` // Operating System - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureListResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesFirewallInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesFirewallInputRequest] +type devicePostureListResponseInputTeamsDevicesFirewallInputRequestJSON struct { Enabled apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureListResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureListResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureListResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesSentineloneInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesSentineloneInputRequest] +type devicePostureListResponseInputTeamsDevicesSentineloneInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -1196,38 +1174,38 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureListResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureListResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureListResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesCarbonblackInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequest] +type devicePostureListResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -1236,63 +1214,63 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureListResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureListResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks []string `json:"checkDisks"` // Whether to check all disks for encryption. - RequireAll bool `json:"requireAll"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` + RequireAll bool `json:"requireAll"` + JSON devicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequestJSON +// devicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { +// [DevicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequest] +type devicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { CheckDisks apijson.Field RequireAll apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureListResponseInput() { } -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` // Path for the application. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureListResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesApplicationInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesApplicationInputRequest] +type devicePostureListResponseInputTeamsDevicesApplicationInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -1301,86 +1279,86 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureListResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureListResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID string `json:"certificate_id,required"` // Common Name that is protected by the certificate - Cn string `json:"cn,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` + Cn string `json:"cn,required"` + JSON devicePostureListResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequestJSON +// devicePostureListResponseInputTeamsDevicesClientCertificateInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { +// [DevicePostureListResponseInputTeamsDevicesClientCertificateInputRequest] +type devicePostureListResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { CertificateID apijson.Field Cn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureListResponseInput() { } -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequest] +type devicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureListResponseInput() { } // Compliance Status -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureListResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Operator - Operator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` + Operator DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` // Os Version Os string `json:"os"` // overall @@ -1390,14 +1368,14 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice // Version Version string `json:"version"` // Version Operator - VersionOperator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` + VersionOperator DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` + JSON devicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequest] +type devicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { ConnectionID apijson.Field Operator apijson.Field Os apijson.Field @@ -1409,86 +1387,86 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureListResponseInput() { } // Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown85 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown86 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown87 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown88 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown89 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown85 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown86 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown87 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown88 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown89 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown95 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown96 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown97 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown98 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown99 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown95 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown96 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown97 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown98 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown99 DevicePostureListResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureListResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesIntuneInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesIntuneInputRequest] +type devicePostureListResponseInputTeamsDevicesIntuneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureListResponseInput() { } // Compliance Status -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureListResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Count Operator - CountOperator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` + CountOperator DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` // The Number of Issues. - IssueCount string `json:"issue_count,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` + IssueCount string `json:"issue_count,required"` + JSON devicePostureListResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesKolideInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesKolideInputRequest] +type devicePostureListResponseInputTeamsDevicesKolideInputRequestJSON struct { ConnectionID apijson.Field CountOperator apijson.Field IssueCount apijson.Field @@ -1496,44 +1474,44 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureListResponseInput() { } // Count Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown105 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown106 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown107 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown108 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown109 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown105 DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown106 DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown107 DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown108 DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown109 DevicePostureListResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen string `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` + Operator DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` + RiskLevel DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` // Score Operator - ScoreOperator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` + ScoreOperator DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. - TotalScore float64 `json:"total_score"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` + TotalScore float64 `json:"total_score"` + JSON devicePostureListResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestJSON struct { +// devicePostureListResponseInputTeamsDevicesTaniumInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureListResponseInputTeamsDevicesTaniumInputRequest] +type devicePostureListResponseInputTeamsDevicesTaniumInputRequestJSON struct { ConnectionID apijson.Field EidLastSeen apijson.Field Operator apijson.Field @@ -1544,46 +1522,46 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureListResponseInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown115 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown116 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown117 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown118 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown119 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown115 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown116 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown117 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown118 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown119 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureListResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown125 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown126 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown127 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown128 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown129 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown125 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown126 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown127 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown128 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown129 DevicePostureListResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // The Number of active threats. @@ -1593,16 +1571,16 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice // Whether device is active. IsActive bool `json:"is_active"` // Network status of device. - NetworkStatus DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` + NetworkStatus DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` // operator - Operator DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` + Operator DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` + JSON devicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestJSON +// devicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequest] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { +// [DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequest] +type devicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { ConnectionID apijson.Field ActiveThreats apijson.Field Infected apijson.Field @@ -1613,88 +1591,105 @@ type devicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevice ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleResponseInput() { +func (r DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureListResponseInput() { } // Network status of device. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string +type DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" ) // operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string +type DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown135 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown136 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown137 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown138 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown139 DevicePostureDevicePostureRulesNewDevicePostureRuleResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown135 DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown136 DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown137 DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown138 DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown139 DevicePostureListResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatch struct { - Platform DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform `json:"platform"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchJSON `json:"-"` +type DevicePostureListResponseMatch struct { + Platform DevicePostureListResponseMatchPlatform `json:"platform"` + JSON devicePostureListResponseMatchJSON `json:"-"` } -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchJSON contains -// the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatch] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchJSON struct { +// devicePostureListResponseMatchJSON contains the JSON metadata for the struct +// [DevicePostureListResponseMatch] +type devicePostureListResponseMatchJSON struct { Platform apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatch) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseMatch) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform string +type DevicePostureListResponseMatchPlatform string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatformWindows DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatformMac DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform = "mac" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatformLinux DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatformAndroid DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform = "android" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatformIos DevicePostureDevicePostureRulesNewDevicePostureRuleResponseMatchPlatform = "ios" + DevicePostureListResponseMatchPlatformWindows DevicePostureListResponseMatchPlatform = "windows" + DevicePostureListResponseMatchPlatformMac DevicePostureListResponseMatchPlatform = "mac" + DevicePostureListResponseMatchPlatformLinux DevicePostureListResponseMatchPlatform = "linux" + DevicePostureListResponseMatchPlatformAndroid DevicePostureListResponseMatchPlatform = "android" + DevicePostureListResponseMatchPlatformIos DevicePostureListResponseMatchPlatform = "ios" ) // The type of device posture rule. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType string - -const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeFile DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "file" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeApplication DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "application" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeTanium DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "tanium" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeGateway DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "gateway" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeWarp DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "warp" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeDiskEncryption DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "disk_encryption" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeSentinelone DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "sentinelone" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeCarbonblack DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "carbonblack" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeFirewall DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "firewall" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeOsVersion DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "os_version" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeDomainJoined DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "domain_joined" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeClientCertificate DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "client_certificate" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeUniqueClientID DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "unique_client_id" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeKolide DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "kolide" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeTaniumS2s DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "tanium_s2s" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeCrowdstrikeS2s DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "crowdstrike_s2s" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeIntune DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "intune" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeWorkspaceOne DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "workspace_one" - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseTypeSentineloneS2s DevicePostureDevicePostureRulesNewDevicePostureRuleResponseType = "sentinelone_s2s" -) - -type DevicePostureDevicePostureRulesListDevicePostureRulesResponse struct { +type DevicePostureListResponseType string + +const ( + DevicePostureListResponseTypeFile DevicePostureListResponseType = "file" + DevicePostureListResponseTypeApplication DevicePostureListResponseType = "application" + DevicePostureListResponseTypeTanium DevicePostureListResponseType = "tanium" + DevicePostureListResponseTypeGateway DevicePostureListResponseType = "gateway" + DevicePostureListResponseTypeWarp DevicePostureListResponseType = "warp" + DevicePostureListResponseTypeDiskEncryption DevicePostureListResponseType = "disk_encryption" + DevicePostureListResponseTypeSentinelone DevicePostureListResponseType = "sentinelone" + DevicePostureListResponseTypeCarbonblack DevicePostureListResponseType = "carbonblack" + DevicePostureListResponseTypeFirewall DevicePostureListResponseType = "firewall" + DevicePostureListResponseTypeOsVersion DevicePostureListResponseType = "os_version" + DevicePostureListResponseTypeDomainJoined DevicePostureListResponseType = "domain_joined" + DevicePostureListResponseTypeClientCertificate DevicePostureListResponseType = "client_certificate" + DevicePostureListResponseTypeUniqueClientID DevicePostureListResponseType = "unique_client_id" + DevicePostureListResponseTypeKolide DevicePostureListResponseType = "kolide" + DevicePostureListResponseTypeTaniumS2s DevicePostureListResponseType = "tanium_s2s" + DevicePostureListResponseTypeCrowdstrikeS2s DevicePostureListResponseType = "crowdstrike_s2s" + DevicePostureListResponseTypeIntune DevicePostureListResponseType = "intune" + DevicePostureListResponseTypeWorkspaceOne DevicePostureListResponseType = "workspace_one" + DevicePostureListResponseTypeSentineloneS2s DevicePostureListResponseType = "sentinelone_s2s" +) + +type DevicePostureDeleteResponse struct { + // API UUID. + ID string `json:"id"` + JSON devicePostureDeleteResponseJSON `json:"-"` +} + +// devicePostureDeleteResponseJSON contains the JSON metadata for the struct +// [DevicePostureDeleteResponse] +type devicePostureDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePostureGetResponse struct { // API UUID. ID string `json:"id"` // The description of the device posture rule. @@ -1703,23 +1698,22 @@ type DevicePostureDevicePostureRulesListDevicePostureRulesResponse struct { // remains valid until it is overwritten by new data from the WARP client. Expiration string `json:"expiration"` // The value to be checked against. - Input DevicePostureDevicePostureRulesListDevicePostureRulesResponseInput `json:"input"` + Input DevicePostureGetResponseInput `json:"input"` // The conditions that the client must match to run the rule. - Match []DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatch `json:"match"` + Match []DevicePostureGetResponseMatch `json:"match"` // The name of the device posture rule. Name string `json:"name"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule string `json:"schedule"` // The type of device posture rule. - Type DevicePostureDevicePostureRulesListDevicePostureRulesResponseType `json:"type"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseJSON `json:"-"` + Type DevicePostureGetResponseType `json:"type"` + JSON devicePostureGetResponseJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseJSON contains the -// JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponse] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseJSON struct { +// devicePostureGetResponseJSON contains the JSON metadata for the struct +// [DevicePostureGetResponse] +type devicePostureGetResponseJSON struct { ID apijson.Field Description apijson.Field Expiration apijson.Field @@ -1732,41 +1726,39 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The value to be checked against. // -// Union satisfied by -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequest], -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequest] -// or -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInput interface { - implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() +// Union satisfied by [DevicePostureGetResponseInputTeamsDevicesFileInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesKolideInputRequest], +// [DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest] or +// [DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureGetResponseInput interface { + implementsDevicePostureGetResponseInput() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DevicePostureDevicePostureRulesListDevicePostureRulesResponseInput)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DevicePostureGetResponseInput)(nil)).Elem(), "") } -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // Whether or not file exists @@ -1774,14 +1766,14 @@ type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON contains the JSON +// metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesFileInputRequest] +type devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Exists apijson.Field @@ -1791,93 +1783,93 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureGetResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID string `json:"id,required"` // Operating System - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest] +type devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { ID apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureGetResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` // Domain - Domain string `json:"domain"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` + Domain string `json:"domain"` + JSON devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest] +type devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { OperatingSystem apijson.Field Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureGetResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` // Operator - Operator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` + Operator DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` // Version of OS Version string `json:"version,required"` // Operating System Distribution Name (linux only) @@ -1886,14 +1878,14 @@ type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi OsDistroRevision string `json:"os_distro_revision"` // Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, // the kernel release version. (Mac, iOS, and Linux only) - OsVersionExtra string `json:"os_version_extra"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` + OsVersionExtra string `json:"os_version_extra"` + JSON devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest] +type devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON struct { OperatingSystem apijson.Field Operator apijson.Field Version apijson.Field @@ -1904,80 +1896,80 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureGetResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown145 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown146 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown147 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown148 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown149 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown145 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown146 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown147 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown148 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown149 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled bool `json:"enabled,required"` // Operating System - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest] +type devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON struct { Enabled apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureGetResponseInput() { } // Operating System -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest] +type devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -1986,38 +1978,38 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureGetResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest] +type devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -2026,63 +2018,63 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureGetResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks []string `json:"checkDisks"` // Whether to check all disks for encryption. - RequireAll bool `json:"requireAll"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` + RequireAll bool `json:"requireAll"` + JSON devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest] +type devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { CheckDisks apijson.Field RequireAll apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureGetResponseInput() { } -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` // Path for the application. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest] +type devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -2091,86 +2083,86 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureGetResponseInput() { } // Operating system -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID string `json:"certificate_id,required"` // Common Name that is protected by the certificate - Cn string `json:"cn,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` + Cn string `json:"cn,required"` + JSON devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequestJSON +// devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { +// [DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest] +type devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { CertificateID apijson.Field Cn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureGetResponseInput() { } -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest] +type devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureGetResponseInput() { } // Compliance Status -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Operator - Operator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` + Operator DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` // Os Version Os string `json:"os"` // overall @@ -2180,14 +2172,14 @@ type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi // Version Version string `json:"version"` // Version Operator - VersionOperator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` + VersionOperator DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` + JSON devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest] +type devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { ConnectionID apijson.Field Operator apijson.Field Os apijson.Field @@ -2199,86 +2191,86 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureGetResponseInput() { } // Operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown155 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown156 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown157 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown158 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown159 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown155 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown156 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown157 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown158 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown159 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown165 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown166 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown167 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown168 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown169 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown165 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown166 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown167 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown168 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown169 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest] +type devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureGetResponseInput() { } // Compliance Status -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Count Operator - CountOperator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` + CountOperator DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` // The Number of Issues. - IssueCount string `json:"issue_count,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` + IssueCount string `json:"issue_count,required"` + JSON devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesKolideInputRequest] +type devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON struct { ConnectionID apijson.Field CountOperator apijson.Field IssueCount apijson.Field @@ -2286,44 +2278,44 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureGetResponseInput() { } // Count Operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown175 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown176 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown177 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown178 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown179 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown175 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown176 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown177 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown178 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown179 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen string `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` + Operator DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` + RiskLevel DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` // Score Operator - ScoreOperator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` + ScoreOperator DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. - TotalScore float64 `json:"total_score"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` + TotalScore float64 `json:"total_score"` + JSON devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest] +type devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON struct { ConnectionID apijson.Field EidLastSeen apijson.Field Operator apijson.Field @@ -2334,46 +2326,46 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureGetResponseInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown185 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown186 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown187 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown188 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown189 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown185 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown186 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown187 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown188 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown189 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown195 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown196 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown197 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown198 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown199 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown195 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown196 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown197 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown198 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown199 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // The Number of active threats. @@ -2383,16 +2375,16 @@ type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi // Whether device is active. IsActive bool `json:"is_active"` // Network status of device. - NetworkStatus DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` + NetworkStatus DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` // operator - Operator DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` + Operator DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` + JSON devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequest] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { +// devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest] +type devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { ConnectionID apijson.Field ActiveThreats apijson.Field Infected apijson.Field @@ -2403,88 +2395,87 @@ type devicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevi ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureDevicePostureRulesListDevicePostureRulesResponseInput() { +func (r DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureGetResponseInput() { } // Network status of device. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string +type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" ) // operator -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string +type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown205 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown206 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown207 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown208 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown209 DevicePostureDevicePostureRulesListDevicePostureRulesResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown205 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown206 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown207 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown208 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown209 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatch struct { - Platform DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform `json:"platform"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseMatchJSON `json:"-"` +type DevicePostureGetResponseMatch struct { + Platform DevicePostureGetResponseMatchPlatform `json:"platform"` + JSON devicePostureGetResponseMatchJSON `json:"-"` } -// devicePostureDevicePostureRulesListDevicePostureRulesResponseMatchJSON contains -// the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatch] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseMatchJSON struct { +// devicePostureGetResponseMatchJSON contains the JSON metadata for the struct +// [DevicePostureGetResponseMatch] +type devicePostureGetResponseMatchJSON struct { Platform apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatch) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureGetResponseMatch) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform string +type DevicePostureGetResponseMatchPlatform string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatformWindows DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform = "windows" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatformMac DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform = "mac" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatformLinux DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform = "linux" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatformAndroid DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform = "android" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatformIos DevicePostureDevicePostureRulesListDevicePostureRulesResponseMatchPlatform = "ios" + DevicePostureGetResponseMatchPlatformWindows DevicePostureGetResponseMatchPlatform = "windows" + DevicePostureGetResponseMatchPlatformMac DevicePostureGetResponseMatchPlatform = "mac" + DevicePostureGetResponseMatchPlatformLinux DevicePostureGetResponseMatchPlatform = "linux" + DevicePostureGetResponseMatchPlatformAndroid DevicePostureGetResponseMatchPlatform = "android" + DevicePostureGetResponseMatchPlatformIos DevicePostureGetResponseMatchPlatform = "ios" ) // The type of device posture rule. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseType string - -const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeFile DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "file" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeApplication DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "application" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeTanium DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "tanium" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeGateway DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "gateway" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeWarp DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "warp" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeDiskEncryption DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "disk_encryption" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeSentinelone DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "sentinelone" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeCarbonblack DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "carbonblack" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeFirewall DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "firewall" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeOsVersion DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "os_version" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeDomainJoined DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "domain_joined" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeClientCertificate DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "client_certificate" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeUniqueClientID DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "unique_client_id" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeKolide DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "kolide" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeTaniumS2s DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "tanium_s2s" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeCrowdstrikeS2s DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "crowdstrike_s2s" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeIntune DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "intune" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeWorkspaceOne DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "workspace_one" - DevicePostureDevicePostureRulesListDevicePostureRulesResponseTypeSentineloneS2s DevicePostureDevicePostureRulesListDevicePostureRulesResponseType = "sentinelone_s2s" +type DevicePostureGetResponseType string + +const ( + DevicePostureGetResponseTypeFile DevicePostureGetResponseType = "file" + DevicePostureGetResponseTypeApplication DevicePostureGetResponseType = "application" + DevicePostureGetResponseTypeTanium DevicePostureGetResponseType = "tanium" + DevicePostureGetResponseTypeGateway DevicePostureGetResponseType = "gateway" + DevicePostureGetResponseTypeWarp DevicePostureGetResponseType = "warp" + DevicePostureGetResponseTypeDiskEncryption DevicePostureGetResponseType = "disk_encryption" + DevicePostureGetResponseTypeSentinelone DevicePostureGetResponseType = "sentinelone" + DevicePostureGetResponseTypeCarbonblack DevicePostureGetResponseType = "carbonblack" + DevicePostureGetResponseTypeFirewall DevicePostureGetResponseType = "firewall" + DevicePostureGetResponseTypeOsVersion DevicePostureGetResponseType = "os_version" + DevicePostureGetResponseTypeDomainJoined DevicePostureGetResponseType = "domain_joined" + DevicePostureGetResponseTypeClientCertificate DevicePostureGetResponseType = "client_certificate" + DevicePostureGetResponseTypeUniqueClientID DevicePostureGetResponseType = "unique_client_id" + DevicePostureGetResponseTypeKolide DevicePostureGetResponseType = "kolide" + DevicePostureGetResponseTypeTaniumS2s DevicePostureGetResponseType = "tanium_s2s" + DevicePostureGetResponseTypeCrowdstrikeS2s DevicePostureGetResponseType = "crowdstrike_s2s" + DevicePostureGetResponseTypeIntune DevicePostureGetResponseType = "intune" + DevicePostureGetResponseTypeWorkspaceOne DevicePostureGetResponseType = "workspace_one" + DevicePostureGetResponseTypeSentineloneS2s DevicePostureGetResponseType = "sentinelone_s2s" ) -type DevicePostureGetResponse struct { +type DevicePostureReplaceResponse struct { // API UUID. ID string `json:"id"` // The description of the device posture rule. @@ -2493,22 +2484,22 @@ type DevicePostureGetResponse struct { // remains valid until it is overwritten by new data from the WARP client. Expiration string `json:"expiration"` // The value to be checked against. - Input DevicePostureGetResponseInput `json:"input"` + Input DevicePostureReplaceResponseInput `json:"input"` // The conditions that the client must match to run the rule. - Match []DevicePostureGetResponseMatch `json:"match"` + Match []DevicePostureReplaceResponseMatch `json:"match"` // The name of the device posture rule. Name string `json:"name"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule string `json:"schedule"` // The type of device posture rule. - Type DevicePostureGetResponseType `json:"type"` - JSON devicePostureGetResponseJSON `json:"-"` + Type DevicePostureReplaceResponseType `json:"type"` + JSON devicePostureReplaceResponseJSON `json:"-"` } -// devicePostureGetResponseJSON contains the JSON metadata for the struct -// [DevicePostureGetResponse] -type devicePostureGetResponseJSON struct { +// devicePostureReplaceResponseJSON contains the JSON metadata for the struct +// [DevicePostureReplaceResponse] +type devicePostureReplaceResponseJSON struct { ID apijson.Field Description apijson.Field Expiration apijson.Field @@ -2521,39 +2512,40 @@ type devicePostureGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The value to be checked against. // -// Union satisfied by [DevicePostureGetResponseInputTeamsDevicesFileInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesKolideInputRequest], -// [DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest] or -// [DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureGetResponseInput interface { - implementsDevicePostureGetResponseInput() +// Union satisfied by +// [DevicePostureReplaceResponseInputTeamsDevicesFileInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequest], +// [DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequest] or +// [DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureReplaceResponseInput interface { + implementsDevicePostureReplaceResponseInput() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DevicePostureGetResponseInput)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DevicePostureReplaceResponseInput)(nil)).Elem(), "") } -type DevicePostureGetResponseInputTeamsDevicesFileInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // Whether or not file exists @@ -2561,14 +2553,14 @@ type DevicePostureGetResponseInputTeamsDevicesFileInputRequest struct { // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureReplaceResponseInputTeamsDevicesFileInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON contains the JSON -// metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesFileInputRequest] -type devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesFileInputRequestJSON contains the +// JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesFileInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesFileInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Exists apijson.Field @@ -2578,93 +2570,93 @@ type devicePostureGetResponseInputTeamsDevicesFileInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesFileInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesFileInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating system -type DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureReplaceResponseInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID string `json:"id,required"` // Operating System - OperatingSystem DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest] -type devicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestJSON struct { ID apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating System -type DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureGetResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureReplaceResponseInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem `json:"operating_system,required"` // Domain - Domain string `json:"domain"` - JSON devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` + Domain string `json:"domain"` + JSON devicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest] -type devicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestJSON struct { OperatingSystem apijson.Field Domain apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating System -type DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem `json:"operating_system,required"` // Operator - Operator DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` + Operator DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator `json:"operator,required"` // Version of OS Version string `json:"version,required"` // Operating System Distribution Name (linux only) @@ -2673,14 +2665,14 @@ type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest struct { OsDistroRevision string `json:"os_distro_revision"` // Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, // the kernel release version. (Mac, iOS, and Linux only) - OsVersionExtra string `json:"os_version_extra"` - JSON devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` + OsVersionExtra string `json:"os_version_extra"` + JSON devicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON contains the -// JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest] -type devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestJSON struct { OperatingSystem apijson.Field Operator apijson.Field Version apijson.Field @@ -2691,80 +2683,80 @@ type devicePostureGetResponseInputTeamsDevicesOsVersionInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating System -type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown215 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown216 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown217 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown218 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown219 DevicePostureGetResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown215 DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown216 DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown217 DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown218 DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperatorUnknown219 DevicePostureReplaceResponseInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled bool `json:"enabled,required"` // Operating System - OperatingSystem DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` - JSON devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystem `json:"operating_system,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON contains the -// JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest] -type devicePostureGetResponseInputTeamsDevicesFirewallInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestJSON contains +// the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestJSON struct { Enabled apijson.Field OperatingSystem apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating System -type DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureReplaceResponseInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest] -type devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -2773,38 +2765,38 @@ type devicePostureGetResponseInputTeamsDevicesSentineloneInputRequestJSON struct ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating system -type DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureReplaceResponseInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem `json:"operating_system,required"` // File path. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest] -type devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -2813,63 +2805,63 @@ type devicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestJSON struct ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating system -type DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureReplaceResponseInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks []string `json:"checkDisks"` // Whether to check all disks for encryption. - RequireAll bool `json:"requireAll"` - JSON devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` + RequireAll bool `json:"requireAll"` + JSON devicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest] -type devicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequestJSON struct { CheckDisks apijson.Field RequireAll apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureReplaceResponseInput() { } -type DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` + OperatingSystem DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystem `json:"operating_system,required"` // Path for the application. Path string `json:"path,required"` // SHA-256. Sha256 string `json:"sha256"` // Signing certificate thumbprint. - Thumbprint string `json:"thumbprint"` - JSON devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` + Thumbprint string `json:"thumbprint"` + JSON devicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest] -type devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestJSON struct { OperatingSystem apijson.Field Path apijson.Field Sha256 apijson.Field @@ -2878,86 +2870,86 @@ type devicePostureGetResponseInputTeamsDevicesApplicationInputRequestJSON struct ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operating system -type DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureGetResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureReplaceResponseInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID string `json:"certificate_id,required"` // Common Name that is protected by the certificate - Cn string `json:"cn,required"` - JSON devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` + Cn string `json:"cn,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON +// devicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequestJSON // contains the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest] -type devicePostureGetResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { +// [DevicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequestJSON struct { CertificateID apijson.Field Cn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureReplaceResponseInput() { } -type DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest] -type devicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureReplaceResponseInput() { } // Compliance Status -type DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureGetResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureReplaceResponseInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Operator - Operator DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` + Operator DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator `json:"operator"` // Os Version Os string `json:"os"` // overall @@ -2967,14 +2959,14 @@ type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest struct { // Version Version string `json:"version"` // Version Operator - VersionOperator DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` - JSON devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` + VersionOperator DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator `json:"versionOperator"` + JSON devicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest] -type devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct { ConnectionID apijson.Field Operator apijson.Field Os apijson.Field @@ -2986,86 +2978,86 @@ type devicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestJSON struct ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operator -type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown225 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown226 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown227 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown228 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown229 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown225 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown226 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown227 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown228 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown229 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown235 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown236 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown237 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown238 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown239 DevicePostureGetResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown235 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown236 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown237 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown238 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown239 DevicePostureReplaceResponseInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` + ComplianceStatus DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus `json:"compliance_status,required"` // Posture Integration ID. - ConnectionID string `json:"connection_id,required"` - JSON devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` + ConnectionID string `json:"connection_id,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON contains the +// devicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest] -type devicePostureGetResponseInputTeamsDevicesIntuneInputRequestJSON struct { +// [DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestJSON struct { ComplianceStatus apijson.Field ConnectionID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequest) implementsDevicePostureReplaceResponseInput() { } // Compliance Status -type DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureGetResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureReplaceResponseInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureGetResponseInputTeamsDevicesKolideInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // Count Operator - CountOperator DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` + CountOperator DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator `json:"countOperator,required"` // The Number of Issues. - IssueCount string `json:"issue_count,required"` - JSON devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` + IssueCount string `json:"issue_count,required"` + JSON devicePostureReplaceResponseInputTeamsDevicesKolideInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON contains the +// devicePostureReplaceResponseInputTeamsDevicesKolideInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesKolideInputRequest] -type devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON struct { +// [DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesKolideInputRequestJSON struct { ConnectionID apijson.Field CountOperator apijson.Field IssueCount apijson.Field @@ -3073,44 +3065,44 @@ type devicePostureGetResponseInputTeamsDevicesKolideInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequest) implementsDevicePostureReplaceResponseInput() { } // Count Operator -type DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown245 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown246 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown247 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown248 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown249 DevicePostureGetResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown245 DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown246 DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown247 DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown248 DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperatorUnknown249 DevicePostureReplaceResponseInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen string `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` + Operator DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` + RiskLevel DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel `json:"risk_level"` // Score Operator - ScoreOperator DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` + ScoreOperator DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. - TotalScore float64 `json:"total_score"` - JSON devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` + TotalScore float64 `json:"total_score"` + JSON devicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON contains the +// devicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestJSON contains the // JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest] -type devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON struct { +// [DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestJSON struct { ConnectionID apijson.Field EidLastSeen apijson.Field Operator apijson.Field @@ -3121,46 +3113,46 @@ type devicePostureGetResponseInputTeamsDevicesTaniumInputRequestJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequest) implementsDevicePostureReplaceResponseInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown255 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown256 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown257 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown258 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown259 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown255 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown256 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown257 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown258 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperatorUnknown259 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown265 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown266 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown267 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown268 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown269 DevicePostureGetResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown265 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown266 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown267 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown268 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown269 DevicePostureReplaceResponseInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID string `json:"connection_id,required"` // The Number of active threats. @@ -3170,16 +3162,16 @@ type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest struct // Whether device is active. IsActive bool `json:"is_active"` // Network status of device. - NetworkStatus DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` + NetworkStatus DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus `json:"network_status"` // operator - Operator DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` - JSON devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` + Operator DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator `json:"operator"` + JSON devicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestJSON `json:"-"` } -// devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON contains -// the JSON metadata for the struct -// [DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest] -type devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { +// devicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestJSON +// contains the JSON metadata for the struct +// [DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequest] +type devicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestJSON struct { ConnectionID apijson.Field ActiveThreats apijson.Field Infected apijson.Field @@ -3190,159 +3182,159 @@ type devicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestJSON str ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequest) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureGetResponseInput() { +func (r DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureReplaceResponseInput() { } // Network status of device. -type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string +type DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string const ( - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" ) // operator -type DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string +type DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator string const ( - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown275 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown276 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown277 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown278 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown279 DevicePostureGetResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown275 DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown276 DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown277 DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown278 DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown279 DevicePostureReplaceResponseInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" ) -type DevicePostureGetResponseMatch struct { - Platform DevicePostureGetResponseMatchPlatform `json:"platform"` - JSON devicePostureGetResponseMatchJSON `json:"-"` +type DevicePostureReplaceResponseMatch struct { + Platform DevicePostureReplaceResponseMatchPlatform `json:"platform"` + JSON devicePostureReplaceResponseMatchJSON `json:"-"` } -// devicePostureGetResponseMatchJSON contains the JSON metadata for the struct -// [DevicePostureGetResponseMatch] -type devicePostureGetResponseMatchJSON struct { +// devicePostureReplaceResponseMatchJSON contains the JSON metadata for the struct +// [DevicePostureReplaceResponseMatch] +type devicePostureReplaceResponseMatchJSON struct { Platform apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseMatch) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseMatch) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureGetResponseMatchPlatform string +type DevicePostureReplaceResponseMatchPlatform string const ( - DevicePostureGetResponseMatchPlatformWindows DevicePostureGetResponseMatchPlatform = "windows" - DevicePostureGetResponseMatchPlatformMac DevicePostureGetResponseMatchPlatform = "mac" - DevicePostureGetResponseMatchPlatformLinux DevicePostureGetResponseMatchPlatform = "linux" - DevicePostureGetResponseMatchPlatformAndroid DevicePostureGetResponseMatchPlatform = "android" - DevicePostureGetResponseMatchPlatformIos DevicePostureGetResponseMatchPlatform = "ios" + DevicePostureReplaceResponseMatchPlatformWindows DevicePostureReplaceResponseMatchPlatform = "windows" + DevicePostureReplaceResponseMatchPlatformMac DevicePostureReplaceResponseMatchPlatform = "mac" + DevicePostureReplaceResponseMatchPlatformLinux DevicePostureReplaceResponseMatchPlatform = "linux" + DevicePostureReplaceResponseMatchPlatformAndroid DevicePostureReplaceResponseMatchPlatform = "android" + DevicePostureReplaceResponseMatchPlatformIos DevicePostureReplaceResponseMatchPlatform = "ios" ) // The type of device posture rule. -type DevicePostureGetResponseType string - -const ( - DevicePostureGetResponseTypeFile DevicePostureGetResponseType = "file" - DevicePostureGetResponseTypeApplication DevicePostureGetResponseType = "application" - DevicePostureGetResponseTypeTanium DevicePostureGetResponseType = "tanium" - DevicePostureGetResponseTypeGateway DevicePostureGetResponseType = "gateway" - DevicePostureGetResponseTypeWarp DevicePostureGetResponseType = "warp" - DevicePostureGetResponseTypeDiskEncryption DevicePostureGetResponseType = "disk_encryption" - DevicePostureGetResponseTypeSentinelone DevicePostureGetResponseType = "sentinelone" - DevicePostureGetResponseTypeCarbonblack DevicePostureGetResponseType = "carbonblack" - DevicePostureGetResponseTypeFirewall DevicePostureGetResponseType = "firewall" - DevicePostureGetResponseTypeOsVersion DevicePostureGetResponseType = "os_version" - DevicePostureGetResponseTypeDomainJoined DevicePostureGetResponseType = "domain_joined" - DevicePostureGetResponseTypeClientCertificate DevicePostureGetResponseType = "client_certificate" - DevicePostureGetResponseTypeUniqueClientID DevicePostureGetResponseType = "unique_client_id" - DevicePostureGetResponseTypeKolide DevicePostureGetResponseType = "kolide" - DevicePostureGetResponseTypeTaniumS2s DevicePostureGetResponseType = "tanium_s2s" - DevicePostureGetResponseTypeCrowdstrikeS2s DevicePostureGetResponseType = "crowdstrike_s2s" - DevicePostureGetResponseTypeIntune DevicePostureGetResponseType = "intune" - DevicePostureGetResponseTypeWorkspaceOne DevicePostureGetResponseType = "workspace_one" - DevicePostureGetResponseTypeSentineloneS2s DevicePostureGetResponseType = "sentinelone_s2s" -) - -type DevicePostureUpdateParams struct { +type DevicePostureReplaceResponseType string + +const ( + DevicePostureReplaceResponseTypeFile DevicePostureReplaceResponseType = "file" + DevicePostureReplaceResponseTypeApplication DevicePostureReplaceResponseType = "application" + DevicePostureReplaceResponseTypeTanium DevicePostureReplaceResponseType = "tanium" + DevicePostureReplaceResponseTypeGateway DevicePostureReplaceResponseType = "gateway" + DevicePostureReplaceResponseTypeWarp DevicePostureReplaceResponseType = "warp" + DevicePostureReplaceResponseTypeDiskEncryption DevicePostureReplaceResponseType = "disk_encryption" + DevicePostureReplaceResponseTypeSentinelone DevicePostureReplaceResponseType = "sentinelone" + DevicePostureReplaceResponseTypeCarbonblack DevicePostureReplaceResponseType = "carbonblack" + DevicePostureReplaceResponseTypeFirewall DevicePostureReplaceResponseType = "firewall" + DevicePostureReplaceResponseTypeOsVersion DevicePostureReplaceResponseType = "os_version" + DevicePostureReplaceResponseTypeDomainJoined DevicePostureReplaceResponseType = "domain_joined" + DevicePostureReplaceResponseTypeClientCertificate DevicePostureReplaceResponseType = "client_certificate" + DevicePostureReplaceResponseTypeUniqueClientID DevicePostureReplaceResponseType = "unique_client_id" + DevicePostureReplaceResponseTypeKolide DevicePostureReplaceResponseType = "kolide" + DevicePostureReplaceResponseTypeTaniumS2s DevicePostureReplaceResponseType = "tanium_s2s" + DevicePostureReplaceResponseTypeCrowdstrikeS2s DevicePostureReplaceResponseType = "crowdstrike_s2s" + DevicePostureReplaceResponseTypeIntune DevicePostureReplaceResponseType = "intune" + DevicePostureReplaceResponseTypeWorkspaceOne DevicePostureReplaceResponseType = "workspace_one" + DevicePostureReplaceResponseTypeSentineloneS2s DevicePostureReplaceResponseType = "sentinelone_s2s" +) + +type DevicePostureNewParams struct { // The name of the device posture rule. Name param.Field[string] `json:"name,required"` // The type of device posture rule. - Type param.Field[DevicePostureUpdateParamsType] `json:"type,required"` + Type param.Field[DevicePostureNewParamsType] `json:"type,required"` // The description of the device posture rule. Description param.Field[string] `json:"description"` // Sets the expiration time for a posture check result. If empty, the result // remains valid until it is overwritten by new data from the WARP client. Expiration param.Field[string] `json:"expiration"` // The value to be checked against. - Input param.Field[DevicePostureUpdateParamsInput] `json:"input"` + Input param.Field[DevicePostureNewParamsInput] `json:"input"` // The conditions that the client must match to run the rule. - Match param.Field[[]DevicePostureUpdateParamsMatch] `json:"match"` + Match param.Field[[]DevicePostureNewParamsMatch] `json:"match"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule param.Field[string] `json:"schedule"` } -func (r DevicePostureUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of device posture rule. -type DevicePostureUpdateParamsType string - -const ( - DevicePostureUpdateParamsTypeFile DevicePostureUpdateParamsType = "file" - DevicePostureUpdateParamsTypeApplication DevicePostureUpdateParamsType = "application" - DevicePostureUpdateParamsTypeTanium DevicePostureUpdateParamsType = "tanium" - DevicePostureUpdateParamsTypeGateway DevicePostureUpdateParamsType = "gateway" - DevicePostureUpdateParamsTypeWarp DevicePostureUpdateParamsType = "warp" - DevicePostureUpdateParamsTypeDiskEncryption DevicePostureUpdateParamsType = "disk_encryption" - DevicePostureUpdateParamsTypeSentinelone DevicePostureUpdateParamsType = "sentinelone" - DevicePostureUpdateParamsTypeCarbonblack DevicePostureUpdateParamsType = "carbonblack" - DevicePostureUpdateParamsTypeFirewall DevicePostureUpdateParamsType = "firewall" - DevicePostureUpdateParamsTypeOsVersion DevicePostureUpdateParamsType = "os_version" - DevicePostureUpdateParamsTypeDomainJoined DevicePostureUpdateParamsType = "domain_joined" - DevicePostureUpdateParamsTypeClientCertificate DevicePostureUpdateParamsType = "client_certificate" - DevicePostureUpdateParamsTypeUniqueClientID DevicePostureUpdateParamsType = "unique_client_id" - DevicePostureUpdateParamsTypeKolide DevicePostureUpdateParamsType = "kolide" - DevicePostureUpdateParamsTypeTaniumS2s DevicePostureUpdateParamsType = "tanium_s2s" - DevicePostureUpdateParamsTypeCrowdstrikeS2s DevicePostureUpdateParamsType = "crowdstrike_s2s" - DevicePostureUpdateParamsTypeIntune DevicePostureUpdateParamsType = "intune" - DevicePostureUpdateParamsTypeWorkspaceOne DevicePostureUpdateParamsType = "workspace_one" - DevicePostureUpdateParamsTypeSentineloneS2s DevicePostureUpdateParamsType = "sentinelone_s2s" +type DevicePostureNewParamsType string + +const ( + DevicePostureNewParamsTypeFile DevicePostureNewParamsType = "file" + DevicePostureNewParamsTypeApplication DevicePostureNewParamsType = "application" + DevicePostureNewParamsTypeTanium DevicePostureNewParamsType = "tanium" + DevicePostureNewParamsTypeGateway DevicePostureNewParamsType = "gateway" + DevicePostureNewParamsTypeWarp DevicePostureNewParamsType = "warp" + DevicePostureNewParamsTypeDiskEncryption DevicePostureNewParamsType = "disk_encryption" + DevicePostureNewParamsTypeSentinelone DevicePostureNewParamsType = "sentinelone" + DevicePostureNewParamsTypeCarbonblack DevicePostureNewParamsType = "carbonblack" + DevicePostureNewParamsTypeFirewall DevicePostureNewParamsType = "firewall" + DevicePostureNewParamsTypeOsVersion DevicePostureNewParamsType = "os_version" + DevicePostureNewParamsTypeDomainJoined DevicePostureNewParamsType = "domain_joined" + DevicePostureNewParamsTypeClientCertificate DevicePostureNewParamsType = "client_certificate" + DevicePostureNewParamsTypeUniqueClientID DevicePostureNewParamsType = "unique_client_id" + DevicePostureNewParamsTypeKolide DevicePostureNewParamsType = "kolide" + DevicePostureNewParamsTypeTaniumS2s DevicePostureNewParamsType = "tanium_s2s" + DevicePostureNewParamsTypeCrowdstrikeS2s DevicePostureNewParamsType = "crowdstrike_s2s" + DevicePostureNewParamsTypeIntune DevicePostureNewParamsType = "intune" + DevicePostureNewParamsTypeWorkspaceOne DevicePostureNewParamsType = "workspace_one" + DevicePostureNewParamsTypeSentineloneS2s DevicePostureNewParamsType = "sentinelone_s2s" ) // The value to be checked against. // -// Satisfied by [DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequest], -// [DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureUpdateParamsInput interface { - implementsDevicePostureUpdateParamsInput() -} - -type DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest struct { +// Satisfied by [DevicePostureNewParamsInputTeamsDevicesFileInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesFirewallInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesApplicationInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesIntuneInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesKolideInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesTaniumInputRequest], +// [DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureNewParamsInput interface { + implementsDevicePostureNewParamsInput() +} + +type DevicePostureNewParamsInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // Whether or not file exists @@ -3353,71 +3345,71 @@ type DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest struct { Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesFileInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesFileInputRequest) implementsDevicePostureNewParamsInput() { } // Operating system -type DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID param.Field[string] `json:"id,required"` // Operating System - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem] `json:"operating_system,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureNewParamsInput() { } // Operating System -type DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureUpdateParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureNewParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem] `json:"operating_system,required"` // Domain Domain param.Field[string] `json:"domain"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureNewParamsInput() { } // Operating System -type DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem] `json:"operating_system,required"` // Operator - Operator param.Field[DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator] `json:"operator,required"` + Operator param.Field[DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator] `json:"operator,required"` // Version of OS Version param.Field[string] `json:"version,required"` // Operating System Distribution Name (linux only) @@ -3429,56 +3421,56 @@ type DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequest struct { OsVersionExtra param.Field[string] `json:"os_version_extra"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureNewParamsInput() { } // Operating System -type DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown285 DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown286 DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown287 DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown288 DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown289 DevicePostureUpdateParamsInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown285 DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown286 DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown287 DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown288 DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown289 DevicePostureNewParamsInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled param.Field[bool] `json:"enabled,required"` // Operating System - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystem] `json:"operating_system,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesFirewallInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesFirewallInputRequest) implementsDevicePostureNewParamsInput() { } // Operating System -type DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureUpdateParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureNewParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -3487,25 +3479,25 @@ type DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequest struct { Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureNewParamsInput() { } // Operating system -type DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureUpdateParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureNewParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -3514,39 +3506,39 @@ type DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequest struct { Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureNewParamsInput() { } // Operating system -type DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureUpdateParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureNewParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateParamsInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks param.Field[[]string] `json:"checkDisks"` // Whether to check all disks for encryption. RequireAll param.Field[bool] `json:"requireAll"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesDiskEncryptionInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesDiskEncryptionInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureNewParamsInput() { } -type DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystem] `json:"operating_system,required"` // Path for the application. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -3555,64 +3547,64 @@ type DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequest struct { Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesApplicationInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesApplicationInputRequest) implementsDevicePostureNewParamsInput() { } // Operating system -type DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureUpdateParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureNewParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureUpdateParamsInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID param.Field[string] `json:"certificate_id,required"` // Common Name that is protected by the certificate Cn param.Field[string] `json:"cn,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesClientCertificateInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesClientCertificateInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureNewParamsInput() { } -type DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus param.Field[DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus] `json:"compliance_status,required"` + ComplianceStatus param.Field[DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus] `json:"compliance_status,required"` // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureNewParamsInput() { } // Compliance Status -type DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureUpdateParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureNewParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // Operator - Operator param.Field[DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator] `json:"operator"` // Os Version Os param.Field[string] `json:"os"` // overall @@ -3622,146 +3614,146 @@ type DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequest struct { // Version Version param.Field[string] `json:"version"` // Version Operator - VersionOperator param.Field[DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator] `json:"versionOperator"` + VersionOperator param.Field[DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator] `json:"versionOperator"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureNewParamsInput() { } // Operator -type DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown295 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown296 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown297 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown298 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown299 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown295 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown296 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown297 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown298 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown299 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown305 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown306 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown307 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown308 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown309 DevicePostureUpdateParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown305 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown306 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown307 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown308 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown309 DevicePostureNewParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus param.Field[DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus] `json:"compliance_status,required"` + ComplianceStatus param.Field[DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus] `json:"compliance_status,required"` // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesIntuneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesIntuneInputRequest) implementsDevicePostureNewParamsInput() { } // Compliance Status -type DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureUpdateParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureNewParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // Count Operator - CountOperator param.Field[DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator] `json:"countOperator,required"` + CountOperator param.Field[DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator] `json:"countOperator,required"` // The Number of Issues. IssueCount param.Field[string] `json:"issue_count,required"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesKolideInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesKolideInputRequest) implementsDevicePostureNewParamsInput() { } // Count Operator -type DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown315 DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown316 DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown317 DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown318 DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown319 DevicePostureUpdateParamsInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown315 DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown316 DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown317 DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown318 DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown319 DevicePostureNewParamsInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen param.Field[string] `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator param.Field[DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator] `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel param.Field[DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel] `json:"risk_level"` + RiskLevel param.Field[DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel] `json:"risk_level"` // Score Operator - ScoreOperator param.Field[DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator] `json:"scoreOperator"` + ScoreOperator param.Field[DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator] `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. TotalScore param.Field[float64] `json:"total_score"` } -func (r DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureNewParamsInputTeamsDevicesTaniumInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequest) implementsDevicePostureUpdateParamsInput() { +func (r DevicePostureNewParamsInputTeamsDevicesTaniumInputRequest) implementsDevicePostureNewParamsInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown325 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown326 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown327 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown328 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown329 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown325 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown326 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown327 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown328 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown329 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown335 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown336 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown337 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown338 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown339 DevicePostureUpdateParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown335 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown336 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown337 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown338 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown339 DevicePostureNewParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // The Number of active threats. @@ -3771,126 +3763,224 @@ type DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequest struct // Whether device is active. IsActive param.Field[bool] `json:"is_active"` // Network status of device. - NetworkStatus param.Field[DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus] `json:"network_status"` + NetworkStatus param.Field[DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus] `json:"network_status"` // operator - Operator param.Field[DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator] `json:"operator"` +} + +func (r DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequest) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureNewParamsInput() { +} + +// Network status of device. +type DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string + +const ( + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" +) + +// operator +type DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator string + +const ( + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown345 DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown346 DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown347 DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown348 DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown349 DevicePostureNewParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" +) + +type DevicePostureNewParamsMatch struct { + Platform param.Field[DevicePostureNewParamsMatchPlatform] `json:"platform"` +} + +func (r DevicePostureNewParamsMatch) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DevicePostureNewParamsMatchPlatform string + +const ( + DevicePostureNewParamsMatchPlatformWindows DevicePostureNewParamsMatchPlatform = "windows" + DevicePostureNewParamsMatchPlatformMac DevicePostureNewParamsMatchPlatform = "mac" + DevicePostureNewParamsMatchPlatformLinux DevicePostureNewParamsMatchPlatform = "linux" + DevicePostureNewParamsMatchPlatformAndroid DevicePostureNewParamsMatchPlatform = "android" + DevicePostureNewParamsMatchPlatformIos DevicePostureNewParamsMatchPlatform = "ios" +) + +type DevicePostureNewResponseEnvelope struct { + Errors []DevicePostureNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureNewResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureNewResponse `json:"result,required,nullable"` + // Whether the API call was successful. + Success DevicePostureNewResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureNewResponseEnvelopeJSON `json:"-"` +} + +// devicePostureNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePostureNewResponseEnvelope] +type devicePostureNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePostureNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// devicePostureNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePostureNewResponseEnvelopeErrors] +type devicePostureNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequest) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *DevicePostureNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureUpdateParamsInput() { +type DevicePostureNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureNewResponseEnvelopeMessagesJSON `json:"-"` } -// Network status of device. -type DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string - -const ( - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" -) - -// operator -type DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator string - -const ( - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown345 DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown346 DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown347 DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown348 DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown349 DevicePostureUpdateParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" -) - -type DevicePostureUpdateParamsMatch struct { - Platform param.Field[DevicePostureUpdateParamsMatchPlatform] `json:"platform"` +// devicePostureNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DevicePostureNewResponseEnvelopeMessages] +type devicePostureNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r DevicePostureUpdateParamsMatch) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *DevicePostureNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type DevicePostureUpdateParamsMatchPlatform string +// Whether the API call was successful. +type DevicePostureNewResponseEnvelopeSuccess bool const ( - DevicePostureUpdateParamsMatchPlatformWindows DevicePostureUpdateParamsMatchPlatform = "windows" - DevicePostureUpdateParamsMatchPlatformMac DevicePostureUpdateParamsMatchPlatform = "mac" - DevicePostureUpdateParamsMatchPlatformLinux DevicePostureUpdateParamsMatchPlatform = "linux" - DevicePostureUpdateParamsMatchPlatformAndroid DevicePostureUpdateParamsMatchPlatform = "android" - DevicePostureUpdateParamsMatchPlatformIos DevicePostureUpdateParamsMatchPlatform = "ios" + DevicePostureNewResponseEnvelopeSuccessTrue DevicePostureNewResponseEnvelopeSuccess = true ) -type DevicePostureUpdateResponseEnvelope struct { - Errors []DevicePostureUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureUpdateResponse `json:"result,required,nullable"` +type DevicePostureListResponseEnvelope struct { + Errors []DevicePostureListResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureListResponseEnvelopeMessages `json:"messages,required"` + Result []DevicePostureListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePostureUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureUpdateResponseEnvelopeJSON `json:"-"` + Success DevicePostureListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DevicePostureListResponseEnvelopeResultInfo `json:"result_info"` + JSON devicePostureListResponseEnvelopeJSON `json:"-"` } -// devicePostureUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [DevicePostureUpdateResponseEnvelope] -type devicePostureUpdateResponseEnvelopeJSON struct { +// devicePostureListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePostureListResponseEnvelope] +type devicePostureListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureUpdateResponseEnvelopeErrorsJSON `json:"-"` +type DevicePostureListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureListResponseEnvelopeErrorsJSON `json:"-"` } -// devicePostureUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DevicePostureUpdateResponseEnvelopeErrors] -type devicePostureUpdateResponseEnvelopeErrorsJSON struct { +// devicePostureListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePostureListResponseEnvelopeErrors] +type devicePostureListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureUpdateResponseEnvelopeMessagesJSON `json:"-"` +type DevicePostureListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureListResponseEnvelopeMessagesJSON `json:"-"` } -// devicePostureUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DevicePostureUpdateResponseEnvelopeMessages] -type devicePostureUpdateResponseEnvelopeMessagesJSON struct { +// devicePostureListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DevicePostureListResponseEnvelopeMessages] +type devicePostureListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePostureUpdateResponseEnvelopeSuccess bool +type DevicePostureListResponseEnvelopeSuccess bool const ( - DevicePostureUpdateResponseEnvelopeSuccessTrue DevicePostureUpdateResponseEnvelopeSuccess = true + DevicePostureListResponseEnvelopeSuccessTrue DevicePostureListResponseEnvelopeSuccess = true ) +type DevicePostureListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON devicePostureListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// devicePostureListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DevicePostureListResponseEnvelopeResultInfo] +type devicePostureListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type DevicePostureDeleteResponseEnvelope struct { Errors []DevicePostureDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []DevicePostureDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -3960,80 +4050,148 @@ const ( DevicePostureDeleteResponseEnvelopeSuccessTrue DevicePostureDeleteResponseEnvelopeSuccess = true ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParams struct { +type DevicePostureGetResponseEnvelope struct { + Errors []DevicePostureGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureGetResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureGetResponse `json:"result,required,nullable"` + // Whether the API call was successful. + Success DevicePostureGetResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureGetResponseEnvelopeJSON `json:"-"` +} + +// devicePostureGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [DevicePostureGetResponseEnvelope] +type devicePostureGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePostureGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// devicePostureGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DevicePostureGetResponseEnvelopeErrors] +type devicePostureGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DevicePostureGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// devicePostureGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DevicePostureGetResponseEnvelopeMessages] +type devicePostureGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DevicePostureGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type DevicePostureGetResponseEnvelopeSuccess bool + +const ( + DevicePostureGetResponseEnvelopeSuccessTrue DevicePostureGetResponseEnvelopeSuccess = true +) + +type DevicePostureReplaceParams struct { // The name of the device posture rule. Name param.Field[string] `json:"name,required"` // The type of device posture rule. - Type param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType] `json:"type,required"` + Type param.Field[DevicePostureReplaceParamsType] `json:"type,required"` // The description of the device posture rule. Description param.Field[string] `json:"description"` // Sets the expiration time for a posture check result. If empty, the result // remains valid until it is overwritten by new data from the WARP client. Expiration param.Field[string] `json:"expiration"` // The value to be checked against. - Input param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput] `json:"input"` + Input param.Field[DevicePostureReplaceParamsInput] `json:"input"` // The conditions that the client must match to run the rule. - Match param.Field[[]DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatch] `json:"match"` + Match param.Field[[]DevicePostureReplaceParamsMatch] `json:"match"` // Polling frequency for the WARP client posture check. Default: `5m` (poll every // five minutes). Minimum: `1m`. Schedule param.Field[string] `json:"schedule"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParams) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of device posture rule. -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType string - -const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeFile DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "file" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeApplication DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "application" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeTanium DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "tanium" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeGateway DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "gateway" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeWarp DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "warp" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeDiskEncryption DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "disk_encryption" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeSentinelone DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "sentinelone" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeCarbonblack DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "carbonblack" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeFirewall DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "firewall" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeOsVersion DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "os_version" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeDomainJoined DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "domain_joined" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeClientCertificate DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "client_certificate" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeUniqueClientID DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "unique_client_id" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeKolide DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "kolide" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeTaniumS2s DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "tanium_s2s" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeCrowdstrikeS2s DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "crowdstrike_s2s" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeIntune DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "intune" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeWorkspaceOne DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "workspace_one" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeSentineloneS2s DevicePostureDevicePostureRulesNewDevicePostureRuleParamsType = "sentinelone_s2s" +type DevicePostureReplaceParamsType string + +const ( + DevicePostureReplaceParamsTypeFile DevicePostureReplaceParamsType = "file" + DevicePostureReplaceParamsTypeApplication DevicePostureReplaceParamsType = "application" + DevicePostureReplaceParamsTypeTanium DevicePostureReplaceParamsType = "tanium" + DevicePostureReplaceParamsTypeGateway DevicePostureReplaceParamsType = "gateway" + DevicePostureReplaceParamsTypeWarp DevicePostureReplaceParamsType = "warp" + DevicePostureReplaceParamsTypeDiskEncryption DevicePostureReplaceParamsType = "disk_encryption" + DevicePostureReplaceParamsTypeSentinelone DevicePostureReplaceParamsType = "sentinelone" + DevicePostureReplaceParamsTypeCarbonblack DevicePostureReplaceParamsType = "carbonblack" + DevicePostureReplaceParamsTypeFirewall DevicePostureReplaceParamsType = "firewall" + DevicePostureReplaceParamsTypeOsVersion DevicePostureReplaceParamsType = "os_version" + DevicePostureReplaceParamsTypeDomainJoined DevicePostureReplaceParamsType = "domain_joined" + DevicePostureReplaceParamsTypeClientCertificate DevicePostureReplaceParamsType = "client_certificate" + DevicePostureReplaceParamsTypeUniqueClientID DevicePostureReplaceParamsType = "unique_client_id" + DevicePostureReplaceParamsTypeKolide DevicePostureReplaceParamsType = "kolide" + DevicePostureReplaceParamsTypeTaniumS2s DevicePostureReplaceParamsType = "tanium_s2s" + DevicePostureReplaceParamsTypeCrowdstrikeS2s DevicePostureReplaceParamsType = "crowdstrike_s2s" + DevicePostureReplaceParamsTypeIntune DevicePostureReplaceParamsType = "intune" + DevicePostureReplaceParamsTypeWorkspaceOne DevicePostureReplaceParamsType = "workspace_one" + DevicePostureReplaceParamsTypeSentineloneS2s DevicePostureReplaceParamsType = "sentinelone_s2s" ) // The value to be checked against. // -// Satisfied by -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDiskEncryptionInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesClientCertificateInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequest], -// [DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequest]. -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput interface { - implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() -} - -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest struct { +// Satisfied by [DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesDiskEncryptionInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesClientCertificateInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequest], +// [DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequest]. +type DevicePostureReplaceParamsInput interface { + implementsDevicePostureReplaceParamsInput() +} + +type DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // Whether or not file exists @@ -4044,71 +4202,71 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesF Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystem = "mac" + DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystem = "linux" + DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystemMac DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequest struct { // List ID. ID param.Field[string] `json:"id,required"` // Operating System - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem] `json:"operating_system,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" + DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemAndroid DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "android" + DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemIos DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "ios" + DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystemChromeos DevicePostureReplaceParamsInputTeamsDevicesUniqueClientIDInputRequestOperatingSystem = "chromeos" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequest struct { // Operating System - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem] `json:"operating_system,required"` // Domain Domain param.Field[string] `json:"domain"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesDomainJoinedInputRequestOperatingSystem = "windows" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequest struct { // Operating System - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem] `json:"operating_system,required"` // Operator - Operator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator] `json:"operator,required"` + Operator param.Field[DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator] `json:"operator,required"` // Version of OS Version param.Field[string] `json:"version,required"` // Operating System Distribution Name (linux only) @@ -4120,56 +4278,56 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesO OsVersionExtra param.Field[string] `json:"os_version_extra"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatingSystem = "windows" ) // Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator string +type DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown355 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown356 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown357 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown358 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown359 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesOsVersionInputRequestOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown355 DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown356 DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown357 DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown358 DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperatorUnknown359 DevicePostureReplaceParamsInputTeamsDevicesOsVersionInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequest struct { // Enabled Enabled param.Field[bool] `json:"enabled,required"` // Operating System - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystem] `json:"operating_system,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating System -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" + DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystemMac DevicePostureReplaceParamsInputTeamsDevicesFirewallInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -4178,25 +4336,25 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesS Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemLinux DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "linux" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystemMac DevicePostureReplaceParamsInputTeamsDevicesSentineloneInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem] `json:"operating_system,required"` // File path. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -4205,39 +4363,39 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesC Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" + DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemLinux DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "linux" + DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystemMac DevicePostureReplaceParamsInputTeamsDevicesCarbonblackInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDiskEncryptionInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesDiskEncryptionInputRequest struct { // List of volume names to be checked for encryption. CheckDisks param.Field[[]string] `json:"checkDisks"` // Whether to check all disks for encryption. RequireAll param.Field[bool] `json:"requireAll"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDiskEncryptionInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesDiskEncryptionInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesDiskEncryptionInputRequest) implementsDevicePostureReplaceParamsInput() { } -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequest struct { // Operating system - OperatingSystem param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystem] `json:"operating_system,required"` + OperatingSystem param.Field[DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystem] `json:"operating_system,required"` // Path for the application. Path param.Field[string] `json:"path,required"` // SHA-256. @@ -4246,64 +4404,64 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesA Thumbprint param.Field[string] `json:"thumbprint"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operating system -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystem string +type DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystem string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" + DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystemWindows DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "windows" + DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystemLinux DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "linux" + DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystemMac DevicePostureReplaceParamsInputTeamsDevicesApplicationInputRequestOperatingSystem = "mac" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesClientCertificateInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesClientCertificateInputRequest struct { // UUID of Cloudflare managed certificate. CertificateID param.Field[string] `json:"certificate_id,required"` // Common Name that is protected by the certificate Cn param.Field[string] `json:"cn,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesClientCertificateInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesClientCertificateInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesClientCertificateInputRequest) implementsDevicePostureReplaceParamsInput() { } -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequest struct { // Compliance Status - ComplianceStatus param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus] `json:"compliance_status,required"` + ComplianceStatus param.Field[DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus] `json:"compliance_status,required"` // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequest) implementsDevicePostureReplaceParamsInput() { } // Compliance Status -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string +type DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" + DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusCompliant DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "compliant" + DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusNoncompliant DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "noncompliant" + DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatusUnknown DevicePostureReplaceParamsInputTeamsDevicesWorkspaceOneInputRequestComplianceStatus = "unknown" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // Operator - Operator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator] `json:"operator"` // Os Version Os param.Field[string] `json:"os"` // overall @@ -4313,146 +4471,146 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesC // Version Version param.Field[string] `json:"version"` // Version Operator - VersionOperator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator] `json:"versionOperator"` + VersionOperator param.Field[DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator] `json:"versionOperator"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator string +type DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown365 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown366 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown367 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown368 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown369 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown365 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown366 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown367 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown368 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperatorUnknown369 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestOperator = "==" ) // Version Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string +type DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown375 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown376 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown377 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown378 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown379 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown375 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown376 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown377 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown378 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperatorUnknown379 DevicePostureReplaceParamsInputTeamsDevicesCrowdstrikeInputRequestVersionOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequest struct { // Compliance Status - ComplianceStatus param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus] `json:"compliance_status,required"` + ComplianceStatus param.Field[DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus] `json:"compliance_status,required"` // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequest) implementsDevicePostureReplaceParamsInput() { } // Compliance Status -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus string +type DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusCompliant DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "compliant" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNoncompliant DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "noncompliant" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusUnknown DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "unknown" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusNotapplicable DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "notapplicable" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusIngraceperiod DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "ingraceperiod" + DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatusError DevicePostureReplaceParamsInputTeamsDevicesIntuneInputRequestComplianceStatus = "error" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // Count Operator - CountOperator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator] `json:"countOperator,required"` + CountOperator param.Field[DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator] `json:"countOperator,required"` // The Number of Issues. IssueCount param.Field[string] `json:"issue_count,required"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequest) implementsDevicePostureReplaceParamsInput() { } // Count Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator string +type DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown385 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown386 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown387 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown388 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown389 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesKolideInputRequestCountOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown385 DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown386 DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown387 DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown388 DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperatorUnknown389 DevicePostureReplaceParamsInputTeamsDevicesKolideInputRequestCountOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // For more details on eid last seen, refer to the Tanium documentation. EidLastSeen param.Field[string] `json:"eid_last_seen"` // Operator to evaluate risk_level or eid_last_seen. - Operator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator] `json:"operator"` // For more details on risk level, refer to the Tanium documentation. - RiskLevel param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel] `json:"risk_level"` + RiskLevel param.Field[DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel] `json:"risk_level"` // Score Operator - ScoreOperator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator] `json:"scoreOperator"` + ScoreOperator param.Field[DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator] `json:"scoreOperator"` // For more details on total score, refer to the Tanium documentation. TotalScore param.Field[float64] `json:"total_score"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequest) implementsDevicePostureReplaceParamsInput() { } // Operator to evaluate risk_level or eid_last_seen. -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator string +type DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown395 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown396 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown397 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown398 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown399 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown395 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown396 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown397 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown398 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperatorUnknown399 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestOperator = "==" ) // For more details on risk level, refer to the Tanium documentation. -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel string +type DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "low" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "high" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevelLow DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "low" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevelMedium DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "medium" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevelHigh DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "high" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevelCritical DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestRiskLevel = "critical" ) // Score Operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator string +type DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown405 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown406 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown407 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown408 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown409 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown405 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown406 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown407 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown408 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperatorUnknown409 DevicePostureReplaceParamsInputTeamsDevicesTaniumInputRequestScoreOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequest struct { +type DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequest struct { // Posture Integration ID. ConnectionID param.Field[string] `json:"connection_id,required"` // The Number of active threats. @@ -4462,243 +4620,69 @@ type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesS // Whether device is active. IsActive param.Field[bool] `json:"is_active"` // Network status of device. - NetworkStatus param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus] `json:"network_status"` + NetworkStatus param.Field[DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus] `json:"network_status"` // operator - Operator param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator] `json:"operator"` + Operator param.Field[DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator] `json:"operator"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput() { +func (r DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequest) implementsDevicePostureReplaceParamsInput() { } // Network status of device. -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string +type DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnected DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connected" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnected DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnected" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusDisconnecting DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "disconnecting" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatusConnecting DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestNetworkStatus = "connecting" ) // operator -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator string +type DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator string const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown415 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown416 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown417 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown418 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown419 DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown415 DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown416 DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "<=" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown417 DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown418 DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = ">=" + DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperatorUnknown419 DevicePostureReplaceParamsInputTeamsDevicesSentineloneS2sInputRequestOperator = "==" ) -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatch struct { - Platform param.Field[DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform] `json:"platform"` +type DevicePostureReplaceParamsMatch struct { + Platform param.Field[DevicePostureReplaceParamsMatchPlatform] `json:"platform"` } -func (r DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatch) MarshalJSON() (data []byte, err error) { +func (r DevicePostureReplaceParamsMatch) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform string - -const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformWindows DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform = "windows" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformMac DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform = "mac" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformLinux DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform = "linux" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformAndroid DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform = "android" - DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformIos DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatform = "ios" -) - -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelope struct { - Errors []DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureDevicePostureRulesNewDevicePostureRuleResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeJSON `json:"-"` -} - -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelope] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrors] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessages] -type devicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeSuccess bool - -const ( - DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeSuccessTrue DevicePostureDevicePostureRulesNewDevicePostureRuleResponseEnvelopeSuccess = true -) - -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelope struct { - Errors []DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePostureDevicePostureRulesListDevicePostureRulesResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeJSON `json:"-"` -} - -// devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelope] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrors] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessages] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeSuccess bool +type DevicePostureReplaceParamsMatchPlatform string const ( - DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeSuccessTrue DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeSuccess = true + DevicePostureReplaceParamsMatchPlatformWindows DevicePostureReplaceParamsMatchPlatform = "windows" + DevicePostureReplaceParamsMatchPlatformMac DevicePostureReplaceParamsMatchPlatform = "mac" + DevicePostureReplaceParamsMatchPlatformLinux DevicePostureReplaceParamsMatchPlatform = "linux" + DevicePostureReplaceParamsMatchPlatformAndroid DevicePostureReplaceParamsMatchPlatform = "android" + DevicePostureReplaceParamsMatchPlatformIos DevicePostureReplaceParamsMatchPlatform = "ios" ) -type DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfo] -type devicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureDevicePostureRulesListDevicePostureRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureGetResponseEnvelope struct { - Errors []DevicePostureGetResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureGetResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureGetResponse `json:"result,required,nullable"` +type DevicePostureReplaceResponseEnvelope struct { + Errors []DevicePostureReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePostureGetResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureGetResponseEnvelopeJSON `json:"-"` + Success DevicePostureReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureReplaceResponseEnvelopeJSON `json:"-"` } -// devicePostureGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [DevicePostureGetResponseEnvelope] -type devicePostureGetResponseEnvelopeJSON struct { +// devicePostureReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DevicePostureReplaceResponseEnvelope] +type devicePostureReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -4707,51 +4691,51 @@ type devicePostureGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureGetResponseEnvelopeErrorsJSON `json:"-"` +type DevicePostureReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// devicePostureGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DevicePostureGetResponseEnvelopeErrors] -type devicePostureGetResponseEnvelopeErrorsJSON struct { +// devicePostureReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DevicePostureReplaceResponseEnvelopeErrors] +type devicePostureReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureGetResponseEnvelopeMessagesJSON `json:"-"` +type DevicePostureReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// devicePostureGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DevicePostureGetResponseEnvelopeMessages] -type devicePostureGetResponseEnvelopeMessagesJSON struct { +// devicePostureReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DevicePostureReplaceResponseEnvelopeMessages] +type devicePostureReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePostureGetResponseEnvelopeSuccess bool +type DevicePostureReplaceResponseEnvelopeSuccess bool const ( - DevicePostureGetResponseEnvelopeSuccessTrue DevicePostureGetResponseEnvelopeSuccess = true + DevicePostureReplaceResponseEnvelopeSuccessTrue DevicePostureReplaceResponseEnvelopeSuccess = true ) diff --git a/deviceposture_test.go b/deviceposture_test.go index 71c6e81e5f2..aaf82efdce2 100644 --- a/deviceposture_test.go +++ b/deviceposture_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePostureUpdateWithOptionalParams(t *testing.T) { +func TestDevicePostureNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,28 +29,27 @@ func TestDevicePostureUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Update( + _, err := client.Devices.Postures.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePostureUpdateParams{ + cloudflare.DevicePostureNewParams{ Name: cloudflare.F("Admin Serial Numbers"), - Type: cloudflare.F(cloudflare.DevicePostureUpdateParamsTypeFile), + Type: cloudflare.F(cloudflare.DevicePostureNewParamsTypeFile), Description: cloudflare.F("The rule for admin serial numbers"), Expiration: cloudflare.F("1h"), - Input: cloudflare.F[cloudflare.DevicePostureUpdateParamsInput](cloudflare.DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest(cloudflare.DevicePostureUpdateParamsInputTeamsDevicesFileInputRequest{ + Input: cloudflare.F[cloudflare.DevicePostureNewParamsInput](cloudflare.DevicePostureNewParamsInputTeamsDevicesFileInputRequest(cloudflare.DevicePostureNewParamsInputTeamsDevicesFileInputRequest{ Exists: cloudflare.F(true), - OperatingSystem: cloudflare.F(cloudflare.DevicePostureUpdateParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux), + OperatingSystem: cloudflare.F(cloudflare.DevicePostureNewParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux), Path: cloudflare.F("/bin/cat"), Sha256: cloudflare.F("https://api.us-2.crowdstrike.com"), Thumbprint: cloudflare.F("0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"), })), - Match: cloudflare.F([]cloudflare.DevicePostureUpdateParamsMatch{{ - Platform: cloudflare.F(cloudflare.DevicePostureUpdateParamsMatchPlatformWindows), + Match: cloudflare.F([]cloudflare.DevicePostureNewParamsMatch{{ + Platform: cloudflare.F(cloudflare.DevicePostureNewParamsMatchPlatformWindows), }, { - Platform: cloudflare.F(cloudflare.DevicePostureUpdateParamsMatchPlatformWindows), + Platform: cloudflare.F(cloudflare.DevicePostureNewParamsMatchPlatformWindows), }, { - Platform: cloudflare.F(cloudflare.DevicePostureUpdateParamsMatchPlatformWindows), + Platform: cloudflare.F(cloudflare.DevicePostureNewParamsMatchPlatformWindows), }}), Schedule: cloudflare.F("1h"), }, @@ -64,7 +63,7 @@ func TestDevicePostureUpdateWithOptionalParams(t *testing.T) { } } -func TestDevicePostureDelete(t *testing.T) { +func TestDevicePostureList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -80,11 +79,7 @@ func TestDevicePostureDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Devices.Postures.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -94,7 +89,7 @@ func TestDevicePostureDelete(t *testing.T) { } } -func TestDevicePostureDevicePostureRulesNewDevicePostureRuleWithOptionalParams(t *testing.T) { +func TestDevicePostureDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -110,30 +105,10 @@ func TestDevicePostureDevicePostureRulesNewDevicePostureRuleWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.DevicePostureRulesNewDevicePostureRule( + _, err := client.Devices.Postures.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParams{ - Name: cloudflare.F("Admin Serial Numbers"), - Type: cloudflare.F(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsTypeFile), - Description: cloudflare.F("The rule for admin serial numbers"), - Expiration: cloudflare.F("1h"), - Input: cloudflare.F[cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInput](cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequest{ - Exists: cloudflare.F(true), - OperatingSystem: cloudflare.F(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux), - Path: cloudflare.F("/bin/cat"), - Sha256: cloudflare.F("https://api.us-2.crowdstrike.com"), - Thumbprint: cloudflare.F("0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"), - })), - Match: cloudflare.F([]cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatch{{ - Platform: cloudflare.F(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformWindows), - }, { - Platform: cloudflare.F(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformWindows), - }, { - Platform: cloudflare.F(cloudflare.DevicePostureDevicePostureRulesNewDevicePostureRuleParamsMatchPlatformWindows), - }}), - Schedule: cloudflare.F("1h"), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -144,7 +119,7 @@ func TestDevicePostureDevicePostureRulesNewDevicePostureRuleWithOptionalParams(t } } -func TestDevicePostureDevicePostureRulesListDevicePostureRules(t *testing.T) { +func TestDevicePostureGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -160,7 +135,11 @@ func TestDevicePostureDevicePostureRulesListDevicePostureRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.DevicePostureRulesListDevicePostureRules(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Postures.Get( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -170,7 +149,7 @@ func TestDevicePostureDevicePostureRulesListDevicePostureRules(t *testing.T) { } } -func TestDevicePostureGet(t *testing.T) { +func TestDevicePostureReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -186,10 +165,31 @@ func TestDevicePostureGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Get( + _, err := client.Devices.Postures.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.DevicePostureReplaceParams{ + Name: cloudflare.F("Admin Serial Numbers"), + Type: cloudflare.F(cloudflare.DevicePostureReplaceParamsTypeFile), + Description: cloudflare.F("The rule for admin serial numbers"), + Expiration: cloudflare.F("1h"), + Input: cloudflare.F[cloudflare.DevicePostureReplaceParamsInput](cloudflare.DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest(cloudflare.DevicePostureReplaceParamsInputTeamsDevicesFileInputRequest{ + Exists: cloudflare.F(true), + OperatingSystem: cloudflare.F(cloudflare.DevicePostureReplaceParamsInputTeamsDevicesFileInputRequestOperatingSystemLinux), + Path: cloudflare.F("/bin/cat"), + Sha256: cloudflare.F("https://api.us-2.crowdstrike.com"), + Thumbprint: cloudflare.F("0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e"), + })), + Match: cloudflare.F([]cloudflare.DevicePostureReplaceParamsMatch{{ + Platform: cloudflare.F(cloudflare.DevicePostureReplaceParamsMatchPlatformWindows), + }, { + Platform: cloudflare.F(cloudflare.DevicePostureReplaceParamsMatchPlatformWindows), + }, { + Platform: cloudflare.F(cloudflare.DevicePostureReplaceParamsMatchPlatformWindows), + }}), + Schedule: cloudflare.F("1h"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/devicepostureintegration.go b/devicepostureintegration.go index 5a4c8d0eead..db4cdf9c722 100644 --- a/devicepostureintegration.go +++ b/devicepostureintegration.go @@ -34,6 +34,19 @@ func NewDevicePostureIntegrationService(opts ...option.RequestOption) (r *Device return } +// Create a new device posture integration. +func (r *DevicePostureIntegrationService) New(ctx context.Context, identifier interface{}, body DevicePostureIntegrationNewParams, opts ...option.RequestOption) (res *DevicePostureIntegrationNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env DevicePostureIntegrationNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/devices/posture/integration", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Updates a configured device posture integration. func (r *DevicePostureIntegrationService) Update(ctx context.Context, identifier interface{}, uuid string, body DevicePostureIntegrationUpdateParams, opts ...option.RequestOption) (res *DevicePostureIntegrationUpdateResponse, err error) { opts = append(r.Options[:], opts...) @@ -60,32 +73,6 @@ func (r *DevicePostureIntegrationService) Delete(ctx context.Context, identifier return } -// Create a new device posture integration. -func (r *DevicePostureIntegrationService) DevicePostureIntegrationsNewDevicePostureIntegration(ctx context.Context, identifier interface{}, body DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParams, opts ...option.RequestOption) (res *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture/integration", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches the list of device posture integrations for an account. -func (r *DevicePostureIntegrationService) DevicePostureIntegrationsListDevicePostureIntegrations(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *[]DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse, err error) { - opts = append(r.Options[:], opts...) - var env DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelope - path := fmt.Sprintf("accounts/%v/devices/posture/integration", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetches details for a single device posture integration. func (r *DevicePostureIntegrationService) Get(ctx context.Context, identifier interface{}, uuid string, opts ...option.RequestOption) (res *DevicePostureIntegrationGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -99,24 +86,24 @@ func (r *DevicePostureIntegrationService) Get(ctx context.Context, identifier in return } -type DevicePostureIntegrationUpdateResponse struct { +type DevicePostureIntegrationNewResponse struct { // API UUID. ID string `json:"id"` // The configuration object containing third-party integration information. - Config DevicePostureIntegrationUpdateResponseConfig `json:"config"` + Config DevicePostureIntegrationNewResponseConfig `json:"config"` // The interval between each posture check with the third-party API. Use `m` for // minutes (e.g. `5m`) and `h` for hours (e.g. `12h`). Interval string `json:"interval"` // The name of the device posture integration. Name string `json:"name"` // The type of device posture integration. - Type DevicePostureIntegrationUpdateResponseType `json:"type"` - JSON devicePostureIntegrationUpdateResponseJSON `json:"-"` + Type DevicePostureIntegrationNewResponseType `json:"type"` + JSON devicePostureIntegrationNewResponseJSON `json:"-"` } -// devicePostureIntegrationUpdateResponseJSON contains the JSON metadata for the -// struct [DevicePostureIntegrationUpdateResponse] -type devicePostureIntegrationUpdateResponseJSON struct { +// devicePostureIntegrationNewResponseJSON contains the JSON metadata for the +// struct [DevicePostureIntegrationNewResponse] +type devicePostureIntegrationNewResponseJSON struct { ID apijson.Field Config apijson.Field Interval apijson.Field @@ -126,24 +113,24 @@ type devicePostureIntegrationUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing third-party integration information. -type DevicePostureIntegrationUpdateResponseConfig struct { +type DevicePostureIntegrationNewResponseConfig struct { // The Workspace One API URL provided in the Workspace One Admin Dashboard. APIURL string `json:"api_url,required"` // The Workspace One Authorization URL depending on your region. AuthURL string `json:"auth_url,required"` // The Workspace One client ID provided in the Workspace One Admin Dashboard. - ClientID string `json:"client_id,required"` - JSON devicePostureIntegrationUpdateResponseConfigJSON `json:"-"` + ClientID string `json:"client_id,required"` + JSON devicePostureIntegrationNewResponseConfigJSON `json:"-"` } -// devicePostureIntegrationUpdateResponseConfigJSON contains the JSON metadata for -// the struct [DevicePostureIntegrationUpdateResponseConfig] -type devicePostureIntegrationUpdateResponseConfigJSON struct { +// devicePostureIntegrationNewResponseConfigJSON contains the JSON metadata for the +// struct [DevicePostureIntegrationNewResponseConfig] +type devicePostureIntegrationNewResponseConfigJSON struct { APIURL apijson.Field AuthURL apijson.Field ClientID apijson.Field @@ -151,59 +138,41 @@ type devicePostureIntegrationUpdateResponseConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationUpdateResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationNewResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device posture integration. -type DevicePostureIntegrationUpdateResponseType string +type DevicePostureIntegrationNewResponseType string const ( - DevicePostureIntegrationUpdateResponseTypeWorkspaceOne DevicePostureIntegrationUpdateResponseType = "workspace_one" - DevicePostureIntegrationUpdateResponseTypeCrowdstrikeS2s DevicePostureIntegrationUpdateResponseType = "crowdstrike_s2s" - DevicePostureIntegrationUpdateResponseTypeUptycs DevicePostureIntegrationUpdateResponseType = "uptycs" - DevicePostureIntegrationUpdateResponseTypeIntune DevicePostureIntegrationUpdateResponseType = "intune" - DevicePostureIntegrationUpdateResponseTypeKolide DevicePostureIntegrationUpdateResponseType = "kolide" - DevicePostureIntegrationUpdateResponseTypeTanium DevicePostureIntegrationUpdateResponseType = "tanium" - DevicePostureIntegrationUpdateResponseTypeSentineloneS2s DevicePostureIntegrationUpdateResponseType = "sentinelone_s2s" + DevicePostureIntegrationNewResponseTypeWorkspaceOne DevicePostureIntegrationNewResponseType = "workspace_one" + DevicePostureIntegrationNewResponseTypeCrowdstrikeS2s DevicePostureIntegrationNewResponseType = "crowdstrike_s2s" + DevicePostureIntegrationNewResponseTypeUptycs DevicePostureIntegrationNewResponseType = "uptycs" + DevicePostureIntegrationNewResponseTypeIntune DevicePostureIntegrationNewResponseType = "intune" + DevicePostureIntegrationNewResponseTypeKolide DevicePostureIntegrationNewResponseType = "kolide" + DevicePostureIntegrationNewResponseTypeTanium DevicePostureIntegrationNewResponseType = "tanium" + DevicePostureIntegrationNewResponseTypeSentineloneS2s DevicePostureIntegrationNewResponseType = "sentinelone_s2s" ) -// Union satisfied by [DevicePostureIntegrationDeleteResponseUnknown] or -// [shared.UnionString]. -type DevicePostureIntegrationDeleteResponse interface { - ImplementsDevicePostureIntegrationDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*DevicePostureIntegrationDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse struct { +type DevicePostureIntegrationUpdateResponse struct { // API UUID. ID string `json:"id"` // The configuration object containing third-party integration information. - Config DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfig `json:"config"` + Config DevicePostureIntegrationUpdateResponseConfig `json:"config"` // The interval between each posture check with the third-party API. Use `m` for // minutes (e.g. `5m`) and `h` for hours (e.g. `12h`). Interval string `json:"interval"` // The name of the device posture integration. Name string `json:"name"` // The type of device posture integration. - Type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType `json:"type"` - JSON devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseJSON `json:"-"` + Type DevicePostureIntegrationUpdateResponseType `json:"type"` + JSON devicePostureIntegrationUpdateResponseJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse] -type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseJSON struct { +// devicePostureIntegrationUpdateResponseJSON contains the JSON metadata for the +// struct [DevicePostureIntegrationUpdateResponse] +type devicePostureIntegrationUpdateResponseJSON struct { ID apijson.Field Config apijson.Field Interval apijson.Field @@ -213,25 +182,24 @@ type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration object containing third-party integration information. -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfig struct { +type DevicePostureIntegrationUpdateResponseConfig struct { // The Workspace One API URL provided in the Workspace One Admin Dashboard. APIURL string `json:"api_url,required"` // The Workspace One Authorization URL depending on your region. AuthURL string `json:"auth_url,required"` // The Workspace One client ID provided in the Workspace One Admin Dashboard. - ClientID string `json:"client_id,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfigJSON `json:"-"` + ClientID string `json:"client_id,required"` + JSON devicePostureIntegrationUpdateResponseConfigJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfigJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfig] -type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfigJSON struct { +// devicePostureIntegrationUpdateResponseConfigJSON contains the JSON metadata for +// the struct [DevicePostureIntegrationUpdateResponseConfig] +type devicePostureIntegrationUpdateResponseConfigJSON struct { APIURL apijson.Field AuthURL apijson.Field ClientID apijson.Field @@ -239,94 +207,40 @@ type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseConfig) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationUpdateResponseConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of device posture integration. -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType string +type DevicePostureIntegrationUpdateResponseType string const ( - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeWorkspaceOne DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "workspace_one" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeCrowdstrikeS2s DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "crowdstrike_s2s" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeUptycs DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "uptycs" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeIntune DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "intune" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeKolide DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "kolide" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeTanium DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "tanium" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseTypeSentineloneS2s DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseType = "sentinelone_s2s" + DevicePostureIntegrationUpdateResponseTypeWorkspaceOne DevicePostureIntegrationUpdateResponseType = "workspace_one" + DevicePostureIntegrationUpdateResponseTypeCrowdstrikeS2s DevicePostureIntegrationUpdateResponseType = "crowdstrike_s2s" + DevicePostureIntegrationUpdateResponseTypeUptycs DevicePostureIntegrationUpdateResponseType = "uptycs" + DevicePostureIntegrationUpdateResponseTypeIntune DevicePostureIntegrationUpdateResponseType = "intune" + DevicePostureIntegrationUpdateResponseTypeKolide DevicePostureIntegrationUpdateResponseType = "kolide" + DevicePostureIntegrationUpdateResponseTypeTanium DevicePostureIntegrationUpdateResponseType = "tanium" + DevicePostureIntegrationUpdateResponseTypeSentineloneS2s DevicePostureIntegrationUpdateResponseType = "sentinelone_s2s" ) -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse struct { - // API UUID. - ID string `json:"id"` - // The configuration object containing third-party integration information. - Config DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfig `json:"config"` - // The interval between each posture check with the third-party API. Use `m` for - // minutes (e.g. `5m`) and `h` for hours (e.g. `12h`). - Interval string `json:"interval"` - // The name of the device posture integration. - Name string `json:"name"` - // The type of device posture integration. - Type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType `json:"type"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseJSON `json:"-"` -} - -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseJSON struct { - ID apijson.Field - Config apijson.Field - Interval apijson.Field - Name apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The configuration object containing third-party integration information. -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfig struct { - // The Workspace One API URL provided in the Workspace One Admin Dashboard. - APIURL string `json:"api_url,required"` - // The Workspace One Authorization URL depending on your region. - AuthURL string `json:"auth_url,required"` - // The Workspace One client ID provided in the Workspace One Admin Dashboard. - ClientID string `json:"client_id,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfigJSON `json:"-"` -} - -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfigJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfig] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfigJSON struct { - APIURL apijson.Field - AuthURL apijson.Field - ClientID apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Union satisfied by [DevicePostureIntegrationDeleteResponseUnknown] or +// [shared.UnionString]. +type DevicePostureIntegrationDeleteResponse interface { + ImplementsDevicePostureIntegrationDeleteResponse() } -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*DevicePostureIntegrationDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// The type of device posture integration. -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType string - -const ( - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeWorkspaceOne DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "workspace_one" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeCrowdstrikeS2s DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "crowdstrike_s2s" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeUptycs DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "uptycs" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeIntune DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "intune" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeKolide DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "kolide" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeTanium DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "tanium" - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseTypeSentineloneS2s DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseType = "sentinelone_s2s" -) - type DevicePostureIntegrationGetResponse struct { // API UUID. ID string `json:"id"` @@ -396,37 +310,37 @@ const ( DevicePostureIntegrationGetResponseTypeSentineloneS2s DevicePostureIntegrationGetResponseType = "sentinelone_s2s" ) -type DevicePostureIntegrationUpdateParams struct { +type DevicePostureIntegrationNewParams struct { // The configuration object containing third-party integration information. - Config param.Field[DevicePostureIntegrationUpdateParamsConfig] `json:"config"` + Config param.Field[DevicePostureIntegrationNewParamsConfig] `json:"config,required"` // The interval between each posture check with the third-party API. Use `m` for // minutes (e.g. `5m`) and `h` for hours (e.g. `12h`). - Interval param.Field[string] `json:"interval"` + Interval param.Field[string] `json:"interval,required"` // The name of the device posture integration. - Name param.Field[string] `json:"name"` + Name param.Field[string] `json:"name,required"` // The type of device posture integration. - Type param.Field[DevicePostureIntegrationUpdateParamsType] `json:"type"` + Type param.Field[DevicePostureIntegrationNewParamsType] `json:"type,required"` } -func (r DevicePostureIntegrationUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration object containing third-party integration information. // // Satisfied by -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest], -// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest]. -type DevicePostureIntegrationUpdateParamsConfig interface { - implementsDevicePostureIntegrationUpdateParamsConfig() -} - -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest struct { +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesCrowdstrikeConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesUptycsConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesIntuneConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesKolideConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesTaniumConfigRequest], +// [DevicePostureIntegrationNewParamsConfigTeamsDevicesSentineloneS2sConfigRequest]. +type DevicePostureIntegrationNewParamsConfig interface { + implementsDevicePostureIntegrationNewParamsConfig() +} + +type DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest struct { // The Workspace One API URL provided in the Workspace One Admin Dashboard. APIURL param.Field[string] `json:"api_url,required"` // The Workspace One Authorization URL depending on your region. @@ -437,14 +351,14 @@ type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigReq ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesCrowdstrikeConfigRequest struct { // The Crowdstrike API URL. APIURL param.Field[string] `json:"api_url,required"` // The Crowdstrike client ID. @@ -455,14 +369,14 @@ type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequ CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesCrowdstrikeConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesCrowdstrikeConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesUptycsConfigRequest struct { // The Uptycs API URL. APIURL param.Field[string] `json:"api_url,required"` // The Uptycs client secret. @@ -473,14 +387,14 @@ type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest s CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesUptycsConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesUptycsConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesIntuneConfigRequest struct { // The Intune client ID. ClientID param.Field[string] `json:"client_id,required"` // The Intune client secret. @@ -489,28 +403,28 @@ type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest s CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesIntuneConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesIntuneConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesKolideConfigRequest struct { // The Kolide client ID. ClientID param.Field[string] `json:"client_id,required"` // The Kolide client secret. ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesKolideConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesKolideConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesTaniumConfigRequest struct { // The Tanium API URL. APIURL param.Field[string] `json:"api_url,required"` // The Tanium client secret. @@ -523,52 +437,52 @@ type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest s AccessClientSecret param.Field[string] `json:"access_client_secret"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesTaniumConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesTaniumConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } -type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest struct { +type DevicePostureIntegrationNewParamsConfigTeamsDevicesSentineloneS2sConfigRequest struct { // The SentinelOne S2S API URL. APIURL param.Field[string] `json:"api_url,required"` // The SentinelOne S2S client secret. ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesSentineloneS2sConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { +func (r DevicePostureIntegrationNewParamsConfigTeamsDevicesSentineloneS2sConfigRequest) implementsDevicePostureIntegrationNewParamsConfig() { } // The type of device posture integration. -type DevicePostureIntegrationUpdateParamsType string +type DevicePostureIntegrationNewParamsType string const ( - DevicePostureIntegrationUpdateParamsTypeWorkspaceOne DevicePostureIntegrationUpdateParamsType = "workspace_one" - DevicePostureIntegrationUpdateParamsTypeCrowdstrikeS2s DevicePostureIntegrationUpdateParamsType = "crowdstrike_s2s" - DevicePostureIntegrationUpdateParamsTypeUptycs DevicePostureIntegrationUpdateParamsType = "uptycs" - DevicePostureIntegrationUpdateParamsTypeIntune DevicePostureIntegrationUpdateParamsType = "intune" - DevicePostureIntegrationUpdateParamsTypeKolide DevicePostureIntegrationUpdateParamsType = "kolide" - DevicePostureIntegrationUpdateParamsTypeTanium DevicePostureIntegrationUpdateParamsType = "tanium" - DevicePostureIntegrationUpdateParamsTypeSentineloneS2s DevicePostureIntegrationUpdateParamsType = "sentinelone_s2s" + DevicePostureIntegrationNewParamsTypeWorkspaceOne DevicePostureIntegrationNewParamsType = "workspace_one" + DevicePostureIntegrationNewParamsTypeCrowdstrikeS2s DevicePostureIntegrationNewParamsType = "crowdstrike_s2s" + DevicePostureIntegrationNewParamsTypeUptycs DevicePostureIntegrationNewParamsType = "uptycs" + DevicePostureIntegrationNewParamsTypeIntune DevicePostureIntegrationNewParamsType = "intune" + DevicePostureIntegrationNewParamsTypeKolide DevicePostureIntegrationNewParamsType = "kolide" + DevicePostureIntegrationNewParamsTypeTanium DevicePostureIntegrationNewParamsType = "tanium" + DevicePostureIntegrationNewParamsTypeSentineloneS2s DevicePostureIntegrationNewParamsType = "sentinelone_s2s" ) -type DevicePostureIntegrationUpdateResponseEnvelope struct { - Errors []DevicePostureIntegrationUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureIntegrationUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureIntegrationUpdateResponse `json:"result,required,nullable"` +type DevicePostureIntegrationNewResponseEnvelope struct { + Errors []DevicePostureIntegrationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureIntegrationNewResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureIntegrationNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePostureIntegrationUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureIntegrationUpdateResponseEnvelopeJSON `json:"-"` + Success DevicePostureIntegrationNewResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureIntegrationNewResponseEnvelopeJSON `json:"-"` } -// devicePostureIntegrationUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [DevicePostureIntegrationUpdateResponseEnvelope] -type devicePostureIntegrationUpdateResponseEnvelopeJSON struct { +// devicePostureIntegrationNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [DevicePostureIntegrationNewResponseEnvelope] +type devicePostureIntegrationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -577,155 +491,86 @@ type devicePostureIntegrationUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureIntegrationUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [DevicePostureIntegrationUpdateResponseEnvelopeErrors] -type devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureIntegrationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureIntegrationUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [DevicePostureIntegrationUpdateResponseEnvelopeMessages] -type devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureIntegrationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful. -type DevicePostureIntegrationUpdateResponseEnvelopeSuccess bool - -const ( - DevicePostureIntegrationUpdateResponseEnvelopeSuccessTrue DevicePostureIntegrationUpdateResponseEnvelopeSuccess = true -) - -type DevicePostureIntegrationDeleteResponseEnvelope struct { - Errors []DevicePostureIntegrationDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureIntegrationDeleteResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureIntegrationDeleteResponse `json:"result,required,nullable"` - // Whether the API call was successful. - Success DevicePostureIntegrationDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureIntegrationDeleteResponseEnvelopeJSON `json:"-"` -} - -// devicePostureIntegrationDeleteResponseEnvelopeJSON contains the JSON metadata -// for the struct [DevicePostureIntegrationDeleteResponseEnvelope] -type devicePostureIntegrationDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureIntegrationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DevicePostureIntegrationDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON `json:"-"` +type DevicePostureIntegrationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationNewResponseEnvelopeErrorsJSON `json:"-"` } -// devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [DevicePostureIntegrationDeleteResponseEnvelopeErrors] -type devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON struct { +// devicePostureIntegrationNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [DevicePostureIntegrationNewResponseEnvelopeErrors] +type devicePostureIntegrationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureIntegrationDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON `json:"-"` +type DevicePostureIntegrationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationNewResponseEnvelopeMessagesJSON `json:"-"` } -// devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [DevicePostureIntegrationDeleteResponseEnvelopeMessages] -type devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON struct { +// devicePostureIntegrationNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePostureIntegrationNewResponseEnvelopeMessages] +type devicePostureIntegrationNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePostureIntegrationDeleteResponseEnvelopeSuccess bool +type DevicePostureIntegrationNewResponseEnvelopeSuccess bool const ( - DevicePostureIntegrationDeleteResponseEnvelopeSuccessTrue DevicePostureIntegrationDeleteResponseEnvelopeSuccess = true + DevicePostureIntegrationNewResponseEnvelopeSuccessTrue DevicePostureIntegrationNewResponseEnvelopeSuccess = true ) -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParams struct { +type DevicePostureIntegrationUpdateParams struct { // The configuration object containing third-party integration information. - Config param.Field[DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig] `json:"config,required"` + Config param.Field[DevicePostureIntegrationUpdateParamsConfig] `json:"config"` // The interval between each posture check with the third-party API. Use `m` for // minutes (e.g. `5m`) and `h` for hours (e.g. `12h`). - Interval param.Field[string] `json:"interval,required"` + Interval param.Field[string] `json:"interval"` // The name of the device posture integration. - Name param.Field[string] `json:"name,required"` + Name param.Field[string] `json:"name"` // The type of device posture integration. - Type param.Field[DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType] `json:"type,required"` + Type param.Field[DevicePostureIntegrationUpdateParamsType] `json:"type"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParams) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration object containing third-party integration information. // // Satisfied by -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesCrowdstrikeConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesUptycsConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesIntuneConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesKolideConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesTaniumConfigRequest], -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesSentineloneS2sConfigRequest]. -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig interface { - implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() -} - -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest struct { +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest], +// [DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest]. +type DevicePostureIntegrationUpdateParamsConfig interface { + implementsDevicePostureIntegrationUpdateParamsConfig() +} + +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest struct { // The Workspace One API URL provided in the Workspace One Admin Dashboard. APIURL param.Field[string] `json:"api_url,required"` // The Workspace One Authorization URL depending on your region. @@ -736,14 +581,14 @@ type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesCrowdstrikeConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest struct { // The Crowdstrike API URL. APIURL param.Field[string] `json:"api_url,required"` // The Crowdstrike client ID. @@ -754,14 +599,14 @@ type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesCrowdstrikeConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesCrowdstrikeConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesCrowdstrikeConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesUptycsConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest struct { // The Uptycs API URL. APIURL param.Field[string] `json:"api_url,required"` // The Uptycs client secret. @@ -772,14 +617,14 @@ type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesUptycsConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesUptycsConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesUptycsConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesIntuneConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest struct { // The Intune client ID. ClientID param.Field[string] `json:"client_id,required"` // The Intune client secret. @@ -788,28 +633,28 @@ type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio CustomerID param.Field[string] `json:"customer_id,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesIntuneConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesIntuneConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesIntuneConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesKolideConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest struct { // The Kolide client ID. ClientID param.Field[string] `json:"client_id,required"` // The Kolide client secret. ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesKolideConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesKolideConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesKolideConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesTaniumConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest struct { // The Tanium API URL. APIURL param.Field[string] `json:"api_url,required"` // The Tanium client secret. @@ -822,53 +667,52 @@ type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio AccessClientSecret param.Field[string] `json:"access_client_secret"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesTaniumConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesTaniumConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesTaniumConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesSentineloneS2sConfigRequest struct { +type DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest struct { // The SentinelOne S2S API URL. APIURL param.Field[string] `json:"api_url,required"` // The SentinelOne S2S client secret. ClientSecret param.Field[string] `json:"client_secret,required"` } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesSentineloneS2sConfigRequest) MarshalJSON() (data []byte, err error) { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesSentineloneS2sConfigRequest) implementsDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig() { +func (r DevicePostureIntegrationUpdateParamsConfigTeamsDevicesSentineloneS2sConfigRequest) implementsDevicePostureIntegrationUpdateParamsConfig() { } // The type of device posture integration. -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType string +type DevicePostureIntegrationUpdateParamsType string const ( - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeWorkspaceOne DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "workspace_one" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeCrowdstrikeS2s DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "crowdstrike_s2s" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeUptycs DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "uptycs" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeIntune DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "intune" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeKolide DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "kolide" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeTanium DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "tanium" - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeSentineloneS2s DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsType = "sentinelone_s2s" + DevicePostureIntegrationUpdateParamsTypeWorkspaceOne DevicePostureIntegrationUpdateParamsType = "workspace_one" + DevicePostureIntegrationUpdateParamsTypeCrowdstrikeS2s DevicePostureIntegrationUpdateParamsType = "crowdstrike_s2s" + DevicePostureIntegrationUpdateParamsTypeUptycs DevicePostureIntegrationUpdateParamsType = "uptycs" + DevicePostureIntegrationUpdateParamsTypeIntune DevicePostureIntegrationUpdateParamsType = "intune" + DevicePostureIntegrationUpdateParamsTypeKolide DevicePostureIntegrationUpdateParamsType = "kolide" + DevicePostureIntegrationUpdateParamsTypeTanium DevicePostureIntegrationUpdateParamsType = "tanium" + DevicePostureIntegrationUpdateParamsTypeSentineloneS2s DevicePostureIntegrationUpdateParamsType = "sentinelone_s2s" ) -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelope struct { - Errors []DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessages `json:"messages,required"` - Result DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponse `json:"result,required,nullable"` +type DevicePostureIntegrationUpdateResponseEnvelope struct { + Errors []DevicePostureIntegrationUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureIntegrationUpdateResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureIntegrationUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeSuccess `json:"success,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeJSON `json:"-"` + Success DevicePostureIntegrationUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureIntegrationUpdateResponseEnvelopeJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelope] -type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeJSON struct { +// devicePostureIntegrationUpdateResponseEnvelopeJSON contains the JSON metadata +// for the struct [DevicePostureIntegrationUpdateResponseEnvelope] +type devicePostureIntegrationUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -877,159 +721,124 @@ type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegratio ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrorsJSON `json:"-"` +type DevicePostureIntegrationUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrors] -type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrorsJSON struct { +// devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [DevicePostureIntegrationUpdateResponseEnvelopeErrors] +type devicePostureIntegrationUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessagesJSON `json:"-"` +type DevicePostureIntegrationUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessages] -type devicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessagesJSON struct { +// devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePostureIntegrationUpdateResponseEnvelopeMessages] +type devicePostureIntegrationUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeSuccess bool +type DevicePostureIntegrationUpdateResponseEnvelopeSuccess bool const ( - DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeSuccessTrue DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationResponseEnvelopeSuccess = true + DevicePostureIntegrationUpdateResponseEnvelopeSuccessTrue DevicePostureIntegrationUpdateResponseEnvelopeSuccess = true ) -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelope struct { - Errors []DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrors `json:"errors,required"` - Messages []DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessages `json:"messages,required"` - Result []DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponse `json:"result,required,nullable"` +type DevicePostureIntegrationDeleteResponseEnvelope struct { + Errors []DevicePostureIntegrationDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DevicePostureIntegrationDeleteResponseEnvelopeMessages `json:"messages,required"` + Result DevicePostureIntegrationDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfo `json:"result_info"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeJSON `json:"-"` + Success DevicePostureIntegrationDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON devicePostureIntegrationDeleteResponseEnvelopeJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelope] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeJSON struct { +// devicePostureIntegrationDeleteResponseEnvelopeJSON contains the JSON metadata +// for the struct [DevicePostureIntegrationDeleteResponseEnvelope] +type devicePostureIntegrationDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrorsJSON `json:"-"` +type DevicePostureIntegrationDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrors] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrorsJSON struct { +// devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [DevicePostureIntegrationDeleteResponseEnvelopeErrors] +type devicePostureIntegrationDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessagesJSON `json:"-"` +type DevicePostureIntegrationDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessages] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessagesJSON struct { +// devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [DevicePostureIntegrationDeleteResponseEnvelopeMessages] +type devicePostureIntegrationDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DevicePostureIntegrationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeSuccess bool +type DevicePostureIntegrationDeleteResponseEnvelopeSuccess bool const ( - DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeSuccessTrue DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeSuccess = true + DevicePostureIntegrationDeleteResponseEnvelopeSuccessTrue DevicePostureIntegrationDeleteResponseEnvelopeSuccess = true ) -type DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfo] -type devicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DevicePostureIntegrationGetResponseEnvelope struct { Errors []DevicePostureIntegrationGetResponseEnvelopeErrors `json:"errors,required"` Messages []DevicePostureIntegrationGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/devicepostureintegration_test.go b/devicepostureintegration_test.go index d2b17b4b5b3..b6547a91c21 100644 --- a/devicepostureintegration_test.go +++ b/devicepostureintegration_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDevicePostureIntegrationUpdateWithOptionalParams(t *testing.T) { +func TestDevicePostureIntegrationNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,11 @@ func TestDevicePostureIntegrationUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Integrations.Update( + _, err := client.Devices.Postures.Integrations.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.DevicePostureIntegrationUpdateParams{ - Config: cloudflare.F[cloudflare.DevicePostureIntegrationUpdateParamsConfig](cloudflare.DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest(cloudflare.DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest{ + cloudflare.DevicePostureIntegrationNewParams{ + Config: cloudflare.F[cloudflare.DevicePostureIntegrationNewParamsConfig](cloudflare.DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest(cloudflare.DevicePostureIntegrationNewParamsConfigTeamsDevicesWorkspaceOneConfigRequest{ APIURL: cloudflare.F("https://as123.awmdm.com/API"), AuthURL: cloudflare.F("https://na.uemauth.vmwservices.com/connect/token"), ClientID: cloudflare.F("example client id"), @@ -42,7 +41,7 @@ func TestDevicePostureIntegrationUpdateWithOptionalParams(t *testing.T) { })), Interval: cloudflare.F("10m"), Name: cloudflare.F("My Workspace One Integration"), - Type: cloudflare.F(cloudflare.DevicePostureIntegrationUpdateParamsTypeWorkspaceOne), + Type: cloudflare.F(cloudflare.DevicePostureIntegrationNewParamsTypeWorkspaceOne), }, ) if err != nil { @@ -54,7 +53,7 @@ func TestDevicePostureIntegrationUpdateWithOptionalParams(t *testing.T) { } } -func TestDevicePostureIntegrationDelete(t *testing.T) { +func TestDevicePostureIntegrationUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -70,41 +69,12 @@ func TestDevicePostureIntegrationDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Integrations.Delete( + _, err := client.Devices.Postures.Integrations.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Devices.Postures.Integrations.DevicePostureIntegrationsNewDevicePostureIntegration( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParams{ - Config: cloudflare.F[cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfig](cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest(cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsConfigTeamsDevicesWorkspaceOneConfigRequest{ + cloudflare.DevicePostureIntegrationUpdateParams{ + Config: cloudflare.F[cloudflare.DevicePostureIntegrationUpdateParamsConfig](cloudflare.DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest(cloudflare.DevicePostureIntegrationUpdateParamsConfigTeamsDevicesWorkspaceOneConfigRequest{ APIURL: cloudflare.F("https://as123.awmdm.com/API"), AuthURL: cloudflare.F("https://na.uemauth.vmwservices.com/connect/token"), ClientID: cloudflare.F("example client id"), @@ -112,7 +82,7 @@ func TestDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegr })), Interval: cloudflare.F("10m"), Name: cloudflare.F("My Workspace One Integration"), - Type: cloudflare.F(cloudflare.DevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegrationParamsTypeWorkspaceOne), + Type: cloudflare.F(cloudflare.DevicePostureIntegrationUpdateParamsTypeWorkspaceOne), }, ) if err != nil { @@ -124,7 +94,7 @@ func TestDevicePostureIntegrationDevicePostureIntegrationsNewDevicePostureIntegr } } -func TestDevicePostureIntegrationDevicePostureIntegrationsListDevicePostureIntegrations(t *testing.T) { +func TestDevicePostureIntegrationDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -140,7 +110,11 @@ func TestDevicePostureIntegrationDevicePostureIntegrationsListDevicePostureInteg option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Postures.Integrations.DevicePostureIntegrationsListDevicePostureIntegrations(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Postures.Integrations.Delete( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/devicerevoke.go b/devicerevoke.go index 9416e18f835..28643e3940d 100644 --- a/devicerevoke.go +++ b/devicerevoke.go @@ -35,9 +35,9 @@ func NewDeviceRevokeService(opts ...option.RequestOption) (r *DeviceRevokeServic } // Revokes a list of devices. -func (r *DeviceRevokeService) DevicesRevokeDevices(ctx context.Context, identifier interface{}, body DeviceRevokeDevicesRevokeDevicesParams, opts ...option.RequestOption) (res *DeviceRevokeDevicesRevokeDevicesResponse, err error) { +func (r *DeviceRevokeService) New(ctx context.Context, identifier interface{}, body DeviceRevokeNewParams, opts ...option.RequestOption) (res *DeviceRevokeNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceRevokeDevicesRevokeDevicesResponseEnvelope + var env DeviceRevokeNewResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/revoke", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -47,15 +47,14 @@ func (r *DeviceRevokeService) DevicesRevokeDevices(ctx context.Context, identifi return } -// Union satisfied by [DeviceRevokeDevicesRevokeDevicesResponseUnknown] or -// [shared.UnionString]. -type DeviceRevokeDevicesRevokeDevicesResponse interface { - ImplementsDeviceRevokeDevicesRevokeDevicesResponse() +// Union satisfied by [DeviceRevokeNewResponseUnknown] or [shared.UnionString]. +type DeviceRevokeNewResponse interface { + ImplementsDeviceRevokeNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DeviceRevokeDevicesRevokeDevicesResponse)(nil)).Elem(), + reflect.TypeOf((*DeviceRevokeNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -64,27 +63,27 @@ func init() { ) } -type DeviceRevokeDevicesRevokeDevicesParams struct { +type DeviceRevokeNewParams struct { // A list of device ids to revoke. Body param.Field[[]string] `json:"body,required"` } -func (r DeviceRevokeDevicesRevokeDevicesParams) MarshalJSON() (data []byte, err error) { +func (r DeviceRevokeNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type DeviceRevokeDevicesRevokeDevicesResponseEnvelope struct { - Errors []DeviceRevokeDevicesRevokeDevicesResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceRevokeDevicesRevokeDevicesResponseEnvelopeMessages `json:"messages,required"` - Result DeviceRevokeDevicesRevokeDevicesResponse `json:"result,required,nullable"` +type DeviceRevokeNewResponseEnvelope struct { + Errors []DeviceRevokeNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceRevokeNewResponseEnvelopeMessages `json:"messages,required"` + Result DeviceRevokeNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceRevokeDevicesRevokeDevicesResponseEnvelopeSuccess `json:"success,required"` - JSON deviceRevokeDevicesRevokeDevicesResponseEnvelopeJSON `json:"-"` + Success DeviceRevokeNewResponseEnvelopeSuccess `json:"success,required"` + JSON deviceRevokeNewResponseEnvelopeJSON `json:"-"` } -// deviceRevokeDevicesRevokeDevicesResponseEnvelopeJSON contains the JSON metadata -// for the struct [DeviceRevokeDevicesRevokeDevicesResponseEnvelope] -type deviceRevokeDevicesRevokeDevicesResponseEnvelopeJSON struct { +// deviceRevokeNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceRevokeNewResponseEnvelope] +type deviceRevokeNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -93,52 +92,51 @@ type deviceRevokeDevicesRevokeDevicesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceRevokeDevicesRevokeDevicesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceRevokeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceRevokeDevicesRevokeDevicesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceRevokeDevicesRevokeDevicesResponseEnvelopeErrorsJSON `json:"-"` +type DeviceRevokeNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceRevokeNewResponseEnvelopeErrorsJSON `json:"-"` } -// deviceRevokeDevicesRevokeDevicesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [DeviceRevokeDevicesRevokeDevicesResponseEnvelopeErrors] -type deviceRevokeDevicesRevokeDevicesResponseEnvelopeErrorsJSON struct { +// deviceRevokeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceRevokeNewResponseEnvelopeErrors] +type deviceRevokeNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceRevokeDevicesRevokeDevicesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceRevokeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceRevokeDevicesRevokeDevicesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceRevokeDevicesRevokeDevicesResponseEnvelopeMessagesJSON `json:"-"` +type DeviceRevokeNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceRevokeNewResponseEnvelopeMessagesJSON `json:"-"` } -// deviceRevokeDevicesRevokeDevicesResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [DeviceRevokeDevicesRevokeDevicesResponseEnvelopeMessages] -type deviceRevokeDevicesRevokeDevicesResponseEnvelopeMessagesJSON struct { +// deviceRevokeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceRevokeNewResponseEnvelopeMessages] +type deviceRevokeNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceRevokeDevicesRevokeDevicesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceRevokeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceRevokeDevicesRevokeDevicesResponseEnvelopeSuccess bool +type DeviceRevokeNewResponseEnvelopeSuccess bool const ( - DeviceRevokeDevicesRevokeDevicesResponseEnvelopeSuccessTrue DeviceRevokeDevicesRevokeDevicesResponseEnvelopeSuccess = true + DeviceRevokeNewResponseEnvelopeSuccessTrue DeviceRevokeNewResponseEnvelopeSuccess = true ) diff --git a/devicerevoke_test.go b/devicerevoke_test.go index c7c80900e3d..7c333d38d5d 100644 --- a/devicerevoke_test.go +++ b/devicerevoke_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceRevokeDevicesRevokeDevices(t *testing.T) { +func TestDeviceRevokeNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestDeviceRevokeDevicesRevokeDevices(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Revokes.DevicesRevokeDevices( + _, err := client.Devices.Revokes.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DeviceRevokeDevicesRevokeDevicesParams{ + cloudflare.DeviceRevokeNewParams{ Body: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }, ) diff --git a/devicesetting.go b/devicesetting.go index 18fcbca32e2..4f0f05ca2b0 100644 --- a/devicesetting.go +++ b/devicesetting.go @@ -32,9 +32,9 @@ func NewDeviceSettingService(opts ...option.RequestOption) (r *DeviceSettingServ } // Describes the current device settings for a Zero Trust account. -func (r *DeviceSettingService) ZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse, err error) { +func (r *DeviceSettingService) List(ctx context.Context, identifier interface{}, opts ...option.RequestOption) (res *DeviceSettingListResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelope + var env DeviceSettingListResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/settings", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,9 +45,9 @@ func (r *DeviceSettingService) ZeroTrustAccountsGetDeviceSettingsForZeroTrustAcc } // Updates the current device settings for a Zero Trust account. -func (r *DeviceSettingService) ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccount(ctx context.Context, identifier interface{}, body DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountParams, opts ...option.RequestOption) (res *DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse, err error) { +func (r *DeviceSettingService) Replace(ctx context.Context, identifier interface{}, body DeviceSettingReplaceParams, opts ...option.RequestOption) (res *DeviceSettingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelope + var env DeviceSettingReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/settings", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -57,7 +57,7 @@ func (r *DeviceSettingService) ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTr return } -type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse struct { +type DeviceSettingListResponse struct { // Enable gateway proxy filtering on TCP. GatewayProxyEnabled bool `json:"gateway_proxy_enabled"` // Enable gateway proxy filtering on UDP. @@ -65,14 +65,13 @@ type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse // Enable installation of cloudflare managed root certificate. RootCertificateInstallationEnabled bool `json:"root_certificate_installation_enabled"` // Enable using CGNAT virtual IPv4. - UseZtVirtualIP bool `json:"use_zt_virtual_ip"` - JSON deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseJSON `json:"-"` + UseZtVirtualIP bool `json:"use_zt_virtual_ip"` + JSON deviceSettingListResponseJSON `json:"-"` } -// deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse] -type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseJSON struct { +// deviceSettingListResponseJSON contains the JSON metadata for the struct +// [DeviceSettingListResponse] +type deviceSettingListResponseJSON struct { GatewayProxyEnabled apijson.Field GatewayUdpProxyEnabled apijson.Field RootCertificateInstallationEnabled apijson.Field @@ -81,11 +80,11 @@ type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseJ ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse struct { +type DeviceSettingReplaceResponse struct { // Enable gateway proxy filtering on TCP. GatewayProxyEnabled bool `json:"gateway_proxy_enabled"` // Enable gateway proxy filtering on UDP. @@ -93,14 +92,13 @@ type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountRes // Enable installation of cloudflare managed root certificate. RootCertificateInstallationEnabled bool `json:"root_certificate_installation_enabled"` // Enable using CGNAT virtual IPv4. - UseZtVirtualIP bool `json:"use_zt_virtual_ip"` - JSON deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseJSON `json:"-"` + UseZtVirtualIP bool `json:"use_zt_virtual_ip"` + JSON deviceSettingReplaceResponseJSON `json:"-"` } -// deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse] -type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseJSON struct { +// deviceSettingReplaceResponseJSON contains the JSON metadata for the struct +// [DeviceSettingReplaceResponse] +type deviceSettingReplaceResponseJSON struct { GatewayProxyEnabled apijson.Field GatewayUdpProxyEnabled apijson.Field RootCertificateInstallationEnabled apijson.Field @@ -109,23 +107,22 @@ type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountRes ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelope struct { - Errors []DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessages `json:"messages,required"` - Result DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponse `json:"result,required,nullable"` +type DeviceSettingListResponseEnvelope struct { + Errors []DeviceSettingListResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceSettingListResponseEnvelopeMessages `json:"messages,required"` + Result DeviceSettingListResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeSuccess `json:"success,required"` - JSON deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeJSON `json:"-"` + Success DeviceSettingListResponseEnvelopeSuccess `json:"success,required"` + JSON deviceSettingListResponseEnvelopeJSON `json:"-"` } -// deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelope] -type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeJSON struct { +// deviceSettingListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceSettingListResponseEnvelope] +type deviceSettingListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -134,58 +131,56 @@ type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseE ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrorsJSON `json:"-"` +type DeviceSettingListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceSettingListResponseEnvelopeErrorsJSON `json:"-"` } -// deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrors] -type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrorsJSON struct { +// deviceSettingListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceSettingListResponseEnvelopeErrors] +type deviceSettingListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessagesJSON `json:"-"` +type DeviceSettingListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceSettingListResponseEnvelopeMessagesJSON `json:"-"` } -// deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessages] -type deviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessagesJSON struct { +// deviceSettingListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceSettingListResponseEnvelopeMessages] +type deviceSettingListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeSuccess bool +type DeviceSettingListResponseEnvelopeSuccess bool const ( - DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeSuccessTrue DeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccountResponseEnvelopeSuccess = true + DeviceSettingListResponseEnvelopeSuccessTrue DeviceSettingListResponseEnvelopeSuccess = true ) -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountParams struct { +type DeviceSettingReplaceParams struct { // Enable gateway proxy filtering on TCP. GatewayProxyEnabled param.Field[bool] `json:"gateway_proxy_enabled"` // Enable gateway proxy filtering on UDP. @@ -196,23 +191,22 @@ type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountPar UseZtVirtualIP param.Field[bool] `json:"use_zt_virtual_ip"` } -func (r DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountParams) MarshalJSON() (data []byte, err error) { +func (r DeviceSettingReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelope struct { - Errors []DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessages `json:"messages,required"` - Result DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponse `json:"result,required,nullable"` +type DeviceSettingReplaceResponseEnvelope struct { + Errors []DeviceSettingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceSettingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DeviceSettingReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeSuccess `json:"success,required"` - JSON deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeJSON `json:"-"` + Success DeviceSettingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON deviceSettingReplaceResponseEnvelopeJSON `json:"-"` } -// deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelope] -type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeJSON struct { +// deviceSettingReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DeviceSettingReplaceResponseEnvelope] +type deviceSettingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -221,53 +215,51 @@ type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountRes ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON `json:"-"` +type DeviceSettingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceSettingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrors] -type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON struct { +// deviceSettingReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DeviceSettingReplaceResponseEnvelopeErrors] +type deviceSettingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON `json:"-"` +type DeviceSettingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceSettingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessages] -type deviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON struct { +// deviceSettingReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DeviceSettingReplaceResponseEnvelopeMessages] +type deviceSettingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceSettingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeSuccess bool +type DeviceSettingReplaceResponseEnvelopeSuccess bool const ( - DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeSuccessTrue DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountResponseEnvelopeSuccess = true + DeviceSettingReplaceResponseEnvelopeSuccessTrue DeviceSettingReplaceResponseEnvelopeSuccess = true ) diff --git a/devicesetting_test.go b/devicesetting_test.go index 3afa380ee82..462aa6f1ade 100644 --- a/devicesetting_test.go +++ b/devicesetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(t *testing.T) { +func TestDeviceSettingList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(t *t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Settings.ZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Devices.Settings.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestDeviceSettingZeroTrustAccountsGetDeviceSettingsForZeroTrustAccount(t *t } } -func TestDeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountWithOptionalParams(t *testing.T) { +func TestDeviceSettingReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestDeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccoun option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Settings.ZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccount( + _, err := client.Devices.Settings.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DeviceSettingZeroTrustAccountsUpdateDeviceSettingsForTheZeroTrustAccountParams{ + cloudflare.DeviceSettingReplaceParams{ GatewayProxyEnabled: cloudflare.F(true), GatewayUdpProxyEnabled: cloudflare.F(true), RootCertificateInstallationEnabled: cloudflare.F(true), diff --git a/deviceunrevoke.go b/deviceunrevoke.go index e20c073b5ca..58e1be68723 100644 --- a/deviceunrevoke.go +++ b/deviceunrevoke.go @@ -35,9 +35,9 @@ func NewDeviceUnrevokeService(opts ...option.RequestOption) (r *DeviceUnrevokeSe } // Unrevokes a list of devices. -func (r *DeviceUnrevokeService) DevicesUnrevokeDevices(ctx context.Context, identifier interface{}, body DeviceUnrevokeDevicesUnrevokeDevicesParams, opts ...option.RequestOption) (res *DeviceUnrevokeDevicesUnrevokeDevicesResponse, err error) { +func (r *DeviceUnrevokeService) New(ctx context.Context, identifier interface{}, body DeviceUnrevokeNewParams, opts ...option.RequestOption) (res *DeviceUnrevokeNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelope + var env DeviceUnrevokeNewResponseEnvelope path := fmt.Sprintf("accounts/%v/devices/unrevoke", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -47,15 +47,14 @@ func (r *DeviceUnrevokeService) DevicesUnrevokeDevices(ctx context.Context, iden return } -// Union satisfied by [DeviceUnrevokeDevicesUnrevokeDevicesResponseUnknown] or -// [shared.UnionString]. -type DeviceUnrevokeDevicesUnrevokeDevicesResponse interface { - ImplementsDeviceUnrevokeDevicesUnrevokeDevicesResponse() +// Union satisfied by [DeviceUnrevokeNewResponseUnknown] or [shared.UnionString]. +type DeviceUnrevokeNewResponse interface { + ImplementsDeviceUnrevokeNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DeviceUnrevokeDevicesUnrevokeDevicesResponse)(nil)).Elem(), + reflect.TypeOf((*DeviceUnrevokeNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -64,27 +63,27 @@ func init() { ) } -type DeviceUnrevokeDevicesUnrevokeDevicesParams struct { +type DeviceUnrevokeNewParams struct { // A list of device ids to unrevoke. Body param.Field[[]string] `json:"body,required"` } -func (r DeviceUnrevokeDevicesUnrevokeDevicesParams) MarshalJSON() (data []byte, err error) { +func (r DeviceUnrevokeNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelope struct { - Errors []DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrors `json:"errors,required"` - Messages []DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessages `json:"messages,required"` - Result DeviceUnrevokeDevicesUnrevokeDevicesResponse `json:"result,required,nullable"` +type DeviceUnrevokeNewResponseEnvelope struct { + Errors []DeviceUnrevokeNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DeviceUnrevokeNewResponseEnvelopeMessages `json:"messages,required"` + Result DeviceUnrevokeNewResponse `json:"result,required,nullable"` // Whether the API call was successful. - Success DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeSuccess `json:"success,required"` - JSON deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeJSON `json:"-"` + Success DeviceUnrevokeNewResponseEnvelopeSuccess `json:"success,required"` + JSON deviceUnrevokeNewResponseEnvelopeJSON `json:"-"` } -// deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeJSON contains the JSON -// metadata for the struct [DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelope] -type deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeJSON struct { +// deviceUnrevokeNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [DeviceUnrevokeNewResponseEnvelope] +type deviceUnrevokeNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -93,53 +92,51 @@ type deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceUnrevokeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrorsJSON `json:"-"` +type DeviceUnrevokeNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceUnrevokeNewResponseEnvelopeErrorsJSON `json:"-"` } -// deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrors] -type deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrorsJSON struct { +// deviceUnrevokeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DeviceUnrevokeNewResponseEnvelopeErrors] +type deviceUnrevokeNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceUnrevokeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessagesJSON `json:"-"` +type DeviceUnrevokeNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON deviceUnrevokeNewResponseEnvelopeMessagesJSON `json:"-"` } -// deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessages] -type deviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessagesJSON struct { +// deviceUnrevokeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DeviceUnrevokeNewResponseEnvelopeMessages] +type deviceUnrevokeNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DeviceUnrevokeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeSuccess bool +type DeviceUnrevokeNewResponseEnvelopeSuccess bool const ( - DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeSuccessTrue DeviceUnrevokeDevicesUnrevokeDevicesResponseEnvelopeSuccess = true + DeviceUnrevokeNewResponseEnvelopeSuccessTrue DeviceUnrevokeNewResponseEnvelopeSuccess = true ) diff --git a/deviceunrevoke_test.go b/deviceunrevoke_test.go index fb72b91bece..c7900d05ead 100644 --- a/deviceunrevoke_test.go +++ b/deviceunrevoke_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDeviceUnrevokeDevicesUnrevokeDevices(t *testing.T) { +func TestDeviceUnrevokeNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestDeviceUnrevokeDevicesUnrevokeDevices(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Devices.Unrevokes.DevicesUnrevokeDevices( + _, err := client.Devices.Unrevokes.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.DeviceUnrevokeDevicesUnrevokeDevicesParams{ + cloudflare.DeviceUnrevokeNewParams{ Body: cloudflare.F([]string{"f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"}), }, ) diff --git a/diagnostictraceroute.go b/diagnostictraceroute.go index 492ed6cbd83..d62abb9fe3d 100644 --- a/diagnostictraceroute.go +++ b/diagnostictraceroute.go @@ -32,9 +32,9 @@ func NewDiagnosticTracerouteService(opts ...option.RequestOption) (r *Diagnostic } // Run traceroutes from Cloudflare colos. -func (r *DiagnosticTracerouteService) DiagnosticsTraceroute(ctx context.Context, accountID string, body DiagnosticTracerouteDiagnosticsTracerouteParams, opts ...option.RequestOption) (res *[]DiagnosticTracerouteDiagnosticsTracerouteResponse, err error) { +func (r *DiagnosticTracerouteService) New(ctx context.Context, accountID string, body DiagnosticTracerouteNewParams, opts ...option.RequestOption) (res *[]DiagnosticTracerouteNewResponse, err error) { opts = append(r.Options[:], opts...) - var env DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelope + var env DiagnosticTracerouteNewResponseEnvelope path := fmt.Sprintf("accounts/%s/diagnostics/traceroute", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -44,41 +44,41 @@ func (r *DiagnosticTracerouteService) DiagnosticsTraceroute(ctx context.Context, return } -type DiagnosticTracerouteDiagnosticsTracerouteResponse struct { - Colos []DiagnosticTracerouteDiagnosticsTracerouteResponseColo `json:"colos"` +type DiagnosticTracerouteNewResponse struct { + Colos []DiagnosticTracerouteNewResponseColo `json:"colos"` // The target hostname, IPv6, or IPv6 address. - Target string `json:"target"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseJSON `json:"-"` + Target string `json:"target"` + JSON diagnosticTracerouteNewResponseJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseJSON contains the JSON metadata -// for the struct [DiagnosticTracerouteDiagnosticsTracerouteResponse] -type diagnosticTracerouteDiagnosticsTracerouteResponseJSON struct { +// diagnosticTracerouteNewResponseJSON contains the JSON metadata for the struct +// [DiagnosticTracerouteNewResponse] +type diagnosticTracerouteNewResponseJSON struct { Colos apijson.Field Target apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteResponseColo struct { - Colo DiagnosticTracerouteDiagnosticsTracerouteResponseColosColo `json:"colo"` +type DiagnosticTracerouteNewResponseColo struct { + Colo DiagnosticTracerouteNewResponseColosColo `json:"colo"` // Errors resulting from collecting traceroute from colo to target. - Error DiagnosticTracerouteDiagnosticsTracerouteResponseColosError `json:"error"` - Hops []DiagnosticTracerouteDiagnosticsTracerouteResponseColosHop `json:"hops"` + Error DiagnosticTracerouteNewResponseColosError `json:"error"` + Hops []DiagnosticTracerouteNewResponseColosHop `json:"hops"` // Aggregated statistics from all hops about the target. TargetSummary interface{} `json:"target_summary"` // Total time of traceroute in ms. - TracerouteTimeMs int64 `json:"traceroute_time_ms"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseColoJSON `json:"-"` + TracerouteTimeMs int64 `json:"traceroute_time_ms"` + JSON diagnosticTracerouteNewResponseColoJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseColoJSON contains the JSON -// metadata for the struct [DiagnosticTracerouteDiagnosticsTracerouteResponseColo] -type diagnosticTracerouteDiagnosticsTracerouteResponseColoJSON struct { +// diagnosticTracerouteNewResponseColoJSON contains the JSON metadata for the +// struct [DiagnosticTracerouteNewResponseColo] +type diagnosticTracerouteNewResponseColoJSON struct { Colo apijson.Field Error apijson.Field Hops apijson.Field @@ -88,59 +88,57 @@ type diagnosticTracerouteDiagnosticsTracerouteResponseColoJSON struct { ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseColo) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseColo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteResponseColosColo struct { +type DiagnosticTracerouteNewResponseColosColo struct { // Source colo city. City string `json:"city"` // Source colo name. - Name string `json:"name"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseColosColoJSON `json:"-"` + Name string `json:"name"` + JSON diagnosticTracerouteNewResponseColosColoJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseColosColoJSON contains the JSON -// metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseColosColo] -type diagnosticTracerouteDiagnosticsTracerouteResponseColosColoJSON struct { +// diagnosticTracerouteNewResponseColosColoJSON contains the JSON metadata for the +// struct [DiagnosticTracerouteNewResponseColosColo] +type diagnosticTracerouteNewResponseColosColoJSON struct { City apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseColosColo) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseColosColo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Errors resulting from collecting traceroute from colo to target. -type DiagnosticTracerouteDiagnosticsTracerouteResponseColosError string +type DiagnosticTracerouteNewResponseColosError string const ( - DiagnosticTracerouteDiagnosticsTracerouteResponseColosErrorEmpty DiagnosticTracerouteDiagnosticsTracerouteResponseColosError = "" - DiagnosticTracerouteDiagnosticsTracerouteResponseColosErrorCouldNotGatherTracerouteDataCode1 DiagnosticTracerouteDiagnosticsTracerouteResponseColosError = "Could not gather traceroute data: Code 1" - DiagnosticTracerouteDiagnosticsTracerouteResponseColosErrorCouldNotGatherTracerouteDataCode2 DiagnosticTracerouteDiagnosticsTracerouteResponseColosError = "Could not gather traceroute data: Code 2" - DiagnosticTracerouteDiagnosticsTracerouteResponseColosErrorCouldNotGatherTracerouteDataCode3 DiagnosticTracerouteDiagnosticsTracerouteResponseColosError = "Could not gather traceroute data: Code 3" - DiagnosticTracerouteDiagnosticsTracerouteResponseColosErrorCouldNotGatherTracerouteDataCode4 DiagnosticTracerouteDiagnosticsTracerouteResponseColosError = "Could not gather traceroute data: Code 4" + DiagnosticTracerouteNewResponseColosErrorEmpty DiagnosticTracerouteNewResponseColosError = "" + DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode1 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 1" + DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode2 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 2" + DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode3 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 3" + DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode4 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 4" ) -type DiagnosticTracerouteDiagnosticsTracerouteResponseColosHop struct { +type DiagnosticTracerouteNewResponseColosHop struct { // An array of node objects. - Nodes []DiagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNode `json:"nodes"` + Nodes []DiagnosticTracerouteNewResponseColosHopsNode `json:"nodes"` // Number of packets where no response was received. PacketsLost int64 `json:"packets_lost"` // Number of packets sent with specified TTL. PacketsSent int64 `json:"packets_sent"` // The time to live (TTL). - PacketsTTL int64 `json:"packets_ttl"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseColosHopJSON `json:"-"` + PacketsTTL int64 `json:"packets_ttl"` + JSON diagnosticTracerouteNewResponseColosHopJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseColosHopJSON contains the JSON -// metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseColosHop] -type diagnosticTracerouteDiagnosticsTracerouteResponseColosHopJSON struct { +// diagnosticTracerouteNewResponseColosHopJSON contains the JSON metadata for the +// struct [DiagnosticTracerouteNewResponseColosHop] +type diagnosticTracerouteNewResponseColosHopJSON struct { Nodes apijson.Field PacketsLost apijson.Field PacketsSent apijson.Field @@ -149,11 +147,11 @@ type diagnosticTracerouteDiagnosticsTracerouteResponseColosHopJSON struct { ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseColosHop) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseColosHop) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNode struct { +type DiagnosticTracerouteNewResponseColosHopsNode struct { // AS number associated with the node object. Asn string `json:"asn"` // IP address of the node. @@ -173,14 +171,13 @@ type DiagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNode struct { // Number of packets with a response from this node. PacketCount int64 `json:"packet_count"` // Standard deviation of the RTTs in ms. - StdDevRttMs float64 `json:"std_dev_rtt_ms"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNodeJSON `json:"-"` + StdDevRttMs float64 `json:"std_dev_rtt_ms"` + JSON diagnosticTracerouteNewResponseColosHopsNodeJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNodeJSON contains the -// JSON metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNode] -type diagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNodeJSON struct { +// diagnosticTracerouteNewResponseColosHopsNodeJSON contains the JSON metadata for +// the struct [DiagnosticTracerouteNewResponseColosHopsNode] +type diagnosticTracerouteNewResponseColosHopsNodeJSON struct { Asn apijson.Field IP apijson.Field Labels apijson.Field @@ -194,27 +191,27 @@ type diagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNodeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseColosHopsNode) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseColosHopsNode) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteParams struct { +type DiagnosticTracerouteNewParams struct { Targets param.Field[[]string] `json:"targets,required"` // If no source colo names specified, all colos will be used. China colos are // unavailable for traceroutes. - Colos param.Field[[]string] `json:"colos"` - Options param.Field[DiagnosticTracerouteDiagnosticsTracerouteParamsOptions] `json:"options"` + Colos param.Field[[]string] `json:"colos"` + Options param.Field[DiagnosticTracerouteNewParamsOptions] `json:"options"` } -func (r DiagnosticTracerouteDiagnosticsTracerouteParams) MarshalJSON() (data []byte, err error) { +func (r DiagnosticTracerouteNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DiagnosticTracerouteDiagnosticsTracerouteParamsOptions struct { +type DiagnosticTracerouteNewParamsOptions struct { // Max TTL. MaxTTL param.Field[int64] `json:"max_ttl"` // Type of packet sent. - PacketType param.Field[DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType] `json:"packet_type"` + PacketType param.Field[DiagnosticTracerouteNewParamsOptionsPacketType] `json:"packet_type"` // Number of packets sent at each TTL. PacketsPerTTL param.Field[int64] `json:"packets_per_ttl"` // For UDP and TCP, specifies the destination port. For ICMP, specifies the initial @@ -225,35 +222,34 @@ type DiagnosticTracerouteDiagnosticsTracerouteParamsOptions struct { WaitTime param.Field[int64] `json:"wait_time"` } -func (r DiagnosticTracerouteDiagnosticsTracerouteParamsOptions) MarshalJSON() (data []byte, err error) { +func (r DiagnosticTracerouteNewParamsOptions) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of packet sent. -type DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType string +type DiagnosticTracerouteNewParamsOptionsPacketType string const ( - DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeIcmp DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType = "icmp" - DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeTcp DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType = "tcp" - DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeUdp DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType = "udp" - DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeGre DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType = "gre" - DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeGreIcmp DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketType = "gre+icmp" + DiagnosticTracerouteNewParamsOptionsPacketTypeIcmp DiagnosticTracerouteNewParamsOptionsPacketType = "icmp" + DiagnosticTracerouteNewParamsOptionsPacketTypeTcp DiagnosticTracerouteNewParamsOptionsPacketType = "tcp" + DiagnosticTracerouteNewParamsOptionsPacketTypeUdp DiagnosticTracerouteNewParamsOptionsPacketType = "udp" + DiagnosticTracerouteNewParamsOptionsPacketTypeGre DiagnosticTracerouteNewParamsOptionsPacketType = "gre" + DiagnosticTracerouteNewParamsOptionsPacketTypeGreIcmp DiagnosticTracerouteNewParamsOptionsPacketType = "gre+icmp" ) -type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelope struct { - Errors []DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrors `json:"errors,required"` - Messages []DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessages `json:"messages,required"` - Result []DiagnosticTracerouteDiagnosticsTracerouteResponse `json:"result,required,nullable"` +type DiagnosticTracerouteNewResponseEnvelope struct { + Errors []DiagnosticTracerouteNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DiagnosticTracerouteNewResponseEnvelopeMessages `json:"messages,required"` + Result []DiagnosticTracerouteNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfo `json:"result_info"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeJSON `json:"-"` + Success DiagnosticTracerouteNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DiagnosticTracerouteNewResponseEnvelopeResultInfo `json:"result_info"` + JSON diagnosticTracerouteNewResponseEnvelopeJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelope] -type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeJSON struct { +// diagnosticTracerouteNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [DiagnosticTracerouteNewResponseEnvelope] +type diagnosticTracerouteNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -263,58 +259,56 @@ type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrorsJSON `json:"-"` +type DiagnosticTracerouteNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON diagnosticTracerouteNewResponseEnvelopeErrorsJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrors] -type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrorsJSON struct { +// diagnosticTracerouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DiagnosticTracerouteNewResponseEnvelopeErrors] +type diagnosticTracerouteNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessagesJSON `json:"-"` +type DiagnosticTracerouteNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON diagnosticTracerouteNewResponseEnvelopeMessagesJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessages] -type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessagesJSON struct { +// diagnosticTracerouteNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DiagnosticTracerouteNewResponseEnvelopeMessages] +type diagnosticTracerouteNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeSuccess bool +type DiagnosticTracerouteNewResponseEnvelopeSuccess bool const ( - DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeSuccessTrue DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeSuccess = true + DiagnosticTracerouteNewResponseEnvelopeSuccessTrue DiagnosticTracerouteNewResponseEnvelopeSuccess = true ) -type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfo struct { +type DiagnosticTracerouteNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -322,14 +316,13 @@ type DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfo struct // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON diagnosticTracerouteNewResponseEnvelopeResultInfoJSON `json:"-"` } -// diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfo] -type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfoJSON struct { +// diagnosticTracerouteNewResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [DiagnosticTracerouteNewResponseEnvelopeResultInfo] +type diagnosticTracerouteNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -338,6 +331,6 @@ type diagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfoJSON str ExtraFields map[string]apijson.Field } -func (r *DiagnosticTracerouteDiagnosticsTracerouteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DiagnosticTracerouteNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/diagnostictraceroute_test.go b/diagnostictraceroute_test.go index db5376fa5ec..e9b340ef228 100644 --- a/diagnostictraceroute_test.go +++ b/diagnostictraceroute_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDiagnosticTracerouteDiagnosticsTracerouteWithOptionalParams(t *testing.T) { +func TestDiagnosticTracerouteNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,15 @@ func TestDiagnosticTracerouteDiagnosticsTracerouteWithOptionalParams(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Diagnostics.Traceroutes.DiagnosticsTraceroute( + _, err := client.Diagnostics.Traceroutes.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.DiagnosticTracerouteDiagnosticsTracerouteParams{ + cloudflare.DiagnosticTracerouteNewParams{ Targets: cloudflare.F([]string{"203.0.113.1", "cloudflare.com"}), Colos: cloudflare.F([]string{"den", "sin"}), - Options: cloudflare.F(cloudflare.DiagnosticTracerouteDiagnosticsTracerouteParamsOptions{ + Options: cloudflare.F(cloudflare.DiagnosticTracerouteNewParamsOptions{ MaxTTL: cloudflare.F(int64(15)), - PacketType: cloudflare.F(cloudflare.DiagnosticTracerouteDiagnosticsTracerouteParamsOptionsPacketTypeIcmp), + PacketType: cloudflare.F(cloudflare.DiagnosticTracerouteNewParamsOptionsPacketTypeIcmp), PacketsPerTTL: cloudflare.F(int64(0)), Port: cloudflare.F(int64(0)), WaitTime: cloudflare.F(int64(1)), diff --git a/dispatcherscript.go b/dispatcherscript.go index e9f5f4a780d..597c9d8df2c 100644 --- a/dispatcherscript.go +++ b/dispatcherscript.go @@ -38,19 +38,6 @@ func NewDispatcherScriptService(opts ...option.RequestOption) (r *DispatcherScri return } -// Upload a worker module to a Workers for Platforms namespace. -func (r *DispatcherScriptService) Update(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body DispatcherScriptUpdateParams, opts ...option.RequestOption) (res *DispatcherScriptUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env DispatcherScriptUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s", accountID, dispatchNamespace, scriptName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Delete a worker from a Workers for Platforms namespace. This call has no // response body on a successful delete. func (r *DispatcherScriptService) Delete(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body DispatcherScriptDeleteParams, opts ...option.RequestOption) (err error) { @@ -74,7 +61,47 @@ func (r *DispatcherScriptService) Get(ctx context.Context, accountID string, dis return } -type DispatcherScriptUpdateResponse struct { +// Upload a worker module to a Workers for Platforms namespace. +func (r *DispatcherScriptService) Replace(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, body DispatcherScriptReplaceParams, opts ...option.RequestOption) (res *DispatcherScriptReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env DispatcherScriptReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s", accountID, dispatchNamespace, scriptName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Details about a worker uploaded to a Workers for Platforms namespace. +type DispatcherScriptGetResponse struct { + // When the script was created. + CreatedOn time.Time `json:"created_on" format:"date-time"` + // Name of the Workers for Platforms dispatch namespace. + DispatchNamespace string `json:"dispatch_namespace"` + // When the script was last modified. + ModifiedOn time.Time `json:"modified_on" format:"date-time"` + Script DispatcherScriptGetResponseScript `json:"script"` + JSON dispatcherScriptGetResponseJSON `json:"-"` +} + +// dispatcherScriptGetResponseJSON contains the JSON metadata for the struct +// [DispatcherScriptGetResponse] +type dispatcherScriptGetResponseJSON struct { + CreatedOn apijson.Field + DispatchNamespace apijson.Field + ModifiedOn apijson.Field + Script apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DispatcherScriptGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DispatcherScriptGetResponseScript struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -90,15 +117,15 @@ type DispatcherScriptUpdateResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []DispatcherScriptUpdateResponseTailConsumer `json:"tail_consumers"` + TailConsumers []DispatcherScriptGetResponseScriptTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON dispatcherScriptUpdateResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON dispatcherScriptGetResponseScriptJSON `json:"-"` } -// dispatcherScriptUpdateResponseJSON contains the JSON metadata for the struct -// [DispatcherScriptUpdateResponse] -type dispatcherScriptUpdateResponseJSON struct { +// dispatcherScriptGetResponseScriptJSON contains the JSON metadata for the struct +// [DispatcherScriptGetResponseScript] +type dispatcherScriptGetResponseScriptJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -112,24 +139,24 @@ type dispatcherScriptUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptGetResponseScript) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type DispatcherScriptUpdateResponseTailConsumer struct { +type DispatcherScriptGetResponseScriptTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON dispatcherScriptUpdateResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON dispatcherScriptGetResponseScriptTailConsumerJSON `json:"-"` } -// dispatcherScriptUpdateResponseTailConsumerJSON contains the JSON metadata for -// the struct [DispatcherScriptUpdateResponseTailConsumer] -type dispatcherScriptUpdateResponseTailConsumerJSON struct { +// dispatcherScriptGetResponseScriptTailConsumerJSON contains the JSON metadata for +// the struct [DispatcherScriptGetResponseScriptTailConsumer] +type dispatcherScriptGetResponseScriptTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -137,38 +164,11 @@ type dispatcherScriptUpdateResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Details about a worker uploaded to a Workers for Platforms namespace. -type DispatcherScriptGetResponse struct { - // When the script was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // Name of the Workers for Platforms dispatch namespace. - DispatchNamespace string `json:"dispatch_namespace"` - // When the script was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - Script DispatcherScriptGetResponseScript `json:"script"` - JSON dispatcherScriptGetResponseJSON `json:"-"` -} - -// dispatcherScriptGetResponseJSON contains the JSON metadata for the struct -// [DispatcherScriptGetResponse] -type dispatcherScriptGetResponseJSON struct { - CreatedOn apijson.Field - DispatchNamespace apijson.Field - ModifiedOn apijson.Field - Script apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DispatcherScriptGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptGetResponseScriptTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DispatcherScriptGetResponseScript struct { +type DispatcherScriptReplaceResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -184,15 +184,15 @@ type DispatcherScriptGetResponseScript struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []DispatcherScriptGetResponseScriptTailConsumer `json:"tail_consumers"` + TailConsumers []DispatcherScriptReplaceResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON dispatcherScriptGetResponseScriptJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON dispatcherScriptReplaceResponseJSON `json:"-"` } -// dispatcherScriptGetResponseScriptJSON contains the JSON metadata for the struct -// [DispatcherScriptGetResponseScript] -type dispatcherScriptGetResponseScriptJSON struct { +// dispatcherScriptReplaceResponseJSON contains the JSON metadata for the struct +// [DispatcherScriptReplaceResponse] +type dispatcherScriptReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -206,24 +206,24 @@ type dispatcherScriptGetResponseScriptJSON struct { ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptGetResponseScript) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type DispatcherScriptGetResponseScriptTailConsumer struct { +type DispatcherScriptReplaceResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON dispatcherScriptGetResponseScriptTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON dispatcherScriptReplaceResponseTailConsumerJSON `json:"-"` } -// dispatcherScriptGetResponseScriptTailConsumerJSON contains the JSON metadata for -// the struct [DispatcherScriptGetResponseScriptTailConsumer] -type dispatcherScriptGetResponseScriptTailConsumerJSON struct { +// dispatcherScriptReplaceResponseTailConsumerJSON contains the JSON metadata for +// the struct [DispatcherScriptReplaceResponseTailConsumer] +type dispatcherScriptReplaceResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -231,26 +231,113 @@ type dispatcherScriptGetResponseScriptTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptGetResponseScriptTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptReplaceResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DispatcherScriptDeleteParams struct { + // If set to true, delete will not be stopped by associated service binding, + // durable object, or other binding. Any of these associated bindings/durable + // objects will be deleted along with the script. + Force param.Field[bool] `query:"force"` +} + +// URLQuery serializes [DispatcherScriptDeleteParams]'s query parameters as +// `url.Values`. +func (r DispatcherScriptDeleteParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type DispatcherScriptGetResponseEnvelope struct { + Errors []DispatcherScriptGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DispatcherScriptGetResponseEnvelopeMessages `json:"messages,required"` + // Details about a worker uploaded to a Workers for Platforms namespace. + Result DispatcherScriptGetResponse `json:"result,required"` + // Whether the API call was successful + Success DispatcherScriptGetResponseEnvelopeSuccess `json:"success,required"` + JSON dispatcherScriptGetResponseEnvelopeJSON `json:"-"` +} + +// dispatcherScriptGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [DispatcherScriptGetResponseEnvelope] +type dispatcherScriptGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DispatcherScriptGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DispatcherScriptGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dispatcherScriptGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// dispatcherScriptGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DispatcherScriptGetResponseEnvelopeErrors] +type dispatcherScriptGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DispatcherScriptGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DispatcherScriptGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dispatcherScriptGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// dispatcherScriptGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DispatcherScriptGetResponseEnvelopeMessages] +type dispatcherScriptGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DispatcherScriptGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +// Whether the API call was successful +type DispatcherScriptGetResponseEnvelopeSuccess bool + +const ( + DispatcherScriptGetResponseEnvelopeSuccessTrue DispatcherScriptGetResponseEnvelopeSuccess = true +) + // This interface is a union satisfied by one of the following: -// [DispatcherScriptUpdateParamsVariant0], [DispatcherScriptUpdateParamsVariant1]. -type DispatcherScriptUpdateParams interface { - ImplementsDispatcherScriptUpdateParams() +// [DispatcherScriptReplaceParamsVariant0], +// [DispatcherScriptReplaceParamsVariant1]. +type DispatcherScriptReplaceParams interface { + ImplementsDispatcherScriptReplaceParams() } -type DispatcherScriptUpdateParamsVariant0 struct { +type DispatcherScriptReplaceParamsVariant0 struct { // A module comprising a Worker script, often a javascript file. Multiple modules // may be provided as separate named parts, but at least one module must be present // and referenced in the metadata as `main_module` or `body_part` by part name. AnyPartName param.Field[[]io.Reader] `json:"" format:"binary"` // JSON encoded metadata about the uploaded parts and Worker configuration. - Metadata param.Field[DispatcherScriptUpdateParamsVariant0Metadata] `json:"metadata"` + Metadata param.Field[DispatcherScriptReplaceParamsVariant0Metadata] `json:"metadata"` } -func (r DispatcherScriptUpdateParamsVariant0) MarshalMultipart() (data []byte, contentType string, err error) { +func (r DispatcherScriptReplaceParamsVariant0) MarshalMultipart() (data []byte, contentType string, err error) { buf := bytes.NewBuffer(nil) writer := multipart.NewWriter(buf) err = apiform.MarshalRoot(r, writer) @@ -265,12 +352,12 @@ func (r DispatcherScriptUpdateParamsVariant0) MarshalMultipart() (data []byte, c return buf.Bytes(), writer.FormDataContentType(), nil } -func (DispatcherScriptUpdateParamsVariant0) ImplementsDispatcherScriptUpdateParams() { +func (DispatcherScriptReplaceParamsVariant0) ImplementsDispatcherScriptReplaceParams() { } // JSON encoded metadata about the uploaded parts and Worker configuration. -type DispatcherScriptUpdateParamsVariant0Metadata struct { +type DispatcherScriptReplaceParamsVariant0Metadata struct { // List of bindings available to the worker. Bindings param.Field[[]interface{}] `json:"bindings"` // Name of the part in the multipart request that contains the script (e.g. the @@ -292,33 +379,33 @@ type DispatcherScriptUpdateParamsVariant0Metadata struct { // the file exporting a `fetch` handler). Indicates a `module syntax` Worker. MainModule param.Field[string] `json:"main_module"` // Migrations to apply for Durable Objects associated with this Worker. - Migrations param.Field[DispatcherScriptUpdateParamsVariant0MetadataMigrations] `json:"migrations"` - Placement param.Field[DispatcherScriptUpdateParamsVariant0MetadataPlacement] `json:"placement"` + Migrations param.Field[DispatcherScriptReplaceParamsVariant0MetadataMigrations] `json:"migrations"` + Placement param.Field[DispatcherScriptReplaceParamsVariant0MetadataPlacement] `json:"placement"` // List of strings to use as tags for this Worker Tags param.Field[[]string] `json:"tags"` // List of Workers that will consume logs from the attached Worker. - TailConsumers param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataTailConsumer] `json:"tail_consumers"` + TailConsumers param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataTailConsumer] `json:"tail_consumers"` // Usage model to apply to invocations. - UsageModel param.Field[DispatcherScriptUpdateParamsVariant0MetadataUsageModel] `json:"usage_model"` + UsageModel param.Field[DispatcherScriptReplaceParamsVariant0MetadataUsageModel] `json:"usage_model"` // Key-value pairs to use as tags for this version of this Worker VersionTags param.Field[interface{}] `json:"version_tags"` } -func (r DispatcherScriptUpdateParamsVariant0Metadata) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0Metadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Migrations to apply for Durable Objects associated with this Worker. // // Satisfied by -// [DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations], -// [DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations]. -type DispatcherScriptUpdateParamsVariant0MetadataMigrations interface { - implementsDispatcherScriptUpdateParamsVariant0MetadataMigrations() +// [DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations], +// [DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations]. +type DispatcherScriptReplaceParamsVariant0MetadataMigrations interface { + implementsDispatcherScriptReplaceParamsVariant0MetadataMigrations() } // A single set of migrations to apply. -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. @@ -329,112 +416,112 @@ type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigr // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) implementsDispatcherScriptUpdateParamsVariant0MetadataMigrations() { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) implementsDispatcherScriptReplaceParamsVariant0MetadataMigrations() { } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations struct { // Tag to set as the latest migration tag. NewTag param.Field[string] `json:"new_tag"` // Tag used to verify against the latest migration tag for this Worker. If they // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // Migrations to apply in order. - Steps param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep] `json:"steps"` + Steps param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep] `json:"steps"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations) implementsDispatcherScriptUpdateParamsVariant0MetadataMigrations() { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations) implementsDispatcherScriptReplaceParamsVariant0MetadataMigrations() { } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. NewClasses param.Field[[]string] `json:"new_classes"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { +type DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DispatcherScriptUpdateParamsVariant0MetadataPlacement struct { +type DispatcherScriptReplaceParamsVariant0MetadataPlacement struct { // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported - Mode param.Field[DispatcherScriptUpdateParamsVariant0MetadataPlacementMode] `json:"mode"` + Mode param.Field[DispatcherScriptReplaceParamsVariant0MetadataPlacementMode] `json:"mode"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataPlacement) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataPlacement) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported -type DispatcherScriptUpdateParamsVariant0MetadataPlacementMode string +type DispatcherScriptReplaceParamsVariant0MetadataPlacementMode string const ( - DispatcherScriptUpdateParamsVariant0MetadataPlacementModeSmart DispatcherScriptUpdateParamsVariant0MetadataPlacementMode = "smart" + DispatcherScriptReplaceParamsVariant0MetadataPlacementModeSmart DispatcherScriptReplaceParamsVariant0MetadataPlacementMode = "smart" ) // A reference to a script that will consume logs from the attached Worker. -type DispatcherScriptUpdateParamsVariant0MetadataTailConsumer struct { +type DispatcherScriptReplaceParamsVariant0MetadataTailConsumer struct { // Name of Worker that is to be the consumer. Service param.Field[string] `json:"service,required"` // Optional environment if the Worker utilizes one. @@ -443,44 +530,44 @@ type DispatcherScriptUpdateParamsVariant0MetadataTailConsumer struct { Namespace param.Field[string] `json:"namespace"` } -func (r DispatcherScriptUpdateParamsVariant0MetadataTailConsumer) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant0MetadataTailConsumer) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Usage model to apply to invocations. -type DispatcherScriptUpdateParamsVariant0MetadataUsageModel string +type DispatcherScriptReplaceParamsVariant0MetadataUsageModel string const ( - DispatcherScriptUpdateParamsVariant0MetadataUsageModelBundled DispatcherScriptUpdateParamsVariant0MetadataUsageModel = "bundled" - DispatcherScriptUpdateParamsVariant0MetadataUsageModelUnbound DispatcherScriptUpdateParamsVariant0MetadataUsageModel = "unbound" + DispatcherScriptReplaceParamsVariant0MetadataUsageModelBundled DispatcherScriptReplaceParamsVariant0MetadataUsageModel = "bundled" + DispatcherScriptReplaceParamsVariant0MetadataUsageModelUnbound DispatcherScriptReplaceParamsVariant0MetadataUsageModel = "unbound" ) -type DispatcherScriptUpdateParamsVariant1 struct { +type DispatcherScriptReplaceParamsVariant1 struct { // Rollback message to be associated with this deployment. Only parsed when query // param `"rollback_to"` is present. Message param.Field[string] `json:"message"` } -func (r DispatcherScriptUpdateParamsVariant1) MarshalJSON() (data []byte, err error) { +func (r DispatcherScriptReplaceParamsVariant1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DispatcherScriptUpdateParamsVariant1) ImplementsDispatcherScriptUpdateParams() { +func (DispatcherScriptReplaceParamsVariant1) ImplementsDispatcherScriptReplaceParams() { } -type DispatcherScriptUpdateResponseEnvelope struct { - Errors []DispatcherScriptUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DispatcherScriptUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DispatcherScriptUpdateResponse `json:"result,required"` +type DispatcherScriptReplaceResponseEnvelope struct { + Errors []DispatcherScriptReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DispatcherScriptReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DispatcherScriptReplaceResponse `json:"result,required"` // Whether the API call was successful - Success DispatcherScriptUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON dispatcherScriptUpdateResponseEnvelopeJSON `json:"-"` + Success DispatcherScriptReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON dispatcherScriptReplaceResponseEnvelopeJSON `json:"-"` } -// dispatcherScriptUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [DispatcherScriptUpdateResponseEnvelope] -type dispatcherScriptUpdateResponseEnvelopeJSON struct { +// dispatcherScriptReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DispatcherScriptReplaceResponseEnvelope] +type dispatcherScriptReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -489,137 +576,51 @@ type dispatcherScriptUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DispatcherScriptUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dispatcherScriptUpdateResponseEnvelopeErrorsJSON `json:"-"` +type DispatcherScriptReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dispatcherScriptReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// dispatcherScriptUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [DispatcherScriptUpdateResponseEnvelopeErrors] -type dispatcherScriptUpdateResponseEnvelopeErrorsJSON struct { +// dispatcherScriptReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DispatcherScriptReplaceResponseEnvelopeErrors] +type dispatcherScriptReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DispatcherScriptUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dispatcherScriptUpdateResponseEnvelopeMessagesJSON `json:"-"` +type DispatcherScriptReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dispatcherScriptReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// dispatcherScriptUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [DispatcherScriptUpdateResponseEnvelopeMessages] -type dispatcherScriptUpdateResponseEnvelopeMessagesJSON struct { +// dispatcherScriptReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DispatcherScriptReplaceResponseEnvelopeMessages] +type dispatcherScriptReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DispatcherScriptUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DispatcherScriptReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DispatcherScriptUpdateResponseEnvelopeSuccess bool +type DispatcherScriptReplaceResponseEnvelopeSuccess bool const ( - DispatcherScriptUpdateResponseEnvelopeSuccessTrue DispatcherScriptUpdateResponseEnvelopeSuccess = true -) - -type DispatcherScriptDeleteParams struct { - // If set to true, delete will not be stopped by associated service binding, - // durable object, or other binding. Any of these associated bindings/durable - // objects will be deleted along with the script. - Force param.Field[bool] `query:"force"` -} - -// URLQuery serializes [DispatcherScriptDeleteParams]'s query parameters as -// `url.Values`. -func (r DispatcherScriptDeleteParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type DispatcherScriptGetResponseEnvelope struct { - Errors []DispatcherScriptGetResponseEnvelopeErrors `json:"errors,required"` - Messages []DispatcherScriptGetResponseEnvelopeMessages `json:"messages,required"` - // Details about a worker uploaded to a Workers for Platforms namespace. - Result DispatcherScriptGetResponse `json:"result,required"` - // Whether the API call was successful - Success DispatcherScriptGetResponseEnvelopeSuccess `json:"success,required"` - JSON dispatcherScriptGetResponseEnvelopeJSON `json:"-"` -} - -// dispatcherScriptGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [DispatcherScriptGetResponseEnvelope] -type dispatcherScriptGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DispatcherScriptGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DispatcherScriptGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dispatcherScriptGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// dispatcherScriptGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DispatcherScriptGetResponseEnvelopeErrors] -type dispatcherScriptGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DispatcherScriptGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DispatcherScriptGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dispatcherScriptGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// dispatcherScriptGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [DispatcherScriptGetResponseEnvelopeMessages] -type dispatcherScriptGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DispatcherScriptGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type DispatcherScriptGetResponseEnvelopeSuccess bool - -const ( - DispatcherScriptGetResponseEnvelopeSuccessTrue DispatcherScriptGetResponseEnvelopeSuccess = true + DispatcherScriptReplaceResponseEnvelopeSuccessTrue DispatcherScriptReplaceResponseEnvelopeSuccess = true ) diff --git a/dispatcherscript_test.go b/dispatcherscript_test.go index fc0b118fd9e..f9b5f0eaa9e 100644 --- a/dispatcherscript_test.go +++ b/dispatcherscript_test.go @@ -15,7 +15,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDispatcherScriptUpdateWithOptionalParams(t *testing.T) { +func TestDispatcherScriptDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -31,70 +31,13 @@ func TestDispatcherScriptUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Dispatchers.Scripts.Update( + err := client.Dispatchers.Scripts.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-dispatch-namespace", "this-is_my_script-01", - cloudflare.DispatcherScriptUpdateParamsVariant0{ - AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), - Metadata: cloudflare.F(cloudflare.DispatcherScriptUpdateParamsVariant0Metadata{ - Bindings: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), - BodyPart: cloudflare.F("worker.js"), - CompatibilityDate: cloudflare.F("2023-07-25"), - CompatibilityFlags: cloudflare.F([]string{"string", "string", "string"}), - KeepBindings: cloudflare.F([]string{"string", "string", "string"}), - Logpush: cloudflare.F(false), - MainModule: cloudflare.F("worker.js"), - Migrations: cloudflare.F[cloudflare.DispatcherScriptUpdateParamsVariant0MetadataMigrations](cloudflare.DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations(cloudflare.DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations{ - NewTag: cloudflare.F("v2"), - OldTag: cloudflare.F("v1"), - DeletedClasses: cloudflare.F([]string{"string", "string", "string"}), - NewClasses: cloudflare.F([]string{"string", "string", "string"}), - RenamedClasses: cloudflare.F([]cloudflare.DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass{{ - From: cloudflare.F("string"), - To: cloudflare.F("string"), - }, { - From: cloudflare.F("string"), - To: cloudflare.F("string"), - }, { - From: cloudflare.F("string"), - To: cloudflare.F("string"), - }}), - TransferredClasses: cloudflare.F([]cloudflare.DispatcherScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass{{ - From: cloudflare.F("string"), - FromScript: cloudflare.F("string"), - To: cloudflare.F("string"), - }, { - From: cloudflare.F("string"), - FromScript: cloudflare.F("string"), - To: cloudflare.F("string"), - }, { - From: cloudflare.F("string"), - FromScript: cloudflare.F("string"), - To: cloudflare.F("string"), - }}), - })), - Placement: cloudflare.F(cloudflare.DispatcherScriptUpdateParamsVariant0MetadataPlacement{ - Mode: cloudflare.F(cloudflare.DispatcherScriptUpdateParamsVariant0MetadataPlacementModeSmart), - }), - Tags: cloudflare.F([]string{"string", "string", "string"}), - TailConsumers: cloudflare.F([]cloudflare.DispatcherScriptUpdateParamsVariant0MetadataTailConsumer{{ - Environment: cloudflare.F("production"), - Namespace: cloudflare.F("my-namespace"), - Service: cloudflare.F("my-log-consumer"), - }, { - Environment: cloudflare.F("production"), - Namespace: cloudflare.F("my-namespace"), - Service: cloudflare.F("my-log-consumer"), - }, { - Environment: cloudflare.F("production"), - Namespace: cloudflare.F("my-namespace"), - Service: cloudflare.F("my-log-consumer"), - }}), - UsageModel: cloudflare.F(cloudflare.DispatcherScriptUpdateParamsVariant0MetadataUsageModelBundled), - VersionTags: cloudflare.F[any](map[string]interface{}{}), - }), + cloudflare.DispatcherScriptDeleteParams{ + Force: cloudflare.F(true), }, ) if err != nil { @@ -106,7 +49,7 @@ func TestDispatcherScriptUpdateWithOptionalParams(t *testing.T) { } } -func TestDispatcherScriptDeleteWithOptionalParams(t *testing.T) { +func TestDispatcherScriptGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,14 +65,11 @@ func TestDispatcherScriptDeleteWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Dispatchers.Scripts.Delete( + _, err := client.Dispatchers.Scripts.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-dispatch-namespace", "this-is_my_script-01", - cloudflare.DispatcherScriptDeleteParams{ - Force: cloudflare.F(true), - }, ) if err != nil { var apierr *cloudflare.Error @@ -140,7 +80,7 @@ func TestDispatcherScriptDeleteWithOptionalParams(t *testing.T) { } } -func TestDispatcherScriptGet(t *testing.T) { +func TestDispatcherScriptReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -156,11 +96,71 @@ func TestDispatcherScriptGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Dispatchers.Scripts.Get( + _, err := client.Dispatchers.Scripts.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-dispatch-namespace", "this-is_my_script-01", + cloudflare.DispatcherScriptReplaceParamsVariant0{ + AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), + Metadata: cloudflare.F(cloudflare.DispatcherScriptReplaceParamsVariant0Metadata{ + Bindings: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), + BodyPart: cloudflare.F("worker.js"), + CompatibilityDate: cloudflare.F("2023-07-25"), + CompatibilityFlags: cloudflare.F([]string{"string", "string", "string"}), + KeepBindings: cloudflare.F([]string{"string", "string", "string"}), + Logpush: cloudflare.F(false), + MainModule: cloudflare.F("worker.js"), + Migrations: cloudflare.F[cloudflare.DispatcherScriptReplaceParamsVariant0MetadataMigrations](cloudflare.DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations(cloudflare.DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations{ + NewTag: cloudflare.F("v2"), + OldTag: cloudflare.F("v1"), + DeletedClasses: cloudflare.F([]string{"string", "string", "string"}), + NewClasses: cloudflare.F([]string{"string", "string", "string"}), + RenamedClasses: cloudflare.F([]cloudflare.DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass{{ + From: cloudflare.F("string"), + To: cloudflare.F("string"), + }, { + From: cloudflare.F("string"), + To: cloudflare.F("string"), + }, { + From: cloudflare.F("string"), + To: cloudflare.F("string"), + }}), + TransferredClasses: cloudflare.F([]cloudflare.DispatcherScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass{{ + From: cloudflare.F("string"), + FromScript: cloudflare.F("string"), + To: cloudflare.F("string"), + }, { + From: cloudflare.F("string"), + FromScript: cloudflare.F("string"), + To: cloudflare.F("string"), + }, { + From: cloudflare.F("string"), + FromScript: cloudflare.F("string"), + To: cloudflare.F("string"), + }}), + })), + Placement: cloudflare.F(cloudflare.DispatcherScriptReplaceParamsVariant0MetadataPlacement{ + Mode: cloudflare.F(cloudflare.DispatcherScriptReplaceParamsVariant0MetadataPlacementModeSmart), + }), + Tags: cloudflare.F([]string{"string", "string", "string"}), + TailConsumers: cloudflare.F([]cloudflare.DispatcherScriptReplaceParamsVariant0MetadataTailConsumer{{ + Environment: cloudflare.F("production"), + Namespace: cloudflare.F("my-namespace"), + Service: cloudflare.F("my-log-consumer"), + }, { + Environment: cloudflare.F("production"), + Namespace: cloudflare.F("my-namespace"), + Service: cloudflare.F("my-log-consumer"), + }, { + Environment: cloudflare.F("production"), + Namespace: cloudflare.F("my-namespace"), + Service: cloudflare.F("my-log-consumer"), + }}), + UsageModel: cloudflare.F(cloudflare.DispatcherScriptReplaceParamsVariant0MetadataUsageModelBundled), + VersionTags: cloudflare.F[any](map[string]interface{}{}), + }), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/dlp.go b/dlp.go index 41f09228ef0..0795d5e4c9c 100644 --- a/dlp.go +++ b/dlp.go @@ -12,6 +12,7 @@ import ( // directly, and instead use the [NewDLPService] method instead. type DLPService struct { Options []option.RequestOption + Datasets *DLPDatasetService Patterns *DLPPatternService PayloadLogs *DLPPayloadLogService Profiles *DLPProfileService @@ -23,6 +24,7 @@ type DLPService struct { func NewDLPService(opts ...option.RequestOption) (r *DLPService) { r = &DLPService{} r.Options = opts + r.Datasets = NewDLPDatasetService(opts...) r.Patterns = NewDLPPatternService(opts...) r.PayloadLogs = NewDLPPayloadLogService(opts...) r.Profiles = NewDLPProfileService(opts...) diff --git a/dlpdataset.go b/dlpdataset.go index 4208198d683..4e9cc64646e 100644 --- a/dlpdataset.go +++ b/dlpdataset.go @@ -20,6 +20,7 @@ import ( // service directly, and instead use the [NewDLPDatasetService] method instead. type DLPDatasetService struct { Options []option.RequestOption + Upload *DLPDatasetUploadService } // NewDLPDatasetService generates a new service that applies the given options to @@ -28,6 +29,7 @@ type DLPDatasetService struct { func NewDLPDatasetService(opts ...option.RequestOption) (r *DLPDatasetService) { r = &DLPDatasetService{} r.Options = opts + r.Upload = NewDLPDatasetUploadService(opts...) return } @@ -44,19 +46,6 @@ func (r *DLPDatasetService) New(ctx context.Context, accountID string, body DLPD return } -// Update details about a dataset. -func (r *DLPDatasetService) Update(ctx context.Context, accountID string, datasetID string, body DLPDatasetUpdateParams, opts ...option.RequestOption) (res *DLPDatasetUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env DLPDatasetUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/datasets/%s", accountID, datasetID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetch all datasets with information about available versions. func (r *DLPDatasetService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]DLPDatasetListResponse, err error) { opts = append(r.Options[:], opts...) @@ -94,25 +83,12 @@ func (r *DLPDatasetService) Get(ctx context.Context, accountID string, datasetID return } -// Upload a new version of a dataset. -func (r *DLPDatasetService) Upload(ctx context.Context, accountID string, datasetID string, version int64, opts ...option.RequestOption) (res *DLPDatasetUploadResponse, err error) { - opts = append(r.Options[:], opts...) - var env DLPDatasetUploadResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload/%v", accountID, datasetID, version) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Prepare to upload a new version of a dataset. -func (r *DLPDatasetService) UploadPrepare(ctx context.Context, accountID string, datasetID string, opts ...option.RequestOption) (res *DLPDatasetUploadPrepareResponse, err error) { +// Update details about a dataset. +func (r *DLPDatasetService) Replace(ctx context.Context, accountID string, datasetID string, body DLPDatasetReplaceParams, opts ...option.RequestOption) (res *DLPDatasetReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DLPDatasetUploadPrepareResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload", accountID, datasetID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + var env DLPDatasetReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/dlp/datasets/%s", accountID, datasetID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -218,78 +194,6 @@ const ( DLPDatasetNewResponseDatasetUploadsStatusComplete DLPDatasetNewResponseDatasetUploadsStatus = "complete" ) -type DLPDatasetUpdateResponse struct { - ID string `json:"id,required" format:"uuid"` - CreatedAt time.Time `json:"created_at,required" format:"date-time"` - Name string `json:"name,required"` - NumCells int64 `json:"num_cells,required"` - Secret bool `json:"secret,required"` - Status DLPDatasetUpdateResponseStatus `json:"status,required"` - UpdatedAt time.Time `json:"updated_at,required" format:"date-time"` - Uploads []DLPDatasetUpdateResponseUpload `json:"uploads,required"` - Description string `json:"description,nullable"` - JSON dlpDatasetUpdateResponseJSON `json:"-"` -} - -// dlpDatasetUpdateResponseJSON contains the JSON metadata for the struct -// [DLPDatasetUpdateResponse] -type dlpDatasetUpdateResponseJSON struct { - ID apijson.Field - CreatedAt apijson.Field - Name apijson.Field - NumCells apijson.Field - Secret apijson.Field - Status apijson.Field - UpdatedAt apijson.Field - Uploads apijson.Field - Description apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUpdateResponseStatus string - -const ( - DLPDatasetUpdateResponseStatusEmpty DLPDatasetUpdateResponseStatus = "empty" - DLPDatasetUpdateResponseStatusUploading DLPDatasetUpdateResponseStatus = "uploading" - DLPDatasetUpdateResponseStatusFailed DLPDatasetUpdateResponseStatus = "failed" - DLPDatasetUpdateResponseStatusComplete DLPDatasetUpdateResponseStatus = "complete" -) - -type DLPDatasetUpdateResponseUpload struct { - NumCells int64 `json:"num_cells,required"` - Status DLPDatasetUpdateResponseUploadsStatus `json:"status,required"` - Version int64 `json:"version,required"` - JSON dlpDatasetUpdateResponseUploadJSON `json:"-"` -} - -// dlpDatasetUpdateResponseUploadJSON contains the JSON metadata for the struct -// [DLPDatasetUpdateResponseUpload] -type dlpDatasetUpdateResponseUploadJSON struct { - NumCells apijson.Field - Status apijson.Field - Version apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponseUpload) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUpdateResponseUploadsStatus string - -const ( - DLPDatasetUpdateResponseUploadsStatusEmpty DLPDatasetUpdateResponseUploadsStatus = "empty" - DLPDatasetUpdateResponseUploadsStatusUploading DLPDatasetUpdateResponseUploadsStatus = "uploading" - DLPDatasetUpdateResponseUploadsStatusFailed DLPDatasetUpdateResponseUploadsStatus = "failed" - DLPDatasetUpdateResponseUploadsStatusComplete DLPDatasetUpdateResponseUploadsStatus = "complete" -) - type DLPDatasetListResponse struct { ID string `json:"id,required" format:"uuid"` CreatedAt time.Time `json:"created_at,required" format:"date-time"` @@ -434,22 +338,22 @@ const ( DLPDatasetGetResponseUploadsStatusComplete DLPDatasetGetResponseUploadsStatus = "complete" ) -type DLPDatasetUploadResponse struct { - ID string `json:"id,required" format:"uuid"` - CreatedAt time.Time `json:"created_at,required" format:"date-time"` - Name string `json:"name,required"` - NumCells int64 `json:"num_cells,required"` - Secret bool `json:"secret,required"` - Status DLPDatasetUploadResponseStatus `json:"status,required"` - UpdatedAt time.Time `json:"updated_at,required" format:"date-time"` - Uploads []DLPDatasetUploadResponseUpload `json:"uploads,required"` - Description string `json:"description,nullable"` - JSON dlpDatasetUploadResponseJSON `json:"-"` -} - -// dlpDatasetUploadResponseJSON contains the JSON metadata for the struct -// [DLPDatasetUploadResponse] -type dlpDatasetUploadResponseJSON struct { +type DLPDatasetReplaceResponse struct { + ID string `json:"id,required" format:"uuid"` + CreatedAt time.Time `json:"created_at,required" format:"date-time"` + Name string `json:"name,required"` + NumCells int64 `json:"num_cells,required"` + Secret bool `json:"secret,required"` + Status DLPDatasetReplaceResponseStatus `json:"status,required"` + UpdatedAt time.Time `json:"updated_at,required" format:"date-time"` + Uploads []DLPDatasetReplaceResponseUpload `json:"uploads,required"` + Description string `json:"description,nullable"` + JSON dlpDatasetReplaceResponseJSON `json:"-"` +} + +// dlpDatasetReplaceResponseJSON contains the JSON metadata for the struct +// [DLPDatasetReplaceResponse] +type dlpDatasetReplaceResponseJSON struct { ID apijson.Field CreatedAt apijson.Field Name apijson.Field @@ -463,29 +367,29 @@ type dlpDatasetUploadResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadResponseStatus string +type DLPDatasetReplaceResponseStatus string const ( - DLPDatasetUploadResponseStatusEmpty DLPDatasetUploadResponseStatus = "empty" - DLPDatasetUploadResponseStatusUploading DLPDatasetUploadResponseStatus = "uploading" - DLPDatasetUploadResponseStatusFailed DLPDatasetUploadResponseStatus = "failed" - DLPDatasetUploadResponseStatusComplete DLPDatasetUploadResponseStatus = "complete" + DLPDatasetReplaceResponseStatusEmpty DLPDatasetReplaceResponseStatus = "empty" + DLPDatasetReplaceResponseStatusUploading DLPDatasetReplaceResponseStatus = "uploading" + DLPDatasetReplaceResponseStatusFailed DLPDatasetReplaceResponseStatus = "failed" + DLPDatasetReplaceResponseStatusComplete DLPDatasetReplaceResponseStatus = "complete" ) -type DLPDatasetUploadResponseUpload struct { - NumCells int64 `json:"num_cells,required"` - Status DLPDatasetUploadResponseUploadsStatus `json:"status,required"` - Version int64 `json:"version,required"` - JSON dlpDatasetUploadResponseUploadJSON `json:"-"` +type DLPDatasetReplaceResponseUpload struct { + NumCells int64 `json:"num_cells,required"` + Status DLPDatasetReplaceResponseUploadsStatus `json:"status,required"` + Version int64 `json:"version,required"` + JSON dlpDatasetReplaceResponseUploadJSON `json:"-"` } -// dlpDatasetUploadResponseUploadJSON contains the JSON metadata for the struct -// [DLPDatasetUploadResponseUpload] -type dlpDatasetUploadResponseUploadJSON struct { +// dlpDatasetReplaceResponseUploadJSON contains the JSON metadata for the struct +// [DLPDatasetReplaceResponseUpload] +type dlpDatasetReplaceResponseUploadJSON struct { NumCells apijson.Field Status apijson.Field Version apijson.Field @@ -493,40 +397,19 @@ type dlpDatasetUploadResponseUploadJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadResponseUpload) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponseUpload) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadResponseUploadsStatus string +type DLPDatasetReplaceResponseUploadsStatus string const ( - DLPDatasetUploadResponseUploadsStatusEmpty DLPDatasetUploadResponseUploadsStatus = "empty" - DLPDatasetUploadResponseUploadsStatusUploading DLPDatasetUploadResponseUploadsStatus = "uploading" - DLPDatasetUploadResponseUploadsStatusFailed DLPDatasetUploadResponseUploadsStatus = "failed" - DLPDatasetUploadResponseUploadsStatusComplete DLPDatasetUploadResponseUploadsStatus = "complete" + DLPDatasetReplaceResponseUploadsStatusEmpty DLPDatasetReplaceResponseUploadsStatus = "empty" + DLPDatasetReplaceResponseUploadsStatusUploading DLPDatasetReplaceResponseUploadsStatus = "uploading" + DLPDatasetReplaceResponseUploadsStatusFailed DLPDatasetReplaceResponseUploadsStatus = "failed" + DLPDatasetReplaceResponseUploadsStatusComplete DLPDatasetReplaceResponseUploadsStatus = "complete" ) -type DLPDatasetUploadPrepareResponse struct { - MaxCells int64 `json:"max_cells,required"` - Version int64 `json:"version,required"` - Secret string `json:"secret" format:"password"` - JSON dlpDatasetUploadPrepareResponseJSON `json:"-"` -} - -// dlpDatasetUploadPrepareResponseJSON contains the JSON metadata for the struct -// [DLPDatasetUploadPrepareResponse] -type dlpDatasetUploadPrepareResponseJSON struct { - MaxCells apijson.Field - Version apijson.Field - Secret apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUploadPrepareResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DLPDatasetNewParams struct { Name param.Field[string] `json:"name,required"` Description param.Field[string] `json:"description"` @@ -631,105 +514,6 @@ func (r *DLPDatasetNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (er return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUpdateParams struct { - Description param.Field[string] `json:"description"` - Name param.Field[string] `json:"name"` -} - -func (r DLPDatasetUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DLPDatasetUpdateResponseEnvelope struct { - Errors []DLPDatasetUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPDatasetUpdateResponseEnvelopeMessages `json:"messages,required"` - Success bool `json:"success,required"` - Result DLPDatasetUpdateResponse `json:"result"` - ResultInfo DLPDatasetUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON dlpDatasetUpdateResponseEnvelopeJSON `json:"-"` -} - -// dlpDatasetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [DLPDatasetUpdateResponseEnvelope] -type dlpDatasetUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - Result apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// dlpDatasetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DLPDatasetUpdateResponseEnvelopeErrors] -type dlpDatasetUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// dlpDatasetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DLPDatasetUpdateResponseEnvelopeMessages] -type dlpDatasetUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUpdateResponseEnvelopeResultInfo struct { - // total number of pages - Count int64 `json:"count,required"` - // current page - Page int64 `json:"page,required"` - // number of items per page - PerPage int64 `json:"per_page,required"` - // total number of items - TotalCount int64 `json:"total_count,required"` - JSON dlpDatasetUpdateResponseEnvelopeResultInfoJSON `json:"-"` -} - -// dlpDatasetUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [DLPDatasetUpdateResponseEnvelopeResultInfo] -type dlpDatasetUpdateResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DLPDatasetListResponseEnvelope struct { Errors []DLPDatasetListResponseEnvelopeErrors `json:"errors,required"` Messages []DLPDatasetListResponseEnvelopeMessages `json:"messages,required"` @@ -910,108 +694,27 @@ func (r *DLPDatasetGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (er return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadResponseEnvelope struct { - Errors []DLPDatasetUploadResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPDatasetUploadResponseEnvelopeMessages `json:"messages,required"` - Success bool `json:"success,required"` - Result DLPDatasetUploadResponse `json:"result"` - ResultInfo DLPDatasetUploadResponseEnvelopeResultInfo `json:"result_info"` - JSON dlpDatasetUploadResponseEnvelopeJSON `json:"-"` -} - -// dlpDatasetUploadResponseEnvelopeJSON contains the JSON metadata for the struct -// [DLPDatasetUploadResponseEnvelope] -type dlpDatasetUploadResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - Result apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUploadResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUploadResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUploadResponseEnvelopeErrorsJSON `json:"-"` -} - -// dlpDatasetUploadResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DLPDatasetUploadResponseEnvelopeErrors] -type dlpDatasetUploadResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUploadResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUploadResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUploadResponseEnvelopeMessagesJSON `json:"-"` -} - -// dlpDatasetUploadResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DLPDatasetUploadResponseEnvelopeMessages] -type dlpDatasetUploadResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPDatasetUploadResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPDatasetUploadResponseEnvelopeResultInfo struct { - // total number of pages - Count int64 `json:"count,required"` - // current page - Page int64 `json:"page,required"` - // number of items per page - PerPage int64 `json:"per_page,required"` - // total number of items - TotalCount int64 `json:"total_count,required"` - JSON dlpDatasetUploadResponseEnvelopeResultInfoJSON `json:"-"` -} - -// dlpDatasetUploadResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [DLPDatasetUploadResponseEnvelopeResultInfo] -type dlpDatasetUploadResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field +type DLPDatasetReplaceParams struct { + Description param.Field[string] `json:"description"` + Name param.Field[string] `json:"name"` } -func (r *DLPDatasetUploadResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r DLPDatasetReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type DLPDatasetUploadPrepareResponseEnvelope struct { - Errors []DLPDatasetUploadPrepareResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPDatasetUploadPrepareResponseEnvelopeMessages `json:"messages,required"` - Success bool `json:"success,required"` - Result DLPDatasetUploadPrepareResponse `json:"result"` - ResultInfo DLPDatasetUploadPrepareResponseEnvelopeResultInfo `json:"result_info"` - JSON dlpDatasetUploadPrepareResponseEnvelopeJSON `json:"-"` +type DLPDatasetReplaceResponseEnvelope struct { + Errors []DLPDatasetReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPDatasetReplaceResponseEnvelopeMessages `json:"messages,required"` + Success bool `json:"success,required"` + Result DLPDatasetReplaceResponse `json:"result"` + ResultInfo DLPDatasetReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON dlpDatasetReplaceResponseEnvelopeJSON `json:"-"` } -// dlpDatasetUploadPrepareResponseEnvelopeJSON contains the JSON metadata for the -// struct [DLPDatasetUploadPrepareResponseEnvelope] -type dlpDatasetUploadPrepareResponseEnvelopeJSON struct { +// dlpDatasetReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [DLPDatasetReplaceResponseEnvelope] +type dlpDatasetReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Success apijson.Field @@ -1021,49 +724,49 @@ type dlpDatasetUploadPrepareResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadPrepareResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadPrepareResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUploadPrepareResponseEnvelopeErrorsJSON `json:"-"` +type DLPDatasetReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// dlpDatasetUploadPrepareResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [DLPDatasetUploadPrepareResponseEnvelopeErrors] -type dlpDatasetUploadPrepareResponseEnvelopeErrorsJSON struct { +// dlpDatasetReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPDatasetReplaceResponseEnvelopeErrors] +type dlpDatasetReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadPrepareResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadPrepareResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpDatasetUploadPrepareResponseEnvelopeMessagesJSON `json:"-"` +type DLPDatasetReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// dlpDatasetUploadPrepareResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [DLPDatasetUploadPrepareResponseEnvelopeMessages] -type dlpDatasetUploadPrepareResponseEnvelopeMessagesJSON struct { +// dlpDatasetReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DLPDatasetReplaceResponseEnvelopeMessages] +type dlpDatasetReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadPrepareResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPDatasetUploadPrepareResponseEnvelopeResultInfo struct { +type DLPDatasetReplaceResponseEnvelopeResultInfo struct { // total number of pages Count int64 `json:"count,required"` // current page @@ -1071,13 +774,13 @@ type DLPDatasetUploadPrepareResponseEnvelopeResultInfo struct { // number of items per page PerPage int64 `json:"per_page,required"` // total number of items - TotalCount int64 `json:"total_count,required"` - JSON dlpDatasetUploadPrepareResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount int64 `json:"total_count,required"` + JSON dlpDatasetReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// dlpDatasetUploadPrepareResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [DLPDatasetUploadPrepareResponseEnvelopeResultInfo] -type dlpDatasetUploadPrepareResponseEnvelopeResultInfoJSON struct { +// dlpDatasetReplaceResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DLPDatasetReplaceResponseEnvelopeResultInfo] +type dlpDatasetReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -1086,6 +789,6 @@ type dlpDatasetUploadPrepareResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPDatasetUploadPrepareResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DLPDatasetReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/dlpdataset_test.go b/dlpdataset_test.go index 31bcaeda25f..aacdd9c88f2 100644 --- a/dlpdataset_test.go +++ b/dlpdataset_test.go @@ -47,40 +47,6 @@ func TestDLPDatasetNewWithOptionalParams(t *testing.T) { } } -func TestDLPDatasetUpdateWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.DLP.Datasets.Update( - context.TODO(), - "string", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - cloudflare.DLPDatasetUpdateParams{ - Description: cloudflare.F("string"), - Name: cloudflare.F("string"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - func TestDLPDatasetList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -167,7 +133,7 @@ func TestDLPDatasetGet(t *testing.T) { } } -func TestDLPDatasetUpload(t *testing.T) { +func TestDLPDatasetReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -183,41 +149,14 @@ func TestDLPDatasetUpload(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLP.Datasets.Upload( - context.TODO(), - "string", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - int64(0), - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestDLPDatasetUploadPrepare(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.DLP.Datasets.UploadPrepare( + _, err := client.DLP.Datasets.Replace( context.TODO(), "string", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + cloudflare.DLPDatasetReplaceParams{ + Description: cloudflare.F("string"), + Name: cloudflare.F("string"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/dlpdatasetupload.go b/dlpdatasetupload.go new file mode 100644 index 00000000000..ff71def5f69 --- /dev/null +++ b/dlpdatasetupload.go @@ -0,0 +1,331 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// DLPDatasetUploadService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewDLPDatasetUploadService] method +// instead. +type DLPDatasetUploadService struct { + Options []option.RequestOption +} + +// NewDLPDatasetUploadService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewDLPDatasetUploadService(opts ...option.RequestOption) (r *DLPDatasetUploadService) { + r = &DLPDatasetUploadService{} + r.Options = opts + return +} + +// Prepare to upload a new version of a dataset. +func (r *DLPDatasetUploadService) New(ctx context.Context, accountID string, datasetID string, opts ...option.RequestOption) (res *DLPDatasetUploadNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env DLPDatasetUploadNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload", accountID, datasetID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Upload a new version of a dataset. +func (r *DLPDatasetUploadService) Update(ctx context.Context, accountID string, datasetID string, version int64, opts ...option.RequestOption) (res *DLPDatasetUploadUpdateResponse, err error) { + opts = append(r.Options[:], opts...) + var env DLPDatasetUploadUpdateResponseEnvelope + path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload/%v", accountID, datasetID, version) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type DLPDatasetUploadNewResponse struct { + MaxCells int64 `json:"max_cells,required"` + Version int64 `json:"version,required"` + Secret string `json:"secret" format:"password"` + JSON dlpDatasetUploadNewResponseJSON `json:"-"` +} + +// dlpDatasetUploadNewResponseJSON contains the JSON metadata for the struct +// [DLPDatasetUploadNewResponse] +type dlpDatasetUploadNewResponseJSON struct { + MaxCells apijson.Field + Version apijson.Field + Secret apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponse struct { + ID string `json:"id,required" format:"uuid"` + CreatedAt time.Time `json:"created_at,required" format:"date-time"` + Name string `json:"name,required"` + NumCells int64 `json:"num_cells,required"` + Secret bool `json:"secret,required"` + Status DLPDatasetUploadUpdateResponseStatus `json:"status,required"` + UpdatedAt time.Time `json:"updated_at,required" format:"date-time"` + Uploads []DLPDatasetUploadUpdateResponseUpload `json:"uploads,required"` + Description string `json:"description,nullable"` + JSON dlpDatasetUploadUpdateResponseJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseJSON contains the JSON metadata for the struct +// [DLPDatasetUploadUpdateResponse] +type dlpDatasetUploadUpdateResponseJSON struct { + ID apijson.Field + CreatedAt apijson.Field + Name apijson.Field + NumCells apijson.Field + Secret apijson.Field + Status apijson.Field + UpdatedAt apijson.Field + Uploads apijson.Field + Description apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseStatus string + +const ( + DLPDatasetUploadUpdateResponseStatusEmpty DLPDatasetUploadUpdateResponseStatus = "empty" + DLPDatasetUploadUpdateResponseStatusUploading DLPDatasetUploadUpdateResponseStatus = "uploading" + DLPDatasetUploadUpdateResponseStatusFailed DLPDatasetUploadUpdateResponseStatus = "failed" + DLPDatasetUploadUpdateResponseStatusComplete DLPDatasetUploadUpdateResponseStatus = "complete" +) + +type DLPDatasetUploadUpdateResponseUpload struct { + NumCells int64 `json:"num_cells,required"` + Status DLPDatasetUploadUpdateResponseUploadsStatus `json:"status,required"` + Version int64 `json:"version,required"` + JSON dlpDatasetUploadUpdateResponseUploadJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseUploadJSON contains the JSON metadata for the +// struct [DLPDatasetUploadUpdateResponseUpload] +type dlpDatasetUploadUpdateResponseUploadJSON struct { + NumCells apijson.Field + Status apijson.Field + Version apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponseUpload) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseUploadsStatus string + +const ( + DLPDatasetUploadUpdateResponseUploadsStatusEmpty DLPDatasetUploadUpdateResponseUploadsStatus = "empty" + DLPDatasetUploadUpdateResponseUploadsStatusUploading DLPDatasetUploadUpdateResponseUploadsStatus = "uploading" + DLPDatasetUploadUpdateResponseUploadsStatusFailed DLPDatasetUploadUpdateResponseUploadsStatus = "failed" + DLPDatasetUploadUpdateResponseUploadsStatusComplete DLPDatasetUploadUpdateResponseUploadsStatus = "complete" +) + +type DLPDatasetUploadNewResponseEnvelope struct { + Errors []DLPDatasetUploadNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPDatasetUploadNewResponseEnvelopeMessages `json:"messages,required"` + Success bool `json:"success,required"` + Result DLPDatasetUploadNewResponse `json:"result"` + ResultInfo DLPDatasetUploadNewResponseEnvelopeResultInfo `json:"result_info"` + JSON dlpDatasetUploadNewResponseEnvelopeJSON `json:"-"` +} + +// dlpDatasetUploadNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [DLPDatasetUploadNewResponseEnvelope] +type dlpDatasetUploadNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + Result apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetUploadNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// dlpDatasetUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPDatasetUploadNewResponseEnvelopeErrors] +type dlpDatasetUploadNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetUploadNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// dlpDatasetUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DLPDatasetUploadNewResponseEnvelopeMessages] +type dlpDatasetUploadNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadNewResponseEnvelopeResultInfo struct { + // total number of pages + Count int64 `json:"count,required"` + // current page + Page int64 `json:"page,required"` + // number of items per page + PerPage int64 `json:"per_page,required"` + // total number of items + TotalCount int64 `json:"total_count,required"` + JSON dlpDatasetUploadNewResponseEnvelopeResultInfoJSON `json:"-"` +} + +// dlpDatasetUploadNewResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DLPDatasetUploadNewResponseEnvelopeResultInfo] +type dlpDatasetUploadNewResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseEnvelope struct { + Errors []DLPDatasetUploadUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPDatasetUploadUpdateResponseEnvelopeMessages `json:"messages,required"` + Success bool `json:"success,required"` + Result DLPDatasetUploadUpdateResponse `json:"result"` + ResultInfo DLPDatasetUploadUpdateResponseEnvelopeResultInfo `json:"result_info"` + JSON dlpDatasetUploadUpdateResponseEnvelopeJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [DLPDatasetUploadUpdateResponseEnvelope] +type dlpDatasetUploadUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + Result apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetUploadUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DLPDatasetUploadUpdateResponseEnvelopeErrors] +type dlpDatasetUploadUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpDatasetUploadUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DLPDatasetUploadUpdateResponseEnvelopeMessages] +type dlpDatasetUploadUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPDatasetUploadUpdateResponseEnvelopeResultInfo struct { + // total number of pages + Count int64 `json:"count,required"` + // current page + Page int64 `json:"page,required"` + // number of items per page + PerPage int64 `json:"per_page,required"` + // total number of items + TotalCount int64 `json:"total_count,required"` + JSON dlpDatasetUploadUpdateResponseEnvelopeResultInfoJSON `json:"-"` +} + +// dlpDatasetUploadUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [DLPDatasetUploadUpdateResponseEnvelopeResultInfo] +type dlpDatasetUploadUpdateResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPDatasetUploadUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/dlpdatasetupload_test.go b/dlpdatasetupload_test.go new file mode 100644 index 00000000000..c588776d61e --- /dev/null +++ b/dlpdatasetupload_test.go @@ -0,0 +1,75 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare_test + +import ( + "context" + "errors" + "os" + "testing" + + "github.com/cloudflare/cloudflare-sdk-go" + "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +func TestDLPDatasetUploadNew(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.DLP.Datasets.Upload.New( + context.TODO(), + "string", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestDLPDatasetUploadUpdate(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.DLP.Datasets.Upload.Update( + context.TODO(), + "string", + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + int64(0), + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/dlppattern.go b/dlppattern.go index b8de61ef051..07436fa537b 100644 --- a/dlppattern.go +++ b/dlppattern.go @@ -3,6 +3,13 @@ package cloudflare import ( + "context" + "fmt" + "net/http" + + "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/option" ) @@ -11,8 +18,7 @@ import ( // variables from the environment automatically. You should not instantiate this // service directly, and instead use the [NewDLPPatternService] method instead. type DLPPatternService struct { - Options []option.RequestOption - Validates *DLPPatternValidateService + Options []option.RequestOption } // NewDLPPatternService generates a new service that applies the given options to @@ -21,6 +27,116 @@ type DLPPatternService struct { func NewDLPPatternService(opts ...option.RequestOption) (r *DLPPatternService) { r = &DLPPatternService{} r.Options = opts - r.Validates = NewDLPPatternValidateService(opts...) return } + +// Validates whether this pattern is a valid regular expression. Rejects it if the +// regular expression is too complex or can match an unbounded-length string. Your +// regex will be rejected if it uses the Kleene Star -- be sure to bound the +// maximum number of characters that can be matched. +func (r *DLPPatternService) Validate(ctx context.Context, accountID string, body DLPPatternValidateParams, opts ...option.RequestOption) (res *DLPPatternValidateResponse, err error) { + opts = append(r.Options[:], opts...) + var env DLPPatternValidateResponseEnvelope + path := fmt.Sprintf("accounts/%s/dlp/patterns/validate", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type DLPPatternValidateResponse struct { + Valid bool `json:"valid"` + JSON dlpPatternValidateResponseJSON `json:"-"` +} + +// dlpPatternValidateResponseJSON contains the JSON metadata for the struct +// [DLPPatternValidateResponse] +type dlpPatternValidateResponseJSON struct { + Valid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPPatternValidateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPPatternValidateParams struct { + // The regex pattern. + Regex param.Field[string] `json:"regex,required"` +} + +func (r DLPPatternValidateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DLPPatternValidateResponseEnvelope struct { + Errors []DLPPatternValidateResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPPatternValidateResponseEnvelopeMessages `json:"messages,required"` + Result DLPPatternValidateResponse `json:"result,required"` + // Whether the API call was successful + Success DLPPatternValidateResponseEnvelopeSuccess `json:"success,required"` + JSON dlpPatternValidateResponseEnvelopeJSON `json:"-"` +} + +// dlpPatternValidateResponseEnvelopeJSON contains the JSON metadata for the struct +// [DLPPatternValidateResponseEnvelope] +type dlpPatternValidateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPPatternValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPPatternValidateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPatternValidateResponseEnvelopeErrorsJSON `json:"-"` +} + +// dlpPatternValidateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPPatternValidateResponseEnvelopeErrors] +type dlpPatternValidateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPPatternValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DLPPatternValidateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPatternValidateResponseEnvelopeMessagesJSON `json:"-"` +} + +// dlpPatternValidateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DLPPatternValidateResponseEnvelopeMessages] +type dlpPatternValidateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DLPPatternValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type DLPPatternValidateResponseEnvelopeSuccess bool + +const ( + DLPPatternValidateResponseEnvelopeSuccessTrue DLPPatternValidateResponseEnvelopeSuccess = true +) diff --git a/workerdeploymentbyscriptdetail_test.go b/dlppattern_test.go similarity index 83% rename from workerdeploymentbyscriptdetail_test.go rename to dlppattern_test.go index be7b5e47d70..3175e82e274 100644 --- a/workerdeploymentbyscriptdetail_test.go +++ b/dlppattern_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerDeploymentByScriptDetailGet(t *testing.T) { +func TestDLPPatternValidate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,12 @@ func TestWorkerDeploymentByScriptDetailGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Deployments.ByScripts.Details.Get( + _, err := client.DLP.Patterns.Validate( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "8ee82b3a2c0f42928b8f14dae4a97121", - "bcf48806-b317-4351-9ee7-36e7d557d4de", + cloudflare.DLPPatternValidateParams{ + Regex: cloudflare.F("^4[0-9]{6,}$"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/dlppatternvalidate.go b/dlppatternvalidate.go deleted file mode 100644 index 6b08d939944..00000000000 --- a/dlppatternvalidate.go +++ /dev/null @@ -1,147 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// DLPPatternValidateService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewDLPPatternValidateService] method -// instead. -type DLPPatternValidateService struct { - Options []option.RequestOption -} - -// NewDLPPatternValidateService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewDLPPatternValidateService(opts ...option.RequestOption) (r *DLPPatternValidateService) { - r = &DLPPatternValidateService{} - r.Options = opts - return -} - -// Validates whether this pattern is a valid regular expression. Rejects it if the -// regular expression is too complex or can match an unbounded-length string. Your -// regex will be rejected if it uses the Kleene Star -- be sure to bound the -// maximum number of characters that can be matched. -func (r *DLPPatternValidateService) DLPPatternValidationValidatePattern(ctx context.Context, accountID string, body DLPPatternValidateDLPPatternValidationValidatePatternParams, opts ...option.RequestOption) (res *DLPPatternValidateDLPPatternValidationValidatePatternResponse, err error) { - opts = append(r.Options[:], opts...) - var env DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/patterns/validate", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type DLPPatternValidateDLPPatternValidationValidatePatternResponse struct { - Valid bool `json:"valid"` - JSON dlpPatternValidateDLPPatternValidationValidatePatternResponseJSON `json:"-"` -} - -// dlpPatternValidateDLPPatternValidationValidatePatternResponseJSON contains the -// JSON metadata for the struct -// [DLPPatternValidateDLPPatternValidationValidatePatternResponse] -type dlpPatternValidateDLPPatternValidationValidatePatternResponseJSON struct { - Valid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPPatternValidateDLPPatternValidationValidatePatternResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPPatternValidateDLPPatternValidationValidatePatternParams struct { - // The regex pattern. - Regex param.Field[string] `json:"regex,required"` -} - -func (r DLPPatternValidateDLPPatternValidationValidatePatternParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelope struct { - Errors []DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessages `json:"messages,required"` - Result DLPPatternValidateDLPPatternValidationValidatePatternResponse `json:"result,required"` - // Whether the API call was successful - Success DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeSuccess `json:"success,required"` - JSON dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeJSON `json:"-"` -} - -// dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelope] -type dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrorsJSON `json:"-"` -} - -// dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrors] -type dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessagesJSON `json:"-"` -} - -// dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessages] -type dlpPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeSuccess bool - -const ( - DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeSuccessTrue DLPPatternValidateDLPPatternValidationValidatePatternResponseEnvelopeSuccess = true -) diff --git a/dlppayloadlog.go b/dlppayloadlog.go index 59715108ad2..e0701399d1d 100644 --- a/dlppayloadlog.go +++ b/dlppayloadlog.go @@ -32,9 +32,9 @@ func NewDLPPayloadLogService(opts ...option.RequestOption) (r *DLPPayloadLogServ } // Gets the current DLP payload log settings for this account. -func (r *DLPPayloadLogService) DLPPayloadLogSettingsGetSettings(ctx context.Context, accountID string, opts ...option.RequestOption) (res *DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse, err error) { +func (r *DLPPayloadLogService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *DLPPayloadLogGetResponse, err error) { opts = append(r.Options[:], opts...) - var env DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelope + var env DLPPayloadLogGetResponseEnvelope path := fmt.Sprintf("accounts/%s/dlp/payload_log", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,9 +45,9 @@ func (r *DLPPayloadLogService) DLPPayloadLogSettingsGetSettings(ctx context.Cont } // Updates the DLP payload log settings for this account. -func (r *DLPPayloadLogService) DLPPayloadLogSettingsUpdateSettings(ctx context.Context, accountID string, body DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsParams, opts ...option.RequestOption) (res *DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse, err error) { +func (r *DLPPayloadLogService) Replace(ctx context.Context, accountID string, body DLPPayloadLogReplaceParams, opts ...option.RequestOption) (res *DLPPayloadLogReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelope + var env DLPPayloadLogReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/dlp/payload_log", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -57,54 +57,52 @@ func (r *DLPPayloadLogService) DLPPayloadLogSettingsUpdateSettings(ctx context.C return } -type DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse struct { - PublicKey string `json:"public_key,required,nullable"` - JSON dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseJSON `json:"-"` +type DLPPayloadLogGetResponse struct { + PublicKey string `json:"public_key,required,nullable"` + JSON dlpPayloadLogGetResponseJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseJSON contains the JSON -// metadata for the struct [DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse] -type dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseJSON struct { +// dlpPayloadLogGetResponseJSON contains the JSON metadata for the struct +// [DLPPayloadLogGetResponse] +type dlpPayloadLogGetResponseJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse struct { - PublicKey string `json:"public_key,required,nullable"` - JSON dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseJSON `json:"-"` +type DLPPayloadLogReplaceResponse struct { + PublicKey string `json:"public_key,required,nullable"` + JSON dlpPayloadLogReplaceResponseJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseJSON contains the JSON -// metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse] -type dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseJSON struct { +// dlpPayloadLogReplaceResponseJSON contains the JSON metadata for the struct +// [DLPPayloadLogReplaceResponse] +type dlpPayloadLogReplaceResponseJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelope struct { - Errors []DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessages `json:"messages,required"` - Result DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponse `json:"result,required"` +type DLPPayloadLogGetResponseEnvelope struct { + Errors []DLPPayloadLogGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPPayloadLogGetResponseEnvelopeMessages `json:"messages,required"` + Result DLPPayloadLogGetResponse `json:"result,required"` // Whether the API call was successful - Success DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeJSON `json:"-"` + Success DLPPayloadLogGetResponseEnvelopeSuccess `json:"success,required"` + JSON dlpPayloadLogGetResponseEnvelopeJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelope] -type dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeJSON struct { +// dlpPayloadLogGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [DLPPayloadLogGetResponseEnvelope] +type dlpPayloadLogGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -113,79 +111,76 @@ type dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrorsJSON `json:"-"` +type DLPPayloadLogGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPayloadLogGetResponseEnvelopeErrorsJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrors] -type dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrorsJSON struct { +// dlpPayloadLogGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPPayloadLogGetResponseEnvelopeErrors] +type dlpPayloadLogGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessagesJSON `json:"-"` +type DLPPayloadLogGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPayloadLogGetResponseEnvelopeMessagesJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessages] -type dlpPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessagesJSON struct { +// dlpPayloadLogGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DLPPayloadLogGetResponseEnvelopeMessages] +type dlpPayloadLogGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeSuccess bool +type DLPPayloadLogGetResponseEnvelopeSuccess bool const ( - DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeSuccessTrue DLPPayloadLogDLPPayloadLogSettingsGetSettingsResponseEnvelopeSuccess = true + DLPPayloadLogGetResponseEnvelopeSuccessTrue DLPPayloadLogGetResponseEnvelopeSuccess = true ) -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsParams struct { +type DLPPayloadLogReplaceParams struct { // The public key to use when encrypting extracted payloads, as a base64 string PublicKey param.Field[string] `json:"public_key,required"` } -func (r DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsParams) MarshalJSON() (data []byte, err error) { +func (r DLPPayloadLogReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelope struct { - Errors []DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessages `json:"messages,required"` - Result DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponse `json:"result,required"` +type DLPPayloadLogReplaceResponseEnvelope struct { + Errors []DLPPayloadLogReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPPayloadLogReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DLPPayloadLogReplaceResponse `json:"result,required"` // Whether the API call was successful - Success DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeJSON `json:"-"` + Success DLPPayloadLogReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON dlpPayloadLogReplaceResponseEnvelopeJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelope] -type dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeJSON struct { +// dlpPayloadLogReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [DLPPayloadLogReplaceResponseEnvelope] +type dlpPayloadLogReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -194,53 +189,51 @@ type dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrorsJSON `json:"-"` +type DLPPayloadLogReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPayloadLogReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrors] -type dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrorsJSON struct { +// dlpPayloadLogReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DLPPayloadLogReplaceResponseEnvelopeErrors] +type dlpPayloadLogReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessagesJSON `json:"-"` +type DLPPayloadLogReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpPayloadLogReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessages] -type dlpPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessagesJSON struct { +// dlpPayloadLogReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DLPPayloadLogReplaceResponseEnvelopeMessages] +type dlpPayloadLogReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPPayloadLogReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeSuccess bool +type DLPPayloadLogReplaceResponseEnvelopeSuccess bool const ( - DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeSuccessTrue DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsResponseEnvelopeSuccess = true + DLPPayloadLogReplaceResponseEnvelopeSuccessTrue DLPPayloadLogReplaceResponseEnvelopeSuccess = true ) diff --git a/dlppayloadlog_test.go b/dlppayloadlog_test.go index 2e7af183595..01bcea811c1 100644 --- a/dlppayloadlog_test.go +++ b/dlppayloadlog_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDLPPayloadLogDLPPayloadLogSettingsGetSettings(t *testing.T) { +func TestDLPPayloadLogGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDLPPayloadLogDLPPayloadLogSettingsGetSettings(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.PayloadLogs.DLPPayloadLogSettingsGetSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.DLP.PayloadLogs.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestDLPPayloadLogDLPPayloadLogSettingsGetSettings(t *testing.T) { } } -func TestDLPPayloadLogDLPPayloadLogSettingsUpdateSettings(t *testing.T) { +func TestDLPPayloadLogReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestDLPPayloadLogDLPPayloadLogSettingsUpdateSettings(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.PayloadLogs.DLPPayloadLogSettingsUpdateSettings( + _, err := client.DLP.PayloadLogs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.DLPPayloadLogDLPPayloadLogSettingsUpdateSettingsParams{ + cloudflare.DLPPayloadLogReplaceParams{ PublicKey: cloudflare.F("EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0="), }, ) diff --git a/dlpprofile.go b/dlpprofile.go index f1f4a14e823..dd7277876bc 100644 --- a/dlpprofile.go +++ b/dlpprofile.go @@ -36,9 +36,9 @@ func NewDLPProfileService(opts ...option.RequestOption) (r *DLPProfileService) { } // Lists all DLP profiles in an account. -func (r *DLPProfileService) DLPProfilesListAllProfiles(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]DLPProfileDLPProfilesListAllProfilesResponse, err error) { +func (r *DLPProfileService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]DLPProfileListResponse, err error) { opts = append(r.Options[:], opts...) - var env DLPProfileDLPProfilesListAllProfilesResponseEnvelope + var env DLPProfileListResponseEnvelope path := fmt.Sprintf("accounts/%s/dlp/profiles", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -61,36 +61,34 @@ func (r *DLPProfileService) Get(ctx context.Context, accountID string, profileID return } -// Union satisfied by -// [DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfile], -// [DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile] or -// [DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfile]. -type DLPProfileDLPProfilesListAllProfilesResponse interface { - implementsDLPProfileDLPProfilesListAllProfilesResponse() +// Union satisfied by [DLPProfileListResponseDLPPredefinedProfile], +// [DLPProfileListResponseDLPCustomProfile] or +// [DLPProfileListResponseDLPIntegrationProfile]. +type DLPProfileListResponse interface { + implementsDLPProfileListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DLPProfileDLPProfilesListAllProfilesResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DLPProfileListResponse)(nil)).Elem(), "") } -type DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfile struct { +type DLPProfileListResponseDLPPredefinedProfile struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. AllowedMatchCount float64 `json:"allowed_match_count"` // The entries for this profile. - Entries []DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntry `json:"entries"` + Entries []DLPProfileListResponseDLPPredefinedProfileEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileType `json:"type"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileJSON `json:"-"` + Type DLPProfileListResponseDLPPredefinedProfileType `json:"type"` + JSON dlpProfileListResponseDLPPredefinedProfileJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileJSON contains -// the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfile] -type dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileJSON struct { +// dlpProfileListResponseDLPPredefinedProfileJSON contains the JSON metadata for +// the struct [DLPProfileListResponseDLPPredefinedProfile] +type dlpProfileListResponseDLPPredefinedProfileJSON struct { ID apijson.Field AllowedMatchCount apijson.Field Entries apijson.Field @@ -100,15 +98,14 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileJSON struct ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfile) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPPredefinedProfile) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfile) implementsDLPProfileDLPProfilesListAllProfilesResponse() { -} +func (r DLPProfileListResponseDLPPredefinedProfile) implementsDLPProfileListResponse() {} // A predefined entry that matches a profile -type DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntry struct { +type DLPProfileListResponseDLPPredefinedProfileEntry struct { // The ID for this entry ID string `json:"id"` // Whether the entry is enabled or not. @@ -116,14 +113,13 @@ type DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntry struc // The name of the entry. Name string `json:"name"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + JSON dlpProfileListResponseDLPPredefinedProfileEntryJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntryJSON -// contains the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntry] -type dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntryJSON struct { +// dlpProfileListResponseDLPPredefinedProfileEntryJSON contains the JSON metadata +// for the struct [DLPProfileListResponseDLPPredefinedProfileEntry] +type dlpProfileListResponseDLPPredefinedProfileEntryJSON struct { ID apijson.Field Enabled apijson.Field Name apijson.Field @@ -132,18 +128,18 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntryJSON s ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPPredefinedProfileEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of the profile. -type DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileType string +type DLPProfileListResponseDLPPredefinedProfileType string const ( - DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileTypePredefined DLPProfileDLPProfilesListAllProfilesResponseDLPPredefinedProfileType = "predefined" + DLPProfileListResponseDLPPredefinedProfileTypePredefined DLPProfileListResponseDLPPredefinedProfileType = "predefined" ) -type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile struct { +type DLPProfileListResponseDLPCustomProfile struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. @@ -152,19 +148,18 @@ type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile struct { // The description of the profile. Description string `json:"description"` // The entries for this profile. - Entries []DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntry `json:"entries"` + Entries []DLPProfileListResponseDLPCustomProfileEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileJSON `json:"-"` + Type DLPProfileListResponseDLPCustomProfileType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileListResponseDLPCustomProfileJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileJSON contains the -// JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile] -type dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileJSON struct { +// dlpProfileListResponseDLPCustomProfileJSON contains the JSON metadata for the +// struct [DLPProfileListResponseDLPCustomProfile] +type dlpProfileListResponseDLPCustomProfileJSON struct { ID apijson.Field AllowedMatchCount apijson.Field CreatedAt apijson.Field @@ -177,15 +172,14 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPCustomProfile) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfile) implementsDLPProfileDLPProfilesListAllProfilesResponse() { -} +func (r DLPProfileListResponseDLPCustomProfile) implementsDLPProfileListResponse() {} // A custom entry that matches a profile -type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntry struct { +type DLPProfileListResponseDLPCustomProfileEntry struct { // The ID for this entry ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` @@ -194,17 +188,16 @@ type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntry struct { // The name of the entry. Name string `json:"name"` // A pattern that matches an entry - Pattern DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPattern `json:"pattern"` + Pattern DLPProfileListResponseDLPCustomProfileEntriesPattern `json:"pattern"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileListResponseDLPCustomProfileEntryJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntryJSON contains -// the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntry] -type dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntryJSON struct { +// dlpProfileListResponseDLPCustomProfileEntryJSON contains the JSON metadata for +// the struct [DLPProfileListResponseDLPCustomProfileEntry] +type dlpProfileListResponseDLPCustomProfileEntryJSON struct { ID apijson.Field CreatedAt apijson.Field Enabled apijson.Field @@ -216,69 +209,67 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntryJSON struc ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPCustomProfileEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A pattern that matches an entry -type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPattern struct { +type DLPProfileListResponseDLPCustomProfileEntriesPattern struct { // The regex pattern. Regex string `json:"regex,required"` // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. - Validation DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternValidation `json:"validation"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternJSON `json:"-"` + Validation DLPProfileListResponseDLPCustomProfileEntriesPatternValidation `json:"validation"` + JSON dlpProfileListResponseDLPCustomProfileEntriesPatternJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternJSON -// contains the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPattern] -type dlpProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternJSON struct { +// dlpProfileListResponseDLPCustomProfileEntriesPatternJSON contains the JSON +// metadata for the struct [DLPProfileListResponseDLPCustomProfileEntriesPattern] +type dlpProfileListResponseDLPCustomProfileEntriesPatternJSON struct { Regex apijson.Field Validation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPattern) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPCustomProfileEntriesPattern) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. -type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternValidation string +type DLPProfileListResponseDLPCustomProfileEntriesPatternValidation string const ( - DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternValidationLuhn DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileEntriesPatternValidation = "luhn" + DLPProfileListResponseDLPCustomProfileEntriesPatternValidationLuhn DLPProfileListResponseDLPCustomProfileEntriesPatternValidation = "luhn" ) // The type of the profile. -type DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileType string +type DLPProfileListResponseDLPCustomProfileType string const ( - DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileTypeCustom DLPProfileDLPProfilesListAllProfilesResponseDLPCustomProfileType = "custom" + DLPProfileListResponseDLPCustomProfileTypeCustom DLPProfileListResponseDLPCustomProfileType = "custom" ) -type DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfile struct { +type DLPProfileListResponseDLPIntegrationProfile struct { // The ID for this profile ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // The description of the profile. Description string `json:"description"` // The entries for this profile. - Entries []DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntry `json:"entries"` + Entries []DLPProfileListResponseDLPIntegrationProfileEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileJSON `json:"-"` + Type DLPProfileListResponseDLPIntegrationProfileType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileListResponseDLPIntegrationProfileJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileJSON contains -// the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfile] -type dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileJSON struct { +// dlpProfileListResponseDLPIntegrationProfileJSON contains the JSON metadata for +// the struct [DLPProfileListResponseDLPIntegrationProfile] +type dlpProfileListResponseDLPIntegrationProfileJSON struct { ID apijson.Field CreatedAt apijson.Field Description apijson.Field @@ -290,15 +281,14 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileJSON struc ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfile) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPIntegrationProfile) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfile) implementsDLPProfileDLPProfilesListAllProfilesResponse() { -} +func (r DLPProfileListResponseDLPIntegrationProfile) implementsDLPProfileListResponse() {} // An entry derived from an integration -type DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntry struct { +type DLPProfileListResponseDLPIntegrationProfileEntry struct { // The ID for this entry ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` @@ -307,15 +297,14 @@ type DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntry stru // The name of the entry. Name string `json:"name"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileListResponseDLPIntegrationProfileEntryJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntryJSON -// contains the JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntry] -type dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntryJSON struct { +// dlpProfileListResponseDLPIntegrationProfileEntryJSON contains the JSON metadata +// for the struct [DLPProfileListResponseDLPIntegrationProfileEntry] +type dlpProfileListResponseDLPIntegrationProfileEntryJSON struct { ID apijson.Field CreatedAt apijson.Field Enabled apijson.Field @@ -326,15 +315,15 @@ type dlpProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntryJSON ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseDLPIntegrationProfileEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of the profile. -type DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileType string +type DLPProfileListResponseDLPIntegrationProfileType string const ( - DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileTypeIntegration DLPProfileDLPProfilesListAllProfilesResponseDLPIntegrationProfileType = "integration" + DLPProfileListResponseDLPIntegrationProfileTypeIntegration DLPProfileListResponseDLPIntegrationProfileType = "integration" ) // Union satisfied by [DLPProfileGetResponseDLPPredefinedProfile], @@ -602,19 +591,19 @@ const ( DLPProfileGetResponseDLPIntegrationProfileTypeIntegration DLPProfileGetResponseDLPIntegrationProfileType = "integration" ) -type DLPProfileDLPProfilesListAllProfilesResponseEnvelope struct { - Errors []DLPProfileDLPProfilesListAllProfilesResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPProfileDLPProfilesListAllProfilesResponseEnvelopeMessages `json:"messages,required"` - Result []DLPProfileDLPProfilesListAllProfilesResponse `json:"result,required,nullable"` +type DLPProfileListResponseEnvelope struct { + Errors []DLPProfileListResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPProfileListResponseEnvelopeMessages `json:"messages,required"` + Result []DLPProfileListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success DLPProfileDLPProfilesListAllProfilesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DLPProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfo `json:"result_info"` - JSON dlpProfileDLPProfilesListAllProfilesResponseEnvelopeJSON `json:"-"` + Success DLPProfileListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DLPProfileListResponseEnvelopeResultInfo `json:"result_info"` + JSON dlpProfileListResponseEnvelopeJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseEnvelopeJSON contains the JSON -// metadata for the struct [DLPProfileDLPProfilesListAllProfilesResponseEnvelope] -type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeJSON struct { +// dlpProfileListResponseEnvelopeJSON contains the JSON metadata for the struct +// [DLPProfileListResponseEnvelope] +type dlpProfileListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -624,58 +613,56 @@ type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileDLPProfilesListAllProfilesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileDLPProfilesListAllProfilesResponseEnvelopeErrorsJSON `json:"-"` +type DLPProfileListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileListResponseEnvelopeErrorsJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseEnvelopeErrors] -type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeErrorsJSON struct { +// dlpProfileListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPProfileListResponseEnvelopeErrors] +type dlpProfileListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileDLPProfilesListAllProfilesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileDLPProfilesListAllProfilesResponseEnvelopeMessagesJSON `json:"-"` +type DLPProfileListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileListResponseEnvelopeMessagesJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseEnvelopeMessages] -type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeMessagesJSON struct { +// dlpProfileListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DLPProfileListResponseEnvelopeMessages] +type dlpProfileListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DLPProfileDLPProfilesListAllProfilesResponseEnvelopeSuccess bool +type DLPProfileListResponseEnvelopeSuccess bool const ( - DLPProfileDLPProfilesListAllProfilesResponseEnvelopeSuccessTrue DLPProfileDLPProfilesListAllProfilesResponseEnvelopeSuccess = true + DLPProfileListResponseEnvelopeSuccessTrue DLPProfileListResponseEnvelopeSuccess = true ) -type DLPProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfo struct { +type DLPProfileListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -683,14 +670,13 @@ type DLPProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON dlpProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON dlpProfileListResponseEnvelopeResultInfoJSON `json:"-"` } -// dlpProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [DLPProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfo] -type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfoJSON struct { +// dlpProfileListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [DLPProfileListResponseEnvelopeResultInfo] +type dlpProfileListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -699,7 +685,7 @@ type dlpProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileDLPProfilesListAllProfilesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/dlpprofile_test.go b/dlpprofile_test.go index fb004fc896e..fe949a05bb7 100644 --- a/dlpprofile_test.go +++ b/dlpprofile_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDLPProfileDLPProfilesListAllProfiles(t *testing.T) { +func TestDLPProfileList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestDLPProfileDLPProfilesListAllProfiles(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.DLPProfilesListAllProfiles(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.DLP.Profiles.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -55,7 +55,7 @@ func TestDLPProfileGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Get( + _, err := client.DLP.Profiles.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "384e129d-25bd-403c-8019-bc19eb7a8a5f", diff --git a/dlpprofilecustom.go b/dlpprofilecustom.go index 827196906d1..a7676cb1acb 100644 --- a/dlpprofilecustom.go +++ b/dlpprofilecustom.go @@ -35,11 +35,16 @@ func NewDLPProfileCustomService(opts ...option.RequestOption) (r *DLPProfileCust return } -// Updates a DLP custom profile. -func (r *DLPProfileCustomService) Update(ctx context.Context, accountID string, profileID string, body DLPProfileCustomUpdateParams, opts ...option.RequestOption) (res *DLPProfileCustomUpdateResponse, err error) { +// Creates a set of DLP custom profiles. +func (r *DLPProfileCustomService) New(ctx context.Context, accountID string, body DLPProfileCustomNewParams, opts ...option.RequestOption) (res *[]DLPProfileCustomNewResponse, err error) { opts = append(r.Options[:], opts...) - path := fmt.Sprintf("accounts/%s/dlp/profiles/custom/%s", accountID, profileID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) + var env DLPProfileCustomNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/dlp/profiles/custom", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result return } @@ -56,19 +61,6 @@ func (r *DLPProfileCustomService) Delete(ctx context.Context, accountID string, return } -// Creates a set of DLP custom profiles. -func (r *DLPProfileCustomService) DLPProfilesNewCustomProfiles(ctx context.Context, accountID string, body DLPProfileCustomDLPProfilesNewCustomProfilesParams, opts ...option.RequestOption) (res *[]DLPProfileCustomDLPProfilesNewCustomProfilesResponse, err error) { - opts = append(r.Options[:], opts...) - var env DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/profiles/custom", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetches a custom DLP profile. func (r *DLPProfileCustomService) Get(ctx context.Context, accountID string, profileID string, opts ...option.RequestOption) (res *DLPProfileCustomGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -82,7 +74,15 @@ func (r *DLPProfileCustomService) Get(ctx context.Context, accountID string, pro return } -type DLPProfileCustomUpdateResponse struct { +// Updates a DLP custom profile. +func (r *DLPProfileCustomService) Replace(ctx context.Context, accountID string, profileID string, body DLPProfileCustomReplaceParams, opts ...option.RequestOption) (res *DLPProfileCustomReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("accounts/%s/dlp/profiles/custom/%s", accountID, profileID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) + return +} + +type DLPProfileCustomNewResponse struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. @@ -91,18 +91,18 @@ type DLPProfileCustomUpdateResponse struct { // The description of the profile. Description string `json:"description"` // The entries for this profile. - Entries []DLPProfileCustomUpdateResponseEntry `json:"entries"` + Entries []DLPProfileCustomNewResponseEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileCustomUpdateResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomUpdateResponseJSON `json:"-"` + Type DLPProfileCustomNewResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomNewResponseJSON `json:"-"` } -// dlpProfileCustomUpdateResponseJSON contains the JSON metadata for the struct -// [DLPProfileCustomUpdateResponse] -type dlpProfileCustomUpdateResponseJSON struct { +// dlpProfileCustomNewResponseJSON contains the JSON metadata for the struct +// [DLPProfileCustomNewResponse] +type dlpProfileCustomNewResponseJSON struct { ID apijson.Field AllowedMatchCount apijson.Field CreatedAt apijson.Field @@ -115,12 +115,12 @@ type dlpProfileCustomUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A custom entry that matches a profile -type DLPProfileCustomUpdateResponseEntry struct { +type DLPProfileCustomNewResponseEntry struct { // The ID for this entry ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` @@ -129,16 +129,16 @@ type DLPProfileCustomUpdateResponseEntry struct { // The name of the entry. Name string `json:"name"` // A pattern that matches an entry - Pattern DLPProfileCustomUpdateResponseEntriesPattern `json:"pattern"` + Pattern DLPProfileCustomNewResponseEntriesPattern `json:"pattern"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomUpdateResponseEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomNewResponseEntryJSON `json:"-"` } -// dlpProfileCustomUpdateResponseEntryJSON contains the JSON metadata for the -// struct [DLPProfileCustomUpdateResponseEntry] -type dlpProfileCustomUpdateResponseEntryJSON struct { +// dlpProfileCustomNewResponseEntryJSON contains the JSON metadata for the struct +// [DLPProfileCustomNewResponseEntry] +type dlpProfileCustomNewResponseEntryJSON struct { ID apijson.Field CreatedAt apijson.Field Enabled apijson.Field @@ -150,46 +150,46 @@ type dlpProfileCustomUpdateResponseEntryJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomUpdateResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A pattern that matches an entry -type DLPProfileCustomUpdateResponseEntriesPattern struct { +type DLPProfileCustomNewResponseEntriesPattern struct { // The regex pattern. Regex string `json:"regex,required"` // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. - Validation DLPProfileCustomUpdateResponseEntriesPatternValidation `json:"validation"` - JSON dlpProfileCustomUpdateResponseEntriesPatternJSON `json:"-"` + Validation DLPProfileCustomNewResponseEntriesPatternValidation `json:"validation"` + JSON dlpProfileCustomNewResponseEntriesPatternJSON `json:"-"` } -// dlpProfileCustomUpdateResponseEntriesPatternJSON contains the JSON metadata for -// the struct [DLPProfileCustomUpdateResponseEntriesPattern] -type dlpProfileCustomUpdateResponseEntriesPatternJSON struct { +// dlpProfileCustomNewResponseEntriesPatternJSON contains the JSON metadata for the +// struct [DLPProfileCustomNewResponseEntriesPattern] +type dlpProfileCustomNewResponseEntriesPatternJSON struct { Regex apijson.Field Validation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomUpdateResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. -type DLPProfileCustomUpdateResponseEntriesPatternValidation string +type DLPProfileCustomNewResponseEntriesPatternValidation string const ( - DLPProfileCustomUpdateResponseEntriesPatternValidationLuhn DLPProfileCustomUpdateResponseEntriesPatternValidation = "luhn" + DLPProfileCustomNewResponseEntriesPatternValidationLuhn DLPProfileCustomNewResponseEntriesPatternValidation = "luhn" ) // The type of the profile. -type DLPProfileCustomUpdateResponseType string +type DLPProfileCustomNewResponseType string const ( - DLPProfileCustomUpdateResponseTypeCustom DLPProfileCustomUpdateResponseType = "custom" + DLPProfileCustomNewResponseTypeCustom DLPProfileCustomNewResponseType = "custom" ) // Union satisfied by [DLPProfileCustomDeleteResponseUnknown] or @@ -209,7 +209,7 @@ func init() { ) } -type DLPProfileCustomDLPProfilesNewCustomProfilesResponse struct { +type DLPProfileCustomGetResponse struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. @@ -218,18 +218,18 @@ type DLPProfileCustomDLPProfilesNewCustomProfilesResponse struct { // The description of the profile. Description string `json:"description"` // The entries for this profile. - Entries []DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntry `json:"entries"` + Entries []DLPProfileCustomGetResponseEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileCustomDLPProfilesNewCustomProfilesResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseJSON `json:"-"` + Type DLPProfileCustomGetResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomGetResponseJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseJSON contains the JSON -// metadata for the struct [DLPProfileCustomDLPProfilesNewCustomProfilesResponse] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseJSON struct { +// dlpProfileCustomGetResponseJSON contains the JSON metadata for the struct +// [DLPProfileCustomGetResponse] +type dlpProfileCustomGetResponseJSON struct { ID apijson.Field AllowedMatchCount apijson.Field CreatedAt apijson.Field @@ -242,12 +242,12 @@ type dlpProfileCustomDLPProfilesNewCustomProfilesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A custom entry that matches a profile -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntry struct { +type DLPProfileCustomGetResponseEntry struct { // The ID for this entry ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` @@ -256,17 +256,16 @@ type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntry struct { // The name of the entry. Name string `json:"name"` // A pattern that matches an entry - Pattern DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPattern `json:"pattern"` + Pattern DLPProfileCustomGetResponseEntriesPattern `json:"pattern"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomGetResponseEntryJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntryJSON contains the JSON -// metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntry] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntryJSON struct { +// dlpProfileCustomGetResponseEntryJSON contains the JSON metadata for the struct +// [DLPProfileCustomGetResponseEntry] +type dlpProfileCustomGetResponseEntryJSON struct { ID apijson.Field CreatedAt apijson.Field Enabled apijson.Field @@ -278,50 +277,49 @@ type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntryJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomGetResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A pattern that matches an entry -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPattern struct { +type DLPProfileCustomGetResponseEntriesPattern struct { // The regex pattern. Regex string `json:"regex,required"` // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. - Validation DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternValidation `json:"validation"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternJSON `json:"-"` + Validation DLPProfileCustomGetResponseEntriesPatternValidation `json:"validation"` + JSON dlpProfileCustomGetResponseEntriesPatternJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternJSON contains -// the JSON metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPattern] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternJSON struct { +// dlpProfileCustomGetResponseEntriesPatternJSON contains the JSON metadata for the +// struct [DLPProfileCustomGetResponseEntriesPattern] +type dlpProfileCustomGetResponseEntriesPatternJSON struct { Regex apijson.Field Validation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomGetResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternValidation string +type DLPProfileCustomGetResponseEntriesPatternValidation string const ( - DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternValidationLuhn DLPProfileCustomDLPProfilesNewCustomProfilesResponseEntriesPatternValidation = "luhn" + DLPProfileCustomGetResponseEntriesPatternValidationLuhn DLPProfileCustomGetResponseEntriesPatternValidation = "luhn" ) // The type of the profile. -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseType string +type DLPProfileCustomGetResponseType string const ( - DLPProfileCustomDLPProfilesNewCustomProfilesResponseTypeCustom DLPProfileCustomDLPProfilesNewCustomProfilesResponseType = "custom" + DLPProfileCustomGetResponseTypeCustom DLPProfileCustomGetResponseType = "custom" ) -type DLPProfileCustomGetResponse struct { +type DLPProfileCustomReplaceResponse struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. @@ -330,18 +328,18 @@ type DLPProfileCustomGetResponse struct { // The description of the profile. Description string `json:"description"` // The entries for this profile. - Entries []DLPProfileCustomGetResponseEntry `json:"entries"` + Entries []DLPProfileCustomReplaceResponseEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfileCustomGetResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomGetResponseJSON `json:"-"` + Type DLPProfileCustomReplaceResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomReplaceResponseJSON `json:"-"` } -// dlpProfileCustomGetResponseJSON contains the JSON metadata for the struct -// [DLPProfileCustomGetResponse] -type dlpProfileCustomGetResponseJSON struct { +// dlpProfileCustomReplaceResponseJSON contains the JSON metadata for the struct +// [DLPProfileCustomReplaceResponse] +type dlpProfileCustomReplaceResponseJSON struct { ID apijson.Field AllowedMatchCount apijson.Field CreatedAt apijson.Field @@ -354,12 +352,12 @@ type dlpProfileCustomGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A custom entry that matches a profile -type DLPProfileCustomGetResponseEntry struct { +type DLPProfileCustomReplaceResponseEntry struct { // The ID for this entry ID string `json:"id"` CreatedAt time.Time `json:"created_at" format:"date-time"` @@ -368,16 +366,16 @@ type DLPProfileCustomGetResponseEntry struct { // The name of the entry. Name string `json:"name"` // A pattern that matches an entry - Pattern DLPProfileCustomGetResponseEntriesPattern `json:"pattern"` + Pattern DLPProfileCustomReplaceResponseEntriesPattern `json:"pattern"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON dlpProfileCustomGetResponseEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON dlpProfileCustomReplaceResponseEntryJSON `json:"-"` } -// dlpProfileCustomGetResponseEntryJSON contains the JSON metadata for the struct -// [DLPProfileCustomGetResponseEntry] -type dlpProfileCustomGetResponseEntryJSON struct { +// dlpProfileCustomReplaceResponseEntryJSON contains the JSON metadata for the +// struct [DLPProfileCustomReplaceResponseEntry] +type dlpProfileCustomReplaceResponseEntryJSON struct { ID apijson.Field CreatedAt apijson.Field Enabled apijson.Field @@ -389,369 +387,273 @@ type dlpProfileCustomGetResponseEntryJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomGetResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomReplaceResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A pattern that matches an entry -type DLPProfileCustomGetResponseEntriesPattern struct { +type DLPProfileCustomReplaceResponseEntriesPattern struct { // The regex pattern. Regex string `json:"regex,required"` // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. - Validation DLPProfileCustomGetResponseEntriesPatternValidation `json:"validation"` - JSON dlpProfileCustomGetResponseEntriesPatternJSON `json:"-"` + Validation DLPProfileCustomReplaceResponseEntriesPatternValidation `json:"validation"` + JSON dlpProfileCustomReplaceResponseEntriesPatternJSON `json:"-"` } -// dlpProfileCustomGetResponseEntriesPatternJSON contains the JSON metadata for the -// struct [DLPProfileCustomGetResponseEntriesPattern] -type dlpProfileCustomGetResponseEntriesPatternJSON struct { +// dlpProfileCustomReplaceResponseEntriesPatternJSON contains the JSON metadata for +// the struct [DLPProfileCustomReplaceResponseEntriesPattern] +type dlpProfileCustomReplaceResponseEntriesPatternJSON struct { Regex apijson.Field Validation apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomGetResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomReplaceResponseEntriesPattern) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. -type DLPProfileCustomGetResponseEntriesPatternValidation string +type DLPProfileCustomReplaceResponseEntriesPatternValidation string const ( - DLPProfileCustomGetResponseEntriesPatternValidationLuhn DLPProfileCustomGetResponseEntriesPatternValidation = "luhn" + DLPProfileCustomReplaceResponseEntriesPatternValidationLuhn DLPProfileCustomReplaceResponseEntriesPatternValidation = "luhn" ) // The type of the profile. -type DLPProfileCustomGetResponseType string +type DLPProfileCustomReplaceResponseType string const ( - DLPProfileCustomGetResponseTypeCustom DLPProfileCustomGetResponseType = "custom" + DLPProfileCustomReplaceResponseTypeCustom DLPProfileCustomReplaceResponseType = "custom" ) -type DLPProfileCustomUpdateParams struct { +type DLPProfileCustomNewParams struct { + Profiles param.Field[[]DLPProfileCustomNewParamsProfile] `json:"profiles,required"` +} + +func (r DLPProfileCustomNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DLPProfileCustomNewParamsProfile struct { // Related DLP policies will trigger when the match count exceeds the number set. AllowedMatchCount param.Field[float64] `json:"allowed_match_count"` // The description of the profile. Description param.Field[string] `json:"description"` - // The custom entries for this profile. Array elements with IDs are modifying the - // existing entry with that ID. Elements without ID will create new entries. Any - // entry not in the list will be deleted. - Entries param.Field[[]DLPProfileCustomUpdateParamsEntry] `json:"entries"` + // The entries for this profile. + Entries param.Field[[]DLPProfileCustomNewParamsProfilesEntry] `json:"entries"` // The name of the profile. Name param.Field[string] `json:"name"` - // Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your - // Microsoft Information Protection profiles). - SharedEntries param.Field[[]DLPProfileCustomUpdateParamsSharedEntry] `json:"shared_entries"` } -func (r DLPProfileCustomUpdateParams) MarshalJSON() (data []byte, err error) { +func (r DLPProfileCustomNewParamsProfile) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// A custom entry that matches a profile -type DLPProfileCustomUpdateParamsEntry struct { +// A custom entry create payload +type DLPProfileCustomNewParamsProfilesEntry struct { // Whether the entry is enabled or not. - Enabled param.Field[bool] `json:"enabled"` + Enabled param.Field[bool] `json:"enabled,required"` // The name of the entry. - Name param.Field[string] `json:"name"` + Name param.Field[string] `json:"name,required"` // A pattern that matches an entry - Pattern param.Field[DLPProfileCustomUpdateParamsEntriesPattern] `json:"pattern"` - // ID of the parent profile - ProfileID param.Field[interface{}] `json:"profile_id"` + Pattern param.Field[DLPProfileCustomNewParamsProfilesEntriesPattern] `json:"pattern,required"` } -func (r DLPProfileCustomUpdateParamsEntry) MarshalJSON() (data []byte, err error) { +func (r DLPProfileCustomNewParamsProfilesEntry) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A pattern that matches an entry -type DLPProfileCustomUpdateParamsEntriesPattern struct { +type DLPProfileCustomNewParamsProfilesEntriesPattern struct { // The regex pattern. Regex param.Field[string] `json:"regex,required"` // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. - Validation param.Field[DLPProfileCustomUpdateParamsEntriesPatternValidation] `json:"validation"` + Validation param.Field[DLPProfileCustomNewParamsProfilesEntriesPatternValidation] `json:"validation"` } -func (r DLPProfileCustomUpdateParamsEntriesPattern) MarshalJSON() (data []byte, err error) { +func (r DLPProfileCustomNewParamsProfilesEntriesPattern) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Validation algorithm for the pattern. This algorithm will get run on potential // matches, and if it returns false, the entry will not be matched. -type DLPProfileCustomUpdateParamsEntriesPatternValidation string +type DLPProfileCustomNewParamsProfilesEntriesPatternValidation string const ( - DLPProfileCustomUpdateParamsEntriesPatternValidationLuhn DLPProfileCustomUpdateParamsEntriesPatternValidation = "luhn" + DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn DLPProfileCustomNewParamsProfilesEntriesPatternValidation = "luhn" ) -// Properties of a predefined entry in a custom profile -// -// Satisfied by -// [DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined], -// [DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdateIntegration]. -type DLPProfileCustomUpdateParamsSharedEntry interface { - implementsDLPProfileCustomUpdateParamsSharedEntry() -} - -// Properties of a predefined entry in a custom profile -type DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined struct { - // Whether the entry is enabled or not. - Enabled param.Field[bool] `json:"enabled"` -} - -func (r DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined) implementsDLPProfileCustomUpdateParamsSharedEntry() { -} - -// Properties of an integration entry in a custom profile -type DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdateIntegration struct { - // Whether the entry is enabled or not. - Enabled param.Field[bool] `json:"enabled"` -} - -func (r DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdateIntegration) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdateIntegration) implementsDLPProfileCustomUpdateParamsSharedEntry() { -} - -type DLPProfileCustomDeleteResponseEnvelope struct { - Errors []DLPProfileCustomDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPProfileCustomDeleteResponseEnvelopeMessages `json:"messages,required"` - Result DLPProfileCustomDeleteResponse `json:"result,required"` +type DLPProfileCustomNewResponseEnvelope struct { + Errors []DLPProfileCustomNewResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPProfileCustomNewResponseEnvelopeMessages `json:"messages,required"` + Result []DLPProfileCustomNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success DLPProfileCustomDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON dlpProfileCustomDeleteResponseEnvelopeJSON `json:"-"` + Success DLPProfileCustomNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo DLPProfileCustomNewResponseEnvelopeResultInfo `json:"result_info"` + JSON dlpProfileCustomNewResponseEnvelopeJSON `json:"-"` } -// dlpProfileCustomDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [DLPProfileCustomDeleteResponseEnvelope] -type dlpProfileCustomDeleteResponseEnvelopeJSON struct { +// dlpProfileCustomNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [DLPProfileCustomNewResponseEnvelope] +type dlpProfileCustomNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileCustomDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileCustomDeleteResponseEnvelopeErrorsJSON `json:"-"` +type DLPProfileCustomNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileCustomNewResponseEnvelopeErrorsJSON `json:"-"` } -// dlpProfileCustomDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [DLPProfileCustomDeleteResponseEnvelopeErrors] -type dlpProfileCustomDeleteResponseEnvelopeErrorsJSON struct { +// dlpProfileCustomNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DLPProfileCustomNewResponseEnvelopeErrors] +type dlpProfileCustomNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileCustomDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileCustomDeleteResponseEnvelopeMessagesJSON `json:"-"` +type DLPProfileCustomNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileCustomNewResponseEnvelopeMessagesJSON `json:"-"` } -// dlpProfileCustomDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [DLPProfileCustomDeleteResponseEnvelopeMessages] -type dlpProfileCustomDeleteResponseEnvelopeMessagesJSON struct { +// dlpProfileCustomNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [DLPProfileCustomNewResponseEnvelopeMessages] +type dlpProfileCustomNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DLPProfileCustomDeleteResponseEnvelopeSuccess bool +type DLPProfileCustomNewResponseEnvelopeSuccess bool const ( - DLPProfileCustomDeleteResponseEnvelopeSuccessTrue DLPProfileCustomDeleteResponseEnvelopeSuccess = true + DLPProfileCustomNewResponseEnvelopeSuccessTrue DLPProfileCustomNewResponseEnvelopeSuccess = true ) -type DLPProfileCustomDLPProfilesNewCustomProfilesParams struct { - Profiles param.Field[[]DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfile] `json:"profiles,required"` -} - -func (r DLPProfileCustomDLPProfilesNewCustomProfilesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfile struct { - // Related DLP policies will trigger when the match count exceeds the number set. - AllowedMatchCount param.Field[float64] `json:"allowed_match_count"` - // The description of the profile. - Description param.Field[string] `json:"description"` - // The entries for this profile. - Entries param.Field[[]DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry] `json:"entries"` - // The name of the profile. - Name param.Field[string] `json:"name"` -} - -func (r DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfile) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A custom entry create payload -type DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry struct { - // Whether the entry is enabled or not. - Enabled param.Field[bool] `json:"enabled,required"` - // The name of the entry. - Name param.Field[string] `json:"name,required"` - // A pattern that matches an entry - Pattern param.Field[DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern] `json:"pattern,required"` -} - -func (r DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type DLPProfileCustomNewResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON dlpProfileCustomNewResponseEnvelopeResultInfoJSON `json:"-"` } -// A pattern that matches an entry -type DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern struct { - // The regex pattern. - Regex param.Field[string] `json:"regex,required"` - // Validation algorithm for the pattern. This algorithm will get run on potential - // matches, and if it returns false, the entry will not be matched. - Validation param.Field[DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidation] `json:"validation"` +// dlpProfileCustomNewResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [DLPProfileCustomNewResponseEnvelopeResultInfo] +type dlpProfileCustomNewResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *DLPProfileCustomNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// Validation algorithm for the pattern. This algorithm will get run on potential -// matches, and if it returns false, the entry will not be matched. -type DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidation string - -const ( - DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidation = "luhn" -) - -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelope struct { - Errors []DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrors `json:"errors,required"` - Messages []DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessages `json:"messages,required"` - Result []DLPProfileCustomDLPProfilesNewCustomProfilesResponse `json:"result,required,nullable"` +type DLPProfileCustomDeleteResponseEnvelope struct { + Errors []DLPProfileCustomDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DLPProfileCustomDeleteResponseEnvelopeMessages `json:"messages,required"` + Result DLPProfileCustomDeleteResponse `json:"result,required"` // Whether the API call was successful - Success DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfo `json:"result_info"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeJSON `json:"-"` + Success DLPProfileCustomDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON dlpProfileCustomDeleteResponseEnvelopeJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelope] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeJSON struct { +// dlpProfileCustomDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [DLPProfileCustomDeleteResponseEnvelope] +type dlpProfileCustomDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrorsJSON `json:"-"` +type DLPProfileCustomDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileCustomDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrors] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrorsJSON struct { +// dlpProfileCustomDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [DLPProfileCustomDeleteResponseEnvelopeErrors] +type dlpProfileCustomDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessagesJSON `json:"-"` +type DLPProfileCustomDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dlpProfileCustomDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessages] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessagesJSON struct { +// dlpProfileCustomDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [DLPProfileCustomDeleteResponseEnvelopeMessages] +type dlpProfileCustomDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfileCustomDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeSuccess bool +type DLPProfileCustomDeleteResponseEnvelopeSuccess bool const ( - DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeSuccessTrue DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeSuccess = true + DLPProfileCustomDeleteResponseEnvelopeSuccessTrue DLPProfileCustomDeleteResponseEnvelopeSuccess = true ) -type DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfo] -type dlpProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DLPProfileCustomDLPProfilesNewCustomProfilesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DLPProfileCustomGetResponseEnvelope struct { Errors []DLPProfileCustomGetResponseEnvelopeErrors `json:"errors,required"` Messages []DLPProfileCustomGetResponseEnvelopeMessages `json:"messages,required"` @@ -820,3 +722,95 @@ type DLPProfileCustomGetResponseEnvelopeSuccess bool const ( DLPProfileCustomGetResponseEnvelopeSuccessTrue DLPProfileCustomGetResponseEnvelopeSuccess = true ) + +type DLPProfileCustomReplaceParams struct { + // Related DLP policies will trigger when the match count exceeds the number set. + AllowedMatchCount param.Field[float64] `json:"allowed_match_count"` + // The description of the profile. + Description param.Field[string] `json:"description"` + // The custom entries for this profile. Array elements with IDs are modifying the + // existing entry with that ID. Elements without ID will create new entries. Any + // entry not in the list will be deleted. + Entries param.Field[[]DLPProfileCustomReplaceParamsEntry] `json:"entries"` + // The name of the profile. + Name param.Field[string] `json:"name"` + // Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your + // Microsoft Information Protection profiles). + SharedEntries param.Field[[]DLPProfileCustomReplaceParamsSharedEntry] `json:"shared_entries"` +} + +func (r DLPProfileCustomReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// A custom entry that matches a profile +type DLPProfileCustomReplaceParamsEntry struct { + // Whether the entry is enabled or not. + Enabled param.Field[bool] `json:"enabled"` + // The name of the entry. + Name param.Field[string] `json:"name"` + // A pattern that matches an entry + Pattern param.Field[DLPProfileCustomReplaceParamsEntriesPattern] `json:"pattern"` + // ID of the parent profile + ProfileID param.Field[interface{}] `json:"profile_id"` +} + +func (r DLPProfileCustomReplaceParamsEntry) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// A pattern that matches an entry +type DLPProfileCustomReplaceParamsEntriesPattern struct { + // The regex pattern. + Regex param.Field[string] `json:"regex,required"` + // Validation algorithm for the pattern. This algorithm will get run on potential + // matches, and if it returns false, the entry will not be matched. + Validation param.Field[DLPProfileCustomReplaceParamsEntriesPatternValidation] `json:"validation"` +} + +func (r DLPProfileCustomReplaceParamsEntriesPattern) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Validation algorithm for the pattern. This algorithm will get run on potential +// matches, and if it returns false, the entry will not be matched. +type DLPProfileCustomReplaceParamsEntriesPatternValidation string + +const ( + DLPProfileCustomReplaceParamsEntriesPatternValidationLuhn DLPProfileCustomReplaceParamsEntriesPatternValidation = "luhn" +) + +// Properties of a predefined entry in a custom profile +// +// Satisfied by +// [DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined], +// [DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdateIntegration]. +type DLPProfileCustomReplaceParamsSharedEntry interface { + implementsDLPProfileCustomReplaceParamsSharedEntry() +} + +// Properties of a predefined entry in a custom profile +type DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined struct { + // Whether the entry is enabled or not. + Enabled param.Field[bool] `json:"enabled"` +} + +func (r DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined) implementsDLPProfileCustomReplaceParamsSharedEntry() { +} + +// Properties of an integration entry in a custom profile +type DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdateIntegration struct { + // Whether the entry is enabled or not. + Enabled param.Field[bool] `json:"enabled"` +} + +func (r DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdateIntegration) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdateIntegration) implementsDLPProfileCustomReplaceParamsSharedEntry() { +} diff --git a/dlpprofilecustom_test.go b/dlpprofilecustom_test.go index c3663520b7c..614e06e4dd2 100644 --- a/dlpprofilecustom_test.go +++ b/dlpprofilecustom_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDLPProfileCustomUpdateWithOptionalParams(t *testing.T) { +func TestDLPProfileCustomNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,46 +29,89 @@ func TestDLPProfileCustomUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Customs.Update( + _, err := client.DLP.Profiles.Customs.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "384e129d-25bd-403c-8019-bc19eb7a8a5f", - cloudflare.DLPProfileCustomUpdateParams{ - AllowedMatchCount: cloudflare.F(5.000000), - Description: cloudflare.F("A standard CVV card number"), - Entries: cloudflare.F([]cloudflare.DLPProfileCustomUpdateParamsEntry{{ - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPatternValidationLuhn), - }), - ProfileID: cloudflare.F[any](map[string]interface{}{}), + cloudflare.DLPProfileCustomNewParams{ + Profiles: cloudflare.F([]cloudflare.DLPProfileCustomNewParamsProfile{{ + AllowedMatchCount: cloudflare.F(5.000000), + Description: cloudflare.F("A standard CVV card number"), + Entries: cloudflare.F([]cloudflare.DLPProfileCustomNewParamsProfilesEntry{{ + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }}), + Name: cloudflare.F("Generic CVV Card Number"), }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPatternValidationLuhn), - }), - ProfileID: cloudflare.F[any](map[string]interface{}{}), + AllowedMatchCount: cloudflare.F(5.000000), + Description: cloudflare.F("A standard CVV card number"), + Entries: cloudflare.F([]cloudflare.DLPProfileCustomNewParamsProfilesEntry{{ + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }}), + Name: cloudflare.F("Generic CVV Card Number"), }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomUpdateParamsEntriesPatternValidationLuhn), - }), - ProfileID: cloudflare.F[any](map[string]interface{}{}), + AllowedMatchCount: cloudflare.F(5.000000), + Description: cloudflare.F("A standard CVV card number"), + Entries: cloudflare.F([]cloudflare.DLPProfileCustomNewParamsProfilesEntry{{ + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomNewParamsProfilesEntriesPatternValidationLuhn), + }), + }}), + Name: cloudflare.F("Generic CVV Card Number"), }}), - Name: cloudflare.F("Generic CVV Card Number"), - SharedEntries: cloudflare.F([]cloudflare.DLPProfileCustomUpdateParamsSharedEntry{cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined{ - Enabled: cloudflare.F(true), - }), cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined{ - Enabled: cloudflare.F(true), - }), cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdatePredefined{ - Enabled: cloudflare.F(true), - })}), }, ) if err != nil { @@ -96,7 +139,7 @@ func TestDLPProfileCustomDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Customs.Delete( + _, err := client.DLP.Profiles.Customs.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "384e129d-25bd-403c-8019-bc19eb7a8a5f", @@ -110,7 +153,7 @@ func TestDLPProfileCustomDelete(t *testing.T) { } } -func TestDLPProfileCustomDLPProfilesNewCustomProfiles(t *testing.T) { +func TestDLPProfileCustomGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,90 +169,10 @@ func TestDLPProfileCustomDLPProfilesNewCustomProfiles(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Customs.DLPProfilesNewCustomProfiles( + _, err := client.DLP.Profiles.Customs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParams{ - Profiles: cloudflare.F([]cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfile{{ - AllowedMatchCount: cloudflare.F(5.000000), - Description: cloudflare.F("A standard CVV card number"), - Entries: cloudflare.F([]cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry{{ - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }}), - Name: cloudflare.F("Generic CVV Card Number"), - }, { - AllowedMatchCount: cloudflare.F(5.000000), - Description: cloudflare.F("A standard CVV card number"), - Entries: cloudflare.F([]cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry{{ - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }}), - Name: cloudflare.F("Generic CVV Card Number"), - }, { - AllowedMatchCount: cloudflare.F(5.000000), - Description: cloudflare.F("A standard CVV card number"), - Entries: cloudflare.F([]cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntry{{ - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }, { - Enabled: cloudflare.F(true), - Name: cloudflare.F("Credit card (Visa)"), - Pattern: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPattern{ - Regex: cloudflare.F("^4[0-9]{6,14}$"), - Validation: cloudflare.F(cloudflare.DLPProfileCustomDLPProfilesNewCustomProfilesParamsProfilesEntriesPatternValidationLuhn), - }), - }}), - Name: cloudflare.F("Generic CVV Card Number"), - }}), - }, + "384e129d-25bd-403c-8019-bc19eb7a8a5f", ) if err != nil { var apierr *cloudflare.Error @@ -220,7 +183,7 @@ func TestDLPProfileCustomDLPProfilesNewCustomProfiles(t *testing.T) { } } -func TestDLPProfileCustomGet(t *testing.T) { +func TestDLPProfileCustomReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -236,10 +199,47 @@ func TestDLPProfileCustomGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Customs.Get( + _, err := client.DLP.Profiles.Customs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "384e129d-25bd-403c-8019-bc19eb7a8a5f", + cloudflare.DLPProfileCustomReplaceParams{ + AllowedMatchCount: cloudflare.F(5.000000), + Description: cloudflare.F("A standard CVV card number"), + Entries: cloudflare.F([]cloudflare.DLPProfileCustomReplaceParamsEntry{{ + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPatternValidationLuhn), + }), + ProfileID: cloudflare.F[any](map[string]interface{}{}), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPatternValidationLuhn), + }), + ProfileID: cloudflare.F[any](map[string]interface{}{}), + }, { + Enabled: cloudflare.F(true), + Name: cloudflare.F("Credit card (Visa)"), + Pattern: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPattern{ + Regex: cloudflare.F("^4[0-9]{6,14}$"), + Validation: cloudflare.F(cloudflare.DLPProfileCustomReplaceParamsEntriesPatternValidationLuhn), + }), + ProfileID: cloudflare.F[any](map[string]interface{}{}), + }}), + Name: cloudflare.F("Generic CVV Card Number"), + SharedEntries: cloudflare.F([]cloudflare.DLPProfileCustomReplaceParamsSharedEntry{cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined{ + Enabled: cloudflare.F(true), + }), cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined{ + Enabled: cloudflare.F(true), + }), cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined(cloudflare.DLPProfileCustomReplaceParamsSharedEntriesDLPSharedEntryUpdatePredefined{ + Enabled: cloudflare.F(true), + })}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/dlpprofilepredefined.go b/dlpprofilepredefined.go index db9d1fd648c..72fe0db7196 100644 --- a/dlpprofilepredefined.go +++ b/dlpprofilepredefined.go @@ -31,14 +31,6 @@ func NewDLPProfilePredefinedService(opts ...option.RequestOption) (r *DLPProfile return } -// Updates a DLP predefined profile. Only supports enabling/disabling entries. -func (r *DLPProfilePredefinedService) Update(ctx context.Context, accountID string, profileID string, body DLPProfilePredefinedUpdateParams, opts ...option.RequestOption) (res *DLPProfilePredefinedUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("accounts/%s/dlp/profiles/predefined/%s", accountID, profileID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) - return -} - // Fetches a predefined DLP profile. func (r *DLPProfilePredefinedService) Get(ctx context.Context, accountID string, profileID string, opts ...option.RequestOption) (res *DLPProfilePredefinedGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -52,23 +44,31 @@ func (r *DLPProfilePredefinedService) Get(ctx context.Context, accountID string, return } -type DLPProfilePredefinedUpdateResponse struct { +// Updates a DLP predefined profile. Only supports enabling/disabling entries. +func (r *DLPProfilePredefinedService) Replace(ctx context.Context, accountID string, profileID string, body DLPProfilePredefinedReplaceParams, opts ...option.RequestOption) (res *DLPProfilePredefinedReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("accounts/%s/dlp/profiles/predefined/%s", accountID, profileID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) + return +} + +type DLPProfilePredefinedGetResponse struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. AllowedMatchCount float64 `json:"allowed_match_count"` // The entries for this profile. - Entries []DLPProfilePredefinedUpdateResponseEntry `json:"entries"` + Entries []DLPProfilePredefinedGetResponseEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfilePredefinedUpdateResponseType `json:"type"` - JSON dlpProfilePredefinedUpdateResponseJSON `json:"-"` + Type DLPProfilePredefinedGetResponseType `json:"type"` + JSON dlpProfilePredefinedGetResponseJSON `json:"-"` } -// dlpProfilePredefinedUpdateResponseJSON contains the JSON metadata for the struct -// [DLPProfilePredefinedUpdateResponse] -type dlpProfilePredefinedUpdateResponseJSON struct { +// dlpProfilePredefinedGetResponseJSON contains the JSON metadata for the struct +// [DLPProfilePredefinedGetResponse] +type dlpProfilePredefinedGetResponseJSON struct { ID apijson.Field AllowedMatchCount apijson.Field Entries apijson.Field @@ -78,12 +78,12 @@ type dlpProfilePredefinedUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfilePredefinedUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfilePredefinedGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A predefined entry that matches a profile -type DLPProfilePredefinedUpdateResponseEntry struct { +type DLPProfilePredefinedGetResponseEntry struct { // The ID for this entry ID string `json:"id"` // Whether the entry is enabled or not. @@ -91,13 +91,13 @@ type DLPProfilePredefinedUpdateResponseEntry struct { // The name of the entry. Name string `json:"name"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - JSON dlpProfilePredefinedUpdateResponseEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + JSON dlpProfilePredefinedGetResponseEntryJSON `json:"-"` } -// dlpProfilePredefinedUpdateResponseEntryJSON contains the JSON metadata for the -// struct [DLPProfilePredefinedUpdateResponseEntry] -type dlpProfilePredefinedUpdateResponseEntryJSON struct { +// dlpProfilePredefinedGetResponseEntryJSON contains the JSON metadata for the +// struct [DLPProfilePredefinedGetResponseEntry] +type dlpProfilePredefinedGetResponseEntryJSON struct { ID apijson.Field Enabled apijson.Field Name apijson.Field @@ -106,34 +106,34 @@ type dlpProfilePredefinedUpdateResponseEntryJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfilePredefinedUpdateResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfilePredefinedGetResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of the profile. -type DLPProfilePredefinedUpdateResponseType string +type DLPProfilePredefinedGetResponseType string const ( - DLPProfilePredefinedUpdateResponseTypePredefined DLPProfilePredefinedUpdateResponseType = "predefined" + DLPProfilePredefinedGetResponseTypePredefined DLPProfilePredefinedGetResponseType = "predefined" ) -type DLPProfilePredefinedGetResponse struct { +type DLPProfilePredefinedReplaceResponse struct { // The ID for this profile ID string `json:"id"` // Related DLP policies will trigger when the match count exceeds the number set. AllowedMatchCount float64 `json:"allowed_match_count"` // The entries for this profile. - Entries []DLPProfilePredefinedGetResponseEntry `json:"entries"` + Entries []DLPProfilePredefinedReplaceResponseEntry `json:"entries"` // The name of the profile. Name string `json:"name"` // The type of the profile. - Type DLPProfilePredefinedGetResponseType `json:"type"` - JSON dlpProfilePredefinedGetResponseJSON `json:"-"` + Type DLPProfilePredefinedReplaceResponseType `json:"type"` + JSON dlpProfilePredefinedReplaceResponseJSON `json:"-"` } -// dlpProfilePredefinedGetResponseJSON contains the JSON metadata for the struct -// [DLPProfilePredefinedGetResponse] -type dlpProfilePredefinedGetResponseJSON struct { +// dlpProfilePredefinedReplaceResponseJSON contains the JSON metadata for the +// struct [DLPProfilePredefinedReplaceResponse] +type dlpProfilePredefinedReplaceResponseJSON struct { ID apijson.Field AllowedMatchCount apijson.Field Entries apijson.Field @@ -143,12 +143,12 @@ type dlpProfilePredefinedGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfilePredefinedGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfilePredefinedReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A predefined entry that matches a profile -type DLPProfilePredefinedGetResponseEntry struct { +type DLPProfilePredefinedReplaceResponseEntry struct { // The ID for this entry ID string `json:"id"` // Whether the entry is enabled or not. @@ -156,13 +156,13 @@ type DLPProfilePredefinedGetResponseEntry struct { // The name of the entry. Name string `json:"name"` // ID of the parent profile - ProfileID interface{} `json:"profile_id"` - JSON dlpProfilePredefinedGetResponseEntryJSON `json:"-"` + ProfileID interface{} `json:"profile_id"` + JSON dlpProfilePredefinedReplaceResponseEntryJSON `json:"-"` } -// dlpProfilePredefinedGetResponseEntryJSON contains the JSON metadata for the -// struct [DLPProfilePredefinedGetResponseEntry] -type dlpProfilePredefinedGetResponseEntryJSON struct { +// dlpProfilePredefinedReplaceResponseEntryJSON contains the JSON metadata for the +// struct [DLPProfilePredefinedReplaceResponseEntry] +type dlpProfilePredefinedReplaceResponseEntryJSON struct { ID apijson.Field Enabled apijson.Field Name apijson.Field @@ -171,37 +171,17 @@ type dlpProfilePredefinedGetResponseEntryJSON struct { ExtraFields map[string]apijson.Field } -func (r *DLPProfilePredefinedGetResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *DLPProfilePredefinedReplaceResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of the profile. -type DLPProfilePredefinedGetResponseType string +type DLPProfilePredefinedReplaceResponseType string const ( - DLPProfilePredefinedGetResponseTypePredefined DLPProfilePredefinedGetResponseType = "predefined" + DLPProfilePredefinedReplaceResponseTypePredefined DLPProfilePredefinedReplaceResponseType = "predefined" ) -type DLPProfilePredefinedUpdateParams struct { - // Related DLP policies will trigger when the match count exceeds the number set. - AllowedMatchCount param.Field[float64] `json:"allowed_match_count"` - // The entries for this profile. - Entries param.Field[[]DLPProfilePredefinedUpdateParamsEntry] `json:"entries"` -} - -func (r DLPProfilePredefinedUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type DLPProfilePredefinedUpdateParamsEntry struct { - // Whether the entry is enabled or not. - Enabled param.Field[bool] `json:"enabled"` -} - -func (r DLPProfilePredefinedUpdateParamsEntry) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - type DLPProfilePredefinedGetResponseEnvelope struct { Errors []DLPProfilePredefinedGetResponseEnvelopeErrors `json:"errors,required"` Messages []DLPProfilePredefinedGetResponseEnvelopeMessages `json:"messages,required"` @@ -270,3 +250,23 @@ type DLPProfilePredefinedGetResponseEnvelopeSuccess bool const ( DLPProfilePredefinedGetResponseEnvelopeSuccessTrue DLPProfilePredefinedGetResponseEnvelopeSuccess = true ) + +type DLPProfilePredefinedReplaceParams struct { + // Related DLP policies will trigger when the match count exceeds the number set. + AllowedMatchCount param.Field[float64] `json:"allowed_match_count"` + // The entries for this profile. + Entries param.Field[[]DLPProfilePredefinedReplaceParamsEntry] `json:"entries"` +} + +func (r DLPProfilePredefinedReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DLPProfilePredefinedReplaceParamsEntry struct { + // Whether the entry is enabled or not. + Enabled param.Field[bool] `json:"enabled"` +} + +func (r DLPProfilePredefinedReplaceParamsEntry) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} diff --git a/dlpprofilepredefined_test.go b/dlpprofilepredefined_test.go index e08c86634c9..e16f9de34da 100644 --- a/dlpprofilepredefined_test.go +++ b/dlpprofilepredefined_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDLPProfilePredefinedUpdateWithOptionalParams(t *testing.T) { +func TestDLPProfilePredefinedGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,20 +29,10 @@ func TestDLPProfilePredefinedUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Predefineds.Update( + _, err := client.DLP.Profiles.Predefineds.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "384e129d-25bd-403c-8019-bc19eb7a8a5f", - cloudflare.DLPProfilePredefinedUpdateParams{ - AllowedMatchCount: cloudflare.F(5.000000), - Entries: cloudflare.F([]cloudflare.DLPProfilePredefinedUpdateParamsEntry{{ - Enabled: cloudflare.F(true), - }, { - Enabled: cloudflare.F(true), - }, { - Enabled: cloudflare.F(true), - }}), - }, ) if err != nil { var apierr *cloudflare.Error @@ -53,7 +43,7 @@ func TestDLPProfilePredefinedUpdateWithOptionalParams(t *testing.T) { } } -func TestDLPProfilePredefinedGet(t *testing.T) { +func TestDLPProfilePredefinedReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -69,10 +59,20 @@ func TestDLPProfilePredefinedGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Profiles.Predefineds.Get( + _, err := client.DLP.Profiles.Predefineds.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "384e129d-25bd-403c-8019-bc19eb7a8a5f", + cloudflare.DLPProfilePredefinedReplaceParams{ + AllowedMatchCount: cloudflare.F(5.000000), + Entries: cloudflare.F([]cloudflare.DLPProfilePredefinedReplaceParamsEntry{{ + Enabled: cloudflare.F(true), + }, { + Enabled: cloudflare.F(true), + }, { + Enabled: cloudflare.F(true), + }}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/dnsfirewall_test.go b/dnsfirewall_test.go index c5044f282a4..bbb7882580d 100644 --- a/dnsfirewall_test.go +++ b/dnsfirewall_test.go @@ -30,7 +30,7 @@ func TestDNSFirewallNewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.New( + _, err := client.DNSFirewall.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.DNSFirewallNewParams{ @@ -76,7 +76,7 @@ func TestDNSFirewallUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.Update( + _, err := client.DNSFirewall.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -124,7 +124,7 @@ func TestDNSFirewallListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.List( + _, err := client.DNSFirewall.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.DNSFirewallListParams{ @@ -157,7 +157,7 @@ func TestDNSFirewallDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.Delete( + _, err := client.DNSFirewall.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -187,7 +187,7 @@ func TestDNSFirewallGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.Get( + _, err := client.DNSFirewall.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/dnsfirewalldnsanalyticreport_test.go b/dnsfirewalldnsanalyticreport_test.go index b3ba643ff78..710a0c384e4 100644 --- a/dnsfirewalldnsanalyticreport_test.go +++ b/dnsfirewalldnsanalyticreport_test.go @@ -30,7 +30,7 @@ func TestDNSFirewallDNSAnalyticReportListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.DNSAnalytics.Reports.List( + _, err := client.DNSFirewall.DNSAnalytics.Reports.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/dnsfirewalldnsanalyticreportbytime_test.go b/dnsfirewalldnsanalyticreportbytime_test.go index cfd3df9ef12..1e6bf1e84dc 100644 --- a/dnsfirewalldnsanalyticreportbytime_test.go +++ b/dnsfirewalldnsanalyticreportbytime_test.go @@ -30,7 +30,7 @@ func TestDNSFirewallDNSAnalyticReportBytimeListWithOptionalParams(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSFirewalls.DNSAnalytics.Reports.Bytimes.List( + _, err := client.DNSFirewall.DNSAnalytics.Reports.Bytimes.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/dnsrecord.go b/dnsrecord.go index 7f9434bd3e4..418f0ca2faa 100644 --- a/dnsrecord.go +++ b/dnsrecord.go @@ -56,24 +56,6 @@ func (r *DNSRecordService) New(ctx context.Context, zoneID string, body DNSRecor return } -// Overwrite an existing DNS record. Notes: -// -// - A/AAAA records cannot exist on the same name as CNAME records. -// - NS records cannot exist on the same name as any other record type. -// - Domain names are always represented in Punycode, even if Unicode characters -// were used when creating the record. -func (r *DNSRecordService) Update(ctx context.Context, zoneID string, dnsRecordID string, body DNSRecordUpdateParams, opts ...option.RequestOption) (res *DNSRecordUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env DNSRecordUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/dns_records/%s", zoneID, dnsRecordID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List, search, sort, and filter a zones' DNS records. func (r *DNSRecordService) List(ctx context.Context, zoneID string, query DNSRecordListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[DNSRecordListResponse], err error) { var raw *http.Response @@ -158,6 +140,24 @@ func (r *DNSRecordService) Import(ctx context.Context, zoneID string, body DNSRe return } +// Overwrite an existing DNS record. Notes: +// +// - A/AAAA records cannot exist on the same name as CNAME records. +// - NS records cannot exist on the same name as any other record type. +// - Domain names are always represented in Punycode, even if Unicode characters +// were used when creating the record. +func (r *DNSRecordService) Replace(ctx context.Context, zoneID string, dnsRecordID string, body DNSRecordReplaceParams, opts ...option.RequestOption) (res *DNSRecordReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env DNSRecordReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/dns_records/%s", zoneID, dnsRecordID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Scan for common DNS records on your domain and automatically add them to your // zone. Useful if you haven't updated your nameservers yet. func (r *DNSRecordService) Scan(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *DNSRecordScanResponse, err error) { @@ -3070,41 +3070,41 @@ const ( DNSRecordNewResponseDNSRecordsUriRecordTTLNumber1 DNSRecordNewResponseDNSRecordsUriRecordTTLNumber = 1 ) -// Union satisfied by [DNSRecordUpdateResponseDNSRecordsARecord], -// [DNSRecordUpdateResponseDNSRecordsAaaaRecord], -// [DNSRecordUpdateResponseDNSRecordsCaaRecord], -// [DNSRecordUpdateResponseDNSRecordsCertRecord], -// [DNSRecordUpdateResponseDNSRecordsCnameRecord], -// [DNSRecordUpdateResponseDNSRecordsDnskeyRecord], -// [DNSRecordUpdateResponseDNSRecordsDsRecord], -// [DNSRecordUpdateResponseDNSRecordsHTTPSRecord], -// [DNSRecordUpdateResponseDNSRecordsLocRecord], -// [DNSRecordUpdateResponseDNSRecordsMxRecord], -// [DNSRecordUpdateResponseDNSRecordsNaptrRecord], -// [DNSRecordUpdateResponseDNSRecordsNsRecord], -// [DNSRecordUpdateResponseDNSRecordsPtrRecord], -// [DNSRecordUpdateResponseDNSRecordsSmimeaRecord], -// [DNSRecordUpdateResponseDNSRecordsSrvRecord], -// [DNSRecordUpdateResponseDNSRecordsSshfpRecord], -// [DNSRecordUpdateResponseDNSRecordsSvcbRecord], -// [DNSRecordUpdateResponseDNSRecordsTlsaRecord], -// [DNSRecordUpdateResponseDNSRecordsTxtRecord] or -// [DNSRecordUpdateResponseDNSRecordsUriRecord]. -type DNSRecordUpdateResponse interface { - implementsDNSRecordUpdateResponse() +// Union satisfied by [DNSRecordListResponseDNSRecordsARecord], +// [DNSRecordListResponseDNSRecordsAaaaRecord], +// [DNSRecordListResponseDNSRecordsCaaRecord], +// [DNSRecordListResponseDNSRecordsCertRecord], +// [DNSRecordListResponseDNSRecordsCnameRecord], +// [DNSRecordListResponseDNSRecordsDnskeyRecord], +// [DNSRecordListResponseDNSRecordsDsRecord], +// [DNSRecordListResponseDNSRecordsHTTPSRecord], +// [DNSRecordListResponseDNSRecordsLocRecord], +// [DNSRecordListResponseDNSRecordsMxRecord], +// [DNSRecordListResponseDNSRecordsNaptrRecord], +// [DNSRecordListResponseDNSRecordsNsRecord], +// [DNSRecordListResponseDNSRecordsPtrRecord], +// [DNSRecordListResponseDNSRecordsSmimeaRecord], +// [DNSRecordListResponseDNSRecordsSrvRecord], +// [DNSRecordListResponseDNSRecordsSshfpRecord], +// [DNSRecordListResponseDNSRecordsSvcbRecord], +// [DNSRecordListResponseDNSRecordsTlsaRecord], +// [DNSRecordListResponseDNSRecordsTxtRecord] or +// [DNSRecordListResponseDNSRecordsUriRecord]. +type DNSRecordListResponse interface { + implementsDNSRecordListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DNSRecordUpdateResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DNSRecordListResponse)(nil)).Elem(), "") } -type DNSRecordUpdateResponseDNSRecordsARecord struct { +type DNSRecordListResponseDNSRecordsARecord struct { // A valid IPv4 address. Content string `json:"content,required" format:"ipv4"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsARecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsARecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3116,7 +3116,7 @@ type DNSRecordUpdateResponseDNSRecordsARecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsARecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsARecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3129,17 +3129,17 @@ type DNSRecordUpdateResponseDNSRecordsARecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsARecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsARecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsARecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsARecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsARecordJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseDNSRecordsARecord] -type dnsRecordUpdateResponseDNSRecordsARecordJSON struct { +// dnsRecordListResponseDNSRecordsARecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsARecord] +type dnsRecordListResponseDNSRecordsARecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -3159,39 +3159,39 @@ type dnsRecordUpdateResponseDNSRecordsARecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsARecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsARecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsARecordType string +type DNSRecordListResponseDNSRecordsARecordType string const ( - DNSRecordUpdateResponseDNSRecordsARecordTypeA DNSRecordUpdateResponseDNSRecordsARecordType = "A" + DNSRecordListResponseDNSRecordsARecordTypeA DNSRecordListResponseDNSRecordsARecordType = "A" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsARecordMeta struct { +type DNSRecordListResponseDNSRecordsARecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsARecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsARecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsARecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsARecordMeta] -type dnsRecordUpdateResponseDNSRecordsARecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsARecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsARecordMeta] +type dnsRecordListResponseDNSRecordsARecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3200,14 +3200,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsARecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsARecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsARecordTTL() +// [DNSRecordListResponseDNSRecordsARecordTTLNumber]. +type DNSRecordListResponseDNSRecordsARecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsARecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsARecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsARecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3216,19 +3216,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsARecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsARecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsARecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsARecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsARecordTTLNumber1 DNSRecordListResponseDNSRecordsARecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsAaaaRecord struct { +type DNSRecordListResponseDNSRecordsAaaaRecord struct { // A valid IPv6 address. Content string `json:"content,required" format:"ipv6"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsAaaaRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsAaaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3240,7 +3240,7 @@ type DNSRecordUpdateResponseDNSRecordsAaaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsAaaaRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsAaaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3253,17 +3253,17 @@ type DNSRecordUpdateResponseDNSRecordsAaaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsAaaaRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsAaaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsAaaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsAaaaRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsAaaaRecord] -type dnsRecordUpdateResponseDNSRecordsAaaaRecordJSON struct { +// dnsRecordListResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsAaaaRecord] +type dnsRecordListResponseDNSRecordsAaaaRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -3283,39 +3283,39 @@ type dnsRecordUpdateResponseDNSRecordsAaaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsAaaaRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsAaaaRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsAaaaRecordType string +type DNSRecordListResponseDNSRecordsAaaaRecordType string const ( - DNSRecordUpdateResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordUpdateResponseDNSRecordsAaaaRecordType = "AAAA" + DNSRecordListResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordListResponseDNSRecordsAaaaRecordType = "AAAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsAaaaRecordMeta struct { +type DNSRecordListResponseDNSRecordsAaaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsAaaaRecordMeta] -type dnsRecordUpdateResponseDNSRecordsAaaaRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsAaaaRecordMeta] +type dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3324,14 +3324,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsAaaaRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsAaaaRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsAaaaRecordTTL() +// [DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsAaaaRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsAaaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3340,19 +3340,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsAaaaRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsAaaaRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsCaaRecord struct { +type DNSRecordListResponseDNSRecordsCaaRecord struct { // Components of a CAA record. - Data DNSRecordUpdateResponseDNSRecordsCaaRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsCaaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsCaaRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsCaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3366,7 +3366,7 @@ type DNSRecordUpdateResponseDNSRecordsCaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsCaaRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsCaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3376,17 +3376,17 @@ type DNSRecordUpdateResponseDNSRecordsCaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsCaaRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsCaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsCaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsCaaRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCaaRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsCaaRecord] -type dnsRecordUpdateResponseDNSRecordsCaaRecordJSON struct { +// dnsRecordListResponseDNSRecordsCaaRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsCaaRecord] +type dnsRecordListResponseDNSRecordsCaaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -3406,26 +3406,26 @@ type dnsRecordUpdateResponseDNSRecordsCaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsCaaRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsCaaRecord) implementsDNSRecordListResponse() {} // Components of a CAA record. -type DNSRecordUpdateResponseDNSRecordsCaaRecordData struct { +type DNSRecordListResponseDNSRecordsCaaRecordData struct { // Flags for the CAA record. Flags float64 `json:"flags"` // Name of the property controlled by this record (e.g.: issue, issuewild, iodef). Tag string `json:"tag"` // Value of the record. This field's semantics depend on the chosen tag. - Value string `json:"value"` - JSON dnsRecordUpdateResponseDNSRecordsCaaRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordListResponseDNSRecordsCaaRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsCaaRecordData] -type dnsRecordUpdateResponseDNSRecordsCaaRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsCaaRecordData] +type dnsRecordListResponseDNSRecordsCaaRecordDataJSON struct { Flags apijson.Field Tag apijson.Field Value apijson.Field @@ -3433,37 +3433,37 @@ type dnsRecordUpdateResponseDNSRecordsCaaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsCaaRecordType string +type DNSRecordListResponseDNSRecordsCaaRecordType string const ( - DNSRecordUpdateResponseDNSRecordsCaaRecordTypeCaa DNSRecordUpdateResponseDNSRecordsCaaRecordType = "CAA" + DNSRecordListResponseDNSRecordsCaaRecordTypeCaa DNSRecordListResponseDNSRecordsCaaRecordType = "CAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsCaaRecordMeta struct { +type DNSRecordListResponseDNSRecordsCaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsCaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsCaaRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsCaaRecordMeta] -type dnsRecordUpdateResponseDNSRecordsCaaRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsCaaRecordMeta] +type dnsRecordListResponseDNSRecordsCaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3472,14 +3472,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsCaaRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsCaaRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsCaaRecordTTL() +// [DNSRecordListResponseDNSRecordsCaaRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsCaaRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsCaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3488,19 +3488,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsCaaRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsCaaRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsCaaRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordListResponseDNSRecordsCaaRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsCertRecord struct { +type DNSRecordListResponseDNSRecordsCertRecord struct { // Components of a CERT record. - Data DNSRecordUpdateResponseDNSRecordsCertRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsCertRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsCertRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsCertRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3514,7 +3514,7 @@ type DNSRecordUpdateResponseDNSRecordsCertRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsCertRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsCertRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3524,17 +3524,17 @@ type DNSRecordUpdateResponseDNSRecordsCertRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsCertRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsCertRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsCertRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsCertRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCertRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsCertRecord] -type dnsRecordUpdateResponseDNSRecordsCertRecordJSON struct { +// dnsRecordListResponseDNSRecordsCertRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsCertRecord] +type dnsRecordListResponseDNSRecordsCertRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -3554,14 +3554,14 @@ type dnsRecordUpdateResponseDNSRecordsCertRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsCertRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsCertRecord) implementsDNSRecordListResponse() {} // Components of a CERT record. -type DNSRecordUpdateResponseDNSRecordsCertRecordData struct { +type DNSRecordListResponseDNSRecordsCertRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Certificate. @@ -3569,13 +3569,13 @@ type DNSRecordUpdateResponseDNSRecordsCertRecordData struct { // Key Tag. KeyTag float64 `json:"key_tag"` // Type. - Type float64 `json:"type"` - JSON dnsRecordUpdateResponseDNSRecordsCertRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordListResponseDNSRecordsCertRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCertRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsCertRecordData] -type dnsRecordUpdateResponseDNSRecordsCertRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsCertRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsCertRecordData] +type dnsRecordListResponseDNSRecordsCertRecordDataJSON struct { Algorithm apijson.Field Certificate apijson.Field KeyTag apijson.Field @@ -3584,37 +3584,37 @@ type dnsRecordUpdateResponseDNSRecordsCertRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsCertRecordType string +type DNSRecordListResponseDNSRecordsCertRecordType string const ( - DNSRecordUpdateResponseDNSRecordsCertRecordTypeCert DNSRecordUpdateResponseDNSRecordsCertRecordType = "CERT" + DNSRecordListResponseDNSRecordsCertRecordTypeCert DNSRecordListResponseDNSRecordsCertRecordType = "CERT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsCertRecordMeta struct { +type DNSRecordListResponseDNSRecordsCertRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsCertRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsCertRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsCertRecordMeta] -type dnsRecordUpdateResponseDNSRecordsCertRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsCertRecordMeta] +type dnsRecordListResponseDNSRecordsCertRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3623,14 +3623,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsCertRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsCertRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsCertRecordTTL() +// [DNSRecordListResponseDNSRecordsCertRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsCertRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsCertRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsCertRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsCertRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3639,19 +3639,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsCertRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsCertRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsCertRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsCertRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsCertRecordTTLNumber1 DNSRecordListResponseDNSRecordsCertRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsCnameRecord struct { +type DNSRecordListResponseDNSRecordsCnameRecord struct { // A valid hostname. Must not match the record's name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsCnameRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsCnameRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3663,7 +3663,7 @@ type DNSRecordUpdateResponseDNSRecordsCnameRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsCnameRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsCnameRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3676,17 +3676,17 @@ type DNSRecordUpdateResponseDNSRecordsCnameRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsCnameRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsCnameRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsCnameRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsCnameRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCnameRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsCnameRecord] -type dnsRecordUpdateResponseDNSRecordsCnameRecordJSON struct { +// dnsRecordListResponseDNSRecordsCnameRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsCnameRecord] +type dnsRecordListResponseDNSRecordsCnameRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -3706,39 +3706,39 @@ type dnsRecordUpdateResponseDNSRecordsCnameRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsCnameRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsCnameRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsCnameRecordType string +type DNSRecordListResponseDNSRecordsCnameRecordType string const ( - DNSRecordUpdateResponseDNSRecordsCnameRecordTypeCname DNSRecordUpdateResponseDNSRecordsCnameRecordType = "CNAME" + DNSRecordListResponseDNSRecordsCnameRecordTypeCname DNSRecordListResponseDNSRecordsCnameRecordType = "CNAME" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsCnameRecordMeta struct { +type DNSRecordListResponseDNSRecordsCnameRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsCnameRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsCnameRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsCnameRecordMeta] -type dnsRecordUpdateResponseDNSRecordsCnameRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsCnameRecordMeta] +type dnsRecordListResponseDNSRecordsCnameRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3747,14 +3747,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data [] // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsCnameRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsCnameRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsCnameRecordTTL() +// [DNSRecordListResponseDNSRecordsCnameRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsCnameRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsCnameRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3763,19 +3763,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsCnameRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsCnameRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsCnameRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordListResponseDNSRecordsCnameRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsDnskeyRecord struct { +type DNSRecordListResponseDNSRecordsDnskeyRecord struct { // Components of a DNSKEY record. - Data DNSRecordUpdateResponseDNSRecordsDnskeyRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsDnskeyRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsDnskeyRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsDnskeyRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3789,7 +3789,7 @@ type DNSRecordUpdateResponseDNSRecordsDnskeyRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsDnskeyRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsDnskeyRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3799,17 +3799,17 @@ type DNSRecordUpdateResponseDNSRecordsDnskeyRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsDnskeyRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsDnskeyRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsDnskeyRecord] -type dnsRecordUpdateResponseDNSRecordsDnskeyRecordJSON struct { +// dnsRecordListResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsDnskeyRecord] +type dnsRecordListResponseDNSRecordsDnskeyRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -3829,14 +3829,14 @@ type dnsRecordUpdateResponseDNSRecordsDnskeyRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsDnskeyRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsDnskeyRecord) implementsDNSRecordListResponse() {} // Components of a DNSKEY record. -type DNSRecordUpdateResponseDNSRecordsDnskeyRecordData struct { +type DNSRecordListResponseDNSRecordsDnskeyRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Flags. @@ -3844,13 +3844,13 @@ type DNSRecordUpdateResponseDNSRecordsDnskeyRecordData struct { // Protocol. Protocol float64 `json:"protocol"` // Public Key. - PublicKey string `json:"public_key"` - JSON dnsRecordUpdateResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` + PublicKey string `json:"public_key"` + JSON dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDnskeyRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsDnskeyRecordData] -type dnsRecordUpdateResponseDNSRecordsDnskeyRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsDnskeyRecordData] +type dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON struct { Algorithm apijson.Field Flags apijson.Field Protocol apijson.Field @@ -3859,37 +3859,37 @@ type dnsRecordUpdateResponseDNSRecordsDnskeyRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsDnskeyRecordType string +type DNSRecordListResponseDNSRecordsDnskeyRecordType string const ( - DNSRecordUpdateResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordUpdateResponseDNSRecordsDnskeyRecordType = "DNSKEY" + DNSRecordListResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordListResponseDNSRecordsDnskeyRecordType = "DNSKEY" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsDnskeyRecordMeta struct { +type DNSRecordListResponseDNSRecordsDnskeyRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsDnskeyRecordMeta] -type dnsRecordUpdateResponseDNSRecordsDnskeyRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsDnskeyRecordMeta] +type dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -3898,14 +3898,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data [ // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsDnskeyRecordTTL() +// [DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsDnskeyRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsDnskeyRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -3914,19 +3914,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsDnskeyRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsDsRecord struct { +type DNSRecordListResponseDNSRecordsDsRecord struct { // Components of a DS record. - Data DNSRecordUpdateResponseDNSRecordsDsRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsDsRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsDsRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsDsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -3940,7 +3940,7 @@ type DNSRecordUpdateResponseDNSRecordsDsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsDsRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsDsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -3950,17 +3950,17 @@ type DNSRecordUpdateResponseDNSRecordsDsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsDsRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsDsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsDsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsDsRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDsRecordJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseDNSRecordsDsRecord] -type dnsRecordUpdateResponseDNSRecordsDsRecordJSON struct { +// dnsRecordListResponseDNSRecordsDsRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsDsRecord] +type dnsRecordListResponseDNSRecordsDsRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -3980,14 +3980,14 @@ type dnsRecordUpdateResponseDNSRecordsDsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsDsRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsDsRecord) implementsDNSRecordListResponse() {} // Components of a DS record. -type DNSRecordUpdateResponseDNSRecordsDsRecordData struct { +type DNSRecordListResponseDNSRecordsDsRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Digest. @@ -3995,13 +3995,13 @@ type DNSRecordUpdateResponseDNSRecordsDsRecordData struct { // Digest Type. DigestType float64 `json:"digest_type"` // Key Tag. - KeyTag float64 `json:"key_tag"` - JSON dnsRecordUpdateResponseDNSRecordsDsRecordDataJSON `json:"-"` + KeyTag float64 `json:"key_tag"` + JSON dnsRecordListResponseDNSRecordsDsRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDsRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsDsRecordData] -type dnsRecordUpdateResponseDNSRecordsDsRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsDsRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsDsRecordData] +type dnsRecordListResponseDNSRecordsDsRecordDataJSON struct { Algorithm apijson.Field Digest apijson.Field DigestType apijson.Field @@ -4010,37 +4010,37 @@ type dnsRecordUpdateResponseDNSRecordsDsRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsDsRecordType string +type DNSRecordListResponseDNSRecordsDsRecordType string const ( - DNSRecordUpdateResponseDNSRecordsDsRecordTypeDs DNSRecordUpdateResponseDNSRecordsDsRecordType = "DS" + DNSRecordListResponseDNSRecordsDsRecordTypeDs DNSRecordListResponseDNSRecordsDsRecordType = "DS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsDsRecordMeta struct { +type DNSRecordListResponseDNSRecordsDsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsDsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsDsRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsDsRecordMeta] -type dnsRecordUpdateResponseDNSRecordsDsRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsDsRecordMeta] +type dnsRecordListResponseDNSRecordsDsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4049,14 +4049,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsDsRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsDsRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsDsRecordTTL() +// [DNSRecordListResponseDNSRecordsDsRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsDsRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsDsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsDsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsDsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4065,19 +4065,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsDsRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsDsRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsDsRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsDsRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsDsRecordTTLNumber1 DNSRecordListResponseDNSRecordsDsRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsHTTPSRecord struct { +type DNSRecordListResponseDNSRecordsHTTPSRecord struct { // Components of a HTTPS record. - Data DNSRecordUpdateResponseDNSRecordsHTTPSRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsHTTPSRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsHTTPSRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsHTTPSRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4091,7 +4091,7 @@ type DNSRecordUpdateResponseDNSRecordsHTTPSRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsHTTPSRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsHTTPSRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4101,17 +4101,17 @@ type DNSRecordUpdateResponseDNSRecordsHTTPSRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsHTTPSRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsHTTPSRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsHTTPSRecord] -type dnsRecordUpdateResponseDNSRecordsHTTPSRecordJSON struct { +// dnsRecordListResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsHTTPSRecord] +type dnsRecordListResponseDNSRecordsHTTPSRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -4131,26 +4131,26 @@ type dnsRecordUpdateResponseDNSRecordsHTTPSRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsHTTPSRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsHTTPSRecord) implementsDNSRecordListResponse() {} // Components of a HTTPS record. -type DNSRecordUpdateResponseDNSRecordsHTTPSRecordData struct { +type DNSRecordListResponseDNSRecordsHTTPSRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordUpdateResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsHTTPSRecordData] -type dnsRecordUpdateResponseDNSRecordsHTTPSRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsHTTPSRecordData] +type dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -4158,37 +4158,37 @@ type dnsRecordUpdateResponseDNSRecordsHTTPSRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsHTTPSRecordType string +type DNSRecordListResponseDNSRecordsHTTPSRecordType string const ( - DNSRecordUpdateResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordUpdateResponseDNSRecordsHTTPSRecordType = "HTTPS" + DNSRecordListResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordListResponseDNSRecordsHTTPSRecordType = "HTTPS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsHTTPSRecordMeta struct { +type DNSRecordListResponseDNSRecordsHTTPSRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsHTTPSRecordMeta] -type dnsRecordUpdateResponseDNSRecordsHTTPSRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsHTTPSRecordMeta] +type dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4197,14 +4197,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data [] // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsHTTPSRecordTTL() +// [DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsHTTPSRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsHTTPSRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4213,19 +4213,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsHTTPSRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsLocRecord struct { +type DNSRecordListResponseDNSRecordsLocRecord struct { // Components of a LOC record. - Data DNSRecordUpdateResponseDNSRecordsLocRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsLocRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsLocRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsLocRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4239,7 +4239,7 @@ type DNSRecordUpdateResponseDNSRecordsLocRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsLocRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsLocRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4249,17 +4249,17 @@ type DNSRecordUpdateResponseDNSRecordsLocRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsLocRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsLocRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsLocRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsLocRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsLocRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsLocRecord] -type dnsRecordUpdateResponseDNSRecordsLocRecordJSON struct { +// dnsRecordListResponseDNSRecordsLocRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsLocRecord] +type dnsRecordListResponseDNSRecordsLocRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -4279,20 +4279,20 @@ type dnsRecordUpdateResponseDNSRecordsLocRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsLocRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsLocRecord) implementsDNSRecordListResponse() {} // Components of a LOC record. -type DNSRecordUpdateResponseDNSRecordsLocRecordData struct { +type DNSRecordListResponseDNSRecordsLocRecordData struct { // Altitude of location in meters. Altitude float64 `json:"altitude"` // Degrees of latitude. LatDegrees float64 `json:"lat_degrees"` // Latitude direction. - LatDirection DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` + LatDirection DNSRecordListResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` // Minutes of latitude. LatMinutes float64 `json:"lat_minutes"` // Seconds of latitude. @@ -4300,7 +4300,7 @@ type DNSRecordUpdateResponseDNSRecordsLocRecordData struct { // Degrees of longitude. LongDegrees float64 `json:"long_degrees"` // Longitude direction. - LongDirection DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` + LongDirection DNSRecordListResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` // Minutes of longitude. LongMinutes float64 `json:"long_minutes"` // Seconds of longitude. @@ -4310,13 +4310,13 @@ type DNSRecordUpdateResponseDNSRecordsLocRecordData struct { // Vertical precision of location. PrecisionVert float64 `json:"precision_vert"` // Size of location in meters. - Size float64 `json:"size"` - JSON dnsRecordUpdateResponseDNSRecordsLocRecordDataJSON `json:"-"` + Size float64 `json:"size"` + JSON dnsRecordListResponseDNSRecordsLocRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsLocRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsLocRecordData] -type dnsRecordUpdateResponseDNSRecordsLocRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsLocRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsLocRecordData] +type dnsRecordListResponseDNSRecordsLocRecordDataJSON struct { Altitude apijson.Field LatDegrees apijson.Field LatDirection apijson.Field @@ -4333,53 +4333,53 @@ type dnsRecordUpdateResponseDNSRecordsLocRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Latitude direction. -type DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirection string +type DNSRecordListResponseDNSRecordsLocRecordDataLatDirection string const ( - DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirection = "N" - DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordUpdateResponseDNSRecordsLocRecordDataLatDirection = "S" + DNSRecordListResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordListResponseDNSRecordsLocRecordDataLatDirection = "N" + DNSRecordListResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordListResponseDNSRecordsLocRecordDataLatDirection = "S" ) // Longitude direction. -type DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirection string +type DNSRecordListResponseDNSRecordsLocRecordDataLongDirection string const ( - DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirection = "E" - DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordUpdateResponseDNSRecordsLocRecordDataLongDirection = "W" + DNSRecordListResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordListResponseDNSRecordsLocRecordDataLongDirection = "E" + DNSRecordListResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordListResponseDNSRecordsLocRecordDataLongDirection = "W" ) // Record type. -type DNSRecordUpdateResponseDNSRecordsLocRecordType string +type DNSRecordListResponseDNSRecordsLocRecordType string const ( - DNSRecordUpdateResponseDNSRecordsLocRecordTypeLoc DNSRecordUpdateResponseDNSRecordsLocRecordType = "LOC" + DNSRecordListResponseDNSRecordsLocRecordTypeLoc DNSRecordListResponseDNSRecordsLocRecordType = "LOC" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsLocRecordMeta struct { +type DNSRecordListResponseDNSRecordsLocRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsLocRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsLocRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsLocRecordMeta] -type dnsRecordUpdateResponseDNSRecordsLocRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsLocRecordMeta] +type dnsRecordListResponseDNSRecordsLocRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4388,14 +4388,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsLocRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsLocRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsLocRecordTTL() +// [DNSRecordListResponseDNSRecordsLocRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsLocRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsLocRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsLocRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsLocRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4404,13 +4404,13 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsLocRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsLocRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsLocRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsLocRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsLocRecordTTLNumber1 DNSRecordListResponseDNSRecordsLocRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsMxRecord struct { +type DNSRecordListResponseDNSRecordsMxRecord struct { // A valid mail server hostname. Content string `json:"content,required" format:"hostname"` // DNS record name (or @ for the zone apex) in Punycode. @@ -4419,7 +4419,7 @@ type DNSRecordUpdateResponseDNSRecordsMxRecord struct { // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsMxRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsMxRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4431,7 +4431,7 @@ type DNSRecordUpdateResponseDNSRecordsMxRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsMxRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsMxRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4441,17 +4441,17 @@ type DNSRecordUpdateResponseDNSRecordsMxRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsMxRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsMxRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsMxRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsMxRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsMxRecordJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseDNSRecordsMxRecord] -type dnsRecordUpdateResponseDNSRecordsMxRecordJSON struct { +// dnsRecordListResponseDNSRecordsMxRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsMxRecord] +type dnsRecordListResponseDNSRecordsMxRecordJSON struct { Content apijson.Field Name apijson.Field Priority apijson.Field @@ -4471,39 +4471,39 @@ type dnsRecordUpdateResponseDNSRecordsMxRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsMxRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsMxRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsMxRecordType string +type DNSRecordListResponseDNSRecordsMxRecordType string const ( - DNSRecordUpdateResponseDNSRecordsMxRecordTypeMx DNSRecordUpdateResponseDNSRecordsMxRecordType = "MX" + DNSRecordListResponseDNSRecordsMxRecordTypeMx DNSRecordListResponseDNSRecordsMxRecordType = "MX" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsMxRecordMeta struct { +type DNSRecordListResponseDNSRecordsMxRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsMxRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsMxRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsMxRecordMeta] -type dnsRecordUpdateResponseDNSRecordsMxRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsMxRecordMeta] +type dnsRecordListResponseDNSRecordsMxRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4512,14 +4512,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsMxRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsMxRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsMxRecordTTL() +// [DNSRecordListResponseDNSRecordsMxRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsMxRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsMxRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsMxRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsMxRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4528,19 +4528,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsMxRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsMxRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsMxRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsMxRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsMxRecordTTLNumber1 DNSRecordListResponseDNSRecordsMxRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsNaptrRecord struct { +type DNSRecordListResponseDNSRecordsNaptrRecord struct { // Components of a NAPTR record. - Data DNSRecordUpdateResponseDNSRecordsNaptrRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsNaptrRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsNaptrRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsNaptrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4554,7 +4554,7 @@ type DNSRecordUpdateResponseDNSRecordsNaptrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsNaptrRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsNaptrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4564,17 +4564,17 @@ type DNSRecordUpdateResponseDNSRecordsNaptrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsNaptrRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsNaptrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsNaptrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsNaptrRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsNaptrRecord] -type dnsRecordUpdateResponseDNSRecordsNaptrRecordJSON struct { +// dnsRecordListResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsNaptrRecord] +type dnsRecordListResponseDNSRecordsNaptrRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -4594,14 +4594,14 @@ type dnsRecordUpdateResponseDNSRecordsNaptrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsNaptrRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsNaptrRecord) implementsDNSRecordListResponse() {} // Components of a NAPTR record. -type DNSRecordUpdateResponseDNSRecordsNaptrRecordData struct { +type DNSRecordListResponseDNSRecordsNaptrRecordData struct { // Flags. Flags string `json:"flags"` // Order. @@ -4613,13 +4613,13 @@ type DNSRecordUpdateResponseDNSRecordsNaptrRecordData struct { // Replacement. Replacement string `json:"replacement"` // Service. - Service string `json:"service"` - JSON dnsRecordUpdateResponseDNSRecordsNaptrRecordDataJSON `json:"-"` + Service string `json:"service"` + JSON dnsRecordListResponseDNSRecordsNaptrRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsNaptrRecordData] -type dnsRecordUpdateResponseDNSRecordsNaptrRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsNaptrRecordData] +type dnsRecordListResponseDNSRecordsNaptrRecordDataJSON struct { Flags apijson.Field Order apijson.Field Preference apijson.Field @@ -4630,37 +4630,37 @@ type dnsRecordUpdateResponseDNSRecordsNaptrRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsNaptrRecordType string +type DNSRecordListResponseDNSRecordsNaptrRecordType string const ( - DNSRecordUpdateResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordUpdateResponseDNSRecordsNaptrRecordType = "NAPTR" + DNSRecordListResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordListResponseDNSRecordsNaptrRecordType = "NAPTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsNaptrRecordMeta struct { +type DNSRecordListResponseDNSRecordsNaptrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsNaptrRecordMeta] -type dnsRecordUpdateResponseDNSRecordsNaptrRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsNaptrRecordMeta] +type dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4669,14 +4669,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data [] // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsNaptrRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsNaptrRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsNaptrRecordTTL() +// [DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsNaptrRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsNaptrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4685,19 +4685,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsNaptrRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsNaptrRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsNsRecord struct { +type DNSRecordListResponseDNSRecordsNsRecord struct { // A valid name server host name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsNsRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsNsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4709,7 +4709,7 @@ type DNSRecordUpdateResponseDNSRecordsNsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsNsRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsNsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4719,17 +4719,17 @@ type DNSRecordUpdateResponseDNSRecordsNsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsNsRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsNsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsNsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsNsRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsNsRecordJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseDNSRecordsNsRecord] -type dnsRecordUpdateResponseDNSRecordsNsRecordJSON struct { +// dnsRecordListResponseDNSRecordsNsRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsNsRecord] +type dnsRecordListResponseDNSRecordsNsRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -4748,39 +4748,39 @@ type dnsRecordUpdateResponseDNSRecordsNsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsNsRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsNsRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsNsRecordType string +type DNSRecordListResponseDNSRecordsNsRecordType string const ( - DNSRecordUpdateResponseDNSRecordsNsRecordTypeNs DNSRecordUpdateResponseDNSRecordsNsRecordType = "NS" + DNSRecordListResponseDNSRecordsNsRecordTypeNs DNSRecordListResponseDNSRecordsNsRecordType = "NS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsNsRecordMeta struct { +type DNSRecordListResponseDNSRecordsNsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsNsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsNsRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsNsRecordMeta] -type dnsRecordUpdateResponseDNSRecordsNsRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsNsRecordMeta] +type dnsRecordListResponseDNSRecordsNsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4789,14 +4789,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsNsRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsNsRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsNsRecordTTL() +// [DNSRecordListResponseDNSRecordsNsRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsNsRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsNsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsNsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsNsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4805,19 +4805,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsNsRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsNsRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsNsRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsNsRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsNsRecordTTLNumber1 DNSRecordListResponseDNSRecordsNsRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsPtrRecord struct { +type DNSRecordListResponseDNSRecordsPtrRecord struct { // Domain name pointing to the address. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsPtrRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsPtrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4829,7 +4829,7 @@ type DNSRecordUpdateResponseDNSRecordsPtrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsPtrRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsPtrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4839,17 +4839,17 @@ type DNSRecordUpdateResponseDNSRecordsPtrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsPtrRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsPtrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsPtrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsPtrRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsPtrRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsPtrRecord] -type dnsRecordUpdateResponseDNSRecordsPtrRecordJSON struct { +// dnsRecordListResponseDNSRecordsPtrRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsPtrRecord] +type dnsRecordListResponseDNSRecordsPtrRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -4868,39 +4868,39 @@ type dnsRecordUpdateResponseDNSRecordsPtrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsPtrRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsPtrRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsPtrRecordType string +type DNSRecordListResponseDNSRecordsPtrRecordType string const ( - DNSRecordUpdateResponseDNSRecordsPtrRecordTypePtr DNSRecordUpdateResponseDNSRecordsPtrRecordType = "PTR" + DNSRecordListResponseDNSRecordsPtrRecordTypePtr DNSRecordListResponseDNSRecordsPtrRecordType = "PTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsPtrRecordMeta struct { +type DNSRecordListResponseDNSRecordsPtrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsPtrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsPtrRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsPtrRecordMeta] -type dnsRecordUpdateResponseDNSRecordsPtrRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsPtrRecordMeta] +type dnsRecordListResponseDNSRecordsPtrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -4909,14 +4909,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsPtrRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsPtrRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsPtrRecordTTL() +// [DNSRecordListResponseDNSRecordsPtrRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsPtrRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsPtrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -4925,19 +4925,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsPtrRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsPtrRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsPtrRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordListResponseDNSRecordsPtrRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsSmimeaRecord struct { +type DNSRecordListResponseDNSRecordsSmimeaRecord struct { // Components of a SMIMEA record. - Data DNSRecordUpdateResponseDNSRecordsSmimeaRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsSmimeaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsSmimeaRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsSmimeaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -4951,7 +4951,7 @@ type DNSRecordUpdateResponseDNSRecordsSmimeaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsSmimeaRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsSmimeaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -4961,17 +4961,17 @@ type DNSRecordUpdateResponseDNSRecordsSmimeaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsSmimeaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsSmimeaRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsSmimeaRecord] -type dnsRecordUpdateResponseDNSRecordsSmimeaRecordJSON struct { +// dnsRecordListResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSmimeaRecord] +type dnsRecordListResponseDNSRecordsSmimeaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -4991,14 +4991,14 @@ type dnsRecordUpdateResponseDNSRecordsSmimeaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsSmimeaRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsSmimeaRecord) implementsDNSRecordListResponse() {} // Components of a SMIMEA record. -type DNSRecordUpdateResponseDNSRecordsSmimeaRecordData struct { +type DNSRecordListResponseDNSRecordsSmimeaRecordData struct { // Certificate. Certificate string `json:"certificate"` // Matching Type. @@ -5006,13 +5006,13 @@ type DNSRecordUpdateResponseDNSRecordsSmimeaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordUpdateResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSmimeaRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSmimeaRecordData] -type dnsRecordUpdateResponseDNSRecordsSmimeaRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsSmimeaRecordData] +type dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -5021,37 +5021,37 @@ type dnsRecordUpdateResponseDNSRecordsSmimeaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsSmimeaRecordType string +type DNSRecordListResponseDNSRecordsSmimeaRecordType string const ( - DNSRecordUpdateResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordUpdateResponseDNSRecordsSmimeaRecordType = "SMIMEA" + DNSRecordListResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordListResponseDNSRecordsSmimeaRecordType = "SMIMEA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsSmimeaRecordMeta struct { +type DNSRecordListResponseDNSRecordsSmimeaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSmimeaRecordMeta] -type dnsRecordUpdateResponseDNSRecordsSmimeaRecordMetaJSON struct { - AutoAdded apijson.Field +// dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsSmimeaRecordMeta] +type dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON struct { + AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5060,14 +5060,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data [ // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsSmimeaRecordTTL() +// [DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsSmimeaRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsSmimeaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5076,21 +5076,21 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsSmimeaRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsSrvRecord struct { +type DNSRecordListResponseDNSRecordsSrvRecord struct { // Components of a SRV record. - Data DNSRecordUpdateResponseDNSRecordsSrvRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsSrvRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first // label is normally a service and the second a protocol name, each starting with // an underscore. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsSrvRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsSrvRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5105,7 +5105,7 @@ type DNSRecordUpdateResponseDNSRecordsSrvRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsSrvRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsSrvRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5115,17 +5115,17 @@ type DNSRecordUpdateResponseDNSRecordsSrvRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsSrvRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsSrvRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsSrvRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsSrvRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSrvRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsSrvRecord] -type dnsRecordUpdateResponseDNSRecordsSrvRecordJSON struct { +// dnsRecordListResponseDNSRecordsSrvRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsSrvRecord] +type dnsRecordListResponseDNSRecordsSrvRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -5145,14 +5145,14 @@ type dnsRecordUpdateResponseDNSRecordsSrvRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsSrvRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsSrvRecord) implementsDNSRecordListResponse() {} // Components of a SRV record. -type DNSRecordUpdateResponseDNSRecordsSrvRecordData struct { +type DNSRecordListResponseDNSRecordsSrvRecordData struct { // A valid hostname. Deprecated in favor of the regular 'name' outside the data // map. This data map field represents the remainder of the full 'name' after the // service and protocol. @@ -5173,13 +5173,13 @@ type DNSRecordUpdateResponseDNSRecordsSrvRecordData struct { // A valid hostname. Target string `json:"target" format:"hostname"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordUpdateResponseDNSRecordsSrvRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordListResponseDNSRecordsSrvRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSrvRecordData] -type dnsRecordUpdateResponseDNSRecordsSrvRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSrvRecordData] +type dnsRecordListResponseDNSRecordsSrvRecordDataJSON struct { Name apijson.Field Port apijson.Field Priority apijson.Field @@ -5191,37 +5191,37 @@ type dnsRecordUpdateResponseDNSRecordsSrvRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsSrvRecordType string +type DNSRecordListResponseDNSRecordsSrvRecordType string const ( - DNSRecordUpdateResponseDNSRecordsSrvRecordTypeSrv DNSRecordUpdateResponseDNSRecordsSrvRecordType = "SRV" + DNSRecordListResponseDNSRecordsSrvRecordTypeSrv DNSRecordListResponseDNSRecordsSrvRecordType = "SRV" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsSrvRecordMeta struct { +type DNSRecordListResponseDNSRecordsSrvRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsSrvRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsSrvRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSrvRecordMeta] -type dnsRecordUpdateResponseDNSRecordsSrvRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSrvRecordMeta] +type dnsRecordListResponseDNSRecordsSrvRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5230,14 +5230,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsSrvRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsSrvRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsSrvRecordTTL() +// [DNSRecordListResponseDNSRecordsSrvRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsSrvRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsSrvRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5246,19 +5246,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsSrvRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsSrvRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsSrvRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordListResponseDNSRecordsSrvRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsSshfpRecord struct { +type DNSRecordListResponseDNSRecordsSshfpRecord struct { // Components of a SSHFP record. - Data DNSRecordUpdateResponseDNSRecordsSshfpRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsSshfpRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsSshfpRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsSshfpRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5272,7 +5272,7 @@ type DNSRecordUpdateResponseDNSRecordsSshfpRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsSshfpRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsSshfpRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5282,17 +5282,17 @@ type DNSRecordUpdateResponseDNSRecordsSshfpRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsSshfpRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsSshfpRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsSshfpRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsSshfpRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsSshfpRecord] -type dnsRecordUpdateResponseDNSRecordsSshfpRecordJSON struct { +// dnsRecordListResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSshfpRecord] +type dnsRecordListResponseDNSRecordsSshfpRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -5312,26 +5312,26 @@ type dnsRecordUpdateResponseDNSRecordsSshfpRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsSshfpRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsSshfpRecord) implementsDNSRecordListResponse() {} // Components of a SSHFP record. -type DNSRecordUpdateResponseDNSRecordsSshfpRecordData struct { +type DNSRecordListResponseDNSRecordsSshfpRecordData struct { // algorithm. Algorithm float64 `json:"algorithm"` // fingerprint. Fingerprint string `json:"fingerprint"` // type. - Type float64 `json:"type"` - JSON dnsRecordUpdateResponseDNSRecordsSshfpRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordListResponseDNSRecordsSshfpRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSshfpRecordData] -type dnsRecordUpdateResponseDNSRecordsSshfpRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsSshfpRecordData] +type dnsRecordListResponseDNSRecordsSshfpRecordDataJSON struct { Algorithm apijson.Field Fingerprint apijson.Field Type apijson.Field @@ -5339,37 +5339,37 @@ type dnsRecordUpdateResponseDNSRecordsSshfpRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsSshfpRecordType string +type DNSRecordListResponseDNSRecordsSshfpRecordType string const ( - DNSRecordUpdateResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordUpdateResponseDNSRecordsSshfpRecordType = "SSHFP" + DNSRecordListResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordListResponseDNSRecordsSshfpRecordType = "SSHFP" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsSshfpRecordMeta struct { +type DNSRecordListResponseDNSRecordsSshfpRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSshfpRecordMeta] -type dnsRecordUpdateResponseDNSRecordsSshfpRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordListResponseDNSRecordsSshfpRecordMeta] +type dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5378,14 +5378,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data [] // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsSshfpRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsSshfpRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsSshfpRecordTTL() +// [DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsSshfpRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsSshfpRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5394,19 +5394,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsSshfpRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsSshfpRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsSvcbRecord struct { +type DNSRecordListResponseDNSRecordsSvcbRecord struct { // Components of a SVCB record. - Data DNSRecordUpdateResponseDNSRecordsSvcbRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsSvcbRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsSvcbRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsSvcbRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5420,7 +5420,7 @@ type DNSRecordUpdateResponseDNSRecordsSvcbRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsSvcbRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsSvcbRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5430,17 +5430,17 @@ type DNSRecordUpdateResponseDNSRecordsSvcbRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsSvcbRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsSvcbRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsSvcbRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsSvcbRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsSvcbRecord] -type dnsRecordUpdateResponseDNSRecordsSvcbRecordJSON struct { +// dnsRecordListResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsSvcbRecord] +type dnsRecordListResponseDNSRecordsSvcbRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -5460,26 +5460,26 @@ type dnsRecordUpdateResponseDNSRecordsSvcbRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsSvcbRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsSvcbRecord) implementsDNSRecordListResponse() {} // Components of a SVCB record. -type DNSRecordUpdateResponseDNSRecordsSvcbRecordData struct { +type DNSRecordListResponseDNSRecordsSvcbRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordUpdateResponseDNSRecordsSvcbRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordListResponseDNSRecordsSvcbRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSvcbRecordData] -type dnsRecordUpdateResponseDNSRecordsSvcbRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSvcbRecordData] +type dnsRecordListResponseDNSRecordsSvcbRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -5487,37 +5487,37 @@ type dnsRecordUpdateResponseDNSRecordsSvcbRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsSvcbRecordType string +type DNSRecordListResponseDNSRecordsSvcbRecordType string const ( - DNSRecordUpdateResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordUpdateResponseDNSRecordsSvcbRecordType = "SVCB" + DNSRecordListResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordListResponseDNSRecordsSvcbRecordType = "SVCB" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsSvcbRecordMeta struct { +type DNSRecordListResponseDNSRecordsSvcbRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsSvcbRecordMeta] -type dnsRecordUpdateResponseDNSRecordsSvcbRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsSvcbRecordMeta] +type dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5526,14 +5526,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsSvcbRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsSvcbRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsSvcbRecordTTL() +// [DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsSvcbRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsSvcbRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5542,19 +5542,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsSvcbRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsSvcbRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsTlsaRecord struct { +type DNSRecordListResponseDNSRecordsTlsaRecord struct { // Components of a TLSA record. - Data DNSRecordUpdateResponseDNSRecordsTlsaRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsTlsaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsTlsaRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsTlsaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5568,7 +5568,7 @@ type DNSRecordUpdateResponseDNSRecordsTlsaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsTlsaRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsTlsaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5578,17 +5578,17 @@ type DNSRecordUpdateResponseDNSRecordsTlsaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsTlsaRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsTlsaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsTlsaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsTlsaRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsTlsaRecord] -type dnsRecordUpdateResponseDNSRecordsTlsaRecordJSON struct { +// dnsRecordListResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsTlsaRecord] +type dnsRecordListResponseDNSRecordsTlsaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -5608,14 +5608,14 @@ type dnsRecordUpdateResponseDNSRecordsTlsaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsTlsaRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsTlsaRecord) implementsDNSRecordListResponse() {} // Components of a TLSA record. -type DNSRecordUpdateResponseDNSRecordsTlsaRecordData struct { +type DNSRecordListResponseDNSRecordsTlsaRecordData struct { // certificate. Certificate string `json:"certificate"` // Matching Type. @@ -5623,13 +5623,13 @@ type DNSRecordUpdateResponseDNSRecordsTlsaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordUpdateResponseDNSRecordsTlsaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordListResponseDNSRecordsTlsaRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsTlsaRecordData] -type dnsRecordUpdateResponseDNSRecordsTlsaRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsTlsaRecordData] +type dnsRecordListResponseDNSRecordsTlsaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -5638,37 +5638,37 @@ type dnsRecordUpdateResponseDNSRecordsTlsaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsTlsaRecordType string +type DNSRecordListResponseDNSRecordsTlsaRecordType string const ( - DNSRecordUpdateResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordUpdateResponseDNSRecordsTlsaRecordType = "TLSA" + DNSRecordListResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordListResponseDNSRecordsTlsaRecordType = "TLSA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsTlsaRecordMeta struct { +type DNSRecordListResponseDNSRecordsTlsaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsTlsaRecordMeta] -type dnsRecordUpdateResponseDNSRecordsTlsaRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsTlsaRecordMeta] +type dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5677,14 +5677,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsTlsaRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsTlsaRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsTlsaRecordTTL() +// [DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsTlsaRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsTlsaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5693,19 +5693,19 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsTlsaRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsTlsaRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsTxtRecord struct { +type DNSRecordListResponseDNSRecordsTxtRecord struct { // Text content for the record. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsTxtRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsTxtRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5717,7 +5717,7 @@ type DNSRecordUpdateResponseDNSRecordsTxtRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsTxtRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsTxtRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5727,17 +5727,17 @@ type DNSRecordUpdateResponseDNSRecordsTxtRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsTxtRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsTxtRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsTxtRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsTxtRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsTxtRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsTxtRecord] -type dnsRecordUpdateResponseDNSRecordsTxtRecordJSON struct { +// dnsRecordListResponseDNSRecordsTxtRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsTxtRecord] +type dnsRecordListResponseDNSRecordsTxtRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -5756,39 +5756,39 @@ type dnsRecordUpdateResponseDNSRecordsTxtRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsTxtRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsTxtRecord) implementsDNSRecordListResponse() {} // Record type. -type DNSRecordUpdateResponseDNSRecordsTxtRecordType string +type DNSRecordListResponseDNSRecordsTxtRecordType string const ( - DNSRecordUpdateResponseDNSRecordsTxtRecordTypeTxt DNSRecordUpdateResponseDNSRecordsTxtRecordType = "TXT" + DNSRecordListResponseDNSRecordsTxtRecordTypeTxt DNSRecordListResponseDNSRecordsTxtRecordType = "TXT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsTxtRecordMeta struct { +type DNSRecordListResponseDNSRecordsTxtRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsTxtRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsTxtRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsTxtRecordMeta] -type dnsRecordUpdateResponseDNSRecordsTxtRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsTxtRecordMeta] +type dnsRecordListResponseDNSRecordsTxtRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5797,14 +5797,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsTxtRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsTxtRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsTxtRecordTTL() +// [DNSRecordListResponseDNSRecordsTxtRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsTxtRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsTxtRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5813,22 +5813,22 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsTxtRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsTxtRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsTxtRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordListResponseDNSRecordsTxtRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseDNSRecordsUriRecord struct { +type DNSRecordListResponseDNSRecordsUriRecord struct { // Components of a URI record. - Data DNSRecordUpdateResponseDNSRecordsUriRecordData `json:"data,required"` + Data DNSRecordListResponseDNSRecordsUriRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Required for MX, SRV and URI records; unused by other record types. Records with // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordUpdateResponseDNSRecordsUriRecordType `json:"type,required"` + Type DNSRecordListResponseDNSRecordsUriRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -5842,7 +5842,7 @@ type DNSRecordUpdateResponseDNSRecordsUriRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordUpdateResponseDNSRecordsUriRecordMeta `json:"meta"` + Meta DNSRecordListResponseDNSRecordsUriRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -5852,17 +5852,17 @@ type DNSRecordUpdateResponseDNSRecordsUriRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordUpdateResponseDNSRecordsUriRecordTTL `json:"ttl"` + TTL DNSRecordListResponseDNSRecordsUriRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordUpdateResponseDNSRecordsUriRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordListResponseDNSRecordsUriRecordJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsUriRecordJSON contains the JSON metadata for -// the struct [DNSRecordUpdateResponseDNSRecordsUriRecord] -type dnsRecordUpdateResponseDNSRecordsUriRecordJSON struct { +// dnsRecordListResponseDNSRecordsUriRecordJSON contains the JSON metadata for the +// struct [DNSRecordListResponseDNSRecordsUriRecord] +type dnsRecordListResponseDNSRecordsUriRecordJSON struct { Data apijson.Field Name apijson.Field Priority apijson.Field @@ -5883,61 +5883,61 @@ type dnsRecordUpdateResponseDNSRecordsUriRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordUpdateResponseDNSRecordsUriRecord) implementsDNSRecordUpdateResponse() {} +func (r DNSRecordListResponseDNSRecordsUriRecord) implementsDNSRecordListResponse() {} // Components of a URI record. -type DNSRecordUpdateResponseDNSRecordsUriRecordData struct { +type DNSRecordListResponseDNSRecordsUriRecordData struct { // The record content. Content string `json:"content"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordUpdateResponseDNSRecordsUriRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordListResponseDNSRecordsUriRecordDataJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsUriRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsUriRecordData] -type dnsRecordUpdateResponseDNSRecordsUriRecordDataJSON struct { +// dnsRecordListResponseDNSRecordsUriRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsUriRecordData] +type dnsRecordListResponseDNSRecordsUriRecordDataJSON struct { Content apijson.Field Weight apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordUpdateResponseDNSRecordsUriRecordType string +type DNSRecordListResponseDNSRecordsUriRecordType string const ( - DNSRecordUpdateResponseDNSRecordsUriRecordTypeUri DNSRecordUpdateResponseDNSRecordsUriRecordType = "URI" + DNSRecordListResponseDNSRecordsUriRecordTypeUri DNSRecordListResponseDNSRecordsUriRecordType = "URI" ) // Extra Cloudflare-specific information about the record. -type DNSRecordUpdateResponseDNSRecordsUriRecordMeta struct { +type DNSRecordListResponseDNSRecordsUriRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordUpdateResponseDNSRecordsUriRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordListResponseDNSRecordsUriRecordMetaJSON `json:"-"` } -// dnsRecordUpdateResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordUpdateResponseDNSRecordsUriRecordMeta] -type dnsRecordUpdateResponseDNSRecordsUriRecordMetaJSON struct { +// dnsRecordListResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordListResponseDNSRecordsUriRecordMeta] +type dnsRecordListResponseDNSRecordsUriRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordUpdateResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordListResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -5946,14 +5946,14 @@ func (r *DNSRecordUpdateResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordUpdateResponseDNSRecordsUriRecordTTLNumber]. -type DNSRecordUpdateResponseDNSRecordsUriRecordTTL interface { - ImplementsDNSRecordUpdateResponseDNSRecordsUriRecordTTL() +// [DNSRecordListResponseDNSRecordsUriRecordTTLNumber]. +type DNSRecordListResponseDNSRecordsUriRecordTTL interface { + ImplementsDNSRecordListResponseDNSRecordsUriRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordUpdateResponseDNSRecordsUriRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordListResponseDNSRecordsUriRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -5962,47 +5962,65 @@ func init() { ) } -type DNSRecordUpdateResponseDNSRecordsUriRecordTTLNumber float64 +type DNSRecordListResponseDNSRecordsUriRecordTTLNumber float64 const ( - DNSRecordUpdateResponseDNSRecordsUriRecordTTLNumber1 DNSRecordUpdateResponseDNSRecordsUriRecordTTLNumber = 1 + DNSRecordListResponseDNSRecordsUriRecordTTLNumber1 DNSRecordListResponseDNSRecordsUriRecordTTLNumber = 1 ) -// Union satisfied by [DNSRecordListResponseDNSRecordsARecord], -// [DNSRecordListResponseDNSRecordsAaaaRecord], -// [DNSRecordListResponseDNSRecordsCaaRecord], -// [DNSRecordListResponseDNSRecordsCertRecord], -// [DNSRecordListResponseDNSRecordsCnameRecord], -// [DNSRecordListResponseDNSRecordsDnskeyRecord], -// [DNSRecordListResponseDNSRecordsDsRecord], -// [DNSRecordListResponseDNSRecordsHTTPSRecord], -// [DNSRecordListResponseDNSRecordsLocRecord], -// [DNSRecordListResponseDNSRecordsMxRecord], -// [DNSRecordListResponseDNSRecordsNaptrRecord], -// [DNSRecordListResponseDNSRecordsNsRecord], -// [DNSRecordListResponseDNSRecordsPtrRecord], -// [DNSRecordListResponseDNSRecordsSmimeaRecord], -// [DNSRecordListResponseDNSRecordsSrvRecord], -// [DNSRecordListResponseDNSRecordsSshfpRecord], -// [DNSRecordListResponseDNSRecordsSvcbRecord], -// [DNSRecordListResponseDNSRecordsTlsaRecord], -// [DNSRecordListResponseDNSRecordsTxtRecord] or -// [DNSRecordListResponseDNSRecordsUriRecord]. -type DNSRecordListResponse interface { - implementsDNSRecordListResponse() +type DNSRecordDeleteResponse struct { + // Identifier + ID string `json:"id"` + JSON dnsRecordDeleteResponseJSON `json:"-"` } -func init() { - apijson.RegisterUnion(reflect.TypeOf((*DNSRecordListResponse)(nil)).Elem(), "") +// dnsRecordDeleteResponseJSON contains the JSON metadata for the struct +// [DNSRecordDeleteResponse] +type dnsRecordDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type DNSRecordListResponseDNSRecordsARecord struct { +func (r *DNSRecordDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [DNSRecordGetResponseDNSRecordsARecord], +// [DNSRecordGetResponseDNSRecordsAaaaRecord], +// [DNSRecordGetResponseDNSRecordsCaaRecord], +// [DNSRecordGetResponseDNSRecordsCertRecord], +// [DNSRecordGetResponseDNSRecordsCnameRecord], +// [DNSRecordGetResponseDNSRecordsDnskeyRecord], +// [DNSRecordGetResponseDNSRecordsDsRecord], +// [DNSRecordGetResponseDNSRecordsHTTPSRecord], +// [DNSRecordGetResponseDNSRecordsLocRecord], +// [DNSRecordGetResponseDNSRecordsMxRecord], +// [DNSRecordGetResponseDNSRecordsNaptrRecord], +// [DNSRecordGetResponseDNSRecordsNsRecord], +// [DNSRecordGetResponseDNSRecordsPtrRecord], +// [DNSRecordGetResponseDNSRecordsSmimeaRecord], +// [DNSRecordGetResponseDNSRecordsSrvRecord], +// [DNSRecordGetResponseDNSRecordsSshfpRecord], +// [DNSRecordGetResponseDNSRecordsSvcbRecord], +// [DNSRecordGetResponseDNSRecordsTlsaRecord], +// [DNSRecordGetResponseDNSRecordsTxtRecord] or +// [DNSRecordGetResponseDNSRecordsUriRecord]. +type DNSRecordGetResponse interface { + implementsDNSRecordGetResponse() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*DNSRecordGetResponse)(nil)).Elem(), "") +} + +type DNSRecordGetResponseDNSRecordsARecord struct { // A valid IPv4 address. Content string `json:"content,required" format:"ipv4"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsARecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsARecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6014,7 +6032,7 @@ type DNSRecordListResponseDNSRecordsARecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsARecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsARecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6027,17 +6045,17 @@ type DNSRecordListResponseDNSRecordsARecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsARecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsARecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsARecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsARecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsARecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsARecord] -type dnsRecordListResponseDNSRecordsARecordJSON struct { +// dnsRecordGetResponseDNSRecordsARecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsARecord] +type dnsRecordGetResponseDNSRecordsARecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -6057,39 +6075,39 @@ type dnsRecordListResponseDNSRecordsARecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsARecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsARecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsARecordType string +type DNSRecordGetResponseDNSRecordsARecordType string const ( - DNSRecordListResponseDNSRecordsARecordTypeA DNSRecordListResponseDNSRecordsARecordType = "A" + DNSRecordGetResponseDNSRecordsARecordTypeA DNSRecordGetResponseDNSRecordsARecordType = "A" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsARecordMeta struct { +type DNSRecordGetResponseDNSRecordsARecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsARecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsARecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsARecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsARecordMeta] -type dnsRecordListResponseDNSRecordsARecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsARecordMetaJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsARecordMeta] +type dnsRecordGetResponseDNSRecordsARecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6098,14 +6116,14 @@ func (r *DNSRecordListResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsARecordTTLNumber]. -type DNSRecordListResponseDNSRecordsARecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsARecordTTL() +// [DNSRecordGetResponseDNSRecordsARecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsARecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsARecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsARecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsARecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6114,19 +6132,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsARecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsARecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsARecordTTLNumber1 DNSRecordListResponseDNSRecordsARecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsARecordTTLNumber1 DNSRecordGetResponseDNSRecordsARecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsAaaaRecord struct { +type DNSRecordGetResponseDNSRecordsAaaaRecord struct { // A valid IPv6 address. Content string `json:"content,required" format:"ipv6"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsAaaaRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsAaaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6138,7 +6156,7 @@ type DNSRecordListResponseDNSRecordsAaaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsAaaaRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsAaaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6151,17 +6169,17 @@ type DNSRecordListResponseDNSRecordsAaaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsAaaaRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsAaaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsAaaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsAaaaRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsAaaaRecord] -type dnsRecordListResponseDNSRecordsAaaaRecordJSON struct { +// dnsRecordGetResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsAaaaRecord] +type dnsRecordGetResponseDNSRecordsAaaaRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -6181,39 +6199,39 @@ type dnsRecordListResponseDNSRecordsAaaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsAaaaRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsAaaaRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsAaaaRecordType string +type DNSRecordGetResponseDNSRecordsAaaaRecordType string const ( - DNSRecordListResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordListResponseDNSRecordsAaaaRecordType = "AAAA" + DNSRecordGetResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordGetResponseDNSRecordsAaaaRecordType = "AAAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsAaaaRecordMeta struct { +type DNSRecordGetResponseDNSRecordsAaaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsAaaaRecordMeta] -type dnsRecordListResponseDNSRecordsAaaaRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsAaaaRecordMeta] +type dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6222,14 +6240,14 @@ func (r *DNSRecordListResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsAaaaRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsAaaaRecordTTL() +// [DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsAaaaRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsAaaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6238,19 +6256,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordListResponseDNSRecordsAaaaRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsCaaRecord struct { +type DNSRecordGetResponseDNSRecordsCaaRecord struct { // Components of a CAA record. - Data DNSRecordListResponseDNSRecordsCaaRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsCaaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsCaaRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsCaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6264,7 +6282,7 @@ type DNSRecordListResponseDNSRecordsCaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsCaaRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsCaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6274,17 +6292,17 @@ type DNSRecordListResponseDNSRecordsCaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsCaaRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsCaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsCaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsCaaRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCaaRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsCaaRecord] -type dnsRecordListResponseDNSRecordsCaaRecordJSON struct { +// dnsRecordGetResponseDNSRecordsCaaRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsCaaRecord] +type dnsRecordGetResponseDNSRecordsCaaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -6304,26 +6322,26 @@ type dnsRecordListResponseDNSRecordsCaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsCaaRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsCaaRecord) implementsDNSRecordGetResponse() {} // Components of a CAA record. -type DNSRecordListResponseDNSRecordsCaaRecordData struct { +type DNSRecordGetResponseDNSRecordsCaaRecordData struct { // Flags for the CAA record. Flags float64 `json:"flags"` // Name of the property controlled by this record (e.g.: issue, issuewild, iodef). Tag string `json:"tag"` // Value of the record. This field's semantics depend on the chosen tag. - Value string `json:"value"` - JSON dnsRecordListResponseDNSRecordsCaaRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordGetResponseDNSRecordsCaaRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsCaaRecordData] -type dnsRecordListResponseDNSRecordsCaaRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsCaaRecordData] +type dnsRecordGetResponseDNSRecordsCaaRecordDataJSON struct { Flags apijson.Field Tag apijson.Field Value apijson.Field @@ -6331,37 +6349,37 @@ type dnsRecordListResponseDNSRecordsCaaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsCaaRecordType string +type DNSRecordGetResponseDNSRecordsCaaRecordType string const ( - DNSRecordListResponseDNSRecordsCaaRecordTypeCaa DNSRecordListResponseDNSRecordsCaaRecordType = "CAA" + DNSRecordGetResponseDNSRecordsCaaRecordTypeCaa DNSRecordGetResponseDNSRecordsCaaRecordType = "CAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsCaaRecordMeta struct { +type DNSRecordGetResponseDNSRecordsCaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsCaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsCaaRecordMeta] -type dnsRecordListResponseDNSRecordsCaaRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsCaaRecordMeta] +type dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6370,14 +6388,14 @@ func (r *DNSRecordListResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsCaaRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsCaaRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsCaaRecordTTL() +// [DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsCaaRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsCaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6386,19 +6404,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsCaaRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordListResponseDNSRecordsCaaRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsCertRecord struct { +type DNSRecordGetResponseDNSRecordsCertRecord struct { // Components of a CERT record. - Data DNSRecordListResponseDNSRecordsCertRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsCertRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsCertRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsCertRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6412,7 +6430,7 @@ type DNSRecordListResponseDNSRecordsCertRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsCertRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsCertRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6422,17 +6440,17 @@ type DNSRecordListResponseDNSRecordsCertRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsCertRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsCertRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsCertRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsCertRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCertRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsCertRecord] -type dnsRecordListResponseDNSRecordsCertRecordJSON struct { +// dnsRecordGetResponseDNSRecordsCertRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsCertRecord] +type dnsRecordGetResponseDNSRecordsCertRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -6452,14 +6470,14 @@ type dnsRecordListResponseDNSRecordsCertRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsCertRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsCertRecord) implementsDNSRecordGetResponse() {} // Components of a CERT record. -type DNSRecordListResponseDNSRecordsCertRecordData struct { +type DNSRecordGetResponseDNSRecordsCertRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Certificate. @@ -6467,13 +6485,13 @@ type DNSRecordListResponseDNSRecordsCertRecordData struct { // Key Tag. KeyTag float64 `json:"key_tag"` // Type. - Type float64 `json:"type"` - JSON dnsRecordListResponseDNSRecordsCertRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordGetResponseDNSRecordsCertRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCertRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsCertRecordData] -type dnsRecordListResponseDNSRecordsCertRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsCertRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsCertRecordData] +type dnsRecordGetResponseDNSRecordsCertRecordDataJSON struct { Algorithm apijson.Field Certificate apijson.Field KeyTag apijson.Field @@ -6482,37 +6500,37 @@ type dnsRecordListResponseDNSRecordsCertRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsCertRecordType string +type DNSRecordGetResponseDNSRecordsCertRecordType string const ( - DNSRecordListResponseDNSRecordsCertRecordTypeCert DNSRecordListResponseDNSRecordsCertRecordType = "CERT" + DNSRecordGetResponseDNSRecordsCertRecordTypeCert DNSRecordGetResponseDNSRecordsCertRecordType = "CERT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsCertRecordMeta struct { +type DNSRecordGetResponseDNSRecordsCertRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsCertRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsCertRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsCertRecordMeta] -type dnsRecordListResponseDNSRecordsCertRecordMetaJSON struct { - AutoAdded apijson.Field +// dnsRecordGetResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsCertRecordMeta] +type dnsRecordGetResponseDNSRecordsCertRecordMetaJSON struct { + AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6521,14 +6539,14 @@ func (r *DNSRecordListResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsCertRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsCertRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsCertRecordTTL() +// [DNSRecordGetResponseDNSRecordsCertRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsCertRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsCertRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsCertRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCertRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6537,19 +6555,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsCertRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsCertRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsCertRecordTTLNumber1 DNSRecordListResponseDNSRecordsCertRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsCertRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCertRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsCnameRecord struct { +type DNSRecordGetResponseDNSRecordsCnameRecord struct { // A valid hostname. Must not match the record's name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsCnameRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsCnameRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6561,7 +6579,7 @@ type DNSRecordListResponseDNSRecordsCnameRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsCnameRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsCnameRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6574,17 +6592,17 @@ type DNSRecordListResponseDNSRecordsCnameRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsCnameRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsCnameRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsCnameRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsCnameRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCnameRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsCnameRecord] -type dnsRecordListResponseDNSRecordsCnameRecordJSON struct { +// dnsRecordGetResponseDNSRecordsCnameRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsCnameRecord] +type dnsRecordGetResponseDNSRecordsCnameRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -6604,39 +6622,39 @@ type dnsRecordListResponseDNSRecordsCnameRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsCnameRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsCnameRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsCnameRecordType string +type DNSRecordGetResponseDNSRecordsCnameRecordType string const ( - DNSRecordListResponseDNSRecordsCnameRecordTypeCname DNSRecordListResponseDNSRecordsCnameRecordType = "CNAME" + DNSRecordGetResponseDNSRecordsCnameRecordTypeCname DNSRecordGetResponseDNSRecordsCnameRecordType = "CNAME" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsCnameRecordMeta struct { +type DNSRecordGetResponseDNSRecordsCnameRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsCnameRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsCnameRecordMeta] -type dnsRecordListResponseDNSRecordsCnameRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsCnameRecordMeta] +type dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6645,14 +6663,14 @@ func (r *DNSRecordListResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsCnameRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsCnameRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsCnameRecordTTL() +// [DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsCnameRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsCnameRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6661,19 +6679,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsCnameRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordListResponseDNSRecordsCnameRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsDnskeyRecord struct { +type DNSRecordGetResponseDNSRecordsDnskeyRecord struct { // Components of a DNSKEY record. - Data DNSRecordListResponseDNSRecordsDnskeyRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsDnskeyRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsDnskeyRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsDnskeyRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6687,7 +6705,7 @@ type DNSRecordListResponseDNSRecordsDnskeyRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsDnskeyRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsDnskeyRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6697,17 +6715,17 @@ type DNSRecordListResponseDNSRecordsDnskeyRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsDnskeyRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsDnskeyRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsDnskeyRecord] -type dnsRecordListResponseDNSRecordsDnskeyRecordJSON struct { +// dnsRecordGetResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsDnskeyRecord] +type dnsRecordGetResponseDNSRecordsDnskeyRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -6727,14 +6745,14 @@ type dnsRecordListResponseDNSRecordsDnskeyRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsDnskeyRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsDnskeyRecord) implementsDNSRecordGetResponse() {} // Components of a DNSKEY record. -type DNSRecordListResponseDNSRecordsDnskeyRecordData struct { +type DNSRecordGetResponseDNSRecordsDnskeyRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Flags. @@ -6742,13 +6760,13 @@ type DNSRecordListResponseDNSRecordsDnskeyRecordData struct { // Protocol. Protocol float64 `json:"protocol"` // Public Key. - PublicKey string `json:"public_key"` - JSON dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` + PublicKey string `json:"public_key"` + JSON dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsDnskeyRecordData] -type dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordGetResponseDNSRecordsDnskeyRecordData] +type dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON struct { Algorithm apijson.Field Flags apijson.Field Protocol apijson.Field @@ -6757,37 +6775,37 @@ type dnsRecordListResponseDNSRecordsDnskeyRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsDnskeyRecordType string +type DNSRecordGetResponseDNSRecordsDnskeyRecordType string const ( - DNSRecordListResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordListResponseDNSRecordsDnskeyRecordType = "DNSKEY" + DNSRecordGetResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordGetResponseDNSRecordsDnskeyRecordType = "DNSKEY" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsDnskeyRecordMeta struct { +type DNSRecordGetResponseDNSRecordsDnskeyRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsDnskeyRecordMeta] -type dnsRecordListResponseDNSRecordsDnskeyRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordGetResponseDNSRecordsDnskeyRecordMeta] +type dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6796,14 +6814,14 @@ func (r *DNSRecordListResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsDnskeyRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsDnskeyRecordTTL() +// [DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsDnskeyRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsDnskeyRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6812,19 +6830,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordListResponseDNSRecordsDnskeyRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsDsRecord struct { +type DNSRecordGetResponseDNSRecordsDsRecord struct { // Components of a DS record. - Data DNSRecordListResponseDNSRecordsDsRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsDsRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsDsRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsDsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6838,7 +6856,7 @@ type DNSRecordListResponseDNSRecordsDsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsDsRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsDsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6848,17 +6866,17 @@ type DNSRecordListResponseDNSRecordsDsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsDsRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsDsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsDsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsDsRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDsRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsDsRecord] -type dnsRecordListResponseDNSRecordsDsRecordJSON struct { +// dnsRecordGetResponseDNSRecordsDsRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsDsRecord] +type dnsRecordGetResponseDNSRecordsDsRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -6878,14 +6896,14 @@ type dnsRecordListResponseDNSRecordsDsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsDsRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsDsRecord) implementsDNSRecordGetResponse() {} // Components of a DS record. -type DNSRecordListResponseDNSRecordsDsRecordData struct { +type DNSRecordGetResponseDNSRecordsDsRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Digest. @@ -6893,13 +6911,13 @@ type DNSRecordListResponseDNSRecordsDsRecordData struct { // Digest Type. DigestType float64 `json:"digest_type"` // Key Tag. - KeyTag float64 `json:"key_tag"` - JSON dnsRecordListResponseDNSRecordsDsRecordDataJSON `json:"-"` + KeyTag float64 `json:"key_tag"` + JSON dnsRecordGetResponseDNSRecordsDsRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDsRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsDsRecordData] -type dnsRecordListResponseDNSRecordsDsRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsDsRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsDsRecordData] +type dnsRecordGetResponseDNSRecordsDsRecordDataJSON struct { Algorithm apijson.Field Digest apijson.Field DigestType apijson.Field @@ -6908,37 +6926,37 @@ type dnsRecordListResponseDNSRecordsDsRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsDsRecordType string +type DNSRecordGetResponseDNSRecordsDsRecordType string const ( - DNSRecordListResponseDNSRecordsDsRecordTypeDs DNSRecordListResponseDNSRecordsDsRecordType = "DS" + DNSRecordGetResponseDNSRecordsDsRecordTypeDs DNSRecordGetResponseDNSRecordsDsRecordType = "DS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsDsRecordMeta struct { +type DNSRecordGetResponseDNSRecordsDsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsDsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsDsRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsDsRecordMeta] -type dnsRecordListResponseDNSRecordsDsRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsDsRecordMeta] +type dnsRecordGetResponseDNSRecordsDsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -6947,14 +6965,14 @@ func (r *DNSRecordListResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsDsRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsDsRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsDsRecordTTL() +// [DNSRecordGetResponseDNSRecordsDsRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsDsRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsDsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsDsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsDsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -6963,19 +6981,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsDsRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsDsRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsDsRecordTTLNumber1 DNSRecordListResponseDNSRecordsDsRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsDsRecordTTLNumber1 DNSRecordGetResponseDNSRecordsDsRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsHTTPSRecord struct { +type DNSRecordGetResponseDNSRecordsHTTPSRecord struct { // Components of a HTTPS record. - Data DNSRecordListResponseDNSRecordsHTTPSRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsHTTPSRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsHTTPSRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsHTTPSRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -6989,7 +7007,7 @@ type DNSRecordListResponseDNSRecordsHTTPSRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsHTTPSRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsHTTPSRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -6999,17 +7017,17 @@ type DNSRecordListResponseDNSRecordsHTTPSRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsHTTPSRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsHTTPSRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsHTTPSRecord] -type dnsRecordListResponseDNSRecordsHTTPSRecordJSON struct { +// dnsRecordGetResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsHTTPSRecord] +type dnsRecordGetResponseDNSRecordsHTTPSRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -7029,26 +7047,26 @@ type dnsRecordListResponseDNSRecordsHTTPSRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsHTTPSRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsHTTPSRecord) implementsDNSRecordGetResponse() {} // Components of a HTTPS record. -type DNSRecordListResponseDNSRecordsHTTPSRecordData struct { +type DNSRecordGetResponseDNSRecordsHTTPSRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsHTTPSRecordData] -type dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsHTTPSRecordData] +type dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -7056,37 +7074,37 @@ type dnsRecordListResponseDNSRecordsHTTPSRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsHTTPSRecordType string +type DNSRecordGetResponseDNSRecordsHTTPSRecordType string const ( - DNSRecordListResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordListResponseDNSRecordsHTTPSRecordType = "HTTPS" + DNSRecordGetResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordGetResponseDNSRecordsHTTPSRecordType = "HTTPS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsHTTPSRecordMeta struct { +type DNSRecordGetResponseDNSRecordsHTTPSRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsHTTPSRecordMeta] -type dnsRecordListResponseDNSRecordsHTTPSRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsHTTPSRecordMeta] +type dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7095,14 +7113,14 @@ func (r *DNSRecordListResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsHTTPSRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsHTTPSRecordTTL() +// [DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsHTTPSRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsHTTPSRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7111,19 +7129,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordListResponseDNSRecordsHTTPSRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsLocRecord struct { +type DNSRecordGetResponseDNSRecordsLocRecord struct { // Components of a LOC record. - Data DNSRecordListResponseDNSRecordsLocRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsLocRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsLocRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsLocRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7137,7 +7155,7 @@ type DNSRecordListResponseDNSRecordsLocRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsLocRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsLocRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7147,17 +7165,17 @@ type DNSRecordListResponseDNSRecordsLocRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsLocRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsLocRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsLocRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsLocRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsLocRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsLocRecord] -type dnsRecordListResponseDNSRecordsLocRecordJSON struct { +// dnsRecordGetResponseDNSRecordsLocRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsLocRecord] +type dnsRecordGetResponseDNSRecordsLocRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -7177,20 +7195,20 @@ type dnsRecordListResponseDNSRecordsLocRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsLocRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsLocRecord) implementsDNSRecordGetResponse() {} // Components of a LOC record. -type DNSRecordListResponseDNSRecordsLocRecordData struct { +type DNSRecordGetResponseDNSRecordsLocRecordData struct { // Altitude of location in meters. Altitude float64 `json:"altitude"` // Degrees of latitude. LatDegrees float64 `json:"lat_degrees"` // Latitude direction. - LatDirection DNSRecordListResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` + LatDirection DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` // Minutes of latitude. LatMinutes float64 `json:"lat_minutes"` // Seconds of latitude. @@ -7198,7 +7216,7 @@ type DNSRecordListResponseDNSRecordsLocRecordData struct { // Degrees of longitude. LongDegrees float64 `json:"long_degrees"` // Longitude direction. - LongDirection DNSRecordListResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` + LongDirection DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` // Minutes of longitude. LongMinutes float64 `json:"long_minutes"` // Seconds of longitude. @@ -7208,13 +7226,13 @@ type DNSRecordListResponseDNSRecordsLocRecordData struct { // Vertical precision of location. PrecisionVert float64 `json:"precision_vert"` // Size of location in meters. - Size float64 `json:"size"` - JSON dnsRecordListResponseDNSRecordsLocRecordDataJSON `json:"-"` + Size float64 `json:"size"` + JSON dnsRecordGetResponseDNSRecordsLocRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsLocRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsLocRecordData] -type dnsRecordListResponseDNSRecordsLocRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsLocRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsLocRecordData] +type dnsRecordGetResponseDNSRecordsLocRecordDataJSON struct { Altitude apijson.Field LatDegrees apijson.Field LatDirection apijson.Field @@ -7231,53 +7249,53 @@ type dnsRecordListResponseDNSRecordsLocRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Latitude direction. -type DNSRecordListResponseDNSRecordsLocRecordDataLatDirection string +type DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection string const ( - DNSRecordListResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordListResponseDNSRecordsLocRecordDataLatDirection = "N" - DNSRecordListResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordListResponseDNSRecordsLocRecordDataLatDirection = "S" + DNSRecordGetResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection = "N" + DNSRecordGetResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection = "S" ) // Longitude direction. -type DNSRecordListResponseDNSRecordsLocRecordDataLongDirection string +type DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection string const ( - DNSRecordListResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordListResponseDNSRecordsLocRecordDataLongDirection = "E" - DNSRecordListResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordListResponseDNSRecordsLocRecordDataLongDirection = "W" + DNSRecordGetResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection = "E" + DNSRecordGetResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection = "W" ) // Record type. -type DNSRecordListResponseDNSRecordsLocRecordType string +type DNSRecordGetResponseDNSRecordsLocRecordType string const ( - DNSRecordListResponseDNSRecordsLocRecordTypeLoc DNSRecordListResponseDNSRecordsLocRecordType = "LOC" + DNSRecordGetResponseDNSRecordsLocRecordTypeLoc DNSRecordGetResponseDNSRecordsLocRecordType = "LOC" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsLocRecordMeta struct { +type DNSRecordGetResponseDNSRecordsLocRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsLocRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsLocRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsLocRecordMeta] -type dnsRecordListResponseDNSRecordsLocRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsLocRecordMeta] +type dnsRecordGetResponseDNSRecordsLocRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7286,14 +7304,14 @@ func (r *DNSRecordListResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsLocRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsLocRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsLocRecordTTL() +// [DNSRecordGetResponseDNSRecordsLocRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsLocRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsLocRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsLocRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsLocRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7302,13 +7320,13 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsLocRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsLocRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsLocRecordTTLNumber1 DNSRecordListResponseDNSRecordsLocRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsLocRecordTTLNumber1 DNSRecordGetResponseDNSRecordsLocRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsMxRecord struct { +type DNSRecordGetResponseDNSRecordsMxRecord struct { // A valid mail server hostname. Content string `json:"content,required" format:"hostname"` // DNS record name (or @ for the zone apex) in Punycode. @@ -7317,7 +7335,7 @@ type DNSRecordListResponseDNSRecordsMxRecord struct { // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordListResponseDNSRecordsMxRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsMxRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7329,7 +7347,7 @@ type DNSRecordListResponseDNSRecordsMxRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsMxRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsMxRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7339,17 +7357,17 @@ type DNSRecordListResponseDNSRecordsMxRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsMxRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsMxRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsMxRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsMxRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsMxRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsMxRecord] -type dnsRecordListResponseDNSRecordsMxRecordJSON struct { +// dnsRecordGetResponseDNSRecordsMxRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsMxRecord] +type dnsRecordGetResponseDNSRecordsMxRecordJSON struct { Content apijson.Field Name apijson.Field Priority apijson.Field @@ -7369,39 +7387,39 @@ type dnsRecordListResponseDNSRecordsMxRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsMxRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsMxRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsMxRecordType string +type DNSRecordGetResponseDNSRecordsMxRecordType string const ( - DNSRecordListResponseDNSRecordsMxRecordTypeMx DNSRecordListResponseDNSRecordsMxRecordType = "MX" + DNSRecordGetResponseDNSRecordsMxRecordTypeMx DNSRecordGetResponseDNSRecordsMxRecordType = "MX" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsMxRecordMeta struct { +type DNSRecordGetResponseDNSRecordsMxRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsMxRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsMxRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsMxRecordMeta] -type dnsRecordListResponseDNSRecordsMxRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsMxRecordMeta] +type dnsRecordGetResponseDNSRecordsMxRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7410,14 +7428,14 @@ func (r *DNSRecordListResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsMxRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsMxRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsMxRecordTTL() +// [DNSRecordGetResponseDNSRecordsMxRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsMxRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsMxRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsMxRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsMxRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7426,19 +7444,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsMxRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsMxRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsMxRecordTTLNumber1 DNSRecordListResponseDNSRecordsMxRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsMxRecordTTLNumber1 DNSRecordGetResponseDNSRecordsMxRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsNaptrRecord struct { +type DNSRecordGetResponseDNSRecordsNaptrRecord struct { // Components of a NAPTR record. - Data DNSRecordListResponseDNSRecordsNaptrRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsNaptrRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsNaptrRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsNaptrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7452,7 +7470,7 @@ type DNSRecordListResponseDNSRecordsNaptrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsNaptrRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsNaptrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7462,17 +7480,17 @@ type DNSRecordListResponseDNSRecordsNaptrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsNaptrRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsNaptrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsNaptrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsNaptrRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsNaptrRecord] -type dnsRecordListResponseDNSRecordsNaptrRecordJSON struct { +// dnsRecordGetResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsNaptrRecord] +type dnsRecordGetResponseDNSRecordsNaptrRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -7492,14 +7510,14 @@ type dnsRecordListResponseDNSRecordsNaptrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsNaptrRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsNaptrRecord) implementsDNSRecordGetResponse() {} // Components of a NAPTR record. -type DNSRecordListResponseDNSRecordsNaptrRecordData struct { +type DNSRecordGetResponseDNSRecordsNaptrRecordData struct { // Flags. Flags string `json:"flags"` // Order. @@ -7511,13 +7529,13 @@ type DNSRecordListResponseDNSRecordsNaptrRecordData struct { // Replacement. Replacement string `json:"replacement"` // Service. - Service string `json:"service"` - JSON dnsRecordListResponseDNSRecordsNaptrRecordDataJSON `json:"-"` + Service string `json:"service"` + JSON dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsNaptrRecordData] -type dnsRecordListResponseDNSRecordsNaptrRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsNaptrRecordData] +type dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON struct { Flags apijson.Field Order apijson.Field Preference apijson.Field @@ -7528,37 +7546,37 @@ type dnsRecordListResponseDNSRecordsNaptrRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsNaptrRecordType string +type DNSRecordGetResponseDNSRecordsNaptrRecordType string const ( - DNSRecordListResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordListResponseDNSRecordsNaptrRecordType = "NAPTR" + DNSRecordGetResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordGetResponseDNSRecordsNaptrRecordType = "NAPTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsNaptrRecordMeta struct { +type DNSRecordGetResponseDNSRecordsNaptrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsNaptrRecordMeta] -type dnsRecordListResponseDNSRecordsNaptrRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsNaptrRecordMeta] +type dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7567,14 +7585,14 @@ func (r *DNSRecordListResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsNaptrRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsNaptrRecordTTL() +// [DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsNaptrRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsNaptrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7583,19 +7601,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordListResponseDNSRecordsNaptrRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsNsRecord struct { +type DNSRecordGetResponseDNSRecordsNsRecord struct { // A valid name server host name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsNsRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsNsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7607,7 +7625,7 @@ type DNSRecordListResponseDNSRecordsNsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsNsRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsNsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7617,17 +7635,17 @@ type DNSRecordListResponseDNSRecordsNsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsNsRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsNsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsNsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsNsRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsNsRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsNsRecord] -type dnsRecordListResponseDNSRecordsNsRecordJSON struct { +// dnsRecordGetResponseDNSRecordsNsRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsNsRecord] +type dnsRecordGetResponseDNSRecordsNsRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -7646,39 +7664,39 @@ type dnsRecordListResponseDNSRecordsNsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsNsRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsNsRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsNsRecordType string +type DNSRecordGetResponseDNSRecordsNsRecordType string const ( - DNSRecordListResponseDNSRecordsNsRecordTypeNs DNSRecordListResponseDNSRecordsNsRecordType = "NS" + DNSRecordGetResponseDNSRecordsNsRecordTypeNs DNSRecordGetResponseDNSRecordsNsRecordType = "NS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsNsRecordMeta struct { +type DNSRecordGetResponseDNSRecordsNsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsNsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsNsRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsNsRecordMeta] -type dnsRecordListResponseDNSRecordsNsRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsNsRecordMeta] +type dnsRecordGetResponseDNSRecordsNsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7687,14 +7705,14 @@ func (r *DNSRecordListResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsNsRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsNsRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsNsRecordTTL() +// [DNSRecordGetResponseDNSRecordsNsRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsNsRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsNsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsNsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsNsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7703,19 +7721,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsNsRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsNsRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsNsRecordTTLNumber1 DNSRecordListResponseDNSRecordsNsRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsNsRecordTTLNumber1 DNSRecordGetResponseDNSRecordsNsRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsPtrRecord struct { +type DNSRecordGetResponseDNSRecordsPtrRecord struct { // Domain name pointing to the address. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsPtrRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsPtrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7727,7 +7745,7 @@ type DNSRecordListResponseDNSRecordsPtrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsPtrRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsPtrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7737,17 +7755,17 @@ type DNSRecordListResponseDNSRecordsPtrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsPtrRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsPtrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsPtrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsPtrRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsPtrRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsPtrRecord] -type dnsRecordListResponseDNSRecordsPtrRecordJSON struct { +// dnsRecordGetResponseDNSRecordsPtrRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsPtrRecord] +type dnsRecordGetResponseDNSRecordsPtrRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -7766,39 +7784,39 @@ type dnsRecordListResponseDNSRecordsPtrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsPtrRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsPtrRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsPtrRecordType string +type DNSRecordGetResponseDNSRecordsPtrRecordType string const ( - DNSRecordListResponseDNSRecordsPtrRecordTypePtr DNSRecordListResponseDNSRecordsPtrRecordType = "PTR" + DNSRecordGetResponseDNSRecordsPtrRecordTypePtr DNSRecordGetResponseDNSRecordsPtrRecordType = "PTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsPtrRecordMeta struct { +type DNSRecordGetResponseDNSRecordsPtrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsPtrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsPtrRecordMeta] -type dnsRecordListResponseDNSRecordsPtrRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsPtrRecordMeta] +type dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7807,14 +7825,14 @@ func (r *DNSRecordListResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsPtrRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsPtrRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsPtrRecordTTL() +// [DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsPtrRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsPtrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7823,19 +7841,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsPtrRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordListResponseDNSRecordsPtrRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsSmimeaRecord struct { +type DNSRecordGetResponseDNSRecordsSmimeaRecord struct { // Components of a SMIMEA record. - Data DNSRecordListResponseDNSRecordsSmimeaRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsSmimeaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsSmimeaRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsSmimeaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -7849,7 +7867,7 @@ type DNSRecordListResponseDNSRecordsSmimeaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsSmimeaRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsSmimeaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -7859,17 +7877,17 @@ type DNSRecordListResponseDNSRecordsSmimeaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsSmimeaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsSmimeaRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSmimeaRecord] -type dnsRecordListResponseDNSRecordsSmimeaRecordJSON struct { +// dnsRecordGetResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSmimeaRecord] +type dnsRecordGetResponseDNSRecordsSmimeaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -7889,14 +7907,14 @@ type dnsRecordListResponseDNSRecordsSmimeaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsSmimeaRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsSmimeaRecord) implementsDNSRecordGetResponse() {} // Components of a SMIMEA record. -type DNSRecordListResponseDNSRecordsSmimeaRecordData struct { +type DNSRecordGetResponseDNSRecordsSmimeaRecordData struct { // Certificate. Certificate string `json:"certificate"` // Matching Type. @@ -7904,13 +7922,13 @@ type DNSRecordListResponseDNSRecordsSmimeaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsSmimeaRecordData] -type dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordGetResponseDNSRecordsSmimeaRecordData] +type dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -7919,37 +7937,37 @@ type dnsRecordListResponseDNSRecordsSmimeaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsSmimeaRecordType string +type DNSRecordGetResponseDNSRecordsSmimeaRecordType string const ( - DNSRecordListResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordListResponseDNSRecordsSmimeaRecordType = "SMIMEA" + DNSRecordGetResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordGetResponseDNSRecordsSmimeaRecordType = "SMIMEA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsSmimeaRecordMeta struct { +type DNSRecordGetResponseDNSRecordsSmimeaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsSmimeaRecordMeta] -type dnsRecordListResponseDNSRecordsSmimeaRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordGetResponseDNSRecordsSmimeaRecordMeta] +type dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -7958,14 +7976,14 @@ func (r *DNSRecordListResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []b // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsSmimeaRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsSmimeaRecordTTL() +// [DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsSmimeaRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsSmimeaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -7974,21 +7992,21 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordListResponseDNSRecordsSmimeaRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsSrvRecord struct { +type DNSRecordGetResponseDNSRecordsSrvRecord struct { // Components of a SRV record. - Data DNSRecordListResponseDNSRecordsSrvRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsSrvRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first // label is normally a service and the second a protocol name, each starting with // an underscore. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsSrvRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsSrvRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8003,7 +8021,7 @@ type DNSRecordListResponseDNSRecordsSrvRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsSrvRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsSrvRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8013,17 +8031,17 @@ type DNSRecordListResponseDNSRecordsSrvRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsSrvRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsSrvRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsSrvRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsSrvRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSrvRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsSrvRecord] -type dnsRecordListResponseDNSRecordsSrvRecordJSON struct { +// dnsRecordGetResponseDNSRecordsSrvRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsSrvRecord] +type dnsRecordGetResponseDNSRecordsSrvRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -8043,14 +8061,14 @@ type dnsRecordListResponseDNSRecordsSrvRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsSrvRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsSrvRecord) implementsDNSRecordGetResponse() {} // Components of a SRV record. -type DNSRecordListResponseDNSRecordsSrvRecordData struct { +type DNSRecordGetResponseDNSRecordsSrvRecordData struct { // A valid hostname. Deprecated in favor of the regular 'name' outside the data // map. This data map field represents the remainder of the full 'name' after the // service and protocol. @@ -8071,13 +8089,13 @@ type DNSRecordListResponseDNSRecordsSrvRecordData struct { // A valid hostname. Target string `json:"target" format:"hostname"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordListResponseDNSRecordsSrvRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordGetResponseDNSRecordsSrvRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSrvRecordData] -type dnsRecordListResponseDNSRecordsSrvRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSrvRecordData] +type dnsRecordGetResponseDNSRecordsSrvRecordDataJSON struct { Name apijson.Field Port apijson.Field Priority apijson.Field @@ -8089,37 +8107,37 @@ type dnsRecordListResponseDNSRecordsSrvRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsSrvRecordType string +type DNSRecordGetResponseDNSRecordsSrvRecordType string const ( - DNSRecordListResponseDNSRecordsSrvRecordTypeSrv DNSRecordListResponseDNSRecordsSrvRecordType = "SRV" + DNSRecordGetResponseDNSRecordsSrvRecordTypeSrv DNSRecordGetResponseDNSRecordsSrvRecordType = "SRV" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsSrvRecordMeta struct { +type DNSRecordGetResponseDNSRecordsSrvRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsSrvRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSrvRecordMeta] -type dnsRecordListResponseDNSRecordsSrvRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSrvRecordMeta] +type dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8128,14 +8146,14 @@ func (r *DNSRecordListResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsSrvRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsSrvRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsSrvRecordTTL() +// [DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsSrvRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsSrvRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8144,19 +8162,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsSrvRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordListResponseDNSRecordsSrvRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsSshfpRecord struct { +type DNSRecordGetResponseDNSRecordsSshfpRecord struct { // Components of a SSHFP record. - Data DNSRecordListResponseDNSRecordsSshfpRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsSshfpRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsSshfpRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsSshfpRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8170,7 +8188,7 @@ type DNSRecordListResponseDNSRecordsSshfpRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsSshfpRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsSshfpRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8180,17 +8198,17 @@ type DNSRecordListResponseDNSRecordsSshfpRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsSshfpRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsSshfpRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsSshfpRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsSshfpRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSshfpRecord] -type dnsRecordListResponseDNSRecordsSshfpRecordJSON struct { +// dnsRecordGetResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsSshfpRecord] +type dnsRecordGetResponseDNSRecordsSshfpRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -8210,26 +8228,26 @@ type dnsRecordListResponseDNSRecordsSshfpRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsSshfpRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsSshfpRecord) implementsDNSRecordGetResponse() {} // Components of a SSHFP record. -type DNSRecordListResponseDNSRecordsSshfpRecordData struct { +type DNSRecordGetResponseDNSRecordsSshfpRecordData struct { // algorithm. Algorithm float64 `json:"algorithm"` // fingerprint. Fingerprint string `json:"fingerprint"` // type. - Type float64 `json:"type"` - JSON dnsRecordListResponseDNSRecordsSshfpRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsSshfpRecordData] -type dnsRecordListResponseDNSRecordsSshfpRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSshfpRecordData] +type dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON struct { Algorithm apijson.Field Fingerprint apijson.Field Type apijson.Field @@ -8237,37 +8255,37 @@ type dnsRecordListResponseDNSRecordsSshfpRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsSshfpRecordType string +type DNSRecordGetResponseDNSRecordsSshfpRecordType string const ( - DNSRecordListResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordListResponseDNSRecordsSshfpRecordType = "SSHFP" + DNSRecordGetResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordGetResponseDNSRecordsSshfpRecordType = "SSHFP" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsSshfpRecordMeta struct { +type DNSRecordGetResponseDNSRecordsSshfpRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordListResponseDNSRecordsSshfpRecordMeta] -type dnsRecordListResponseDNSRecordsSshfpRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSshfpRecordMeta] +type dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8276,14 +8294,14 @@ func (r *DNSRecordListResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsSshfpRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsSshfpRecordTTL() +// [DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsSshfpRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsSshfpRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8292,19 +8310,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordListResponseDNSRecordsSshfpRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsSvcbRecord struct { +type DNSRecordGetResponseDNSRecordsSvcbRecord struct { // Components of a SVCB record. - Data DNSRecordListResponseDNSRecordsSvcbRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsSvcbRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsSvcbRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsSvcbRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8318,7 +8336,7 @@ type DNSRecordListResponseDNSRecordsSvcbRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsSvcbRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsSvcbRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8328,17 +8346,17 @@ type DNSRecordListResponseDNSRecordsSvcbRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsSvcbRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsSvcbRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsSvcbRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsSvcbRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsSvcbRecord] -type dnsRecordListResponseDNSRecordsSvcbRecordJSON struct { +// dnsRecordGetResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsSvcbRecord] +type dnsRecordGetResponseDNSRecordsSvcbRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -8358,26 +8376,26 @@ type dnsRecordListResponseDNSRecordsSvcbRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsSvcbRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsSvcbRecord) implementsDNSRecordGetResponse() {} // Components of a SVCB record. -type DNSRecordListResponseDNSRecordsSvcbRecordData struct { +type DNSRecordGetResponseDNSRecordsSvcbRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordListResponseDNSRecordsSvcbRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSvcbRecordData] -type dnsRecordListResponseDNSRecordsSvcbRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSvcbRecordData] +type dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -8385,37 +8403,37 @@ type dnsRecordListResponseDNSRecordsSvcbRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsSvcbRecordType string +type DNSRecordGetResponseDNSRecordsSvcbRecordType string const ( - DNSRecordListResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordListResponseDNSRecordsSvcbRecordType = "SVCB" + DNSRecordGetResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordGetResponseDNSRecordsSvcbRecordType = "SVCB" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsSvcbRecordMeta struct { +type DNSRecordGetResponseDNSRecordsSvcbRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsSvcbRecordMeta] -type dnsRecordListResponseDNSRecordsSvcbRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsSvcbRecordMeta] +type dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8424,14 +8442,14 @@ func (r *DNSRecordListResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsSvcbRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsSvcbRecordTTL() +// [DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsSvcbRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsSvcbRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8440,19 +8458,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordListResponseDNSRecordsSvcbRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsTlsaRecord struct { +type DNSRecordGetResponseDNSRecordsTlsaRecord struct { // Components of a TLSA record. - Data DNSRecordListResponseDNSRecordsTlsaRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsTlsaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsTlsaRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsTlsaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8466,7 +8484,7 @@ type DNSRecordListResponseDNSRecordsTlsaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsTlsaRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsTlsaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8476,17 +8494,17 @@ type DNSRecordListResponseDNSRecordsTlsaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsTlsaRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsTlsaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsTlsaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsTlsaRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsTlsaRecord] -type dnsRecordListResponseDNSRecordsTlsaRecordJSON struct { +// dnsRecordGetResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsTlsaRecord] +type dnsRecordGetResponseDNSRecordsTlsaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -8506,14 +8524,14 @@ type dnsRecordListResponseDNSRecordsTlsaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsTlsaRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsTlsaRecord) implementsDNSRecordGetResponse() {} // Components of a TLSA record. -type DNSRecordListResponseDNSRecordsTlsaRecordData struct { +type DNSRecordGetResponseDNSRecordsTlsaRecordData struct { // certificate. Certificate string `json:"certificate"` // Matching Type. @@ -8521,13 +8539,13 @@ type DNSRecordListResponseDNSRecordsTlsaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordListResponseDNSRecordsTlsaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsTlsaRecordData] -type dnsRecordListResponseDNSRecordsTlsaRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsTlsaRecordData] +type dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -8536,37 +8554,37 @@ type dnsRecordListResponseDNSRecordsTlsaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsTlsaRecordType string +type DNSRecordGetResponseDNSRecordsTlsaRecordType string const ( - DNSRecordListResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordListResponseDNSRecordsTlsaRecordType = "TLSA" + DNSRecordGetResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordGetResponseDNSRecordsTlsaRecordType = "TLSA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsTlsaRecordMeta struct { +type DNSRecordGetResponseDNSRecordsTlsaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsTlsaRecordMeta] -type dnsRecordListResponseDNSRecordsTlsaRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsTlsaRecordMeta] +type dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8575,14 +8593,14 @@ func (r *DNSRecordListResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsTlsaRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsTlsaRecordTTL() +// [DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsTlsaRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsTlsaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8591,19 +8609,19 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordListResponseDNSRecordsTlsaRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsTxtRecord struct { +type DNSRecordGetResponseDNSRecordsTxtRecord struct { // Text content for the record. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordListResponseDNSRecordsTxtRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsTxtRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8615,7 +8633,7 @@ type DNSRecordListResponseDNSRecordsTxtRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsTxtRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsTxtRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8625,17 +8643,17 @@ type DNSRecordListResponseDNSRecordsTxtRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsTxtRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsTxtRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsTxtRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsTxtRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsTxtRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsTxtRecord] -type dnsRecordListResponseDNSRecordsTxtRecordJSON struct { +// dnsRecordGetResponseDNSRecordsTxtRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsTxtRecord] +type dnsRecordGetResponseDNSRecordsTxtRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -8654,39 +8672,39 @@ type dnsRecordListResponseDNSRecordsTxtRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsTxtRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsTxtRecord) implementsDNSRecordGetResponse() {} // Record type. -type DNSRecordListResponseDNSRecordsTxtRecordType string +type DNSRecordGetResponseDNSRecordsTxtRecordType string const ( - DNSRecordListResponseDNSRecordsTxtRecordTypeTxt DNSRecordListResponseDNSRecordsTxtRecordType = "TXT" + DNSRecordGetResponseDNSRecordsTxtRecordTypeTxt DNSRecordGetResponseDNSRecordsTxtRecordType = "TXT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsTxtRecordMeta struct { +type DNSRecordGetResponseDNSRecordsTxtRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsTxtRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsTxtRecordMeta] -type dnsRecordListResponseDNSRecordsTxtRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsTxtRecordMeta] +type dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8695,14 +8713,14 @@ func (r *DNSRecordListResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsTxtRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsTxtRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsTxtRecordTTL() +// [DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsTxtRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsTxtRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8711,22 +8729,22 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsTxtRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordListResponseDNSRecordsTxtRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber = 1 ) -type DNSRecordListResponseDNSRecordsUriRecord struct { +type DNSRecordGetResponseDNSRecordsUriRecord struct { // Components of a URI record. - Data DNSRecordListResponseDNSRecordsUriRecordData `json:"data,required"` + Data DNSRecordGetResponseDNSRecordsUriRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Required for MX, SRV and URI records; unused by other record types. Records with // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordListResponseDNSRecordsUriRecordType `json:"type,required"` + Type DNSRecordGetResponseDNSRecordsUriRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8740,7 +8758,7 @@ type DNSRecordListResponseDNSRecordsUriRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordListResponseDNSRecordsUriRecordMeta `json:"meta"` + Meta DNSRecordGetResponseDNSRecordsUriRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8750,17 +8768,17 @@ type DNSRecordListResponseDNSRecordsUriRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordListResponseDNSRecordsUriRecordTTL `json:"ttl"` + TTL DNSRecordGetResponseDNSRecordsUriRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordListResponseDNSRecordsUriRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordGetResponseDNSRecordsUriRecordJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsUriRecordJSON contains the JSON metadata for the -// struct [DNSRecordListResponseDNSRecordsUriRecord] -type dnsRecordListResponseDNSRecordsUriRecordJSON struct { +// dnsRecordGetResponseDNSRecordsUriRecordJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseDNSRecordsUriRecord] +type dnsRecordGetResponseDNSRecordsUriRecordJSON struct { Data apijson.Field Name apijson.Field Priority apijson.Field @@ -8781,61 +8799,61 @@ type dnsRecordListResponseDNSRecordsUriRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordListResponseDNSRecordsUriRecord) implementsDNSRecordListResponse() {} +func (r DNSRecordGetResponseDNSRecordsUriRecord) implementsDNSRecordGetResponse() {} // Components of a URI record. -type DNSRecordListResponseDNSRecordsUriRecordData struct { +type DNSRecordGetResponseDNSRecordsUriRecordData struct { // The record content. Content string `json:"content"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordListResponseDNSRecordsUriRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordGetResponseDNSRecordsUriRecordDataJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsUriRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsUriRecordData] -type dnsRecordListResponseDNSRecordsUriRecordDataJSON struct { +// dnsRecordGetResponseDNSRecordsUriRecordDataJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsUriRecordData] +type dnsRecordGetResponseDNSRecordsUriRecordDataJSON struct { Content apijson.Field Weight apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordListResponseDNSRecordsUriRecordType string +type DNSRecordGetResponseDNSRecordsUriRecordType string const ( - DNSRecordListResponseDNSRecordsUriRecordTypeUri DNSRecordListResponseDNSRecordsUriRecordType = "URI" + DNSRecordGetResponseDNSRecordsUriRecordTypeUri DNSRecordGetResponseDNSRecordsUriRecordType = "URI" ) // Extra Cloudflare-specific information about the record. -type DNSRecordListResponseDNSRecordsUriRecordMeta struct { +type DNSRecordGetResponseDNSRecordsUriRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordListResponseDNSRecordsUriRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordGetResponseDNSRecordsUriRecordMetaJSON `json:"-"` } -// dnsRecordListResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordListResponseDNSRecordsUriRecordMeta] -type dnsRecordListResponseDNSRecordsUriRecordMetaJSON struct { +// dnsRecordGetResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordGetResponseDNSRecordsUriRecordMeta] +type dnsRecordGetResponseDNSRecordsUriRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordListResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordGetResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -8844,14 +8862,14 @@ func (r *DNSRecordListResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordListResponseDNSRecordsUriRecordTTLNumber]. -type DNSRecordListResponseDNSRecordsUriRecordTTL interface { - ImplementsDNSRecordListResponseDNSRecordsUriRecordTTL() +// [DNSRecordGetResponseDNSRecordsUriRecordTTLNumber]. +type DNSRecordGetResponseDNSRecordsUriRecordTTL interface { + ImplementsDNSRecordGetResponseDNSRecordsUriRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordListResponseDNSRecordsUriRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordGetResponseDNSRecordsUriRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -8860,65 +8878,68 @@ func init() { ) } -type DNSRecordListResponseDNSRecordsUriRecordTTLNumber float64 +type DNSRecordGetResponseDNSRecordsUriRecordTTLNumber float64 const ( - DNSRecordListResponseDNSRecordsUriRecordTTLNumber1 DNSRecordListResponseDNSRecordsUriRecordTTLNumber = 1 + DNSRecordGetResponseDNSRecordsUriRecordTTLNumber1 DNSRecordGetResponseDNSRecordsUriRecordTTLNumber = 1 ) -type DNSRecordDeleteResponse struct { - // Identifier - ID string `json:"id"` - JSON dnsRecordDeleteResponseJSON `json:"-"` +type DNSRecordImportResponse struct { + // Number of DNS records added. + RecsAdded float64 `json:"recs_added"` + // Total number of DNS records parsed. + TotalRecordsParsed float64 `json:"total_records_parsed"` + JSON dnsRecordImportResponseJSON `json:"-"` } -// dnsRecordDeleteResponseJSON contains the JSON metadata for the struct -// [DNSRecordDeleteResponse] -type dnsRecordDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field +// dnsRecordImportResponseJSON contains the JSON metadata for the struct +// [DNSRecordImportResponse] +type dnsRecordImportResponseJSON struct { + RecsAdded apijson.Field + TotalRecordsParsed apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *DNSRecordDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordImportResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [DNSRecordGetResponseDNSRecordsARecord], -// [DNSRecordGetResponseDNSRecordsAaaaRecord], -// [DNSRecordGetResponseDNSRecordsCaaRecord], -// [DNSRecordGetResponseDNSRecordsCertRecord], -// [DNSRecordGetResponseDNSRecordsCnameRecord], -// [DNSRecordGetResponseDNSRecordsDnskeyRecord], -// [DNSRecordGetResponseDNSRecordsDsRecord], -// [DNSRecordGetResponseDNSRecordsHTTPSRecord], -// [DNSRecordGetResponseDNSRecordsLocRecord], -// [DNSRecordGetResponseDNSRecordsMxRecord], -// [DNSRecordGetResponseDNSRecordsNaptrRecord], -// [DNSRecordGetResponseDNSRecordsNsRecord], -// [DNSRecordGetResponseDNSRecordsPtrRecord], -// [DNSRecordGetResponseDNSRecordsSmimeaRecord], -// [DNSRecordGetResponseDNSRecordsSrvRecord], -// [DNSRecordGetResponseDNSRecordsSshfpRecord], -// [DNSRecordGetResponseDNSRecordsSvcbRecord], -// [DNSRecordGetResponseDNSRecordsTlsaRecord], -// [DNSRecordGetResponseDNSRecordsTxtRecord] or -// [DNSRecordGetResponseDNSRecordsUriRecord]. -type DNSRecordGetResponse interface { - implementsDNSRecordGetResponse() +// Union satisfied by [DNSRecordReplaceResponseDNSRecordsARecord], +// [DNSRecordReplaceResponseDNSRecordsAaaaRecord], +// [DNSRecordReplaceResponseDNSRecordsCaaRecord], +// [DNSRecordReplaceResponseDNSRecordsCertRecord], +// [DNSRecordReplaceResponseDNSRecordsCnameRecord], +// [DNSRecordReplaceResponseDNSRecordsDnskeyRecord], +// [DNSRecordReplaceResponseDNSRecordsDsRecord], +// [DNSRecordReplaceResponseDNSRecordsHTTPSRecord], +// [DNSRecordReplaceResponseDNSRecordsLocRecord], +// [DNSRecordReplaceResponseDNSRecordsMxRecord], +// [DNSRecordReplaceResponseDNSRecordsNaptrRecord], +// [DNSRecordReplaceResponseDNSRecordsNsRecord], +// [DNSRecordReplaceResponseDNSRecordsPtrRecord], +// [DNSRecordReplaceResponseDNSRecordsSmimeaRecord], +// [DNSRecordReplaceResponseDNSRecordsSrvRecord], +// [DNSRecordReplaceResponseDNSRecordsSshfpRecord], +// [DNSRecordReplaceResponseDNSRecordsSvcbRecord], +// [DNSRecordReplaceResponseDNSRecordsTlsaRecord], +// [DNSRecordReplaceResponseDNSRecordsTxtRecord] or +// [DNSRecordReplaceResponseDNSRecordsUriRecord]. +type DNSRecordReplaceResponse interface { + implementsDNSRecordReplaceResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*DNSRecordGetResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*DNSRecordReplaceResponse)(nil)).Elem(), "") } -type DNSRecordGetResponseDNSRecordsARecord struct { +type DNSRecordReplaceResponseDNSRecordsARecord struct { // A valid IPv4 address. Content string `json:"content,required" format:"ipv4"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsARecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsARecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -8930,7 +8951,7 @@ type DNSRecordGetResponseDNSRecordsARecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsARecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsARecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -8943,17 +8964,17 @@ type DNSRecordGetResponseDNSRecordsARecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsARecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsARecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsARecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsARecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsARecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsARecord] -type dnsRecordGetResponseDNSRecordsARecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsARecordJSON contains the JSON metadata for the +// struct [DNSRecordReplaceResponseDNSRecordsARecord] +type dnsRecordReplaceResponseDNSRecordsARecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -8973,39 +8994,39 @@ type dnsRecordGetResponseDNSRecordsARecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsARecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsARecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsARecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsARecordType string +type DNSRecordReplaceResponseDNSRecordsARecordType string const ( - DNSRecordGetResponseDNSRecordsARecordTypeA DNSRecordGetResponseDNSRecordsARecordType = "A" + DNSRecordReplaceResponseDNSRecordsARecordTypeA DNSRecordReplaceResponseDNSRecordsARecordType = "A" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsARecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsARecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsARecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsARecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsARecordMetaJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsARecordMeta] -type dnsRecordGetResponseDNSRecordsARecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsARecordMetaJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsARecordMeta] +type dnsRecordReplaceResponseDNSRecordsARecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9014,14 +9035,14 @@ func (r *DNSRecordGetResponseDNSRecordsARecordMeta) UnmarshalJSON(data []byte) ( // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsARecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsARecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsARecordTTL() +// [DNSRecordReplaceResponseDNSRecordsARecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsARecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsARecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsARecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsARecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9030,19 +9051,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsARecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsARecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsARecordTTLNumber1 DNSRecordGetResponseDNSRecordsARecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsARecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsARecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsAaaaRecord struct { +type DNSRecordReplaceResponseDNSRecordsAaaaRecord struct { // A valid IPv6 address. Content string `json:"content,required" format:"ipv6"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsAaaaRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsAaaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9054,7 +9075,7 @@ type DNSRecordGetResponseDNSRecordsAaaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsAaaaRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsAaaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9067,17 +9088,17 @@ type DNSRecordGetResponseDNSRecordsAaaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsAaaaRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsAaaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsAaaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsAaaaRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsAaaaRecord] -type dnsRecordGetResponseDNSRecordsAaaaRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsAaaaRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsAaaaRecord] +type dnsRecordReplaceResponseDNSRecordsAaaaRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -9097,39 +9118,39 @@ type dnsRecordGetResponseDNSRecordsAaaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsAaaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsAaaaRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsAaaaRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsAaaaRecordType string +type DNSRecordReplaceResponseDNSRecordsAaaaRecordType string const ( - DNSRecordGetResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordGetResponseDNSRecordsAaaaRecordType = "AAAA" + DNSRecordReplaceResponseDNSRecordsAaaaRecordTypeAaaa DNSRecordReplaceResponseDNSRecordsAaaaRecordType = "AAAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsAaaaRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsAaaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsAaaaRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsAaaaRecordMeta] -type dnsRecordGetResponseDNSRecordsAaaaRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsAaaaRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsAaaaRecordMeta] +type dnsRecordReplaceResponseDNSRecordsAaaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9138,14 +9159,14 @@ func (r *DNSRecordGetResponseDNSRecordsAaaaRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsAaaaRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsAaaaRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsAaaaRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsAaaaRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsAaaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsAaaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9154,19 +9175,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsAaaaRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsAaaaRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsAaaaRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsAaaaRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsCaaRecord struct { +type DNSRecordReplaceResponseDNSRecordsCaaRecord struct { // Components of a CAA record. - Data DNSRecordGetResponseDNSRecordsCaaRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsCaaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsCaaRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsCaaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9180,7 +9201,7 @@ type DNSRecordGetResponseDNSRecordsCaaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsCaaRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsCaaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9190,17 +9211,17 @@ type DNSRecordGetResponseDNSRecordsCaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsCaaRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsCaaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsCaaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsCaaRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCaaRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsCaaRecord] -type dnsRecordGetResponseDNSRecordsCaaRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsCaaRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsCaaRecord] +type dnsRecordReplaceResponseDNSRecordsCaaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -9220,26 +9241,26 @@ type dnsRecordGetResponseDNSRecordsCaaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCaaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsCaaRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsCaaRecord) implementsDNSRecordReplaceResponse() {} // Components of a CAA record. -type DNSRecordGetResponseDNSRecordsCaaRecordData struct { +type DNSRecordReplaceResponseDNSRecordsCaaRecordData struct { // Flags for the CAA record. Flags float64 `json:"flags"` // Name of the property controlled by this record (e.g.: issue, issuewild, iodef). Tag string `json:"tag"` // Value of the record. This field's semantics depend on the chosen tag. - Value string `json:"value"` - JSON dnsRecordGetResponseDNSRecordsCaaRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordReplaceResponseDNSRecordsCaaRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsCaaRecordData] -type dnsRecordGetResponseDNSRecordsCaaRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsCaaRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsCaaRecordData] +type dnsRecordReplaceResponseDNSRecordsCaaRecordDataJSON struct { Flags apijson.Field Tag apijson.Field Value apijson.Field @@ -9247,37 +9268,37 @@ type dnsRecordGetResponseDNSRecordsCaaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCaaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsCaaRecordType string +type DNSRecordReplaceResponseDNSRecordsCaaRecordType string const ( - DNSRecordGetResponseDNSRecordsCaaRecordTypeCaa DNSRecordGetResponseDNSRecordsCaaRecordType = "CAA" + DNSRecordReplaceResponseDNSRecordsCaaRecordTypeCaa DNSRecordReplaceResponseDNSRecordsCaaRecordType = "CAA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsCaaRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsCaaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsCaaRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsCaaRecordMeta] -type dnsRecordGetResponseDNSRecordsCaaRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsCaaRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsCaaRecordMeta] +type dnsRecordReplaceResponseDNSRecordsCaaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9286,14 +9307,14 @@ func (r *DNSRecordGetResponseDNSRecordsCaaRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsCaaRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsCaaRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsCaaRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsCaaRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsCaaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsCaaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9302,19 +9323,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsCaaRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCaaRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsCaaRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsCaaRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsCertRecord struct { +type DNSRecordReplaceResponseDNSRecordsCertRecord struct { // Components of a CERT record. - Data DNSRecordGetResponseDNSRecordsCertRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsCertRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsCertRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsCertRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9328,7 +9349,7 @@ type DNSRecordGetResponseDNSRecordsCertRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsCertRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsCertRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9338,17 +9359,17 @@ type DNSRecordGetResponseDNSRecordsCertRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsCertRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsCertRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsCertRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsCertRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCertRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsCertRecord] -type dnsRecordGetResponseDNSRecordsCertRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsCertRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsCertRecord] +type dnsRecordReplaceResponseDNSRecordsCertRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -9368,14 +9389,14 @@ type dnsRecordGetResponseDNSRecordsCertRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCertRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsCertRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsCertRecord) implementsDNSRecordReplaceResponse() {} // Components of a CERT record. -type DNSRecordGetResponseDNSRecordsCertRecordData struct { +type DNSRecordReplaceResponseDNSRecordsCertRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Certificate. @@ -9383,13 +9404,13 @@ type DNSRecordGetResponseDNSRecordsCertRecordData struct { // Key Tag. KeyTag float64 `json:"key_tag"` // Type. - Type float64 `json:"type"` - JSON dnsRecordGetResponseDNSRecordsCertRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordReplaceResponseDNSRecordsCertRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCertRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsCertRecordData] -type dnsRecordGetResponseDNSRecordsCertRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsCertRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsCertRecordData] +type dnsRecordReplaceResponseDNSRecordsCertRecordDataJSON struct { Algorithm apijson.Field Certificate apijson.Field KeyTag apijson.Field @@ -9398,37 +9419,37 @@ type dnsRecordGetResponseDNSRecordsCertRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCertRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsCertRecordType string +type DNSRecordReplaceResponseDNSRecordsCertRecordType string const ( - DNSRecordGetResponseDNSRecordsCertRecordTypeCert DNSRecordGetResponseDNSRecordsCertRecordType = "CERT" + DNSRecordReplaceResponseDNSRecordsCertRecordTypeCert DNSRecordReplaceResponseDNSRecordsCertRecordType = "CERT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsCertRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsCertRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsCertRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsCertRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsCertRecordMeta] -type dnsRecordGetResponseDNSRecordsCertRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsCertRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsCertRecordMeta] +type dnsRecordReplaceResponseDNSRecordsCertRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9437,14 +9458,14 @@ func (r *DNSRecordGetResponseDNSRecordsCertRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsCertRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsCertRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsCertRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsCertRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsCertRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsCertRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCertRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsCertRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9453,19 +9474,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsCertRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsCertRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsCertRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCertRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsCertRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsCertRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsCnameRecord struct { +type DNSRecordReplaceResponseDNSRecordsCnameRecord struct { // A valid hostname. Must not match the record's name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsCnameRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsCnameRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9477,7 +9498,7 @@ type DNSRecordGetResponseDNSRecordsCnameRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsCnameRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsCnameRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9490,17 +9511,17 @@ type DNSRecordGetResponseDNSRecordsCnameRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsCnameRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsCnameRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsCnameRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsCnameRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCnameRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsCnameRecord] -type dnsRecordGetResponseDNSRecordsCnameRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsCnameRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsCnameRecord] +type dnsRecordReplaceResponseDNSRecordsCnameRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -9520,39 +9541,39 @@ type dnsRecordGetResponseDNSRecordsCnameRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCnameRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsCnameRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsCnameRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsCnameRecordType string +type DNSRecordReplaceResponseDNSRecordsCnameRecordType string const ( - DNSRecordGetResponseDNSRecordsCnameRecordTypeCname DNSRecordGetResponseDNSRecordsCnameRecordType = "CNAME" + DNSRecordReplaceResponseDNSRecordsCnameRecordTypeCname DNSRecordReplaceResponseDNSRecordsCnameRecordType = "CNAME" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsCnameRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsCnameRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsCnameRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsCnameRecordMeta] -type dnsRecordGetResponseDNSRecordsCnameRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsCnameRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsCnameRecordMeta] +type dnsRecordReplaceResponseDNSRecordsCnameRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9561,14 +9582,14 @@ func (r *DNSRecordGetResponseDNSRecordsCnameRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsCnameRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsCnameRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsCnameRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsCnameRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsCnameRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsCnameRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9577,19 +9598,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsCnameRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordGetResponseDNSRecordsCnameRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsCnameRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsCnameRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsDnskeyRecord struct { +type DNSRecordReplaceResponseDNSRecordsDnskeyRecord struct { // Components of a DNSKEY record. - Data DNSRecordGetResponseDNSRecordsDnskeyRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsDnskeyRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsDnskeyRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsDnskeyRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9603,7 +9624,7 @@ type DNSRecordGetResponseDNSRecordsDnskeyRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsDnskeyRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsDnskeyRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9613,17 +9634,17 @@ type DNSRecordGetResponseDNSRecordsDnskeyRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsDnskeyRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsDnskeyRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsDnskeyRecord] -type dnsRecordGetResponseDNSRecordsDnskeyRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsDnskeyRecordJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsDnskeyRecord] +type dnsRecordReplaceResponseDNSRecordsDnskeyRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -9643,14 +9664,14 @@ type dnsRecordGetResponseDNSRecordsDnskeyRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDnskeyRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsDnskeyRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsDnskeyRecord) implementsDNSRecordReplaceResponse() {} // Components of a DNSKEY record. -type DNSRecordGetResponseDNSRecordsDnskeyRecordData struct { +type DNSRecordReplaceResponseDNSRecordsDnskeyRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Flags. @@ -9658,13 +9679,13 @@ type DNSRecordGetResponseDNSRecordsDnskeyRecordData struct { // Protocol. Protocol float64 `json:"protocol"` // Public Key. - PublicKey string `json:"public_key"` - JSON dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` + PublicKey string `json:"public_key"` + JSON dnsRecordReplaceResponseDNSRecordsDnskeyRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordGetResponseDNSRecordsDnskeyRecordData] -type dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsDnskeyRecordDataJSON contains the JSON +// metadata for the struct [DNSRecordReplaceResponseDNSRecordsDnskeyRecordData] +type dnsRecordReplaceResponseDNSRecordsDnskeyRecordDataJSON struct { Algorithm apijson.Field Flags apijson.Field Protocol apijson.Field @@ -9673,37 +9694,37 @@ type dnsRecordGetResponseDNSRecordsDnskeyRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDnskeyRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsDnskeyRecordType string +type DNSRecordReplaceResponseDNSRecordsDnskeyRecordType string const ( - DNSRecordGetResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordGetResponseDNSRecordsDnskeyRecordType = "DNSKEY" + DNSRecordReplaceResponseDNSRecordsDnskeyRecordTypeDnskey DNSRecordReplaceResponseDNSRecordsDnskeyRecordType = "DNSKEY" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsDnskeyRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsDnskeyRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsDnskeyRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordGetResponseDNSRecordsDnskeyRecordMeta] -type dnsRecordGetResponseDNSRecordsDnskeyRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsDnskeyRecordMetaJSON contains the JSON +// metadata for the struct [DNSRecordReplaceResponseDNSRecordsDnskeyRecordMeta] +type dnsRecordReplaceResponseDNSRecordsDnskeyRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9712,14 +9733,14 @@ func (r *DNSRecordGetResponseDNSRecordsDnskeyRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsDnskeyRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsDnskeyRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsDnskeyRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9728,19 +9749,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordGetResponseDNSRecordsDnskeyRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsDnskeyRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsDsRecord struct { +type DNSRecordReplaceResponseDNSRecordsDsRecord struct { // Components of a DS record. - Data DNSRecordGetResponseDNSRecordsDsRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsDsRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsDsRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsDsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9754,7 +9775,7 @@ type DNSRecordGetResponseDNSRecordsDsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsDsRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsDsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9764,17 +9785,17 @@ type DNSRecordGetResponseDNSRecordsDsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsDsRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsDsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsDsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsDsRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDsRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsDsRecord] -type dnsRecordGetResponseDNSRecordsDsRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsDsRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsDsRecord] +type dnsRecordReplaceResponseDNSRecordsDsRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -9794,14 +9815,14 @@ type dnsRecordGetResponseDNSRecordsDsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsDsRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsDsRecord) implementsDNSRecordReplaceResponse() {} // Components of a DS record. -type DNSRecordGetResponseDNSRecordsDsRecordData struct { +type DNSRecordReplaceResponseDNSRecordsDsRecordData struct { // Algorithm. Algorithm float64 `json:"algorithm"` // Digest. @@ -9809,13 +9830,13 @@ type DNSRecordGetResponseDNSRecordsDsRecordData struct { // Digest Type. DigestType float64 `json:"digest_type"` // Key Tag. - KeyTag float64 `json:"key_tag"` - JSON dnsRecordGetResponseDNSRecordsDsRecordDataJSON `json:"-"` + KeyTag float64 `json:"key_tag"` + JSON dnsRecordReplaceResponseDNSRecordsDsRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDsRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsDsRecordData] -type dnsRecordGetResponseDNSRecordsDsRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsDsRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsDsRecordData] +type dnsRecordReplaceResponseDNSRecordsDsRecordDataJSON struct { Algorithm apijson.Field Digest apijson.Field DigestType apijson.Field @@ -9824,37 +9845,37 @@ type dnsRecordGetResponseDNSRecordsDsRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDsRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsDsRecordType string +type DNSRecordReplaceResponseDNSRecordsDsRecordType string const ( - DNSRecordGetResponseDNSRecordsDsRecordTypeDs DNSRecordGetResponseDNSRecordsDsRecordType = "DS" + DNSRecordReplaceResponseDNSRecordsDsRecordTypeDs DNSRecordReplaceResponseDNSRecordsDsRecordType = "DS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsDsRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsDsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsDsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsDsRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsDsRecordMeta] -type dnsRecordGetResponseDNSRecordsDsRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsDsRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsDsRecordMeta] +type dnsRecordReplaceResponseDNSRecordsDsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -9863,14 +9884,14 @@ func (r *DNSRecordGetResponseDNSRecordsDsRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsDsRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsDsRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsDsRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsDsRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsDsRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsDsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsDsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsDsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -9879,19 +9900,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsDsRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsDsRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsDsRecordTTLNumber1 DNSRecordGetResponseDNSRecordsDsRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsDsRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsDsRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsHTTPSRecord struct { +type DNSRecordReplaceResponseDNSRecordsHTTPSRecord struct { // Components of a HTTPS record. - Data DNSRecordGetResponseDNSRecordsHTTPSRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsHTTPSRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsHTTPSRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsHTTPSRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -9905,7 +9926,7 @@ type DNSRecordGetResponseDNSRecordsHTTPSRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsHTTPSRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsHTTPSRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -9915,17 +9936,17 @@ type DNSRecordGetResponseDNSRecordsHTTPSRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsHTTPSRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsHTTPSRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsHTTPSRecord] -type dnsRecordGetResponseDNSRecordsHTTPSRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsHTTPSRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsHTTPSRecord] +type dnsRecordReplaceResponseDNSRecordsHTTPSRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -9945,26 +9966,26 @@ type dnsRecordGetResponseDNSRecordsHTTPSRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsHTTPSRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsHTTPSRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsHTTPSRecord) implementsDNSRecordReplaceResponse() {} // Components of a HTTPS record. -type DNSRecordGetResponseDNSRecordsHTTPSRecordData struct { +type DNSRecordReplaceResponseDNSRecordsHTTPSRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordReplaceResponseDNSRecordsHTTPSRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsHTTPSRecordData] -type dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsHTTPSRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsHTTPSRecordData] +type dnsRecordReplaceResponseDNSRecordsHTTPSRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -9972,37 +9993,37 @@ type dnsRecordGetResponseDNSRecordsHTTPSRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsHTTPSRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsHTTPSRecordType string +type DNSRecordReplaceResponseDNSRecordsHTTPSRecordType string const ( - DNSRecordGetResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordGetResponseDNSRecordsHTTPSRecordType = "HTTPS" + DNSRecordReplaceResponseDNSRecordsHTTPSRecordTypeHTTPS DNSRecordReplaceResponseDNSRecordsHTTPSRecordType = "HTTPS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsHTTPSRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsHTTPSRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsHTTPSRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsHTTPSRecordMeta] -type dnsRecordGetResponseDNSRecordsHTTPSRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsHTTPSRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsHTTPSRecordMeta] +type dnsRecordReplaceResponseDNSRecordsHTTPSRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10011,14 +10032,14 @@ func (r *DNSRecordGetResponseDNSRecordsHTTPSRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsHTTPSRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsHTTPSRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsHTTPSRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10027,19 +10048,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordGetResponseDNSRecordsHTTPSRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsHTTPSRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsLocRecord struct { +type DNSRecordReplaceResponseDNSRecordsLocRecord struct { // Components of a LOC record. - Data DNSRecordGetResponseDNSRecordsLocRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsLocRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsLocRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsLocRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10053,7 +10074,7 @@ type DNSRecordGetResponseDNSRecordsLocRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsLocRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsLocRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10063,17 +10084,17 @@ type DNSRecordGetResponseDNSRecordsLocRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsLocRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsLocRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsLocRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsLocRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsLocRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsLocRecord] -type dnsRecordGetResponseDNSRecordsLocRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsLocRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsLocRecord] +type dnsRecordReplaceResponseDNSRecordsLocRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -10093,20 +10114,20 @@ type dnsRecordGetResponseDNSRecordsLocRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsLocRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsLocRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsLocRecord) implementsDNSRecordReplaceResponse() {} // Components of a LOC record. -type DNSRecordGetResponseDNSRecordsLocRecordData struct { +type DNSRecordReplaceResponseDNSRecordsLocRecordData struct { // Altitude of location in meters. Altitude float64 `json:"altitude"` // Degrees of latitude. LatDegrees float64 `json:"lat_degrees"` // Latitude direction. - LatDirection DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` + LatDirection DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirection `json:"lat_direction"` // Minutes of latitude. LatMinutes float64 `json:"lat_minutes"` // Seconds of latitude. @@ -10114,7 +10135,7 @@ type DNSRecordGetResponseDNSRecordsLocRecordData struct { // Degrees of longitude. LongDegrees float64 `json:"long_degrees"` // Longitude direction. - LongDirection DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` + LongDirection DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirection `json:"long_direction"` // Minutes of longitude. LongMinutes float64 `json:"long_minutes"` // Seconds of longitude. @@ -10124,13 +10145,13 @@ type DNSRecordGetResponseDNSRecordsLocRecordData struct { // Vertical precision of location. PrecisionVert float64 `json:"precision_vert"` // Size of location in meters. - Size float64 `json:"size"` - JSON dnsRecordGetResponseDNSRecordsLocRecordDataJSON `json:"-"` + Size float64 `json:"size"` + JSON dnsRecordReplaceResponseDNSRecordsLocRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsLocRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsLocRecordData] -type dnsRecordGetResponseDNSRecordsLocRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsLocRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsLocRecordData] +type dnsRecordReplaceResponseDNSRecordsLocRecordDataJSON struct { Altitude apijson.Field LatDegrees apijson.Field LatDirection apijson.Field @@ -10147,53 +10168,53 @@ type dnsRecordGetResponseDNSRecordsLocRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsLocRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Latitude direction. -type DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection string +type DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirection string const ( - DNSRecordGetResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection = "N" - DNSRecordGetResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordGetResponseDNSRecordsLocRecordDataLatDirection = "S" + DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirectionN DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirection = "N" + DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirectionS DNSRecordReplaceResponseDNSRecordsLocRecordDataLatDirection = "S" ) // Longitude direction. -type DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection string +type DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirection string const ( - DNSRecordGetResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection = "E" - DNSRecordGetResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordGetResponseDNSRecordsLocRecordDataLongDirection = "W" + DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirectionE DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirection = "E" + DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirectionW DNSRecordReplaceResponseDNSRecordsLocRecordDataLongDirection = "W" ) // Record type. -type DNSRecordGetResponseDNSRecordsLocRecordType string +type DNSRecordReplaceResponseDNSRecordsLocRecordType string const ( - DNSRecordGetResponseDNSRecordsLocRecordTypeLoc DNSRecordGetResponseDNSRecordsLocRecordType = "LOC" + DNSRecordReplaceResponseDNSRecordsLocRecordTypeLoc DNSRecordReplaceResponseDNSRecordsLocRecordType = "LOC" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsLocRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsLocRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsLocRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsLocRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsLocRecordMeta] -type dnsRecordGetResponseDNSRecordsLocRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsLocRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsLocRecordMeta] +type dnsRecordReplaceResponseDNSRecordsLocRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10202,14 +10223,14 @@ func (r *DNSRecordGetResponseDNSRecordsLocRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsLocRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsLocRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsLocRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsLocRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsLocRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsLocRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsLocRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsLocRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10218,13 +10239,13 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsLocRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsLocRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsLocRecordTTLNumber1 DNSRecordGetResponseDNSRecordsLocRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsLocRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsLocRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsMxRecord struct { +type DNSRecordReplaceResponseDNSRecordsMxRecord struct { // A valid mail server hostname. Content string `json:"content,required" format:"hostname"` // DNS record name (or @ for the zone apex) in Punycode. @@ -10233,7 +10254,7 @@ type DNSRecordGetResponseDNSRecordsMxRecord struct { // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsMxRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsMxRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10245,7 +10266,7 @@ type DNSRecordGetResponseDNSRecordsMxRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsMxRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsMxRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10255,17 +10276,17 @@ type DNSRecordGetResponseDNSRecordsMxRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsMxRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsMxRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsMxRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsMxRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsMxRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsMxRecord] -type dnsRecordGetResponseDNSRecordsMxRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsMxRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsMxRecord] +type dnsRecordReplaceResponseDNSRecordsMxRecordJSON struct { Content apijson.Field Name apijson.Field Priority apijson.Field @@ -10285,39 +10306,39 @@ type dnsRecordGetResponseDNSRecordsMxRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsMxRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsMxRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsMxRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsMxRecordType string +type DNSRecordReplaceResponseDNSRecordsMxRecordType string const ( - DNSRecordGetResponseDNSRecordsMxRecordTypeMx DNSRecordGetResponseDNSRecordsMxRecordType = "MX" + DNSRecordReplaceResponseDNSRecordsMxRecordTypeMx DNSRecordReplaceResponseDNSRecordsMxRecordType = "MX" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsMxRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsMxRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsMxRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsMxRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsMxRecordMeta] -type dnsRecordGetResponseDNSRecordsMxRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsMxRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsMxRecordMeta] +type dnsRecordReplaceResponseDNSRecordsMxRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10326,14 +10347,14 @@ func (r *DNSRecordGetResponseDNSRecordsMxRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsMxRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsMxRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsMxRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsMxRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsMxRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsMxRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsMxRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsMxRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10342,19 +10363,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsMxRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsMxRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsMxRecordTTLNumber1 DNSRecordGetResponseDNSRecordsMxRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsMxRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsMxRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsNaptrRecord struct { +type DNSRecordReplaceResponseDNSRecordsNaptrRecord struct { // Components of a NAPTR record. - Data DNSRecordGetResponseDNSRecordsNaptrRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsNaptrRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsNaptrRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsNaptrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10368,7 +10389,7 @@ type DNSRecordGetResponseDNSRecordsNaptrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsNaptrRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsNaptrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10378,17 +10399,17 @@ type DNSRecordGetResponseDNSRecordsNaptrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsNaptrRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsNaptrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsNaptrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsNaptrRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsNaptrRecord] -type dnsRecordGetResponseDNSRecordsNaptrRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsNaptrRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsNaptrRecord] +type dnsRecordReplaceResponseDNSRecordsNaptrRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -10408,14 +10429,14 @@ type dnsRecordGetResponseDNSRecordsNaptrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsNaptrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsNaptrRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsNaptrRecord) implementsDNSRecordReplaceResponse() {} // Components of a NAPTR record. -type DNSRecordGetResponseDNSRecordsNaptrRecordData struct { +type DNSRecordReplaceResponseDNSRecordsNaptrRecordData struct { // Flags. Flags string `json:"flags"` // Order. @@ -10427,13 +10448,13 @@ type DNSRecordGetResponseDNSRecordsNaptrRecordData struct { // Replacement. Replacement string `json:"replacement"` // Service. - Service string `json:"service"` - JSON dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON `json:"-"` + Service string `json:"service"` + JSON dnsRecordReplaceResponseDNSRecordsNaptrRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsNaptrRecordData] -type dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsNaptrRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsNaptrRecordData] +type dnsRecordReplaceResponseDNSRecordsNaptrRecordDataJSON struct { Flags apijson.Field Order apijson.Field Preference apijson.Field @@ -10444,37 +10465,37 @@ type dnsRecordGetResponseDNSRecordsNaptrRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsNaptrRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsNaptrRecordType string +type DNSRecordReplaceResponseDNSRecordsNaptrRecordType string const ( - DNSRecordGetResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordGetResponseDNSRecordsNaptrRecordType = "NAPTR" + DNSRecordReplaceResponseDNSRecordsNaptrRecordTypeNaptr DNSRecordReplaceResponseDNSRecordsNaptrRecordType = "NAPTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsNaptrRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsNaptrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsNaptrRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsNaptrRecordMeta] -type dnsRecordGetResponseDNSRecordsNaptrRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsNaptrRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsNaptrRecordMeta] +type dnsRecordReplaceResponseDNSRecordsNaptrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10483,14 +10504,14 @@ func (r *DNSRecordGetResponseDNSRecordsNaptrRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsNaptrRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsNaptrRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsNaptrRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsNaptrRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsNaptrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsNaptrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10499,19 +10520,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsNaptrRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordGetResponseDNSRecordsNaptrRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsNaptrRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsNaptrRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsNsRecord struct { +type DNSRecordReplaceResponseDNSRecordsNsRecord struct { // A valid name server host name. Content interface{} `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsNsRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsNsRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10523,7 +10544,7 @@ type DNSRecordGetResponseDNSRecordsNsRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsNsRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsNsRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10533,17 +10554,17 @@ type DNSRecordGetResponseDNSRecordsNsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsNsRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsNsRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsNsRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsNsRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsNsRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsNsRecord] -type dnsRecordGetResponseDNSRecordsNsRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsNsRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsNsRecord] +type dnsRecordReplaceResponseDNSRecordsNsRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -10562,39 +10583,39 @@ type dnsRecordGetResponseDNSRecordsNsRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsNsRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsNsRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsNsRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsNsRecordType string +type DNSRecordReplaceResponseDNSRecordsNsRecordType string const ( - DNSRecordGetResponseDNSRecordsNsRecordTypeNs DNSRecordGetResponseDNSRecordsNsRecordType = "NS" + DNSRecordReplaceResponseDNSRecordsNsRecordTypeNs DNSRecordReplaceResponseDNSRecordsNsRecordType = "NS" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsNsRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsNsRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsNsRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsNsRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsNsRecordMeta] -type dnsRecordGetResponseDNSRecordsNsRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsNsRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsNsRecordMeta] +type dnsRecordReplaceResponseDNSRecordsNsRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10603,14 +10624,14 @@ func (r *DNSRecordGetResponseDNSRecordsNsRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsNsRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsNsRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsNsRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsNsRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsNsRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsNsRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsNsRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsNsRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10619,19 +10640,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsNsRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsNsRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsNsRecordTTLNumber1 DNSRecordGetResponseDNSRecordsNsRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsNsRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsNsRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsPtrRecord struct { +type DNSRecordReplaceResponseDNSRecordsPtrRecord struct { // Domain name pointing to the address. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsPtrRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsPtrRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10643,7 +10664,7 @@ type DNSRecordGetResponseDNSRecordsPtrRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsPtrRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsPtrRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10653,17 +10674,17 @@ type DNSRecordGetResponseDNSRecordsPtrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsPtrRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsPtrRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsPtrRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsPtrRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsPtrRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsPtrRecord] -type dnsRecordGetResponseDNSRecordsPtrRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsPtrRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsPtrRecord] +type dnsRecordReplaceResponseDNSRecordsPtrRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -10682,39 +10703,39 @@ type dnsRecordGetResponseDNSRecordsPtrRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsPtrRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsPtrRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsPtrRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsPtrRecordType string +type DNSRecordReplaceResponseDNSRecordsPtrRecordType string const ( - DNSRecordGetResponseDNSRecordsPtrRecordTypePtr DNSRecordGetResponseDNSRecordsPtrRecordType = "PTR" + DNSRecordReplaceResponseDNSRecordsPtrRecordTypePtr DNSRecordReplaceResponseDNSRecordsPtrRecordType = "PTR" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsPtrRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsPtrRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsPtrRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsPtrRecordMeta] -type dnsRecordGetResponseDNSRecordsPtrRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsPtrRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsPtrRecordMeta] +type dnsRecordReplaceResponseDNSRecordsPtrRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10723,14 +10744,14 @@ func (r *DNSRecordGetResponseDNSRecordsPtrRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsPtrRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsPtrRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsPtrRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsPtrRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsPtrRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsPtrRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10739,19 +10760,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsPtrRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordGetResponseDNSRecordsPtrRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsPtrRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsPtrRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsSmimeaRecord struct { +type DNSRecordReplaceResponseDNSRecordsSmimeaRecord struct { // Components of a SMIMEA record. - Data DNSRecordGetResponseDNSRecordsSmimeaRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsSmimeaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsSmimeaRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsSmimeaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10765,7 +10786,7 @@ type DNSRecordGetResponseDNSRecordsSmimeaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsSmimeaRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsSmimeaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10775,17 +10796,17 @@ type DNSRecordGetResponseDNSRecordsSmimeaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsSmimeaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsSmimeaRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSmimeaRecord] -type dnsRecordGetResponseDNSRecordsSmimeaRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsSmimeaRecordJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSmimeaRecord] +type dnsRecordReplaceResponseDNSRecordsSmimeaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -10805,14 +10826,14 @@ type dnsRecordGetResponseDNSRecordsSmimeaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSmimeaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsSmimeaRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsSmimeaRecord) implementsDNSRecordReplaceResponse() {} // Components of a SMIMEA record. -type DNSRecordGetResponseDNSRecordsSmimeaRecordData struct { +type DNSRecordReplaceResponseDNSRecordsSmimeaRecordData struct { // Certificate. Certificate string `json:"certificate"` // Matching Type. @@ -10820,13 +10841,13 @@ type DNSRecordGetResponseDNSRecordsSmimeaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordReplaceResponseDNSRecordsSmimeaRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON contains the JSON metadata -// for the struct [DNSRecordGetResponseDNSRecordsSmimeaRecordData] -type dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsSmimeaRecordDataJSON contains the JSON +// metadata for the struct [DNSRecordReplaceResponseDNSRecordsSmimeaRecordData] +type dnsRecordReplaceResponseDNSRecordsSmimeaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -10835,37 +10856,37 @@ type dnsRecordGetResponseDNSRecordsSmimeaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSmimeaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsSmimeaRecordType string +type DNSRecordReplaceResponseDNSRecordsSmimeaRecordType string const ( - DNSRecordGetResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordGetResponseDNSRecordsSmimeaRecordType = "SMIMEA" + DNSRecordReplaceResponseDNSRecordsSmimeaRecordTypeSmimea DNSRecordReplaceResponseDNSRecordsSmimeaRecordType = "SMIMEA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsSmimeaRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsSmimeaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsSmimeaRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON metadata -// for the struct [DNSRecordGetResponseDNSRecordsSmimeaRecordMeta] -type dnsRecordGetResponseDNSRecordsSmimeaRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsSmimeaRecordMetaJSON contains the JSON +// metadata for the struct [DNSRecordReplaceResponseDNSRecordsSmimeaRecordMeta] +type dnsRecordReplaceResponseDNSRecordsSmimeaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -10874,14 +10895,14 @@ func (r *DNSRecordGetResponseDNSRecordsSmimeaRecordMeta) UnmarshalJSON(data []by // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsSmimeaRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsSmimeaRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsSmimeaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -10890,21 +10911,21 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSmimeaRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsSmimeaRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsSrvRecord struct { +type DNSRecordReplaceResponseDNSRecordsSrvRecord struct { // Components of a SRV record. - Data DNSRecordGetResponseDNSRecordsSrvRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsSrvRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first // label is normally a service and the second a protocol name, each starting with // an underscore. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsSrvRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsSrvRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -10919,7 +10940,7 @@ type DNSRecordGetResponseDNSRecordsSrvRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsSrvRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsSrvRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -10929,17 +10950,17 @@ type DNSRecordGetResponseDNSRecordsSrvRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsSrvRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsSrvRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsSrvRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsSrvRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSrvRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsSrvRecord] -type dnsRecordGetResponseDNSRecordsSrvRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsSrvRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsSrvRecord] +type dnsRecordReplaceResponseDNSRecordsSrvRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -10959,14 +10980,14 @@ type dnsRecordGetResponseDNSRecordsSrvRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSrvRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsSrvRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsSrvRecord) implementsDNSRecordReplaceResponse() {} // Components of a SRV record. -type DNSRecordGetResponseDNSRecordsSrvRecordData struct { +type DNSRecordReplaceResponseDNSRecordsSrvRecordData struct { // A valid hostname. Deprecated in favor of the regular 'name' outside the data // map. This data map field represents the remainder of the full 'name' after the // service and protocol. @@ -10987,13 +11008,13 @@ type DNSRecordGetResponseDNSRecordsSrvRecordData struct { // A valid hostname. Target string `json:"target" format:"hostname"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordGetResponseDNSRecordsSrvRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordReplaceResponseDNSRecordsSrvRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSrvRecordData] -type dnsRecordGetResponseDNSRecordsSrvRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsSrvRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSrvRecordData] +type dnsRecordReplaceResponseDNSRecordsSrvRecordDataJSON struct { Name apijson.Field Port apijson.Field Priority apijson.Field @@ -11005,37 +11026,37 @@ type dnsRecordGetResponseDNSRecordsSrvRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSrvRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsSrvRecordType string +type DNSRecordReplaceResponseDNSRecordsSrvRecordType string const ( - DNSRecordGetResponseDNSRecordsSrvRecordTypeSrv DNSRecordGetResponseDNSRecordsSrvRecordType = "SRV" + DNSRecordReplaceResponseDNSRecordsSrvRecordTypeSrv DNSRecordReplaceResponseDNSRecordsSrvRecordType = "SRV" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsSrvRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsSrvRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsSrvRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSrvRecordMeta] -type dnsRecordGetResponseDNSRecordsSrvRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsSrvRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSrvRecordMeta] +type dnsRecordReplaceResponseDNSRecordsSrvRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11044,14 +11065,14 @@ func (r *DNSRecordGetResponseDNSRecordsSrvRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsSrvRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsSrvRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsSrvRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsSrvRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsSrvRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsSrvRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11060,19 +11081,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsSrvRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSrvRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsSrvRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsSrvRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsSshfpRecord struct { +type DNSRecordReplaceResponseDNSRecordsSshfpRecord struct { // Components of a SSHFP record. - Data DNSRecordGetResponseDNSRecordsSshfpRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsSshfpRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsSshfpRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsSshfpRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -11086,7 +11107,7 @@ type DNSRecordGetResponseDNSRecordsSshfpRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsSshfpRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsSshfpRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -11096,17 +11117,17 @@ type DNSRecordGetResponseDNSRecordsSshfpRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsSshfpRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsSshfpRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsSshfpRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsSshfpRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsSshfpRecord] -type dnsRecordGetResponseDNSRecordsSshfpRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsSshfpRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsSshfpRecord] +type dnsRecordReplaceResponseDNSRecordsSshfpRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -11126,26 +11147,26 @@ type dnsRecordGetResponseDNSRecordsSshfpRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSshfpRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsSshfpRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsSshfpRecord) implementsDNSRecordReplaceResponse() {} // Components of a SSHFP record. -type DNSRecordGetResponseDNSRecordsSshfpRecordData struct { +type DNSRecordReplaceResponseDNSRecordsSshfpRecordData struct { // algorithm. Algorithm float64 `json:"algorithm"` // fingerprint. Fingerprint string `json:"fingerprint"` // type. - Type float64 `json:"type"` - JSON dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON `json:"-"` + Type float64 `json:"type"` + JSON dnsRecordReplaceResponseDNSRecordsSshfpRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSshfpRecordData] -type dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsSshfpRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSshfpRecordData] +type dnsRecordReplaceResponseDNSRecordsSshfpRecordDataJSON struct { Algorithm apijson.Field Fingerprint apijson.Field Type apijson.Field @@ -11153,37 +11174,37 @@ type dnsRecordGetResponseDNSRecordsSshfpRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSshfpRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsSshfpRecordType string +type DNSRecordReplaceResponseDNSRecordsSshfpRecordType string const ( - DNSRecordGetResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordGetResponseDNSRecordsSshfpRecordType = "SSHFP" + DNSRecordReplaceResponseDNSRecordsSshfpRecordTypeSshfp DNSRecordReplaceResponseDNSRecordsSshfpRecordType = "SSHFP" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsSshfpRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsSshfpRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsSshfpRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSshfpRecordMeta] -type dnsRecordGetResponseDNSRecordsSshfpRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsSshfpRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSshfpRecordMeta] +type dnsRecordReplaceResponseDNSRecordsSshfpRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11192,14 +11213,14 @@ func (r *DNSRecordGetResponseDNSRecordsSshfpRecordMeta) UnmarshalJSON(data []byt // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsSshfpRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsSshfpRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsSshfpRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsSshfpRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsSshfpRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsSshfpRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11208,19 +11229,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsSshfpRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSshfpRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsSshfpRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsSshfpRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsSvcbRecord struct { +type DNSRecordReplaceResponseDNSRecordsSvcbRecord struct { // Components of a SVCB record. - Data DNSRecordGetResponseDNSRecordsSvcbRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsSvcbRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsSvcbRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsSvcbRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -11234,7 +11255,7 @@ type DNSRecordGetResponseDNSRecordsSvcbRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsSvcbRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsSvcbRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -11244,17 +11265,17 @@ type DNSRecordGetResponseDNSRecordsSvcbRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsSvcbRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsSvcbRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsSvcbRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsSvcbRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsSvcbRecord] -type dnsRecordGetResponseDNSRecordsSvcbRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsSvcbRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsSvcbRecord] +type dnsRecordReplaceResponseDNSRecordsSvcbRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -11274,26 +11295,26 @@ type dnsRecordGetResponseDNSRecordsSvcbRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSvcbRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsSvcbRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsSvcbRecord) implementsDNSRecordReplaceResponse() {} // Components of a SVCB record. -type DNSRecordGetResponseDNSRecordsSvcbRecordData struct { +type DNSRecordReplaceResponseDNSRecordsSvcbRecordData struct { // priority. Priority float64 `json:"priority"` // target. Target string `json:"target"` // value. - Value string `json:"value"` - JSON dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON `json:"-"` + Value string `json:"value"` + JSON dnsRecordReplaceResponseDNSRecordsSvcbRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSvcbRecordData] -type dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsSvcbRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSvcbRecordData] +type dnsRecordReplaceResponseDNSRecordsSvcbRecordDataJSON struct { Priority apijson.Field Target apijson.Field Value apijson.Field @@ -11301,37 +11322,37 @@ type dnsRecordGetResponseDNSRecordsSvcbRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSvcbRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsSvcbRecordType string +type DNSRecordReplaceResponseDNSRecordsSvcbRecordType string const ( - DNSRecordGetResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordGetResponseDNSRecordsSvcbRecordType = "SVCB" + DNSRecordReplaceResponseDNSRecordsSvcbRecordTypeSvcb DNSRecordReplaceResponseDNSRecordsSvcbRecordType = "SVCB" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsSvcbRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsSvcbRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsSvcbRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsSvcbRecordMeta] -type dnsRecordGetResponseDNSRecordsSvcbRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsSvcbRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsSvcbRecordMeta] +type dnsRecordReplaceResponseDNSRecordsSvcbRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11340,14 +11361,14 @@ func (r *DNSRecordGetResponseDNSRecordsSvcbRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsSvcbRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsSvcbRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsSvcbRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsSvcbRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsSvcbRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsSvcbRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11356,19 +11377,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsSvcbRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordGetResponseDNSRecordsSvcbRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsSvcbRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsSvcbRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsTlsaRecord struct { +type DNSRecordReplaceResponseDNSRecordsTlsaRecord struct { // Components of a TLSA record. - Data DNSRecordGetResponseDNSRecordsTlsaRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsTlsaRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsTlsaRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsTlsaRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -11382,7 +11403,7 @@ type DNSRecordGetResponseDNSRecordsTlsaRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsTlsaRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsTlsaRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -11392,17 +11413,17 @@ type DNSRecordGetResponseDNSRecordsTlsaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsTlsaRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsTlsaRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsTlsaRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsTlsaRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsTlsaRecord] -type dnsRecordGetResponseDNSRecordsTlsaRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsTlsaRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsTlsaRecord] +type dnsRecordReplaceResponseDNSRecordsTlsaRecordJSON struct { Data apijson.Field Name apijson.Field Type apijson.Field @@ -11422,14 +11443,14 @@ type dnsRecordGetResponseDNSRecordsTlsaRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsTlsaRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsTlsaRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsTlsaRecord) implementsDNSRecordReplaceResponse() {} // Components of a TLSA record. -type DNSRecordGetResponseDNSRecordsTlsaRecordData struct { +type DNSRecordReplaceResponseDNSRecordsTlsaRecordData struct { // certificate. Certificate string `json:"certificate"` // Matching Type. @@ -11437,13 +11458,13 @@ type DNSRecordGetResponseDNSRecordsTlsaRecordData struct { // Selector. Selector float64 `json:"selector"` // Usage. - Usage float64 `json:"usage"` - JSON dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON `json:"-"` + Usage float64 `json:"usage"` + JSON dnsRecordReplaceResponseDNSRecordsTlsaRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsTlsaRecordData] -type dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsTlsaRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsTlsaRecordData] +type dnsRecordReplaceResponseDNSRecordsTlsaRecordDataJSON struct { Certificate apijson.Field MatchingType apijson.Field Selector apijson.Field @@ -11452,37 +11473,37 @@ type dnsRecordGetResponseDNSRecordsTlsaRecordDataJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsTlsaRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsTlsaRecordType string +type DNSRecordReplaceResponseDNSRecordsTlsaRecordType string const ( - DNSRecordGetResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordGetResponseDNSRecordsTlsaRecordType = "TLSA" + DNSRecordReplaceResponseDNSRecordsTlsaRecordTypeTlsa DNSRecordReplaceResponseDNSRecordsTlsaRecordType = "TLSA" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsTlsaRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsTlsaRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsTlsaRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsTlsaRecordMeta] -type dnsRecordGetResponseDNSRecordsTlsaRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsTlsaRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsTlsaRecordMeta] +type dnsRecordReplaceResponseDNSRecordsTlsaRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11491,14 +11512,14 @@ func (r *DNSRecordGetResponseDNSRecordsTlsaRecordMeta) UnmarshalJSON(data []byte // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsTlsaRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsTlsaRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsTlsaRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsTlsaRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsTlsaRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsTlsaRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11507,19 +11528,19 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsTlsaRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordGetResponseDNSRecordsTlsaRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsTlsaRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsTlsaRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsTxtRecord struct { +type DNSRecordReplaceResponseDNSRecordsTxtRecord struct { // Text content for the record. Content string `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsTxtRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsTxtRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -11531,7 +11552,7 @@ type DNSRecordGetResponseDNSRecordsTxtRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsTxtRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsTxtRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -11541,17 +11562,17 @@ type DNSRecordGetResponseDNSRecordsTxtRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsTxtRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsTxtRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsTxtRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsTxtRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsTxtRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsTxtRecord] -type dnsRecordGetResponseDNSRecordsTxtRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsTxtRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsTxtRecord] +type dnsRecordReplaceResponseDNSRecordsTxtRecordJSON struct { Content apijson.Field Name apijson.Field Type apijson.Field @@ -11570,39 +11591,39 @@ type dnsRecordGetResponseDNSRecordsTxtRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsTxtRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsTxtRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsTxtRecord) implementsDNSRecordReplaceResponse() {} // Record type. -type DNSRecordGetResponseDNSRecordsTxtRecordType string +type DNSRecordReplaceResponseDNSRecordsTxtRecordType string const ( - DNSRecordGetResponseDNSRecordsTxtRecordTypeTxt DNSRecordGetResponseDNSRecordsTxtRecordType = "TXT" + DNSRecordReplaceResponseDNSRecordsTxtRecordTypeTxt DNSRecordReplaceResponseDNSRecordsTxtRecordType = "TXT" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsTxtRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsTxtRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsTxtRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsTxtRecordMeta] -type dnsRecordGetResponseDNSRecordsTxtRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsTxtRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsTxtRecordMeta] +type dnsRecordReplaceResponseDNSRecordsTxtRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11611,14 +11632,14 @@ func (r *DNSRecordGetResponseDNSRecordsTxtRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsTxtRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsTxtRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsTxtRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsTxtRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsTxtRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsTxtRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11627,22 +11648,22 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsTxtRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordGetResponseDNSRecordsTxtRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsTxtRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsTxtRecordTTLNumber = 1 ) -type DNSRecordGetResponseDNSRecordsUriRecord struct { +type DNSRecordReplaceResponseDNSRecordsUriRecord struct { // Components of a URI record. - Data DNSRecordGetResponseDNSRecordsUriRecordData `json:"data,required"` + Data DNSRecordReplaceResponseDNSRecordsUriRecordData `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name string `json:"name,required"` // Required for MX, SRV and URI records; unused by other record types. Records with // lower priorities are preferred. Priority float64 `json:"priority,required"` // Record type. - Type DNSRecordGetResponseDNSRecordsUriRecordType `json:"type,required"` + Type DNSRecordReplaceResponseDNSRecordsUriRecordType `json:"type,required"` // Identifier ID string `json:"id"` // Comments or notes about the DNS record. This field has no effect on DNS @@ -11656,7 +11677,7 @@ type DNSRecordGetResponseDNSRecordsUriRecord struct { // Cloudflare). Locked bool `json:"locked"` // Extra Cloudflare-specific information about the record. - Meta DNSRecordGetResponseDNSRecordsUriRecordMeta `json:"meta"` + Meta DNSRecordReplaceResponseDNSRecordsUriRecordMeta `json:"meta"` // When the record was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Whether the record can be proxied by Cloudflare or not. @@ -11666,17 +11687,17 @@ type DNSRecordGetResponseDNSRecordsUriRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL DNSRecordGetResponseDNSRecordsUriRecordTTL `json:"ttl"` + TTL DNSRecordReplaceResponseDNSRecordsUriRecordTTL `json:"ttl"` // Identifier ZoneID string `json:"zone_id"` // The domain of the record. - ZoneName string `json:"zone_name" format:"hostname"` - JSON dnsRecordGetResponseDNSRecordsUriRecordJSON `json:"-"` + ZoneName string `json:"zone_name" format:"hostname"` + JSON dnsRecordReplaceResponseDNSRecordsUriRecordJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsUriRecordJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseDNSRecordsUriRecord] -type dnsRecordGetResponseDNSRecordsUriRecordJSON struct { +// dnsRecordReplaceResponseDNSRecordsUriRecordJSON contains the JSON metadata for +// the struct [DNSRecordReplaceResponseDNSRecordsUriRecord] +type dnsRecordReplaceResponseDNSRecordsUriRecordJSON struct { Data apijson.Field Name apijson.Field Priority apijson.Field @@ -11697,61 +11718,61 @@ type dnsRecordGetResponseDNSRecordsUriRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsUriRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r DNSRecordGetResponseDNSRecordsUriRecord) implementsDNSRecordGetResponse() {} +func (r DNSRecordReplaceResponseDNSRecordsUriRecord) implementsDNSRecordReplaceResponse() {} // Components of a URI record. -type DNSRecordGetResponseDNSRecordsUriRecordData struct { +type DNSRecordReplaceResponseDNSRecordsUriRecordData struct { // The record content. Content string `json:"content"` // The record weight. - Weight float64 `json:"weight"` - JSON dnsRecordGetResponseDNSRecordsUriRecordDataJSON `json:"-"` + Weight float64 `json:"weight"` + JSON dnsRecordReplaceResponseDNSRecordsUriRecordDataJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsUriRecordDataJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsUriRecordData] -type dnsRecordGetResponseDNSRecordsUriRecordDataJSON struct { +// dnsRecordReplaceResponseDNSRecordsUriRecordDataJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsUriRecordData] +type dnsRecordReplaceResponseDNSRecordsUriRecordDataJSON struct { Content apijson.Field Weight apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsUriRecordData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Record type. -type DNSRecordGetResponseDNSRecordsUriRecordType string +type DNSRecordReplaceResponseDNSRecordsUriRecordType string const ( - DNSRecordGetResponseDNSRecordsUriRecordTypeUri DNSRecordGetResponseDNSRecordsUriRecordType = "URI" + DNSRecordReplaceResponseDNSRecordsUriRecordTypeUri DNSRecordReplaceResponseDNSRecordsUriRecordType = "URI" ) // Extra Cloudflare-specific information about the record. -type DNSRecordGetResponseDNSRecordsUriRecordMeta struct { +type DNSRecordReplaceResponseDNSRecordsUriRecordMeta struct { // Will exist if Cloudflare automatically added this DNS record during initial // setup. AutoAdded bool `json:"auto_added"` // Where the record originated from. - Source string `json:"source"` - JSON dnsRecordGetResponseDNSRecordsUriRecordMetaJSON `json:"-"` + Source string `json:"source"` + JSON dnsRecordReplaceResponseDNSRecordsUriRecordMetaJSON `json:"-"` } -// dnsRecordGetResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata for -// the struct [DNSRecordGetResponseDNSRecordsUriRecordMeta] -type dnsRecordGetResponseDNSRecordsUriRecordMetaJSON struct { +// dnsRecordReplaceResponseDNSRecordsUriRecordMetaJSON contains the JSON metadata +// for the struct [DNSRecordReplaceResponseDNSRecordsUriRecordMeta] +type dnsRecordReplaceResponseDNSRecordsUriRecordMetaJSON struct { AutoAdded apijson.Field Source apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordGetResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -11760,14 +11781,14 @@ func (r *DNSRecordGetResponseDNSRecordsUriRecordMeta) UnmarshalJSON(data []byte) // Enterprise zones. // // Union satisfied by [shared.UnionFloat] or -// [DNSRecordGetResponseDNSRecordsUriRecordTTLNumber]. -type DNSRecordGetResponseDNSRecordsUriRecordTTL interface { - ImplementsDNSRecordGetResponseDNSRecordsUriRecordTTL() +// [DNSRecordReplaceResponseDNSRecordsUriRecordTTLNumber]. +type DNSRecordReplaceResponseDNSRecordsUriRecordTTL interface { + ImplementsDNSRecordReplaceResponseDNSRecordsUriRecordTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*DNSRecordGetResponseDNSRecordsUriRecordTTL)(nil)).Elem(), + reflect.TypeOf((*DNSRecordReplaceResponseDNSRecordsUriRecordTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -11776,33 +11797,12 @@ func init() { ) } -type DNSRecordGetResponseDNSRecordsUriRecordTTLNumber float64 +type DNSRecordReplaceResponseDNSRecordsUriRecordTTLNumber float64 const ( - DNSRecordGetResponseDNSRecordsUriRecordTTLNumber1 DNSRecordGetResponseDNSRecordsUriRecordTTLNumber = 1 + DNSRecordReplaceResponseDNSRecordsUriRecordTTLNumber1 DNSRecordReplaceResponseDNSRecordsUriRecordTTLNumber = 1 ) -type DNSRecordImportResponse struct { - // Number of DNS records added. - RecsAdded float64 `json:"recs_added"` - // Total number of DNS records parsed. - TotalRecordsParsed float64 `json:"total_records_parsed"` - JSON dnsRecordImportResponseJSON `json:"-"` -} - -// dnsRecordImportResponseJSON contains the JSON metadata for the struct -// [DNSRecordImportResponse] -type dnsRecordImportResponseJSON struct { - RecsAdded apijson.Field - TotalRecordsParsed apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DNSRecordImportResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DNSRecordScanResponse struct { // Number of DNS records added. RecsAdded float64 `json:"recs_added"` @@ -13157,42 +13157,410 @@ const ( DNSRecordNewResponseEnvelopeSuccessTrue DNSRecordNewResponseEnvelopeSuccess = true ) -// This interface is a union satisfied by one of the following: -// [DNSRecordUpdateParamsDNSRecordsARecord], -// [DNSRecordUpdateParamsDNSRecordsAaaaRecord], -// [DNSRecordUpdateParamsDNSRecordsCaaRecord], -// [DNSRecordUpdateParamsDNSRecordsCertRecord], -// [DNSRecordUpdateParamsDNSRecordsCnameRecord], -// [DNSRecordUpdateParamsDNSRecordsDnskeyRecord], -// [DNSRecordUpdateParamsDNSRecordsDsRecord], -// [DNSRecordUpdateParamsDNSRecordsHTTPSRecord], -// [DNSRecordUpdateParamsDNSRecordsLocRecord], -// [DNSRecordUpdateParamsDNSRecordsMxRecord], -// [DNSRecordUpdateParamsDNSRecordsNaptrRecord], -// [DNSRecordUpdateParamsDNSRecordsNsRecord], -// [DNSRecordUpdateParamsDNSRecordsPtrRecord], -// [DNSRecordUpdateParamsDNSRecordsSmimeaRecord], -// [DNSRecordUpdateParamsDNSRecordsSrvRecord], -// [DNSRecordUpdateParamsDNSRecordsSshfpRecord], -// [DNSRecordUpdateParamsDNSRecordsSvcbRecord], -// [DNSRecordUpdateParamsDNSRecordsTlsaRecord], -// [DNSRecordUpdateParamsDNSRecordsTxtRecord], -// [DNSRecordUpdateParamsDNSRecordsUriRecord]. -type DNSRecordUpdateParams interface { - ImplementsDNSRecordUpdateParams() -} - -type DNSRecordUpdateParamsDNSRecordsARecord struct { - // A valid IPv4 address. - Content param.Field[string] `json:"content,required" format:"ipv4"` - // DNS record name (or @ for the zone apex) in Punycode. - Name param.Field[string] `json:"name,required"` - // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsARecordType] `json:"type,required"` - // Comments or notes about the DNS record. This field has no effect on DNS - // responses. - Comment param.Field[string] `json:"comment"` - // Whether the record is receiving the performance and security benefits of +type DNSRecordListParams struct { + Comment param.Field[DNSRecordListParamsComment] `query:"comment"` + // DNS record content. + Content param.Field[string] `query:"content"` + // Direction to order DNS records in. + Direction param.Field[DNSRecordListParamsDirection] `query:"direction"` + // Whether to match all search requirements or at least one (any). If set to `all`, + // acts like a logical AND between filters. If set to `any`, acts like a logical OR + // instead. Note that the interaction between tag filters is controlled by the + // `tag-match` parameter instead. + Match param.Field[DNSRecordListParamsMatch] `query:"match"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `query:"name"` + // Field to order DNS records by. + Order param.Field[DNSRecordListParamsOrder] `query:"order"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // Number of DNS records per page. + PerPage param.Field[float64] `query:"per_page"` + // Whether the record is receiving the performance and security benefits of + // Cloudflare. + Proxied param.Field[bool] `query:"proxied"` + // Allows searching in multiple properties of a DNS record simultaneously. This + // parameter is intended for human users, not automation. Its exact behavior is + // intentionally left unspecified and is subject to change in the future. This + // parameter works independently of the `match` setting. For automated searches, + // please use the other available parameters. + Search param.Field[string] `query:"search"` + Tag param.Field[DNSRecordListParamsTag] `query:"tag"` + // Whether to match all tag search requirements or at least one (any). If set to + // `all`, acts like a logical AND between tag filters. If set to `any`, acts like a + // logical OR instead. Note that the regular `match` parameter is still used to + // combine the resulting condition with other filters that aren't related to tags. + TagMatch param.Field[DNSRecordListParamsTagMatch] `query:"tag_match"` + // Record type. + Type param.Field[DNSRecordListParamsType] `query:"type"` +} + +// URLQuery serializes [DNSRecordListParams]'s query parameters as `url.Values`. +func (r DNSRecordListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type DNSRecordListParamsComment struct { + // If this parameter is present, only records _without_ a comment are returned. + Absent param.Field[string] `query:"absent"` + // Substring of the DNS record comment. Comment filters are case-insensitive. + Contains param.Field[string] `query:"contains"` + // Suffix of the DNS record comment. Comment filters are case-insensitive. + Endswith param.Field[string] `query:"endswith"` + // Exact value of the DNS record comment. Comment filters are case-insensitive. + Exact param.Field[string] `query:"exact"` + // If this parameter is present, only records _with_ a comment are returned. + Present param.Field[string] `query:"present"` + // Prefix of the DNS record comment. Comment filters are case-insensitive. + Startswith param.Field[string] `query:"startswith"` +} + +// URLQuery serializes [DNSRecordListParamsComment]'s query parameters as +// `url.Values`. +func (r DNSRecordListParamsComment) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Direction to order DNS records in. +type DNSRecordListParamsDirection string + +const ( + DNSRecordListParamsDirectionAsc DNSRecordListParamsDirection = "asc" + DNSRecordListParamsDirectionDesc DNSRecordListParamsDirection = "desc" +) + +// Whether to match all search requirements or at least one (any). If set to `all`, +// acts like a logical AND between filters. If set to `any`, acts like a logical OR +// instead. Note that the interaction between tag filters is controlled by the +// `tag-match` parameter instead. +type DNSRecordListParamsMatch string + +const ( + DNSRecordListParamsMatchAny DNSRecordListParamsMatch = "any" + DNSRecordListParamsMatchAll DNSRecordListParamsMatch = "all" +) + +// Field to order DNS records by. +type DNSRecordListParamsOrder string + +const ( + DNSRecordListParamsOrderType DNSRecordListParamsOrder = "type" + DNSRecordListParamsOrderName DNSRecordListParamsOrder = "name" + DNSRecordListParamsOrderContent DNSRecordListParamsOrder = "content" + DNSRecordListParamsOrderTTL DNSRecordListParamsOrder = "ttl" + DNSRecordListParamsOrderProxied DNSRecordListParamsOrder = "proxied" +) + +type DNSRecordListParamsTag struct { + // Name of a tag which must _not_ be present on the DNS record. Tag filters are + // case-insensitive. + Absent param.Field[string] `query:"absent"` + // A tag and value, of the form `:`. The API will only return + // DNS records that have a tag named `` whose value contains + // ``. Tag filters are case-insensitive. + Contains param.Field[string] `query:"contains"` + // A tag and value, of the form `:`. The API will only return + // DNS records that have a tag named `` whose value ends with + // ``. Tag filters are case-insensitive. + Endswith param.Field[string] `query:"endswith"` + // A tag and value, of the form `:`. The API will only return + // DNS records that have a tag named `` whose value is ``. Tag + // filters are case-insensitive. + Exact param.Field[string] `query:"exact"` + // Name of a tag which must be present on the DNS record. Tag filters are + // case-insensitive. + Present param.Field[string] `query:"present"` + // A tag and value, of the form `:`. The API will only return + // DNS records that have a tag named `` whose value starts with + // ``. Tag filters are case-insensitive. + Startswith param.Field[string] `query:"startswith"` +} + +// URLQuery serializes [DNSRecordListParamsTag]'s query parameters as `url.Values`. +func (r DNSRecordListParamsTag) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Whether to match all tag search requirements or at least one (any). If set to +// `all`, acts like a logical AND between tag filters. If set to `any`, acts like a +// logical OR instead. Note that the regular `match` parameter is still used to +// combine the resulting condition with other filters that aren't related to tags. +type DNSRecordListParamsTagMatch string + +const ( + DNSRecordListParamsTagMatchAny DNSRecordListParamsTagMatch = "any" + DNSRecordListParamsTagMatchAll DNSRecordListParamsTagMatch = "all" +) + +// Record type. +type DNSRecordListParamsType string + +const ( + DNSRecordListParamsTypeA DNSRecordListParamsType = "A" + DNSRecordListParamsTypeAaaa DNSRecordListParamsType = "AAAA" + DNSRecordListParamsTypeCaa DNSRecordListParamsType = "CAA" + DNSRecordListParamsTypeCert DNSRecordListParamsType = "CERT" + DNSRecordListParamsTypeCname DNSRecordListParamsType = "CNAME" + DNSRecordListParamsTypeDnskey DNSRecordListParamsType = "DNSKEY" + DNSRecordListParamsTypeDs DNSRecordListParamsType = "DS" + DNSRecordListParamsTypeHTTPS DNSRecordListParamsType = "HTTPS" + DNSRecordListParamsTypeLoc DNSRecordListParamsType = "LOC" + DNSRecordListParamsTypeMx DNSRecordListParamsType = "MX" + DNSRecordListParamsTypeNaptr DNSRecordListParamsType = "NAPTR" + DNSRecordListParamsTypeNs DNSRecordListParamsType = "NS" + DNSRecordListParamsTypePtr DNSRecordListParamsType = "PTR" + DNSRecordListParamsTypeSmimea DNSRecordListParamsType = "SMIMEA" + DNSRecordListParamsTypeSrv DNSRecordListParamsType = "SRV" + DNSRecordListParamsTypeSshfp DNSRecordListParamsType = "SSHFP" + DNSRecordListParamsTypeSvcb DNSRecordListParamsType = "SVCB" + DNSRecordListParamsTypeTlsa DNSRecordListParamsType = "TLSA" + DNSRecordListParamsTypeTxt DNSRecordListParamsType = "TXT" + DNSRecordListParamsTypeUri DNSRecordListParamsType = "URI" +) + +type DNSRecordDeleteResponseEnvelope struct { + Result DNSRecordDeleteResponse `json:"result"` + JSON dnsRecordDeleteResponseEnvelopeJSON `json:"-"` +} + +// dnsRecordDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [DNSRecordDeleteResponseEnvelope] +type dnsRecordDeleteResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSRecordGetResponseEnvelope struct { + Errors []DNSRecordGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSRecordGetResponseEnvelopeMessages `json:"messages,required"` + Result DNSRecordGetResponse `json:"result,required"` + // Whether the API call was successful + Success DNSRecordGetResponseEnvelopeSuccess `json:"success,required"` + JSON dnsRecordGetResponseEnvelopeJSON `json:"-"` +} + +// dnsRecordGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [DNSRecordGetResponseEnvelope] +type dnsRecordGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSRecordGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// dnsRecordGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [DNSRecordGetResponseEnvelopeErrors] +type dnsRecordGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSRecordGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// dnsRecordGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DNSRecordGetResponseEnvelopeMessages] +type dnsRecordGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type DNSRecordGetResponseEnvelopeSuccess bool + +const ( + DNSRecordGetResponseEnvelopeSuccessTrue DNSRecordGetResponseEnvelopeSuccess = true +) + +type DNSRecordImportParams struct { + // BIND config to import. + // + // **Tip:** When using cURL, a file can be uploaded using + // `--form 'file=@bind_config.txt'`. + File param.Field[string] `json:"file,required"` + // Whether or not proxiable records should receive the performance and security + // benefits of Cloudflare. + // + // The value should be either `true` or `false`. + Proxied param.Field[string] `json:"proxied"` +} + +func (r DNSRecordImportParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type DNSRecordImportResponseEnvelope struct { + Errors []DNSRecordImportResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSRecordImportResponseEnvelopeMessages `json:"messages,required"` + Result DNSRecordImportResponse `json:"result,required"` + // Whether the API call was successful + Success DNSRecordImportResponseEnvelopeSuccess `json:"success,required"` + Timing DNSRecordImportResponseEnvelopeTiming `json:"timing"` + JSON dnsRecordImportResponseEnvelopeJSON `json:"-"` +} + +// dnsRecordImportResponseEnvelopeJSON contains the JSON metadata for the struct +// [DNSRecordImportResponseEnvelope] +type dnsRecordImportResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + Timing apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordImportResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSRecordImportResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordImportResponseEnvelopeErrorsJSON `json:"-"` +} + +// dnsRecordImportResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DNSRecordImportResponseEnvelopeErrors] +type dnsRecordImportResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordImportResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSRecordImportResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordImportResponseEnvelopeMessagesJSON `json:"-"` +} + +// dnsRecordImportResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DNSRecordImportResponseEnvelopeMessages] +type dnsRecordImportResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordImportResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type DNSRecordImportResponseEnvelopeSuccess bool + +const ( + DNSRecordImportResponseEnvelopeSuccessTrue DNSRecordImportResponseEnvelopeSuccess = true +) + +type DNSRecordImportResponseEnvelopeTiming struct { + // When the file parsing ended. + EndTime time.Time `json:"end_time" format:"date-time"` + // Processing time of the file in seconds. + ProcessTime float64 `json:"process_time"` + // When the file parsing started. + StartTime time.Time `json:"start_time" format:"date-time"` + JSON dnsRecordImportResponseEnvelopeTimingJSON `json:"-"` +} + +// dnsRecordImportResponseEnvelopeTimingJSON contains the JSON metadata for the +// struct [DNSRecordImportResponseEnvelopeTiming] +type dnsRecordImportResponseEnvelopeTimingJSON struct { + EndTime apijson.Field + ProcessTime apijson.Field + StartTime apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSRecordImportResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// This interface is a union satisfied by one of the following: +// [DNSRecordReplaceParamsDNSRecordsARecord], +// [DNSRecordReplaceParamsDNSRecordsAaaaRecord], +// [DNSRecordReplaceParamsDNSRecordsCaaRecord], +// [DNSRecordReplaceParamsDNSRecordsCertRecord], +// [DNSRecordReplaceParamsDNSRecordsCnameRecord], +// [DNSRecordReplaceParamsDNSRecordsDnskeyRecord], +// [DNSRecordReplaceParamsDNSRecordsDsRecord], +// [DNSRecordReplaceParamsDNSRecordsHTTPSRecord], +// [DNSRecordReplaceParamsDNSRecordsLocRecord], +// [DNSRecordReplaceParamsDNSRecordsMxRecord], +// [DNSRecordReplaceParamsDNSRecordsNaptrRecord], +// [DNSRecordReplaceParamsDNSRecordsNsRecord], +// [DNSRecordReplaceParamsDNSRecordsPtrRecord], +// [DNSRecordReplaceParamsDNSRecordsSmimeaRecord], +// [DNSRecordReplaceParamsDNSRecordsSrvRecord], +// [DNSRecordReplaceParamsDNSRecordsSshfpRecord], +// [DNSRecordReplaceParamsDNSRecordsSvcbRecord], +// [DNSRecordReplaceParamsDNSRecordsTlsaRecord], +// [DNSRecordReplaceParamsDNSRecordsTxtRecord], +// [DNSRecordReplaceParamsDNSRecordsUriRecord]. +type DNSRecordReplaceParams interface { + ImplementsDNSRecordReplaceParams() +} + +type DNSRecordReplaceParamsDNSRecordsARecord struct { + // A valid IPv4 address. + Content param.Field[string] `json:"content,required" format:"ipv4"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `json:"name,required"` + // Record type. + Type param.Field[DNSRecordReplaceParamsDNSRecordsARecordType] `json:"type,required"` + // Comments or notes about the DNS record. This field has no effect on DNS + // responses. + Comment param.Field[string] `json:"comment"` + // Whether the record is receiving the performance and security benefits of // Cloudflare. Proxied param.Field[bool] `json:"proxied"` // Custom tags for the DNS record. This field has no effect on DNS responses. @@ -13200,22 +13568,22 @@ type DNSRecordUpdateParamsDNSRecordsARecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsARecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsARecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsARecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsARecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsARecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsARecord) ImplementsDNSRecordReplaceParams() { } // Record type. -type DNSRecordUpdateParamsDNSRecordsARecordType string +type DNSRecordReplaceParamsDNSRecordsARecordType string const ( - DNSRecordUpdateParamsDNSRecordsARecordTypeA DNSRecordUpdateParamsDNSRecordsARecordType = "A" + DNSRecordReplaceParamsDNSRecordsARecordTypeA DNSRecordReplaceParamsDNSRecordsARecordType = "A" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13223,24 +13591,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsARecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsARecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsARecordTTL() +// [DNSRecordReplaceParamsDNSRecordsARecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsARecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsARecordTTL() } -type DNSRecordUpdateParamsDNSRecordsARecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsARecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsARecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsARecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsARecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsARecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsAaaaRecord struct { +type DNSRecordReplaceParamsDNSRecordsAaaaRecord struct { // A valid IPv6 address. Content param.Field[string] `json:"content,required" format:"ipv6"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsAaaaRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsAaaaRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13252,22 +13620,22 @@ type DNSRecordUpdateParamsDNSRecordsAaaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsAaaaRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsAaaaRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsAaaaRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsAaaaRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsAaaaRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsAaaaRecord) ImplementsDNSRecordReplaceParams() { } // Record type. -type DNSRecordUpdateParamsDNSRecordsAaaaRecordType string +type DNSRecordReplaceParamsDNSRecordsAaaaRecordType string const ( - DNSRecordUpdateParamsDNSRecordsAaaaRecordTypeAaaa DNSRecordUpdateParamsDNSRecordsAaaaRecordType = "AAAA" + DNSRecordReplaceParamsDNSRecordsAaaaRecordTypeAaaa DNSRecordReplaceParamsDNSRecordsAaaaRecordType = "AAAA" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13275,24 +13643,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsAaaaRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsAaaaRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsAaaaRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsAaaaRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsAaaaRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsAaaaRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsAaaaRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsAaaaRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsAaaaRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsAaaaRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsAaaaRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsAaaaRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsCaaRecord struct { +type DNSRecordReplaceParamsDNSRecordsCaaRecord struct { // Components of a CAA record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsCaaRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsCaaRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsCaaRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsCaaRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13301,19 +13669,19 @@ type DNSRecordUpdateParamsDNSRecordsCaaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsCaaRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsCaaRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsCaaRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsCaaRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsCaaRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsCaaRecord) ImplementsDNSRecordReplaceParams() { } // Components of a CAA record. -type DNSRecordUpdateParamsDNSRecordsCaaRecordData struct { +type DNSRecordReplaceParamsDNSRecordsCaaRecordData struct { // Flags for the CAA record. Flags param.Field[float64] `json:"flags"` // Name of the property controlled by this record (e.g.: issue, issuewild, iodef). @@ -13322,15 +13690,15 @@ type DNSRecordUpdateParamsDNSRecordsCaaRecordData struct { Value param.Field[string] `json:"value"` } -func (r DNSRecordUpdateParamsDNSRecordsCaaRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsCaaRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsCaaRecordType string +type DNSRecordReplaceParamsDNSRecordsCaaRecordType string const ( - DNSRecordUpdateParamsDNSRecordsCaaRecordTypeCaa DNSRecordUpdateParamsDNSRecordsCaaRecordType = "CAA" + DNSRecordReplaceParamsDNSRecordsCaaRecordTypeCaa DNSRecordReplaceParamsDNSRecordsCaaRecordType = "CAA" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13338,24 +13706,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsCaaRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsCaaRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsCaaRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsCaaRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsCaaRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsCaaRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsCaaRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsCaaRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsCaaRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsCaaRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsCaaRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsCaaRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsCertRecord struct { +type DNSRecordReplaceParamsDNSRecordsCertRecord struct { // Components of a CERT record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsCertRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsCertRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsCertRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsCertRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13364,19 +13732,19 @@ type DNSRecordUpdateParamsDNSRecordsCertRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsCertRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsCertRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsCertRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsCertRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsCertRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsCertRecord) ImplementsDNSRecordReplaceParams() { } // Components of a CERT record. -type DNSRecordUpdateParamsDNSRecordsCertRecordData struct { +type DNSRecordReplaceParamsDNSRecordsCertRecordData struct { // Algorithm. Algorithm param.Field[float64] `json:"algorithm"` // Certificate. @@ -13387,15 +13755,15 @@ type DNSRecordUpdateParamsDNSRecordsCertRecordData struct { Type param.Field[float64] `json:"type"` } -func (r DNSRecordUpdateParamsDNSRecordsCertRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsCertRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsCertRecordType string +type DNSRecordReplaceParamsDNSRecordsCertRecordType string const ( - DNSRecordUpdateParamsDNSRecordsCertRecordTypeCert DNSRecordUpdateParamsDNSRecordsCertRecordType = "CERT" + DNSRecordReplaceParamsDNSRecordsCertRecordTypeCert DNSRecordReplaceParamsDNSRecordsCertRecordType = "CERT" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13403,24 +13771,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsCertRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsCertRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsCertRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsCertRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsCertRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsCertRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsCertRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsCertRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsCertRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsCertRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsCertRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsCertRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsCnameRecord struct { +type DNSRecordReplaceParamsDNSRecordsCnameRecord struct { // A valid hostname. Must not match the record's name. Content param.Field[interface{}] `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsCnameRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsCnameRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13432,22 +13800,22 @@ type DNSRecordUpdateParamsDNSRecordsCnameRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsCnameRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsCnameRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsCnameRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsCnameRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsCnameRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsCnameRecord) ImplementsDNSRecordReplaceParams() { } // Record type. -type DNSRecordUpdateParamsDNSRecordsCnameRecordType string +type DNSRecordReplaceParamsDNSRecordsCnameRecordType string const ( - DNSRecordUpdateParamsDNSRecordsCnameRecordTypeCname DNSRecordUpdateParamsDNSRecordsCnameRecordType = "CNAME" + DNSRecordReplaceParamsDNSRecordsCnameRecordTypeCname DNSRecordReplaceParamsDNSRecordsCnameRecordType = "CNAME" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13455,24 +13823,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsCnameRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsCnameRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsCnameRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsCnameRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsCnameRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsCnameRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsCnameRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsCnameRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsCnameRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsCnameRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsCnameRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsCnameRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsDnskeyRecord struct { +type DNSRecordReplaceParamsDNSRecordsDnskeyRecord struct { // Components of a DNSKEY record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsDnskeyRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsDnskeyRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsDnskeyRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsDnskeyRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13481,19 +13849,19 @@ type DNSRecordUpdateParamsDNSRecordsDnskeyRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsDnskeyRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsDnskeyRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsDnskeyRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsDnskeyRecord) ImplementsDNSRecordReplaceParams() { } // Components of a DNSKEY record. -type DNSRecordUpdateParamsDNSRecordsDnskeyRecordData struct { +type DNSRecordReplaceParamsDNSRecordsDnskeyRecordData struct { // Algorithm. Algorithm param.Field[float64] `json:"algorithm"` // Flags. @@ -13504,15 +13872,15 @@ type DNSRecordUpdateParamsDNSRecordsDnskeyRecordData struct { PublicKey param.Field[string] `json:"public_key"` } -func (r DNSRecordUpdateParamsDNSRecordsDnskeyRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsDnskeyRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsDnskeyRecordType string +type DNSRecordReplaceParamsDNSRecordsDnskeyRecordType string const ( - DNSRecordUpdateParamsDNSRecordsDnskeyRecordTypeDnskey DNSRecordUpdateParamsDNSRecordsDnskeyRecordType = "DNSKEY" + DNSRecordReplaceParamsDNSRecordsDnskeyRecordTypeDnskey DNSRecordReplaceParamsDNSRecordsDnskeyRecordType = "DNSKEY" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13520,24 +13888,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsDnskeyRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsDnskeyRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsDnskeyRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsDnskeyRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsDsRecord struct { +type DNSRecordReplaceParamsDNSRecordsDsRecord struct { // Components of a DS record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsDsRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsDsRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsDsRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsDsRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13546,19 +13914,19 @@ type DNSRecordUpdateParamsDNSRecordsDsRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsDsRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsDsRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsDsRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsDsRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsDsRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsDsRecord) ImplementsDNSRecordReplaceParams() { } // Components of a DS record. -type DNSRecordUpdateParamsDNSRecordsDsRecordData struct { +type DNSRecordReplaceParamsDNSRecordsDsRecordData struct { // Algorithm. Algorithm param.Field[float64] `json:"algorithm"` // Digest. @@ -13569,15 +13937,15 @@ type DNSRecordUpdateParamsDNSRecordsDsRecordData struct { KeyTag param.Field[float64] `json:"key_tag"` } -func (r DNSRecordUpdateParamsDNSRecordsDsRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsDsRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsDsRecordType string +type DNSRecordReplaceParamsDNSRecordsDsRecordType string const ( - DNSRecordUpdateParamsDNSRecordsDsRecordTypeDs DNSRecordUpdateParamsDNSRecordsDsRecordType = "DS" + DNSRecordReplaceParamsDNSRecordsDsRecordTypeDs DNSRecordReplaceParamsDNSRecordsDsRecordType = "DS" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13585,24 +13953,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsDsRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsDsRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsDsRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsDsRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsDsRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsDsRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsDsRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsDsRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsDsRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsDsRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsDsRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsDsRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsHTTPSRecord struct { +type DNSRecordReplaceParamsDNSRecordsHTTPSRecord struct { // Components of a HTTPS record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsHTTPSRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsHTTPSRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsHTTPSRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsHTTPSRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13611,19 +13979,19 @@ type DNSRecordUpdateParamsDNSRecordsHTTPSRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsHTTPSRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsHTTPSRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsHTTPSRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsHTTPSRecord) ImplementsDNSRecordReplaceParams() { } // Components of a HTTPS record. -type DNSRecordUpdateParamsDNSRecordsHTTPSRecordData struct { +type DNSRecordReplaceParamsDNSRecordsHTTPSRecordData struct { // priority. Priority param.Field[float64] `json:"priority"` // target. @@ -13632,15 +14000,15 @@ type DNSRecordUpdateParamsDNSRecordsHTTPSRecordData struct { Value param.Field[string] `json:"value"` } -func (r DNSRecordUpdateParamsDNSRecordsHTTPSRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsHTTPSRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsHTTPSRecordType string +type DNSRecordReplaceParamsDNSRecordsHTTPSRecordType string const ( - DNSRecordUpdateParamsDNSRecordsHTTPSRecordTypeHTTPS DNSRecordUpdateParamsDNSRecordsHTTPSRecordType = "HTTPS" + DNSRecordReplaceParamsDNSRecordsHTTPSRecordTypeHTTPS DNSRecordReplaceParamsDNSRecordsHTTPSRecordType = "HTTPS" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13648,24 +14016,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsHTTPSRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsHTTPSRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsHTTPSRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsHTTPSRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsLocRecord struct { +type DNSRecordReplaceParamsDNSRecordsLocRecord struct { // Components of a LOC record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsLocRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsLocRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsLocRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsLocRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13674,25 +14042,25 @@ type DNSRecordUpdateParamsDNSRecordsLocRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsLocRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsLocRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsLocRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsLocRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsLocRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsLocRecord) ImplementsDNSRecordReplaceParams() { } // Components of a LOC record. -type DNSRecordUpdateParamsDNSRecordsLocRecordData struct { +type DNSRecordReplaceParamsDNSRecordsLocRecordData struct { // Altitude of location in meters. Altitude param.Field[float64] `json:"altitude"` // Degrees of latitude. LatDegrees param.Field[float64] `json:"lat_degrees"` // Latitude direction. - LatDirection param.Field[DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirection] `json:"lat_direction"` + LatDirection param.Field[DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirection] `json:"lat_direction"` // Minutes of latitude. LatMinutes param.Field[float64] `json:"lat_minutes"` // Seconds of latitude. @@ -13700,7 +14068,7 @@ type DNSRecordUpdateParamsDNSRecordsLocRecordData struct { // Degrees of longitude. LongDegrees param.Field[float64] `json:"long_degrees"` // Longitude direction. - LongDirection param.Field[DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirection] `json:"long_direction"` + LongDirection param.Field[DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirection] `json:"long_direction"` // Minutes of longitude. LongMinutes param.Field[float64] `json:"long_minutes"` // Seconds of longitude. @@ -13713,31 +14081,31 @@ type DNSRecordUpdateParamsDNSRecordsLocRecordData struct { Size param.Field[float64] `json:"size"` } -func (r DNSRecordUpdateParamsDNSRecordsLocRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsLocRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Latitude direction. -type DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirection string +type DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirection string const ( - DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirectionN DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirection = "N" - DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirectionS DNSRecordUpdateParamsDNSRecordsLocRecordDataLatDirection = "S" + DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirectionN DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirection = "N" + DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirectionS DNSRecordReplaceParamsDNSRecordsLocRecordDataLatDirection = "S" ) // Longitude direction. -type DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirection string +type DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirection string const ( - DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirectionE DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirection = "E" - DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirectionW DNSRecordUpdateParamsDNSRecordsLocRecordDataLongDirection = "W" + DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirectionE DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirection = "E" + DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirectionW DNSRecordReplaceParamsDNSRecordsLocRecordDataLongDirection = "W" ) // Record type. -type DNSRecordUpdateParamsDNSRecordsLocRecordType string +type DNSRecordReplaceParamsDNSRecordsLocRecordType string const ( - DNSRecordUpdateParamsDNSRecordsLocRecordTypeLoc DNSRecordUpdateParamsDNSRecordsLocRecordType = "LOC" + DNSRecordReplaceParamsDNSRecordsLocRecordTypeLoc DNSRecordReplaceParamsDNSRecordsLocRecordType = "LOC" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13745,18 +14113,18 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsLocRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsLocRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsLocRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsLocRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsLocRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsLocRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsLocRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsLocRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsLocRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsLocRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsLocRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsLocRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsMxRecord struct { +type DNSRecordReplaceParamsDNSRecordsMxRecord struct { // A valid mail server hostname. Content param.Field[string] `json:"content,required" format:"hostname"` // DNS record name (or @ for the zone apex) in Punycode. @@ -13765,7 +14133,7 @@ type DNSRecordUpdateParamsDNSRecordsMxRecord struct { // lower priorities are preferred. Priority param.Field[float64] `json:"priority,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsMxRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsMxRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13774,22 +14142,22 @@ type DNSRecordUpdateParamsDNSRecordsMxRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsMxRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsMxRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsMxRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsMxRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsMxRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsMxRecord) ImplementsDNSRecordReplaceParams() { } // Record type. -type DNSRecordUpdateParamsDNSRecordsMxRecordType string +type DNSRecordReplaceParamsDNSRecordsMxRecordType string const ( - DNSRecordUpdateParamsDNSRecordsMxRecordTypeMx DNSRecordUpdateParamsDNSRecordsMxRecordType = "MX" + DNSRecordReplaceParamsDNSRecordsMxRecordTypeMx DNSRecordReplaceParamsDNSRecordsMxRecordType = "MX" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13797,24 +14165,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsMxRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsMxRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsMxRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsMxRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsMxRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsMxRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsMxRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsMxRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsMxRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsMxRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsMxRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsMxRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsNaptrRecord struct { +type DNSRecordReplaceParamsDNSRecordsNaptrRecord struct { // Components of a NAPTR record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsNaptrRecordData] `json:"data,required"` + Data param.Field[DNSRecordReplaceParamsDNSRecordsNaptrRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsNaptrRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsNaptrRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -13823,19 +14191,19 @@ type DNSRecordUpdateParamsDNSRecordsNaptrRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsNaptrRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsNaptrRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsNaptrRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsNaptrRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsNaptrRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsNaptrRecord) ImplementsDNSRecordReplaceParams() { } // Components of a NAPTR record. -type DNSRecordUpdateParamsDNSRecordsNaptrRecordData struct { +type DNSRecordReplaceParamsDNSRecordsNaptrRecordData struct { // Flags. Flags param.Field[string] `json:"flags"` // Order. @@ -13850,15 +14218,15 @@ type DNSRecordUpdateParamsDNSRecordsNaptrRecordData struct { Service param.Field[string] `json:"service"` } -func (r DNSRecordUpdateParamsDNSRecordsNaptrRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsNaptrRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsNaptrRecordType string +type DNSRecordReplaceParamsDNSRecordsNaptrRecordType string const ( - DNSRecordUpdateParamsDNSRecordsNaptrRecordTypeNaptr DNSRecordUpdateParamsDNSRecordsNaptrRecordType = "NAPTR" + DNSRecordReplaceParamsDNSRecordsNaptrRecordTypeNaptr DNSRecordReplaceParamsDNSRecordsNaptrRecordType = "NAPTR" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -13866,305 +14234,48 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsNaptrRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsNaptrRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsNaptrRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsNaptrRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsNaptrRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsNaptrRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsNaptrRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsNaptrRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsNaptrRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsNaptrRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsNaptrRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsNaptrRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsNsRecord struct { +type DNSRecordReplaceParamsDNSRecordsNsRecord struct { // A valid name server host name. Content param.Field[interface{}] `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsNsRecordType] `json:"type,required"` - // Comments or notes about the DNS record. This field has no effect on DNS - // responses. - Comment param.Field[string] `json:"comment"` - // Custom tags for the DNS record. This field has no effect on DNS responses. - Tags param.Field[[]string] `json:"tags"` - // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - // Value must be between 60 and 86400, with the minimum reduced to 30 for - // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsNsRecordTTL] `json:"ttl"` -} - -func (r DNSRecordUpdateParamsDNSRecordsNsRecord) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (DNSRecordUpdateParamsDNSRecordsNsRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Record type. -type DNSRecordUpdateParamsDNSRecordsNsRecordType string - -const ( - DNSRecordUpdateParamsDNSRecordsNsRecordTypeNs DNSRecordUpdateParamsDNSRecordsNsRecordType = "NS" -) - -// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. -// Value must be between 60 and 86400, with the minimum reduced to 30 for -// Enterprise zones. -// -// Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsNsRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsNsRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsNsRecordTTL() -} - -type DNSRecordUpdateParamsDNSRecordsNsRecordTTLNumber float64 - -const ( - DNSRecordUpdateParamsDNSRecordsNsRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsNsRecordTTLNumber = 1 -) - -type DNSRecordUpdateParamsDNSRecordsPtrRecord struct { - // Domain name pointing to the address. - Content param.Field[string] `json:"content,required"` - // DNS record name (or @ for the zone apex) in Punycode. - Name param.Field[string] `json:"name,required"` - // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsPtrRecordType] `json:"type,required"` - // Comments or notes about the DNS record. This field has no effect on DNS - // responses. - Comment param.Field[string] `json:"comment"` - // Custom tags for the DNS record. This field has no effect on DNS responses. - Tags param.Field[[]string] `json:"tags"` - // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - // Value must be between 60 and 86400, with the minimum reduced to 30 for - // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsPtrRecordTTL] `json:"ttl"` -} - -func (r DNSRecordUpdateParamsDNSRecordsPtrRecord) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (DNSRecordUpdateParamsDNSRecordsPtrRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Record type. -type DNSRecordUpdateParamsDNSRecordsPtrRecordType string - -const ( - DNSRecordUpdateParamsDNSRecordsPtrRecordTypePtr DNSRecordUpdateParamsDNSRecordsPtrRecordType = "PTR" -) - -// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. -// Value must be between 60 and 86400, with the minimum reduced to 30 for -// Enterprise zones. -// -// Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsPtrRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsPtrRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsPtrRecordTTL() -} - -type DNSRecordUpdateParamsDNSRecordsPtrRecordTTLNumber float64 - -const ( - DNSRecordUpdateParamsDNSRecordsPtrRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsPtrRecordTTLNumber = 1 -) - -type DNSRecordUpdateParamsDNSRecordsSmimeaRecord struct { - // Components of a SMIMEA record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsSmimeaRecordData] `json:"data,required"` - // DNS record name (or @ for the zone apex) in Punycode. - Name param.Field[string] `json:"name,required"` - // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsSmimeaRecordType] `json:"type,required"` - // Comments or notes about the DNS record. This field has no effect on DNS - // responses. - Comment param.Field[string] `json:"comment"` - // Custom tags for the DNS record. This field has no effect on DNS responses. - Tags param.Field[[]string] `json:"tags"` - // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - // Value must be between 60 and 86400, with the minimum reduced to 30 for - // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTL] `json:"ttl"` -} - -func (r DNSRecordUpdateParamsDNSRecordsSmimeaRecord) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (DNSRecordUpdateParamsDNSRecordsSmimeaRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Components of a SMIMEA record. -type DNSRecordUpdateParamsDNSRecordsSmimeaRecordData struct { - // Certificate. - Certificate param.Field[string] `json:"certificate"` - // Matching Type. - MatchingType param.Field[float64] `json:"matching_type"` - // Selector. - Selector param.Field[float64] `json:"selector"` - // Usage. - Usage param.Field[float64] `json:"usage"` -} - -func (r DNSRecordUpdateParamsDNSRecordsSmimeaRecordData) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Record type. -type DNSRecordUpdateParamsDNSRecordsSmimeaRecordType string - -const ( - DNSRecordUpdateParamsDNSRecordsSmimeaRecordTypeSmimea DNSRecordUpdateParamsDNSRecordsSmimeaRecordType = "SMIMEA" -) - -// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. -// Value must be between 60 and 86400, with the minimum reduced to 30 for -// Enterprise zones. -// -// Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsSmimeaRecordTTL() -} - -type DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTLNumber float64 - -const ( - DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsSmimeaRecordTTLNumber = 1 -) - -type DNSRecordUpdateParamsDNSRecordsSrvRecord struct { - // Components of a SRV record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsSrvRecordData] `json:"data,required"` - // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first - // label is normally a service and the second a protocol name, each starting with - // an underscore. - Name param.Field[string] `json:"name,required"` - // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsSrvRecordType] `json:"type,required"` - // Comments or notes about the DNS record. This field has no effect on DNS - // responses. - Comment param.Field[string] `json:"comment"` - // Custom tags for the DNS record. This field has no effect on DNS responses. - Tags param.Field[[]string] `json:"tags"` - // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - // Value must be between 60 and 86400, with the minimum reduced to 30 for - // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsSrvRecordTTL] `json:"ttl"` -} - -func (r DNSRecordUpdateParamsDNSRecordsSrvRecord) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (DNSRecordUpdateParamsDNSRecordsSrvRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Components of a SRV record. -type DNSRecordUpdateParamsDNSRecordsSrvRecordData struct { - // A valid hostname. Deprecated in favor of the regular 'name' outside the data - // map. This data map field represents the remainder of the full 'name' after the - // service and protocol. - Name param.Field[string] `json:"name" format:"hostname"` - // The port of the service. - Port param.Field[float64] `json:"port"` - // Required for MX, SRV and URI records; unused by other record types. Records with - // lower priorities are preferred. - Priority param.Field[float64] `json:"priority"` - // A valid protocol, prefixed with an underscore. Deprecated in favor of the - // regular 'name' outside the data map. This data map field normally represents the - // second label of that 'name'. - Proto param.Field[string] `json:"proto"` - // A service type, prefixed with an underscore. Deprecated in favor of the regular - // 'name' outside the data map. This data map field normally represents the first - // label of that 'name'. - Service param.Field[string] `json:"service"` - // A valid hostname. - Target param.Field[string] `json:"target" format:"hostname"` - // The record weight. - Weight param.Field[float64] `json:"weight"` -} - -func (r DNSRecordUpdateParamsDNSRecordsSrvRecordData) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Record type. -type DNSRecordUpdateParamsDNSRecordsSrvRecordType string - -const ( - DNSRecordUpdateParamsDNSRecordsSrvRecordTypeSrv DNSRecordUpdateParamsDNSRecordsSrvRecordType = "SRV" -) - -// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. -// Value must be between 60 and 86400, with the minimum reduced to 30 for -// Enterprise zones. -// -// Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsSrvRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsSrvRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsSrvRecordTTL() -} - -type DNSRecordUpdateParamsDNSRecordsSrvRecordTTLNumber float64 - -const ( - DNSRecordUpdateParamsDNSRecordsSrvRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsSrvRecordTTLNumber = 1 -) - -type DNSRecordUpdateParamsDNSRecordsSshfpRecord struct { - // Components of a SSHFP record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsSshfpRecordData] `json:"data,required"` - // DNS record name (or @ for the zone apex) in Punycode. - Name param.Field[string] `json:"name,required"` - // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsSshfpRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsNsRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` // Custom tags for the DNS record. This field has no effect on DNS responses. Tags param.Field[[]string] `json:"tags"` - // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - // Value must be between 60 and 86400, with the minimum reduced to 30 for - // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsSshfpRecordTTL] `json:"ttl"` -} - -func (r DNSRecordUpdateParamsDNSRecordsSshfpRecord) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (DNSRecordUpdateParamsDNSRecordsSshfpRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Components of a SSHFP record. -type DNSRecordUpdateParamsDNSRecordsSshfpRecordData struct { - // algorithm. - Algorithm param.Field[float64] `json:"algorithm"` - // fingerprint. - Fingerprint param.Field[string] `json:"fingerprint"` - // type. - Type param.Field[float64] `json:"type"` + // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + // Value must be between 60 and 86400, with the minimum reduced to 30 for + // Enterprise zones. + TTL param.Field[DNSRecordReplaceParamsDNSRecordsNsRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsSshfpRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsNsRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } +func (DNSRecordReplaceParamsDNSRecordsNsRecord) ImplementsDNSRecordReplaceParams() { + +} + // Record type. -type DNSRecordUpdateParamsDNSRecordsSshfpRecordType string +type DNSRecordReplaceParamsDNSRecordsNsRecordType string const ( - DNSRecordUpdateParamsDNSRecordsSshfpRecordTypeSshfp DNSRecordUpdateParamsDNSRecordsSshfpRecordType = "SSHFP" + DNSRecordReplaceParamsDNSRecordsNsRecordTypeNs DNSRecordReplaceParamsDNSRecordsNsRecordType = "NS" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -14172,24 +14283,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsSshfpRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsSshfpRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsSshfpRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsNsRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsNsRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsNsRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsSshfpRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsNsRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsSshfpRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsSshfpRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsNsRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsNsRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsSvcbRecord struct { - // Components of a SVCB record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsSvcbRecordData] `json:"data,required"` +type DNSRecordReplaceParamsDNSRecordsPtrRecord struct { + // Domain name pointing to the address. + Content param.Field[string] `json:"content,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsSvcbRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsPtrRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -14198,36 +14309,22 @@ type DNSRecordUpdateParamsDNSRecordsSvcbRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsSvcbRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsPtrRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsSvcbRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsPtrRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsSvcbRecord) ImplementsDNSRecordUpdateParams() { - -} - -// Components of a SVCB record. -type DNSRecordUpdateParamsDNSRecordsSvcbRecordData struct { - // priority. - Priority param.Field[float64] `json:"priority"` - // target. - Target param.Field[string] `json:"target"` - // value. - Value param.Field[string] `json:"value"` -} +func (DNSRecordReplaceParamsDNSRecordsPtrRecord) ImplementsDNSRecordReplaceParams() { -func (r DNSRecordUpdateParamsDNSRecordsSvcbRecordData) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsSvcbRecordType string +type DNSRecordReplaceParamsDNSRecordsPtrRecordType string const ( - DNSRecordUpdateParamsDNSRecordsSvcbRecordTypeSvcb DNSRecordUpdateParamsDNSRecordsSvcbRecordType = "SVCB" + DNSRecordReplaceParamsDNSRecordsPtrRecordTypePtr DNSRecordReplaceParamsDNSRecordsPtrRecordType = "PTR" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -14235,24 +14332,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsSvcbRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsSvcbRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsSvcbRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsPtrRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsPtrRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsPtrRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsSvcbRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsPtrRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsSvcbRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsSvcbRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsPtrRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsPtrRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsTlsaRecord struct { - // Components of a TLSA record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsTlsaRecordData] `json:"data,required"` +type DNSRecordReplaceParamsDNSRecordsSmimeaRecord struct { + // Components of a SMIMEA record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsSmimeaRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsTlsaRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsSmimeaRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -14261,20 +14358,20 @@ type DNSRecordUpdateParamsDNSRecordsTlsaRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsTlsaRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsTlsaRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsSmimeaRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsTlsaRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsSmimeaRecord) ImplementsDNSRecordReplaceParams() { } -// Components of a TLSA record. -type DNSRecordUpdateParamsDNSRecordsTlsaRecordData struct { - // certificate. +// Components of a SMIMEA record. +type DNSRecordReplaceParamsDNSRecordsSmimeaRecordData struct { + // Certificate. Certificate param.Field[string] `json:"certificate"` // Matching Type. MatchingType param.Field[float64] `json:"matching_type"` @@ -14284,15 +14381,15 @@ type DNSRecordUpdateParamsDNSRecordsTlsaRecordData struct { Usage param.Field[float64] `json:"usage"` } -func (r DNSRecordUpdateParamsDNSRecordsTlsaRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsSmimeaRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsTlsaRecordType string +type DNSRecordReplaceParamsDNSRecordsSmimeaRecordType string const ( - DNSRecordUpdateParamsDNSRecordsTlsaRecordTypeTlsa DNSRecordUpdateParamsDNSRecordsTlsaRecordType = "TLSA" + DNSRecordReplaceParamsDNSRecordsSmimeaRecordTypeSmimea DNSRecordReplaceParamsDNSRecordsSmimeaRecordType = "SMIMEA" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -14300,24 +14397,26 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsTlsaRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsTlsaRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsTlsaRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsSmimeaRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsTlsaRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsTlsaRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsTlsaRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsSmimeaRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsTxtRecord struct { - // Text content for the record. - Content param.Field[string] `json:"content,required"` - // DNS record name (or @ for the zone apex) in Punycode. +type DNSRecordReplaceParamsDNSRecordsSrvRecord struct { + // Components of a SRV record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsSrvRecordData] `json:"data,required"` + // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + // label is normally a service and the second a protocol name, each starting with + // an underscore. Name param.Field[string] `json:"name,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsTxtRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsSrvRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -14326,22 +14425,51 @@ type DNSRecordUpdateParamsDNSRecordsTxtRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsTxtRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsSrvRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsTxtRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsSrvRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsTxtRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsSrvRecord) ImplementsDNSRecordReplaceParams() { + +} + +// Components of a SRV record. +type DNSRecordReplaceParamsDNSRecordsSrvRecordData struct { + // A valid hostname. Deprecated in favor of the regular 'name' outside the data + // map. This data map field represents the remainder of the full 'name' after the + // service and protocol. + Name param.Field[string] `json:"name" format:"hostname"` + // The port of the service. + Port param.Field[float64] `json:"port"` + // Required for MX, SRV and URI records; unused by other record types. Records with + // lower priorities are preferred. + Priority param.Field[float64] `json:"priority"` + // A valid protocol, prefixed with an underscore. Deprecated in favor of the + // regular 'name' outside the data map. This data map field normally represents the + // second label of that 'name'. + Proto param.Field[string] `json:"proto"` + // A service type, prefixed with an underscore. Deprecated in favor of the regular + // 'name' outside the data map. This data map field normally represents the first + // label of that 'name'. + Service param.Field[string] `json:"service"` + // A valid hostname. + Target param.Field[string] `json:"target" format:"hostname"` + // The record weight. + Weight param.Field[float64] `json:"weight"` +} +func (r DNSRecordReplaceParamsDNSRecordsSrvRecordData) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsTxtRecordType string +type DNSRecordReplaceParamsDNSRecordsSrvRecordType string const ( - DNSRecordUpdateParamsDNSRecordsTxtRecordTypeTxt DNSRecordUpdateParamsDNSRecordsTxtRecordType = "TXT" + DNSRecordReplaceParamsDNSRecordsSrvRecordTypeSrv DNSRecordReplaceParamsDNSRecordsSrvRecordType = "SRV" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -14349,27 +14477,24 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsTxtRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsTxtRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsTxtRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsSrvRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsSrvRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsSrvRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsTxtRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsSrvRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsTxtRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsTxtRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsSrvRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsSrvRecordTTLNumber = 1 ) -type DNSRecordUpdateParamsDNSRecordsUriRecord struct { - // Components of a URI record. - Data param.Field[DNSRecordUpdateParamsDNSRecordsUriRecordData] `json:"data,required"` +type DNSRecordReplaceParamsDNSRecordsSshfpRecord struct { + // Components of a SSHFP record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsSshfpRecordData] `json:"data,required"` // DNS record name (or @ for the zone apex) in Punycode. Name param.Field[string] `json:"name,required"` - // Required for MX, SRV and URI records; unused by other record types. Records with - // lower priorities are preferred. - Priority param.Field[float64] `json:"priority,required"` // Record type. - Type param.Field[DNSRecordUpdateParamsDNSRecordsUriRecordType] `json:"type,required"` + Type param.Field[DNSRecordReplaceParamsDNSRecordsSshfpRecordType] `json:"type,required"` // Comments or notes about the DNS record. This field has no effect on DNS // responses. Comment param.Field[string] `json:"comment"` @@ -14378,34 +14503,36 @@ type DNSRecordUpdateParamsDNSRecordsUriRecord struct { // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. // Value must be between 60 and 86400, with the minimum reduced to 30 for // Enterprise zones. - TTL param.Field[DNSRecordUpdateParamsDNSRecordsUriRecordTTL] `json:"ttl"` + TTL param.Field[DNSRecordReplaceParamsDNSRecordsSshfpRecordTTL] `json:"ttl"` } -func (r DNSRecordUpdateParamsDNSRecordsUriRecord) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsSshfpRecord) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (DNSRecordUpdateParamsDNSRecordsUriRecord) ImplementsDNSRecordUpdateParams() { +func (DNSRecordReplaceParamsDNSRecordsSshfpRecord) ImplementsDNSRecordReplaceParams() { } -// Components of a URI record. -type DNSRecordUpdateParamsDNSRecordsUriRecordData struct { - // The record content. - Content param.Field[string] `json:"content"` - // The record weight. - Weight param.Field[float64] `json:"weight"` +// Components of a SSHFP record. +type DNSRecordReplaceParamsDNSRecordsSshfpRecordData struct { + // algorithm. + Algorithm param.Field[float64] `json:"algorithm"` + // fingerprint. + Fingerprint param.Field[string] `json:"fingerprint"` + // type. + Type param.Field[float64] `json:"type"` } -func (r DNSRecordUpdateParamsDNSRecordsUriRecordData) MarshalJSON() (data []byte, err error) { +func (r DNSRecordReplaceParamsDNSRecordsSshfpRecordData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Record type. -type DNSRecordUpdateParamsDNSRecordsUriRecordType string +type DNSRecordReplaceParamsDNSRecordsSshfpRecordType string const ( - DNSRecordUpdateParamsDNSRecordsUriRecordTypeUri DNSRecordUpdateParamsDNSRecordsUriRecordType = "URI" + DNSRecordReplaceParamsDNSRecordsSshfpRecordTypeSshfp DNSRecordReplaceParamsDNSRecordsSshfpRecordType = "SSHFP" ) // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -14413,454 +14540,327 @@ const ( // Enterprise zones. // // Satisfied by [shared.UnionFloat], -// [DNSRecordUpdateParamsDNSRecordsUriRecordTTLNumber]. -type DNSRecordUpdateParamsDNSRecordsUriRecordTTL interface { - ImplementsDNSRecordUpdateParamsDNSRecordsUriRecordTTL() +// [DNSRecordReplaceParamsDNSRecordsSshfpRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsSshfpRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsSshfpRecordTTL() } -type DNSRecordUpdateParamsDNSRecordsUriRecordTTLNumber float64 +type DNSRecordReplaceParamsDNSRecordsSshfpRecordTTLNumber float64 const ( - DNSRecordUpdateParamsDNSRecordsUriRecordTTLNumber1 DNSRecordUpdateParamsDNSRecordsUriRecordTTLNumber = 1 + DNSRecordReplaceParamsDNSRecordsSshfpRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsSshfpRecordTTLNumber = 1 ) -type DNSRecordUpdateResponseEnvelope struct { - Errors []DNSRecordUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []DNSRecordUpdateResponseEnvelopeMessages `json:"messages,required"` - Result DNSRecordUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success DNSRecordUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON dnsRecordUpdateResponseEnvelopeJSON `json:"-"` -} - -// dnsRecordUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [DNSRecordUpdateResponseEnvelope] -type dnsRecordUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DNSRecordUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type DNSRecordUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordUpdateResponseEnvelopeErrorsJSON `json:"-"` +type DNSRecordReplaceParamsDNSRecordsSvcbRecord struct { + // Components of a SVCB record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsSvcbRecordData] `json:"data,required"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `json:"name,required"` + // Record type. + Type param.Field[DNSRecordReplaceParamsDNSRecordsSvcbRecordType] `json:"type,required"` + // Comments or notes about the DNS record. This field has no effect on DNS + // responses. + Comment param.Field[string] `json:"comment"` + // Custom tags for the DNS record. This field has no effect on DNS responses. + Tags param.Field[[]string] `json:"tags"` + // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + // Value must be between 60 and 86400, with the minimum reduced to 30 for + // Enterprise zones. + TTL param.Field[DNSRecordReplaceParamsDNSRecordsSvcbRecordTTL] `json:"ttl"` } -// dnsRecordUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseEnvelopeErrors] -type dnsRecordUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r DNSRecordReplaceParamsDNSRecordsSvcbRecord) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *DNSRecordUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +func (DNSRecordReplaceParamsDNSRecordsSvcbRecord) ImplementsDNSRecordReplaceParams() { -type DNSRecordUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// dnsRecordUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DNSRecordUpdateResponseEnvelopeMessages] -type dnsRecordUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Components of a SVCB record. +type DNSRecordReplaceParamsDNSRecordsSvcbRecordData struct { + // priority. + Priority param.Field[float64] `json:"priority"` + // target. + Target param.Field[string] `json:"target"` + // value. + Value param.Field[string] `json:"value"` } -func (r *DNSRecordUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r DNSRecordReplaceParamsDNSRecordsSvcbRecordData) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type DNSRecordUpdateResponseEnvelopeSuccess bool +// Record type. +type DNSRecordReplaceParamsDNSRecordsSvcbRecordType string const ( - DNSRecordUpdateResponseEnvelopeSuccessTrue DNSRecordUpdateResponseEnvelopeSuccess = true + DNSRecordReplaceParamsDNSRecordsSvcbRecordTypeSvcb DNSRecordReplaceParamsDNSRecordsSvcbRecordType = "SVCB" ) -type DNSRecordListParams struct { - Comment param.Field[DNSRecordListParamsComment] `query:"comment"` - // DNS record content. - Content param.Field[string] `query:"content"` - // Direction to order DNS records in. - Direction param.Field[DNSRecordListParamsDirection] `query:"direction"` - // Whether to match all search requirements or at least one (any). If set to `all`, - // acts like a logical AND between filters. If set to `any`, acts like a logical OR - // instead. Note that the interaction between tag filters is controlled by the - // `tag-match` parameter instead. - Match param.Field[DNSRecordListParamsMatch] `query:"match"` - // DNS record name (or @ for the zone apex) in Punycode. - Name param.Field[string] `query:"name"` - // Field to order DNS records by. - Order param.Field[DNSRecordListParamsOrder] `query:"order"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Number of DNS records per page. - PerPage param.Field[float64] `query:"per_page"` - // Whether the record is receiving the performance and security benefits of - // Cloudflare. - Proxied param.Field[bool] `query:"proxied"` - // Allows searching in multiple properties of a DNS record simultaneously. This - // parameter is intended for human users, not automation. Its exact behavior is - // intentionally left unspecified and is subject to change in the future. This - // parameter works independently of the `match` setting. For automated searches, - // please use the other available parameters. - Search param.Field[string] `query:"search"` - Tag param.Field[DNSRecordListParamsTag] `query:"tag"` - // Whether to match all tag search requirements or at least one (any). If set to - // `all`, acts like a logical AND between tag filters. If set to `any`, acts like a - // logical OR instead. Note that the regular `match` parameter is still used to - // combine the resulting condition with other filters that aren't related to tags. - TagMatch param.Field[DNSRecordListParamsTagMatch] `query:"tag_match"` - // Record type. - Type param.Field[DNSRecordListParamsType] `query:"type"` -} - -// URLQuery serializes [DNSRecordListParams]'s query parameters as `url.Values`. -func (r DNSRecordListParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type DNSRecordListParamsComment struct { - // If this parameter is present, only records _without_ a comment are returned. - Absent param.Field[string] `query:"absent"` - // Substring of the DNS record comment. Comment filters are case-insensitive. - Contains param.Field[string] `query:"contains"` - // Suffix of the DNS record comment. Comment filters are case-insensitive. - Endswith param.Field[string] `query:"endswith"` - // Exact value of the DNS record comment. Comment filters are case-insensitive. - Exact param.Field[string] `query:"exact"` - // If this parameter is present, only records _with_ a comment are returned. - Present param.Field[string] `query:"present"` - // Prefix of the DNS record comment. Comment filters are case-insensitive. - Startswith param.Field[string] `query:"startswith"` -} - -// URLQuery serializes [DNSRecordListParamsComment]'s query parameters as -// `url.Values`. -func (r DNSRecordListParamsComment) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. +// Value must be between 60 and 86400, with the minimum reduced to 30 for +// Enterprise zones. +// +// Satisfied by [shared.UnionFloat], +// [DNSRecordReplaceParamsDNSRecordsSvcbRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsSvcbRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsSvcbRecordTTL() } -// Direction to order DNS records in. -type DNSRecordListParamsDirection string - -const ( - DNSRecordListParamsDirectionAsc DNSRecordListParamsDirection = "asc" - DNSRecordListParamsDirectionDesc DNSRecordListParamsDirection = "desc" -) - -// Whether to match all search requirements or at least one (any). If set to `all`, -// acts like a logical AND between filters. If set to `any`, acts like a logical OR -// instead. Note that the interaction between tag filters is controlled by the -// `tag-match` parameter instead. -type DNSRecordListParamsMatch string - -const ( - DNSRecordListParamsMatchAny DNSRecordListParamsMatch = "any" - DNSRecordListParamsMatchAll DNSRecordListParamsMatch = "all" -) - -// Field to order DNS records by. -type DNSRecordListParamsOrder string +type DNSRecordReplaceParamsDNSRecordsSvcbRecordTTLNumber float64 const ( - DNSRecordListParamsOrderType DNSRecordListParamsOrder = "type" - DNSRecordListParamsOrderName DNSRecordListParamsOrder = "name" - DNSRecordListParamsOrderContent DNSRecordListParamsOrder = "content" - DNSRecordListParamsOrderTTL DNSRecordListParamsOrder = "ttl" - DNSRecordListParamsOrderProxied DNSRecordListParamsOrder = "proxied" + DNSRecordReplaceParamsDNSRecordsSvcbRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsSvcbRecordTTLNumber = 1 ) -type DNSRecordListParamsTag struct { - // Name of a tag which must _not_ be present on the DNS record. Tag filters are - // case-insensitive. - Absent param.Field[string] `query:"absent"` - // A tag and value, of the form `:`. The API will only return - // DNS records that have a tag named `` whose value contains - // ``. Tag filters are case-insensitive. - Contains param.Field[string] `query:"contains"` - // A tag and value, of the form `:`. The API will only return - // DNS records that have a tag named `` whose value ends with - // ``. Tag filters are case-insensitive. - Endswith param.Field[string] `query:"endswith"` - // A tag and value, of the form `:`. The API will only return - // DNS records that have a tag named `` whose value is ``. Tag - // filters are case-insensitive. - Exact param.Field[string] `query:"exact"` - // Name of a tag which must be present on the DNS record. Tag filters are - // case-insensitive. - Present param.Field[string] `query:"present"` - // A tag and value, of the form `:`. The API will only return - // DNS records that have a tag named `` whose value starts with - // ``. Tag filters are case-insensitive. - Startswith param.Field[string] `query:"startswith"` +type DNSRecordReplaceParamsDNSRecordsTlsaRecord struct { + // Components of a TLSA record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsTlsaRecordData] `json:"data,required"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `json:"name,required"` + // Record type. + Type param.Field[DNSRecordReplaceParamsDNSRecordsTlsaRecordType] `json:"type,required"` + // Comments or notes about the DNS record. This field has no effect on DNS + // responses. + Comment param.Field[string] `json:"comment"` + // Custom tags for the DNS record. This field has no effect on DNS responses. + Tags param.Field[[]string] `json:"tags"` + // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + // Value must be between 60 and 86400, with the minimum reduced to 30 for + // Enterprise zones. + TTL param.Field[DNSRecordReplaceParamsDNSRecordsTlsaRecordTTL] `json:"ttl"` } -// URLQuery serializes [DNSRecordListParamsTag]'s query parameters as `url.Values`. -func (r DNSRecordListParamsTag) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +func (r DNSRecordReplaceParamsDNSRecordsTlsaRecord) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether to match all tag search requirements or at least one (any). If set to -// `all`, acts like a logical AND between tag filters. If set to `any`, acts like a -// logical OR instead. Note that the regular `match` parameter is still used to -// combine the resulting condition with other filters that aren't related to tags. -type DNSRecordListParamsTagMatch string +func (DNSRecordReplaceParamsDNSRecordsTlsaRecord) ImplementsDNSRecordReplaceParams() { -const ( - DNSRecordListParamsTagMatchAny DNSRecordListParamsTagMatch = "any" - DNSRecordListParamsTagMatchAll DNSRecordListParamsTagMatch = "all" -) +} + +// Components of a TLSA record. +type DNSRecordReplaceParamsDNSRecordsTlsaRecordData struct { + // certificate. + Certificate param.Field[string] `json:"certificate"` + // Matching Type. + MatchingType param.Field[float64] `json:"matching_type"` + // Selector. + Selector param.Field[float64] `json:"selector"` + // Usage. + Usage param.Field[float64] `json:"usage"` +} + +func (r DNSRecordReplaceParamsDNSRecordsTlsaRecordData) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} // Record type. -type DNSRecordListParamsType string +type DNSRecordReplaceParamsDNSRecordsTlsaRecordType string const ( - DNSRecordListParamsTypeA DNSRecordListParamsType = "A" - DNSRecordListParamsTypeAaaa DNSRecordListParamsType = "AAAA" - DNSRecordListParamsTypeCaa DNSRecordListParamsType = "CAA" - DNSRecordListParamsTypeCert DNSRecordListParamsType = "CERT" - DNSRecordListParamsTypeCname DNSRecordListParamsType = "CNAME" - DNSRecordListParamsTypeDnskey DNSRecordListParamsType = "DNSKEY" - DNSRecordListParamsTypeDs DNSRecordListParamsType = "DS" - DNSRecordListParamsTypeHTTPS DNSRecordListParamsType = "HTTPS" - DNSRecordListParamsTypeLoc DNSRecordListParamsType = "LOC" - DNSRecordListParamsTypeMx DNSRecordListParamsType = "MX" - DNSRecordListParamsTypeNaptr DNSRecordListParamsType = "NAPTR" - DNSRecordListParamsTypeNs DNSRecordListParamsType = "NS" - DNSRecordListParamsTypePtr DNSRecordListParamsType = "PTR" - DNSRecordListParamsTypeSmimea DNSRecordListParamsType = "SMIMEA" - DNSRecordListParamsTypeSrv DNSRecordListParamsType = "SRV" - DNSRecordListParamsTypeSshfp DNSRecordListParamsType = "SSHFP" - DNSRecordListParamsTypeSvcb DNSRecordListParamsType = "SVCB" - DNSRecordListParamsTypeTlsa DNSRecordListParamsType = "TLSA" - DNSRecordListParamsTypeTxt DNSRecordListParamsType = "TXT" - DNSRecordListParamsTypeUri DNSRecordListParamsType = "URI" + DNSRecordReplaceParamsDNSRecordsTlsaRecordTypeTlsa DNSRecordReplaceParamsDNSRecordsTlsaRecordType = "TLSA" ) -type DNSRecordDeleteResponseEnvelope struct { - Result DNSRecordDeleteResponse `json:"result"` - JSON dnsRecordDeleteResponseEnvelopeJSON `json:"-"` +// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. +// Value must be between 60 and 86400, with the minimum reduced to 30 for +// Enterprise zones. +// +// Satisfied by [shared.UnionFloat], +// [DNSRecordReplaceParamsDNSRecordsTlsaRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsTlsaRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsTlsaRecordTTL() } -// dnsRecordDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [DNSRecordDeleteResponseEnvelope] -type dnsRecordDeleteResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +type DNSRecordReplaceParamsDNSRecordsTlsaRecordTTLNumber float64 -func (r *DNSRecordDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +const ( + DNSRecordReplaceParamsDNSRecordsTlsaRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsTlsaRecordTTLNumber = 1 +) -type DNSRecordGetResponseEnvelope struct { - Errors []DNSRecordGetResponseEnvelopeErrors `json:"errors,required"` - Messages []DNSRecordGetResponseEnvelopeMessages `json:"messages,required"` - Result DNSRecordGetResponse `json:"result,required"` - // Whether the API call was successful - Success DNSRecordGetResponseEnvelopeSuccess `json:"success,required"` - JSON dnsRecordGetResponseEnvelopeJSON `json:"-"` +type DNSRecordReplaceParamsDNSRecordsTxtRecord struct { + // Text content for the record. + Content param.Field[string] `json:"content,required"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `json:"name,required"` + // Record type. + Type param.Field[DNSRecordReplaceParamsDNSRecordsTxtRecordType] `json:"type,required"` + // Comments or notes about the DNS record. This field has no effect on DNS + // responses. + Comment param.Field[string] `json:"comment"` + // Custom tags for the DNS record. This field has no effect on DNS responses. + Tags param.Field[[]string] `json:"tags"` + // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + // Value must be between 60 and 86400, with the minimum reduced to 30 for + // Enterprise zones. + TTL param.Field[DNSRecordReplaceParamsDNSRecordsTxtRecordTTL] `json:"ttl"` } -// dnsRecordGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [DNSRecordGetResponseEnvelope] -type dnsRecordGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r DNSRecordReplaceParamsDNSRecordsTxtRecord) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *DNSRecordGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (DNSRecordReplaceParamsDNSRecordsTxtRecord) ImplementsDNSRecordReplaceParams() { + } -type DNSRecordGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordGetResponseEnvelopeErrorsJSON `json:"-"` +// Record type. +type DNSRecordReplaceParamsDNSRecordsTxtRecordType string + +const ( + DNSRecordReplaceParamsDNSRecordsTxtRecordTypeTxt DNSRecordReplaceParamsDNSRecordsTxtRecordType = "TXT" +) + +// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. +// Value must be between 60 and 86400, with the minimum reduced to 30 for +// Enterprise zones. +// +// Satisfied by [shared.UnionFloat], +// [DNSRecordReplaceParamsDNSRecordsTxtRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsTxtRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsTxtRecordTTL() } -// dnsRecordGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [DNSRecordGetResponseEnvelopeErrors] -type dnsRecordGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type DNSRecordReplaceParamsDNSRecordsTxtRecordTTLNumber float64 + +const ( + DNSRecordReplaceParamsDNSRecordsTxtRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsTxtRecordTTLNumber = 1 +) + +type DNSRecordReplaceParamsDNSRecordsUriRecord struct { + // Components of a URI record. + Data param.Field[DNSRecordReplaceParamsDNSRecordsUriRecordData] `json:"data,required"` + // DNS record name (or @ for the zone apex) in Punycode. + Name param.Field[string] `json:"name,required"` + // Required for MX, SRV and URI records; unused by other record types. Records with + // lower priorities are preferred. + Priority param.Field[float64] `json:"priority,required"` + // Record type. + Type param.Field[DNSRecordReplaceParamsDNSRecordsUriRecordType] `json:"type,required"` + // Comments or notes about the DNS record. This field has no effect on DNS + // responses. + Comment param.Field[string] `json:"comment"` + // Custom tags for the DNS record. This field has no effect on DNS responses. + Tags param.Field[[]string] `json:"tags"` + // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + // Value must be between 60 and 86400, with the minimum reduced to 30 for + // Enterprise zones. + TTL param.Field[DNSRecordReplaceParamsDNSRecordsUriRecordTTL] `json:"ttl"` } -func (r *DNSRecordGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r DNSRecordReplaceParamsDNSRecordsUriRecord) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type DNSRecordGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordGetResponseEnvelopeMessagesJSON `json:"-"` +func (DNSRecordReplaceParamsDNSRecordsUriRecord) ImplementsDNSRecordReplaceParams() { + } -// dnsRecordGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DNSRecordGetResponseEnvelopeMessages] -type dnsRecordGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Components of a URI record. +type DNSRecordReplaceParamsDNSRecordsUriRecordData struct { + // The record content. + Content param.Field[string] `json:"content"` + // The record weight. + Weight param.Field[float64] `json:"weight"` } -func (r *DNSRecordGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r DNSRecordReplaceParamsDNSRecordsUriRecordData) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type DNSRecordGetResponseEnvelopeSuccess bool +// Record type. +type DNSRecordReplaceParamsDNSRecordsUriRecordType string const ( - DNSRecordGetResponseEnvelopeSuccessTrue DNSRecordGetResponseEnvelopeSuccess = true + DNSRecordReplaceParamsDNSRecordsUriRecordTypeUri DNSRecordReplaceParamsDNSRecordsUriRecordType = "URI" ) -type DNSRecordImportParams struct { - // BIND config to import. - // - // **Tip:** When using cURL, a file can be uploaded using - // `--form 'file=@bind_config.txt'`. - File param.Field[string] `json:"file,required"` - // Whether or not proxiable records should receive the performance and security - // benefits of Cloudflare. - // - // The value should be either `true` or `false`. - Proxied param.Field[string] `json:"proxied"` +// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. +// Value must be between 60 and 86400, with the minimum reduced to 30 for +// Enterprise zones. +// +// Satisfied by [shared.UnionFloat], +// [DNSRecordReplaceParamsDNSRecordsUriRecordTTLNumber]. +type DNSRecordReplaceParamsDNSRecordsUriRecordTTL interface { + ImplementsDNSRecordReplaceParamsDNSRecordsUriRecordTTL() } -func (r DNSRecordImportParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} +type DNSRecordReplaceParamsDNSRecordsUriRecordTTLNumber float64 -type DNSRecordImportResponseEnvelope struct { - Errors []DNSRecordImportResponseEnvelopeErrors `json:"errors,required"` - Messages []DNSRecordImportResponseEnvelopeMessages `json:"messages,required"` - Result DNSRecordImportResponse `json:"result,required"` +const ( + DNSRecordReplaceParamsDNSRecordsUriRecordTTLNumber1 DNSRecordReplaceParamsDNSRecordsUriRecordTTLNumber = 1 +) + +type DNSRecordReplaceResponseEnvelope struct { + Errors []DNSRecordReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSRecordReplaceResponseEnvelopeMessages `json:"messages,required"` + Result DNSRecordReplaceResponse `json:"result,required"` // Whether the API call was successful - Success DNSRecordImportResponseEnvelopeSuccess `json:"success,required"` - Timing DNSRecordImportResponseEnvelopeTiming `json:"timing"` - JSON dnsRecordImportResponseEnvelopeJSON `json:"-"` + Success DNSRecordReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON dnsRecordReplaceResponseEnvelopeJSON `json:"-"` } -// dnsRecordImportResponseEnvelopeJSON contains the JSON metadata for the struct -// [DNSRecordImportResponseEnvelope] -type dnsRecordImportResponseEnvelopeJSON struct { +// dnsRecordReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [DNSRecordReplaceResponseEnvelope] +type dnsRecordReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - Timing apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordImportResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DNSRecordImportResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordImportResponseEnvelopeErrorsJSON `json:"-"` +type DNSRecordReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// dnsRecordImportResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [DNSRecordImportResponseEnvelopeErrors] -type dnsRecordImportResponseEnvelopeErrorsJSON struct { +// dnsRecordReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [DNSRecordReplaceResponseEnvelopeErrors] +type dnsRecordReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordImportResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type DNSRecordImportResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON dnsRecordImportResponseEnvelopeMessagesJSON `json:"-"` +type DNSRecordReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnsRecordReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// dnsRecordImportResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [DNSRecordImportResponseEnvelopeMessages] -type dnsRecordImportResponseEnvelopeMessagesJSON struct { +// dnsRecordReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DNSRecordReplaceResponseEnvelopeMessages] +type dnsRecordReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *DNSRecordImportResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *DNSRecordReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type DNSRecordImportResponseEnvelopeSuccess bool +type DNSRecordReplaceResponseEnvelopeSuccess bool const ( - DNSRecordImportResponseEnvelopeSuccessTrue DNSRecordImportResponseEnvelopeSuccess = true + DNSRecordReplaceResponseEnvelopeSuccessTrue DNSRecordReplaceResponseEnvelopeSuccess = true ) -type DNSRecordImportResponseEnvelopeTiming struct { - // When the file parsing ended. - EndTime time.Time `json:"end_time" format:"date-time"` - // Processing time of the file in seconds. - ProcessTime float64 `json:"process_time"` - // When the file parsing started. - StartTime time.Time `json:"start_time" format:"date-time"` - JSON dnsRecordImportResponseEnvelopeTimingJSON `json:"-"` -} - -// dnsRecordImportResponseEnvelopeTimingJSON contains the JSON metadata for the -// struct [DNSRecordImportResponseEnvelopeTiming] -type dnsRecordImportResponseEnvelopeTimingJSON struct { - EndTime apijson.Field - ProcessTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *DNSRecordImportResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type DNSRecordScanResponseEnvelope struct { Errors []DNSRecordScanResponseEnvelopeErrors `json:"errors,required"` Messages []DNSRecordScanResponseEnvelopeMessages `json:"messages,required"` diff --git a/dnsrecord_test.go b/dnsrecord_test.go index d8f3d6b2be5..80a098f0e3c 100644 --- a/dnsrecord_test.go +++ b/dnsrecord_test.go @@ -52,45 +52,6 @@ func TestDNSRecordNewWithOptionalParams(t *testing.T) { } } -func TestDNSRecordUpdateWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.DNSRecords.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.DNSRecordUpdateParamsDNSRecordsARecord{ - Content: cloudflare.F("198.51.100.4"), - Name: cloudflare.F("example.com"), - Type: cloudflare.F(cloudflare.DNSRecordUpdateParamsDNSRecordsARecordTypeA), - Comment: cloudflare.F("Domain verification record"), - Proxied: cloudflare.F(false), - Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}), - TTL: cloudflare.F[cloudflare.DNSRecordUpdateParamsDNSRecordsARecordTTL](shared.UnionFloat(3600.000000)), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - func TestDNSRecordListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -268,6 +229,45 @@ func TestDNSRecordImportWithOptionalParams(t *testing.T) { } } +func TestDNSRecordReplaceWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.DNSRecords.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.DNSRecordReplaceParamsDNSRecordsARecord{ + Content: cloudflare.F("198.51.100.4"), + Name: cloudflare.F("example.com"), + Type: cloudflare.F(cloudflare.DNSRecordReplaceParamsDNSRecordsARecordTypeA), + Comment: cloudflare.F("Domain verification record"), + Proxied: cloudflare.F(false), + Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}), + TTL: cloudflare.F[cloudflare.DNSRecordReplaceParamsDNSRecordsARecordTTL](shared.UnionFloat(3600.000000)), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestDNSRecordScan(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" diff --git a/dnssec.go b/dnssec.go index 2e9a43f7227..a4965567409 100644 --- a/dnssec.go +++ b/dnssec.go @@ -6,12 +6,15 @@ import ( "context" "fmt" "net/http" + "reflect" "time" "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" ) // DNSSECService contains methods and other services that help with interacting @@ -44,6 +47,19 @@ func (r *DNSSECService) Update(ctx context.Context, zoneID string, body DNSSECUp return } +// Delete DNSSEC. +func (r *DNSSECService) Delete(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *DNSSECDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env DNSSECDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/dnssec", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Details about DNSSEC status and configuration. func (r *DNSSECService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *DNSSECGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -135,6 +151,22 @@ const ( DNSSECUpdateResponseStatusError DNSSECUpdateResponseStatus = "error" ) +// Union satisfied by [DNSSECDeleteResponseUnknown] or [shared.UnionString]. +type DNSSECDeleteResponse interface { + ImplementsDNSSECDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*DNSSECDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + type DNSSECGetResponse struct { // Algorithm key code. Algorithm string `json:"algorithm,nullable"` @@ -316,6 +348,75 @@ const ( DNSSECUpdateResponseEnvelopeSuccessTrue DNSSECUpdateResponseEnvelopeSuccess = true ) +type DNSSECDeleteResponseEnvelope struct { + Errors []DNSSECDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSSECDeleteResponseEnvelopeMessages `json:"messages,required"` + Result DNSSECDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success DNSSECDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON dnssecDeleteResponseEnvelopeJSON `json:"-"` +} + +// dnssecDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [DNSSECDeleteResponseEnvelope] +type dnssecDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSSECDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSSECDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnssecDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// dnssecDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [DNSSECDeleteResponseEnvelopeErrors] +type dnssecDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSSECDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type DNSSECDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON dnssecDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// dnssecDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [DNSSECDeleteResponseEnvelopeMessages] +type dnssecDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *DNSSECDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type DNSSECDeleteResponseEnvelopeSuccess bool + +const ( + DNSSECDeleteResponseEnvelopeSuccessTrue DNSSECDeleteResponseEnvelopeSuccess = true +) + type DNSSECGetResponseEnvelope struct { Errors []DNSSECGetResponseEnvelopeErrors `json:"errors,required"` Messages []DNSSECGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/dnssec_test.go b/dnssec_test.go index 171d773a2e5..e61a3ff8e5d 100644 --- a/dnssec_test.go +++ b/dnssec_test.go @@ -29,7 +29,7 @@ func TestDNSSECUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSSECs.Update( + _, err := client.DNSSEC.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.DNSSECUpdateParams{ @@ -47,6 +47,32 @@ func TestDNSSECUpdateWithOptionalParams(t *testing.T) { } } +func TestDNSSECDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.DNSSEC.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestDNSSECGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -63,7 +89,7 @@ func TestDNSSECGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DNSSECs.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.DNSSEC.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/email.go b/email.go index 8c295651c3c..b2aed1d6886 100644 --- a/email.go +++ b/email.go @@ -11,8 +11,8 @@ import ( // from the environment automatically. You should not instantiate this service // directly, and instead use the [NewEmailService] method instead. type EmailService struct { - Options []option.RequestOption - Routings *EmailRoutingService + Options []option.RequestOption + Routing *EmailRoutingService } // NewEmailService generates a new service that applies the given options to each @@ -21,6 +21,6 @@ type EmailService struct { func NewEmailService(opts ...option.RequestOption) (r *EmailService) { r = &EmailService{} r.Options = opts - r.Routings = NewEmailRoutingService(opts...) + r.Routing = NewEmailRoutingService(opts...) return } diff --git a/emailrouting.go b/emailrouting.go index 5e6b031ea71..db1491af441 100644 --- a/emailrouting.go +++ b/emailrouting.go @@ -42,9 +42,9 @@ func NewEmailRoutingService(opts ...option.RequestOption) (r *EmailRoutingServic } // Get information about the settings for your Email Routing zone. -func (r *EmailRoutingService) EmailRoutingSettingsGetEmailRoutingSettings(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse, err error) { +func (r *EmailRoutingService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelope + var env EmailRoutingGetResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -54,31 +54,30 @@ func (r *EmailRoutingService) EmailRoutingSettingsGetEmailRoutingSettings(ctx co return } -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse struct { +type EmailRoutingGetResponse struct { // Email Routing settings identifier. ID string `json:"id"` // The date and time the settings have been created. Created time.Time `json:"created" format:"date-time"` // State of the zone settings for Email Routing. - Enabled EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabled `json:"enabled"` + Enabled EmailRoutingGetResponseEnabled `json:"enabled"` // The date and time the settings have been modified. Modified time.Time `json:"modified" format:"date-time"` // Domain of your zone. Name string `json:"name"` // Flag to check if the user skipped the configuration wizard. - SkipWizard EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizard `json:"skip_wizard"` + SkipWizard EmailRoutingGetResponseSkipWizard `json:"skip_wizard"` // Show the state of your account, and the type or configuration error. - Status EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus `json:"status"` + Status EmailRoutingGetResponseStatus `json:"status"` // Email Routing settings tag. (Deprecated, replaced by Email Routing settings // identifier) - Tag string `json:"tag"` - JSON emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingGetResponseJSON `json:"-"` } -// emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseJSON contains the -// JSON metadata for the struct -// [EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse] -type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseJSON struct { +// emailRoutingGetResponseJSON contains the JSON metadata for the struct +// [EmailRoutingGetResponse] +type emailRoutingGetResponseJSON struct { ID apijson.Field Created apijson.Field Enabled apijson.Field @@ -91,50 +90,49 @@ type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // State of the zone settings for Email Routing. -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabled bool +type EmailRoutingGetResponseEnabled bool const ( - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabledTrue EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabled = true - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabledFalse EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnabled = false + EmailRoutingGetResponseEnabledTrue EmailRoutingGetResponseEnabled = true + EmailRoutingGetResponseEnabledFalse EmailRoutingGetResponseEnabled = false ) // Flag to check if the user skipped the configuration wizard. -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizard bool +type EmailRoutingGetResponseSkipWizard bool const ( - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizardTrue EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizard = true - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizardFalse EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseSkipWizard = false + EmailRoutingGetResponseSkipWizardTrue EmailRoutingGetResponseSkipWizard = true + EmailRoutingGetResponseSkipWizardFalse EmailRoutingGetResponseSkipWizard = false ) // Show the state of your account, and the type or configuration error. -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus string +type EmailRoutingGetResponseStatus string const ( - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatusReady EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus = "ready" - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatusUnconfigured EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus = "unconfigured" - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatusMisconfigured EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus = "misconfigured" - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatusMisconfiguredLocked EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus = "misconfigured/locked" - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatusUnlocked EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseStatus = "unlocked" + EmailRoutingGetResponseStatusReady EmailRoutingGetResponseStatus = "ready" + EmailRoutingGetResponseStatusUnconfigured EmailRoutingGetResponseStatus = "unconfigured" + EmailRoutingGetResponseStatusMisconfigured EmailRoutingGetResponseStatus = "misconfigured" + EmailRoutingGetResponseStatusMisconfiguredLocked EmailRoutingGetResponseStatus = "misconfigured/locked" + EmailRoutingGetResponseStatusUnlocked EmailRoutingGetResponseStatus = "unlocked" ) -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelope struct { - Errors []EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponse `json:"result,required"` +type EmailRoutingGetResponseEnvelope struct { + Errors []EmailRoutingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingGetResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingGetResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeJSON `json:"-"` + Success EmailRoutingGetResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingGetResponseEnvelopeJSON `json:"-"` } -// emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelope] -type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeJSON struct { +// emailRoutingGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [EmailRoutingGetResponseEnvelope] +type emailRoutingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -143,53 +141,51 @@ type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingGetResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrors] -type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrorsJSON struct { +// emailRoutingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [EmailRoutingGetResponseEnvelopeErrors] +type emailRoutingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingGetResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessages] -type emailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessagesJSON struct { +// emailRoutingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [EmailRoutingGetResponseEnvelopeMessages] +type emailRoutingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeSuccess bool +type EmailRoutingGetResponseEnvelopeSuccess bool const ( - EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeSuccessTrue EmailRoutingEmailRoutingSettingsGetEmailRoutingSettingsResponseEnvelopeSuccess = true + EmailRoutingGetResponseEnvelopeSuccessTrue EmailRoutingGetResponseEnvelopeSuccess = true ) diff --git a/emailrouting_test.go b/emailrouting_test.go index db73eca49b3..c55e59c8e5e 100644 --- a/emailrouting_test.go +++ b/emailrouting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingEmailRoutingSettingsGetEmailRoutingSettings(t *testing.T) { +func TestEmailRoutingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestEmailRoutingEmailRoutingSettingsGetEmailRoutingSettings(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.EmailRoutingSettingsGetEmailRoutingSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Emails.Routing.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/emailroutingaddress.go b/emailroutingaddress.go index 8e8229cea64..ff9d12565fc 100644 --- a/emailroutingaddress.go +++ b/emailroutingaddress.go @@ -34,12 +34,13 @@ func NewEmailRoutingAddressService(opts ...option.RequestOption) (r *EmailRoutin return } -// Deletes a specific destination address. -func (r *EmailRoutingAddressService) Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *EmailRoutingAddressDeleteResponse, err error) { +// Create a destination address to forward your emails to. Destination addresses +// need to be verified before they can be used. +func (r *EmailRoutingAddressService) New(ctx context.Context, accountIdentifier string, body EmailRoutingAddressNewParams, opts ...option.RequestOption) (res *EmailRoutingAddressNewResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingAddressDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env EmailRoutingAddressNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,13 +48,12 @@ func (r *EmailRoutingAddressService) Delete(ctx context.Context, accountIdentifi return } -// Create a destination address to forward your emails to. Destination addresses -// need to be verified before they can be used. -func (r *EmailRoutingAddressService) EmailRoutingDestinationAddressesNewADestinationAddress(ctx context.Context, accountIdentifier string, body EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressParams, opts ...option.RequestOption) (res *EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse, err error) { +// Deletes a specific destination address. +func (r *EmailRoutingAddressService) Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *EmailRoutingAddressDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelope - path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env EmailRoutingAddressDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -87,7 +87,7 @@ func (r *EmailRoutingAddressService) Get(ctx context.Context, accountIdentifier return } -type EmailRoutingAddressDeleteResponse struct { +type EmailRoutingAddressNewResponse struct { // Destination address identifier. ID string `json:"id"` // The date and time the destination address has been created. @@ -101,13 +101,13 @@ type EmailRoutingAddressDeleteResponse struct { Tag string `json:"tag"` // The date and time the destination address has been verified. Null means not // verified yet. - Verified time.Time `json:"verified" format:"date-time"` - JSON emailRoutingAddressDeleteResponseJSON `json:"-"` + Verified time.Time `json:"verified" format:"date-time"` + JSON emailRoutingAddressNewResponseJSON `json:"-"` } -// emailRoutingAddressDeleteResponseJSON contains the JSON metadata for the struct -// [EmailRoutingAddressDeleteResponse] -type emailRoutingAddressDeleteResponseJSON struct { +// emailRoutingAddressNewResponseJSON contains the JSON metadata for the struct +// [EmailRoutingAddressNewResponse] +type emailRoutingAddressNewResponseJSON struct { ID apijson.Field Created apijson.Field Email apijson.Field @@ -118,11 +118,11 @@ type emailRoutingAddressDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse struct { +type EmailRoutingAddressDeleteResponse struct { // Destination address identifier. ID string `json:"id"` // The date and time the destination address has been created. @@ -136,14 +136,13 @@ type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressRe Tag string `json:"tag"` // The date and time the destination address has been verified. Null means not // verified yet. - Verified time.Time `json:"verified" format:"date-time"` - JSON emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseJSON `json:"-"` + Verified time.Time `json:"verified" format:"date-time"` + JSON emailRoutingAddressDeleteResponseJSON `json:"-"` } -// emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseJSON -// contains the JSON metadata for the struct -// [EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse] -type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseJSON struct { +// emailRoutingAddressDeleteResponseJSON contains the JSON metadata for the struct +// [EmailRoutingAddressDeleteResponse] +type emailRoutingAddressDeleteResponseJSON struct { ID apijson.Field Created apijson.Field Email apijson.Field @@ -154,7 +153,7 @@ type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressRe ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -229,18 +228,27 @@ func (r *EmailRoutingAddressGetResponse) UnmarshalJSON(data []byte) (err error) return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressDeleteResponseEnvelope struct { - Errors []EmailRoutingAddressDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingAddressDeleteResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingAddressDeleteResponse `json:"result,required"` +type EmailRoutingAddressNewParams struct { + // The contact email address of the user. + Email param.Field[string] `json:"email,required"` +} + +func (r EmailRoutingAddressNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type EmailRoutingAddressNewResponseEnvelope struct { + Errors []EmailRoutingAddressNewResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingAddressNewResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingAddressNewResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingAddressDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingAddressDeleteResponseEnvelopeJSON `json:"-"` + Success EmailRoutingAddressNewResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingAddressNewResponseEnvelopeJSON `json:"-"` } -// emailRoutingAddressDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [EmailRoutingAddressDeleteResponseEnvelope] -type emailRoutingAddressDeleteResponseEnvelopeJSON struct { +// emailRoutingAddressNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingAddressNewResponseEnvelope] +type emailRoutingAddressNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -249,77 +257,67 @@ type emailRoutingAddressDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingAddressDeleteResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingAddressNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingAddressNewResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingAddressDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [EmailRoutingAddressDeleteResponseEnvelopeErrors] -type emailRoutingAddressDeleteResponseEnvelopeErrorsJSON struct { +// emailRoutingAddressNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [EmailRoutingAddressNewResponseEnvelopeErrors] +type emailRoutingAddressNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingAddressDeleteResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingAddressNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingAddressNewResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingAddressDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [EmailRoutingAddressDeleteResponseEnvelopeMessages] -type emailRoutingAddressDeleteResponseEnvelopeMessagesJSON struct { +// emailRoutingAddressNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [EmailRoutingAddressNewResponseEnvelopeMessages] +type emailRoutingAddressNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingAddressDeleteResponseEnvelopeSuccess bool +type EmailRoutingAddressNewResponseEnvelopeSuccess bool const ( - EmailRoutingAddressDeleteResponseEnvelopeSuccessTrue EmailRoutingAddressDeleteResponseEnvelopeSuccess = true + EmailRoutingAddressNewResponseEnvelopeSuccessTrue EmailRoutingAddressNewResponseEnvelopeSuccess = true ) -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressParams struct { - // The contact email address of the user. - Email param.Field[string] `json:"email,required"` -} - -func (r EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelope struct { - Errors []EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponse `json:"result,required"` +type EmailRoutingAddressDeleteResponseEnvelope struct { + Errors []EmailRoutingAddressDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingAddressDeleteResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingAddressDeleteResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeJSON `json:"-"` + Success EmailRoutingAddressDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingAddressDeleteResponseEnvelopeJSON `json:"-"` } -// emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelope] -type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeJSON struct { +// emailRoutingAddressDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingAddressDeleteResponseEnvelope] +type emailRoutingAddressDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -328,55 +326,53 @@ type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressRe ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingAddressDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingAddressDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrors] -type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrorsJSON struct { +// emailRoutingAddressDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [EmailRoutingAddressDeleteResponseEnvelopeErrors] +type emailRoutingAddressDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingAddressDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingAddressDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessages] -type emailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessagesJSON struct { +// emailRoutingAddressDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [EmailRoutingAddressDeleteResponseEnvelopeMessages] +type emailRoutingAddressDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingAddressDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeSuccess bool +type EmailRoutingAddressDeleteResponseEnvelopeSuccess bool const ( - EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeSuccessTrue EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressResponseEnvelopeSuccess = true + EmailRoutingAddressDeleteResponseEnvelopeSuccessTrue EmailRoutingAddressDeleteResponseEnvelopeSuccess = true ) type EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesParams struct { diff --git a/emailroutingaddress_test.go b/emailroutingaddress_test.go index 5bcd095c8d3..a878b52993c 100644 --- a/emailroutingaddress_test.go +++ b/emailroutingaddress_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingAddressDelete(t *testing.T) { +func TestEmailRoutingAddressNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,12 @@ func TestEmailRoutingAddressDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Addresses.Delete( + _, err := client.Emails.Routing.Addresses.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", + cloudflare.EmailRoutingAddressNewParams{ + Email: cloudflare.F("user@example.com"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +45,7 @@ func TestEmailRoutingAddressDelete(t *testing.T) { } } -func TestEmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddress(t *testing.T) { +func TestEmailRoutingAddressDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,12 +61,10 @@ func TestEmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddre option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Addresses.EmailRoutingDestinationAddressesNewADestinationAddress( + _, err := client.Emails.Routing.Addresses.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesNewADestinationAddressParams{ - Email: cloudflare.F("user@example.com"), - }, + "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error @@ -91,7 +91,7 @@ func TestEmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddre option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Addresses.EmailRoutingDestinationAddressesListDestinationAddresses( + _, err := client.Emails.Routing.Addresses.EmailRoutingDestinationAddressesListDestinationAddresses( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.EmailRoutingAddressEmailRoutingDestinationAddressesListDestinationAddressesParams{ @@ -126,7 +126,7 @@ func TestEmailRoutingAddressGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Addresses.Get( + _, err := client.Emails.Routing.Addresses.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", diff --git a/emailroutingdisable.go b/emailroutingdisable.go index 0e29de6494d..2ada7bcc695 100644 --- a/emailroutingdisable.go +++ b/emailroutingdisable.go @@ -33,9 +33,9 @@ func NewEmailRoutingDisableService(opts ...option.RequestOption) (r *EmailRoutin // Disable your Email Routing zone. Also removes additional MX records previously // required for Email Routing to work. -func (r *EmailRoutingDisableService) EmailRoutingSettingsDisableEmailRouting(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse, err error) { +func (r *EmailRoutingDisableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingDisableNewResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelope + var env EmailRoutingDisableNewResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -45,31 +45,30 @@ func (r *EmailRoutingDisableService) EmailRoutingSettingsDisableEmailRouting(ctx return } -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse struct { +type EmailRoutingDisableNewResponse struct { // Email Routing settings identifier. ID string `json:"id"` // The date and time the settings have been created. Created time.Time `json:"created" format:"date-time"` // State of the zone settings for Email Routing. - Enabled EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabled `json:"enabled"` + Enabled EmailRoutingDisableNewResponseEnabled `json:"enabled"` // The date and time the settings have been modified. Modified time.Time `json:"modified" format:"date-time"` // Domain of your zone. Name string `json:"name"` // Flag to check if the user skipped the configuration wizard. - SkipWizard EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizard `json:"skip_wizard"` + SkipWizard EmailRoutingDisableNewResponseSkipWizard `json:"skip_wizard"` // Show the state of your account, and the type or configuration error. - Status EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus `json:"status"` + Status EmailRoutingDisableNewResponseStatus `json:"status"` // Email Routing settings tag. (Deprecated, replaced by Email Routing settings // identifier) - Tag string `json:"tag"` - JSON emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingDisableNewResponseJSON `json:"-"` } -// emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseJSON contains -// the JSON metadata for the struct -// [EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse] -type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseJSON struct { +// emailRoutingDisableNewResponseJSON contains the JSON metadata for the struct +// [EmailRoutingDisableNewResponse] +type emailRoutingDisableNewResponseJSON struct { ID apijson.Field Created apijson.Field Enabled apijson.Field @@ -82,50 +81,49 @@ type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseJSON stru ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDisableNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // State of the zone settings for Email Routing. -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabled bool +type EmailRoutingDisableNewResponseEnabled bool const ( - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabledTrue EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabled = true - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabledFalse EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnabled = false + EmailRoutingDisableNewResponseEnabledTrue EmailRoutingDisableNewResponseEnabled = true + EmailRoutingDisableNewResponseEnabledFalse EmailRoutingDisableNewResponseEnabled = false ) // Flag to check if the user skipped the configuration wizard. -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizard bool +type EmailRoutingDisableNewResponseSkipWizard bool const ( - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizardTrue EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizard = true - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizardFalse EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseSkipWizard = false + EmailRoutingDisableNewResponseSkipWizardTrue EmailRoutingDisableNewResponseSkipWizard = true + EmailRoutingDisableNewResponseSkipWizardFalse EmailRoutingDisableNewResponseSkipWizard = false ) // Show the state of your account, and the type or configuration error. -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus string +type EmailRoutingDisableNewResponseStatus string const ( - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatusReady EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus = "ready" - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatusUnconfigured EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus = "unconfigured" - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatusMisconfigured EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus = "misconfigured" - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatusMisconfiguredLocked EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus = "misconfigured/locked" - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatusUnlocked EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseStatus = "unlocked" + EmailRoutingDisableNewResponseStatusReady EmailRoutingDisableNewResponseStatus = "ready" + EmailRoutingDisableNewResponseStatusUnconfigured EmailRoutingDisableNewResponseStatus = "unconfigured" + EmailRoutingDisableNewResponseStatusMisconfigured EmailRoutingDisableNewResponseStatus = "misconfigured" + EmailRoutingDisableNewResponseStatusMisconfiguredLocked EmailRoutingDisableNewResponseStatus = "misconfigured/locked" + EmailRoutingDisableNewResponseStatusUnlocked EmailRoutingDisableNewResponseStatus = "unlocked" ) -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelope struct { - Errors []EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponse `json:"result,required"` +type EmailRoutingDisableNewResponseEnvelope struct { + Errors []EmailRoutingDisableNewResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingDisableNewResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingDisableNewResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeJSON `json:"-"` + Success EmailRoutingDisableNewResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingDisableNewResponseEnvelopeJSON `json:"-"` } -// emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelope] -type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeJSON struct { +// emailRoutingDisableNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingDisableNewResponseEnvelope] +type emailRoutingDisableNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -134,53 +132,51 @@ type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeJ ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDisableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingDisableNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingDisableNewResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrors] -type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrorsJSON struct { +// emailRoutingDisableNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [EmailRoutingDisableNewResponseEnvelopeErrors] +type emailRoutingDisableNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDisableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingDisableNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingDisableNewResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessages] -type emailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessagesJSON struct { +// emailRoutingDisableNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [EmailRoutingDisableNewResponseEnvelopeMessages] +type emailRoutingDisableNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDisableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeSuccess bool +type EmailRoutingDisableNewResponseEnvelopeSuccess bool const ( - EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeSuccessTrue EmailRoutingDisableEmailRoutingSettingsDisableEmailRoutingResponseEnvelopeSuccess = true + EmailRoutingDisableNewResponseEnvelopeSuccessTrue EmailRoutingDisableNewResponseEnvelopeSuccess = true ) diff --git a/emailroutingdisable_test.go b/emailroutingdisable_test.go index 4f3371a2a5a..4290b47162e 100644 --- a/emailroutingdisable_test.go +++ b/emailroutingdisable_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingDisableEmailRoutingSettingsDisableEmailRouting(t *testing.T) { +func TestEmailRoutingDisableNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestEmailRoutingDisableEmailRoutingSettingsDisableEmailRouting(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Disables.EmailRoutingSettingsDisableEmailRouting(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Emails.Routing.Disables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/emailroutingdns.go b/emailroutingdns.go index 4b4e6b254e8..0103c488dd3 100644 --- a/emailroutingdns.go +++ b/emailroutingdns.go @@ -34,9 +34,9 @@ func NewEmailRoutingDNSService(opts ...option.RequestOption) (r *EmailRoutingDNS } // Show the DNS records needed to configure your Email Routing zone. -func (r *EmailRoutingDNSService) EmailRoutingSettingsEmailRoutingDNSSettings(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse, err error) { +func (r *EmailRoutingDNSService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]EmailRoutingDNSGetResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelope + var env EmailRoutingDNSGetResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/dns", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -47,7 +47,7 @@ func (r *EmailRoutingDNSService) EmailRoutingSettingsEmailRoutingDNSSettings(ctx } // List of records needed to enable an Email Routing zone. -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse struct { +type EmailRoutingDNSGetResponse struct { // DNS record content. Content string `json:"content"` // DNS record name (or @ for the zone apex). @@ -57,16 +57,15 @@ type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse struct { Priority float64 `json:"priority"` // Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 // for 'automatic'. - TTL EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTL `json:"ttl"` + TTL EmailRoutingDNSGetResponseTTL `json:"ttl"` // DNS record type. - Type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType `json:"type"` - JSON emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseJSON `json:"-"` + Type EmailRoutingDNSGetResponseType `json:"type"` + JSON emailRoutingDNSGetResponseJSON `json:"-"` } -// emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseJSON contains -// the JSON metadata for the struct -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse] -type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseJSON struct { +// emailRoutingDNSGetResponseJSON contains the JSON metadata for the struct +// [EmailRoutingDNSGetResponse] +type emailRoutingDNSGetResponseJSON struct { Content apijson.Field Name apijson.Field Priority apijson.Field @@ -76,22 +75,21 @@ type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseJSON stru ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDNSGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 // for 'automatic'. // -// Union satisfied by [shared.UnionFloat] or -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTLNumber]. -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTL interface { - ImplementsEmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTL() +// Union satisfied by [shared.UnionFloat] or [EmailRoutingDNSGetResponseTTLNumber]. +type EmailRoutingDNSGetResponseTTL interface { + ImplementsEmailRoutingDNSGetResponseTTL() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTL)(nil)).Elem(), + reflect.TypeOf((*EmailRoutingDNSGetResponseTTL)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -100,50 +98,49 @@ func init() { ) } -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTLNumber float64 +type EmailRoutingDNSGetResponseTTLNumber float64 const ( - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTLNumber1 EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTLNumber = 1 + EmailRoutingDNSGetResponseTTLNumber1 EmailRoutingDNSGetResponseTTLNumber = 1 ) // DNS record type. -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType string +type EmailRoutingDNSGetResponseType string const ( - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeA EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "A" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeAaaa EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "AAAA" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeCname EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "CNAME" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeHTTPS EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "HTTPS" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeTxt EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "TXT" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeSrv EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "SRV" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeLoc EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "LOC" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeMx EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "MX" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeNs EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "NS" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeCert EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "CERT" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeDnskey EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "DNSKEY" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeDs EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "DS" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeNaptr EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "NAPTR" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeSmimea EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "SMIMEA" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeSshfp EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "SSHFP" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeSvcb EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "SVCB" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeTlsa EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "TLSA" - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTypeUri EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseType = "URI" + EmailRoutingDNSGetResponseTypeA EmailRoutingDNSGetResponseType = "A" + EmailRoutingDNSGetResponseTypeAaaa EmailRoutingDNSGetResponseType = "AAAA" + EmailRoutingDNSGetResponseTypeCname EmailRoutingDNSGetResponseType = "CNAME" + EmailRoutingDNSGetResponseTypeHTTPS EmailRoutingDNSGetResponseType = "HTTPS" + EmailRoutingDNSGetResponseTypeTxt EmailRoutingDNSGetResponseType = "TXT" + EmailRoutingDNSGetResponseTypeSrv EmailRoutingDNSGetResponseType = "SRV" + EmailRoutingDNSGetResponseTypeLoc EmailRoutingDNSGetResponseType = "LOC" + EmailRoutingDNSGetResponseTypeMx EmailRoutingDNSGetResponseType = "MX" + EmailRoutingDNSGetResponseTypeNs EmailRoutingDNSGetResponseType = "NS" + EmailRoutingDNSGetResponseTypeCert EmailRoutingDNSGetResponseType = "CERT" + EmailRoutingDNSGetResponseTypeDnskey EmailRoutingDNSGetResponseType = "DNSKEY" + EmailRoutingDNSGetResponseTypeDs EmailRoutingDNSGetResponseType = "DS" + EmailRoutingDNSGetResponseTypeNaptr EmailRoutingDNSGetResponseType = "NAPTR" + EmailRoutingDNSGetResponseTypeSmimea EmailRoutingDNSGetResponseType = "SMIMEA" + EmailRoutingDNSGetResponseTypeSshfp EmailRoutingDNSGetResponseType = "SSHFP" + EmailRoutingDNSGetResponseTypeSvcb EmailRoutingDNSGetResponseType = "SVCB" + EmailRoutingDNSGetResponseTypeTlsa EmailRoutingDNSGetResponseType = "TLSA" + EmailRoutingDNSGetResponseTypeUri EmailRoutingDNSGetResponseType = "URI" ) -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelope struct { - Errors []EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessages `json:"messages,required"` - Result []EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponse `json:"result,required,nullable"` +type EmailRoutingDNSGetResponseEnvelope struct { + Errors []EmailRoutingDNSGetResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingDNSGetResponseEnvelopeMessages `json:"messages,required"` + Result []EmailRoutingDNSGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfo `json:"result_info"` - JSON emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeJSON `json:"-"` + Success EmailRoutingDNSGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo EmailRoutingDNSGetResponseEnvelopeResultInfo `json:"result_info"` + JSON emailRoutingDNSGetResponseEnvelopeJSON `json:"-"` } -// emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelope] -type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeJSON struct { +// emailRoutingDNSGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [EmailRoutingDNSGetResponseEnvelope] +type emailRoutingDNSGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -153,58 +150,56 @@ type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeJ ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingDNSGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingDNSGetResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrors] -type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrorsJSON struct { +// emailRoutingDNSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [EmailRoutingDNSGetResponseEnvelopeErrors] +type emailRoutingDNSGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingDNSGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingDNSGetResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessages] -type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessagesJSON struct { +// emailRoutingDNSGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [EmailRoutingDNSGetResponseEnvelopeMessages] +type emailRoutingDNSGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeSuccess bool +type EmailRoutingDNSGetResponseEnvelopeSuccess bool const ( - EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeSuccessTrue EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeSuccess = true + EmailRoutingDNSGetResponseEnvelopeSuccessTrue EmailRoutingDNSGetResponseEnvelopeSuccess = true ) -type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfo struct { +type EmailRoutingDNSGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -212,14 +207,13 @@ type EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeR // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON emailRoutingDNSGetResponseEnvelopeResultInfoJSON `json:"-"` } -// emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfo] -type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfoJSON struct { +// emailRoutingDNSGetResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [EmailRoutingDNSGetResponseEnvelopeResultInfo] +type emailRoutingDNSGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -228,6 +222,6 @@ type emailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeR ExtraFields map[string]apijson.Field } -func (r *EmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingDNSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/emailroutingdns_test.go b/emailroutingdns_test.go index 8b5bd9f5336..88ca5551c27 100644 --- a/emailroutingdns_test.go +++ b/emailroutingdns_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettings(t *testing.T) { +func TestEmailRoutingDNSGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestEmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettings(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.DNS.EmailRoutingSettingsEmailRoutingDNSSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Emails.Routing.DNS.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/emailroutingenable.go b/emailroutingenable.go index 2d813c56808..4ab3620d066 100644 --- a/emailroutingenable.go +++ b/emailroutingenable.go @@ -32,9 +32,9 @@ func NewEmailRoutingEnableService(opts ...option.RequestOption) (r *EmailRouting } // Enable you Email Routing zone. Add and lock the necessary MX and SPF records. -func (r *EmailRoutingEnableService) EmailRoutingSettingsEnableEmailRouting(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse, err error) { +func (r *EmailRoutingEnableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingEnableNewResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelope + var env EmailRoutingEnableNewResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -44,31 +44,30 @@ func (r *EmailRoutingEnableService) EmailRoutingSettingsEnableEmailRouting(ctx c return } -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse struct { +type EmailRoutingEnableNewResponse struct { // Email Routing settings identifier. ID string `json:"id"` // The date and time the settings have been created. Created time.Time `json:"created" format:"date-time"` // State of the zone settings for Email Routing. - Enabled EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabled `json:"enabled"` + Enabled EmailRoutingEnableNewResponseEnabled `json:"enabled"` // The date and time the settings have been modified. Modified time.Time `json:"modified" format:"date-time"` // Domain of your zone. Name string `json:"name"` // Flag to check if the user skipped the configuration wizard. - SkipWizard EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizard `json:"skip_wizard"` + SkipWizard EmailRoutingEnableNewResponseSkipWizard `json:"skip_wizard"` // Show the state of your account, and the type or configuration error. - Status EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus `json:"status"` + Status EmailRoutingEnableNewResponseStatus `json:"status"` // Email Routing settings tag. (Deprecated, replaced by Email Routing settings // identifier) - Tag string `json:"tag"` - JSON emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingEnableNewResponseJSON `json:"-"` } -// emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseJSON contains -// the JSON metadata for the struct -// [EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse] -type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseJSON struct { +// emailRoutingEnableNewResponseJSON contains the JSON metadata for the struct +// [EmailRoutingEnableNewResponse] +type emailRoutingEnableNewResponseJSON struct { ID apijson.Field Created apijson.Field Enabled apijson.Field @@ -81,50 +80,49 @@ type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingEnableNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // State of the zone settings for Email Routing. -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabled bool +type EmailRoutingEnableNewResponseEnabled bool const ( - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabledTrue EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabled = true - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabledFalse EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnabled = false + EmailRoutingEnableNewResponseEnabledTrue EmailRoutingEnableNewResponseEnabled = true + EmailRoutingEnableNewResponseEnabledFalse EmailRoutingEnableNewResponseEnabled = false ) // Flag to check if the user skipped the configuration wizard. -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizard bool +type EmailRoutingEnableNewResponseSkipWizard bool const ( - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizardTrue EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizard = true - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizardFalse EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseSkipWizard = false + EmailRoutingEnableNewResponseSkipWizardTrue EmailRoutingEnableNewResponseSkipWizard = true + EmailRoutingEnableNewResponseSkipWizardFalse EmailRoutingEnableNewResponseSkipWizard = false ) // Show the state of your account, and the type or configuration error. -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus string +type EmailRoutingEnableNewResponseStatus string const ( - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatusReady EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus = "ready" - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatusUnconfigured EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus = "unconfigured" - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatusMisconfigured EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus = "misconfigured" - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatusMisconfiguredLocked EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus = "misconfigured/locked" - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatusUnlocked EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseStatus = "unlocked" + EmailRoutingEnableNewResponseStatusReady EmailRoutingEnableNewResponseStatus = "ready" + EmailRoutingEnableNewResponseStatusUnconfigured EmailRoutingEnableNewResponseStatus = "unconfigured" + EmailRoutingEnableNewResponseStatusMisconfigured EmailRoutingEnableNewResponseStatus = "misconfigured" + EmailRoutingEnableNewResponseStatusMisconfiguredLocked EmailRoutingEnableNewResponseStatus = "misconfigured/locked" + EmailRoutingEnableNewResponseStatusUnlocked EmailRoutingEnableNewResponseStatus = "unlocked" ) -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelope struct { - Errors []EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponse `json:"result,required"` +type EmailRoutingEnableNewResponseEnvelope struct { + Errors []EmailRoutingEnableNewResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingEnableNewResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingEnableNewResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeJSON `json:"-"` + Success EmailRoutingEnableNewResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingEnableNewResponseEnvelopeJSON `json:"-"` } -// emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelope] -type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeJSON struct { +// emailRoutingEnableNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingEnableNewResponseEnvelope] +type emailRoutingEnableNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -133,53 +131,51 @@ type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeJSO ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingEnableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingEnableNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingEnableNewResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrors] -type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrorsJSON struct { +// emailRoutingEnableNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [EmailRoutingEnableNewResponseEnvelopeErrors] +type emailRoutingEnableNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingEnableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingEnableNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingEnableNewResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessages] -type emailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessagesJSON struct { +// emailRoutingEnableNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [EmailRoutingEnableNewResponseEnvelopeMessages] +type emailRoutingEnableNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingEnableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeSuccess bool +type EmailRoutingEnableNewResponseEnvelopeSuccess bool const ( - EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeSuccessTrue EmailRoutingEnableEmailRoutingSettingsEnableEmailRoutingResponseEnvelopeSuccess = true + EmailRoutingEnableNewResponseEnvelopeSuccessTrue EmailRoutingEnableNewResponseEnvelopeSuccess = true ) diff --git a/emailroutingenable_test.go b/emailroutingenable_test.go index a2468d87878..8abb8427480 100644 --- a/emailroutingenable_test.go +++ b/emailroutingenable_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingEnableEmailRoutingSettingsEnableEmailRouting(t *testing.T) { +func TestEmailRoutingEnableNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestEmailRoutingEnableEmailRoutingSettingsEnableEmailRouting(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Enables.EmailRoutingSettingsEnableEmailRouting(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Emails.Routing.Enables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/emailroutingrule.go b/emailroutingrule.go index e95f365d585..8c3a458be16 100644 --- a/emailroutingrule.go +++ b/emailroutingrule.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -35,12 +36,14 @@ func NewEmailRoutingRuleService(opts ...option.RequestOption) (r *EmailRoutingRu return } -// Update actions and matches, or enable/disable specific routing rules. -func (r *EmailRoutingRuleService) Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body EmailRoutingRuleUpdateParams, opts ...option.RequestOption) (res *EmailRoutingRuleUpdateResponse, err error) { +// Rules consist of a set of criteria for matching emails (such as an email being +// sent to a specific custom email address) plus a set of actions to take on the +// email (like forwarding it to a specific destination address). +func (r *EmailRoutingRuleService) New(ctx context.Context, zoneIdentifier string, body EmailRoutingRuleNewParams, opts ...option.RequestOption) (res *EmailRoutingRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingRuleUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env EmailRoutingRuleNewResponseEnvelope + path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -48,6 +51,29 @@ func (r *EmailRoutingRuleService) Update(ctx context.Context, zoneIdentifier str return } +// Lists existing routing rules. +func (r *EmailRoutingRuleService) List(ctx context.Context, zoneIdentifier string, query EmailRoutingRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[EmailRoutingRuleListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Lists existing routing rules. +func (r *EmailRoutingRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query EmailRoutingRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[EmailRoutingRuleListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) +} + // Delete a specific routing rule. func (r *EmailRoutingRuleService) Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -61,27 +87,12 @@ func (r *EmailRoutingRuleService) Delete(ctx context.Context, zoneIdentifier str return } -// Rules consist of a set of criteria for matching emails (such as an email being -// sent to a specific custom email address) plus a set of actions to take on the -// email (like forwarding it to a specific destination address). -func (r *EmailRoutingRuleService) EmailRoutingRoutingRulesNewRoutingRule(ctx context.Context, zoneIdentifier string, body EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParams, opts ...option.RequestOption) (res *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelope - path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists existing routing rules. -func (r *EmailRoutingRuleService) EmailRoutingRoutingRulesListRoutingRules(ctx context.Context, zoneIdentifier string, query EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams, opts ...option.RequestOption) (res *[]EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse, err error) { +// Get information for a specific routing rule already created. +func (r *EmailRoutingRuleService) Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRuleGetResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env EmailRoutingRuleGetResponseEnvelope + path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -89,12 +100,12 @@ func (r *EmailRoutingRuleService) EmailRoutingRoutingRulesListRoutingRules(ctx c return } -// Get information for a specific routing rule already created. -func (r *EmailRoutingRuleService) Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRuleGetResponse, err error) { +// Update actions and matches, or enable/disable specific routing rules. +func (r *EmailRoutingRuleService) Replace(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body EmailRoutingRuleReplaceParams, opts ...option.RequestOption) (res *EmailRoutingRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingRuleGetResponseEnvelope + var env EmailRoutingRuleReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -102,27 +113,27 @@ func (r *EmailRoutingRuleService) Get(ctx context.Context, zoneIdentifier string return } -type EmailRoutingRuleUpdateResponse struct { +type EmailRoutingRuleNewResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions patterns. - Actions []EmailRoutingRuleUpdateResponseAction `json:"actions"` + Actions []EmailRoutingRuleNewResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleUpdateResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleNewResponseEnabled `json:"enabled"` // Matching patterns to forward to your actions. - Matchers []EmailRoutingRuleUpdateResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleNewResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Priority of the routing rule. Priority float64 `json:"priority"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleUpdateResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleNewResponseJSON `json:"-"` } -// emailRoutingRuleUpdateResponseJSON contains the JSON metadata for the struct -// [EmailRoutingRuleUpdateResponse] -type emailRoutingRuleUpdateResponseJSON struct { +// emailRoutingRuleNewResponseJSON contains the JSON metadata for the struct +// [EmailRoutingRuleNewResponse] +type emailRoutingRuleNewResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -134,62 +145,62 @@ type emailRoutingRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Actions pattern. -type EmailRoutingRuleUpdateResponseAction struct { +type EmailRoutingRuleNewResponseAction struct { // Type of supported action. - Type EmailRoutingRuleUpdateResponseActionsType `json:"type,required"` - Value []string `json:"value,required"` - JSON emailRoutingRuleUpdateResponseActionJSON `json:"-"` + Type EmailRoutingRuleNewResponseActionsType `json:"type,required"` + Value []string `json:"value,required"` + JSON emailRoutingRuleNewResponseActionJSON `json:"-"` } -// emailRoutingRuleUpdateResponseActionJSON contains the JSON metadata for the -// struct [EmailRoutingRuleUpdateResponseAction] -type emailRoutingRuleUpdateResponseActionJSON struct { +// emailRoutingRuleNewResponseActionJSON contains the JSON metadata for the struct +// [EmailRoutingRuleNewResponseAction] +type emailRoutingRuleNewResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of supported action. -type EmailRoutingRuleUpdateResponseActionsType string +type EmailRoutingRuleNewResponseActionsType string const ( - EmailRoutingRuleUpdateResponseActionsTypeDrop EmailRoutingRuleUpdateResponseActionsType = "drop" - EmailRoutingRuleUpdateResponseActionsTypeForward EmailRoutingRuleUpdateResponseActionsType = "forward" - EmailRoutingRuleUpdateResponseActionsTypeWorker EmailRoutingRuleUpdateResponseActionsType = "worker" + EmailRoutingRuleNewResponseActionsTypeDrop EmailRoutingRuleNewResponseActionsType = "drop" + EmailRoutingRuleNewResponseActionsTypeForward EmailRoutingRuleNewResponseActionsType = "forward" + EmailRoutingRuleNewResponseActionsTypeWorker EmailRoutingRuleNewResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleUpdateResponseEnabled bool +type EmailRoutingRuleNewResponseEnabled bool const ( - EmailRoutingRuleUpdateResponseEnabledTrue EmailRoutingRuleUpdateResponseEnabled = true - EmailRoutingRuleUpdateResponseEnabledFalse EmailRoutingRuleUpdateResponseEnabled = false + EmailRoutingRuleNewResponseEnabledTrue EmailRoutingRuleNewResponseEnabled = true + EmailRoutingRuleNewResponseEnabledFalse EmailRoutingRuleNewResponseEnabled = false ) // Matching pattern to forward your actions. -type EmailRoutingRuleUpdateResponseMatcher struct { +type EmailRoutingRuleNewResponseMatcher struct { // Field for type matcher. - Field EmailRoutingRuleUpdateResponseMatchersField `json:"field,required"` + Field EmailRoutingRuleNewResponseMatchersField `json:"field,required"` // Type of matcher. - Type EmailRoutingRuleUpdateResponseMatchersType `json:"type,required"` + Type EmailRoutingRuleNewResponseMatchersType `json:"type,required"` // Value for matcher. - Value string `json:"value,required"` - JSON emailRoutingRuleUpdateResponseMatcherJSON `json:"-"` + Value string `json:"value,required"` + JSON emailRoutingRuleNewResponseMatcherJSON `json:"-"` } -// emailRoutingRuleUpdateResponseMatcherJSON contains the JSON metadata for the -// struct [EmailRoutingRuleUpdateResponseMatcher] -type emailRoutingRuleUpdateResponseMatcherJSON struct { +// emailRoutingRuleNewResponseMatcherJSON contains the JSON metadata for the struct +// [EmailRoutingRuleNewResponseMatcher] +type emailRoutingRuleNewResponseMatcherJSON struct { Field apijson.Field Type apijson.Field Value apijson.Field @@ -197,45 +208,45 @@ type emailRoutingRuleUpdateResponseMatcherJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Field for type matcher. -type EmailRoutingRuleUpdateResponseMatchersField string +type EmailRoutingRuleNewResponseMatchersField string const ( - EmailRoutingRuleUpdateResponseMatchersFieldTo EmailRoutingRuleUpdateResponseMatchersField = "to" + EmailRoutingRuleNewResponseMatchersFieldTo EmailRoutingRuleNewResponseMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleUpdateResponseMatchersType string +type EmailRoutingRuleNewResponseMatchersType string const ( - EmailRoutingRuleUpdateResponseMatchersTypeLiteral EmailRoutingRuleUpdateResponseMatchersType = "literal" + EmailRoutingRuleNewResponseMatchersTypeLiteral EmailRoutingRuleNewResponseMatchersType = "literal" ) -type EmailRoutingRuleDeleteResponse struct { +type EmailRoutingRuleListResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions patterns. - Actions []EmailRoutingRuleDeleteResponseAction `json:"actions"` + Actions []EmailRoutingRuleListResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleDeleteResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleListResponseEnabled `json:"enabled"` // Matching patterns to forward to your actions. - Matchers []EmailRoutingRuleDeleteResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleListResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Priority of the routing rule. Priority float64 `json:"priority"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleDeleteResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleListResponseJSON `json:"-"` } -// emailRoutingRuleDeleteResponseJSON contains the JSON metadata for the struct -// [EmailRoutingRuleDeleteResponse] -type emailRoutingRuleDeleteResponseJSON struct { +// emailRoutingRuleListResponseJSON contains the JSON metadata for the struct +// [EmailRoutingRuleListResponse] +type emailRoutingRuleListResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -247,62 +258,62 @@ type emailRoutingRuleDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Actions pattern. -type EmailRoutingRuleDeleteResponseAction struct { +type EmailRoutingRuleListResponseAction struct { // Type of supported action. - Type EmailRoutingRuleDeleteResponseActionsType `json:"type,required"` - Value []string `json:"value,required"` - JSON emailRoutingRuleDeleteResponseActionJSON `json:"-"` + Type EmailRoutingRuleListResponseActionsType `json:"type,required"` + Value []string `json:"value,required"` + JSON emailRoutingRuleListResponseActionJSON `json:"-"` } -// emailRoutingRuleDeleteResponseActionJSON contains the JSON metadata for the -// struct [EmailRoutingRuleDeleteResponseAction] -type emailRoutingRuleDeleteResponseActionJSON struct { +// emailRoutingRuleListResponseActionJSON contains the JSON metadata for the struct +// [EmailRoutingRuleListResponseAction] +type emailRoutingRuleListResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleDeleteResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleListResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of supported action. -type EmailRoutingRuleDeleteResponseActionsType string +type EmailRoutingRuleListResponseActionsType string const ( - EmailRoutingRuleDeleteResponseActionsTypeDrop EmailRoutingRuleDeleteResponseActionsType = "drop" - EmailRoutingRuleDeleteResponseActionsTypeForward EmailRoutingRuleDeleteResponseActionsType = "forward" - EmailRoutingRuleDeleteResponseActionsTypeWorker EmailRoutingRuleDeleteResponseActionsType = "worker" + EmailRoutingRuleListResponseActionsTypeDrop EmailRoutingRuleListResponseActionsType = "drop" + EmailRoutingRuleListResponseActionsTypeForward EmailRoutingRuleListResponseActionsType = "forward" + EmailRoutingRuleListResponseActionsTypeWorker EmailRoutingRuleListResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleDeleteResponseEnabled bool +type EmailRoutingRuleListResponseEnabled bool const ( - EmailRoutingRuleDeleteResponseEnabledTrue EmailRoutingRuleDeleteResponseEnabled = true - EmailRoutingRuleDeleteResponseEnabledFalse EmailRoutingRuleDeleteResponseEnabled = false + EmailRoutingRuleListResponseEnabledTrue EmailRoutingRuleListResponseEnabled = true + EmailRoutingRuleListResponseEnabledFalse EmailRoutingRuleListResponseEnabled = false ) // Matching pattern to forward your actions. -type EmailRoutingRuleDeleteResponseMatcher struct { +type EmailRoutingRuleListResponseMatcher struct { // Field for type matcher. - Field EmailRoutingRuleDeleteResponseMatchersField `json:"field,required"` + Field EmailRoutingRuleListResponseMatchersField `json:"field,required"` // Type of matcher. - Type EmailRoutingRuleDeleteResponseMatchersType `json:"type,required"` + Type EmailRoutingRuleListResponseMatchersType `json:"type,required"` // Value for matcher. - Value string `json:"value,required"` - JSON emailRoutingRuleDeleteResponseMatcherJSON `json:"-"` + Value string `json:"value,required"` + JSON emailRoutingRuleListResponseMatcherJSON `json:"-"` } -// emailRoutingRuleDeleteResponseMatcherJSON contains the JSON metadata for the -// struct [EmailRoutingRuleDeleteResponseMatcher] -type emailRoutingRuleDeleteResponseMatcherJSON struct { +// emailRoutingRuleListResponseMatcherJSON contains the JSON metadata for the +// struct [EmailRoutingRuleListResponseMatcher] +type emailRoutingRuleListResponseMatcherJSON struct { Field apijson.Field Type apijson.Field Value apijson.Field @@ -310,46 +321,45 @@ type emailRoutingRuleDeleteResponseMatcherJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleDeleteResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleListResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Field for type matcher. -type EmailRoutingRuleDeleteResponseMatchersField string +type EmailRoutingRuleListResponseMatchersField string const ( - EmailRoutingRuleDeleteResponseMatchersFieldTo EmailRoutingRuleDeleteResponseMatchersField = "to" + EmailRoutingRuleListResponseMatchersFieldTo EmailRoutingRuleListResponseMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleDeleteResponseMatchersType string +type EmailRoutingRuleListResponseMatchersType string const ( - EmailRoutingRuleDeleteResponseMatchersTypeLiteral EmailRoutingRuleDeleteResponseMatchersType = "literal" + EmailRoutingRuleListResponseMatchersTypeLiteral EmailRoutingRuleListResponseMatchersType = "literal" ) -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse struct { +type EmailRoutingRuleDeleteResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions patterns. - Actions []EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseAction `json:"actions"` + Actions []EmailRoutingRuleDeleteResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleDeleteResponseEnabled `json:"enabled"` // Matching patterns to forward to your actions. - Matchers []EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleDeleteResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Priority of the routing rule. Priority float64 `json:"priority"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleDeleteResponseJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseJSON contains the -// JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseJSON struct { +// emailRoutingRuleDeleteResponseJSON contains the JSON metadata for the struct +// [EmailRoutingRuleDeleteResponse] +type emailRoutingRuleDeleteResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -361,64 +371,62 @@ type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Actions pattern. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseAction struct { +type EmailRoutingRuleDeleteResponseAction struct { // Type of supported action. - Type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsType `json:"type,required"` - Value []string `json:"value,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionJSON `json:"-"` + Type EmailRoutingRuleDeleteResponseActionsType `json:"type,required"` + Value []string `json:"value,required"` + JSON emailRoutingRuleDeleteResponseActionJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseAction] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionJSON struct { +// emailRoutingRuleDeleteResponseActionJSON contains the JSON metadata for the +// struct [EmailRoutingRuleDeleteResponseAction] +type emailRoutingRuleDeleteResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleDeleteResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of supported action. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsType string +type EmailRoutingRuleDeleteResponseActionsType string const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsTypeDrop EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsType = "drop" - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsTypeForward EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsType = "forward" - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsTypeWorker EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseActionsType = "worker" + EmailRoutingRuleDeleteResponseActionsTypeDrop EmailRoutingRuleDeleteResponseActionsType = "drop" + EmailRoutingRuleDeleteResponseActionsTypeForward EmailRoutingRuleDeleteResponseActionsType = "forward" + EmailRoutingRuleDeleteResponseActionsTypeWorker EmailRoutingRuleDeleteResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabled bool +type EmailRoutingRuleDeleteResponseEnabled bool const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabledTrue EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabled = true - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabledFalse EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnabled = false + EmailRoutingRuleDeleteResponseEnabledTrue EmailRoutingRuleDeleteResponseEnabled = true + EmailRoutingRuleDeleteResponseEnabledFalse EmailRoutingRuleDeleteResponseEnabled = false ) // Matching pattern to forward your actions. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcher struct { +type EmailRoutingRuleDeleteResponseMatcher struct { // Field for type matcher. - Field EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersField `json:"field,required"` + Field EmailRoutingRuleDeleteResponseMatchersField `json:"field,required"` // Type of matcher. - Type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersType `json:"type,required"` + Type EmailRoutingRuleDeleteResponseMatchersType `json:"type,required"` // Value for matcher. - Value string `json:"value,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcherJSON `json:"-"` + Value string `json:"value,required"` + JSON emailRoutingRuleDeleteResponseMatcherJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcherJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcher] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcherJSON struct { +// emailRoutingRuleDeleteResponseMatcherJSON contains the JSON metadata for the +// struct [EmailRoutingRuleDeleteResponseMatcher] +type emailRoutingRuleDeleteResponseMatcherJSON struct { Field apijson.Field Type apijson.Field Value apijson.Field @@ -426,46 +434,45 @@ type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcherJSON s ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleDeleteResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Field for type matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersField string +type EmailRoutingRuleDeleteResponseMatchersField string const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersFieldTo EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersField = "to" + EmailRoutingRuleDeleteResponseMatchersFieldTo EmailRoutingRuleDeleteResponseMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersType string +type EmailRoutingRuleDeleteResponseMatchersType string const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersTypeLiteral EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseMatchersType = "literal" + EmailRoutingRuleDeleteResponseMatchersTypeLiteral EmailRoutingRuleDeleteResponseMatchersType = "literal" ) -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse struct { +type EmailRoutingRuleGetResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions patterns. - Actions []EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseAction `json:"actions"` + Actions []EmailRoutingRuleGetResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleGetResponseEnabled `json:"enabled"` // Matching patterns to forward to your actions. - Matchers []EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleGetResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Priority of the routing rule. Priority float64 `json:"priority"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleGetResponseJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseJSON contains -// the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseJSON struct { +// emailRoutingRuleGetResponseJSON contains the JSON metadata for the struct +// [EmailRoutingRuleGetResponse] +type emailRoutingRuleGetResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -477,64 +484,62 @@ type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Actions pattern. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseAction struct { +type EmailRoutingRuleGetResponseAction struct { // Type of supported action. - Type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsType `json:"type,required"` - Value []string `json:"value,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionJSON `json:"-"` + Type EmailRoutingRuleGetResponseActionsType `json:"type,required"` + Value []string `json:"value,required"` + JSON emailRoutingRuleGetResponseActionJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseAction] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionJSON struct { +// emailRoutingRuleGetResponseActionJSON contains the JSON metadata for the struct +// [EmailRoutingRuleGetResponseAction] +type emailRoutingRuleGetResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of supported action. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsType string +type EmailRoutingRuleGetResponseActionsType string const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsTypeDrop EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsType = "drop" - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsTypeForward EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsType = "forward" - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsTypeWorker EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseActionsType = "worker" + EmailRoutingRuleGetResponseActionsTypeDrop EmailRoutingRuleGetResponseActionsType = "drop" + EmailRoutingRuleGetResponseActionsTypeForward EmailRoutingRuleGetResponseActionsType = "forward" + EmailRoutingRuleGetResponseActionsTypeWorker EmailRoutingRuleGetResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabled bool +type EmailRoutingRuleGetResponseEnabled bool const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabledTrue EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabled = true - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabledFalse EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnabled = false + EmailRoutingRuleGetResponseEnabledTrue EmailRoutingRuleGetResponseEnabled = true + EmailRoutingRuleGetResponseEnabledFalse EmailRoutingRuleGetResponseEnabled = false ) // Matching pattern to forward your actions. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcher struct { +type EmailRoutingRuleGetResponseMatcher struct { // Field for type matcher. - Field EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersField `json:"field,required"` + Field EmailRoutingRuleGetResponseMatchersField `json:"field,required"` // Type of matcher. - Type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersType `json:"type,required"` + Type EmailRoutingRuleGetResponseMatchersType `json:"type,required"` // Value for matcher. - Value string `json:"value,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcherJSON `json:"-"` + Value string `json:"value,required"` + JSON emailRoutingRuleGetResponseMatcherJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcherJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcher] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcherJSON struct { +// emailRoutingRuleGetResponseMatcherJSON contains the JSON metadata for the struct +// [EmailRoutingRuleGetResponseMatcher] +type emailRoutingRuleGetResponseMatcherJSON struct { Field apijson.Field Type apijson.Field Value apijson.Field @@ -542,45 +547,45 @@ type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcherJSON ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Field for type matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersField string +type EmailRoutingRuleGetResponseMatchersField string const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersFieldTo EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersField = "to" + EmailRoutingRuleGetResponseMatchersFieldTo EmailRoutingRuleGetResponseMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersType string +type EmailRoutingRuleGetResponseMatchersType string const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersTypeLiteral EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseMatchersType = "literal" + EmailRoutingRuleGetResponseMatchersTypeLiteral EmailRoutingRuleGetResponseMatchersType = "literal" ) -type EmailRoutingRuleGetResponse struct { +type EmailRoutingRuleReplaceResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions patterns. - Actions []EmailRoutingRuleGetResponseAction `json:"actions"` + Actions []EmailRoutingRuleReplaceResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleGetResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleReplaceResponseEnabled `json:"enabled"` // Matching patterns to forward to your actions. - Matchers []EmailRoutingRuleGetResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleReplaceResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Priority of the routing rule. Priority float64 `json:"priority"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleGetResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleReplaceResponseJSON `json:"-"` } -// emailRoutingRuleGetResponseJSON contains the JSON metadata for the struct -// [EmailRoutingRuleGetResponse] -type emailRoutingRuleGetResponseJSON struct { +// emailRoutingRuleReplaceResponseJSON contains the JSON metadata for the struct +// [EmailRoutingRuleReplaceResponse] +type emailRoutingRuleReplaceResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -592,62 +597,62 @@ type emailRoutingRuleGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Actions pattern. -type EmailRoutingRuleGetResponseAction struct { +type EmailRoutingRuleReplaceResponseAction struct { // Type of supported action. - Type EmailRoutingRuleGetResponseActionsType `json:"type,required"` - Value []string `json:"value,required"` - JSON emailRoutingRuleGetResponseActionJSON `json:"-"` + Type EmailRoutingRuleReplaceResponseActionsType `json:"type,required"` + Value []string `json:"value,required"` + JSON emailRoutingRuleReplaceResponseActionJSON `json:"-"` } -// emailRoutingRuleGetResponseActionJSON contains the JSON metadata for the struct -// [EmailRoutingRuleGetResponseAction] -type emailRoutingRuleGetResponseActionJSON struct { +// emailRoutingRuleReplaceResponseActionJSON contains the JSON metadata for the +// struct [EmailRoutingRuleReplaceResponseAction] +type emailRoutingRuleReplaceResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of supported action. -type EmailRoutingRuleGetResponseActionsType string +type EmailRoutingRuleReplaceResponseActionsType string const ( - EmailRoutingRuleGetResponseActionsTypeDrop EmailRoutingRuleGetResponseActionsType = "drop" - EmailRoutingRuleGetResponseActionsTypeForward EmailRoutingRuleGetResponseActionsType = "forward" - EmailRoutingRuleGetResponseActionsTypeWorker EmailRoutingRuleGetResponseActionsType = "worker" + EmailRoutingRuleReplaceResponseActionsTypeDrop EmailRoutingRuleReplaceResponseActionsType = "drop" + EmailRoutingRuleReplaceResponseActionsTypeForward EmailRoutingRuleReplaceResponseActionsType = "forward" + EmailRoutingRuleReplaceResponseActionsTypeWorker EmailRoutingRuleReplaceResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleGetResponseEnabled bool +type EmailRoutingRuleReplaceResponseEnabled bool const ( - EmailRoutingRuleGetResponseEnabledTrue EmailRoutingRuleGetResponseEnabled = true - EmailRoutingRuleGetResponseEnabledFalse EmailRoutingRuleGetResponseEnabled = false + EmailRoutingRuleReplaceResponseEnabledTrue EmailRoutingRuleReplaceResponseEnabled = true + EmailRoutingRuleReplaceResponseEnabledFalse EmailRoutingRuleReplaceResponseEnabled = false ) // Matching pattern to forward your actions. -type EmailRoutingRuleGetResponseMatcher struct { +type EmailRoutingRuleReplaceResponseMatcher struct { // Field for type matcher. - Field EmailRoutingRuleGetResponseMatchersField `json:"field,required"` + Field EmailRoutingRuleReplaceResponseMatchersField `json:"field,required"` // Type of matcher. - Type EmailRoutingRuleGetResponseMatchersType `json:"type,required"` + Type EmailRoutingRuleReplaceResponseMatchersType `json:"type,required"` // Value for matcher. - Value string `json:"value,required"` - JSON emailRoutingRuleGetResponseMatcherJSON `json:"-"` + Value string `json:"value,required"` + JSON emailRoutingRuleReplaceResponseMatcherJSON `json:"-"` } -// emailRoutingRuleGetResponseMatcherJSON contains the JSON metadata for the struct -// [EmailRoutingRuleGetResponseMatcher] -type emailRoutingRuleGetResponseMatcherJSON struct { +// emailRoutingRuleReplaceResponseMatcherJSON contains the JSON metadata for the +// struct [EmailRoutingRuleReplaceResponseMatcher] +type emailRoutingRuleReplaceResponseMatcherJSON struct { Field apijson.Field Type apijson.Field Value apijson.Field @@ -655,109 +660,109 @@ type emailRoutingRuleGetResponseMatcherJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Field for type matcher. -type EmailRoutingRuleGetResponseMatchersField string +type EmailRoutingRuleReplaceResponseMatchersField string const ( - EmailRoutingRuleGetResponseMatchersFieldTo EmailRoutingRuleGetResponseMatchersField = "to" + EmailRoutingRuleReplaceResponseMatchersFieldTo EmailRoutingRuleReplaceResponseMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleGetResponseMatchersType string +type EmailRoutingRuleReplaceResponseMatchersType string const ( - EmailRoutingRuleGetResponseMatchersTypeLiteral EmailRoutingRuleGetResponseMatchersType = "literal" + EmailRoutingRuleReplaceResponseMatchersTypeLiteral EmailRoutingRuleReplaceResponseMatchersType = "literal" ) -type EmailRoutingRuleUpdateParams struct { +type EmailRoutingRuleNewParams struct { // List actions patterns. - Actions param.Field[[]EmailRoutingRuleUpdateParamsAction] `json:"actions,required"` + Actions param.Field[[]EmailRoutingRuleNewParamsAction] `json:"actions,required"` // Matching patterns to forward to your actions. - Matchers param.Field[[]EmailRoutingRuleUpdateParamsMatcher] `json:"matchers,required"` + Matchers param.Field[[]EmailRoutingRuleNewParamsMatcher] `json:"matchers,required"` // Routing rule status. - Enabled param.Field[EmailRoutingRuleUpdateParamsEnabled] `json:"enabled"` + Enabled param.Field[EmailRoutingRuleNewParamsEnabled] `json:"enabled"` // Routing rule name. Name param.Field[string] `json:"name"` // Priority of the routing rule. Priority param.Field[float64] `json:"priority"` } -func (r EmailRoutingRuleUpdateParams) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Actions pattern. -type EmailRoutingRuleUpdateParamsAction struct { +type EmailRoutingRuleNewParamsAction struct { // Type of supported action. - Type param.Field[EmailRoutingRuleUpdateParamsActionsType] `json:"type,required"` - Value param.Field[[]string] `json:"value,required"` + Type param.Field[EmailRoutingRuleNewParamsActionsType] `json:"type,required"` + Value param.Field[[]string] `json:"value,required"` } -func (r EmailRoutingRuleUpdateParamsAction) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleNewParamsAction) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of supported action. -type EmailRoutingRuleUpdateParamsActionsType string +type EmailRoutingRuleNewParamsActionsType string const ( - EmailRoutingRuleUpdateParamsActionsTypeDrop EmailRoutingRuleUpdateParamsActionsType = "drop" - EmailRoutingRuleUpdateParamsActionsTypeForward EmailRoutingRuleUpdateParamsActionsType = "forward" - EmailRoutingRuleUpdateParamsActionsTypeWorker EmailRoutingRuleUpdateParamsActionsType = "worker" + EmailRoutingRuleNewParamsActionsTypeDrop EmailRoutingRuleNewParamsActionsType = "drop" + EmailRoutingRuleNewParamsActionsTypeForward EmailRoutingRuleNewParamsActionsType = "forward" + EmailRoutingRuleNewParamsActionsTypeWorker EmailRoutingRuleNewParamsActionsType = "worker" ) // Matching pattern to forward your actions. -type EmailRoutingRuleUpdateParamsMatcher struct { +type EmailRoutingRuleNewParamsMatcher struct { // Field for type matcher. - Field param.Field[EmailRoutingRuleUpdateParamsMatchersField] `json:"field,required"` + Field param.Field[EmailRoutingRuleNewParamsMatchersField] `json:"field,required"` // Type of matcher. - Type param.Field[EmailRoutingRuleUpdateParamsMatchersType] `json:"type,required"` + Type param.Field[EmailRoutingRuleNewParamsMatchersType] `json:"type,required"` // Value for matcher. Value param.Field[string] `json:"value,required"` } -func (r EmailRoutingRuleUpdateParamsMatcher) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleNewParamsMatcher) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Field for type matcher. -type EmailRoutingRuleUpdateParamsMatchersField string +type EmailRoutingRuleNewParamsMatchersField string const ( - EmailRoutingRuleUpdateParamsMatchersFieldTo EmailRoutingRuleUpdateParamsMatchersField = "to" + EmailRoutingRuleNewParamsMatchersFieldTo EmailRoutingRuleNewParamsMatchersField = "to" ) // Type of matcher. -type EmailRoutingRuleUpdateParamsMatchersType string +type EmailRoutingRuleNewParamsMatchersType string const ( - EmailRoutingRuleUpdateParamsMatchersTypeLiteral EmailRoutingRuleUpdateParamsMatchersType = "literal" + EmailRoutingRuleNewParamsMatchersTypeLiteral EmailRoutingRuleNewParamsMatchersType = "literal" ) // Routing rule status. -type EmailRoutingRuleUpdateParamsEnabled bool +type EmailRoutingRuleNewParamsEnabled bool const ( - EmailRoutingRuleUpdateParamsEnabledTrue EmailRoutingRuleUpdateParamsEnabled = true - EmailRoutingRuleUpdateParamsEnabledFalse EmailRoutingRuleUpdateParamsEnabled = false + EmailRoutingRuleNewParamsEnabledTrue EmailRoutingRuleNewParamsEnabled = true + EmailRoutingRuleNewParamsEnabledFalse EmailRoutingRuleNewParamsEnabled = false ) -type EmailRoutingRuleUpdateResponseEnvelope struct { - Errors []EmailRoutingRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingRuleUpdateResponse `json:"result,required"` +type EmailRoutingRuleNewResponseEnvelope struct { + Errors []EmailRoutingRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingRuleNewResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingRuleUpdateResponseEnvelopeJSON `json:"-"` + Success EmailRoutingRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingRuleNewResponseEnvelopeJSON `json:"-"` } -// emailRoutingRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [EmailRoutingRuleUpdateResponseEnvelope] -type emailRoutingRuleUpdateResponseEnvelopeJSON struct { +// emailRoutingRuleNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingRuleNewResponseEnvelope] +type emailRoutingRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -766,53 +771,79 @@ type emailRoutingRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [EmailRoutingRuleUpdateResponseEnvelopeErrors] -type emailRoutingRuleUpdateResponseEnvelopeErrorsJSON struct { +// emailRoutingRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [EmailRoutingRuleNewResponseEnvelopeErrors] +type emailRoutingRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [EmailRoutingRuleUpdateResponseEnvelopeMessages] -type emailRoutingRuleUpdateResponseEnvelopeMessagesJSON struct { +// emailRoutingRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [EmailRoutingRuleNewResponseEnvelopeMessages] +type emailRoutingRuleNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingRuleUpdateResponseEnvelopeSuccess bool +type EmailRoutingRuleNewResponseEnvelopeSuccess bool + +const ( + EmailRoutingRuleNewResponseEnvelopeSuccessTrue EmailRoutingRuleNewResponseEnvelopeSuccess = true +) + +type EmailRoutingRuleListParams struct { + // Filter by enabled routing rules. + Enabled param.Field[EmailRoutingRuleListParamsEnabled] `query:"enabled"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // Maximum number of results per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [EmailRoutingRuleListParams]'s query parameters as +// `url.Values`. +func (r EmailRoutingRuleListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Filter by enabled routing rules. +type EmailRoutingRuleListParamsEnabled bool const ( - EmailRoutingRuleUpdateResponseEnvelopeSuccessTrue EmailRoutingRuleUpdateResponseEnvelopeSuccess = true + EmailRoutingRuleListParamsEnabledTrue EmailRoutingRuleListParamsEnabled = true + EmailRoutingRuleListParamsEnabledFalse EmailRoutingRuleListParamsEnabled = false ) type EmailRoutingRuleDeleteResponseEnvelope struct { @@ -884,92 +915,18 @@ const ( EmailRoutingRuleDeleteResponseEnvelopeSuccessTrue EmailRoutingRuleDeleteResponseEnvelopeSuccess = true ) -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParams struct { - // List actions patterns. - Actions param.Field[[]EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsAction] `json:"actions,required"` - // Matching patterns to forward to your actions. - Matchers param.Field[[]EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatcher] `json:"matchers,required"` - // Routing rule status. - Enabled param.Field[EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabled] `json:"enabled"` - // Routing rule name. - Name param.Field[string] `json:"name"` - // Priority of the routing rule. - Priority param.Field[float64] `json:"priority"` -} - -func (r EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Actions pattern. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsAction struct { - // Type of supported action. - Type param.Field[EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsType] `json:"type,required"` - Value param.Field[[]string] `json:"value,required"` -} - -func (r EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsAction) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Type of supported action. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsType string - -const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeDrop EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsType = "drop" - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeForward EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsType = "forward" - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeWorker EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsType = "worker" -) - -// Matching pattern to forward your actions. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatcher struct { - // Field for type matcher. - Field param.Field[EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersField] `json:"field,required"` - // Type of matcher. - Type param.Field[EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersType] `json:"type,required"` - // Value for matcher. - Value param.Field[string] `json:"value,required"` -} - -func (r EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatcher) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Field for type matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersField string - -const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersFieldTo EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersField = "to" -) - -// Type of matcher. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersType string - -const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersTypeLiteral EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersType = "literal" -) - -// Routing rule status. -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabled bool - -const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabledTrue EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabled = true - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabledFalse EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabled = false -) - -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelope struct { - Errors []EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponse `json:"result,required"` +type EmailRoutingRuleGetResponseEnvelope struct { + Errors []EmailRoutingRuleGetResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingRuleGetResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingRuleGetResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeJSON `json:"-"` + Success EmailRoutingRuleGetResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingRuleGetResponseEnvelopeJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelope] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeJSON struct { +// emailRoutingRuleGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingRuleGetResponseEnvelope] +type emailRoutingRuleGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -978,198 +935,140 @@ type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingRuleGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleGetResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrors] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrorsJSON struct { +// emailRoutingRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [EmailRoutingRuleGetResponseEnvelopeErrors] +type emailRoutingRuleGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingRuleGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleGetResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessages] -type emailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessagesJSON struct { +// emailRoutingRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [EmailRoutingRuleGetResponseEnvelopeMessages] +type emailRoutingRuleGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeSuccess bool +type EmailRoutingRuleGetResponseEnvelopeSuccess bool const ( - EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeSuccessTrue EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleResponseEnvelopeSuccess = true + EmailRoutingRuleGetResponseEnvelopeSuccessTrue EmailRoutingRuleGetResponseEnvelopeSuccess = true ) -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams struct { - // Filter by enabled routing rules. - Enabled param.Field[EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabled] `query:"enabled"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Maximum number of results per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams]'s query -// parameters as `url.Values`. -func (r EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +type EmailRoutingRuleReplaceParams struct { + // List actions patterns. + Actions param.Field[[]EmailRoutingRuleReplaceParamsAction] `json:"actions,required"` + // Matching patterns to forward to your actions. + Matchers param.Field[[]EmailRoutingRuleReplaceParamsMatcher] `json:"matchers,required"` + // Routing rule status. + Enabled param.Field[EmailRoutingRuleReplaceParamsEnabled] `json:"enabled"` + // Routing rule name. + Name param.Field[string] `json:"name"` + // Priority of the routing rule. + Priority param.Field[float64] `json:"priority"` } -// Filter by enabled routing rules. -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabled bool - -const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabledTrue EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabled = true - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabledFalse EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabled = false -) - -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelope struct { - Errors []EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessages `json:"messages,required"` - Result []EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeJSON `json:"-"` +func (r EmailRoutingRuleReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelope] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Actions pattern. +type EmailRoutingRuleReplaceParamsAction struct { + // Type of supported action. + Type param.Field[EmailRoutingRuleReplaceParamsActionsType] `json:"type,required"` + Value param.Field[[]string] `json:"value,required"` } -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r EmailRoutingRuleReplaceParamsAction) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrorsJSON `json:"-"` -} +// Type of supported action. +type EmailRoutingRuleReplaceParamsActionsType string -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrors] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +const ( + EmailRoutingRuleReplaceParamsActionsTypeDrop EmailRoutingRuleReplaceParamsActionsType = "drop" + EmailRoutingRuleReplaceParamsActionsTypeForward EmailRoutingRuleReplaceParamsActionsType = "forward" + EmailRoutingRuleReplaceParamsActionsTypeWorker EmailRoutingRuleReplaceParamsActionsType = "worker" +) -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// Matching pattern to forward your actions. +type EmailRoutingRuleReplaceParamsMatcher struct { + // Field for type matcher. + Field param.Field[EmailRoutingRuleReplaceParamsMatchersField] `json:"field,required"` + // Type of matcher. + Type param.Field[EmailRoutingRuleReplaceParamsMatchersType] `json:"type,required"` + // Value for matcher. + Value param.Field[string] `json:"value,required"` } -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessagesJSON `json:"-"` +func (r EmailRoutingRuleReplaceParamsMatcher) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessages] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +// Field for type matcher. +type EmailRoutingRuleReplaceParamsMatchersField string -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +const ( + EmailRoutingRuleReplaceParamsMatchersFieldTo EmailRoutingRuleReplaceParamsMatchersField = "to" +) -// Whether the API call was successful -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeSuccess bool +// Type of matcher. +type EmailRoutingRuleReplaceParamsMatchersType string const ( - EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeSuccessTrue EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeSuccess = true + EmailRoutingRuleReplaceParamsMatchersTypeLiteral EmailRoutingRuleReplaceParamsMatchersType = "literal" ) -type EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfo] -type emailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +// Routing rule status. +type EmailRoutingRuleReplaceParamsEnabled bool -func (r *EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +const ( + EmailRoutingRuleReplaceParamsEnabledTrue EmailRoutingRuleReplaceParamsEnabled = true + EmailRoutingRuleReplaceParamsEnabledFalse EmailRoutingRuleReplaceParamsEnabled = false +) -type EmailRoutingRuleGetResponseEnvelope struct { - Errors []EmailRoutingRuleGetResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleGetResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingRuleGetResponse `json:"result,required"` +type EmailRoutingRuleReplaceResponseEnvelope struct { + Errors []EmailRoutingRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingRuleReplaceResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingRuleGetResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingRuleGetResponseEnvelopeJSON `json:"-"` + Success EmailRoutingRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingRuleReplaceResponseEnvelopeJSON `json:"-"` } -// emailRoutingRuleGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [EmailRoutingRuleGetResponseEnvelope] -type emailRoutingRuleGetResponseEnvelopeJSON struct { +// emailRoutingRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [EmailRoutingRuleReplaceResponseEnvelope] +type emailRoutingRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1178,51 +1077,51 @@ type emailRoutingRuleGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleGetResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [EmailRoutingRuleGetResponseEnvelopeErrors] -type emailRoutingRuleGetResponseEnvelopeErrorsJSON struct { +// emailRoutingRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [EmailRoutingRuleReplaceResponseEnvelopeErrors] +type emailRoutingRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleGetResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [EmailRoutingRuleGetResponseEnvelopeMessages] -type emailRoutingRuleGetResponseEnvelopeMessagesJSON struct { +// emailRoutingRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [EmailRoutingRuleReplaceResponseEnvelopeMessages] +type emailRoutingRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingRuleGetResponseEnvelopeSuccess bool +type EmailRoutingRuleReplaceResponseEnvelopeSuccess bool const ( - EmailRoutingRuleGetResponseEnvelopeSuccessTrue EmailRoutingRuleGetResponseEnvelopeSuccess = true + EmailRoutingRuleReplaceResponseEnvelopeSuccessTrue EmailRoutingRuleReplaceResponseEnvelopeSuccess = true ) diff --git a/emailroutingrule_test.go b/emailroutingrule_test.go index 7f5f63bef3a..44175aec498 100644 --- a/emailroutingrule_test.go +++ b/emailroutingrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingRuleUpdateWithOptionalParams(t *testing.T) { +func TestEmailRoutingRuleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,35 +29,34 @@ func TestEmailRoutingRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.Update( + _, err := client.Emails.Routing.Rules.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "a7e6fb77503c41d8a7f3113c6918f10c", - cloudflare.EmailRoutingRuleUpdateParams{ - Actions: cloudflare.F([]cloudflare.EmailRoutingRuleUpdateParamsAction{{ - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsActionsTypeForward), + cloudflare.EmailRoutingRuleNewParams{ + Actions: cloudflare.F([]cloudflare.EmailRoutingRuleNewParamsAction{{ + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsActionsTypeForward), + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsActionsTypeForward), + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }}), - Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleUpdateParamsMatcher{{ - Field: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersTypeLiteral), + Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleNewParamsMatcher{{ + Field: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersTypeLiteral), Value: cloudflare.F("test@example.com"), }, { - Field: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersTypeLiteral), + Field: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersTypeLiteral), Value: cloudflare.F("test@example.com"), }, { - Field: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsMatchersTypeLiteral), + Field: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsMatchersTypeLiteral), Value: cloudflare.F("test@example.com"), }}), - Enabled: cloudflare.F(cloudflare.EmailRoutingRuleUpdateParamsEnabledTrue), + Enabled: cloudflare.F(cloudflare.EmailRoutingRuleNewParamsEnabledTrue), Name: cloudflare.F("Send to user@example.net rule."), Priority: cloudflare.F(0.000000), }, @@ -71,7 +70,7 @@ func TestEmailRoutingRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestEmailRoutingRuleDelete(t *testing.T) { +func TestEmailRoutingRuleListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -87,10 +86,14 @@ func TestEmailRoutingRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.Delete( + _, err := client.Emails.Routing.Rules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "a7e6fb77503c41d8a7f3113c6918f10c", + cloudflare.EmailRoutingRuleListParams{ + Enabled: cloudflare.F(cloudflare.EmailRoutingRuleListParamsEnabledTrue), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + }, ) if err != nil { var apierr *cloudflare.Error @@ -101,7 +104,7 @@ func TestEmailRoutingRuleDelete(t *testing.T) { } } -func TestEmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleWithOptionalParams(t *testing.T) { +func TestEmailRoutingRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -117,37 +120,10 @@ func TestEmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleWithOptionalParam option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.EmailRoutingRoutingRulesNewRoutingRule( + _, err := client.Emails.Routing.Rules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParams{ - Actions: cloudflare.F([]cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsAction{{ - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeForward), - Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), - }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeForward), - Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), - }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsActionsTypeForward), - Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), - }}), - Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatcher{{ - Field: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersTypeLiteral), - Value: cloudflare.F("test@example.com"), - }, { - Field: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersTypeLiteral), - Value: cloudflare.F("test@example.com"), - }, { - Field: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersFieldTo), - Type: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsMatchersTypeLiteral), - Value: cloudflare.F("test@example.com"), - }}), - Enabled: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleParamsEnabledTrue), - Name: cloudflare.F("Send to user@example.net rule."), - Priority: cloudflare.F(0.000000), - }, + "a7e6fb77503c41d8a7f3113c6918f10c", ) if err != nil { var apierr *cloudflare.Error @@ -158,7 +134,7 @@ func TestEmailRoutingRuleEmailRoutingRoutingRulesNewRoutingRuleWithOptionalParam } } -func TestEmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesWithOptionalParams(t *testing.T) { +func TestEmailRoutingRuleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -174,14 +150,10 @@ func TestEmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesWithOptionalPar option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.EmailRoutingRoutingRulesListRoutingRules( + _, err := client.Emails.Routing.Rules.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParams{ - Enabled: cloudflare.F(cloudflare.EmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesParamsEnabledTrue), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - }, + "a7e6fb77503c41d8a7f3113c6918f10c", ) if err != nil { var apierr *cloudflare.Error @@ -192,7 +164,7 @@ func TestEmailRoutingRuleEmailRoutingRoutingRulesListRoutingRulesWithOptionalPar } } -func TestEmailRoutingRuleGet(t *testing.T) { +func TestEmailRoutingRuleReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -208,10 +180,38 @@ func TestEmailRoutingRuleGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.Get( + _, err := client.Emails.Routing.Rules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "a7e6fb77503c41d8a7f3113c6918f10c", + cloudflare.EmailRoutingRuleReplaceParams{ + Actions: cloudflare.F([]cloudflare.EmailRoutingRuleReplaceParamsAction{{ + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsActionsTypeForward), + Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), + }, { + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsActionsTypeForward), + Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), + }, { + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsActionsTypeForward), + Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), + }}), + Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleReplaceParamsMatcher{{ + Field: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersTypeLiteral), + Value: cloudflare.F("test@example.com"), + }, { + Field: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersTypeLiteral), + Value: cloudflare.F("test@example.com"), + }, { + Field: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersFieldTo), + Type: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsMatchersTypeLiteral), + Value: cloudflare.F("test@example.com"), + }}), + Enabled: cloudflare.F(cloudflare.EmailRoutingRuleReplaceParamsEnabledTrue), + Name: cloudflare.F("Send to user@example.net rule."), + Priority: cloudflare.F(0.000000), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/emailroutingrulecatchall.go b/emailroutingrulecatchall.go index b7369f14dbe..dfea4da4bd8 100644 --- a/emailroutingrulecatchall.go +++ b/emailroutingrulecatchall.go @@ -32,9 +32,9 @@ func NewEmailRoutingRuleCatchAllService(opts ...option.RequestOption) (r *EmailR } // Get information on the default catch-all routing rule. -func (r *EmailRoutingRuleCatchAllService) EmailRoutingRoutingRulesGetCatchAllRule(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse, err error) { +func (r *EmailRoutingRuleCatchAllService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRuleCatchAllGetResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelope + var env EmailRoutingRuleCatchAllGetResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,9 +46,9 @@ func (r *EmailRoutingRuleCatchAllService) EmailRoutingRoutingRulesGetCatchAllRul // Enable or disable catch-all routing rule, or change action to forward to // specific destination address. -func (r *EmailRoutingRuleCatchAllService) EmailRoutingRoutingRulesUpdateCatchAllRule(ctx context.Context, zoneIdentifier string, body EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParams, opts ...option.RequestOption) (res *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse, err error) { +func (r *EmailRoutingRuleCatchAllService) Replace(ctx context.Context, zoneIdentifier string, body EmailRoutingRuleCatchAllReplaceParams, opts ...option.RequestOption) (res *EmailRoutingRuleCatchAllReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelope + var env EmailRoutingRuleCatchAllReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -58,26 +58,25 @@ func (r *EmailRoutingRuleCatchAllService) EmailRoutingRoutingRulesUpdateCatchAll return } -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse struct { +type EmailRoutingRuleCatchAllGetResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions for the catch-all routing rule. - Actions []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseAction `json:"actions"` + Actions []EmailRoutingRuleCatchAllGetResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleCatchAllGetResponseEnabled `json:"enabled"` // List of matchers for the catch-all routing rule. - Matchers []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleCatchAllGetResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleCatchAllGetResponseJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseJSON struct { +// emailRoutingRuleCatchAllGetResponseJSON contains the JSON metadata for the +// struct [EmailRoutingRuleCatchAllGetResponse] +type emailRoutingRuleCatchAllGetResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -88,96 +87,93 @@ type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseJSON ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Action for the catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseAction struct { +type EmailRoutingRuleCatchAllGetResponseAction struct { // Type of action for catch-all rule. - Type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsType `json:"type,required"` - Value []string `json:"value"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionJSON `json:"-"` + Type EmailRoutingRuleCatchAllGetResponseActionsType `json:"type,required"` + Value []string `json:"value"` + JSON emailRoutingRuleCatchAllGetResponseActionJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseAction] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionJSON struct { +// emailRoutingRuleCatchAllGetResponseActionJSON contains the JSON metadata for the +// struct [EmailRoutingRuleCatchAllGetResponseAction] +type emailRoutingRuleCatchAllGetResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of action for catch-all rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsType string +type EmailRoutingRuleCatchAllGetResponseActionsType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsTypeDrop EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsType = "drop" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsTypeForward EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsType = "forward" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsTypeWorker EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseActionsType = "worker" + EmailRoutingRuleCatchAllGetResponseActionsTypeDrop EmailRoutingRuleCatchAllGetResponseActionsType = "drop" + EmailRoutingRuleCatchAllGetResponseActionsTypeForward EmailRoutingRuleCatchAllGetResponseActionsType = "forward" + EmailRoutingRuleCatchAllGetResponseActionsTypeWorker EmailRoutingRuleCatchAllGetResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabled bool +type EmailRoutingRuleCatchAllGetResponseEnabled bool const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabledTrue EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabled = true - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabledFalse EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnabled = false + EmailRoutingRuleCatchAllGetResponseEnabledTrue EmailRoutingRuleCatchAllGetResponseEnabled = true + EmailRoutingRuleCatchAllGetResponseEnabledFalse EmailRoutingRuleCatchAllGetResponseEnabled = false ) // Matcher for catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcher struct { +type EmailRoutingRuleCatchAllGetResponseMatcher struct { // Type of matcher. Default is 'all'. - Type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatchersType `json:"type,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcherJSON `json:"-"` + Type EmailRoutingRuleCatchAllGetResponseMatchersType `json:"type,required"` + JSON emailRoutingRuleCatchAllGetResponseMatcherJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcherJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcher] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcherJSON struct { +// emailRoutingRuleCatchAllGetResponseMatcherJSON contains the JSON metadata for +// the struct [EmailRoutingRuleCatchAllGetResponseMatcher] +type emailRoutingRuleCatchAllGetResponseMatcherJSON struct { Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of matcher. Default is 'all'. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatchersType string +type EmailRoutingRuleCatchAllGetResponseMatchersType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatchersTypeAll EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseMatchersType = "all" + EmailRoutingRuleCatchAllGetResponseMatchersTypeAll EmailRoutingRuleCatchAllGetResponseMatchersType = "all" ) -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse struct { +type EmailRoutingRuleCatchAllReplaceResponse struct { // Routing rule identifier. ID string `json:"id"` // List actions for the catch-all routing rule. - Actions []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseAction `json:"actions"` + Actions []EmailRoutingRuleCatchAllReplaceResponseAction `json:"actions"` // Routing rule status. - Enabled EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabled `json:"enabled"` + Enabled EmailRoutingRuleCatchAllReplaceResponseEnabled `json:"enabled"` // List of matchers for the catch-all routing rule. - Matchers []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcher `json:"matchers"` + Matchers []EmailRoutingRuleCatchAllReplaceResponseMatcher `json:"matchers"` // Routing rule name. Name string `json:"name"` // Routing rule tag. (Deprecated, replaced by routing rule identifier) - Tag string `json:"tag"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseJSON `json:"-"` + Tag string `json:"tag"` + JSON emailRoutingRuleCatchAllReplaceResponseJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseJSON struct { +// emailRoutingRuleCatchAllReplaceResponseJSON contains the JSON metadata for the +// struct [EmailRoutingRuleCatchAllReplaceResponse] +type emailRoutingRuleCatchAllReplaceResponseJSON struct { ID apijson.Field Actions apijson.Field Enabled apijson.Field @@ -188,89 +184,86 @@ type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseJ ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Action for the catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseAction struct { +type EmailRoutingRuleCatchAllReplaceResponseAction struct { // Type of action for catch-all rule. - Type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsType `json:"type,required"` - Value []string `json:"value"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionJSON `json:"-"` + Type EmailRoutingRuleCatchAllReplaceResponseActionsType `json:"type,required"` + Value []string `json:"value"` + JSON emailRoutingRuleCatchAllReplaceResponseActionJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseAction] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionJSON struct { +// emailRoutingRuleCatchAllReplaceResponseActionJSON contains the JSON metadata for +// the struct [EmailRoutingRuleCatchAllReplaceResponseAction] +type emailRoutingRuleCatchAllReplaceResponseActionJSON struct { Type apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseAction) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponseAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of action for catch-all rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsType string +type EmailRoutingRuleCatchAllReplaceResponseActionsType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsTypeDrop EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsType = "drop" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsTypeForward EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsType = "forward" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsTypeWorker EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseActionsType = "worker" + EmailRoutingRuleCatchAllReplaceResponseActionsTypeDrop EmailRoutingRuleCatchAllReplaceResponseActionsType = "drop" + EmailRoutingRuleCatchAllReplaceResponseActionsTypeForward EmailRoutingRuleCatchAllReplaceResponseActionsType = "forward" + EmailRoutingRuleCatchAllReplaceResponseActionsTypeWorker EmailRoutingRuleCatchAllReplaceResponseActionsType = "worker" ) // Routing rule status. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabled bool +type EmailRoutingRuleCatchAllReplaceResponseEnabled bool const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabledTrue EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabled = true - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabledFalse EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnabled = false + EmailRoutingRuleCatchAllReplaceResponseEnabledTrue EmailRoutingRuleCatchAllReplaceResponseEnabled = true + EmailRoutingRuleCatchAllReplaceResponseEnabledFalse EmailRoutingRuleCatchAllReplaceResponseEnabled = false ) // Matcher for catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcher struct { +type EmailRoutingRuleCatchAllReplaceResponseMatcher struct { // Type of matcher. Default is 'all'. - Type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatchersType `json:"type,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcherJSON `json:"-"` + Type EmailRoutingRuleCatchAllReplaceResponseMatchersType `json:"type,required"` + JSON emailRoutingRuleCatchAllReplaceResponseMatcherJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcherJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcher] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcherJSON struct { +// emailRoutingRuleCatchAllReplaceResponseMatcherJSON contains the JSON metadata +// for the struct [EmailRoutingRuleCatchAllReplaceResponseMatcher] +type emailRoutingRuleCatchAllReplaceResponseMatcherJSON struct { Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatcher) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponseMatcher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of matcher. Default is 'all'. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatchersType string +type EmailRoutingRuleCatchAllReplaceResponseMatchersType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatchersTypeAll EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseMatchersType = "all" + EmailRoutingRuleCatchAllReplaceResponseMatchersTypeAll EmailRoutingRuleCatchAllReplaceResponseMatchersType = "all" ) -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelope struct { - Errors []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponse `json:"result,required"` +type EmailRoutingRuleCatchAllGetResponseEnvelope struct { + Errors []EmailRoutingRuleCatchAllGetResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingRuleCatchAllGetResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingRuleCatchAllGetResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeJSON `json:"-"` + Success EmailRoutingRuleCatchAllGetResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingRuleCatchAllGetResponseEnvelopeJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelope] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeJSON struct { +// emailRoutingRuleCatchAllGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [EmailRoutingRuleCatchAllGetResponseEnvelope] +type emailRoutingRuleCatchAllGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -279,130 +272,127 @@ type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnve ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingRuleCatchAllGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrors] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrorsJSON struct { +// emailRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [EmailRoutingRuleCatchAllGetResponseEnvelopeErrors] +type emailRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingRuleCatchAllGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessages] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessagesJSON struct { +// emailRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [EmailRoutingRuleCatchAllGetResponseEnvelopeMessages] +type emailRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeSuccess bool +type EmailRoutingRuleCatchAllGetResponseEnvelopeSuccess bool const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeSuccessTrue EmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRuleResponseEnvelopeSuccess = true + EmailRoutingRuleCatchAllGetResponseEnvelopeSuccessTrue EmailRoutingRuleCatchAllGetResponseEnvelopeSuccess = true ) -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParams struct { +type EmailRoutingRuleCatchAllReplaceParams struct { // List actions for the catch-all routing rule. - Actions param.Field[[]EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsAction] `json:"actions,required"` + Actions param.Field[[]EmailRoutingRuleCatchAllReplaceParamsAction] `json:"actions,required"` // List of matchers for the catch-all routing rule. - Matchers param.Field[[]EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatcher] `json:"matchers,required"` + Matchers param.Field[[]EmailRoutingRuleCatchAllReplaceParamsMatcher] `json:"matchers,required"` // Routing rule status. - Enabled param.Field[EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabled] `json:"enabled"` + Enabled param.Field[EmailRoutingRuleCatchAllReplaceParamsEnabled] `json:"enabled"` // Routing rule name. Name param.Field[string] `json:"name"` } -func (r EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParams) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleCatchAllReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Action for the catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsAction struct { +type EmailRoutingRuleCatchAllReplaceParamsAction struct { // Type of action for catch-all rule. - Type param.Field[EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsType] `json:"type,required"` - Value param.Field[[]string] `json:"value"` + Type param.Field[EmailRoutingRuleCatchAllReplaceParamsActionsType] `json:"type,required"` + Value param.Field[[]string] `json:"value"` } -func (r EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsAction) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleCatchAllReplaceParamsAction) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of action for catch-all rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsType string +type EmailRoutingRuleCatchAllReplaceParamsActionsType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeDrop EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsType = "drop" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeForward EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsType = "forward" - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeWorker EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsType = "worker" + EmailRoutingRuleCatchAllReplaceParamsActionsTypeDrop EmailRoutingRuleCatchAllReplaceParamsActionsType = "drop" + EmailRoutingRuleCatchAllReplaceParamsActionsTypeForward EmailRoutingRuleCatchAllReplaceParamsActionsType = "forward" + EmailRoutingRuleCatchAllReplaceParamsActionsTypeWorker EmailRoutingRuleCatchAllReplaceParamsActionsType = "worker" ) // Matcher for catch-all routing rule. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatcher struct { +type EmailRoutingRuleCatchAllReplaceParamsMatcher struct { // Type of matcher. Default is 'all'. - Type param.Field[EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersType] `json:"type,required"` + Type param.Field[EmailRoutingRuleCatchAllReplaceParamsMatchersType] `json:"type,required"` } -func (r EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatcher) MarshalJSON() (data []byte, err error) { +func (r EmailRoutingRuleCatchAllReplaceParamsMatcher) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of matcher. Default is 'all'. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersType string +type EmailRoutingRuleCatchAllReplaceParamsMatchersType string const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersTypeAll EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersType = "all" + EmailRoutingRuleCatchAllReplaceParamsMatchersTypeAll EmailRoutingRuleCatchAllReplaceParamsMatchersType = "all" ) // Routing rule status. -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabled bool +type EmailRoutingRuleCatchAllReplaceParamsEnabled bool const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabledTrue EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabled = true - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabledFalse EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabled = false + EmailRoutingRuleCatchAllReplaceParamsEnabledTrue EmailRoutingRuleCatchAllReplaceParamsEnabled = true + EmailRoutingRuleCatchAllReplaceParamsEnabledFalse EmailRoutingRuleCatchAllReplaceParamsEnabled = false ) -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelope struct { - Errors []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessages `json:"messages,required"` - Result EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponse `json:"result,required"` +type EmailRoutingRuleCatchAllReplaceResponseEnvelope struct { + Errors []EmailRoutingRuleCatchAllReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []EmailRoutingRuleCatchAllReplaceResponseEnvelopeMessages `json:"messages,required"` + Result EmailRoutingRuleCatchAllReplaceResponse `json:"result,required"` // Whether the API call was successful - Success EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeSuccess `json:"success,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeJSON `json:"-"` + Success EmailRoutingRuleCatchAllReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON emailRoutingRuleCatchAllReplaceResponseEnvelopeJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelope] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeJSON struct { +// emailRoutingRuleCatchAllReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [EmailRoutingRuleCatchAllReplaceResponseEnvelope] +type emailRoutingRuleCatchAllReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -411,53 +401,52 @@ type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseE ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrorsJSON `json:"-"` +type EmailRoutingRuleCatchAllReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleCatchAllReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrors] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrorsJSON struct { +// emailRoutingRuleCatchAllReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [EmailRoutingRuleCatchAllReplaceResponseEnvelopeErrors] +type emailRoutingRuleCatchAllReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessagesJSON `json:"-"` +type EmailRoutingRuleCatchAllReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON emailRoutingRuleCatchAllReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessages] -type emailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessagesJSON struct { +// emailRoutingRuleCatchAllReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [EmailRoutingRuleCatchAllReplaceResponseEnvelopeMessages] +type emailRoutingRuleCatchAllReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *EmailRoutingRuleCatchAllReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeSuccess bool +type EmailRoutingRuleCatchAllReplaceResponseEnvelopeSuccess bool const ( - EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeSuccessTrue EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleResponseEnvelopeSuccess = true + EmailRoutingRuleCatchAllReplaceResponseEnvelopeSuccessTrue EmailRoutingRuleCatchAllReplaceResponseEnvelopeSuccess = true ) diff --git a/emailroutingrulecatchall_test.go b/emailroutingrulecatchall_test.go index 5c1114d5af8..7b80e581790 100644 --- a/emailroutingrulecatchall_test.go +++ b/emailroutingrulecatchall_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestEmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRule(t *testing.T) { +func TestEmailRoutingRuleCatchAllGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestEmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRule(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.CatchAlls.EmailRoutingRoutingRulesGetCatchAllRule(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Emails.Routing.Rules.CatchAlls.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestEmailRoutingRuleCatchAllEmailRoutingRoutingRulesGetCatchAllRule(t *test } } -func TestEmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleWithOptionalParams(t *testing.T) { +func TestEmailRoutingRuleCatchAllReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,28 +55,28 @@ func TestEmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleWithO option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Emails.Routings.Rules.CatchAlls.EmailRoutingRoutingRulesUpdateCatchAllRule( + _, err := client.Emails.Routing.Rules.CatchAlls.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParams{ - Actions: cloudflare.F([]cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsAction{{ - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeForward), + cloudflare.EmailRoutingRuleCatchAllReplaceParams{ + Actions: cloudflare.F([]cloudflare.EmailRoutingRuleCatchAllReplaceParamsAction{{ + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeForward), + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsActionsTypeForward), + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsActionsTypeForward), Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}), }}), - Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatcher{{ - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersTypeAll), + Matchers: cloudflare.F([]cloudflare.EmailRoutingRuleCatchAllReplaceParamsMatcher{{ + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsMatchersTypeAll), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersTypeAll), + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsMatchersTypeAll), }, { - Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsMatchersTypeAll), + Type: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsMatchersTypeAll), }}), - Enabled: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllEmailRoutingRoutingRulesUpdateCatchAllRuleParamsEnabledTrue), + Enabled: cloudflare.F(cloudflare.EmailRoutingRuleCatchAllReplaceParamsEnabledTrue), Name: cloudflare.F("Send to user@example.net rule."), }, ) diff --git a/filter.go b/filter.go index 179c28c093f..49f4ddf71cf 100644 --- a/filter.go +++ b/filter.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -32,12 +33,12 @@ func NewFilterService(opts ...option.RequestOption) (r *FilterService) { return } -// Updates an existing filter. -func (r *FilterService) Update(ctx context.Context, zoneIdentifier string, id string, body FilterUpdateParams, opts ...option.RequestOption) (res *FilterUpdateResponse, err error) { +// Creates one or more filters. +func (r *FilterService) New(ctx context.Context, zoneIdentifier string, body FilterNewParams, opts ...option.RequestOption) (res *[]FilterNewResponse, err error) { opts = append(r.Options[:], opts...) - var env FilterUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FilterNewResponseEnvelope + path := fmt.Sprintf("zones/%s/filters", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -45,39 +46,37 @@ func (r *FilterService) Update(ctx context.Context, zoneIdentifier string, id st return } -// Deletes an existing filter. -func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env FilterDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) +// Fetches filters in a zone. You can filter the results using several optional +// parameters. +func (r *FilterService) List(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FilterListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/filters", zoneIdentifier) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return -} - -// Creates one or more filters. -func (r *FilterService) FiltersNewFilters(ctx context.Context, zoneIdentifier string, body FilterFiltersNewFiltersParams, opts ...option.RequestOption) (res *[]FilterFiltersNewFiltersResponse, err error) { - opts = append(r.Options[:], opts...) - var env FilterFiltersNewFiltersResponseEnvelope - path := fmt.Sprintf("zones/%s/filters", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = cfg.Execute() if err != nil { - return + return nil, err } - res = &env.Result - return + res.SetPageConfig(cfg, raw) + return res, nil } // Fetches filters in a zone. You can filter the results using several optional // parameters. -func (r *FilterService) FiltersListFilters(ctx context.Context, zoneIdentifier string, query FilterFiltersListFiltersParams, opts ...option.RequestOption) (res *[]FilterFiltersListFiltersResponse, err error) { +func (r *FilterService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FilterListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) +} + +// Deletes an existing filter. +func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env FilterFiltersListFiltersResponseEnvelope - path := fmt.Sprintf("zones/%s/filters", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env FilterDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -85,12 +84,12 @@ func (r *FilterService) FiltersListFilters(ctx context.Context, zoneIdentifier s return } -// Updates one or more existing filters. -func (r *FilterService) FiltersUpdateFilters(ctx context.Context, zoneIdentifier string, body FilterFiltersUpdateFiltersParams, opts ...option.RequestOption) (res *[]FilterFiltersUpdateFiltersResponse, err error) { +// Fetches the details of a filter. +func (r *FilterService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterGetResponse, err error) { opts = append(r.Options[:], opts...) - var env FilterFiltersUpdateFiltersResponseEnvelope - path := fmt.Sprintf("zones/%s/filters", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FilterGetResponseEnvelope + path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -98,12 +97,12 @@ func (r *FilterService) FiltersUpdateFilters(ctx context.Context, zoneIdentifier return } -// Fetches the details of a filter. -func (r *FilterService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterGetResponse, err error) { +// Updates an existing filter. +func (r *FilterService) Replace(ctx context.Context, zoneIdentifier string, id string, body FilterReplaceParams, opts ...option.RequestOption) (res *FilterReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env FilterGetResponseEnvelope + var env FilterReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -111,7 +110,7 @@ func (r *FilterService) Get(ctx context.Context, zoneIdentifier string, id strin return } -type FilterUpdateResponse struct { +type FilterNewResponse struct { // The unique identifier of the filter. ID string `json:"id,required"` // The filter expression. For more information, refer to @@ -122,13 +121,13 @@ type FilterUpdateResponse struct { // An informative summary of the filter. Description string `json:"description"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterUpdateResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON filterNewResponseJSON `json:"-"` } -// filterUpdateResponseJSON contains the JSON metadata for the struct -// [FilterUpdateResponse] -type filterUpdateResponseJSON struct { +// filterNewResponseJSON contains the JSON metadata for the struct +// [FilterNewResponse] +type filterNewResponseJSON struct { ID apijson.Field Expression apijson.Field Paused apijson.Field @@ -138,42 +137,11 @@ type filterUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterDeleteResponse struct { - // The unique identifier of the filter. - ID string `json:"id,required"` - // An informative summary of the filter. - Description string `json:"description"` - // The filter expression. For more information, refer to - // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - Expression string `json:"expression"` - // When true, indicates that the filter is currently paused. - Paused bool `json:"paused"` - // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterDeleteResponseJSON `json:"-"` -} - -// filterDeleteResponseJSON contains the JSON metadata for the struct -// [FilterDeleteResponse] -type filterDeleteResponseJSON struct { - ID apijson.Field - Description apijson.Field - Expression apijson.Field - Paused apijson.Field - Ref apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FilterNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersNewFiltersResponse struct { +type FilterListResponse struct { // The unique identifier of the filter. ID string `json:"id,required"` // The filter expression. For more information, refer to @@ -184,13 +152,13 @@ type FilterFiltersNewFiltersResponse struct { // An informative summary of the filter. Description string `json:"description"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterFiltersNewFiltersResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON filterListResponseJSON `json:"-"` } -// filterFiltersNewFiltersResponseJSON contains the JSON metadata for the struct -// [FilterFiltersNewFiltersResponse] -type filterFiltersNewFiltersResponseJSON struct { +// filterListResponseJSON contains the JSON metadata for the struct +// [FilterListResponse] +type filterListResponseJSON struct { ID apijson.Field Expression apijson.Field Paused apijson.Field @@ -200,42 +168,42 @@ type filterFiltersNewFiltersResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterFiltersNewFiltersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FilterListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersListFiltersResponse struct { +type FilterDeleteResponse struct { // The unique identifier of the filter. ID string `json:"id,required"` + // An informative summary of the filter. + Description string `json:"description"` // The filter expression. For more information, refer to // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - Expression string `json:"expression,required"` + Expression string `json:"expression"` // When true, indicates that the filter is currently paused. - Paused bool `json:"paused,required"` - // An informative summary of the filter. - Description string `json:"description"` + Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterFiltersListFiltersResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON filterDeleteResponseJSON `json:"-"` } -// filterFiltersListFiltersResponseJSON contains the JSON metadata for the struct -// [FilterFiltersListFiltersResponse] -type filterFiltersListFiltersResponseJSON struct { +// filterDeleteResponseJSON contains the JSON metadata for the struct +// [FilterDeleteResponse] +type filterDeleteResponseJSON struct { ID apijson.Field + Description apijson.Field Expression apijson.Field Paused apijson.Field - Description apijson.Field Ref apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersListFiltersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FilterDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersUpdateFiltersResponse struct { +type FilterGetResponse struct { // The unique identifier of the filter. ID string `json:"id,required"` // The filter expression. For more information, refer to @@ -246,13 +214,13 @@ type FilterFiltersUpdateFiltersResponse struct { // An informative summary of the filter. Description string `json:"description"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterFiltersUpdateFiltersResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON filterGetResponseJSON `json:"-"` } -// filterFiltersUpdateFiltersResponseJSON contains the JSON metadata for the struct -// [FilterFiltersUpdateFiltersResponse] -type filterFiltersUpdateFiltersResponseJSON struct { +// filterGetResponseJSON contains the JSON metadata for the struct +// [FilterGetResponse] +type filterGetResponseJSON struct { ID apijson.Field Expression apijson.Field Paused apijson.Field @@ -262,11 +230,11 @@ type filterFiltersUpdateFiltersResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterFiltersUpdateFiltersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FilterGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterGetResponse struct { +type FilterReplaceResponse struct { // The unique identifier of the filter. ID string `json:"id,required"` // The filter expression. For more information, refer to @@ -277,13 +245,13 @@ type FilterGetResponse struct { // An informative summary of the filter. Description string `json:"description"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON filterGetResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON filterReplaceResponseJSON `json:"-"` } -// filterGetResponseJSON contains the JSON metadata for the struct -// [FilterGetResponse] -type filterGetResponseJSON struct { +// filterReplaceResponseJSON contains the JSON metadata for the struct +// [FilterReplaceResponse] +type filterReplaceResponseJSON struct { ID apijson.Field Expression apijson.Field Paused apijson.Field @@ -293,177 +261,31 @@ type filterGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterUpdateParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r FilterUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type FilterUpdateResponseEnvelope struct { - Errors []FilterUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterUpdateResponseEnvelopeMessages `json:"messages,required"` - Result FilterUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FilterUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON filterUpdateResponseEnvelopeJSON `json:"-"` -} - -// filterUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [FilterUpdateResponseEnvelope] -type filterUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// filterUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [FilterUpdateResponseEnvelopeErrors] -type filterUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// filterUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [FilterUpdateResponseEnvelopeMessages] -type filterUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FilterUpdateResponseEnvelopeSuccess bool - -const ( - FilterUpdateResponseEnvelopeSuccessTrue FilterUpdateResponseEnvelopeSuccess = true -) - -type FilterDeleteResponseEnvelope struct { - Errors []FilterDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterDeleteResponseEnvelopeMessages `json:"messages,required"` - Result FilterDeleteResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FilterDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON filterDeleteResponseEnvelopeJSON `json:"-"` -} - -// filterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [FilterDeleteResponseEnvelope] -type filterDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// filterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [FilterDeleteResponseEnvelopeErrors] -type filterDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// filterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [FilterDeleteResponseEnvelopeMessages] -type filterDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FilterReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type FilterDeleteResponseEnvelopeSuccess bool - -const ( - FilterDeleteResponseEnvelopeSuccessTrue FilterDeleteResponseEnvelopeSuccess = true -) - -type FilterFiltersNewFiltersParams struct { +type FilterNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FilterFiltersNewFiltersParams) MarshalJSON() (data []byte, err error) { +func (r FilterNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FilterFiltersNewFiltersResponseEnvelope struct { - Errors []FilterFiltersNewFiltersResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterFiltersNewFiltersResponseEnvelopeMessages `json:"messages,required"` - Result []FilterFiltersNewFiltersResponse `json:"result,required,nullable"` +type FilterNewResponseEnvelope struct { + Errors []FilterNewResponseEnvelopeErrors `json:"errors,required"` + Messages []FilterNewResponseEnvelopeMessages `json:"messages,required"` + Result []FilterNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FilterFiltersNewFiltersResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FilterFiltersNewFiltersResponseEnvelopeResultInfo `json:"result_info"` - JSON filterFiltersNewFiltersResponseEnvelopeJSON `json:"-"` + Success FilterNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo FilterNewResponseEnvelopeResultInfo `json:"result_info"` + JSON filterNewResponseEnvelopeJSON `json:"-"` } -// filterFiltersNewFiltersResponseEnvelopeJSON contains the JSON metadata for the -// struct [FilterFiltersNewFiltersResponseEnvelope] -type filterFiltersNewFiltersResponseEnvelopeJSON struct { +// filterNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [FilterNewResponseEnvelope] +type filterNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -473,56 +295,56 @@ type filterFiltersNewFiltersResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterFiltersNewFiltersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FilterNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersNewFiltersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersNewFiltersResponseEnvelopeErrorsJSON `json:"-"` +type FilterNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterNewResponseEnvelopeErrorsJSON `json:"-"` } -// filterFiltersNewFiltersResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [FilterFiltersNewFiltersResponseEnvelopeErrors] -type filterFiltersNewFiltersResponseEnvelopeErrorsJSON struct { +// filterNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [FilterNewResponseEnvelopeErrors] +type filterNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersNewFiltersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FilterNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersNewFiltersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersNewFiltersResponseEnvelopeMessagesJSON `json:"-"` +type FilterNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterNewResponseEnvelopeMessagesJSON `json:"-"` } -// filterFiltersNewFiltersResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [FilterFiltersNewFiltersResponseEnvelopeMessages] -type filterFiltersNewFiltersResponseEnvelopeMessagesJSON struct { +// filterNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [FilterNewResponseEnvelopeMessages] +type filterNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersNewFiltersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FilterNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FilterFiltersNewFiltersResponseEnvelopeSuccess bool +type FilterNewResponseEnvelopeSuccess bool const ( - FilterFiltersNewFiltersResponseEnvelopeSuccessTrue FilterFiltersNewFiltersResponseEnvelopeSuccess = true + FilterNewResponseEnvelopeSuccessTrue FilterNewResponseEnvelopeSuccess = true ) -type FilterFiltersNewFiltersResponseEnvelopeResultInfo struct { +type FilterNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -530,13 +352,13 @@ type FilterFiltersNewFiltersResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON filterFiltersNewFiltersResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON filterNewResponseEnvelopeResultInfoJSON `json:"-"` } -// filterFiltersNewFiltersResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [FilterFiltersNewFiltersResponseEnvelopeResultInfo] -type filterFiltersNewFiltersResponseEnvelopeResultInfoJSON struct { +// filterNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [FilterNewResponseEnvelopeResultInfo] +type filterNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -545,11 +367,11 @@ type filterFiltersNewFiltersResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterFiltersNewFiltersResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *FilterNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersListFiltersParams struct { +type FilterListParams struct { // A case-insensitive string to find in the description. Description param.Field[string] `query:"description"` // A case-insensitive string to find in the expression. @@ -564,231 +386,172 @@ type FilterFiltersListFiltersParams struct { Ref param.Field[string] `query:"ref"` } -// URLQuery serializes [FilterFiltersListFiltersParams]'s query parameters as -// `url.Values`. -func (r FilterFiltersListFiltersParams) URLQuery() (v url.Values) { +// URLQuery serializes [FilterListParams]'s query parameters as `url.Values`. +func (r FilterListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type FilterFiltersListFiltersResponseEnvelope struct { - Errors []FilterFiltersListFiltersResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterFiltersListFiltersResponseEnvelopeMessages `json:"messages,required"` - Result []FilterFiltersListFiltersResponse `json:"result,required,nullable"` +type FilterDeleteResponseEnvelope struct { + Errors []FilterDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []FilterDeleteResponseEnvelopeMessages `json:"messages,required"` + Result FilterDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FilterFiltersListFiltersResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FilterFiltersListFiltersResponseEnvelopeResultInfo `json:"result_info"` - JSON filterFiltersListFiltersResponseEnvelopeJSON `json:"-"` + Success FilterDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON filterDeleteResponseEnvelopeJSON `json:"-"` } -// filterFiltersListFiltersResponseEnvelopeJSON contains the JSON metadata for the -// struct [FilterFiltersListFiltersResponseEnvelope] -type filterFiltersListFiltersResponseEnvelopeJSON struct { +// filterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [FilterDeleteResponseEnvelope] +type filterDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersListFiltersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersListFiltersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersListFiltersResponseEnvelopeErrorsJSON `json:"-"` +type FilterDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// filterFiltersListFiltersResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [FilterFiltersListFiltersResponseEnvelopeErrors] -type filterFiltersListFiltersResponseEnvelopeErrorsJSON struct { +// filterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [FilterDeleteResponseEnvelopeErrors] +type filterDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersListFiltersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersListFiltersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersListFiltersResponseEnvelopeMessagesJSON `json:"-"` +type FilterDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// filterFiltersListFiltersResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [FilterFiltersListFiltersResponseEnvelopeMessages] -type filterFiltersListFiltersResponseEnvelopeMessagesJSON struct { +// filterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [FilterDeleteResponseEnvelopeMessages] +type filterDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersListFiltersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FilterFiltersListFiltersResponseEnvelopeSuccess bool +type FilterDeleteResponseEnvelopeSuccess bool const ( - FilterFiltersListFiltersResponseEnvelopeSuccessTrue FilterFiltersListFiltersResponseEnvelopeSuccess = true + FilterDeleteResponseEnvelopeSuccessTrue FilterDeleteResponseEnvelopeSuccess = true ) -type FilterFiltersListFiltersResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON filterFiltersListFiltersResponseEnvelopeResultInfoJSON `json:"-"` -} - -// filterFiltersListFiltersResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [FilterFiltersListFiltersResponseEnvelopeResultInfo] -type filterFiltersListFiltersResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FilterFiltersListFiltersResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FilterFiltersUpdateFiltersParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r FilterFiltersUpdateFiltersParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type FilterFiltersUpdateFiltersResponseEnvelope struct { - Errors []FilterFiltersUpdateFiltersResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterFiltersUpdateFiltersResponseEnvelopeMessages `json:"messages,required"` - Result []FilterFiltersUpdateFiltersResponse `json:"result,required,nullable"` +type FilterGetResponseEnvelope struct { + Errors []FilterGetResponseEnvelopeErrors `json:"errors,required"` + Messages []FilterGetResponseEnvelopeMessages `json:"messages,required"` + Result FilterGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FilterFiltersUpdateFiltersResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FilterFiltersUpdateFiltersResponseEnvelopeResultInfo `json:"result_info"` - JSON filterFiltersUpdateFiltersResponseEnvelopeJSON `json:"-"` + Success FilterGetResponseEnvelopeSuccess `json:"success,required"` + JSON filterGetResponseEnvelopeJSON `json:"-"` } -// filterFiltersUpdateFiltersResponseEnvelopeJSON contains the JSON metadata for -// the struct [FilterFiltersUpdateFiltersResponseEnvelope] -type filterFiltersUpdateFiltersResponseEnvelopeJSON struct { +// filterGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [FilterGetResponseEnvelope] +type filterGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersUpdateFiltersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FilterGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersUpdateFiltersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersUpdateFiltersResponseEnvelopeErrorsJSON `json:"-"` +type FilterGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterGetResponseEnvelopeErrorsJSON `json:"-"` } -// filterFiltersUpdateFiltersResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [FilterFiltersUpdateFiltersResponseEnvelopeErrors] -type filterFiltersUpdateFiltersResponseEnvelopeErrorsJSON struct { +// filterGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [FilterGetResponseEnvelopeErrors] +type filterGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersUpdateFiltersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FilterGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterFiltersUpdateFiltersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterFiltersUpdateFiltersResponseEnvelopeMessagesJSON `json:"-"` +type FilterGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterGetResponseEnvelopeMessagesJSON `json:"-"` } -// filterFiltersUpdateFiltersResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [FilterFiltersUpdateFiltersResponseEnvelopeMessages] -type filterFiltersUpdateFiltersResponseEnvelopeMessagesJSON struct { +// filterGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [FilterGetResponseEnvelopeMessages] +type filterGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterFiltersUpdateFiltersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FilterGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FilterFiltersUpdateFiltersResponseEnvelopeSuccess bool +type FilterGetResponseEnvelopeSuccess bool const ( - FilterFiltersUpdateFiltersResponseEnvelopeSuccessTrue FilterFiltersUpdateFiltersResponseEnvelopeSuccess = true + FilterGetResponseEnvelopeSuccessTrue FilterGetResponseEnvelopeSuccess = true ) -type FilterFiltersUpdateFiltersResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON filterFiltersUpdateFiltersResponseEnvelopeResultInfoJSON `json:"-"` -} - -// filterFiltersUpdateFiltersResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [FilterFiltersUpdateFiltersResponseEnvelopeResultInfo] -type filterFiltersUpdateFiltersResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field +type FilterReplaceParams struct { + Body param.Field[interface{}] `json:"body,required"` } -func (r *FilterFiltersUpdateFiltersResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r FilterReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } -type FilterGetResponseEnvelope struct { - Errors []FilterGetResponseEnvelopeErrors `json:"errors,required"` - Messages []FilterGetResponseEnvelopeMessages `json:"messages,required"` - Result FilterGetResponse `json:"result,required,nullable"` +type FilterReplaceResponseEnvelope struct { + Errors []FilterReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []FilterReplaceResponseEnvelopeMessages `json:"messages,required"` + Result FilterReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FilterGetResponseEnvelopeSuccess `json:"success,required"` - JSON filterGetResponseEnvelopeJSON `json:"-"` + Success FilterReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON filterReplaceResponseEnvelopeJSON `json:"-"` } -// filterGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [FilterGetResponseEnvelope] -type filterGetResponseEnvelopeJSON struct { +// filterReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [FilterReplaceResponseEnvelope] +type filterReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -797,51 +560,51 @@ type filterGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FilterGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FilterReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterGetResponseEnvelopeErrorsJSON `json:"-"` +type FilterReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// filterGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [FilterGetResponseEnvelopeErrors] -type filterGetResponseEnvelopeErrorsJSON struct { +// filterReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FilterReplaceResponseEnvelopeErrors] +type filterReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FilterReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FilterGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON filterGetResponseEnvelopeMessagesJSON `json:"-"` +type FilterReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON filterReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// filterGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [FilterGetResponseEnvelopeMessages] -type filterGetResponseEnvelopeMessagesJSON struct { +// filterReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [FilterReplaceResponseEnvelopeMessages] +type filterReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FilterGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FilterReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FilterGetResponseEnvelopeSuccess bool +type FilterReplaceResponseEnvelopeSuccess bool const ( - FilterGetResponseEnvelopeSuccessTrue FilterGetResponseEnvelopeSuccess = true + FilterReplaceResponseEnvelopeSuccessTrue FilterReplaceResponseEnvelopeSuccess = true ) diff --git a/filter_test.go b/filter_test.go index 4ac31db5416..8142bb507b8 100644 --- a/filter_test.go +++ b/filter_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFilterUpdate(t *testing.T) { +func TestFilterNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestFilterUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Filters.Update( + _, err := client.Filters.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b61", - cloudflare.FilterUpdateParams{ + cloudflare.FilterNewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -46,7 +45,7 @@ func TestFilterUpdate(t *testing.T) { } } -func TestFilterDelete(t *testing.T) { +func TestFilterListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,41 +61,16 @@ func TestFilterDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Filters.Delete( + _, err := client.Filters.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b61", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestFilterFiltersNewFilters(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Filters.FiltersNewFilters( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FilterFiltersNewFiltersParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + cloudflare.FilterListParams{ + Description: cloudflare.F("browsers"), + Expression: cloudflare.F("php"), + Page: cloudflare.F(1.000000), + Paused: cloudflare.F(false), + PerPage: cloudflare.F(5.000000), + Ref: cloudflare.F("FIL-100"), }, ) if err != nil { @@ -108,7 +82,7 @@ func TestFilterFiltersNewFilters(t *testing.T) { } } -func TestFilterFiltersListFiltersWithOptionalParams(t *testing.T) { +func TestFilterDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,17 +98,10 @@ func TestFilterFiltersListFiltersWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Filters.FiltersListFilters( + _, err := client.Filters.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FilterFiltersListFiltersParams{ - Description: cloudflare.F("browsers"), - Expression: cloudflare.F("php"), - Page: cloudflare.F(1.000000), - Paused: cloudflare.F(false), - PerPage: cloudflare.F(5.000000), - Ref: cloudflare.F("FIL-100"), - }, + "372e67954025e0ba6aaa6d586b9e0b61", ) if err != nil { var apierr *cloudflare.Error @@ -145,7 +112,7 @@ func TestFilterFiltersListFiltersWithOptionalParams(t *testing.T) { } } -func TestFilterFiltersUpdateFilters(t *testing.T) { +func TestFilterGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -161,12 +128,10 @@ func TestFilterFiltersUpdateFilters(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Filters.FiltersUpdateFilters( + _, err := client.Filters.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FilterFiltersUpdateFiltersParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "372e67954025e0ba6aaa6d586b9e0b61", ) if err != nil { var apierr *cloudflare.Error @@ -177,7 +142,7 @@ func TestFilterFiltersUpdateFilters(t *testing.T) { } } -func TestFilterGet(t *testing.T) { +func TestFilterReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -193,10 +158,13 @@ func TestFilterGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Filters.Get( + _, err := client.Filters.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b61", + cloudflare.FilterReplaceParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewalllockdown.go b/firewalllockdown.go index aad6a2ead8e..102e0158d49 100644 --- a/firewalllockdown.go +++ b/firewalllockdown.go @@ -14,6 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -35,12 +36,12 @@ func NewFirewallLockdownService(opts ...option.RequestOption) (r *FirewallLockdo return } -// Updates an existing Zone Lockdown rule. -func (r *FirewallLockdownService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallLockdownUpdateParams, opts ...option.RequestOption) (res *FirewallLockdownUpdateResponse, err error) { +// Creates a new Zone Lockdown rule. +func (r *FirewallLockdownService) New(ctx context.Context, zoneIdentifier string, body FirewallLockdownNewParams, opts ...option.RequestOption) (res *FirewallLockdownNewResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallLockdownUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FirewallLockdownNewResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -48,6 +49,31 @@ func (r *FirewallLockdownService) Update(ctx context.Context, zoneIdentifier str return } +// Fetches Zone Lockdown rules. You can filter the results using several optional +// parameters. +func (r *FirewallLockdownService) List(ctx context.Context, zoneIdentifier string, query FirewallLockdownListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallLockdownListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Fetches Zone Lockdown rules. You can filter the results using several optional +// parameters. +func (r *FirewallLockdownService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallLockdownListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallLockdownListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) +} + // Deletes an existing Zone Lockdown rule. func (r *FirewallLockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallLockdownDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -74,26 +100,12 @@ func (r *FirewallLockdownService) Get(ctx context.Context, zoneIdentifier string return } -// Creates a new Zone Lockdown rule. -func (r *FirewallLockdownService) ZoneLockdownNewAZoneLockdownRule(ctx context.Context, zoneIdentifier string, body FirewallLockdownZoneLockdownNewAZoneLockdownRuleParams, opts ...option.RequestOption) (res *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches Zone Lockdown rules. You can filter the results using several optional -// parameters. -func (r *FirewallLockdownService) ZoneLockdownListZoneLockdownRules(ctx context.Context, zoneIdentifier string, query FirewallLockdownZoneLockdownListZoneLockdownRulesParams, opts ...option.RequestOption) (res *[]FirewallLockdownZoneLockdownListZoneLockdownRulesResponse, err error) { +// Updates an existing Zone Lockdown rule. +func (r *FirewallLockdownService) Replace(ctx context.Context, zoneIdentifier string, id string, body FirewallLockdownReplaceParams, opts ...option.RequestOption) (res *FirewallLockdownReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env FirewallLockdownReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -101,13 +113,13 @@ func (r *FirewallLockdownService) ZoneLockdownListZoneLockdownRules(ctx context. return } -type FirewallLockdownUpdateResponse struct { +type FirewallLockdownNewResponse struct { // The unique identifier of the Zone Lockdown rule. ID string `json:"id,required"` // A list of IP addresses or CIDR ranges that will be allowed to access the URLs // specified in the Zone Lockdown rule. You can include any number of `ip` or // `ip_range` configurations. - Configurations FirewallLockdownUpdateResponseConfigurations `json:"configurations,required"` + Configurations FirewallLockdownNewResponseConfigurations `json:"configurations,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on,required" format:"date-time"` // An informative summary of the rule. @@ -119,13 +131,13 @@ type FirewallLockdownUpdateResponse struct { // The URLs to include in the rule definition. You can use wildcards. Each entered // URL will be escaped before use, which means you can only use simple wildcard // patterns. - URLs []string `json:"urls,required"` - JSON firewallLockdownUpdateResponseJSON `json:"-"` + URLs []string `json:"urls,required"` + JSON firewallLockdownNewResponseJSON `json:"-"` } -// firewallLockdownUpdateResponseJSON contains the JSON metadata for the struct -// [FirewallLockdownUpdateResponse] -type firewallLockdownUpdateResponseJSON struct { +// firewallLockdownNewResponseJSON contains the JSON metadata for the struct +// [FirewallLockdownNewResponse] +type firewallLockdownNewResponseJSON struct { ID apijson.Field Configurations apijson.Field CreatedOn apijson.Field @@ -137,7 +149,7 @@ type firewallLockdownUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -146,110 +158,92 @@ func (r *FirewallLockdownUpdateResponse) UnmarshalJSON(data []byte) (err error) // `ip_range` configurations. // // Union satisfied by -// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration] or -// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. -type FirewallLockdownUpdateResponseConfigurations interface { - implementsFirewallLockdownUpdateResponseConfigurations() +// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration] or +// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. +type FirewallLockdownNewResponseConfigurations interface { + implementsFirewallLockdownNewResponseConfigurations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownUpdateResponseConfigurations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownNewResponseConfigurations)(nil)).Elem(), "") } -type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { +type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. - Target FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` + Target FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` } -// firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON +// firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration] -type firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { +// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration] +type firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownUpdateResponseConfigurations() { +func (r FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownNewResponseConfigurations() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. -type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string +type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string const ( - FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" + FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" ) -type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { +type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. - Target FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` + Target FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24`. - Value string `json:"value"` - JSON firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` } -// firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON +// firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration] -type firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { +// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration] +type firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownUpdateResponseConfigurations() { +func (r FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownNewResponseConfigurations() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. -type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string +type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string const ( - FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" + FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" ) -type FirewallLockdownDeleteResponse struct { - // The unique identifier of the Zone Lockdown rule. - ID string `json:"id"` - JSON firewallLockdownDeleteResponseJSON `json:"-"` -} - -// firewallLockdownDeleteResponseJSON contains the JSON metadata for the struct -// [FirewallLockdownDeleteResponse] -type firewallLockdownDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallLockdownDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallLockdownGetResponse struct { +type FirewallLockdownListResponse struct { // The unique identifier of the Zone Lockdown rule. ID string `json:"id,required"` // A list of IP addresses or CIDR ranges that will be allowed to access the URLs // specified in the Zone Lockdown rule. You can include any number of `ip` or // `ip_range` configurations. - Configurations FirewallLockdownGetResponseConfigurations `json:"configurations,required"` + Configurations FirewallLockdownListResponseConfigurations `json:"configurations,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on,required" format:"date-time"` // An informative summary of the rule. @@ -261,13 +255,13 @@ type FirewallLockdownGetResponse struct { // The URLs to include in the rule definition. You can use wildcards. Each entered // URL will be escaped before use, which means you can only use simple wildcard // patterns. - URLs []string `json:"urls,required"` - JSON firewallLockdownGetResponseJSON `json:"-"` + URLs []string `json:"urls,required"` + JSON firewallLockdownListResponseJSON `json:"-"` } -// firewallLockdownGetResponseJSON contains the JSON metadata for the struct -// [FirewallLockdownGetResponse] -type firewallLockdownGetResponseJSON struct { +// firewallLockdownListResponseJSON contains the JSON metadata for the struct +// [FirewallLockdownListResponse] +type firewallLockdownListResponseJSON struct { ID apijson.Field Configurations apijson.Field CreatedOn apijson.Field @@ -279,7 +273,7 @@ type firewallLockdownGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -288,92 +282,110 @@ func (r *FirewallLockdownGetResponse) UnmarshalJSON(data []byte) (err error) { // `ip_range` configurations. // // Union satisfied by -// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration] or -// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. -type FirewallLockdownGetResponseConfigurations interface { - implementsFirewallLockdownGetResponseConfigurations() +// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration] or +// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. +type FirewallLockdownListResponseConfigurations interface { + implementsFirewallLockdownListResponseConfigurations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownGetResponseConfigurations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownListResponseConfigurations)(nil)).Elem(), "") } -type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { +type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. - Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` + Target FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` } -// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON +// firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration] -type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { +// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration] +type firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownGetResponseConfigurations() { +func (r FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownListResponseConfigurations() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. -type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string +type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string const ( - FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" + FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" ) -type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { +type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. - Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` + Target FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24`. - Value string `json:"value"` - JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` } -// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON +// firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration] -type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { +// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration] +type firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownGetResponseConfigurations() { +func (r FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownListResponseConfigurations() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. -type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string +type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string const ( - FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" + FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" ) -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse struct { +type FirewallLockdownDeleteResponse struct { + // The unique identifier of the Zone Lockdown rule. + ID string `json:"id"` + JSON firewallLockdownDeleteResponseJSON `json:"-"` +} + +// firewallLockdownDeleteResponseJSON contains the JSON metadata for the struct +// [FirewallLockdownDeleteResponse] +type firewallLockdownDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallLockdownDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type FirewallLockdownGetResponse struct { // The unique identifier of the Zone Lockdown rule. ID string `json:"id,required"` // A list of IP addresses or CIDR ranges that will be allowed to access the URLs // specified in the Zone Lockdown rule. You can include any number of `ip` or // `ip_range` configurations. - Configurations FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations `json:"configurations,required"` + Configurations FirewallLockdownGetResponseConfigurations `json:"configurations,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on,required" format:"date-time"` // An informative summary of the rule. @@ -385,14 +397,13 @@ type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse struct { // The URLs to include in the rule definition. You can use wildcards. Each entered // URL will be escaped before use, which means you can only use simple wildcard // patterns. - URLs []string `json:"urls,required"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseJSON `json:"-"` + URLs []string `json:"urls,required"` + JSON firewallLockdownGetResponseJSON `json:"-"` } -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseJSON contains the JSON -// metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseJSON struct { +// firewallLockdownGetResponseJSON contains the JSON metadata for the struct +// [FirewallLockdownGetResponse] +type firewallLockdownGetResponseJSON struct { ID apijson.Field Configurations apijson.Field CreatedOn apijson.Field @@ -404,7 +415,7 @@ type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -413,93 +424,92 @@ func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse) UnmarshalJSON // `ip_range` configurations. // // Union satisfied by -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfiguration] -// or -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations interface { - implementsFirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations() +// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration] or +// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. +type FirewallLockdownGetResponseConfigurations interface { + implementsFirewallLockdownGetResponseConfigurations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownGetResponseConfigurations)(nil)).Elem(), "") } -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { +type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. - Target FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` + Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` } -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON +// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfiguration] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { +// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration] +type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations() { +func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownGetResponseConfigurations() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string +type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string const ( - FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" + FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" ) -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { +type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. - Target FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` + Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24`. - Value string `json:"value"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` } -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON +// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfiguration] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { +// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration] +type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurations() { +func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownGetResponseConfigurations() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string +type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string const ( - FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" + FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" ) -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponse struct { +type FirewallLockdownReplaceResponse struct { // The unique identifier of the Zone Lockdown rule. ID string `json:"id,required"` // A list of IP addresses or CIDR ranges that will be allowed to access the URLs // specified in the Zone Lockdown rule. You can include any number of `ip` or // `ip_range` configurations. - Configurations FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations `json:"configurations,required"` + Configurations FirewallLockdownReplaceResponseConfigurations `json:"configurations,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on,required" format:"date-time"` // An informative summary of the rule. @@ -511,14 +521,13 @@ type FirewallLockdownZoneLockdownListZoneLockdownRulesResponse struct { // The URLs to include in the rule definition. You can use wildcards. Each entered // URL will be escaped before use, which means you can only use simple wildcard // patterns. - URLs []string `json:"urls,required"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseJSON `json:"-"` + URLs []string `json:"urls,required"` + JSON firewallLockdownReplaceResponseJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseJSON contains the JSON -// metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponse] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseJSON struct { +// firewallLockdownReplaceResponseJSON contains the JSON metadata for the struct +// [FirewallLockdownReplaceResponse] +type firewallLockdownReplaceResponseJSON struct { ID apijson.Field Configurations apijson.Field CreatedOn apijson.Field @@ -530,7 +539,7 @@ type firewallLockdownZoneLockdownListZoneLockdownRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -539,106 +548,106 @@ func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponse) UnmarshalJSO // `ip_range` configurations. // // Union satisfied by -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfiguration] +// [FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfiguration] // or -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations interface { - implementsFirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations() +// [FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfiguration]. +type FirewallLockdownReplaceResponseConfigurations interface { + implementsFirewallLockdownReplaceResponseConfigurations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallLockdownReplaceResponseConfigurations)(nil)).Elem(), "") } -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { +type FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. - Target FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` + Target FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON +// firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfiguration] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { +// [FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfiguration] +type firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations() { +func (r FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownReplaceResponseConfigurations() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the Zone Lockdown rule. -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string +type FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string const ( - FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" + FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip" ) -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { +type FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. - Target FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` + Target FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24`. - Value string `json:"value"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON +// firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON // contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfiguration] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { +// [FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfiguration] +type firewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurations() { +func (r FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownReplaceResponseConfigurations() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the Zone Lockdown rule. -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string +type FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string const ( - FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownZoneLockdownListZoneLockdownRulesResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" + FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownReplaceResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range" ) -type FirewallLockdownUpdateParams struct { +type FirewallLockdownNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallLockdownUpdateParams) MarshalJSON() (data []byte, err error) { +func (r FirewallLockdownNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallLockdownUpdateResponseEnvelope struct { - Errors []FirewallLockdownUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallLockdownUpdateResponseEnvelopeMessages `json:"messages,required"` - Result FirewallLockdownUpdateResponse `json:"result,required,nullable"` +type FirewallLockdownNewResponseEnvelope struct { + Errors []FirewallLockdownNewResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallLockdownNewResponseEnvelopeMessages `json:"messages,required"` + Result FirewallLockdownNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallLockdownUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON firewallLockdownUpdateResponseEnvelopeJSON `json:"-"` + Success FirewallLockdownNewResponseEnvelopeSuccess `json:"success,required"` + JSON firewallLockdownNewResponseEnvelopeJSON `json:"-"` } -// firewallLockdownUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [FirewallLockdownUpdateResponseEnvelope] -type firewallLockdownUpdateResponseEnvelopeJSON struct { +// firewallLockdownNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [FirewallLockdownNewResponseEnvelope] +type firewallLockdownNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -647,55 +656,88 @@ type firewallLockdownUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallLockdownUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownUpdateResponseEnvelopeErrorsJSON `json:"-"` +type FirewallLockdownNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallLockdownNewResponseEnvelopeErrorsJSON `json:"-"` } -// firewallLockdownUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [FirewallLockdownUpdateResponseEnvelopeErrors] -type firewallLockdownUpdateResponseEnvelopeErrorsJSON struct { +// firewallLockdownNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FirewallLockdownNewResponseEnvelopeErrors] +type firewallLockdownNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallLockdownUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownUpdateResponseEnvelopeMessagesJSON `json:"-"` +type FirewallLockdownNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallLockdownNewResponseEnvelopeMessagesJSON `json:"-"` } -// firewallLockdownUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [FirewallLockdownUpdateResponseEnvelopeMessages] -type firewallLockdownUpdateResponseEnvelopeMessagesJSON struct { +// firewallLockdownNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [FirewallLockdownNewResponseEnvelopeMessages] +type firewallLockdownNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallLockdownUpdateResponseEnvelopeSuccess bool +type FirewallLockdownNewResponseEnvelopeSuccess bool const ( - FirewallLockdownUpdateResponseEnvelopeSuccessTrue FirewallLockdownUpdateResponseEnvelopeSuccess = true + FirewallLockdownNewResponseEnvelopeSuccessTrue FirewallLockdownNewResponseEnvelopeSuccess = true ) +type FirewallLockdownListParams struct { + // A string to search for in the description of existing rules. + Description param.Field[string] `query:"description"` + // A string to search for in the description of existing rules. + DescriptionSearch param.Field[string] `query:"description_search"` + // A single IP address to search for in existing rules. + IP param.Field[string] `query:"ip"` + // A single IP address range to search for in existing rules. + IPRangeSearch param.Field[string] `query:"ip_range_search"` + // A single IP address to search for in existing rules. + IPSearch param.Field[string] `query:"ip_search"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // The maximum number of results per page. You can only set the value to `1` or to + // a multiple of 5 such as `5`, `10`, `15`, or `20`. + PerPage param.Field[float64] `query:"per_page"` + // The priority of the rule to control the processing order. A lower number + // indicates higher priority. If not provided, any rules with a configured priority + // will be processed before rules without a priority. + Priority param.Field[float64] `query:"priority"` + // A single URI to search for in the list of URLs of existing rules. + UriSearch param.Field[string] `query:"uri_search"` +} + +// URLQuery serializes [FirewallLockdownListParams]'s query parameters as +// `url.Values`. +func (r FirewallLockdownListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + type FirewallLockdownDeleteResponseEnvelope struct { Result FirewallLockdownDeleteResponse `json:"result"` JSON firewallLockdownDeleteResponseEnvelopeJSON `json:"-"` @@ -782,217 +824,79 @@ const ( FirewallLockdownGetResponseEnvelopeSuccessTrue FirewallLockdownGetResponseEnvelopeSuccess = true ) -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleParams struct { +type FirewallLockdownReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallLockdownZoneLockdownNewAZoneLockdownRuleParams) MarshalJSON() (data []byte, err error) { +func (r FirewallLockdownReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelope struct { - Errors []FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessages `json:"messages,required"` - Result FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeSuccess `json:"success,required"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeJSON `json:"-"` -} - -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelope] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrors] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessages] -type firewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeSuccess bool - -const ( - FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeSuccessTrue FirewallLockdownZoneLockdownNewAZoneLockdownRuleResponseEnvelopeSuccess = true -) - -type FirewallLockdownZoneLockdownListZoneLockdownRulesParams struct { - // A string to search for in the description of existing rules. - Description param.Field[string] `query:"description"` - // A string to search for in the description of existing rules. - DescriptionSearch param.Field[string] `query:"description_search"` - // A single IP address to search for in existing rules. - IP param.Field[string] `query:"ip"` - // A single IP address range to search for in existing rules. - IPRangeSearch param.Field[string] `query:"ip_range_search"` - // A single IP address to search for in existing rules. - IPSearch param.Field[string] `query:"ip_search"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // The maximum number of results per page. You can only set the value to `1` or to - // a multiple of 5 such as `5`, `10`, `15`, or `20`. - PerPage param.Field[float64] `query:"per_page"` - // The priority of the rule to control the processing order. A lower number - // indicates higher priority. If not provided, any rules with a configured priority - // will be processed before rules without a priority. - Priority param.Field[float64] `query:"priority"` - // A single URI to search for in the list of URLs of existing rules. - UriSearch param.Field[string] `query:"uri_search"` -} - -// URLQuery serializes [FirewallLockdownZoneLockdownListZoneLockdownRulesParams]'s -// query parameters as `url.Values`. -func (r FirewallLockdownZoneLockdownListZoneLockdownRulesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelope struct { - Errors []FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallLockdownZoneLockdownListZoneLockdownRulesResponse `json:"result,required,nullable"` +type FirewallLockdownReplaceResponseEnvelope struct { + Errors []FirewallLockdownReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallLockdownReplaceResponseEnvelopeMessages `json:"messages,required"` + Result FirewallLockdownReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeJSON `json:"-"` + Success FirewallLockdownReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON firewallLockdownReplaceResponseEnvelopeJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelope] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeJSON struct { +// firewallLockdownReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [FirewallLockdownReplaceResponseEnvelope] +type firewallLockdownReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrorsJSON `json:"-"` +type FirewallLockdownReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallLockdownReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrors] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrorsJSON struct { +// firewallLockdownReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [FirewallLockdownReplaceResponseEnvelopeErrors] +type firewallLockdownReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessagesJSON `json:"-"` +type FirewallLockdownReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallLockdownReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessages] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessagesJSON struct { +// firewallLockdownReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [FirewallLockdownReplaceResponseEnvelopeMessages] +type firewallLockdownReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallLockdownReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeSuccess bool +type FirewallLockdownReplaceResponseEnvelopeSuccess bool const ( - FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeSuccessTrue FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeSuccess = true + FirewallLockdownReplaceResponseEnvelopeSuccessTrue FirewallLockdownReplaceResponseEnvelopeSuccess = true ) - -type FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfo] -type firewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallLockdownZoneLockdownListZoneLockdownRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/firewalllockdown_test.go b/firewalllockdown_test.go index 26e965977c9..f58f84a3798 100644 --- a/firewalllockdown_test.go +++ b/firewalllockdown_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFirewallLockdownUpdate(t *testing.T) { +func TestFirewallLockdownNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestFirewallLockdownUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Lockdowns.Update( + _, err := client.Firewalls.Lockdowns.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b59", - cloudflare.FirewallLockdownUpdateParams{ + cloudflare.FirewallLockdownNewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -46,7 +45,7 @@ func TestFirewallLockdownUpdate(t *testing.T) { } } -func TestFirewallLockdownDelete(t *testing.T) { +func TestFirewallLockdownListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,10 +61,20 @@ func TestFirewallLockdownDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Lockdowns.Delete( + _, err := client.Firewalls.Lockdowns.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b59", + cloudflare.FirewallLockdownListParams{ + Description: cloudflare.F("endpoints"), + DescriptionSearch: cloudflare.F("endpoints"), + IP: cloudflare.F("1.2.3.4"), + IPRangeSearch: cloudflare.F("1.2.3.0/16"), + IPSearch: cloudflare.F("1.2.3.4"), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(1.000000), + Priority: cloudflare.F(5.000000), + UriSearch: cloudflare.F("/some/path"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -76,7 +85,7 @@ func TestFirewallLockdownDelete(t *testing.T) { } } -func TestFirewallLockdownGet(t *testing.T) { +func TestFirewallLockdownDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -92,7 +101,7 @@ func TestFirewallLockdownGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Lockdowns.Get( + _, err := client.Firewalls.Lockdowns.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b59", @@ -106,7 +115,7 @@ func TestFirewallLockdownGet(t *testing.T) { } } -func TestFirewallLockdownZoneLockdownNewAZoneLockdownRule(t *testing.T) { +func TestFirewallLockdownGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,12 +131,10 @@ func TestFirewallLockdownZoneLockdownNewAZoneLockdownRule(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Lockdowns.ZoneLockdownNewAZoneLockdownRule( + _, err := client.Firewalls.Lockdowns.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallLockdownZoneLockdownNewAZoneLockdownRuleParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "372e67954025e0ba6aaa6d586b9e0b59", ) if err != nil { var apierr *cloudflare.Error @@ -138,7 +145,7 @@ func TestFirewallLockdownZoneLockdownNewAZoneLockdownRule(t *testing.T) { } } -func TestFirewallLockdownZoneLockdownListZoneLockdownRulesWithOptionalParams(t *testing.T) { +func TestFirewallLockdownReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -154,19 +161,12 @@ func TestFirewallLockdownZoneLockdownListZoneLockdownRulesWithOptionalParams(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Lockdowns.ZoneLockdownListZoneLockdownRules( + _, err := client.Firewalls.Lockdowns.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallLockdownZoneLockdownListZoneLockdownRulesParams{ - Description: cloudflare.F("endpoints"), - DescriptionSearch: cloudflare.F("endpoints"), - IP: cloudflare.F("1.2.3.4"), - IPRangeSearch: cloudflare.F("1.2.3.0/16"), - IPSearch: cloudflare.F("1.2.3.4"), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(1.000000), - Priority: cloudflare.F(5.000000), - UriSearch: cloudflare.F("/some/path"), + "372e67954025e0ba6aaa6d586b9e0b59", + cloudflare.FirewallLockdownReplaceParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/firewallrule.go b/firewallrule.go index 7f4ec1830bc..513c7481a1f 100644 --- a/firewallrule.go +++ b/firewallrule.go @@ -13,6 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -34,12 +35,12 @@ func NewFirewallRuleService(opts ...option.RequestOption) (r *FirewallRuleServic return } -// Updates an existing firewall rule. -func (r *FirewallRuleService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleUpdateParams, opts ...option.RequestOption) (res *FirewallRuleUpdateResponse, err error) { +// Create one or more firewall rules. +func (r *FirewallRuleService) New(ctx context.Context, zoneIdentifier string, body FirewallRuleNewParams, opts ...option.RequestOption) (res *[]FirewallRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallRuleUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FirewallRuleNewResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +48,12 @@ func (r *FirewallRuleService) Update(ctx context.Context, zoneIdentifier string, return } -// Deletes an existing firewall rule. -func (r *FirewallRuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleDeleteParams, opts ...option.RequestOption) (res *FirewallRuleDeleteResponse, err error) { +// Updates the priority of existing firewall rules. +func (r *FirewallRuleService) Update(ctx context.Context, zoneIdentifier string, body FirewallRuleUpdateParams, opts ...option.RequestOption) (res *[]FirewallRuleUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallRuleDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) + var env FirewallRuleUpdateResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -60,39 +61,37 @@ func (r *FirewallRuleService) Delete(ctx context.Context, zoneIdentifier string, return } -// Create one or more firewall rules. -func (r *FirewallRuleService) FirewallRulesNewFirewallRules(ctx context.Context, zoneIdentifier string, body FirewallRuleFirewallRulesNewFirewallRulesParams, opts ...option.RequestOption) (res *[]FirewallRuleFirewallRulesNewFirewallRulesResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelope +// Fetches firewall rules in a zone. You can filter the results using several +// optional parameters. +func (r *FirewallRuleService) List(ctx context.Context, zoneIdentifier string, query FirewallRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallRuleListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } // Fetches firewall rules in a zone. You can filter the results using several // optional parameters. -func (r *FirewallRuleService) FirewallRulesListFirewallRules(ctx context.Context, zoneIdentifier string, query FirewallRuleFirewallRulesListFirewallRulesParams, opts ...option.RequestOption) (res *[]FirewallRuleFirewallRulesListFirewallRulesResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallRuleFirewallRulesListFirewallRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +func (r *FirewallRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallRuleListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) } -// Updates one or more existing firewall rules. -func (r *FirewallRuleService) FirewallRulesUpdateFirewallRules(ctx context.Context, zoneIdentifier string, body FirewallRuleFirewallRulesUpdateFirewallRulesParams, opts ...option.RequestOption) (res *[]FirewallRuleFirewallRulesUpdateFirewallRulesResponse, err error) { +// Deletes an existing firewall rule. +func (r *FirewallRuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleDeleteParams, opts ...option.RequestOption) (res *FirewallRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FirewallRuleDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) if err != nil { return } @@ -100,12 +99,12 @@ func (r *FirewallRuleService) FirewallRulesUpdateFirewallRules(ctx context.Conte return } -// Updates the priority of existing firewall rules. -func (r *FirewallRuleService) FirewallRulesUpdatePriorityOfFirewallRules(ctx context.Context, zoneIdentifier string, body FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesParams, opts ...option.RequestOption) (res *[]FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse, err error) { +// Fetches the details of a firewall rule. +func (r *FirewallRuleService) Get(ctx context.Context, zoneIdentifier string, id string, query FirewallRuleGetParams, opts ...option.RequestOption) (res *FirewallRuleGetResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env FirewallRuleGetResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -113,12 +112,12 @@ func (r *FirewallRuleService) FirewallRulesUpdatePriorityOfFirewallRules(ctx con return } -// Fetches the details of a firewall rule. -func (r *FirewallRuleService) Get(ctx context.Context, zoneIdentifier string, id string, query FirewallRuleGetParams, opts ...option.RequestOption) (res *FirewallRuleGetResponse, err error) { +// Updates an existing firewall rule. +func (r *FirewallRuleService) Replace(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleReplaceParams, opts ...option.RequestOption) (res *FirewallRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallRuleGetResponseEnvelope + var env FirewallRuleReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -126,13 +125,13 @@ func (r *FirewallRuleService) Get(ctx context.Context, zoneIdentifier string, id return } -type FirewallRuleUpdateResponse struct { +type FirewallRuleNewResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleUpdateResponseAction `json:"action,required"` - Filter FirewallRuleUpdateResponseFilter `json:"filter,required"` + Action FirewallRuleNewResponseAction `json:"action,required"` + Filter FirewallRuleNewResponseFilter `json:"filter,required"` // When true, indicates that the firewall rule is currently paused. Paused bool `json:"paused,required"` // An informative summary of the firewall rule. @@ -140,16 +139,16 @@ type FirewallRuleUpdateResponse struct { // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleUpdateResponseProduct `json:"products"` + Priority float64 `json:"priority"` + Products []FirewallRuleNewResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleUpdateResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleNewResponseJSON `json:"-"` } -// firewallRuleUpdateResponseJSON contains the JSON metadata for the struct -// [FirewallRuleUpdateResponse] -type firewallRuleUpdateResponseJSON struct { +// firewallRuleNewResponseJSON contains the JSON metadata for the struct +// [FirewallRuleNewResponse] +type firewallRuleNewResponseJSON struct { ID apijson.Field Action apijson.Field Filter apijson.Field @@ -162,35 +161,35 @@ type firewallRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleUpdateResponseAction string +type FirewallRuleNewResponseAction string const ( - FirewallRuleUpdateResponseActionBlock FirewallRuleUpdateResponseAction = "block" - FirewallRuleUpdateResponseActionChallenge FirewallRuleUpdateResponseAction = "challenge" - FirewallRuleUpdateResponseActionJsChallenge FirewallRuleUpdateResponseAction = "js_challenge" - FirewallRuleUpdateResponseActionManagedChallenge FirewallRuleUpdateResponseAction = "managed_challenge" - FirewallRuleUpdateResponseActionAllow FirewallRuleUpdateResponseAction = "allow" - FirewallRuleUpdateResponseActionLog FirewallRuleUpdateResponseAction = "log" - FirewallRuleUpdateResponseActionBypass FirewallRuleUpdateResponseAction = "bypass" + FirewallRuleNewResponseActionBlock FirewallRuleNewResponseAction = "block" + FirewallRuleNewResponseActionChallenge FirewallRuleNewResponseAction = "challenge" + FirewallRuleNewResponseActionJsChallenge FirewallRuleNewResponseAction = "js_challenge" + FirewallRuleNewResponseActionManagedChallenge FirewallRuleNewResponseAction = "managed_challenge" + FirewallRuleNewResponseActionAllow FirewallRuleNewResponseAction = "allow" + FirewallRuleNewResponseActionLog FirewallRuleNewResponseAction = "log" + FirewallRuleNewResponseActionBypass FirewallRuleNewResponseAction = "bypass" ) -// Union satisfied by [FirewallRuleUpdateResponseFilterLegacyJhsFilter] or -// [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleUpdateResponseFilter interface { - implementsFirewallRuleUpdateResponseFilter() +// Union satisfied by [FirewallRuleNewResponseFilterLegacyJhsFilter] or +// [FirewallRuleNewResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleNewResponseFilter interface { + implementsFirewallRuleNewResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleUpdateResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleNewResponseFilter)(nil)).Elem(), "") } -type FirewallRuleUpdateResponseFilterLegacyJhsFilter struct { +type FirewallRuleNewResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -201,13 +200,13 @@ type FirewallRuleUpdateResponseFilterLegacyJhsFilter struct { // When true, indicates that the filter is currently paused. Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleUpdateResponseFilterLegacyJhsFilterJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleNewResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleUpdateResponseFilterLegacyJhsFilterJSON contains the JSON metadata -// for the struct [FirewallRuleUpdateResponseFilterLegacyJhsFilter] -type firewallRuleUpdateResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleNewResponseFilterLegacyJhsFilterJSON contains the JSON metadata for +// the struct [FirewallRuleNewResponseFilterLegacyJhsFilter] +type firewallRuleNewResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -217,79 +216,78 @@ type firewallRuleUpdateResponseFilterLegacyJhsFilterJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleUpdateResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleUpdateResponseFilterLegacyJhsFilter) implementsFirewallRuleUpdateResponseFilter() { -} +func (r FirewallRuleNewResponseFilterLegacyJhsFilter) implementsFirewallRuleNewResponseFilter() {} -type FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleNewResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + Deleted bool `json:"deleted,required"` + JSON firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON contains the JSON -// metadata for the struct [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter] -type firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct [FirewallRuleNewResponseFilterLegacyJhsDeletedFilter] +type firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleUpdateResponseFilter() { +func (r FirewallRuleNewResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleNewResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleUpdateResponseProduct string +type FirewallRuleNewResponseProduct string const ( - FirewallRuleUpdateResponseProductZoneLockdown FirewallRuleUpdateResponseProduct = "zoneLockdown" - FirewallRuleUpdateResponseProductUaBlock FirewallRuleUpdateResponseProduct = "uaBlock" - FirewallRuleUpdateResponseProductBic FirewallRuleUpdateResponseProduct = "bic" - FirewallRuleUpdateResponseProductHot FirewallRuleUpdateResponseProduct = "hot" - FirewallRuleUpdateResponseProductSecurityLevel FirewallRuleUpdateResponseProduct = "securityLevel" - FirewallRuleUpdateResponseProductRateLimit FirewallRuleUpdateResponseProduct = "rateLimit" - FirewallRuleUpdateResponseProductWAF FirewallRuleUpdateResponseProduct = "waf" + FirewallRuleNewResponseProductZoneLockdown FirewallRuleNewResponseProduct = "zoneLockdown" + FirewallRuleNewResponseProductUaBlock FirewallRuleNewResponseProduct = "uaBlock" + FirewallRuleNewResponseProductBic FirewallRuleNewResponseProduct = "bic" + FirewallRuleNewResponseProductHot FirewallRuleNewResponseProduct = "hot" + FirewallRuleNewResponseProductSecurityLevel FirewallRuleNewResponseProduct = "securityLevel" + FirewallRuleNewResponseProductRateLimit FirewallRuleNewResponseProduct = "rateLimit" + FirewallRuleNewResponseProductWAF FirewallRuleNewResponseProduct = "waf" ) -type FirewallRuleDeleteResponse struct { +type FirewallRuleUpdateResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleDeleteResponseAction `json:"action"` - // An informative summary of the firewall rule. - Description string `json:"description"` - Filter FirewallRuleDeleteResponseFilter `json:"filter"` + Action FirewallRuleUpdateResponseAction `json:"action,required"` + Filter FirewallRuleUpdateResponseFilter `json:"filter,required"` // When true, indicates that the firewall rule is currently paused. - Paused bool `json:"paused"` + Paused bool `json:"paused,required"` + // An informative summary of the firewall rule. + Description string `json:"description"` // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. Priority float64 `json:"priority"` - Products []FirewallRuleDeleteResponseProduct `json:"products"` + Products []FirewallRuleUpdateResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. Ref string `json:"ref"` - JSON firewallRuleDeleteResponseJSON `json:"-"` + JSON firewallRuleUpdateResponseJSON `json:"-"` } -// firewallRuleDeleteResponseJSON contains the JSON metadata for the struct -// [FirewallRuleDeleteResponse] -type firewallRuleDeleteResponseJSON struct { +// firewallRuleUpdateResponseJSON contains the JSON metadata for the struct +// [FirewallRuleUpdateResponse] +type firewallRuleUpdateResponseJSON struct { ID apijson.Field Action apijson.Field - Description apijson.Field Filter apijson.Field Paused apijson.Field + Description apijson.Field Priority apijson.Field Products apijson.Field Ref apijson.Field @@ -297,35 +295,35 @@ type firewallRuleDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleDeleteResponseAction string +type FirewallRuleUpdateResponseAction string const ( - FirewallRuleDeleteResponseActionBlock FirewallRuleDeleteResponseAction = "block" - FirewallRuleDeleteResponseActionChallenge FirewallRuleDeleteResponseAction = "challenge" - FirewallRuleDeleteResponseActionJsChallenge FirewallRuleDeleteResponseAction = "js_challenge" - FirewallRuleDeleteResponseActionManagedChallenge FirewallRuleDeleteResponseAction = "managed_challenge" - FirewallRuleDeleteResponseActionAllow FirewallRuleDeleteResponseAction = "allow" - FirewallRuleDeleteResponseActionLog FirewallRuleDeleteResponseAction = "log" - FirewallRuleDeleteResponseActionBypass FirewallRuleDeleteResponseAction = "bypass" + FirewallRuleUpdateResponseActionBlock FirewallRuleUpdateResponseAction = "block" + FirewallRuleUpdateResponseActionChallenge FirewallRuleUpdateResponseAction = "challenge" + FirewallRuleUpdateResponseActionJsChallenge FirewallRuleUpdateResponseAction = "js_challenge" + FirewallRuleUpdateResponseActionManagedChallenge FirewallRuleUpdateResponseAction = "managed_challenge" + FirewallRuleUpdateResponseActionAllow FirewallRuleUpdateResponseAction = "allow" + FirewallRuleUpdateResponseActionLog FirewallRuleUpdateResponseAction = "log" + FirewallRuleUpdateResponseActionBypass FirewallRuleUpdateResponseAction = "bypass" ) -// Union satisfied by [FirewallRuleDeleteResponseFilterLegacyJhsFilter] or -// [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleDeleteResponseFilter interface { - implementsFirewallRuleDeleteResponseFilter() +// Union satisfied by [FirewallRuleUpdateResponseFilterLegacyJhsFilter] or +// [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleUpdateResponseFilter interface { + implementsFirewallRuleUpdateResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleDeleteResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleUpdateResponseFilter)(nil)).Elem(), "") } -type FirewallRuleDeleteResponseFilterLegacyJhsFilter struct { +type FirewallRuleUpdateResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -337,12 +335,12 @@ type FirewallRuleDeleteResponseFilterLegacyJhsFilter struct { Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. Ref string `json:"ref"` - JSON firewallRuleDeleteResponseFilterLegacyJhsFilterJSON `json:"-"` + JSON firewallRuleUpdateResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleDeleteResponseFilterLegacyJhsFilterJSON contains the JSON metadata -// for the struct [FirewallRuleDeleteResponseFilterLegacyJhsFilter] -type firewallRuleDeleteResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleUpdateResponseFilterLegacyJhsFilterJSON contains the JSON metadata +// for the struct [FirewallRuleUpdateResponseFilterLegacyJhsFilter] +type firewallRuleUpdateResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -352,57 +350,57 @@ type firewallRuleDeleteResponseFilterLegacyJhsFilterJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleDeleteResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleUpdateResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleDeleteResponseFilterLegacyJhsFilter) implementsFirewallRuleDeleteResponseFilter() { +func (r FirewallRuleUpdateResponseFilterLegacyJhsFilter) implementsFirewallRuleUpdateResponseFilter() { } -type FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. Deleted bool `json:"deleted,required"` - JSON firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + JSON firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON contains the JSON -// metadata for the struct [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter] -type firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter] +type firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleDeleteResponseFilter() { +func (r FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleUpdateResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleDeleteResponseProduct string +type FirewallRuleUpdateResponseProduct string const ( - FirewallRuleDeleteResponseProductZoneLockdown FirewallRuleDeleteResponseProduct = "zoneLockdown" - FirewallRuleDeleteResponseProductUaBlock FirewallRuleDeleteResponseProduct = "uaBlock" - FirewallRuleDeleteResponseProductBic FirewallRuleDeleteResponseProduct = "bic" - FirewallRuleDeleteResponseProductHot FirewallRuleDeleteResponseProduct = "hot" - FirewallRuleDeleteResponseProductSecurityLevel FirewallRuleDeleteResponseProduct = "securityLevel" - FirewallRuleDeleteResponseProductRateLimit FirewallRuleDeleteResponseProduct = "rateLimit" - FirewallRuleDeleteResponseProductWAF FirewallRuleDeleteResponseProduct = "waf" + FirewallRuleUpdateResponseProductZoneLockdown FirewallRuleUpdateResponseProduct = "zoneLockdown" + FirewallRuleUpdateResponseProductUaBlock FirewallRuleUpdateResponseProduct = "uaBlock" + FirewallRuleUpdateResponseProductBic FirewallRuleUpdateResponseProduct = "bic" + FirewallRuleUpdateResponseProductHot FirewallRuleUpdateResponseProduct = "hot" + FirewallRuleUpdateResponseProductSecurityLevel FirewallRuleUpdateResponseProduct = "securityLevel" + FirewallRuleUpdateResponseProductRateLimit FirewallRuleUpdateResponseProduct = "rateLimit" + FirewallRuleUpdateResponseProductWAF FirewallRuleUpdateResponseProduct = "waf" ) -type FirewallRuleFirewallRulesNewFirewallRulesResponse struct { +type FirewallRuleListResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleFirewallRulesNewFirewallRulesResponseAction `json:"action,required"` - Filter FirewallRuleFirewallRulesNewFirewallRulesResponseFilter `json:"filter,required"` + Action FirewallRuleListResponseAction `json:"action,required"` + Filter FirewallRuleListResponseFilter `json:"filter,required"` // When true, indicates that the firewall rule is currently paused. Paused bool `json:"paused,required"` // An informative summary of the firewall rule. @@ -410,16 +408,16 @@ type FirewallRuleFirewallRulesNewFirewallRulesResponse struct { // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleFirewallRulesNewFirewallRulesResponseProduct `json:"products"` + Priority float64 `json:"priority"` + Products []FirewallRuleListResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleListResponseJSON `json:"-"` } -// firewallRuleFirewallRulesNewFirewallRulesResponseJSON contains the JSON metadata -// for the struct [FirewallRuleFirewallRulesNewFirewallRulesResponse] -type firewallRuleFirewallRulesNewFirewallRulesResponseJSON struct { +// firewallRuleListResponseJSON contains the JSON metadata for the struct +// [FirewallRuleListResponse] +type firewallRuleListResponseJSON struct { ID apijson.Field Action apijson.Field Filter apijson.Field @@ -432,36 +430,35 @@ type firewallRuleFirewallRulesNewFirewallRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleFirewallRulesNewFirewallRulesResponseAction string +type FirewallRuleListResponseAction string const ( - FirewallRuleFirewallRulesNewFirewallRulesResponseActionBlock FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "block" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionChallenge FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "challenge" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionJsChallenge FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "js_challenge" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionManagedChallenge FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "managed_challenge" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionAllow FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "allow" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionLog FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "log" - FirewallRuleFirewallRulesNewFirewallRulesResponseActionBypass FirewallRuleFirewallRulesNewFirewallRulesResponseAction = "bypass" + FirewallRuleListResponseActionBlock FirewallRuleListResponseAction = "block" + FirewallRuleListResponseActionChallenge FirewallRuleListResponseAction = "challenge" + FirewallRuleListResponseActionJsChallenge FirewallRuleListResponseAction = "js_challenge" + FirewallRuleListResponseActionManagedChallenge FirewallRuleListResponseAction = "managed_challenge" + FirewallRuleListResponseActionAllow FirewallRuleListResponseAction = "allow" + FirewallRuleListResponseActionLog FirewallRuleListResponseAction = "log" + FirewallRuleListResponseActionBypass FirewallRuleListResponseAction = "bypass" ) -// Union satisfied by -// [FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter] or -// [FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleFirewallRulesNewFirewallRulesResponseFilter interface { - implementsFirewallRuleFirewallRulesNewFirewallRulesResponseFilter() +// Union satisfied by [FirewallRuleListResponseFilterLegacyJhsFilter] or +// [FirewallRuleListResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleListResponseFilter interface { + implementsFirewallRuleListResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleFirewallRulesNewFirewallRulesResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleListResponseFilter)(nil)).Elem(), "") } -type FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter struct { +type FirewallRuleListResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -472,14 +469,13 @@ type FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter stru // When true, indicates that the filter is currently paused. Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilterJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleListResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter] -type firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleListResponseFilterLegacyJhsFilterJSON contains the JSON metadata for +// the struct [FirewallRuleListResponseFilterLegacyJhsFilter] +type firewallRuleListResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -489,80 +485,78 @@ type firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilterJSON ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleListResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsFilter) implementsFirewallRuleFirewallRulesNewFirewallRulesResponseFilter() { -} +func (r FirewallRuleListResponseFilterLegacyJhsFilter) implementsFirewallRuleListResponseFilter() {} -type FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleListResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + Deleted bool `json:"deleted,required"` + JSON firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilter] -type firewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct [FirewallRuleListResponseFilterLegacyJhsDeletedFilter] +type firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleListResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesNewFirewallRulesResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleFirewallRulesNewFirewallRulesResponseFilter() { +func (r FirewallRuleListResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleListResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleFirewallRulesNewFirewallRulesResponseProduct string +type FirewallRuleListResponseProduct string const ( - FirewallRuleFirewallRulesNewFirewallRulesResponseProductZoneLockdown FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "zoneLockdown" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductUaBlock FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "uaBlock" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductBic FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "bic" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductHot FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "hot" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductSecurityLevel FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "securityLevel" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductRateLimit FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "rateLimit" - FirewallRuleFirewallRulesNewFirewallRulesResponseProductWAF FirewallRuleFirewallRulesNewFirewallRulesResponseProduct = "waf" + FirewallRuleListResponseProductZoneLockdown FirewallRuleListResponseProduct = "zoneLockdown" + FirewallRuleListResponseProductUaBlock FirewallRuleListResponseProduct = "uaBlock" + FirewallRuleListResponseProductBic FirewallRuleListResponseProduct = "bic" + FirewallRuleListResponseProductHot FirewallRuleListResponseProduct = "hot" + FirewallRuleListResponseProductSecurityLevel FirewallRuleListResponseProduct = "securityLevel" + FirewallRuleListResponseProductRateLimit FirewallRuleListResponseProduct = "rateLimit" + FirewallRuleListResponseProductWAF FirewallRuleListResponseProduct = "waf" ) -type FirewallRuleFirewallRulesListFirewallRulesResponse struct { +type FirewallRuleDeleteResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleFirewallRulesListFirewallRulesResponseAction `json:"action,required"` - Filter FirewallRuleFirewallRulesListFirewallRulesResponseFilter `json:"filter,required"` - // When true, indicates that the firewall rule is currently paused. - Paused bool `json:"paused,required"` + Action FirewallRuleDeleteResponseAction `json:"action"` // An informative summary of the firewall rule. - Description string `json:"description"` + Description string `json:"description"` + Filter FirewallRuleDeleteResponseFilter `json:"filter"` + // When true, indicates that the firewall rule is currently paused. + Paused bool `json:"paused"` // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleFirewallRulesListFirewallRulesResponseProduct `json:"products"` + Priority float64 `json:"priority"` + Products []FirewallRuleDeleteResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleDeleteResponseJSON `json:"-"` } -// firewallRuleFirewallRulesListFirewallRulesResponseJSON contains the JSON -// metadata for the struct [FirewallRuleFirewallRulesListFirewallRulesResponse] -type firewallRuleFirewallRulesListFirewallRulesResponseJSON struct { +// firewallRuleDeleteResponseJSON contains the JSON metadata for the struct +// [FirewallRuleDeleteResponse] +type firewallRuleDeleteResponseJSON struct { ID apijson.Field Action apijson.Field + Description apijson.Field Filter apijson.Field Paused apijson.Field - Description apijson.Field Priority apijson.Field Products apijson.Field Ref apijson.Field @@ -570,36 +564,35 @@ type firewallRuleFirewallRulesListFirewallRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesListFirewallRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleFirewallRulesListFirewallRulesResponseAction string +type FirewallRuleDeleteResponseAction string const ( - FirewallRuleFirewallRulesListFirewallRulesResponseActionBlock FirewallRuleFirewallRulesListFirewallRulesResponseAction = "block" - FirewallRuleFirewallRulesListFirewallRulesResponseActionChallenge FirewallRuleFirewallRulesListFirewallRulesResponseAction = "challenge" - FirewallRuleFirewallRulesListFirewallRulesResponseActionJsChallenge FirewallRuleFirewallRulesListFirewallRulesResponseAction = "js_challenge" - FirewallRuleFirewallRulesListFirewallRulesResponseActionManagedChallenge FirewallRuleFirewallRulesListFirewallRulesResponseAction = "managed_challenge" - FirewallRuleFirewallRulesListFirewallRulesResponseActionAllow FirewallRuleFirewallRulesListFirewallRulesResponseAction = "allow" - FirewallRuleFirewallRulesListFirewallRulesResponseActionLog FirewallRuleFirewallRulesListFirewallRulesResponseAction = "log" - FirewallRuleFirewallRulesListFirewallRulesResponseActionBypass FirewallRuleFirewallRulesListFirewallRulesResponseAction = "bypass" + FirewallRuleDeleteResponseActionBlock FirewallRuleDeleteResponseAction = "block" + FirewallRuleDeleteResponseActionChallenge FirewallRuleDeleteResponseAction = "challenge" + FirewallRuleDeleteResponseActionJsChallenge FirewallRuleDeleteResponseAction = "js_challenge" + FirewallRuleDeleteResponseActionManagedChallenge FirewallRuleDeleteResponseAction = "managed_challenge" + FirewallRuleDeleteResponseActionAllow FirewallRuleDeleteResponseAction = "allow" + FirewallRuleDeleteResponseActionLog FirewallRuleDeleteResponseAction = "log" + FirewallRuleDeleteResponseActionBypass FirewallRuleDeleteResponseAction = "bypass" ) -// Union satisfied by -// [FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter] or -// [FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleFirewallRulesListFirewallRulesResponseFilter interface { - implementsFirewallRuleFirewallRulesListFirewallRulesResponseFilter() +// Union satisfied by [FirewallRuleDeleteResponseFilterLegacyJhsFilter] or +// [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleDeleteResponseFilter interface { + implementsFirewallRuleDeleteResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleFirewallRulesListFirewallRulesResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleDeleteResponseFilter)(nil)).Elem(), "") } -type FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter struct { +type FirewallRuleDeleteResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -610,14 +603,13 @@ type FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter str // When true, indicates that the filter is currently paused. Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilterJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleDeleteResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter] -type firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleDeleteResponseFilterLegacyJhsFilterJSON contains the JSON metadata +// for the struct [FirewallRuleDeleteResponseFilterLegacyJhsFilter] +type firewallRuleDeleteResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -627,58 +619,57 @@ type firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilterJSON ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleDeleteResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsFilter) implementsFirewallRuleFirewallRulesListFirewallRulesResponseFilter() { +func (r FirewallRuleDeleteResponseFilterLegacyJhsFilter) implementsFirewallRuleDeleteResponseFilter() { } -type FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + Deleted bool `json:"deleted,required"` + JSON firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilter] -type firewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter] +type firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesListFirewallRulesResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleFirewallRulesListFirewallRulesResponseFilter() { +func (r FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleDeleteResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleFirewallRulesListFirewallRulesResponseProduct string +type FirewallRuleDeleteResponseProduct string const ( - FirewallRuleFirewallRulesListFirewallRulesResponseProductZoneLockdown FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "zoneLockdown" - FirewallRuleFirewallRulesListFirewallRulesResponseProductUaBlock FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "uaBlock" - FirewallRuleFirewallRulesListFirewallRulesResponseProductBic FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "bic" - FirewallRuleFirewallRulesListFirewallRulesResponseProductHot FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "hot" - FirewallRuleFirewallRulesListFirewallRulesResponseProductSecurityLevel FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "securityLevel" - FirewallRuleFirewallRulesListFirewallRulesResponseProductRateLimit FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "rateLimit" - FirewallRuleFirewallRulesListFirewallRulesResponseProductWAF FirewallRuleFirewallRulesListFirewallRulesResponseProduct = "waf" -) - -type FirewallRuleFirewallRulesUpdateFirewallRulesResponse struct { + FirewallRuleDeleteResponseProductZoneLockdown FirewallRuleDeleteResponseProduct = "zoneLockdown" + FirewallRuleDeleteResponseProductUaBlock FirewallRuleDeleteResponseProduct = "uaBlock" + FirewallRuleDeleteResponseProductBic FirewallRuleDeleteResponseProduct = "bic" + FirewallRuleDeleteResponseProductHot FirewallRuleDeleteResponseProduct = "hot" + FirewallRuleDeleteResponseProductSecurityLevel FirewallRuleDeleteResponseProduct = "securityLevel" + FirewallRuleDeleteResponseProductRateLimit FirewallRuleDeleteResponseProduct = "rateLimit" + FirewallRuleDeleteResponseProductWAF FirewallRuleDeleteResponseProduct = "waf" +) + +type FirewallRuleGetResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction `json:"action,required"` - Filter FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter `json:"filter,required"` + Action FirewallRuleGetResponseAction `json:"action,required"` + Filter FirewallRuleGetResponseFilter `json:"filter,required"` // When true, indicates that the firewall rule is currently paused. Paused bool `json:"paused,required"` // An informative summary of the firewall rule. @@ -686,16 +677,16 @@ type FirewallRuleFirewallRulesUpdateFirewallRulesResponse struct { // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct `json:"products"` + Priority float64 `json:"priority"` + Products []FirewallRuleGetResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleGetResponseJSON `json:"-"` } -// firewallRuleFirewallRulesUpdateFirewallRulesResponseJSON contains the JSON -// metadata for the struct [FirewallRuleFirewallRulesUpdateFirewallRulesResponse] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseJSON struct { +// firewallRuleGetResponseJSON contains the JSON metadata for the struct +// [FirewallRuleGetResponse] +type firewallRuleGetResponseJSON struct { ID apijson.Field Action apijson.Field Filter apijson.Field @@ -708,36 +699,35 @@ type firewallRuleFirewallRulesUpdateFirewallRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction string +type FirewallRuleGetResponseAction string const ( - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionBlock FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "block" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionChallenge FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "challenge" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionJsChallenge FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "js_challenge" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionManagedChallenge FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "managed_challenge" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionAllow FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "allow" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionLog FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "log" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseActionBypass FirewallRuleFirewallRulesUpdateFirewallRulesResponseAction = "bypass" + FirewallRuleGetResponseActionBlock FirewallRuleGetResponseAction = "block" + FirewallRuleGetResponseActionChallenge FirewallRuleGetResponseAction = "challenge" + FirewallRuleGetResponseActionJsChallenge FirewallRuleGetResponseAction = "js_challenge" + FirewallRuleGetResponseActionManagedChallenge FirewallRuleGetResponseAction = "managed_challenge" + FirewallRuleGetResponseActionAllow FirewallRuleGetResponseAction = "allow" + FirewallRuleGetResponseActionLog FirewallRuleGetResponseAction = "log" + FirewallRuleGetResponseActionBypass FirewallRuleGetResponseAction = "bypass" ) -// Union satisfied by -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter] or -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter interface { - implementsFirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter() +// Union satisfied by [FirewallRuleGetResponseFilterLegacyJhsFilter] or +// [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleGetResponseFilter interface { + implementsFirewallRuleGetResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleGetResponseFilter)(nil)).Elem(), "") } -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter struct { +type FirewallRuleGetResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -748,14 +738,13 @@ type FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter s // When true, indicates that the filter is currently paused. Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilterJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleGetResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleGetResponseFilterLegacyJhsFilterJSON contains the JSON metadata for +// the struct [FirewallRuleGetResponseFilterLegacyJhsFilter] +type firewallRuleGetResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -765,58 +754,56 @@ type firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilterJS ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsFilter) implementsFirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter() { -} +func (r FirewallRuleGetResponseFilterLegacyJhsFilter) implementsFirewallRuleGetResponseFilter() {} -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleGetResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + Deleted bool `json:"deleted,required"` + JSON firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilter] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter] +type firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesUpdateFirewallRulesResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleFirewallRulesUpdateFirewallRulesResponseFilter() { +func (r FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleGetResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct string +type FirewallRuleGetResponseProduct string const ( - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductZoneLockdown FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "zoneLockdown" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductUaBlock FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "uaBlock" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductBic FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "bic" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductHot FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "hot" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductSecurityLevel FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "securityLevel" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductRateLimit FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "rateLimit" - FirewallRuleFirewallRulesUpdateFirewallRulesResponseProductWAF FirewallRuleFirewallRulesUpdateFirewallRulesResponseProduct = "waf" + FirewallRuleGetResponseProductZoneLockdown FirewallRuleGetResponseProduct = "zoneLockdown" + FirewallRuleGetResponseProductUaBlock FirewallRuleGetResponseProduct = "uaBlock" + FirewallRuleGetResponseProductBic FirewallRuleGetResponseProduct = "bic" + FirewallRuleGetResponseProductHot FirewallRuleGetResponseProduct = "hot" + FirewallRuleGetResponseProductSecurityLevel FirewallRuleGetResponseProduct = "securityLevel" + FirewallRuleGetResponseProductRateLimit FirewallRuleGetResponseProduct = "rateLimit" + FirewallRuleGetResponseProductWAF FirewallRuleGetResponseProduct = "waf" ) -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse struct { +type FirewallRuleReplaceResponse struct { // The unique identifier of the firewall rule. ID string `json:"id,required"` // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. - Action FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction `json:"action,required"` - Filter FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter `json:"filter,required"` + Action FirewallRuleReplaceResponseAction `json:"action,required"` + Filter FirewallRuleReplaceResponseFilter `json:"filter,required"` // When true, indicates that the firewall rule is currently paused. Paused bool `json:"paused,required"` // An informative summary of the firewall rule. @@ -824,17 +811,16 @@ type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse struct { // The priority of the rule. Optional value used to define the processing order. A // lower number indicates a higher priority. If not provided, rules with a defined // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct `json:"products"` + Priority float64 `json:"priority"` + Products []FirewallRuleReplaceResponseProduct `json:"products"` // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleReplaceResponseJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseJSON contains the -// JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseJSON struct { +// firewallRuleReplaceResponseJSON contains the JSON metadata for the struct +// [FirewallRuleReplaceResponse] +type firewallRuleReplaceResponseJSON struct { ID apijson.Field Action apijson.Field Filter apijson.Field @@ -847,37 +833,35 @@ type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. The `log` action is only available on // an Enterprise plan. -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction string +type FirewallRuleReplaceResponseAction string const ( - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionBlock FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "block" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionChallenge FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "challenge" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionJsChallenge FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "js_challenge" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionManagedChallenge FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "managed_challenge" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionAllow FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "allow" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionLog FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "log" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseActionBypass FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseAction = "bypass" + FirewallRuleReplaceResponseActionBlock FirewallRuleReplaceResponseAction = "block" + FirewallRuleReplaceResponseActionChallenge FirewallRuleReplaceResponseAction = "challenge" + FirewallRuleReplaceResponseActionJsChallenge FirewallRuleReplaceResponseAction = "js_challenge" + FirewallRuleReplaceResponseActionManagedChallenge FirewallRuleReplaceResponseAction = "managed_challenge" + FirewallRuleReplaceResponseActionAllow FirewallRuleReplaceResponseAction = "allow" + FirewallRuleReplaceResponseActionLog FirewallRuleReplaceResponseAction = "log" + FirewallRuleReplaceResponseActionBypass FirewallRuleReplaceResponseAction = "bypass" ) -// Union satisfied by -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilter] -// or -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter interface { - implementsFirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter() +// Union satisfied by [FirewallRuleReplaceResponseFilterLegacyJhsFilter] or +// [FirewallRuleReplaceResponseFilterLegacyJhsDeletedFilter]. +type FirewallRuleReplaceResponseFilter interface { + implementsFirewallRuleReplaceResponseFilter() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleReplaceResponseFilter)(nil)).Elem(), "") } -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilter struct { +type FirewallRuleReplaceResponseFilterLegacyJhsFilter struct { // The unique identifier of the filter. ID string `json:"id"` // An informative summary of the filter. @@ -888,14 +872,13 @@ type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJ // When true, indicates that the filter is currently paused. Paused bool `json:"paused"` // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilterJSON `json:"-"` + Ref string `json:"ref"` + JSON firewallRuleReplaceResponseFilterLegacyJhsFilterJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilter] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilterJSON struct { +// firewallRuleReplaceResponseFilterLegacyJhsFilterJSON contains the JSON metadata +// for the struct [FirewallRuleReplaceResponseFilterLegacyJhsFilter] +type firewallRuleReplaceResponseFilterLegacyJhsFilterJSON struct { ID apijson.Field Description apijson.Field Expression apijson.Field @@ -905,185 +888,157 @@ type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJ ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsFilter) implementsFirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter() { +func (r FirewallRuleReplaceResponseFilterLegacyJhsFilter) implementsFirewallRuleReplaceResponseFilter() { } -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilter struct { +type FirewallRuleReplaceResponseFilterLegacyJhsDeletedFilter struct { // The unique identifier of the filter. ID string `json:"id,required"` // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` + Deleted bool `json:"deleted,required"` + JSON firewallRuleReplaceResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilter] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilterJSON struct { +// firewallRuleReplaceResponseFilterLegacyJhsDeletedFilterJSON contains the JSON +// metadata for the struct +// [FirewallRuleReplaceResponseFilterLegacyJhsDeletedFilter] +type firewallRuleReplaceResponseFilterLegacyJhsDeletedFilterJSON struct { ID apijson.Field Deleted apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseFilter() { +func (r FirewallRuleReplaceResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleReplaceResponseFilter() { } // A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct string +type FirewallRuleReplaceResponseProduct string const ( - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductZoneLockdown FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "zoneLockdown" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductUaBlock FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "uaBlock" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductBic FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "bic" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductHot FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "hot" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductSecurityLevel FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "securityLevel" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductRateLimit FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "rateLimit" - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProductWAF FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseProduct = "waf" + FirewallRuleReplaceResponseProductZoneLockdown FirewallRuleReplaceResponseProduct = "zoneLockdown" + FirewallRuleReplaceResponseProductUaBlock FirewallRuleReplaceResponseProduct = "uaBlock" + FirewallRuleReplaceResponseProductBic FirewallRuleReplaceResponseProduct = "bic" + FirewallRuleReplaceResponseProductHot FirewallRuleReplaceResponseProduct = "hot" + FirewallRuleReplaceResponseProductSecurityLevel FirewallRuleReplaceResponseProduct = "securityLevel" + FirewallRuleReplaceResponseProductRateLimit FirewallRuleReplaceResponseProduct = "rateLimit" + FirewallRuleReplaceResponseProductWAF FirewallRuleReplaceResponseProduct = "waf" ) -type FirewallRuleGetResponse struct { - // The unique identifier of the firewall rule. - ID string `json:"id,required"` - // The action to apply to a matched request. The `log` action is only available on - // an Enterprise plan. - Action FirewallRuleGetResponseAction `json:"action,required"` - Filter FirewallRuleGetResponseFilter `json:"filter,required"` - // When true, indicates that the firewall rule is currently paused. - Paused bool `json:"paused,required"` - // An informative summary of the firewall rule. - Description string `json:"description"` - // The priority of the rule. Optional value used to define the processing order. A - // lower number indicates a higher priority. If not provided, rules with a defined - // priority will be processed before rules without a priority. - Priority float64 `json:"priority"` - Products []FirewallRuleGetResponseProduct `json:"products"` - // A short reference tag. Allows you to select related firewall rules. - Ref string `json:"ref"` - JSON firewallRuleGetResponseJSON `json:"-"` +type FirewallRuleNewParams struct { + Body param.Field[interface{}] `json:"body,required"` } -// firewallRuleGetResponseJSON contains the JSON metadata for the struct -// [FirewallRuleGetResponse] -type firewallRuleGetResponseJSON struct { - ID apijson.Field - Action apijson.Field - Filter apijson.Field - Paused apijson.Field - Description apijson.Field - Priority apijson.Field - Products apijson.Field - Ref apijson.Field +func (r FirewallRuleNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type FirewallRuleNewResponseEnvelope struct { + Errors []FirewallRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result []FirewallRuleNewResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success FirewallRuleNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo FirewallRuleNewResponseEnvelopeResultInfo `json:"result_info"` + JSON firewallRuleNewResponseEnvelopeJSON `json:"-"` +} + +// firewallRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [FirewallRuleNewResponseEnvelope] +type firewallRuleNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The action to apply to a matched request. The `log` action is only available on -// an Enterprise plan. -type FirewallRuleGetResponseAction string - -const ( - FirewallRuleGetResponseActionBlock FirewallRuleGetResponseAction = "block" - FirewallRuleGetResponseActionChallenge FirewallRuleGetResponseAction = "challenge" - FirewallRuleGetResponseActionJsChallenge FirewallRuleGetResponseAction = "js_challenge" - FirewallRuleGetResponseActionManagedChallenge FirewallRuleGetResponseAction = "managed_challenge" - FirewallRuleGetResponseActionAllow FirewallRuleGetResponseAction = "allow" - FirewallRuleGetResponseActionLog FirewallRuleGetResponseAction = "log" - FirewallRuleGetResponseActionBypass FirewallRuleGetResponseAction = "bypass" -) +type FirewallRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleNewResponseEnvelopeErrorsJSON `json:"-"` +} -// Union satisfied by [FirewallRuleGetResponseFilterLegacyJhsFilter] or -// [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter]. -type FirewallRuleGetResponseFilter interface { - implementsFirewallRuleGetResponseFilter() +// firewallRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FirewallRuleNewResponseEnvelopeErrors] +type firewallRuleNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func init() { - apijson.RegisterUnion(reflect.TypeOf((*FirewallRuleGetResponseFilter)(nil)).Elem(), "") +func (r *FirewallRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type FirewallRuleGetResponseFilterLegacyJhsFilter struct { - // The unique identifier of the filter. - ID string `json:"id"` - // An informative summary of the filter. - Description string `json:"description"` - // The filter expression. For more information, refer to - // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - Expression string `json:"expression"` - // When true, indicates that the filter is currently paused. - Paused bool `json:"paused"` - // A short reference tag. Allows you to select related filters. - Ref string `json:"ref"` - JSON firewallRuleGetResponseFilterLegacyJhsFilterJSON `json:"-"` +type FirewallRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// firewallRuleGetResponseFilterLegacyJhsFilterJSON contains the JSON metadata for -// the struct [FirewallRuleGetResponseFilterLegacyJhsFilter] -type firewallRuleGetResponseFilterLegacyJhsFilterJSON struct { - ID apijson.Field - Description apijson.Field - Expression apijson.Field - Paused apijson.Field - Ref apijson.Field +// firewallRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [FirewallRuleNewResponseEnvelopeMessages] +type firewallRuleNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleGetResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleGetResponseFilterLegacyJhsFilter) implementsFirewallRuleGetResponseFilter() {} +// Whether the API call was successful +type FirewallRuleNewResponseEnvelopeSuccess bool -type FirewallRuleGetResponseFilterLegacyJhsDeletedFilter struct { - // The unique identifier of the filter. - ID string `json:"id,required"` - // When true, indicates that the firewall rule was deleted. - Deleted bool `json:"deleted,required"` - JSON firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON `json:"-"` +const ( + FirewallRuleNewResponseEnvelopeSuccessTrue FirewallRuleNewResponseEnvelopeSuccess = true +) + +type FirewallRuleNewResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON firewallRuleNewResponseEnvelopeResultInfoJSON `json:"-"` } -// firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON contains the JSON -// metadata for the struct [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter] -type firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON struct { - ID apijson.Field - Deleted apijson.Field +// firewallRuleNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [FirewallRuleNewResponseEnvelopeResultInfo] +type firewallRuleNewResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleGetResponseFilter() { -} - -// A list of products to bypass for a request when using the `bypass` action. -type FirewallRuleGetResponseProduct string - -const ( - FirewallRuleGetResponseProductZoneLockdown FirewallRuleGetResponseProduct = "zoneLockdown" - FirewallRuleGetResponseProductUaBlock FirewallRuleGetResponseProduct = "uaBlock" - FirewallRuleGetResponseProductBic FirewallRuleGetResponseProduct = "bic" - FirewallRuleGetResponseProductHot FirewallRuleGetResponseProduct = "hot" - FirewallRuleGetResponseProductSecurityLevel FirewallRuleGetResponseProduct = "securityLevel" - FirewallRuleGetResponseProductRateLimit FirewallRuleGetResponseProduct = "rateLimit" - FirewallRuleGetResponseProductWAF FirewallRuleGetResponseProduct = "waf" -) - type FirewallRuleUpdateParams struct { Body param.Field[interface{}] `json:"body,required"` } @@ -1095,10 +1050,11 @@ func (r FirewallRuleUpdateParams) MarshalJSON() (data []byte, err error) { type FirewallRuleUpdateResponseEnvelope struct { Errors []FirewallRuleUpdateResponseEnvelopeErrors `json:"errors,required"` Messages []FirewallRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result FirewallRuleUpdateResponse `json:"result,required,nullable"` + Result []FirewallRuleUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON firewallRuleUpdateResponseEnvelopeJSON `json:"-"` + Success FirewallRuleUpdateResponseEnvelopeSuccess `json:"success,required"` + ResultInfo FirewallRuleUpdateResponseEnvelopeResultInfo `json:"result_info"` + JSON firewallRuleUpdateResponseEnvelopeJSON `json:"-"` } // firewallRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct @@ -1108,6 +1064,7 @@ type firewallRuleUpdateResponseEnvelopeJSON struct { Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1161,6 +1118,54 @@ const ( FirewallRuleUpdateResponseEnvelopeSuccessTrue FirewallRuleUpdateResponseEnvelopeSuccess = true ) +type FirewallRuleUpdateResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON firewallRuleUpdateResponseEnvelopeResultInfoJSON `json:"-"` +} + +// firewallRuleUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [FirewallRuleUpdateResponseEnvelopeResultInfo] +type firewallRuleUpdateResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallRuleUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type FirewallRuleListParams struct { + // The action to search for. Must be an exact match. + Action param.Field[string] `query:"action"` + // A case-insensitive string to find in the description. + Description param.Field[string] `query:"description"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // When true, indicates that the firewall rule is currently paused. + Paused param.Field[bool] `query:"paused"` + // Number of firewall rules per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [FirewallRuleListParams]'s query parameters as `url.Values`. +func (r FirewallRuleListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + type FirewallRuleDeleteParams struct { // When true, indicates that Cloudflare should also delete the associated filter if // there are no other firewall rules referencing the filter. @@ -1240,528 +1245,151 @@ const ( FirewallRuleDeleteResponseEnvelopeSuccessTrue FirewallRuleDeleteResponseEnvelopeSuccess = true ) -type FirewallRuleFirewallRulesNewFirewallRulesParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r FirewallRuleFirewallRulesNewFirewallRulesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) +type FirewallRuleGetParams struct { } -type FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelope struct { - Errors []FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallRuleFirewallRulesNewFirewallRulesResponse `json:"result,required,nullable"` +type FirewallRuleGetResponseEnvelope struct { + Errors []FirewallRuleGetResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallRuleGetResponseEnvelopeMessages `json:"messages,required"` + Result FirewallRuleGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeJSON `json:"-"` + Success FirewallRuleGetResponseEnvelopeSuccess `json:"success,required"` + JSON firewallRuleGetResponseEnvelopeJSON `json:"-"` } -// firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelope] -type firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeJSON struct { +// firewallRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [FirewallRuleGetResponseEnvelope] +type firewallRuleGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrors] -type firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessages] -type firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeSuccess bool - -const ( - FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeSuccessTrue FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeSuccess = true -) - -type FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfo] -type firewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesNewFirewallRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesListFirewallRulesParams struct { - // The action to search for. Must be an exact match. - Action param.Field[string] `query:"action"` - // A case-insensitive string to find in the description. - Description param.Field[string] `query:"description"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // When true, indicates that the firewall rule is currently paused. - Paused param.Field[bool] `query:"paused"` - // Number of firewall rules per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes [FirewallRuleFirewallRulesListFirewallRulesParams]'s query -// parameters as `url.Values`. -func (r FirewallRuleFirewallRulesListFirewallRulesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type FirewallRuleFirewallRulesListFirewallRulesResponseEnvelope struct { - Errors []FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallRuleFirewallRulesListFirewallRulesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeJSON `json:"-"` -} - -// firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseEnvelope] -type firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrors] -type firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessages] -type firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeSuccess bool - -const ( - FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeSuccessTrue FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeSuccess = true -) - -type FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfo] -type firewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesListFirewallRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesUpdateFirewallRulesParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r FirewallRuleFirewallRulesUpdateFirewallRulesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelope struct { - Errors []FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallRuleFirewallRulesUpdateFirewallRulesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeJSON `json:"-"` -} - -// firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelope] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrorsJSON `json:"-"` +type FirewallRuleGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleGetResponseEnvelopeErrorsJSON `json:"-"` } -// firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrors] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrorsJSON struct { +// firewallRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FirewallRuleGetResponseEnvelopeErrors] +type firewallRuleGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessagesJSON `json:"-"` +type FirewallRuleGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleGetResponseEnvelopeMessagesJSON `json:"-"` } -// firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessages] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessagesJSON struct { +// firewallRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [FirewallRuleGetResponseEnvelopeMessages] +type firewallRuleGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeSuccess bool +type FirewallRuleGetResponseEnvelopeSuccess bool const ( - FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeSuccessTrue FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeSuccess = true + FirewallRuleGetResponseEnvelopeSuccessTrue FirewallRuleGetResponseEnvelopeSuccess = true ) -type FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfo] -type firewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesUpdateFirewallRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesParams struct { +type FirewallRuleReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesParams) MarshalJSON() (data []byte, err error) { +func (r FirewallRuleReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelope struct { - Errors []FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponse `json:"result,required,nullable"` +type FirewallRuleReplaceResponseEnvelope struct { + Errors []FirewallRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result FirewallRuleReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeJSON `json:"-"` + Success FirewallRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON firewallRuleReplaceResponseEnvelopeJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelope] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeJSON struct { +// firewallRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [FirewallRuleReplaceResponseEnvelope] +type firewallRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrorsJSON `json:"-"` +type FirewallRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrors] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrorsJSON struct { +// firewallRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FirewallRuleReplaceResponseEnvelopeErrors] +type firewallRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessagesJSON `json:"-"` +type FirewallRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessages] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessagesJSON struct { +// firewallRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [FirewallRuleReplaceResponseEnvelopeMessages] +type firewallRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeSuccess bool +type FirewallRuleReplaceResponseEnvelopeSuccess bool const ( - FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeSuccessTrue FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeSuccess = true -) - -type FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfo] -type firewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleGetParams struct { -} - -type FirewallRuleGetResponseEnvelope struct { - Errors []FirewallRuleGetResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallRuleGetResponseEnvelopeMessages `json:"messages,required"` - Result FirewallRuleGetResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallRuleGetResponseEnvelopeSuccess `json:"success,required"` - JSON firewallRuleGetResponseEnvelopeJSON `json:"-"` -} - -// firewallRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [FirewallRuleGetResponseEnvelope] -type firewallRuleGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [FirewallRuleGetResponseEnvelopeErrors] -type firewallRuleGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallRuleGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallRuleGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [FirewallRuleGetResponseEnvelopeMessages] -type firewallRuleGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallRuleGetResponseEnvelopeSuccess bool - -const ( - FirewallRuleGetResponseEnvelopeSuccessTrue FirewallRuleGetResponseEnvelopeSuccess = true + FirewallRuleReplaceResponseEnvelopeSuccessTrue FirewallRuleReplaceResponseEnvelopeSuccess = true ) diff --git a/firewallrule_test.go b/firewallrule_test.go index 9cd6aab52b4..662912ec684 100644 --- a/firewallrule_test.go +++ b/firewallrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFirewallRuleUpdate(t *testing.T) { +func TestFirewallRuleNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestFirewallRuleUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.Update( + _, err := client.Firewalls.Rules.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b60", - cloudflare.FirewallRuleUpdateParams{ + cloudflare.FirewallRuleNewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -46,40 +45,7 @@ func TestFirewallRuleUpdate(t *testing.T) { } } -func TestFirewallRuleDeleteWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Firewalls.Rules.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b60", - cloudflare.FirewallRuleDeleteParams{ - DeleteFilterIfUnused: cloudflare.F(true), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestFirewallRuleFirewallRulesNewFirewallRules(t *testing.T) { +func TestFirewallRuleUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -95,10 +61,10 @@ func TestFirewallRuleFirewallRulesNewFirewallRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.FirewallRulesNewFirewallRules( + _, err := client.Firewalls.Rules.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallRuleFirewallRulesNewFirewallRulesParams{ + cloudflare.FirewallRuleUpdateParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -111,7 +77,7 @@ func TestFirewallRuleFirewallRulesNewFirewallRules(t *testing.T) { } } -func TestFirewallRuleFirewallRulesListFirewallRulesWithOptionalParams(t *testing.T) { +func TestFirewallRuleListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -127,10 +93,10 @@ func TestFirewallRuleFirewallRulesListFirewallRulesWithOptionalParams(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.FirewallRulesListFirewallRules( + _, err := client.Firewalls.Rules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallRuleFirewallRulesListFirewallRulesParams{ + cloudflare.FirewallRuleListParams{ Action: cloudflare.F("block"), Description: cloudflare.F("mir"), Page: cloudflare.F(1.000000), @@ -147,7 +113,7 @@ func TestFirewallRuleFirewallRulesListFirewallRulesWithOptionalParams(t *testing } } -func TestFirewallRuleFirewallRulesUpdateFirewallRules(t *testing.T) { +func TestFirewallRuleDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -163,11 +129,12 @@ func TestFirewallRuleFirewallRulesUpdateFirewallRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.FirewallRulesUpdateFirewallRules( + _, err := client.Firewalls.Rules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallRuleFirewallRulesUpdateFirewallRulesParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + "372e67954025e0ba6aaa6d586b9e0b60", + cloudflare.FirewallRuleDeleteParams{ + DeleteFilterIfUnused: cloudflare.F(true), }, ) if err != nil { @@ -179,7 +146,7 @@ func TestFirewallRuleFirewallRulesUpdateFirewallRules(t *testing.T) { } } -func TestFirewallRuleFirewallRulesUpdatePriorityOfFirewallRules(t *testing.T) { +func TestFirewallRuleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -195,12 +162,11 @@ func TestFirewallRuleFirewallRulesUpdatePriorityOfFirewallRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.FirewallRulesUpdatePriorityOfFirewallRules( + _, err := client.Firewalls.Rules.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallRuleFirewallRulesUpdatePriorityOfFirewallRulesParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "372e67954025e0ba6aaa6d586b9e0b60", + cloudflare.FirewallRuleGetParams{}, ) if err != nil { var apierr *cloudflare.Error @@ -211,7 +177,7 @@ func TestFirewallRuleFirewallRulesUpdatePriorityOfFirewallRules(t *testing.T) { } } -func TestFirewallRuleGet(t *testing.T) { +func TestFirewallRuleReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -227,11 +193,13 @@ func TestFirewallRuleGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.Rules.Get( + _, err := client.Firewalls.Rules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b60", - cloudflare.FirewallRuleGetParams{}, + cloudflare.FirewallRuleReplaceParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewalluarule.go b/firewalluarule.go index a8856749768..fa86bb28dac 100644 --- a/firewalluarule.go +++ b/firewalluarule.go @@ -36,12 +36,12 @@ func NewFirewallUaRuleService(opts ...option.RequestOption) (r *FirewallUaRuleSe return } -// Updates an existing User Agent Blocking rule. -func (r *FirewallUaRuleService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallUaRuleUpdateParams, opts ...option.RequestOption) (res *FirewallUaRuleUpdateResponse, err error) { +// Creates a new User Agent Blocking rule in a zone. +func (r *FirewallUaRuleService) New(ctx context.Context, zoneIdentifier string, body FirewallUaRuleNewParams, opts ...option.RequestOption) (res *FirewallUaRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallUaRuleUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FirewallUaRuleNewResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -49,6 +49,31 @@ func (r *FirewallUaRuleService) Update(ctx context.Context, zoneIdentifier strin return } +// Fetches User Agent Blocking rules in a zone. You can filter the results using +// several optional parameters. +func (r *FirewallUaRuleService) List(ctx context.Context, zoneIdentifier string, query FirewallUaRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallUaRuleListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Fetches User Agent Blocking rules in a zone. You can filter the results using +// several optional parameters. +func (r *FirewallUaRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallUaRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallUaRuleListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) +} + // Deletes an existing User Agent Blocking rule. func (r *FirewallUaRuleService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallUaRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -75,26 +100,12 @@ func (r *FirewallUaRuleService) Get(ctx context.Context, zoneIdentifier string, return } -// Creates a new User Agent Blocking rule in a zone. -func (r *FirewallUaRuleService) UserAgentBlockingRulesNewAUserAgentBlockingRule(ctx context.Context, zoneIdentifier string, body FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleParams, opts ...option.RequestOption) (res *FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches User Agent Blocking rules in a zone. You can filter the results using -// several optional parameters. -func (r *FirewallUaRuleService) UserAgentBlockingRulesListUserAgentBlockingRules(ctx context.Context, zoneIdentifier string, query FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams, opts ...option.RequestOption) (res *[]FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse, err error) { +// Updates an existing User Agent Blocking rule. +func (r *FirewallUaRuleService) Replace(ctx context.Context, zoneIdentifier string, id string, body FirewallUaRuleReplaceParams, opts ...option.RequestOption) (res *FirewallUaRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env FirewallUaRuleReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -102,15 +113,14 @@ func (r *FirewallUaRuleService) UserAgentBlockingRulesListUserAgentBlockingRules return } -// Union satisfied by [FirewallUaRuleUpdateResponseUnknown] or -// [shared.UnionString]. -type FirewallUaRuleUpdateResponse interface { - ImplementsFirewallUaRuleUpdateResponse() +// Union satisfied by [FirewallUaRuleNewResponseUnknown] or [shared.UnionString]. +type FirewallUaRuleNewResponse interface { + ImplementsFirewallUaRuleNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*FirewallUaRuleUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*FirewallUaRuleNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -119,6 +129,70 @@ func init() { ) } +type FirewallUaRuleListResponse struct { + // The unique identifier of the User Agent Blocking rule. + ID string `json:"id"` + // The configuration object for the current rule. + Configuration FirewallUaRuleListResponseConfiguration `json:"configuration"` + // An informative summary of the rule. + Description string `json:"description"` + // The action to apply to a matched request. + Mode FirewallUaRuleListResponseMode `json:"mode"` + // When true, indicates that the rule is currently paused. + Paused bool `json:"paused"` + JSON firewallUaRuleListResponseJSON `json:"-"` +} + +// firewallUaRuleListResponseJSON contains the JSON metadata for the struct +// [FirewallUaRuleListResponse] +type firewallUaRuleListResponseJSON struct { + ID apijson.Field + Configuration apijson.Field + Description apijson.Field + Mode apijson.Field + Paused apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallUaRuleListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The configuration object for the current rule. +type FirewallUaRuleListResponseConfiguration struct { + // The configuration target for this rule. You must set the target to `ua` for User + // Agent Blocking rules. + Target string `json:"target"` + // The exact user agent string to match. This value will be compared to the + // received `User-Agent` HTTP header value. + Value string `json:"value"` + JSON firewallUaRuleListResponseConfigurationJSON `json:"-"` +} + +// firewallUaRuleListResponseConfigurationJSON contains the JSON metadata for the +// struct [FirewallUaRuleListResponseConfiguration] +type firewallUaRuleListResponseConfigurationJSON struct { + Target apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallUaRuleListResponseConfiguration) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The action to apply to a matched request. +type FirewallUaRuleListResponseMode string + +const ( + FirewallUaRuleListResponseModeBlock FirewallUaRuleListResponseMode = "block" + FirewallUaRuleListResponseModeChallenge FirewallUaRuleListResponseMode = "challenge" + FirewallUaRuleListResponseModeJsChallenge FirewallUaRuleListResponseMode = "js_challenge" + FirewallUaRuleListResponseModeManagedChallenge FirewallUaRuleListResponseMode = "managed_challenge" +) + type FirewallUaRuleDeleteResponse struct { // The unique identifier of the User Agent Blocking rule. ID string `json:"id"` @@ -153,16 +227,15 @@ func init() { ) } -// Union satisfied by -// [FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseUnknown] -// or [shared.UnionString]. -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse interface { - ImplementsFirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse() +// Union satisfied by [FirewallUaRuleReplaceResponseUnknown] or +// [shared.UnionString]. +type FirewallUaRuleReplaceResponse interface { + ImplementsFirewallUaRuleReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse)(nil)).Elem(), + reflect.TypeOf((*FirewallUaRuleReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -171,92 +244,26 @@ func init() { ) } -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse struct { - // The unique identifier of the User Agent Blocking rule. - ID string `json:"id"` - // The configuration object for the current rule. - Configuration FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfiguration `json:"configuration"` - // An informative summary of the rule. - Description string `json:"description"` - // The action to apply to a matched request. - Mode FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode `json:"mode"` - // When true, indicates that the rule is currently paused. - Paused bool `json:"paused"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseJSON struct { - ID apijson.Field - Configuration apijson.Field - Description apijson.Field - Mode apijson.Field - Paused apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The configuration object for the current rule. -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfiguration struct { - // The configuration target for this rule. You must set the target to `ua` for User - // Agent Blocking rules. - Target string `json:"target"` - // The exact user agent string to match. This value will be compared to the - // received `User-Agent` HTTP header value. - Value string `json:"value"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfigurationJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfigurationJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfiguration] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfigurationJSON struct { - Target apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseConfiguration) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action to apply to a matched request. -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode string - -const ( - FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseModeBlock FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode = "block" - FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseModeChallenge FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode = "challenge" - FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseModeJsChallenge FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode = "js_challenge" - FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseModeManagedChallenge FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseMode = "managed_challenge" -) - -type FirewallUaRuleUpdateParams struct { +type FirewallUaRuleNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallUaRuleUpdateParams) MarshalJSON() (data []byte, err error) { +func (r FirewallUaRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallUaRuleUpdateResponseEnvelope struct { - Errors []FirewallUaRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallUaRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result FirewallUaRuleUpdateResponse `json:"result,required,nullable"` +type FirewallUaRuleNewResponseEnvelope struct { + Errors []FirewallUaRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallUaRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result FirewallUaRuleNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallUaRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON firewallUaRuleUpdateResponseEnvelopeJSON `json:"-"` + Success FirewallUaRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON firewallUaRuleNewResponseEnvelopeJSON `json:"-"` } -// firewallUaRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [FirewallUaRuleUpdateResponseEnvelope] -type firewallUaRuleUpdateResponseEnvelopeJSON struct { +// firewallUaRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [FirewallUaRuleNewResponseEnvelope] +type firewallUaRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -265,55 +272,78 @@ type firewallUaRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallUaRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type FirewallUaRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallUaRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// firewallUaRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [FirewallUaRuleUpdateResponseEnvelopeErrors] -type firewallUaRuleUpdateResponseEnvelopeErrorsJSON struct { +// firewallUaRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [FirewallUaRuleNewResponseEnvelopeErrors] +type firewallUaRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallUaRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type FirewallUaRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallUaRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// firewallUaRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [FirewallUaRuleUpdateResponseEnvelopeMessages] -type firewallUaRuleUpdateResponseEnvelopeMessagesJSON struct { +// firewallUaRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [FirewallUaRuleNewResponseEnvelopeMessages] +type firewallUaRuleNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallUaRuleUpdateResponseEnvelopeSuccess bool +type FirewallUaRuleNewResponseEnvelopeSuccess bool const ( - FirewallUaRuleUpdateResponseEnvelopeSuccessTrue FirewallUaRuleUpdateResponseEnvelopeSuccess = true + FirewallUaRuleNewResponseEnvelopeSuccessTrue FirewallUaRuleNewResponseEnvelopeSuccess = true ) +type FirewallUaRuleListParams struct { + // A string to search for in the description of existing rules. + Description param.Field[string] `query:"description"` + // A string to search for in the description of existing rules. + DescriptionSearch param.Field[string] `query:"description_search"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // The maximum number of results per page. You can only set the value to `1` or to + // a multiple of 5 such as `5`, `10`, `15`, or `20`. + PerPage param.Field[float64] `query:"per_page"` + // A string to search for in the user agent values of existing rules. + UaSearch param.Field[string] `query:"ua_search"` +} + +// URLQuery serializes [FirewallUaRuleListParams]'s query parameters as +// `url.Values`. +func (r FirewallUaRuleListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + type FirewallUaRuleDeleteResponseEnvelope struct { Errors []FirewallUaRuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []FirewallUaRuleDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -452,27 +482,26 @@ const ( FirewallUaRuleGetResponseEnvelopeSuccessTrue FirewallUaRuleGetResponseEnvelopeSuccess = true ) -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleParams struct { +type FirewallUaRuleReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleParams) MarshalJSON() (data []byte, err error) { +func (r FirewallUaRuleReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelope struct { - Errors []FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessages `json:"messages,required"` - Result FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse `json:"result,required,nullable"` +type FirewallUaRuleReplaceResponseEnvelope struct { + Errors []FirewallUaRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallUaRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result FirewallUaRuleReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeSuccess `json:"success,required"` - JSON firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeJSON `json:"-"` + Success FirewallUaRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON firewallUaRuleReplaceResponseEnvelopeJSON `json:"-"` } -// firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelope] -type firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeJSON struct { +// firewallUaRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [FirewallUaRuleReplaceResponseEnvelope] +type firewallUaRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -481,179 +510,51 @@ type firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelo ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrorsJSON `json:"-"` +type FirewallUaRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallUaRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrors] -type firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrorsJSON struct { +// firewallUaRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [FirewallUaRuleReplaceResponseEnvelopeErrors] +type firewallUaRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessagesJSON `json:"-"` +type FirewallUaRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallUaRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessages] -type firewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessagesJSON struct { +// firewallUaRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [FirewallUaRuleReplaceResponseEnvelopeMessages] +type firewallUaRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallUaRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeSuccess bool +type FirewallUaRuleReplaceResponseEnvelopeSuccess bool const ( - FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeSuccessTrue FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponseEnvelopeSuccess = true + FirewallUaRuleReplaceResponseEnvelopeSuccessTrue FirewallUaRuleReplaceResponseEnvelopeSuccess = true ) - -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams struct { - // A string to search for in the description of existing rules. - Description param.Field[string] `query:"description"` - // A string to search for in the description of existing rules. - DescriptionSearch param.Field[string] `query:"description_search"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // The maximum number of results per page. You can only set the value to `1` or to - // a multiple of 5 such as `5`, `10`, `15`, or `20`. - PerPage param.Field[float64] `query:"per_page"` - // A string to search for in the user agent values of existing rules. - UaSearch param.Field[string] `query:"ua_search"` -} - -// URLQuery serializes -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams]'s query -// parameters as `url.Values`. -func (r FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelope struct { - Errors []FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelope] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrors] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessages] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeSuccess bool - -const ( - FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeSuccessTrue FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeSuccess = true -) - -type FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfo] -type firewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/firewalluarule_test.go b/firewalluarule_test.go index 212864a46f7..83c17540246 100644 --- a/firewalluarule_test.go +++ b/firewalluarule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFirewallUaRuleUpdate(t *testing.T) { +func TestFirewallUaRuleNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestFirewallUaRuleUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.UaRules.Update( + _, err := client.Firewalls.UaRules.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b59", - cloudflare.FirewallUaRuleUpdateParams{ + cloudflare.FirewallUaRuleNewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -46,7 +45,7 @@ func TestFirewallUaRuleUpdate(t *testing.T) { } } -func TestFirewallUaRuleDelete(t *testing.T) { +func TestFirewallUaRuleListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,10 +61,16 @@ func TestFirewallUaRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.UaRules.Delete( + _, err := client.Firewalls.UaRules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b59", + cloudflare.FirewallUaRuleListParams{ + Description: cloudflare.F("abusive"), + DescriptionSearch: cloudflare.F("abusive"), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(1.000000), + UaSearch: cloudflare.F("Safari"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -76,7 +81,7 @@ func TestFirewallUaRuleDelete(t *testing.T) { } } -func TestFirewallUaRuleGet(t *testing.T) { +func TestFirewallUaRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -92,7 +97,7 @@ func TestFirewallUaRuleGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.UaRules.Get( + _, err := client.Firewalls.UaRules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b59", @@ -106,7 +111,7 @@ func TestFirewallUaRuleGet(t *testing.T) { } } -func TestFirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRule(t *testing.T) { +func TestFirewallUaRuleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,12 +127,10 @@ func TestFirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRule(t *testin option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.UaRules.UserAgentBlockingRulesNewAUserAgentBlockingRule( + _, err := client.Firewalls.UaRules.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "372e67954025e0ba6aaa6d586b9e0b59", ) if err != nil { var apierr *cloudflare.Error @@ -138,7 +141,7 @@ func TestFirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRule(t *testin } } -func TestFirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesWithOptionalParams(t *testing.T) { +func TestFirewallUaRuleReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -154,15 +157,12 @@ func TestFirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesWithOptio option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.UaRules.UserAgentBlockingRulesListUserAgentBlockingRules( + _, err := client.Firewalls.UaRules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallUaRuleUserAgentBlockingRulesListUserAgentBlockingRulesParams{ - Description: cloudflare.F("abusive"), - DescriptionSearch: cloudflare.F("abusive"), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(1.000000), - UaSearch: cloudflare.F("Safari"), + "372e67954025e0ba6aaa6d586b9e0b59", + cloudflare.FirewallUaRuleReplaceParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/firewallwafoverride.go b/firewallwafoverride.go index 4d9e22cd45e..4b1116f6283 100644 --- a/firewallwafoverride.go +++ b/firewallwafoverride.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -33,15 +34,15 @@ func NewFirewallWAFOverrideService(opts ...option.RequestOption) (r *FirewallWAF return } -// Updates an existing URI-based WAF override. +// Creates a URI-based WAF override for a zone. // // **Note:** Applies only to the // [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). -func (r *FirewallWAFOverrideService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallWAFOverrideUpdateParams, opts ...option.RequestOption) (res *FirewallWAFOverrideUpdateResponse, err error) { +func (r *FirewallWAFOverrideService) New(ctx context.Context, zoneIdentifier string, body FirewallWAFOverrideNewParams, opts ...option.RequestOption) (res *FirewallWAFOverrideNewResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallWAFOverrideUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env FirewallWAFOverrideNewResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -49,6 +50,35 @@ func (r *FirewallWAFOverrideService) Update(ctx context.Context, zoneIdentifier return } +// Fetches the URI-based WAF overrides in a zone. +// +// **Note:** Applies only to the +// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). +func (r *FirewallWAFOverrideService) List(ctx context.Context, zoneIdentifier string, query FirewallWAFOverrideListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFOverrideListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Fetches the URI-based WAF overrides in a zone. +// +// **Note:** Applies only to the +// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). +func (r *FirewallWAFOverrideService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallWAFOverrideListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFOverrideListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) +} + // Deletes an existing URI-based WAF override. // // **Note:** Applies only to the @@ -81,31 +111,15 @@ func (r *FirewallWAFOverrideService) Get(ctx context.Context, zoneIdentifier str return } -// Creates a URI-based WAF override for a zone. -// -// **Note:** Applies only to the -// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). -func (r *FirewallWAFOverrideService) WAFOverridesNewAWAFOverride(ctx context.Context, zoneIdentifier string, body FirewallWAFOverrideWAFOverridesNewAWAFOverrideParams, opts ...option.RequestOption) (res *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches the URI-based WAF overrides in a zone. +// Updates an existing URI-based WAF override. // // **Note:** Applies only to the // [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). -func (r *FirewallWAFOverrideService) WAFOverridesListWAFOverrides(ctx context.Context, zoneIdentifier string, query FirewallWAFOverrideWAFOverridesListWAFOverridesParams, opts ...option.RequestOption) (res *[]FirewallWAFOverrideWAFOverridesListWAFOverridesResponse, err error) { +func (r *FirewallWAFOverrideService) Replace(ctx context.Context, zoneIdentifier string, id string, body FirewallWAFOverrideReplaceParams, opts ...option.RequestOption) (res *FirewallWAFOverrideReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env FirewallWAFOverrideReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -113,7 +127,7 @@ func (r *FirewallWAFOverrideService) WAFOverridesListWAFOverrides(ctx context.Co return } -type FirewallWAFOverrideUpdateResponse struct { +type FirewallWAFOverrideNewResponse struct { // The unique identifier of the WAF override. ID string `json:"id"` // An informative summary of the current URI-based WAF override. @@ -132,23 +146,23 @@ type FirewallWAFOverrideUpdateResponse struct { Priority float64 `json:"priority"` // Specifies that, when a WAF rule matches, its configured action will be replaced // by the action configured in this object. - RewriteAction FirewallWAFOverrideUpdateResponseRewriteAction `json:"rewrite_action"` + RewriteAction FirewallWAFOverrideNewResponseRewriteAction `json:"rewrite_action"` // An object that allows you to override the action of specific WAF rules. Each key // of this object must be the ID of a WAF rule, and each value must be a valid WAF // action. Unless you are disabling a rule, ensure that you also enable the rule // group that this WAF rule belongs to. When creating a new URI-based WAF override, // you must provide a `groups` object or a `rules` object. - Rules map[string]FirewallWAFOverrideUpdateResponseRule `json:"rules"` + Rules map[string]FirewallWAFOverrideNewResponseRule `json:"rules"` // The URLs to include in the current WAF override. You can use wildcards. Each // entered URL will be escaped before use, which means you can only use simple // wildcard patterns. - URLs []string `json:"urls"` - JSON firewallWAFOverrideUpdateResponseJSON `json:"-"` + URLs []string `json:"urls"` + JSON firewallWAFOverrideNewResponseJSON `json:"-"` } -// firewallWAFOverrideUpdateResponseJSON contains the JSON metadata for the struct -// [FirewallWAFOverrideUpdateResponse] -type firewallWAFOverrideUpdateResponseJSON struct { +// firewallWAFOverrideNewResponseJSON contains the JSON metadata for the struct +// [FirewallWAFOverrideNewResponse] +type firewallWAFOverrideNewResponseJSON struct { ID apijson.Field Description apijson.Field Groups apijson.Field @@ -161,26 +175,140 @@ type firewallWAFOverrideUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Specifies that, when a WAF rule matches, its configured action will be replaced +// by the action configured in this object. +type FirewallWAFOverrideNewResponseRewriteAction struct { + // The WAF rule action to apply. + Block FirewallWAFOverrideNewResponseRewriteActionBlock `json:"block"` + Challenge interface{} `json:"challenge"` + Default interface{} `json:"default"` + // The WAF rule action to apply. + Disable FirewallWAFOverrideNewResponseRewriteActionDisable `json:"disable"` + Simulate interface{} `json:"simulate"` + JSON firewallWAFOverrideNewResponseRewriteActionJSON `json:"-"` +} + +// firewallWAFOverrideNewResponseRewriteActionJSON contains the JSON metadata for +// the struct [FirewallWAFOverrideNewResponseRewriteAction] +type firewallWAFOverrideNewResponseRewriteActionJSON struct { + Block apijson.Field + Challenge apijson.Field + Default apijson.Field + Disable apijson.Field + Simulate apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallWAFOverrideNewResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The WAF rule action to apply. +type FirewallWAFOverrideNewResponseRewriteActionBlock string + +const ( + FirewallWAFOverrideNewResponseRewriteActionBlockChallenge FirewallWAFOverrideNewResponseRewriteActionBlock = "challenge" + FirewallWAFOverrideNewResponseRewriteActionBlockBlock FirewallWAFOverrideNewResponseRewriteActionBlock = "block" + FirewallWAFOverrideNewResponseRewriteActionBlockSimulate FirewallWAFOverrideNewResponseRewriteActionBlock = "simulate" + FirewallWAFOverrideNewResponseRewriteActionBlockDisable FirewallWAFOverrideNewResponseRewriteActionBlock = "disable" + FirewallWAFOverrideNewResponseRewriteActionBlockDefault FirewallWAFOverrideNewResponseRewriteActionBlock = "default" +) + +// The WAF rule action to apply. +type FirewallWAFOverrideNewResponseRewriteActionDisable string + +const ( + FirewallWAFOverrideNewResponseRewriteActionDisableChallenge FirewallWAFOverrideNewResponseRewriteActionDisable = "challenge" + FirewallWAFOverrideNewResponseRewriteActionDisableBlock FirewallWAFOverrideNewResponseRewriteActionDisable = "block" + FirewallWAFOverrideNewResponseRewriteActionDisableSimulate FirewallWAFOverrideNewResponseRewriteActionDisable = "simulate" + FirewallWAFOverrideNewResponseRewriteActionDisableDisable FirewallWAFOverrideNewResponseRewriteActionDisable = "disable" + FirewallWAFOverrideNewResponseRewriteActionDisableDefault FirewallWAFOverrideNewResponseRewriteActionDisable = "default" +) + +// The WAF rule action to apply. +type FirewallWAFOverrideNewResponseRule string + +const ( + FirewallWAFOverrideNewResponseRuleChallenge FirewallWAFOverrideNewResponseRule = "challenge" + FirewallWAFOverrideNewResponseRuleBlock FirewallWAFOverrideNewResponseRule = "block" + FirewallWAFOverrideNewResponseRuleSimulate FirewallWAFOverrideNewResponseRule = "simulate" + FirewallWAFOverrideNewResponseRuleDisable FirewallWAFOverrideNewResponseRule = "disable" + FirewallWAFOverrideNewResponseRuleDefault FirewallWAFOverrideNewResponseRule = "default" +) + +type FirewallWAFOverrideListResponse struct { + // The unique identifier of the WAF override. + ID string `json:"id,required"` + // When true, indicates that the WAF package is currently paused. + Paused bool `json:"paused,required"` + // The relative priority of the current URI-based WAF override when multiple + // overrides match a single URL. A lower number indicates higher priority. Higher + // priority overrides may overwrite values set by lower priority overrides. + Priority float64 `json:"priority,required"` + // The URLs to include in the current WAF override. You can use wildcards. Each + // entered URL will be escaped before use, which means you can only use simple + // wildcard patterns. + URLs []string `json:"urls,required"` + // An informative summary of the current URI-based WAF override. + Description string `json:"description,nullable"` + // An object that allows you to enable or disable WAF rule groups for the current + // WAF override. Each key of this object must be the ID of a WAF rule group, and + // each value must be a valid WAF action (usually `default` or `disable`). When + // creating a new URI-based WAF override, you must provide a `groups` object or a + // `rules` object. + Groups map[string]interface{} `json:"groups"` + // Specifies that, when a WAF rule matches, its configured action will be replaced + // by the action configured in this object. + RewriteAction FirewallWAFOverrideListResponseRewriteAction `json:"rewrite_action"` + // An object that allows you to override the action of specific WAF rules. Each key + // of this object must be the ID of a WAF rule, and each value must be a valid WAF + // action. Unless you are disabling a rule, ensure that you also enable the rule + // group that this WAF rule belongs to. When creating a new URI-based WAF override, + // you must provide a `groups` object or a `rules` object. + Rules map[string]FirewallWAFOverrideListResponseRule `json:"rules"` + JSON firewallWAFOverrideListResponseJSON `json:"-"` +} + +// firewallWAFOverrideListResponseJSON contains the JSON metadata for the struct +// [FirewallWAFOverrideListResponse] +type firewallWAFOverrideListResponseJSON struct { + ID apijson.Field + Paused apijson.Field + Priority apijson.Field + URLs apijson.Field + Description apijson.Field + Groups apijson.Field + RewriteAction apijson.Field + Rules apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *FirewallWAFOverrideListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies that, when a WAF rule matches, its configured action will be replaced // by the action configured in this object. -type FirewallWAFOverrideUpdateResponseRewriteAction struct { +type FirewallWAFOverrideListResponseRewriteAction struct { // The WAF rule action to apply. - Block FirewallWAFOverrideUpdateResponseRewriteActionBlock `json:"block"` - Challenge interface{} `json:"challenge"` - Default interface{} `json:"default"` + Block FirewallWAFOverrideListResponseRewriteActionBlock `json:"block"` + Challenge interface{} `json:"challenge"` + Default interface{} `json:"default"` // The WAF rule action to apply. - Disable FirewallWAFOverrideUpdateResponseRewriteActionDisable `json:"disable"` - Simulate interface{} `json:"simulate"` - JSON firewallWAFOverrideUpdateResponseRewriteActionJSON `json:"-"` + Disable FirewallWAFOverrideListResponseRewriteActionDisable `json:"disable"` + Simulate interface{} `json:"simulate"` + JSON firewallWAFOverrideListResponseRewriteActionJSON `json:"-"` } -// firewallWAFOverrideUpdateResponseRewriteActionJSON contains the JSON metadata -// for the struct [FirewallWAFOverrideUpdateResponseRewriteAction] -type firewallWAFOverrideUpdateResponseRewriteActionJSON struct { +// firewallWAFOverrideListResponseRewriteActionJSON contains the JSON metadata for +// the struct [FirewallWAFOverrideListResponseRewriteAction] +type firewallWAFOverrideListResponseRewriteActionJSON struct { Block apijson.Field Challenge apijson.Field Default apijson.Field @@ -190,41 +318,41 @@ type firewallWAFOverrideUpdateResponseRewriteActionJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideUpdateResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideListResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The WAF rule action to apply. -type FirewallWAFOverrideUpdateResponseRewriteActionBlock string +type FirewallWAFOverrideListResponseRewriteActionBlock string const ( - FirewallWAFOverrideUpdateResponseRewriteActionBlockChallenge FirewallWAFOverrideUpdateResponseRewriteActionBlock = "challenge" - FirewallWAFOverrideUpdateResponseRewriteActionBlockBlock FirewallWAFOverrideUpdateResponseRewriteActionBlock = "block" - FirewallWAFOverrideUpdateResponseRewriteActionBlockSimulate FirewallWAFOverrideUpdateResponseRewriteActionBlock = "simulate" - FirewallWAFOverrideUpdateResponseRewriteActionBlockDisable FirewallWAFOverrideUpdateResponseRewriteActionBlock = "disable" - FirewallWAFOverrideUpdateResponseRewriteActionBlockDefault FirewallWAFOverrideUpdateResponseRewriteActionBlock = "default" + FirewallWAFOverrideListResponseRewriteActionBlockChallenge FirewallWAFOverrideListResponseRewriteActionBlock = "challenge" + FirewallWAFOverrideListResponseRewriteActionBlockBlock FirewallWAFOverrideListResponseRewriteActionBlock = "block" + FirewallWAFOverrideListResponseRewriteActionBlockSimulate FirewallWAFOverrideListResponseRewriteActionBlock = "simulate" + FirewallWAFOverrideListResponseRewriteActionBlockDisable FirewallWAFOverrideListResponseRewriteActionBlock = "disable" + FirewallWAFOverrideListResponseRewriteActionBlockDefault FirewallWAFOverrideListResponseRewriteActionBlock = "default" ) // The WAF rule action to apply. -type FirewallWAFOverrideUpdateResponseRewriteActionDisable string +type FirewallWAFOverrideListResponseRewriteActionDisable string const ( - FirewallWAFOverrideUpdateResponseRewriteActionDisableChallenge FirewallWAFOverrideUpdateResponseRewriteActionDisable = "challenge" - FirewallWAFOverrideUpdateResponseRewriteActionDisableBlock FirewallWAFOverrideUpdateResponseRewriteActionDisable = "block" - FirewallWAFOverrideUpdateResponseRewriteActionDisableSimulate FirewallWAFOverrideUpdateResponseRewriteActionDisable = "simulate" - FirewallWAFOverrideUpdateResponseRewriteActionDisableDisable FirewallWAFOverrideUpdateResponseRewriteActionDisable = "disable" - FirewallWAFOverrideUpdateResponseRewriteActionDisableDefault FirewallWAFOverrideUpdateResponseRewriteActionDisable = "default" + FirewallWAFOverrideListResponseRewriteActionDisableChallenge FirewallWAFOverrideListResponseRewriteActionDisable = "challenge" + FirewallWAFOverrideListResponseRewriteActionDisableBlock FirewallWAFOverrideListResponseRewriteActionDisable = "block" + FirewallWAFOverrideListResponseRewriteActionDisableSimulate FirewallWAFOverrideListResponseRewriteActionDisable = "simulate" + FirewallWAFOverrideListResponseRewriteActionDisableDisable FirewallWAFOverrideListResponseRewriteActionDisable = "disable" + FirewallWAFOverrideListResponseRewriteActionDisableDefault FirewallWAFOverrideListResponseRewriteActionDisable = "default" ) // The WAF rule action to apply. -type FirewallWAFOverrideUpdateResponseRule string +type FirewallWAFOverrideListResponseRule string const ( - FirewallWAFOverrideUpdateResponseRuleChallenge FirewallWAFOverrideUpdateResponseRule = "challenge" - FirewallWAFOverrideUpdateResponseRuleBlock FirewallWAFOverrideUpdateResponseRule = "block" - FirewallWAFOverrideUpdateResponseRuleSimulate FirewallWAFOverrideUpdateResponseRule = "simulate" - FirewallWAFOverrideUpdateResponseRuleDisable FirewallWAFOverrideUpdateResponseRule = "disable" - FirewallWAFOverrideUpdateResponseRuleDefault FirewallWAFOverrideUpdateResponseRule = "default" + FirewallWAFOverrideListResponseRuleChallenge FirewallWAFOverrideListResponseRule = "challenge" + FirewallWAFOverrideListResponseRuleBlock FirewallWAFOverrideListResponseRule = "block" + FirewallWAFOverrideListResponseRuleSimulate FirewallWAFOverrideListResponseRule = "simulate" + FirewallWAFOverrideListResponseRuleDisable FirewallWAFOverrideListResponseRule = "disable" + FirewallWAFOverrideListResponseRuleDefault FirewallWAFOverrideListResponseRule = "default" ) type FirewallWAFOverrideDeleteResponse struct { @@ -359,7 +487,7 @@ const ( FirewallWAFOverrideGetResponseRuleDefault FirewallWAFOverrideGetResponseRule = "default" ) -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse struct { +type FirewallWAFOverrideReplaceResponse struct { // The unique identifier of the WAF override. ID string `json:"id"` // An informative summary of the current URI-based WAF override. @@ -378,23 +506,23 @@ type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse struct { Priority float64 `json:"priority"` // Specifies that, when a WAF rule matches, its configured action will be replaced // by the action configured in this object. - RewriteAction FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteAction `json:"rewrite_action"` + RewriteAction FirewallWAFOverrideReplaceResponseRewriteAction `json:"rewrite_action"` // An object that allows you to override the action of specific WAF rules. Each key // of this object must be the ID of a WAF rule, and each value must be a valid WAF // action. Unless you are disabling a rule, ensure that you also enable the rule // group that this WAF rule belongs to. When creating a new URI-based WAF override, // you must provide a `groups` object or a `rules` object. - Rules map[string]FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule `json:"rules"` + Rules map[string]FirewallWAFOverrideReplaceResponseRule `json:"rules"` // The URLs to include in the current WAF override. You can use wildcards. Each // entered URL will be escaped before use, which means you can only use simple // wildcard patterns. - URLs []string `json:"urls"` - JSON firewallWAFOverrideWAFOverridesNewAwafOverrideResponseJSON `json:"-"` + URLs []string `json:"urls"` + JSON firewallWAFOverrideReplaceResponseJSON `json:"-"` } -// firewallWAFOverrideWAFOverridesNewAwafOverrideResponseJSON contains the JSON -// metadata for the struct [FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse] -type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseJSON struct { +// firewallWAFOverrideReplaceResponseJSON contains the JSON metadata for the struct +// [FirewallWAFOverrideReplaceResponse] +type firewallWAFOverrideReplaceResponseJSON struct { ID apijson.Field Description apijson.Field Groups apijson.Field @@ -407,143 +535,26 @@ type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Specifies that, when a WAF rule matches, its configured action will be replaced -// by the action configured in this object. -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteAction struct { - // The WAF rule action to apply. - Block FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock `json:"block"` - Challenge interface{} `json:"challenge"` - Default interface{} `json:"default"` - // The WAF rule action to apply. - Disable FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable `json:"disable"` - Simulate interface{} `json:"simulate"` - JSON firewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionJSON contains -// the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteAction] -type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionJSON struct { - Block apijson.Field - Challenge apijson.Field - Default apijson.Field - Disable apijson.Field - Simulate apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock string - -const ( - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlockChallenge FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock = "challenge" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlockBlock FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock = "block" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlockSimulate FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock = "simulate" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlockDisable FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock = "disable" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlockDefault FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionBlock = "default" -) - -// The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable string - -const ( - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisableChallenge FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable = "challenge" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisableBlock FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable = "block" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisableSimulate FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable = "simulate" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisableDisable FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable = "disable" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisableDefault FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRewriteActionDisable = "default" -) - -// The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule string - -const ( - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRuleChallenge FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule = "challenge" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRuleBlock FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule = "block" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRuleSimulate FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule = "simulate" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRuleDisable FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule = "disable" - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRuleDefault FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseRule = "default" -) - -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponse struct { - // The unique identifier of the WAF override. - ID string `json:"id,required"` - // When true, indicates that the WAF package is currently paused. - Paused bool `json:"paused,required"` - // The relative priority of the current URI-based WAF override when multiple - // overrides match a single URL. A lower number indicates higher priority. Higher - // priority overrides may overwrite values set by lower priority overrides. - Priority float64 `json:"priority,required"` - // The URLs to include in the current WAF override. You can use wildcards. Each - // entered URL will be escaped before use, which means you can only use simple - // wildcard patterns. - URLs []string `json:"urls,required"` - // An informative summary of the current URI-based WAF override. - Description string `json:"description,nullable"` - // An object that allows you to enable or disable WAF rule groups for the current - // WAF override. Each key of this object must be the ID of a WAF rule group, and - // each value must be a valid WAF action (usually `default` or `disable`). When - // creating a new URI-based WAF override, you must provide a `groups` object or a - // `rules` object. - Groups map[string]interface{} `json:"groups"` - // Specifies that, when a WAF rule matches, its configured action will be replaced - // by the action configured in this object. - RewriteAction FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteAction `json:"rewrite_action"` - // An object that allows you to override the action of specific WAF rules. Each key - // of this object must be the ID of a WAF rule, and each value must be a valid WAF - // action. Unless you are disabling a rule, ensure that you also enable the rule - // group that this WAF rule belongs to. When creating a new URI-based WAF override, - // you must provide a `groups` object or a `rules` object. - Rules map[string]FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule `json:"rules"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseJSON contains the JSON -// metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponse] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseJSON struct { - ID apijson.Field - Paused apijson.Field - Priority apijson.Field - URLs apijson.Field - Description apijson.Field - Groups apijson.Field - RewriteAction apijson.Field - Rules apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies that, when a WAF rule matches, its configured action will be replaced // by the action configured in this object. -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteAction struct { +type FirewallWAFOverrideReplaceResponseRewriteAction struct { // The WAF rule action to apply. - Block FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock `json:"block"` - Challenge interface{} `json:"challenge"` - Default interface{} `json:"default"` + Block FirewallWAFOverrideReplaceResponseRewriteActionBlock `json:"block"` + Challenge interface{} `json:"challenge"` + Default interface{} `json:"default"` // The WAF rule action to apply. - Disable FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable `json:"disable"` - Simulate interface{} `json:"simulate"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionJSON `json:"-"` + Disable FirewallWAFOverrideReplaceResponseRewriteActionDisable `json:"disable"` + Simulate interface{} `json:"simulate"` + JSON firewallWAFOverrideReplaceResponseRewriteActionJSON `json:"-"` } -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteAction] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionJSON struct { +// firewallWAFOverrideReplaceResponseRewriteActionJSON contains the JSON metadata +// for the struct [FirewallWAFOverrideReplaceResponseRewriteAction] +type firewallWAFOverrideReplaceResponseRewriteActionJSON struct { Block apijson.Field Challenge apijson.Field Default apijson.Field @@ -553,63 +564,63 @@ type firewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionJSON st ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideReplaceResponseRewriteAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock string +type FirewallWAFOverrideReplaceResponseRewriteActionBlock string const ( - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlockChallenge FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock = "challenge" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlockBlock FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock = "block" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlockSimulate FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock = "simulate" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlockDisable FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock = "disable" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlockDefault FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionBlock = "default" + FirewallWAFOverrideReplaceResponseRewriteActionBlockChallenge FirewallWAFOverrideReplaceResponseRewriteActionBlock = "challenge" + FirewallWAFOverrideReplaceResponseRewriteActionBlockBlock FirewallWAFOverrideReplaceResponseRewriteActionBlock = "block" + FirewallWAFOverrideReplaceResponseRewriteActionBlockSimulate FirewallWAFOverrideReplaceResponseRewriteActionBlock = "simulate" + FirewallWAFOverrideReplaceResponseRewriteActionBlockDisable FirewallWAFOverrideReplaceResponseRewriteActionBlock = "disable" + FirewallWAFOverrideReplaceResponseRewriteActionBlockDefault FirewallWAFOverrideReplaceResponseRewriteActionBlock = "default" ) // The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable string +type FirewallWAFOverrideReplaceResponseRewriteActionDisable string const ( - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisableChallenge FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable = "challenge" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisableBlock FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable = "block" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisableSimulate FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable = "simulate" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisableDisable FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable = "disable" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisableDefault FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRewriteActionDisable = "default" + FirewallWAFOverrideReplaceResponseRewriteActionDisableChallenge FirewallWAFOverrideReplaceResponseRewriteActionDisable = "challenge" + FirewallWAFOverrideReplaceResponseRewriteActionDisableBlock FirewallWAFOverrideReplaceResponseRewriteActionDisable = "block" + FirewallWAFOverrideReplaceResponseRewriteActionDisableSimulate FirewallWAFOverrideReplaceResponseRewriteActionDisable = "simulate" + FirewallWAFOverrideReplaceResponseRewriteActionDisableDisable FirewallWAFOverrideReplaceResponseRewriteActionDisable = "disable" + FirewallWAFOverrideReplaceResponseRewriteActionDisableDefault FirewallWAFOverrideReplaceResponseRewriteActionDisable = "default" ) // The WAF rule action to apply. -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule string +type FirewallWAFOverrideReplaceResponseRule string const ( - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRuleChallenge FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule = "challenge" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRuleBlock FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule = "block" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRuleSimulate FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule = "simulate" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRuleDisable FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule = "disable" - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRuleDefault FirewallWAFOverrideWAFOverridesListWAFOverridesResponseRule = "default" + FirewallWAFOverrideReplaceResponseRuleChallenge FirewallWAFOverrideReplaceResponseRule = "challenge" + FirewallWAFOverrideReplaceResponseRuleBlock FirewallWAFOverrideReplaceResponseRule = "block" + FirewallWAFOverrideReplaceResponseRuleSimulate FirewallWAFOverrideReplaceResponseRule = "simulate" + FirewallWAFOverrideReplaceResponseRuleDisable FirewallWAFOverrideReplaceResponseRule = "disable" + FirewallWAFOverrideReplaceResponseRuleDefault FirewallWAFOverrideReplaceResponseRule = "default" ) -type FirewallWAFOverrideUpdateParams struct { +type FirewallWAFOverrideNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallWAFOverrideUpdateParams) MarshalJSON() (data []byte, err error) { +func (r FirewallWAFOverrideNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallWAFOverrideUpdateResponseEnvelope struct { - Errors []FirewallWAFOverrideUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallWAFOverrideUpdateResponseEnvelopeMessages `json:"messages,required"` - Result FirewallWAFOverrideUpdateResponse `json:"result,required,nullable"` +type FirewallWAFOverrideNewResponseEnvelope struct { + Errors []FirewallWAFOverrideNewResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallWAFOverrideNewResponseEnvelopeMessages `json:"messages,required"` + Result FirewallWAFOverrideNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallWAFOverrideUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON firewallWAFOverrideUpdateResponseEnvelopeJSON `json:"-"` + Success FirewallWAFOverrideNewResponseEnvelopeSuccess `json:"success,required"` + JSON firewallWAFOverrideNewResponseEnvelopeJSON `json:"-"` } -// firewallWAFOverrideUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [FirewallWAFOverrideUpdateResponseEnvelope] -type firewallWAFOverrideUpdateResponseEnvelopeJSON struct { +// firewallWAFOverrideNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [FirewallWAFOverrideNewResponseEnvelope] +type firewallWAFOverrideNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -618,55 +629,71 @@ type firewallWAFOverrideUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFOverrideUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON `json:"-"` +type FirewallWAFOverrideNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFOverrideNewResponseEnvelopeErrorsJSON `json:"-"` } -// firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [FirewallWAFOverrideUpdateResponseEnvelopeErrors] -type firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON struct { +// firewallWAFOverrideNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [FirewallWAFOverrideNewResponseEnvelopeErrors] +type firewallWAFOverrideNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFOverrideUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON `json:"-"` +type FirewallWAFOverrideNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFOverrideNewResponseEnvelopeMessagesJSON `json:"-"` } -// firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [FirewallWAFOverrideUpdateResponseEnvelopeMessages] -type firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON struct { +// firewallWAFOverrideNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [FirewallWAFOverrideNewResponseEnvelopeMessages] +type firewallWAFOverrideNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallWAFOverrideUpdateResponseEnvelopeSuccess bool +type FirewallWAFOverrideNewResponseEnvelopeSuccess bool const ( - FirewallWAFOverrideUpdateResponseEnvelopeSuccessTrue FirewallWAFOverrideUpdateResponseEnvelopeSuccess = true + FirewallWAFOverrideNewResponseEnvelopeSuccessTrue FirewallWAFOverrideNewResponseEnvelopeSuccess = true ) +type FirewallWAFOverrideListParams struct { + // The page number of paginated results. + Page param.Field[float64] `query:"page"` + // The number of WAF overrides per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [FirewallWAFOverrideListParams]'s query parameters as +// `url.Values`. +func (r FirewallWAFOverrideListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + type FirewallWAFOverrideDeleteResponseEnvelope struct { Result FirewallWAFOverrideDeleteResponse `json:"result"` JSON firewallWAFOverrideDeleteResponseEnvelopeJSON `json:"-"` @@ -753,27 +780,26 @@ const ( FirewallWAFOverrideGetResponseEnvelopeSuccessTrue FirewallWAFOverrideGetResponseEnvelopeSuccess = true ) -type FirewallWAFOverrideWAFOverridesNewAWAFOverrideParams struct { +type FirewallWAFOverrideReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r FirewallWAFOverrideWAFOverridesNewAWAFOverrideParams) MarshalJSON() (data []byte, err error) { +func (r FirewallWAFOverrideReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelope struct { - Errors []FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessages `json:"messages,required"` - Result FirewallWAFOverrideWAFOverridesNewAwafOverrideResponse `json:"result,required,nullable"` +type FirewallWAFOverrideReplaceResponseEnvelope struct { + Errors []FirewallWAFOverrideReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallWAFOverrideReplaceResponseEnvelopeMessages `json:"messages,required"` + Result FirewallWAFOverrideReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeSuccess `json:"success,required"` - JSON firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeJSON `json:"-"` + Success FirewallWAFOverrideReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON firewallWAFOverrideReplaceResponseEnvelopeJSON `json:"-"` } -// firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelope] -type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeJSON struct { +// firewallWAFOverrideReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [FirewallWAFOverrideReplaceResponseEnvelope] +type firewallWAFOverrideReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -782,171 +808,51 @@ type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrorsJSON `json:"-"` +type FirewallWAFOverrideReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFOverrideReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrors] -type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrorsJSON struct { +// firewallWAFOverrideReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [FirewallWAFOverrideReplaceResponseEnvelopeErrors] +type firewallWAFOverrideReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessagesJSON `json:"-"` +type FirewallWAFOverrideReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFOverrideReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessages] -type firewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessagesJSON struct { +// firewallWAFOverrideReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [FirewallWAFOverrideReplaceResponseEnvelopeMessages] +type firewallWAFOverrideReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFOverrideReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeSuccess bool +type FirewallWAFOverrideReplaceResponseEnvelopeSuccess bool const ( - FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeSuccessTrue FirewallWAFOverrideWAFOverridesNewAwafOverrideResponseEnvelopeSuccess = true + FirewallWAFOverrideReplaceResponseEnvelopeSuccessTrue FirewallWAFOverrideReplaceResponseEnvelopeSuccess = true ) - -type FirewallWAFOverrideWAFOverridesListWAFOverridesParams struct { - // The page number of paginated results. - Page param.Field[float64] `query:"page"` - // The number of WAF overrides per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes [FirewallWAFOverrideWAFOverridesListWAFOverridesParams]'s -// query parameters as `url.Values`. -func (r FirewallWAFOverrideWAFOverridesListWAFOverridesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelope struct { - Errors []FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallWAFOverrideWAFOverridesListWAFOverridesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelope] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrors] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessages] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeSuccess bool - -const ( - FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeSuccessTrue FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeSuccess = true -) - -type FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfo] -type firewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFOverrideWAFOverridesListWAFOverridesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/firewallwafoverride_test.go b/firewallwafoverride_test.go index 16edf9b7f72..8673484ff8f 100644 --- a/firewallwafoverride_test.go +++ b/firewallwafoverride_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestFirewallWAFOverrideUpdate(t *testing.T) { +func TestFirewallWAFOverrideNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestFirewallWAFOverrideUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Overrides.Update( + _, err := client.Firewalls.WAF.Overrides.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "de677e5818985db1285d0e80225f06e5", - cloudflare.FirewallWAFOverrideUpdateParams{ + cloudflare.FirewallWAFOverrideNewParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) @@ -46,7 +45,7 @@ func TestFirewallWAFOverrideUpdate(t *testing.T) { } } -func TestFirewallWAFOverrideDelete(t *testing.T) { +func TestFirewallWAFOverrideListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,10 +61,13 @@ func TestFirewallWAFOverrideDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Overrides.Delete( + _, err := client.Firewalls.WAF.Overrides.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "de677e5818985db1285d0e80225f06e5", + cloudflare.FirewallWAFOverrideListParams{ + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + }, ) if err != nil { var apierr *cloudflare.Error @@ -76,7 +78,7 @@ func TestFirewallWAFOverrideDelete(t *testing.T) { } } -func TestFirewallWAFOverrideGet(t *testing.T) { +func TestFirewallWAFOverrideDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -92,7 +94,7 @@ func TestFirewallWAFOverrideGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Overrides.Get( + _, err := client.Firewalls.WAF.Overrides.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "de677e5818985db1285d0e80225f06e5", @@ -106,7 +108,7 @@ func TestFirewallWAFOverrideGet(t *testing.T) { } } -func TestFirewallWAFOverrideWAFOverridesNewAWAFOverride(t *testing.T) { +func TestFirewallWAFOverrideGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,12 +124,10 @@ func TestFirewallWAFOverrideWAFOverridesNewAWAFOverride(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Overrides.WAFOverridesNewAWAFOverride( + _, err := client.Firewalls.WAF.Overrides.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallWAFOverrideWAFOverridesNewAWAFOverrideParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "de677e5818985db1285d0e80225f06e5", ) if err != nil { var apierr *cloudflare.Error @@ -138,7 +138,7 @@ func TestFirewallWAFOverrideWAFOverridesNewAWAFOverride(t *testing.T) { } } -func TestFirewallWAFOverrideWAFOverridesListWAFOverridesWithOptionalParams(t *testing.T) { +func TestFirewallWAFOverrideReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -154,12 +154,12 @@ func TestFirewallWAFOverrideWAFOverridesListWAFOverridesWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Overrides.WAFOverridesListWAFOverrides( + _, err := client.Firewalls.WAF.Overrides.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.FirewallWAFOverrideWAFOverridesListWAFOverridesParams{ - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), + "de677e5818985db1285d0e80225f06e5", + cloudflare.FirewallWAFOverrideReplaceParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/firewallwafpackagegroup.go b/firewallwafpackagegroup.go index a6da9545135..db8a503d10b 100644 --- a/firewallwafpackagegroup.go +++ b/firewallwafpackagegroup.go @@ -53,31 +53,44 @@ func (r *FirewallWAFPackageGroupService) Update(ctx context.Context, zoneID stri return } -// Fetches the details of a WAF rule group. +// Fetches the WAF rule groups in a WAF package. // // **Note:** Applies only to the // [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). -func (r *FirewallWAFPackageGroupService) Get(ctx context.Context, zoneID string, packageID string, groupID string, opts ...option.RequestOption) (res *FirewallWAFPackageGroupGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env FirewallWAFPackageGroupGetResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", zoneID, packageID, groupID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) +func (r *FirewallWAFPackageGroupService) List(ctx context.Context, zoneID string, packageID string, query FirewallWAFPackageGroupListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFPackageGroupListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups", zoneID, packageID) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } // Fetches the WAF rule groups in a WAF package. // // **Note:** Applies only to the // [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). -func (r *FirewallWAFPackageGroupService) WAFRuleGroupsListWAFRuleGroups(ctx context.Context, zoneID string, packageID string, query FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams, opts ...option.RequestOption) (res *[]FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse, err error) { +func (r *FirewallWAFPackageGroupService) ListAutoPaging(ctx context.Context, zoneID string, packageID string, query FirewallWAFPackageGroupListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFPackageGroupListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneID, packageID, query, opts...)) +} + +// Fetches the details of a WAF rule group. +// +// **Note:** Applies only to the +// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). +func (r *FirewallWAFPackageGroupService) Get(ctx context.Context, zoneID string, packageID string, groupID string, opts ...option.RequestOption) (res *FirewallWAFPackageGroupGetResponse, err error) { opts = append(r.Options[:], opts...) - var env FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups", zoneID, packageID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env FirewallWAFPackageGroupGetResponseEnvelope + path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", zoneID, packageID, groupID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -107,53 +120,31 @@ type FirewallWAFPackageGroupUpdateResponseArray []interface{} func (r FirewallWAFPackageGroupUpdateResponseArray) ImplementsFirewallWAFPackageGroupUpdateResponse() { } -// Union satisfied by [FirewallWAFPackageGroupGetResponseUnknown], -// [FirewallWAFPackageGroupGetResponseArray] or [shared.UnionString]. -type FirewallWAFPackageGroupGetResponse interface { - ImplementsFirewallWAFPackageGroupGetResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*FirewallWAFPackageGroupGetResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type FirewallWAFPackageGroupGetResponseArray []interface{} - -func (r FirewallWAFPackageGroupGetResponseArray) ImplementsFirewallWAFPackageGroupGetResponse() {} - -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse struct { +type FirewallWAFPackageGroupListResponse struct { // The unique identifier of the rule group. ID string `json:"id,required"` // An informative summary of what the rule group does. Description string `json:"description,required,nullable"` // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. - Mode FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseMode `json:"mode,required"` + Mode FirewallWAFPackageGroupListResponseMode `json:"mode,required"` // The name of the rule group. Name string `json:"name,required"` // The number of rules in the current rule group. RulesCount float64 `json:"rules_count,required"` // The available states for the rule group. - AllowedModes []FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedMode `json:"allowed_modes"` + AllowedModes []FirewallWAFPackageGroupListResponseAllowedMode `json:"allowed_modes"` // The number of rules within the group that have been modified from their default // configuration. ModifiedRulesCount float64 `json:"modified_rules_count"` // The unique identifier of a WAF package. - PackageID string `json:"package_id"` - JSON firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseJSON `json:"-"` + PackageID string `json:"package_id"` + JSON firewallWAFPackageGroupListResponseJSON `json:"-"` } -// firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseJSON contains the -// JSON metadata for the struct -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse] -type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseJSON struct { +// firewallWAFPackageGroupListResponseJSON contains the JSON metadata for the +// struct [FirewallWAFPackageGroupListResponse] +type firewallWAFPackageGroupListResponseJSON struct { ID apijson.Field Description apijson.Field Mode apijson.Field @@ -166,28 +157,49 @@ type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFPackageGroupListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseMode string +type FirewallWAFPackageGroupListResponseMode string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseModeOn FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseMode = "on" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseModeOff FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseMode = "off" + FirewallWAFPackageGroupListResponseModeOn FirewallWAFPackageGroupListResponseMode = "on" + FirewallWAFPackageGroupListResponseModeOff FirewallWAFPackageGroupListResponseMode = "off" ) // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedMode string +type FirewallWAFPackageGroupListResponseAllowedMode string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedModeOn FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedMode = "on" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedModeOff FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseAllowedMode = "off" + FirewallWAFPackageGroupListResponseAllowedModeOn FirewallWAFPackageGroupListResponseAllowedMode = "on" + FirewallWAFPackageGroupListResponseAllowedModeOff FirewallWAFPackageGroupListResponseAllowedMode = "off" ) +// Union satisfied by [FirewallWAFPackageGroupGetResponseUnknown], +// [FirewallWAFPackageGroupGetResponseArray] or [shared.UnionString]. +type FirewallWAFPackageGroupGetResponse interface { + ImplementsFirewallWAFPackageGroupGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*FirewallWAFPackageGroupGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type FirewallWAFPackageGroupGetResponseArray []interface{} + +func (r FirewallWAFPackageGroupGetResponseArray) ImplementsFirewallWAFPackageGroupGetResponse() {} + type FirewallWAFPackageGroupUpdateParams struct { // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. @@ -276,96 +288,26 @@ const ( FirewallWAFPackageGroupUpdateResponseEnvelopeSuccessTrue FirewallWAFPackageGroupUpdateResponseEnvelopeSuccess = true ) -type FirewallWAFPackageGroupGetResponseEnvelope struct { - Errors []FirewallWAFPackageGroupGetResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallWAFPackageGroupGetResponseEnvelopeMessages `json:"messages,required"` - Result FirewallWAFPackageGroupGetResponse `json:"result,required"` - // Whether the API call was successful - Success FirewallWAFPackageGroupGetResponseEnvelopeSuccess `json:"success,required"` - JSON firewallWAFPackageGroupGetResponseEnvelopeJSON `json:"-"` -} - -// firewallWAFPackageGroupGetResponseEnvelopeJSON contains the JSON metadata for -// the struct [FirewallWAFPackageGroupGetResponseEnvelope] -type firewallWAFPackageGroupGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFPackageGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallWAFPackageGroupGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [FirewallWAFPackageGroupGetResponseEnvelopeErrors] -type firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFPackageGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FirewallWAFPackageGroupGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [FirewallWAFPackageGroupGetResponseEnvelopeMessages] -type firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFPackageGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type FirewallWAFPackageGroupGetResponseEnvelopeSuccess bool - -const ( - FirewallWAFPackageGroupGetResponseEnvelopeSuccessTrue FirewallWAFPackageGroupGetResponseEnvelopeSuccess = true -) - -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams struct { +type FirewallWAFPackageGroupListParams struct { // The direction used to sort returned rule groups. - Direction param.Field[FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirection] `query:"direction"` + Direction param.Field[FirewallWAFPackageGroupListParamsDirection] `query:"direction"` // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. - Match param.Field[FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatch] `query:"match"` + Match param.Field[FirewallWAFPackageGroupListParamsMatch] `query:"match"` // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. - Mode param.Field[FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMode] `query:"mode"` + Mode param.Field[FirewallWAFPackageGroupListParamsMode] `query:"mode"` // The field used to sort returned rule groups. - Order param.Field[FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrder] `query:"order"` + Order param.Field[FirewallWAFPackageGroupListParamsOrder] `query:"order"` // The page number of paginated results. Page param.Field[float64] `query:"page"` // The number of rule groups per page. PerPage param.Field[float64] `query:"per_page"` } -// URLQuery serializes -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams]'s query parameters -// as `url.Values`. -func (r FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams) URLQuery() (v url.Values) { +// URLQuery serializes [FirewallWAFPackageGroupListParams]'s query parameters as +// `url.Values`. +func (r FirewallWAFPackageGroupListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -373,137 +315,104 @@ func (r FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams) URLQuery() } // The direction used to sort returned rule groups. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirection string +type FirewallWAFPackageGroupListParamsDirection string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirectionAsc FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirection = "asc" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirectionDesc FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirection = "desc" + FirewallWAFPackageGroupListParamsDirectionAsc FirewallWAFPackageGroupListParamsDirection = "asc" + FirewallWAFPackageGroupListParamsDirectionDesc FirewallWAFPackageGroupListParamsDirection = "desc" ) // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatch string +type FirewallWAFPackageGroupListParamsMatch string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatchAny FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatch = "any" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatchAll FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatch = "all" + FirewallWAFPackageGroupListParamsMatchAny FirewallWAFPackageGroupListParamsMatch = "any" + FirewallWAFPackageGroupListParamsMatchAll FirewallWAFPackageGroupListParamsMatch = "all" ) // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMode string +type FirewallWAFPackageGroupListParamsMode string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsModeOn FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMode = "on" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsModeOff FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMode = "off" + FirewallWAFPackageGroupListParamsModeOn FirewallWAFPackageGroupListParamsMode = "on" + FirewallWAFPackageGroupListParamsModeOff FirewallWAFPackageGroupListParamsMode = "off" ) // The field used to sort returned rule groups. -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrder string +type FirewallWAFPackageGroupListParamsOrder string const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrderMode FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrder = "mode" - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrderRulesCount FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrder = "rules_count" + FirewallWAFPackageGroupListParamsOrderMode FirewallWAFPackageGroupListParamsOrder = "mode" + FirewallWAFPackageGroupListParamsOrderRulesCount FirewallWAFPackageGroupListParamsOrder = "rules_count" ) -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelope struct { - Errors []FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrors `json:"errors,required"` - Messages []FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessages `json:"messages,required"` - Result []FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponse `json:"result,required,nullable"` +type FirewallWAFPackageGroupGetResponseEnvelope struct { + Errors []FirewallWAFPackageGroupGetResponseEnvelopeErrors `json:"errors,required"` + Messages []FirewallWAFPackageGroupGetResponseEnvelopeMessages `json:"messages,required"` + Result FirewallWAFPackageGroupGetResponse `json:"result,required"` // Whether the API call was successful - Success FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfo `json:"result_info"` - JSON firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeJSON `json:"-"` + Success FirewallWAFPackageGroupGetResponseEnvelopeSuccess `json:"success,required"` + JSON firewallWAFPackageGroupGetResponseEnvelopeJSON `json:"-"` } -// firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelope] -type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeJSON struct { +// firewallWAFPackageGroupGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [FirewallWAFPackageGroupGetResponseEnvelope] +type firewallWAFPackageGroupGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFPackageGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrorsJSON `json:"-"` +type FirewallWAFPackageGroupGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON `json:"-"` } -// firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrors] -type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrorsJSON struct { +// firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [FirewallWAFPackageGroupGetResponseEnvelopeErrors] +type firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFPackageGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessagesJSON `json:"-"` +type FirewallWAFPackageGroupGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON `json:"-"` } -// firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessages] -type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessagesJSON struct { +// firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [FirewallWAFPackageGroupGetResponseEnvelopeMessages] +type firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *FirewallWAFPackageGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeSuccess bool +type FirewallWAFPackageGroupGetResponseEnvelopeSuccess bool const ( - FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeSuccessTrue FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeSuccess = true + FirewallWAFPackageGroupGetResponseEnvelopeSuccessTrue FirewallWAFPackageGroupGetResponseEnvelopeSuccess = true ) - -type FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfo] -type firewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/firewallwafpackagegroup_test.go b/firewallwafpackagegroup_test.go index 09148929710..dff4f30ff04 100644 --- a/firewallwafpackagegroup_test.go +++ b/firewallwafpackagegroup_test.go @@ -47,7 +47,7 @@ func TestFirewallWAFPackageGroupUpdateWithOptionalParams(t *testing.T) { } } -func TestFirewallWAFPackageGroupGet(t *testing.T) { +func TestFirewallWAFPackageGroupListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +63,18 @@ func TestFirewallWAFPackageGroupGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Packages.Groups.Get( + _, err := client.Firewalls.WAF.Packages.Groups.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "a25a9a7e9c00afc1fb2e0245519d725b", - "a25a9a7e9c00afc1fb2e0245519d725b", + cloudflare.FirewallWAFPackageGroupListParams{ + Direction: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsDirectionDesc), + Match: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsMatchAny), + Mode: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsModeOn), + Order: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsOrderMode), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +85,7 @@ func TestFirewallWAFPackageGroupGet(t *testing.T) { } } -func TestFirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsWithOptionalParams(t *testing.T) { +func TestFirewallWAFPackageGroupGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,18 +101,11 @@ func TestFirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsWithOptionalParams option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Firewalls.WAF.Packages.Groups.WAFRuleGroupsListWAFRuleGroups( + _, err := client.Firewalls.WAF.Packages.Groups.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "a25a9a7e9c00afc1fb2e0245519d725b", - cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParams{ - Direction: cloudflare.F(cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsDirectionDesc), - Match: cloudflare.F(cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsMatchAny), - Mode: cloudflare.F(cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsModeOn), - Order: cloudflare.F(cloudflare.FirewallWAFPackageGroupWAFRuleGroupsListWAFRuleGroupsParamsOrderMode), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - }, + "a25a9a7e9c00afc1fb2e0245519d725b", ) if err != nil { var apierr *cloudflare.Error diff --git a/fontsetting.go b/fontsetting.go deleted file mode 100644 index 26579369e5d..00000000000 --- a/fontsetting.go +++ /dev/null @@ -1,320 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "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/option" -) - -// FontSettingService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewFontSettingService] method -// instead. -type FontSettingService struct { - Options []option.RequestOption -} - -// NewFontSettingService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewFontSettingService(opts ...option.RequestOption) (r *FontSettingService) { - r = &FontSettingService{} - r.Options = opts - return -} - -// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google -// Hosted fonts from your own domain, boost performance, and enhance user privacy. -// Refer to the Cloudflare Fonts documentation for more information. -func (r *FontSettingService) Update(ctx context.Context, zoneID string, body FontSettingUpdateParams, opts ...option.RequestOption) (res *FontSettingUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env FontSettingUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/settings/fonts", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google -// Hosted fonts from your own domain, boost performance, and enhance user privacy. -// Refer to the Cloudflare Fonts documentation for more information. -func (r *FontSettingService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *FontSettingGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env FontSettingGetResponseEnvelope - path := fmt.Sprintf("zones/%s/settings/fonts", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google -// Hosted fonts from your own domain, boost performance, and enhance user privacy. -// Refer to the Cloudflare Fonts documentation for more information. -type FontSettingUpdateResponse struct { - // ID of the zone setting. - ID FontSettingUpdateResponseID `json:"id,required"` - // Current value of the zone setting. - Value FontSettingUpdateResponseValue `json:"value,required"` - // Whether or not this setting can be modified for this zone (based on your - // Cloudflare plan level). - Editable FontSettingUpdateResponseEditable `json:"editable"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON fontSettingUpdateResponseJSON `json:"-"` -} - -// fontSettingUpdateResponseJSON contains the JSON metadata for the struct -// [FontSettingUpdateResponse] -type fontSettingUpdateResponseJSON struct { - ID apijson.Field - Value apijson.Field - Editable apijson.Field - ModifiedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// ID of the zone setting. -type FontSettingUpdateResponseID string - -const ( - FontSettingUpdateResponseIDFonts FontSettingUpdateResponseID = "fonts" -) - -// Current value of the zone setting. -type FontSettingUpdateResponseValue string - -const ( - FontSettingUpdateResponseValueOn FontSettingUpdateResponseValue = "on" - FontSettingUpdateResponseValueOff FontSettingUpdateResponseValue = "off" -) - -// Whether or not this setting can be modified for this zone (based on your -// Cloudflare plan level). -type FontSettingUpdateResponseEditable bool - -const ( - FontSettingUpdateResponseEditableTrue FontSettingUpdateResponseEditable = true - FontSettingUpdateResponseEditableFalse FontSettingUpdateResponseEditable = false -) - -// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google -// Hosted fonts from your own domain, boost performance, and enhance user privacy. -// Refer to the Cloudflare Fonts documentation for more information. -type FontSettingGetResponse struct { - // ID of the zone setting. - ID FontSettingGetResponseID `json:"id,required"` - // Current value of the zone setting. - Value FontSettingGetResponseValue `json:"value,required"` - // Whether or not this setting can be modified for this zone (based on your - // Cloudflare plan level). - Editable FontSettingGetResponseEditable `json:"editable"` - // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON fontSettingGetResponseJSON `json:"-"` -} - -// fontSettingGetResponseJSON contains the JSON metadata for the struct -// [FontSettingGetResponse] -type fontSettingGetResponseJSON struct { - ID apijson.Field - Value apijson.Field - Editable apijson.Field - ModifiedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// ID of the zone setting. -type FontSettingGetResponseID string - -const ( - FontSettingGetResponseIDFonts FontSettingGetResponseID = "fonts" -) - -// Current value of the zone setting. -type FontSettingGetResponseValue string - -const ( - FontSettingGetResponseValueOn FontSettingGetResponseValue = "on" - FontSettingGetResponseValueOff FontSettingGetResponseValue = "off" -) - -// Whether or not this setting can be modified for this zone (based on your -// Cloudflare plan level). -type FontSettingGetResponseEditable bool - -const ( - FontSettingGetResponseEditableTrue FontSettingGetResponseEditable = true - FontSettingGetResponseEditableFalse FontSettingGetResponseEditable = false -) - -type FontSettingUpdateParams struct { - // Whether the feature is enabled or disabled. - Value param.Field[FontSettingUpdateParamsValue] `json:"value,required"` -} - -func (r FontSettingUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Whether the feature is enabled or disabled. -type FontSettingUpdateParamsValue string - -const ( - FontSettingUpdateParamsValueOn FontSettingUpdateParamsValue = "on" - FontSettingUpdateParamsValueOff FontSettingUpdateParamsValue = "off" -) - -type FontSettingUpdateResponseEnvelope struct { - Errors []FontSettingUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []FontSettingUpdateResponseEnvelopeMessages `json:"messages,required"` - // Whether the API call was successful - Success bool `json:"success,required"` - // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google - // Hosted fonts from your own domain, boost performance, and enhance user privacy. - // Refer to the Cloudflare Fonts documentation for more information. - Result FontSettingUpdateResponse `json:"result"` - JSON fontSettingUpdateResponseEnvelopeJSON `json:"-"` -} - -// fontSettingUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [FontSettingUpdateResponseEnvelope] -type fontSettingUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FontSettingUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON fontSettingUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// fontSettingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [FontSettingUpdateResponseEnvelopeErrors] -type fontSettingUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FontSettingUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON fontSettingUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// fontSettingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [FontSettingUpdateResponseEnvelopeMessages] -type fontSettingUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FontSettingGetResponseEnvelope struct { - Errors []FontSettingGetResponseEnvelopeErrors `json:"errors,required"` - Messages []FontSettingGetResponseEnvelopeMessages `json:"messages,required"` - // Whether the API call was successful - Success bool `json:"success,required"` - // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google - // Hosted fonts from your own domain, boost performance, and enhance user privacy. - // Refer to the Cloudflare Fonts documentation for more information. - Result FontSettingGetResponse `json:"result"` - JSON fontSettingGetResponseEnvelopeJSON `json:"-"` -} - -// fontSettingGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [FontSettingGetResponseEnvelope] -type fontSettingGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FontSettingGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON fontSettingGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// fontSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [FontSettingGetResponseEnvelopeErrors] -type fontSettingGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type FontSettingGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON fontSettingGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// fontSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [FontSettingGetResponseEnvelopeMessages] -type fontSettingGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *FontSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/gateway.go b/gateway.go index fdcecc409d1..e840c6055ab 100644 --- a/gateway.go +++ b/gateway.go @@ -17,15 +17,16 @@ import ( // variables from the environment automatically. You should not instantiate this // service directly, and instead use the [NewGatewayService] method instead. type GatewayService struct { - Options []option.RequestOption - Categories *GatewayCategoryService - AppTypes *GatewayAppTypeService - Configurations *GatewayConfigurationService - Lists *GatewayListService - Locations *GatewayLocationService - Loggings *GatewayLoggingService - ProxyEndpoints *GatewayProxyEndpointService - Rules *GatewayRuleService + Options []option.RequestOption + AuditSSHSettings *GatewayAuditSSHSettingService + Categories *GatewayCategoryService + AppTypes *GatewayAppTypeService + Configurations *GatewayConfigurationService + Lists *GatewayListService + Locations *GatewayLocationService + Loggings *GatewayLoggingService + ProxyEndpoints *GatewayProxyEndpointService + Rules *GatewayRuleService } // NewGatewayService generates a new service that applies the given options to each @@ -34,6 +35,7 @@ type GatewayService struct { func NewGatewayService(opts ...option.RequestOption) (r *GatewayService) { r = &GatewayService{} r.Options = opts + r.AuditSSHSettings = NewGatewayAuditSSHSettingService(opts...) r.Categories = NewGatewayCategoryService(opts...) r.AppTypes = NewGatewayAppTypeService(opts...) r.Configurations = NewGatewayConfigurationService(opts...) @@ -46,9 +48,9 @@ func NewGatewayService(opts ...option.RequestOption) (r *GatewayService) { } // Creates a Zero Trust account with an existing Cloudflare account. -func (r *GatewayService) ZeroTrustAccountsNewZeroTrustAccount(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayZeroTrustAccountsNewZeroTrustAccountResponse, err error) { +func (r *GatewayService) New(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayNewResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelope + var env GatewayNewResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -59,9 +61,9 @@ func (r *GatewayService) ZeroTrustAccountsNewZeroTrustAccount(ctx context.Contex } // Gets information about the current Zero Trust account. -func (r *GatewayService) ZeroTrustAccountsGetZeroTrustAccountInformation(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse, err error) { +func (r *GatewayService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayListResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelope + var env GatewayListResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -71,19 +73,19 @@ func (r *GatewayService) ZeroTrustAccountsGetZeroTrustAccountInformation(ctx con return } -type GatewayZeroTrustAccountsNewZeroTrustAccountResponse struct { +type GatewayNewResponse struct { // Cloudflare account ID. ID string `json:"id"` // Gateway internal ID. GatewayTag string `json:"gateway_tag"` // The name of the provider. Usually Cloudflare. - ProviderName string `json:"provider_name"` - JSON gatewayZeroTrustAccountsNewZeroTrustAccountResponseJSON `json:"-"` + ProviderName string `json:"provider_name"` + JSON gatewayNewResponseJSON `json:"-"` } -// gatewayZeroTrustAccountsNewZeroTrustAccountResponseJSON contains the JSON -// metadata for the struct [GatewayZeroTrustAccountsNewZeroTrustAccountResponse] -type gatewayZeroTrustAccountsNewZeroTrustAccountResponseJSON struct { +// gatewayNewResponseJSON contains the JSON metadata for the struct +// [GatewayNewResponse] +type gatewayNewResponseJSON struct { ID apijson.Field GatewayTag apijson.Field ProviderName apijson.Field @@ -91,24 +93,23 @@ type gatewayZeroTrustAccountsNewZeroTrustAccountResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsNewZeroTrustAccountResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse struct { +type GatewayListResponse struct { // Cloudflare account ID. ID string `json:"id"` // Gateway internal ID. GatewayTag string `json:"gateway_tag"` // The name of the provider. Usually Cloudflare. - ProviderName string `json:"provider_name"` - JSON gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseJSON `json:"-"` + ProviderName string `json:"provider_name"` + JSON gatewayListResponseJSON `json:"-"` } -// gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseJSON contains the -// JSON metadata for the struct -// [GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse] -type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseJSON struct { +// gatewayListResponseJSON contains the JSON metadata for the struct +// [GatewayListResponse] +type gatewayListResponseJSON struct { ID apijson.Field GatewayTag apijson.Field ProviderName apijson.Field @@ -116,23 +117,22 @@ type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelope struct { - Errors []GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessages `json:"messages,required"` - Result GatewayZeroTrustAccountsNewZeroTrustAccountResponse `json:"result,required"` +type GatewayNewResponseEnvelope struct { + Errors []GatewayNewResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayNewResponseEnvelopeMessages `json:"messages,required"` + Result GatewayNewResponse `json:"result,required"` // Whether the API call was successful - Success GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeJSON `json:"-"` + Success GatewayNewResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayNewResponseEnvelopeJSON `json:"-"` } -// gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelope] -type gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeJSON struct { +// gatewayNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayNewResponseEnvelope] +type gatewayNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -141,70 +141,67 @@ type gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrorsJSON `json:"-"` +type GatewayNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayNewResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrors] -type gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrorsJSON struct { +// gatewayNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [GatewayNewResponseEnvelopeErrors] +type gatewayNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessagesJSON `json:"-"` +type GatewayNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayNewResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessages] -type gatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessagesJSON struct { +// gatewayNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [GatewayNewResponseEnvelopeMessages] +type gatewayNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeSuccess bool +type GatewayNewResponseEnvelopeSuccess bool const ( - GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeSuccessTrue GatewayZeroTrustAccountsNewZeroTrustAccountResponseEnvelopeSuccess = true + GatewayNewResponseEnvelopeSuccessTrue GatewayNewResponseEnvelopeSuccess = true ) -type GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelope struct { - Errors []GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessages `json:"messages,required"` - Result GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponse `json:"result,required"` +type GatewayListResponseEnvelope struct { + Errors []GatewayListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayListResponseEnvelopeMessages `json:"messages,required"` + Result GatewayListResponse `json:"result,required"` // Whether the API call was successful - Success GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeJSON `json:"-"` + Success GatewayListResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayListResponseEnvelopeJSON `json:"-"` } -// gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelope] -type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeJSON struct { +// gatewayListResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayListResponseEnvelope] +type gatewayListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -213,53 +210,51 @@ type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrorsJSON `json:"-"` +type GatewayListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrors] -type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrorsJSON struct { +// gatewayListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [GatewayListResponseEnvelopeErrors] +type gatewayListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessagesJSON `json:"-"` +type GatewayListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessages] -type gatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessagesJSON struct { +// gatewayListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayListResponseEnvelopeMessages] +type gatewayListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeSuccess bool +type GatewayListResponseEnvelopeSuccess bool const ( - GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeSuccessTrue GatewayZeroTrustAccountsGetZeroTrustAccountInformationResponseEnvelopeSuccess = true + GatewayListResponseEnvelopeSuccessTrue GatewayListResponseEnvelopeSuccess = true ) diff --git a/gateway_test.go b/gateway_test.go index 39fd65fa463..371f5b0dced 100644 --- a/gateway_test.go +++ b/gateway_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayZeroTrustAccountsNewZeroTrustAccount(t *testing.T) { +func TestGatewayNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestGatewayZeroTrustAccountsNewZeroTrustAccount(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ZeroTrustAccountsNewZeroTrustAccount(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.New(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestGatewayZeroTrustAccountsNewZeroTrustAccount(t *testing.T) { } } -func TestGatewayZeroTrustAccountsGetZeroTrustAccountInformation(t *testing.T) { +func TestGatewayList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +55,7 @@ func TestGatewayZeroTrustAccountsGetZeroTrustAccountInformation(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ZeroTrustAccountsGetZeroTrustAccountInformation(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewayapptype.go b/gatewayapptype.go index eb54afe91ae..5a924f47360 100644 --- a/gatewayapptype.go +++ b/gatewayapptype.go @@ -33,9 +33,9 @@ func NewGatewayAppTypeService(opts ...option.RequestOption) (r *GatewayAppTypeSe } // Fetches all application and application type mappings. -func (r *GatewayAppTypeService) ZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappings(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse, err error) { +func (r *GatewayAppTypeService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]GatewayAppTypeListResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelope + var env GatewayAppTypeListResponseEnvelope path := fmt.Sprintf("accounts/%s/gateway/app_types", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,19 +45,17 @@ func (r *GatewayAppTypeService) ZeroTrustGatewayApplicationAndApplicationTypeMap return } -// Union satisfied by -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplication] -// or -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationType]. -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse interface { - implementsGatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse() +// Union satisfied by [GatewayAppTypeListResponseZeroTrustGatewayApplication] or +// [GatewayAppTypeListResponseZeroTrustGatewayApplicationType]. +type GatewayAppTypeListResponse interface { + implementsGatewayAppTypeListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*GatewayAppTypeListResponse)(nil)).Elem(), "") } -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplication struct { +type GatewayAppTypeListResponseZeroTrustGatewayApplication struct { // The identifier for this application. There is only one application per ID. ID int64 `json:"id"` // The identifier for the type of this application. There can be many applications @@ -65,14 +63,13 @@ type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl ApplicationTypeID int64 `json:"application_type_id"` CreatedAt time.Time `json:"created_at" format:"date-time"` // The name of the application or application type. - Name string `json:"name"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationJSON `json:"-"` + Name string `json:"name"` + JSON gatewayAppTypeListResponseZeroTrustGatewayApplicationJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplication] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationJSON struct { +// gatewayAppTypeListResponseZeroTrustGatewayApplicationJSON contains the JSON +// metadata for the struct [GatewayAppTypeListResponseZeroTrustGatewayApplication] +type gatewayAppTypeListResponseZeroTrustGatewayApplicationJSON struct { ID apijson.Field ApplicationTypeID apijson.Field CreatedAt apijson.Field @@ -81,14 +78,14 @@ type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplication) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseZeroTrustGatewayApplication) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplication) implementsGatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse() { +func (r GatewayAppTypeListResponseZeroTrustGatewayApplication) implementsGatewayAppTypeListResponse() { } -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationType struct { +type GatewayAppTypeListResponseZeroTrustGatewayApplicationType struct { // The identifier for the type of this application. There can be many applications // with the same type. This refers to the `id` of a returned application type. ID int64 `json:"id"` @@ -96,14 +93,14 @@ type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl // A short summary of applications with this type. Description string `json:"description"` // The name of the application or application type. - Name string `json:"name"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationTypeJSON `json:"-"` + Name string `json:"name"` + JSON gatewayAppTypeListResponseZeroTrustGatewayApplicationTypeJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationTypeJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationType] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationTypeJSON struct { +// gatewayAppTypeListResponseZeroTrustGatewayApplicationTypeJSON contains the JSON +// metadata for the struct +// [GatewayAppTypeListResponseZeroTrustGatewayApplicationType] +type gatewayAppTypeListResponseZeroTrustGatewayApplicationTypeJSON struct { ID apijson.Field CreatedAt apijson.Field Description apijson.Field @@ -112,27 +109,26 @@ type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationType) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseZeroTrustGatewayApplicationType) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseZeroTrustGatewayApplicationType) implementsGatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse() { +func (r GatewayAppTypeListResponseZeroTrustGatewayApplicationType) implementsGatewayAppTypeListResponse() { } -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelope struct { - Errors []GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponse `json:"result,required,nullable"` +type GatewayAppTypeListResponseEnvelope struct { + Errors []GatewayAppTypeListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayAppTypeListResponseEnvelopeMessages `json:"messages,required"` + Result []GatewayAppTypeListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeJSON `json:"-"` + Success GatewayAppTypeListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayAppTypeListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayAppTypeListResponseEnvelopeJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelope] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeJSON struct { +// gatewayAppTypeListResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayAppTypeListResponseEnvelope] +type gatewayAppTypeListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -142,58 +138,56 @@ type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrorsJSON `json:"-"` +type GatewayAppTypeListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAppTypeListResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrors] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrorsJSON struct { +// gatewayAppTypeListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayAppTypeListResponseEnvelopeErrors] +type gatewayAppTypeListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessagesJSON `json:"-"` +type GatewayAppTypeListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAppTypeListResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessages] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessagesJSON struct { +// gatewayAppTypeListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayAppTypeListResponseEnvelopeMessages] +type gatewayAppTypeListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeSuccess bool +type GatewayAppTypeListResponseEnvelopeSuccess bool const ( - GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeSuccessTrue GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeSuccess = true + GatewayAppTypeListResponseEnvelopeSuccessTrue GatewayAppTypeListResponseEnvelopeSuccess = true ) -type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfo struct { +type GatewayAppTypeListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -201,14 +195,13 @@ type GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON gatewayAppTypeListResponseEnvelopeResultInfoJSON `json:"-"` } -// gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfo] -type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfoJSON struct { +// gatewayAppTypeListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [GatewayAppTypeListResponseEnvelopeResultInfo] +type gatewayAppTypeListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -217,6 +210,6 @@ type gatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListAppl ExtraFields map[string]apijson.Field } -func (r *GatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappingsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAppTypeListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/gatewayapptype_test.go b/gatewayapptype_test.go index 20e5228445c..6a56d9e9547 100644 --- a/gatewayapptype_test.go +++ b/gatewayapptype_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappings(t *testing.T) { +func TestGatewayAppTypeList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestGatewayAppTypeZeroTrustGatewayApplicationAndApplicationTypeMappingsList option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.AppTypes.ZeroTrustGatewayApplicationAndApplicationTypeMappingsListApplicationAndApplicationTypeMappings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Gateways.AppTypes.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewayauditsshsetting.go b/gatewayauditsshsetting.go index b3d0b49df07..53be0c00271 100644 --- a/gatewayauditsshsetting.go +++ b/gatewayauditsshsetting.go @@ -32,12 +32,12 @@ func NewGatewayAuditSSHSettingService(opts ...option.RequestOption) (r *GatewayA return } -// Updates Zero Trust Audit SSH settings. -func (r *GatewayAuditSSHSettingService) Update(ctx context.Context, accountID interface{}, body GatewayAuditSSHSettingUpdateParams, opts ...option.RequestOption) (res *GatewayAuditSSHSettingUpdateResponse, err error) { +// Get all Zero Trust Audit SSH settings for an account. +func (r *GatewayAuditSSHSettingService) Get(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayAuditSSHSettingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayAuditSSHSettingUpdateResponseEnvelope + var env GatewayAuditSSHSettingGetResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/audit_ssh_settings", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *GatewayAuditSSHSettingService) Update(ctx context.Context, accountID in return } -// Get all Zero Trust Audit SSH settings for an account. -func (r *GatewayAuditSSHSettingService) Get(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayAuditSSHSettingGetResponse, err error) { +// Updates Zero Trust Audit SSH settings. +func (r *GatewayAuditSSHSettingService) Replace(ctx context.Context, accountID interface{}, body GatewayAuditSSHSettingReplaceParams, opts ...option.RequestOption) (res *GatewayAuditSSHSettingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayAuditSSHSettingGetResponseEnvelope + var env GatewayAuditSSHSettingReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/audit_ssh_settings", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -58,19 +58,19 @@ func (r *GatewayAuditSSHSettingService) Get(ctx context.Context, accountID inter return } -type GatewayAuditSSHSettingUpdateResponse struct { +type GatewayAuditSSHSettingGetResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // SSH encryption public key PublicKey string `json:"public_key"` // Seed ID - SeedID string `json:"seed_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayAuditSSHSettingUpdateResponseJSON `json:"-"` + SeedID string `json:"seed_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayAuditSSHSettingGetResponseJSON `json:"-"` } -// gatewayAuditSSHSettingUpdateResponseJSON contains the JSON metadata for the -// struct [GatewayAuditSSHSettingUpdateResponse] -type gatewayAuditSSHSettingUpdateResponseJSON struct { +// gatewayAuditSSHSettingGetResponseJSON contains the JSON metadata for the struct +// [GatewayAuditSSHSettingGetResponse] +type gatewayAuditSSHSettingGetResponseJSON struct { CreatedAt apijson.Field PublicKey apijson.Field SeedID apijson.Field @@ -79,23 +79,23 @@ type gatewayAuditSSHSettingUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingGetResponse struct { +type GatewayAuditSSHSettingReplaceResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // SSH encryption public key PublicKey string `json:"public_key"` // Seed ID - SeedID string `json:"seed_id"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayAuditSSHSettingGetResponseJSON `json:"-"` + SeedID string `json:"seed_id"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayAuditSSHSettingReplaceResponseJSON `json:"-"` } -// gatewayAuditSSHSettingGetResponseJSON contains the JSON metadata for the struct -// [GatewayAuditSSHSettingGetResponse] -type gatewayAuditSSHSettingGetResponseJSON struct { +// gatewayAuditSSHSettingReplaceResponseJSON contains the JSON metadata for the +// struct [GatewayAuditSSHSettingReplaceResponse] +type gatewayAuditSSHSettingReplaceResponseJSON struct { CreatedAt apijson.Field PublicKey apijson.Field SeedID apijson.Field @@ -104,33 +104,22 @@ type gatewayAuditSSHSettingGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingUpdateParams struct { - // SSH encryption public key - PublicKey param.Field[string] `json:"public_key,required"` - // Seed ID - SeedID param.Field[string] `json:"seed_id"` -} - -func (r GatewayAuditSSHSettingUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type GatewayAuditSSHSettingUpdateResponseEnvelope struct { - Errors []GatewayAuditSSHSettingUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayAuditSSHSettingUpdateResponseEnvelopeMessages `json:"messages,required"` - Result GatewayAuditSSHSettingUpdateResponse `json:"result,required"` +type GatewayAuditSSHSettingGetResponseEnvelope struct { + Errors []GatewayAuditSSHSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayAuditSSHSettingGetResponseEnvelopeMessages `json:"messages,required"` + Result GatewayAuditSSHSettingGetResponse `json:"result,required"` // Whether the API call was successful - Success GatewayAuditSSHSettingUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayAuditSSHSettingUpdateResponseEnvelopeJSON `json:"-"` + Success GatewayAuditSSHSettingGetResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayAuditSSHSettingGetResponseEnvelopeJSON `json:"-"` } -// gatewayAuditSSHSettingUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [GatewayAuditSSHSettingUpdateResponseEnvelope] -type gatewayAuditSSHSettingUpdateResponseEnvelopeJSON struct { +// gatewayAuditSSHSettingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayAuditSSHSettingGetResponseEnvelope] +type gatewayAuditSSHSettingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -139,67 +128,78 @@ type gatewayAuditSSHSettingUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAuditSSHSettingUpdateResponseEnvelopeErrorsJSON `json:"-"` +type GatewayAuditSSHSettingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayAuditSSHSettingUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [GatewayAuditSSHSettingUpdateResponseEnvelopeErrors] -type gatewayAuditSSHSettingUpdateResponseEnvelopeErrorsJSON struct { +// gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [GatewayAuditSSHSettingGetResponseEnvelopeErrors] +type gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAuditSSHSettingUpdateResponseEnvelopeMessagesJSON `json:"-"` +type GatewayAuditSSHSettingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayAuditSSHSettingUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [GatewayAuditSSHSettingUpdateResponseEnvelopeMessages] -type gatewayAuditSSHSettingUpdateResponseEnvelopeMessagesJSON struct { +// gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [GatewayAuditSSHSettingGetResponseEnvelopeMessages] +type gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayAuditSSHSettingUpdateResponseEnvelopeSuccess bool +type GatewayAuditSSHSettingGetResponseEnvelopeSuccess bool const ( - GatewayAuditSSHSettingUpdateResponseEnvelopeSuccessTrue GatewayAuditSSHSettingUpdateResponseEnvelopeSuccess = true + GatewayAuditSSHSettingGetResponseEnvelopeSuccessTrue GatewayAuditSSHSettingGetResponseEnvelopeSuccess = true ) -type GatewayAuditSSHSettingGetResponseEnvelope struct { - Errors []GatewayAuditSSHSettingGetResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayAuditSSHSettingGetResponseEnvelopeMessages `json:"messages,required"` - Result GatewayAuditSSHSettingGetResponse `json:"result,required"` +type GatewayAuditSSHSettingReplaceParams struct { + // SSH encryption public key + PublicKey param.Field[string] `json:"public_key,required"` + // Seed ID + SeedID param.Field[string] `json:"seed_id"` +} + +func (r GatewayAuditSSHSettingReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type GatewayAuditSSHSettingReplaceResponseEnvelope struct { + Errors []GatewayAuditSSHSettingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayAuditSSHSettingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result GatewayAuditSSHSettingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayAuditSSHSettingGetResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayAuditSSHSettingGetResponseEnvelopeJSON `json:"-"` + Success GatewayAuditSSHSettingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayAuditSSHSettingReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayAuditSSHSettingGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [GatewayAuditSSHSettingGetResponseEnvelope] -type gatewayAuditSSHSettingGetResponseEnvelopeJSON struct { +// gatewayAuditSSHSettingReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [GatewayAuditSSHSettingReplaceResponseEnvelope] +type gatewayAuditSSHSettingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -208,51 +208,51 @@ type gatewayAuditSSHSettingGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON `json:"-"` +type GatewayAuditSSHSettingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAuditSSHSettingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [GatewayAuditSSHSettingGetResponseEnvelopeErrors] -type gatewayAuditSSHSettingGetResponseEnvelopeErrorsJSON struct { +// gatewayAuditSSHSettingReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [GatewayAuditSSHSettingReplaceResponseEnvelopeErrors] +type gatewayAuditSSHSettingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayAuditSSHSettingGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON `json:"-"` +type GatewayAuditSSHSettingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayAuditSSHSettingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [GatewayAuditSSHSettingGetResponseEnvelopeMessages] -type gatewayAuditSSHSettingGetResponseEnvelopeMessagesJSON struct { +// gatewayAuditSSHSettingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [GatewayAuditSSHSettingReplaceResponseEnvelopeMessages] +type gatewayAuditSSHSettingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayAuditSSHSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayAuditSSHSettingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayAuditSSHSettingGetResponseEnvelopeSuccess bool +type GatewayAuditSSHSettingReplaceResponseEnvelopeSuccess bool const ( - GatewayAuditSSHSettingGetResponseEnvelopeSuccessTrue GatewayAuditSSHSettingGetResponseEnvelopeSuccess = true + GatewayAuditSSHSettingReplaceResponseEnvelopeSuccessTrue GatewayAuditSSHSettingReplaceResponseEnvelopeSuccess = true ) diff --git a/gatewayauditsshsetting_test.go b/gatewayauditsshsetting_test.go index a13eb359d75..a3cf3eed472 100644 --- a/gatewayauditsshsetting_test.go +++ b/gatewayauditsshsetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayAuditSSHSettingUpdateWithOptionalParams(t *testing.T) { +func TestGatewayAuditSSHSettingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,7 @@ func TestGatewayAuditSSHSettingUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateway.AuditSSHSettings.Update( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayAuditSSHSettingUpdateParams{ - PublicKey: cloudflare.F("1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA="), - SeedID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), - }, - ) + _, err := client.Gateways.AuditSSHSettings.Get(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -46,7 +39,7 @@ func TestGatewayAuditSSHSettingUpdateWithOptionalParams(t *testing.T) { } } -func TestGatewayAuditSSHSettingGet(t *testing.T) { +func TestGatewayAuditSSHSettingReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,7 +55,14 @@ func TestGatewayAuditSSHSettingGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateway.AuditSSHSettings.Get(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.AuditSSHSettings.Replace( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + cloudflare.GatewayAuditSSHSettingReplaceParams{ + PublicKey: cloudflare.F("1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA="), + SeedID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewaycategory.go b/gatewaycategory.go index 1e666af3de6..e74220554af 100644 --- a/gatewaycategory.go +++ b/gatewaycategory.go @@ -31,9 +31,9 @@ func NewGatewayCategoryService(opts ...option.RequestOption) (r *GatewayCategory } // Fetches a list of all categories. -func (r *GatewayCategoryService) ZeroTrustGatewayCategoriesListCategories(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse, err error) { +func (r *GatewayCategoryService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]GatewayCategoryListResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelope + var env GatewayCategoryListResponseEnvelope path := fmt.Sprintf("accounts/%s/gateway/categories", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,7 +43,7 @@ func (r *GatewayCategoryService) ZeroTrustGatewayCategoriesListCategories(ctx co return } -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse struct { +type GatewayCategoryListResponse struct { // The identifier for this category. There is only one category per ID. ID int64 `json:"id"` // True if the category is in beta and subject to change. @@ -52,20 +52,19 @@ type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse struct { // `blocked` categories are blocked unconditionally for all accounts. // `removalPending` categories can be removed from policies but not added. // `noBlock` categories cannot be blocked. - Class GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass `json:"class"` + Class GatewayCategoryListResponseClass `json:"class"` // A short summary of domains in the category. Description string `json:"description"` // The name of the category. Name string `json:"name"` // All subcategories for this category. - Subcategories []GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategory `json:"subcategories"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseJSON `json:"-"` + Subcategories []GatewayCategoryListResponseSubcategory `json:"subcategories"` + JSON gatewayCategoryListResponseJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseJSON contains the -// JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseJSON struct { +// gatewayCategoryListResponseJSON contains the JSON metadata for the struct +// [GatewayCategoryListResponse] +type gatewayCategoryListResponseJSON struct { ID apijson.Field Beta apijson.Field Class apijson.Field @@ -76,7 +75,7 @@ type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -84,17 +83,17 @@ func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse) Unmars // `blocked` categories are blocked unconditionally for all accounts. // `removalPending` categories can be removed from policies but not added. // `noBlock` categories cannot be blocked. -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass string +type GatewayCategoryListResponseClass string const ( - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClassFree GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass = "free" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClassPremium GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass = "premium" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClassBlocked GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass = "blocked" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClassRemovalPending GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass = "removalPending" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClassNoBlock GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseClass = "noBlock" + GatewayCategoryListResponseClassFree GatewayCategoryListResponseClass = "free" + GatewayCategoryListResponseClassPremium GatewayCategoryListResponseClass = "premium" + GatewayCategoryListResponseClassBlocked GatewayCategoryListResponseClass = "blocked" + GatewayCategoryListResponseClassRemovalPending GatewayCategoryListResponseClass = "removalPending" + GatewayCategoryListResponseClassNoBlock GatewayCategoryListResponseClass = "noBlock" ) -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategory struct { +type GatewayCategoryListResponseSubcategory struct { // The identifier for this category. There is only one category per ID. ID int64 `json:"id"` // True if the category is in beta and subject to change. @@ -103,18 +102,17 @@ type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategory // `blocked` categories are blocked unconditionally for all accounts. // `removalPending` categories can be removed from policies but not added. // `noBlock` categories cannot be blocked. - Class GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass `json:"class"` + Class GatewayCategoryListResponseSubcategoriesClass `json:"class"` // A short summary of domains in the category. Description string `json:"description"` // The name of the category. - Name string `json:"name"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoryJSON `json:"-"` + Name string `json:"name"` + JSON gatewayCategoryListResponseSubcategoryJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoryJSON -// contains the JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategory] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoryJSON struct { +// gatewayCategoryListResponseSubcategoryJSON contains the JSON metadata for the +// struct [GatewayCategoryListResponseSubcategory] +type gatewayCategoryListResponseSubcategoryJSON struct { ID apijson.Field Beta apijson.Field Class apijson.Field @@ -124,7 +122,7 @@ type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoryJ ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategory) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponseSubcategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -132,30 +130,29 @@ func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcateg // `blocked` categories are blocked unconditionally for all accounts. // `removalPending` categories can be removed from policies but not added. // `noBlock` categories cannot be blocked. -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass string +type GatewayCategoryListResponseSubcategoriesClass string const ( - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClassFree GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass = "free" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClassPremium GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass = "premium" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClassBlocked GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass = "blocked" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClassRemovalPending GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass = "removalPending" - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClassNoBlock GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseSubcategoriesClass = "noBlock" + GatewayCategoryListResponseSubcategoriesClassFree GatewayCategoryListResponseSubcategoriesClass = "free" + GatewayCategoryListResponseSubcategoriesClassPremium GatewayCategoryListResponseSubcategoriesClass = "premium" + GatewayCategoryListResponseSubcategoriesClassBlocked GatewayCategoryListResponseSubcategoriesClass = "blocked" + GatewayCategoryListResponseSubcategoriesClassRemovalPending GatewayCategoryListResponseSubcategoriesClass = "removalPending" + GatewayCategoryListResponseSubcategoriesClassNoBlock GatewayCategoryListResponseSubcategoriesClass = "noBlock" ) -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelope struct { - Errors []GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponse `json:"result,required,nullable"` +type GatewayCategoryListResponseEnvelope struct { + Errors []GatewayCategoryListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayCategoryListResponseEnvelopeMessages `json:"messages,required"` + Result []GatewayCategoryListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeJSON `json:"-"` + Success GatewayCategoryListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayCategoryListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayCategoryListResponseEnvelopeJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelope] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeJSON struct { +// gatewayCategoryListResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayCategoryListResponseEnvelope] +type gatewayCategoryListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -165,58 +162,56 @@ type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrorsJSON `json:"-"` +type GatewayCategoryListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayCategoryListResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrors] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrorsJSON struct { +// gatewayCategoryListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayCategoryListResponseEnvelopeErrors] +type gatewayCategoryListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessagesJSON `json:"-"` +type GatewayCategoryListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayCategoryListResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessages] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessagesJSON struct { +// gatewayCategoryListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayCategoryListResponseEnvelopeMessages] +type gatewayCategoryListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeSuccess bool +type GatewayCategoryListResponseEnvelopeSuccess bool const ( - GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeSuccessTrue GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeSuccess = true + GatewayCategoryListResponseEnvelopeSuccessTrue GatewayCategoryListResponseEnvelopeSuccess = true ) -type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfo struct { +type GatewayCategoryListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -224,14 +219,13 @@ type GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResu // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON gatewayCategoryListResponseEnvelopeResultInfoJSON `json:"-"` } -// gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfo] -type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfoJSON struct { +// gatewayCategoryListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [GatewayCategoryListResponseEnvelopeResultInfo] +type gatewayCategoryListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -240,6 +234,6 @@ type gatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResu ExtraFields map[string]apijson.Field } -func (r *GatewayCategoryZeroTrustGatewayCategoriesListCategoriesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayCategoryListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/gatewaycategory_test.go b/gatewaycategory_test.go index a7f0274404c..e233030478a 100644 --- a/gatewaycategory_test.go +++ b/gatewaycategory_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayCategoryZeroTrustGatewayCategoriesListCategories(t *testing.T) { +func TestGatewayCategoryList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestGatewayCategoryZeroTrustGatewayCategoriesListCategories(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Categories.ZeroTrustGatewayCategoriesListCategories(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Gateways.Categories.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewayconfiguration.go b/gatewayconfiguration.go index 674508a818b..a35c74f20e5 100644 --- a/gatewayconfiguration.go +++ b/gatewayconfiguration.go @@ -32,12 +32,16 @@ func NewGatewayConfigurationService(opts ...option.RequestOption) (r *GatewayCon return } -// Fetches the current Zero Trust account configuration. -func (r *GatewayConfigurationService) ZeroTrustAccountsGetZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse, err error) { +// Patches the current Zero Trust account configuration. This endpoint can update a +// single subcollection of settings such as `antivirus`, `tls_decrypt`, +// `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or +// `custom_certificate`, without updating the entire configuration object. Returns +// an error if any collection of settings is not properly configured. +func (r *GatewayConfigurationService) Update(ctx context.Context, accountID interface{}, body GatewayConfigurationUpdateParams, opts ...option.RequestOption) (res *GatewayConfigurationUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelope + var env GatewayConfigurationUpdateResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/configuration", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -45,16 +49,12 @@ func (r *GatewayConfigurationService) ZeroTrustAccountsGetZeroTrustAccountConfig return } -// Patches the current Zero Trust account configuration. This endpoint can update a -// single subcollection of settings such as `antivirus`, `tls_decrypt`, -// `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or -// `custom_certificate`, without updating the entire configuration object. Returns -// an error if any collection of settings is not properly configured. -func (r *GatewayConfigurationService) ZeroTrustAccountsPatchZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}, body GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParams, opts ...option.RequestOption) (res *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse, err error) { +// Fetches the current Zero Trust account configuration. +func (r *GatewayConfigurationService) Get(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayConfigurationGetResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelope + var env GatewayConfigurationGetResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/configuration", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -63,9 +63,9 @@ func (r *GatewayConfigurationService) ZeroTrustAccountsPatchZeroTrustAccountConf } // Updates the current Zero Trust account configuration. -func (r *GatewayConfigurationService) ZeroTrustAccountsUpdateZeroTrustAccountConfiguration(ctx context.Context, accountID interface{}, body GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParams, opts ...option.RequestOption) (res *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse, err error) { +func (r *GatewayConfigurationService) Replace(ctx context.Context, accountID interface{}, body GatewayConfigurationReplaceParams, opts ...option.RequestOption) (res *GatewayConfigurationReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelope + var env GatewayConfigurationReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/configuration", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -76,18 +76,17 @@ func (r *GatewayConfigurationService) ZeroTrustAccountsUpdateZeroTrustAccountCon } // account settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse struct { +type GatewayConfigurationUpdateResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // account settings. - Settings GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettings `json:"settings"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseJSON `json:"-"` + Settings GatewayConfigurationUpdateResponseSettings `json:"settings"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationUpdateResponseJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseJSON struct { +// gatewayConfigurationUpdateResponseJSON contains the JSON metadata for the struct +// [GatewayConfigurationUpdateResponse] +type gatewayConfigurationUpdateResponseJSON struct { CreatedAt apijson.Field Settings apijson.Field UpdatedAt apijson.Field @@ -95,39 +94,38 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // account settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettings struct { +type GatewayConfigurationUpdateResponseSettings struct { // Activity log settings. - ActivityLog GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLog `json:"activity_log"` + ActivityLog GatewayConfigurationUpdateResponseSettingsActivityLog `json:"activity_log"` // Anti-virus settings. - Antivirus GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirus `json:"antivirus"` + Antivirus GatewayConfigurationUpdateResponseSettingsAntivirus `json:"antivirus"` // Block page layout settings. - BlockPage GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPage `json:"block_page"` + BlockPage GatewayConfigurationUpdateResponseSettingsBlockPage `json:"block_page"` // DLP body scanning settings. - BodyScanning GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanning `json:"body_scanning"` + BodyScanning GatewayConfigurationUpdateResponseSettingsBodyScanning `json:"body_scanning"` // Browser isolation settings. - BrowserIsolation GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolation `json:"browser_isolation"` + BrowserIsolation GatewayConfigurationUpdateResponseSettingsBrowserIsolation `json:"browser_isolation"` // Custom certificate settings for BYO-PKI. - CustomCertificate GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificate `json:"custom_certificate"` + CustomCertificate GatewayConfigurationUpdateResponseSettingsCustomCertificate `json:"custom_certificate"` // Extended e-mail matching settings. - ExtendedEmailMatching GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` + ExtendedEmailMatching GatewayConfigurationUpdateResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` // FIPS settings. - Fips GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFips `json:"fips"` + Fips GatewayConfigurationUpdateResponseSettingsFips `json:"fips"` // Protocol Detection settings. - ProtocolDetection GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetection `json:"protocol_detection"` + ProtocolDetection GatewayConfigurationUpdateResponseSettingsProtocolDetection `json:"protocol_detection"` // TLS interception settings. - TLSDecrypt GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecrypt `json:"tls_decrypt"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsJSON `json:"-"` + TLSDecrypt GatewayConfigurationUpdateResponseSettingsTLSDecrypt `json:"tls_decrypt"` + JSON gatewayConfigurationUpdateResponseSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettings] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsJSON struct { +// gatewayConfigurationUpdateResponseSettingsJSON contains the JSON metadata for +// the struct [GatewayConfigurationUpdateResponseSettings] +type gatewayConfigurationUpdateResponseSettingsJSON struct { ActivityLog apijson.Field Antivirus apijson.Field BlockPage apijson.Field @@ -142,32 +140,31 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Activity log settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLog struct { +type GatewayConfigurationUpdateResponseSettingsActivityLog struct { // Enable activity logging. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationUpdateResponseSettingsActivityLogJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLogJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLog] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLogJSON struct { +// gatewayConfigurationUpdateResponseSettingsActivityLogJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseSettingsActivityLog] +type gatewayConfigurationUpdateResponseSettingsActivityLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Anti-virus settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirus struct { +type GatewayConfigurationUpdateResponseSettingsAntivirus struct { // Enable anti-virus scanning on downloads. EnabledDownloadPhase bool `json:"enabled_download_phase"` // Enable anti-virus scanning on uploads. @@ -176,14 +173,13 @@ type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon FailClosed bool `json:"fail_closed"` // Configure a message to display on the user's device when an antivirus search is // performed. - NotificationSettings GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusJSON `json:"-"` + NotificationSettings GatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` + JSON gatewayConfigurationUpdateResponseSettingsAntivirusJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirus] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusJSON struct { +// gatewayConfigurationUpdateResponseSettingsAntivirusJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseSettingsAntivirus] +type gatewayConfigurationUpdateResponseSettingsAntivirusJSON struct { EnabledDownloadPhase apijson.Field EnabledUploadPhase apijson.Field FailClosed apijson.Field @@ -192,27 +188,27 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a message to display on the user's device when an antivirus search is // performed. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings struct { +type GatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON +// gatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettingsJSON // contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON struct { +// [GatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettings] +type gatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -220,12 +216,12 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Block page layout settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPage struct { +type GatewayConfigurationUpdateResponseSettingsBlockPage struct { // Block page background color in #rrggbb format. BackgroundColor string `json:"background_color"` // Enable only cipher suites and TLS versions compliant with FIPS 140-2. @@ -243,14 +239,13 @@ type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon // Block page title. Name string `json:"name"` // Suppress detailed info at the bottom of the block page. - SuppressFooter bool `json:"suppress_footer"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPageJSON `json:"-"` + SuppressFooter bool `json:"suppress_footer"` + JSON gatewayConfigurationUpdateResponseSettingsBlockPageJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPageJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPage] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPageJSON struct { +// gatewayConfigurationUpdateResponseSettingsBlockPageJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseSettingsBlockPage] +type gatewayConfigurationUpdateResponseSettingsBlockPageJSON struct { BackgroundColor apijson.Field Enabled apijson.Field FooterText apijson.Field @@ -264,69 +259,68 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // DLP body scanning settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanning struct { +type GatewayConfigurationUpdateResponseSettingsBodyScanning struct { // Set the inspection mode to either `deep` or `shallow`. - InspectionMode string `json:"inspection_mode"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON `json:"-"` + InspectionMode string `json:"inspection_mode"` + JSON gatewayConfigurationUpdateResponseSettingsBodyScanningJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanning] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON struct { +// gatewayConfigurationUpdateResponseSettingsBodyScanningJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseSettingsBodyScanning] +type gatewayConfigurationUpdateResponseSettingsBodyScanningJSON struct { InspectionMode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Browser isolation settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolation struct { +type GatewayConfigurationUpdateResponseSettingsBrowserIsolation struct { // Enable non-identity onramp support for Browser Isolation. NonIdentityEnabled bool `json:"non_identity_enabled"` // Enable Clientless Browser Isolation. - URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON `json:"-"` + URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` + JSON gatewayConfigurationUpdateResponseSettingsBrowserIsolationJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolation] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON struct { +// gatewayConfigurationUpdateResponseSettingsBrowserIsolationJSON contains the JSON +// metadata for the struct +// [GatewayConfigurationUpdateResponseSettingsBrowserIsolation] +type gatewayConfigurationUpdateResponseSettingsBrowserIsolationJSON struct { NonIdentityEnabled apijson.Field URLBrowserIsolationEnabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Custom certificate settings for BYO-PKI. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificate struct { +type GatewayConfigurationUpdateResponseSettingsCustomCertificate struct { // Enable use of custom certificate authority for signing Gateway traffic. Enabled bool `json:"enabled,required"` // UUID of certificate (ID from MTLS certificate store). ID string `json:"id"` // Certificate status (internal). - BindingStatus string `json:"binding_status"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON `json:"-"` + BindingStatus string `json:"binding_status"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationUpdateResponseSettingsCustomCertificateJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificate] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON struct { +// gatewayConfigurationUpdateResponseSettingsCustomCertificateJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationUpdateResponseSettingsCustomCertificate] +type gatewayConfigurationUpdateResponseSettingsCustomCertificateJSON struct { Enabled apijson.Field ID apijson.Field BindingStatus apijson.Field @@ -335,104 +329,101 @@ type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationRespon ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Extended e-mail matching settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching struct { +type GatewayConfigurationUpdateResponseSettingsExtendedEmailMatching struct { // Enable matching all variants of user emails (with + or . modifiers) used as // criteria in Firewall policies. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationUpdateResponseSettingsExtendedEmailMatchingJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON struct { +// gatewayConfigurationUpdateResponseSettingsExtendedEmailMatchingJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationUpdateResponseSettingsExtendedEmailMatching] +type gatewayConfigurationUpdateResponseSettingsExtendedEmailMatchingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // FIPS settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFips struct { +type GatewayConfigurationUpdateResponseSettingsFips struct { // Enable only cipher suites and TLS versions compliant with FIPS 140-2. - TLS bool `json:"tls"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFipsJSON `json:"-"` + TLS bool `json:"tls"` + JSON gatewayConfigurationUpdateResponseSettingsFipsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFipsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFips] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFipsJSON struct { +// gatewayConfigurationUpdateResponseSettingsFipsJSON contains the JSON metadata +// for the struct [GatewayConfigurationUpdateResponseSettingsFips] +type gatewayConfigurationUpdateResponseSettingsFipsJSON struct { TLS apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Protocol Detection settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetection struct { +type GatewayConfigurationUpdateResponseSettingsProtocolDetection struct { // Enable detecting protocol on initial bytes of client traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationUpdateResponseSettingsProtocolDetectionJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetection] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON struct { +// gatewayConfigurationUpdateResponseSettingsProtocolDetectionJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationUpdateResponseSettingsProtocolDetection] +type gatewayConfigurationUpdateResponseSettingsProtocolDetectionJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // TLS interception settings. -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecrypt struct { +type GatewayConfigurationUpdateResponseSettingsTLSDecrypt struct { // Enable inspecting encrypted HTTP traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationUpdateResponseSettingsTLSDecryptJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecrypt] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON struct { +// gatewayConfigurationUpdateResponseSettingsTLSDecryptJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseSettingsTLSDecrypt] +type gatewayConfigurationUpdateResponseSettingsTLSDecryptJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // account settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse struct { +type GatewayConfigurationGetResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // account settings. - Settings GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettings `json:"settings"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseJSON `json:"-"` + Settings GatewayConfigurationGetResponseSettings `json:"settings"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationGetResponseJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseJSON struct { +// gatewayConfigurationGetResponseJSON contains the JSON metadata for the struct +// [GatewayConfigurationGetResponse] +type gatewayConfigurationGetResponseJSON struct { CreatedAt apijson.Field Settings apijson.Field UpdatedAt apijson.Field @@ -440,39 +431,38 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // account settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettings struct { +type GatewayConfigurationGetResponseSettings struct { // Activity log settings. - ActivityLog GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLog `json:"activity_log"` + ActivityLog GatewayConfigurationGetResponseSettingsActivityLog `json:"activity_log"` // Anti-virus settings. - Antivirus GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirus `json:"antivirus"` + Antivirus GatewayConfigurationGetResponseSettingsAntivirus `json:"antivirus"` // Block page layout settings. - BlockPage GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPage `json:"block_page"` + BlockPage GatewayConfigurationGetResponseSettingsBlockPage `json:"block_page"` // DLP body scanning settings. - BodyScanning GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanning `json:"body_scanning"` + BodyScanning GatewayConfigurationGetResponseSettingsBodyScanning `json:"body_scanning"` // Browser isolation settings. - BrowserIsolation GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolation `json:"browser_isolation"` + BrowserIsolation GatewayConfigurationGetResponseSettingsBrowserIsolation `json:"browser_isolation"` // Custom certificate settings for BYO-PKI. - CustomCertificate GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificate `json:"custom_certificate"` + CustomCertificate GatewayConfigurationGetResponseSettingsCustomCertificate `json:"custom_certificate"` // Extended e-mail matching settings. - ExtendedEmailMatching GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` + ExtendedEmailMatching GatewayConfigurationGetResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` // FIPS settings. - Fips GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFips `json:"fips"` + Fips GatewayConfigurationGetResponseSettingsFips `json:"fips"` // Protocol Detection settings. - ProtocolDetection GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetection `json:"protocol_detection"` + ProtocolDetection GatewayConfigurationGetResponseSettingsProtocolDetection `json:"protocol_detection"` // TLS interception settings. - TLSDecrypt GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecrypt `json:"tls_decrypt"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsJSON `json:"-"` + TLSDecrypt GatewayConfigurationGetResponseSettingsTLSDecrypt `json:"tls_decrypt"` + JSON gatewayConfigurationGetResponseSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettings] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsJSON struct { +// gatewayConfigurationGetResponseSettingsJSON contains the JSON metadata for the +// struct [GatewayConfigurationGetResponseSettings] +type gatewayConfigurationGetResponseSettingsJSON struct { ActivityLog apijson.Field Antivirus apijson.Field BlockPage apijson.Field @@ -487,32 +477,31 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Activity log settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLog struct { +type GatewayConfigurationGetResponseSettingsActivityLog struct { // Enable activity logging. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationGetResponseSettingsActivityLogJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLogJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLog] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLogJSON struct { +// gatewayConfigurationGetResponseSettingsActivityLogJSON contains the JSON +// metadata for the struct [GatewayConfigurationGetResponseSettingsActivityLog] +type gatewayConfigurationGetResponseSettingsActivityLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Anti-virus settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirus struct { +type GatewayConfigurationGetResponseSettingsAntivirus struct { // Enable anti-virus scanning on downloads. EnabledDownloadPhase bool `json:"enabled_download_phase"` // Enable anti-virus scanning on uploads. @@ -521,14 +510,13 @@ type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp FailClosed bool `json:"fail_closed"` // Configure a message to display on the user's device when an antivirus search is // performed. - NotificationSettings GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusJSON `json:"-"` + NotificationSettings GatewayConfigurationGetResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` + JSON gatewayConfigurationGetResponseSettingsAntivirusJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirus] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusJSON struct { +// gatewayConfigurationGetResponseSettingsAntivirusJSON contains the JSON metadata +// for the struct [GatewayConfigurationGetResponseSettingsAntivirus] +type gatewayConfigurationGetResponseSettingsAntivirusJSON struct { EnabledDownloadPhase apijson.Field EnabledUploadPhase apijson.Field FailClosed apijson.Field @@ -537,27 +525,27 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a message to display on the user's device when an antivirus search is // performed. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings struct { +type GatewayConfigurationGetResponseSettingsAntivirusNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayConfigurationGetResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON +// gatewayConfigurationGetResponseSettingsAntivirusNotificationSettingsJSON // contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON struct { +// [GatewayConfigurationGetResponseSettingsAntivirusNotificationSettings] +type gatewayConfigurationGetResponseSettingsAntivirusNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -565,12 +553,12 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Block page layout settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPage struct { +type GatewayConfigurationGetResponseSettingsBlockPage struct { // Block page background color in #rrggbb format. BackgroundColor string `json:"background_color"` // Enable only cipher suites and TLS versions compliant with FIPS 140-2. @@ -588,14 +576,13 @@ type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp // Block page title. Name string `json:"name"` // Suppress detailed info at the bottom of the block page. - SuppressFooter bool `json:"suppress_footer"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPageJSON `json:"-"` + SuppressFooter bool `json:"suppress_footer"` + JSON gatewayConfigurationGetResponseSettingsBlockPageJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPageJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPage] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPageJSON struct { +// gatewayConfigurationGetResponseSettingsBlockPageJSON contains the JSON metadata +// for the struct [GatewayConfigurationGetResponseSettingsBlockPage] +type gatewayConfigurationGetResponseSettingsBlockPageJSON struct { BackgroundColor apijson.Field Enabled apijson.Field FooterText apijson.Field @@ -609,69 +596,68 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // DLP body scanning settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanning struct { +type GatewayConfigurationGetResponseSettingsBodyScanning struct { // Set the inspection mode to either `deep` or `shallow`. - InspectionMode string `json:"inspection_mode"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON `json:"-"` + InspectionMode string `json:"inspection_mode"` + JSON gatewayConfigurationGetResponseSettingsBodyScanningJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanning] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON struct { +// gatewayConfigurationGetResponseSettingsBodyScanningJSON contains the JSON +// metadata for the struct [GatewayConfigurationGetResponseSettingsBodyScanning] +type gatewayConfigurationGetResponseSettingsBodyScanningJSON struct { InspectionMode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Browser isolation settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolation struct { +type GatewayConfigurationGetResponseSettingsBrowserIsolation struct { // Enable non-identity onramp support for Browser Isolation. NonIdentityEnabled bool `json:"non_identity_enabled"` // Enable Clientless Browser Isolation. - URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON `json:"-"` + URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` + JSON gatewayConfigurationGetResponseSettingsBrowserIsolationJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolation] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON struct { +// gatewayConfigurationGetResponseSettingsBrowserIsolationJSON contains the JSON +// metadata for the struct +// [GatewayConfigurationGetResponseSettingsBrowserIsolation] +type gatewayConfigurationGetResponseSettingsBrowserIsolationJSON struct { NonIdentityEnabled apijson.Field URLBrowserIsolationEnabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Custom certificate settings for BYO-PKI. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificate struct { +type GatewayConfigurationGetResponseSettingsCustomCertificate struct { // Enable use of custom certificate authority for signing Gateway traffic. Enabled bool `json:"enabled,required"` // UUID of certificate (ID from MTLS certificate store). ID string `json:"id"` // Certificate status (internal). - BindingStatus string `json:"binding_status"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON `json:"-"` + BindingStatus string `json:"binding_status"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationGetResponseSettingsCustomCertificateJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificate] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON struct { +// gatewayConfigurationGetResponseSettingsCustomCertificateJSON contains the JSON +// metadata for the struct +// [GatewayConfigurationGetResponseSettingsCustomCertificate] +type gatewayConfigurationGetResponseSettingsCustomCertificateJSON struct { Enabled apijson.Field ID apijson.Field BindingStatus apijson.Field @@ -680,104 +666,101 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Extended e-mail matching settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching struct { +type GatewayConfigurationGetResponseSettingsExtendedEmailMatching struct { // Enable matching all variants of user emails (with + or . modifiers) used as // criteria in Firewall policies. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationGetResponseSettingsExtendedEmailMatchingJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON struct { +// gatewayConfigurationGetResponseSettingsExtendedEmailMatchingJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationGetResponseSettingsExtendedEmailMatching] +type gatewayConfigurationGetResponseSettingsExtendedEmailMatchingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // FIPS settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFips struct { +type GatewayConfigurationGetResponseSettingsFips struct { // Enable only cipher suites and TLS versions compliant with FIPS 140-2. - TLS bool `json:"tls"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFipsJSON `json:"-"` + TLS bool `json:"tls"` + JSON gatewayConfigurationGetResponseSettingsFipsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFipsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFips] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFipsJSON struct { +// gatewayConfigurationGetResponseSettingsFipsJSON contains the JSON metadata for +// the struct [GatewayConfigurationGetResponseSettingsFips] +type gatewayConfigurationGetResponseSettingsFipsJSON struct { TLS apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Protocol Detection settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetection struct { +type GatewayConfigurationGetResponseSettingsProtocolDetection struct { // Enable detecting protocol on initial bytes of client traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationGetResponseSettingsProtocolDetectionJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetection] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON struct { +// gatewayConfigurationGetResponseSettingsProtocolDetectionJSON contains the JSON +// metadata for the struct +// [GatewayConfigurationGetResponseSettingsProtocolDetection] +type gatewayConfigurationGetResponseSettingsProtocolDetectionJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // TLS interception settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecrypt struct { +type GatewayConfigurationGetResponseSettingsTLSDecrypt struct { // Enable inspecting encrypted HTTP traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationGetResponseSettingsTLSDecryptJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecrypt] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON struct { +// gatewayConfigurationGetResponseSettingsTLSDecryptJSON contains the JSON metadata +// for the struct [GatewayConfigurationGetResponseSettingsTLSDecrypt] +type gatewayConfigurationGetResponseSettingsTLSDecryptJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // account settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse struct { +type GatewayConfigurationReplaceResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // account settings. - Settings GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettings `json:"settings"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseJSON `json:"-"` + Settings GatewayConfigurationReplaceResponseSettings `json:"settings"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationReplaceResponseJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseJSON struct { +// gatewayConfigurationReplaceResponseJSON contains the JSON metadata for the +// struct [GatewayConfigurationReplaceResponse] +type gatewayConfigurationReplaceResponseJSON struct { CreatedAt apijson.Field Settings apijson.Field UpdatedAt apijson.Field @@ -785,39 +768,38 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // account settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettings struct { +type GatewayConfigurationReplaceResponseSettings struct { // Activity log settings. - ActivityLog GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLog `json:"activity_log"` + ActivityLog GatewayConfigurationReplaceResponseSettingsActivityLog `json:"activity_log"` // Anti-virus settings. - Antivirus GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirus `json:"antivirus"` + Antivirus GatewayConfigurationReplaceResponseSettingsAntivirus `json:"antivirus"` // Block page layout settings. - BlockPage GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPage `json:"block_page"` + BlockPage GatewayConfigurationReplaceResponseSettingsBlockPage `json:"block_page"` // DLP body scanning settings. - BodyScanning GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanning `json:"body_scanning"` + BodyScanning GatewayConfigurationReplaceResponseSettingsBodyScanning `json:"body_scanning"` // Browser isolation settings. - BrowserIsolation GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolation `json:"browser_isolation"` + BrowserIsolation GatewayConfigurationReplaceResponseSettingsBrowserIsolation `json:"browser_isolation"` // Custom certificate settings for BYO-PKI. - CustomCertificate GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificate `json:"custom_certificate"` + CustomCertificate GatewayConfigurationReplaceResponseSettingsCustomCertificate `json:"custom_certificate"` // Extended e-mail matching settings. - ExtendedEmailMatching GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` + ExtendedEmailMatching GatewayConfigurationReplaceResponseSettingsExtendedEmailMatching `json:"extended_email_matching"` // FIPS settings. - Fips GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFips `json:"fips"` + Fips GatewayConfigurationReplaceResponseSettingsFips `json:"fips"` // Protocol Detection settings. - ProtocolDetection GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetection `json:"protocol_detection"` + ProtocolDetection GatewayConfigurationReplaceResponseSettingsProtocolDetection `json:"protocol_detection"` // TLS interception settings. - TLSDecrypt GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecrypt `json:"tls_decrypt"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsJSON `json:"-"` + TLSDecrypt GatewayConfigurationReplaceResponseSettingsTLSDecrypt `json:"tls_decrypt"` + JSON gatewayConfigurationReplaceResponseSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettings] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsJSON struct { +// gatewayConfigurationReplaceResponseSettingsJSON contains the JSON metadata for +// the struct [GatewayConfigurationReplaceResponseSettings] +type gatewayConfigurationReplaceResponseSettingsJSON struct { ActivityLog apijson.Field Antivirus apijson.Field BlockPage apijson.Field @@ -832,32 +814,31 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Activity log settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLog struct { +type GatewayConfigurationReplaceResponseSettingsActivityLog struct { // Enable activity logging. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationReplaceResponseSettingsActivityLogJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLogJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLog] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLogJSON struct { +// gatewayConfigurationReplaceResponseSettingsActivityLogJSON contains the JSON +// metadata for the struct [GatewayConfigurationReplaceResponseSettingsActivityLog] +type gatewayConfigurationReplaceResponseSettingsActivityLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsActivityLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Anti-virus settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirus struct { +type GatewayConfigurationReplaceResponseSettingsAntivirus struct { // Enable anti-virus scanning on downloads. EnabledDownloadPhase bool `json:"enabled_download_phase"` // Enable anti-virus scanning on uploads. @@ -866,14 +847,13 @@ type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes FailClosed bool `json:"fail_closed"` // Configure a message to display on the user's device when an antivirus search is // performed. - NotificationSettings GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusJSON `json:"-"` + NotificationSettings GatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettings `json:"notification_settings"` + JSON gatewayConfigurationReplaceResponseSettingsAntivirusJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirus] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusJSON struct { +// gatewayConfigurationReplaceResponseSettingsAntivirusJSON contains the JSON +// metadata for the struct [GatewayConfigurationReplaceResponseSettingsAntivirus] +type gatewayConfigurationReplaceResponseSettingsAntivirusJSON struct { EnabledDownloadPhase apijson.Field EnabledUploadPhase apijson.Field FailClosed apijson.Field @@ -882,27 +862,27 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsAntivirus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a message to display on the user's device when an antivirus search is // performed. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings struct { +type GatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettingsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON +// gatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettingsJSON // contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettingsJSON struct { +// [GatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettings] +type gatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -910,12 +890,12 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsAntivirusNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Block page layout settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPage struct { +type GatewayConfigurationReplaceResponseSettingsBlockPage struct { // Block page background color in #rrggbb format. BackgroundColor string `json:"background_color"` // Enable only cipher suites and TLS versions compliant with FIPS 140-2. @@ -933,14 +913,13 @@ type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes // Block page title. Name string `json:"name"` // Suppress detailed info at the bottom of the block page. - SuppressFooter bool `json:"suppress_footer"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPageJSON `json:"-"` + SuppressFooter bool `json:"suppress_footer"` + JSON gatewayConfigurationReplaceResponseSettingsBlockPageJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPageJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPage] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPageJSON struct { +// gatewayConfigurationReplaceResponseSettingsBlockPageJSON contains the JSON +// metadata for the struct [GatewayConfigurationReplaceResponseSettingsBlockPage] +type gatewayConfigurationReplaceResponseSettingsBlockPageJSON struct { BackgroundColor apijson.Field Enabled apijson.Field FooterText apijson.Field @@ -954,69 +933,69 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsBlockPage) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // DLP body scanning settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanning struct { +type GatewayConfigurationReplaceResponseSettingsBodyScanning struct { // Set the inspection mode to either `deep` or `shallow`. - InspectionMode string `json:"inspection_mode"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON `json:"-"` + InspectionMode string `json:"inspection_mode"` + JSON gatewayConfigurationReplaceResponseSettingsBodyScanningJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanning] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanningJSON struct { +// gatewayConfigurationReplaceResponseSettingsBodyScanningJSON contains the JSON +// metadata for the struct +// [GatewayConfigurationReplaceResponseSettingsBodyScanning] +type gatewayConfigurationReplaceResponseSettingsBodyScanningJSON struct { InspectionMode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsBodyScanning) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Browser isolation settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolation struct { +type GatewayConfigurationReplaceResponseSettingsBrowserIsolation struct { // Enable non-identity onramp support for Browser Isolation. NonIdentityEnabled bool `json:"non_identity_enabled"` // Enable Clientless Browser Isolation. - URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON `json:"-"` + URLBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"` + JSON gatewayConfigurationReplaceResponseSettingsBrowserIsolationJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolation] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolationJSON struct { +// gatewayConfigurationReplaceResponseSettingsBrowserIsolationJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationReplaceResponseSettingsBrowserIsolation] +type gatewayConfigurationReplaceResponseSettingsBrowserIsolationJSON struct { NonIdentityEnabled apijson.Field URLBrowserIsolationEnabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsBrowserIsolation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Custom certificate settings for BYO-PKI. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificate struct { +type GatewayConfigurationReplaceResponseSettingsCustomCertificate struct { // Enable use of custom certificate authority for signing Gateway traffic. Enabled bool `json:"enabled,required"` // UUID of certificate (ID from MTLS certificate store). ID string `json:"id"` // Certificate status (internal). - BindingStatus string `json:"binding_status"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON `json:"-"` + BindingStatus string `json:"binding_status"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayConfigurationReplaceResponseSettingsCustomCertificateJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificate] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificateJSON struct { +// gatewayConfigurationReplaceResponseSettingsCustomCertificateJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationReplaceResponseSettingsCustomCertificate] +type gatewayConfigurationReplaceResponseSettingsCustomCertificateJSON struct { Enabled apijson.Field ID apijson.Field BindingStatus apijson.Field @@ -1025,213 +1004,138 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsCustomCertificate) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Extended e-mail matching settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching struct { +type GatewayConfigurationReplaceResponseSettingsExtendedEmailMatching struct { // Enable matching all variants of user emails (with + or . modifiers) used as // criteria in Firewall policies. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationReplaceResponseSettingsExtendedEmailMatchingJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatchingJSON struct { +// gatewayConfigurationReplaceResponseSettingsExtendedEmailMatchingJSON contains +// the JSON metadata for the struct +// [GatewayConfigurationReplaceResponseSettingsExtendedEmailMatching] +type gatewayConfigurationReplaceResponseSettingsExtendedEmailMatchingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsExtendedEmailMatching) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // FIPS settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFips struct { +type GatewayConfigurationReplaceResponseSettingsFips struct { // Enable only cipher suites and TLS versions compliant with FIPS 140-2. - TLS bool `json:"tls"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFipsJSON `json:"-"` + TLS bool `json:"tls"` + JSON gatewayConfigurationReplaceResponseSettingsFipsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFipsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFips] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFipsJSON struct { +// gatewayConfigurationReplaceResponseSettingsFipsJSON contains the JSON metadata +// for the struct [GatewayConfigurationReplaceResponseSettingsFips] +type gatewayConfigurationReplaceResponseSettingsFipsJSON struct { TLS apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsFips) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Protocol Detection settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetection struct { +type GatewayConfigurationReplaceResponseSettingsProtocolDetection struct { // Enable detecting protocol on initial bytes of client traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationReplaceResponseSettingsProtocolDetectionJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetection] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetectionJSON struct { +// gatewayConfigurationReplaceResponseSettingsProtocolDetectionJSON contains the +// JSON metadata for the struct +// [GatewayConfigurationReplaceResponseSettingsProtocolDetection] +type gatewayConfigurationReplaceResponseSettingsProtocolDetectionJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsProtocolDetection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // TLS interception settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecrypt struct { +type GatewayConfigurationReplaceResponseSettingsTLSDecrypt struct { // Enable inspecting encrypted HTTP traffic. - Enabled bool `json:"enabled"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayConfigurationReplaceResponseSettingsTLSDecryptJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecrypt] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecryptJSON struct { +// gatewayConfigurationReplaceResponseSettingsTLSDecryptJSON contains the JSON +// metadata for the struct [GatewayConfigurationReplaceResponseSettingsTLSDecrypt] +type gatewayConfigurationReplaceResponseSettingsTLSDecryptJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseSettingsTLSDecrypt) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelope struct { - Errors []GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` +type GatewayConfigurationUpdateParams struct { // account settings. - Result GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponse `json:"result,required"` - // Whether the API call was successful - Success GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeJSON `json:"-"` -} - -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelope] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` + Settings param.Field[GatewayConfigurationUpdateParamsSettings] `json:"settings"` } -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrors] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessages] -type gatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeSuccess bool - -const ( - GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeSuccessTrue GatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfigurationResponseEnvelopeSuccess = true -) - -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParams struct { - // account settings. - Settings param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettings] `json:"settings"` -} - -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParams) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // account settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettings struct { +type GatewayConfigurationUpdateParamsSettings struct { // Activity log settings. - ActivityLog param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsActivityLog] `json:"activity_log"` + ActivityLog param.Field[GatewayConfigurationUpdateParamsSettingsActivityLog] `json:"activity_log"` // Anti-virus settings. - Antivirus param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirus] `json:"antivirus"` + Antivirus param.Field[GatewayConfigurationUpdateParamsSettingsAntivirus] `json:"antivirus"` // Block page layout settings. - BlockPage param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBlockPage] `json:"block_page"` + BlockPage param.Field[GatewayConfigurationUpdateParamsSettingsBlockPage] `json:"block_page"` // DLP body scanning settings. - BodyScanning param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBodyScanning] `json:"body_scanning"` + BodyScanning param.Field[GatewayConfigurationUpdateParamsSettingsBodyScanning] `json:"body_scanning"` // Browser isolation settings. - BrowserIsolation param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBrowserIsolation] `json:"browser_isolation"` + BrowserIsolation param.Field[GatewayConfigurationUpdateParamsSettingsBrowserIsolation] `json:"browser_isolation"` // Custom certificate settings for BYO-PKI. - CustomCertificate param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsCustomCertificate] `json:"custom_certificate"` + CustomCertificate param.Field[GatewayConfigurationUpdateParamsSettingsCustomCertificate] `json:"custom_certificate"` // Extended e-mail matching settings. - ExtendedEmailMatching param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching] `json:"extended_email_matching"` + ExtendedEmailMatching param.Field[GatewayConfigurationUpdateParamsSettingsExtendedEmailMatching] `json:"extended_email_matching"` // FIPS settings. - Fips param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsFips] `json:"fips"` + Fips param.Field[GatewayConfigurationUpdateParamsSettingsFips] `json:"fips"` // Protocol Detection settings. - ProtocolDetection param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsProtocolDetection] `json:"protocol_detection"` + ProtocolDetection param.Field[GatewayConfigurationUpdateParamsSettingsProtocolDetection] `json:"protocol_detection"` // TLS interception settings. - TLSDecrypt param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsTLSDecrypt] `json:"tls_decrypt"` + TLSDecrypt param.Field[GatewayConfigurationUpdateParamsSettingsTLSDecrypt] `json:"tls_decrypt"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Activity log settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsActivityLog struct { +type GatewayConfigurationUpdateParamsSettingsActivityLog struct { // Enable activity logging. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsActivityLog) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsActivityLog) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Anti-virus settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirus struct { +type GatewayConfigurationUpdateParamsSettingsAntivirus struct { // Enable anti-virus scanning on downloads. EnabledDownloadPhase param.Field[bool] `json:"enabled_download_phase"` // Enable anti-virus scanning on uploads. @@ -1240,16 +1144,16 @@ type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationPara FailClosed param.Field[bool] `json:"fail_closed"` // Configure a message to display on the user's device when an antivirus search is // performed. - NotificationSettings param.Field[GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings] `json:"notification_settings"` + NotificationSettings param.Field[GatewayConfigurationUpdateParamsSettingsAntivirusNotificationSettings] `json:"notification_settings"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirus) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsAntivirus) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure a message to display on the user's device when an antivirus search is // performed. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings struct { +type GatewayConfigurationUpdateParamsSettingsAntivirusNotificationSettings struct { // Set notification on Enabled param.Field[bool] `json:"enabled"` // Customize the message shown in the notification. @@ -1259,12 +1163,12 @@ type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationPara SupportURL param.Field[string] `json:"support_url"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsAntivirusNotificationSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Block page layout settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBlockPage struct { +type GatewayConfigurationUpdateParamsSettingsBlockPage struct { // Block page background color in #rrggbb format. BackgroundColor param.Field[string] `json:"background_color"` // Enable only cipher suites and TLS versions compliant with FIPS 140-2. @@ -1285,99 +1189,98 @@ type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationPara SuppressFooter param.Field[bool] `json:"suppress_footer"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBlockPage) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsBlockPage) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // DLP body scanning settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBodyScanning struct { +type GatewayConfigurationUpdateParamsSettingsBodyScanning struct { // Set the inspection mode to either `deep` or `shallow`. InspectionMode param.Field[string] `json:"inspection_mode"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBodyScanning) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsBodyScanning) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Browser isolation settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBrowserIsolation struct { +type GatewayConfigurationUpdateParamsSettingsBrowserIsolation struct { // Enable non-identity onramp support for Browser Isolation. NonIdentityEnabled param.Field[bool] `json:"non_identity_enabled"` // Enable Clientless Browser Isolation. URLBrowserIsolationEnabled param.Field[bool] `json:"url_browser_isolation_enabled"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBrowserIsolation) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsBrowserIsolation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Custom certificate settings for BYO-PKI. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsCustomCertificate struct { +type GatewayConfigurationUpdateParamsSettingsCustomCertificate struct { // Enable use of custom certificate authority for signing Gateway traffic. Enabled param.Field[bool] `json:"enabled,required"` // UUID of certificate (ID from MTLS certificate store). ID param.Field[string] `json:"id"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsCustomCertificate) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsCustomCertificate) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Extended e-mail matching settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching struct { +type GatewayConfigurationUpdateParamsSettingsExtendedEmailMatching struct { // Enable matching all variants of user emails (with + or . modifiers) used as // criteria in Firewall policies. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsExtendedEmailMatching) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // FIPS settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsFips struct { +type GatewayConfigurationUpdateParamsSettingsFips struct { // Enable only cipher suites and TLS versions compliant with FIPS 140-2. TLS param.Field[bool] `json:"tls"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsFips) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsFips) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Protocol Detection settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsProtocolDetection struct { +type GatewayConfigurationUpdateParamsSettingsProtocolDetection struct { // Enable detecting protocol on initial bytes of client traffic. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsProtocolDetection) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsProtocolDetection) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // TLS interception settings. -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsTLSDecrypt struct { +type GatewayConfigurationUpdateParamsSettingsTLSDecrypt struct { // Enable inspecting encrypted HTTP traffic. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsTLSDecrypt) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationUpdateParamsSettingsTLSDecrypt) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelope struct { - Errors []GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` +type GatewayConfigurationUpdateResponseEnvelope struct { + Errors []GatewayConfigurationUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayConfigurationUpdateResponseEnvelopeMessages `json:"messages,required"` // account settings. - Result GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponse `json:"result,required"` + Result GatewayConfigurationUpdateResponse `json:"result,required"` // Whether the API call was successful - Success GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success GatewayConfigurationUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayConfigurationUpdateResponseEnvelopeJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelope] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeJSON struct { +// gatewayConfigurationUpdateResponseEnvelopeJSON contains the JSON metadata for +// the struct [GatewayConfigurationUpdateResponseEnvelope] +type gatewayConfigurationUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1386,106 +1289,174 @@ type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResp ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type GatewayConfigurationUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrors] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON struct { +// gatewayConfigurationUpdateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [GatewayConfigurationUpdateResponseEnvelopeErrors] +type gatewayConfigurationUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type GatewayConfigurationUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessages] -type gatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON struct { +// gatewayConfigurationUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [GatewayConfigurationUpdateResponseEnvelopeMessages] +type gatewayConfigurationUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayConfigurationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type GatewayConfigurationUpdateResponseEnvelopeSuccess bool + +const ( + GatewayConfigurationUpdateResponseEnvelopeSuccessTrue GatewayConfigurationUpdateResponseEnvelopeSuccess = true +) + +type GatewayConfigurationGetResponseEnvelope struct { + Errors []GatewayConfigurationGetResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayConfigurationGetResponseEnvelopeMessages `json:"messages,required"` + // account settings. + Result GatewayConfigurationGetResponse `json:"result,required"` + // Whether the API call was successful + Success GatewayConfigurationGetResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayConfigurationGetResponseEnvelopeJSON `json:"-"` +} + +// gatewayConfigurationGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayConfigurationGetResponseEnvelope] +type gatewayConfigurationGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayConfigurationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayConfigurationGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// gatewayConfigurationGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [GatewayConfigurationGetResponseEnvelopeErrors] +type gatewayConfigurationGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayConfigurationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayConfigurationGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// gatewayConfigurationGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [GatewayConfigurationGetResponseEnvelopeMessages] +type gatewayConfigurationGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeSuccess bool +type GatewayConfigurationGetResponseEnvelopeSuccess bool const ( - GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeSuccessTrue GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationResponseEnvelopeSuccess = true + GatewayConfigurationGetResponseEnvelopeSuccessTrue GatewayConfigurationGetResponseEnvelopeSuccess = true ) -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParams struct { +type GatewayConfigurationReplaceParams struct { // account settings. - Settings param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettings] `json:"settings"` + Settings param.Field[GatewayConfigurationReplaceParamsSettings] `json:"settings"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParams) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // account settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettings struct { +type GatewayConfigurationReplaceParamsSettings struct { // Activity log settings. - ActivityLog param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsActivityLog] `json:"activity_log"` + ActivityLog param.Field[GatewayConfigurationReplaceParamsSettingsActivityLog] `json:"activity_log"` // Anti-virus settings. - Antivirus param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirus] `json:"antivirus"` + Antivirus param.Field[GatewayConfigurationReplaceParamsSettingsAntivirus] `json:"antivirus"` // Block page layout settings. - BlockPage param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBlockPage] `json:"block_page"` + BlockPage param.Field[GatewayConfigurationReplaceParamsSettingsBlockPage] `json:"block_page"` // DLP body scanning settings. - BodyScanning param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBodyScanning] `json:"body_scanning"` + BodyScanning param.Field[GatewayConfigurationReplaceParamsSettingsBodyScanning] `json:"body_scanning"` // Browser isolation settings. - BrowserIsolation param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBrowserIsolation] `json:"browser_isolation"` + BrowserIsolation param.Field[GatewayConfigurationReplaceParamsSettingsBrowserIsolation] `json:"browser_isolation"` // Custom certificate settings for BYO-PKI. - CustomCertificate param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsCustomCertificate] `json:"custom_certificate"` + CustomCertificate param.Field[GatewayConfigurationReplaceParamsSettingsCustomCertificate] `json:"custom_certificate"` // Extended e-mail matching settings. - ExtendedEmailMatching param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching] `json:"extended_email_matching"` + ExtendedEmailMatching param.Field[GatewayConfigurationReplaceParamsSettingsExtendedEmailMatching] `json:"extended_email_matching"` // FIPS settings. - Fips param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsFips] `json:"fips"` + Fips param.Field[GatewayConfigurationReplaceParamsSettingsFips] `json:"fips"` // Protocol Detection settings. - ProtocolDetection param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsProtocolDetection] `json:"protocol_detection"` + ProtocolDetection param.Field[GatewayConfigurationReplaceParamsSettingsProtocolDetection] `json:"protocol_detection"` // TLS interception settings. - TLSDecrypt param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsTLSDecrypt] `json:"tls_decrypt"` + TLSDecrypt param.Field[GatewayConfigurationReplaceParamsSettingsTLSDecrypt] `json:"tls_decrypt"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Activity log settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsActivityLog struct { +type GatewayConfigurationReplaceParamsSettingsActivityLog struct { // Enable activity logging. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsActivityLog) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsActivityLog) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Anti-virus settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirus struct { +type GatewayConfigurationReplaceParamsSettingsAntivirus struct { // Enable anti-virus scanning on downloads. EnabledDownloadPhase param.Field[bool] `json:"enabled_download_phase"` // Enable anti-virus scanning on uploads. @@ -1494,16 +1465,16 @@ type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationPar FailClosed param.Field[bool] `json:"fail_closed"` // Configure a message to display on the user's device when an antivirus search is // performed. - NotificationSettings param.Field[GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings] `json:"notification_settings"` + NotificationSettings param.Field[GatewayConfigurationReplaceParamsSettingsAntivirusNotificationSettings] `json:"notification_settings"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirus) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsAntivirus) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure a message to display on the user's device when an antivirus search is // performed. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings struct { +type GatewayConfigurationReplaceParamsSettingsAntivirusNotificationSettings struct { // Set notification on Enabled param.Field[bool] `json:"enabled"` // Customize the message shown in the notification. @@ -1513,12 +1484,12 @@ type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationPar SupportURL param.Field[string] `json:"support_url"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsAntivirusNotificationSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Block page layout settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBlockPage struct { +type GatewayConfigurationReplaceParamsSettingsBlockPage struct { // Block page background color in #rrggbb format. BackgroundColor param.Field[string] `json:"background_color"` // Enable only cipher suites and TLS versions compliant with FIPS 140-2. @@ -1539,99 +1510,98 @@ type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationPar SuppressFooter param.Field[bool] `json:"suppress_footer"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBlockPage) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsBlockPage) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // DLP body scanning settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBodyScanning struct { +type GatewayConfigurationReplaceParamsSettingsBodyScanning struct { // Set the inspection mode to either `deep` or `shallow`. InspectionMode param.Field[string] `json:"inspection_mode"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBodyScanning) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsBodyScanning) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Browser isolation settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBrowserIsolation struct { +type GatewayConfigurationReplaceParamsSettingsBrowserIsolation struct { // Enable non-identity onramp support for Browser Isolation. NonIdentityEnabled param.Field[bool] `json:"non_identity_enabled"` // Enable Clientless Browser Isolation. URLBrowserIsolationEnabled param.Field[bool] `json:"url_browser_isolation_enabled"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBrowserIsolation) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsBrowserIsolation) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Custom certificate settings for BYO-PKI. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsCustomCertificate struct { +type GatewayConfigurationReplaceParamsSettingsCustomCertificate struct { // Enable use of custom certificate authority for signing Gateway traffic. Enabled param.Field[bool] `json:"enabled,required"` // UUID of certificate (ID from MTLS certificate store). ID param.Field[string] `json:"id"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsCustomCertificate) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsCustomCertificate) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Extended e-mail matching settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching struct { +type GatewayConfigurationReplaceParamsSettingsExtendedEmailMatching struct { // Enable matching all variants of user emails (with + or . modifiers) used as // criteria in Firewall policies. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsExtendedEmailMatching) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // FIPS settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsFips struct { +type GatewayConfigurationReplaceParamsSettingsFips struct { // Enable only cipher suites and TLS versions compliant with FIPS 140-2. TLS param.Field[bool] `json:"tls"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsFips) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsFips) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Protocol Detection settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsProtocolDetection struct { +type GatewayConfigurationReplaceParamsSettingsProtocolDetection struct { // Enable detecting protocol on initial bytes of client traffic. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsProtocolDetection) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsProtocolDetection) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // TLS interception settings. -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsTLSDecrypt struct { +type GatewayConfigurationReplaceParamsSettingsTLSDecrypt struct { // Enable inspecting encrypted HTTP traffic. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsTLSDecrypt) MarshalJSON() (data []byte, err error) { +func (r GatewayConfigurationReplaceParamsSettingsTLSDecrypt) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelope struct { - Errors []GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` +type GatewayConfigurationReplaceResponseEnvelope struct { + Errors []GatewayConfigurationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayConfigurationReplaceResponseEnvelopeMessages `json:"messages,required"` // account settings. - Result GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponse `json:"result,required"` + Result GatewayConfigurationReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success GatewayConfigurationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayConfigurationReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelope] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeJSON struct { +// gatewayConfigurationReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [GatewayConfigurationReplaceResponseEnvelope] +type gatewayConfigurationReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1640,53 +1610,51 @@ type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationRes ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type GatewayConfigurationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrors] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrorsJSON struct { +// gatewayConfigurationReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [GatewayConfigurationReplaceResponseEnvelopeErrors] +type gatewayConfigurationReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type GatewayConfigurationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayConfigurationReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessages] -type gatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessagesJSON struct { +// gatewayConfigurationReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [GatewayConfigurationReplaceResponseEnvelopeMessages] +type gatewayConfigurationReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayConfigurationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeSuccess bool +type GatewayConfigurationReplaceResponseEnvelopeSuccess bool const ( - GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeSuccessTrue GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationResponseEnvelopeSuccess = true + GatewayConfigurationReplaceResponseEnvelopeSuccessTrue GatewayConfigurationReplaceResponseEnvelopeSuccess = true ) diff --git a/gatewayconfiguration_test.go b/gatewayconfiguration_test.go index 8e864d7b89c..d61fa998497 100644 --- a/gatewayconfiguration_test.go +++ b/gatewayconfiguration_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfiguration(t *testing.T) { +func TestGatewayConfigurationUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,51 +29,25 @@ func TestGatewayConfigurationZeroTrustAccountsGetZeroTrustAccountConfiguration(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Configurations.ZeroTrustAccountsGetZeroTrustAccountConfiguration(context.TODO(), "699d98642c564d2e855e9661899b7252") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestGatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Gateways.Configurations.ZeroTrustAccountsPatchZeroTrustAccountConfiguration( + _, err := client.Gateways.Configurations.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParams{ - Settings: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettings{ - ActivityLog: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsActivityLog{ + cloudflare.GatewayConfigurationUpdateParams{ + Settings: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettings{ + ActivityLog: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsActivityLog{ Enabled: cloudflare.F(true), }), - Antivirus: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirus{ + Antivirus: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsAntivirus{ EnabledDownloadPhase: cloudflare.F(false), EnabledUploadPhase: cloudflare.F(false), FailClosed: cloudflare.F(false), - NotificationSettings: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings{ + NotificationSettings: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsAntivirusNotificationSettings{ Enabled: cloudflare.F(true), Msg: cloudflare.F("string"), SupportURL: cloudflare.F("string"), }), }), - BlockPage: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBlockPage{ + BlockPage: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsBlockPage{ BackgroundColor: cloudflare.F("string"), Enabled: cloudflare.F(true), FooterText: cloudflare.F("--footer--"), @@ -84,27 +58,27 @@ func TestGatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfiguration Name: cloudflare.F("Cloudflare"), SuppressFooter: cloudflare.F(false), }), - BodyScanning: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBodyScanning{ + BodyScanning: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsBodyScanning{ InspectionMode: cloudflare.F("deep"), }), - BrowserIsolation: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsBrowserIsolation{ + BrowserIsolation: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsBrowserIsolation{ NonIdentityEnabled: cloudflare.F(true), URLBrowserIsolationEnabled: cloudflare.F(true), }), - CustomCertificate: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsCustomCertificate{ + CustomCertificate: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsCustomCertificate{ Enabled: cloudflare.F(true), ID: cloudflare.F("d1b364c5-1311-466e-a194-f0e943e0799f"), }), - ExtendedEmailMatching: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching{ + ExtendedEmailMatching: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsExtendedEmailMatching{ Enabled: cloudflare.F(true), }), - Fips: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsFips{ + Fips: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsFips{ TLS: cloudflare.F(true), }), - ProtocolDetection: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsProtocolDetection{ + ProtocolDetection: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsProtocolDetection{ Enabled: cloudflare.F(true), }), - TLSDecrypt: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfigurationParamsSettingsTLSDecrypt{ + TLSDecrypt: cloudflare.F(cloudflare.GatewayConfigurationUpdateParamsSettingsTLSDecrypt{ Enabled: cloudflare.F(true), }), }), @@ -119,7 +93,33 @@ func TestGatewayConfigurationZeroTrustAccountsPatchZeroTrustAccountConfiguration } } -func TestGatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationWithOptionalParams(t *testing.T) { +func TestGatewayConfigurationGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Gateways.Configurations.Get(context.TODO(), "699d98642c564d2e855e9661899b7252") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestGatewayConfigurationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -135,25 +135,25 @@ func TestGatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfiguratio option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Configurations.ZeroTrustAccountsUpdateZeroTrustAccountConfiguration( + _, err := client.Gateways.Configurations.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParams{ - Settings: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettings{ - ActivityLog: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsActivityLog{ + cloudflare.GatewayConfigurationReplaceParams{ + Settings: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettings{ + ActivityLog: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsActivityLog{ Enabled: cloudflare.F(true), }), - Antivirus: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirus{ + Antivirus: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsAntivirus{ EnabledDownloadPhase: cloudflare.F(false), EnabledUploadPhase: cloudflare.F(false), FailClosed: cloudflare.F(false), - NotificationSettings: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsAntivirusNotificationSettings{ + NotificationSettings: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsAntivirusNotificationSettings{ Enabled: cloudflare.F(true), Msg: cloudflare.F("string"), SupportURL: cloudflare.F("string"), }), }), - BlockPage: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBlockPage{ + BlockPage: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsBlockPage{ BackgroundColor: cloudflare.F("string"), Enabled: cloudflare.F(true), FooterText: cloudflare.F("--footer--"), @@ -164,27 +164,27 @@ func TestGatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfiguratio Name: cloudflare.F("Cloudflare"), SuppressFooter: cloudflare.F(false), }), - BodyScanning: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBodyScanning{ + BodyScanning: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsBodyScanning{ InspectionMode: cloudflare.F("deep"), }), - BrowserIsolation: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsBrowserIsolation{ + BrowserIsolation: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsBrowserIsolation{ NonIdentityEnabled: cloudflare.F(true), URLBrowserIsolationEnabled: cloudflare.F(true), }), - CustomCertificate: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsCustomCertificate{ + CustomCertificate: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsCustomCertificate{ Enabled: cloudflare.F(true), ID: cloudflare.F("d1b364c5-1311-466e-a194-f0e943e0799f"), }), - ExtendedEmailMatching: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsExtendedEmailMatching{ + ExtendedEmailMatching: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsExtendedEmailMatching{ Enabled: cloudflare.F(true), }), - Fips: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsFips{ + Fips: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsFips{ TLS: cloudflare.F(true), }), - ProtocolDetection: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsProtocolDetection{ + ProtocolDetection: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsProtocolDetection{ Enabled: cloudflare.F(true), }), - TLSDecrypt: cloudflare.F(cloudflare.GatewayConfigurationZeroTrustAccountsUpdateZeroTrustAccountConfigurationParamsSettingsTLSDecrypt{ + TLSDecrypt: cloudflare.F(cloudflare.GatewayConfigurationReplaceParamsSettingsTLSDecrypt{ Enabled: cloudflare.F(true), }), }), diff --git a/gatewaylist.go b/gatewaylist.go index a2f4b03ebeb..9454b100e27 100644 --- a/gatewaylist.go +++ b/gatewaylist.go @@ -37,12 +37,25 @@ func NewGatewayListService(opts ...option.RequestOption) (r *GatewayListService) return } -// Updates a configured Zero Trust list. -func (r *GatewayListService) Update(ctx context.Context, accountID interface{}, listID string, body GatewayListUpdateParams, opts ...option.RequestOption) (res *GatewayListUpdateResponse, err error) { +// Creates a new Zero Trust list. +func (r *GatewayListService) New(ctx context.Context, accountID interface{}, body GatewayListNewParams, opts ...option.RequestOption) (res *GatewayListNewResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayListUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/lists/%s", accountID, listID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env GatewayListNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/lists", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches all Zero Trust lists for an account. +func (r *GatewayListService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayListListResponse, err error) { + opts = append(r.Options[:], opts...) + var env GatewayListListResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/lists", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -76,12 +89,12 @@ func (r *GatewayListService) Get(ctx context.Context, accountID interface{}, lis return } -// Creates a new Zero Trust list. -func (r *GatewayListService) ZeroTrustListsNewZeroTrustList(ctx context.Context, accountID interface{}, body GatewayListZeroTrustListsNewZeroTrustListParams, opts ...option.RequestOption) (res *GatewayListZeroTrustListsNewZeroTrustListResponse, err error) { +// Updates a configured Zero Trust list. +func (r *GatewayListService) Replace(ctx context.Context, accountID interface{}, listID string, body GatewayListReplaceParams, opts ...option.RequestOption) (res *GatewayListReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayListZeroTrustListsNewZeroTrustListResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/lists", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env GatewayListReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/lists/%s", accountID, listID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -89,20 +102,72 @@ func (r *GatewayListService) ZeroTrustListsNewZeroTrustList(ctx context.Context, return } -// Fetches all Zero Trust lists for an account. -func (r *GatewayListService) ZeroTrustListsListZeroTrustLists(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayListZeroTrustListsListZeroTrustListsResponse, err error) { - opts = append(r.Options[:], opts...) - var env GatewayListZeroTrustListsListZeroTrustListsResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/lists", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type GatewayListNewResponse struct { + // API Resource UUID tag. + ID string `json:"id"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The description of the list. + Description string `json:"description"` + // The items in the list. + Items []GatewayListNewResponseItem `json:"items"` + // The name of the list. + Name string `json:"name"` + // The type of list. + Type GatewayListNewResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayListNewResponseJSON `json:"-"` } -type GatewayListUpdateResponse struct { +// gatewayListNewResponseJSON contains the JSON metadata for the struct +// [GatewayListNewResponse] +type gatewayListNewResponseJSON struct { + ID apijson.Field + CreatedAt apijson.Field + Description apijson.Field + Items apijson.Field + Name apijson.Field + Type apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayListNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayListNewResponseItem struct { + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The value of the item in a list. + Value string `json:"value"` + JSON gatewayListNewResponseItemJSON `json:"-"` +} + +// gatewayListNewResponseItemJSON contains the JSON metadata for the struct +// [GatewayListNewResponseItem] +type gatewayListNewResponseItemJSON struct { + CreatedAt apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayListNewResponseItem) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of list. +type GatewayListNewResponseType string + +const ( + GatewayListNewResponseTypeSerial GatewayListNewResponseType = "SERIAL" + GatewayListNewResponseTypeURL GatewayListNewResponseType = "URL" + GatewayListNewResponseTypeDomain GatewayListNewResponseType = "DOMAIN" + GatewayListNewResponseTypeEmail GatewayListNewResponseType = "EMAIL" + GatewayListNewResponseTypeIP GatewayListNewResponseType = "IP" +) + +type GatewayListListResponse struct { // API Resource UUID tag. ID string `json:"id"` // The number of items in the list. @@ -113,14 +178,14 @@ type GatewayListUpdateResponse struct { // The name of the list. Name string `json:"name"` // The type of list. - Type GatewayListUpdateResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayListUpdateResponseJSON `json:"-"` + Type GatewayListListResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayListListResponseJSON `json:"-"` } -// gatewayListUpdateResponseJSON contains the JSON metadata for the struct -// [GatewayListUpdateResponse] -type gatewayListUpdateResponseJSON struct { +// gatewayListListResponseJSON contains the JSON metadata for the struct +// [GatewayListListResponse] +type gatewayListListResponseJSON struct { ID apijson.Field Count apijson.Field CreatedAt apijson.Field @@ -132,19 +197,19 @@ type gatewayListUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayListUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of list. -type GatewayListUpdateResponseType string +type GatewayListListResponseType string const ( - GatewayListUpdateResponseTypeSerial GatewayListUpdateResponseType = "SERIAL" - GatewayListUpdateResponseTypeURL GatewayListUpdateResponseType = "URL" - GatewayListUpdateResponseTypeDomain GatewayListUpdateResponseType = "DOMAIN" - GatewayListUpdateResponseTypeEmail GatewayListUpdateResponseType = "EMAIL" - GatewayListUpdateResponseTypeIP GatewayListUpdateResponseType = "IP" + GatewayListListResponseTypeSerial GatewayListListResponseType = "SERIAL" + GatewayListListResponseTypeURL GatewayListListResponseType = "URL" + GatewayListListResponseTypeDomain GatewayListListResponseType = "DOMAIN" + GatewayListListResponseTypeEmail GatewayListListResponseType = "EMAIL" + GatewayListListResponseTypeIP GatewayListListResponseType = "IP" ) // Union satisfied by [GatewayListDeleteResponseUnknown] or [shared.UnionString]. @@ -208,29 +273,29 @@ const ( GatewayListGetResponseTypeIP GatewayListGetResponseType = "IP" ) -type GatewayListZeroTrustListsNewZeroTrustListResponse struct { +type GatewayListReplaceResponse struct { // API Resource UUID tag. - ID string `json:"id"` + ID string `json:"id"` + // The number of items in the list. + Count float64 `json:"count"` CreatedAt time.Time `json:"created_at" format:"date-time"` // The description of the list. Description string `json:"description"` - // The items in the list. - Items []GatewayListZeroTrustListsNewZeroTrustListResponseItem `json:"items"` // The name of the list. Name string `json:"name"` // The type of list. - Type GatewayListZeroTrustListsNewZeroTrustListResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayListZeroTrustListsNewZeroTrustListResponseJSON `json:"-"` + Type GatewayListReplaceResponseType `json:"type"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayListReplaceResponseJSON `json:"-"` } -// gatewayListZeroTrustListsNewZeroTrustListResponseJSON contains the JSON metadata -// for the struct [GatewayListZeroTrustListsNewZeroTrustListResponse] -type gatewayListZeroTrustListsNewZeroTrustListResponseJSON struct { +// gatewayListReplaceResponseJSON contains the JSON metadata for the struct +// [GatewayListReplaceResponse] +type gatewayListReplaceResponseJSON struct { ID apijson.Field + Count apijson.Field CreatedAt apijson.Field Description apijson.Field - Items apijson.Field Name apijson.Field Type apijson.Field UpdatedAt apijson.Field @@ -238,166 +303,223 @@ type gatewayListZeroTrustListsNewZeroTrustListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayListZeroTrustListsNewZeroTrustListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListZeroTrustListsNewZeroTrustListResponseItem struct { - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The value of the item in a list. - Value string `json:"value"` - JSON gatewayListZeroTrustListsNewZeroTrustListResponseItemJSON `json:"-"` -} +// The type of list. +type GatewayListReplaceResponseType string -// gatewayListZeroTrustListsNewZeroTrustListResponseItemJSON contains the JSON -// metadata for the struct [GatewayListZeroTrustListsNewZeroTrustListResponseItem] -type gatewayListZeroTrustListsNewZeroTrustListResponseItemJSON struct { - CreatedAt apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field +const ( + GatewayListReplaceResponseTypeSerial GatewayListReplaceResponseType = "SERIAL" + GatewayListReplaceResponseTypeURL GatewayListReplaceResponseType = "URL" + GatewayListReplaceResponseTypeDomain GatewayListReplaceResponseType = "DOMAIN" + GatewayListReplaceResponseTypeEmail GatewayListReplaceResponseType = "EMAIL" + GatewayListReplaceResponseTypeIP GatewayListReplaceResponseType = "IP" +) + +type GatewayListNewParams struct { + // The name of the list. + Name param.Field[string] `json:"name,required"` + // The type of list. + Type param.Field[GatewayListNewParamsType] `json:"type,required"` + // The description of the list. + Description param.Field[string] `json:"description"` + // The items in the list. + Items param.Field[[]GatewayListNewParamsItem] `json:"items"` } -func (r *GatewayListZeroTrustListsNewZeroTrustListResponseItem) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r GatewayListNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // The type of list. -type GatewayListZeroTrustListsNewZeroTrustListResponseType string +type GatewayListNewParamsType string const ( - GatewayListZeroTrustListsNewZeroTrustListResponseTypeSerial GatewayListZeroTrustListsNewZeroTrustListResponseType = "SERIAL" - GatewayListZeroTrustListsNewZeroTrustListResponseTypeURL GatewayListZeroTrustListsNewZeroTrustListResponseType = "URL" - GatewayListZeroTrustListsNewZeroTrustListResponseTypeDomain GatewayListZeroTrustListsNewZeroTrustListResponseType = "DOMAIN" - GatewayListZeroTrustListsNewZeroTrustListResponseTypeEmail GatewayListZeroTrustListsNewZeroTrustListResponseType = "EMAIL" - GatewayListZeroTrustListsNewZeroTrustListResponseTypeIP GatewayListZeroTrustListsNewZeroTrustListResponseType = "IP" + GatewayListNewParamsTypeSerial GatewayListNewParamsType = "SERIAL" + GatewayListNewParamsTypeURL GatewayListNewParamsType = "URL" + GatewayListNewParamsTypeDomain GatewayListNewParamsType = "DOMAIN" + GatewayListNewParamsTypeEmail GatewayListNewParamsType = "EMAIL" + GatewayListNewParamsTypeIP GatewayListNewParamsType = "IP" ) -type GatewayListZeroTrustListsListZeroTrustListsResponse struct { - // API Resource UUID tag. - ID string `json:"id"` - // The number of items in the list. - Count float64 `json:"count"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The description of the list. - Description string `json:"description"` - // The name of the list. - Name string `json:"name"` - // The type of list. - Type GatewayListZeroTrustListsListZeroTrustListsResponseType `json:"type"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayListZeroTrustListsListZeroTrustListsResponseJSON `json:"-"` +type GatewayListNewParamsItem struct { + // The value of the item in a list. + Value param.Field[string] `json:"value"` } -// gatewayListZeroTrustListsListZeroTrustListsResponseJSON contains the JSON -// metadata for the struct [GatewayListZeroTrustListsListZeroTrustListsResponse] -type gatewayListZeroTrustListsListZeroTrustListsResponseJSON struct { - ID apijson.Field - Count apijson.Field - CreatedAt apijson.Field - Description apijson.Field - Name apijson.Field - Type apijson.Field - UpdatedAt apijson.Field +func (r GatewayListNewParamsItem) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type GatewayListNewResponseEnvelope struct { + Errors []GatewayListNewResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayListNewResponseEnvelopeMessages `json:"messages,required"` + Result GatewayListNewResponse `json:"result,required"` + // Whether the API call was successful + Success GatewayListNewResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayListNewResponseEnvelopeJSON `json:"-"` +} + +// gatewayListNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayListNewResponseEnvelope] +type gatewayListNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListZeroTrustListsListZeroTrustListsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The type of list. -type GatewayListZeroTrustListsListZeroTrustListsResponseType string +type GatewayListNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListNewResponseEnvelopeErrorsJSON `json:"-"` +} -const ( - GatewayListZeroTrustListsListZeroTrustListsResponseTypeSerial GatewayListZeroTrustListsListZeroTrustListsResponseType = "SERIAL" - GatewayListZeroTrustListsListZeroTrustListsResponseTypeURL GatewayListZeroTrustListsListZeroTrustListsResponseType = "URL" - GatewayListZeroTrustListsListZeroTrustListsResponseTypeDomain GatewayListZeroTrustListsListZeroTrustListsResponseType = "DOMAIN" - GatewayListZeroTrustListsListZeroTrustListsResponseTypeEmail GatewayListZeroTrustListsListZeroTrustListsResponseType = "EMAIL" - GatewayListZeroTrustListsListZeroTrustListsResponseTypeIP GatewayListZeroTrustListsListZeroTrustListsResponseType = "IP" -) +// gatewayListNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayListNewResponseEnvelopeErrors] +type gatewayListNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} -type GatewayListUpdateParams struct { - // The name of the list. - Name param.Field[string] `json:"name,required"` - // The description of the list. - Description param.Field[string] `json:"description"` +func (r *GatewayListNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r GatewayListUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type GatewayListNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListNewResponseEnvelopeMessagesJSON `json:"-"` } -type GatewayListUpdateResponseEnvelope struct { - Errors []GatewayListUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayListUpdateResponseEnvelopeMessages `json:"messages,required"` - Result GatewayListUpdateResponse `json:"result,required"` +// gatewayListNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayListNewResponseEnvelopeMessages] +type gatewayListNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayListNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type GatewayListNewResponseEnvelopeSuccess bool + +const ( + GatewayListNewResponseEnvelopeSuccessTrue GatewayListNewResponseEnvelopeSuccess = true +) + +type GatewayListListResponseEnvelope struct { + Errors []GatewayListListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayListListResponseEnvelopeMessages `json:"messages,required"` + Result []GatewayListListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success GatewayListUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayListUpdateResponseEnvelopeJSON `json:"-"` + Success GatewayListListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayListListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayListListResponseEnvelopeJSON `json:"-"` } -// gatewayListUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [GatewayListUpdateResponseEnvelope] -type gatewayListUpdateResponseEnvelopeJSON struct { +// gatewayListListResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayListListResponseEnvelope] +type gatewayListListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListUpdateResponseEnvelopeErrorsJSON `json:"-"` +type GatewayListListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListListResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayListUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [GatewayListUpdateResponseEnvelopeErrors] -type gatewayListUpdateResponseEnvelopeErrorsJSON struct { +// gatewayListListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayListListResponseEnvelopeErrors] +type gatewayListListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListUpdateResponseEnvelopeMessagesJSON `json:"-"` +type GatewayListListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListListResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayListUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [GatewayListUpdateResponseEnvelopeMessages] -type gatewayListUpdateResponseEnvelopeMessagesJSON struct { +// gatewayListListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayListListResponseEnvelopeMessages] +type gatewayListListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayListUpdateResponseEnvelopeSuccess bool +type GatewayListListResponseEnvelopeSuccess bool const ( - GatewayListUpdateResponseEnvelopeSuccessTrue GatewayListUpdateResponseEnvelopeSuccess = true + GatewayListListResponseEnvelopeSuccessTrue GatewayListListResponseEnvelopeSuccess = true ) +type GatewayListListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON gatewayListListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// gatewayListListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [GatewayListListResponseEnvelopeResultInfo] +type gatewayListListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayListListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type GatewayListDeleteResponseEnvelope struct { Errors []GatewayListDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []GatewayListDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -536,211 +658,82 @@ const ( GatewayListGetResponseEnvelopeSuccessTrue GatewayListGetResponseEnvelopeSuccess = true ) -type GatewayListZeroTrustListsNewZeroTrustListParams struct { +type GatewayListReplaceParams struct { // The name of the list. Name param.Field[string] `json:"name,required"` - // The type of list. - Type param.Field[GatewayListZeroTrustListsNewZeroTrustListParamsType] `json:"type,required"` // The description of the list. Description param.Field[string] `json:"description"` - // The items in the list. - Items param.Field[[]GatewayListZeroTrustListsNewZeroTrustListParamsItem] `json:"items"` -} - -func (r GatewayListZeroTrustListsNewZeroTrustListParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The type of list. -type GatewayListZeroTrustListsNewZeroTrustListParamsType string - -const ( - GatewayListZeroTrustListsNewZeroTrustListParamsTypeSerial GatewayListZeroTrustListsNewZeroTrustListParamsType = "SERIAL" - GatewayListZeroTrustListsNewZeroTrustListParamsTypeURL GatewayListZeroTrustListsNewZeroTrustListParamsType = "URL" - GatewayListZeroTrustListsNewZeroTrustListParamsTypeDomain GatewayListZeroTrustListsNewZeroTrustListParamsType = "DOMAIN" - GatewayListZeroTrustListsNewZeroTrustListParamsTypeEmail GatewayListZeroTrustListsNewZeroTrustListParamsType = "EMAIL" - GatewayListZeroTrustListsNewZeroTrustListParamsTypeIP GatewayListZeroTrustListsNewZeroTrustListParamsType = "IP" -) - -type GatewayListZeroTrustListsNewZeroTrustListParamsItem struct { - // The value of the item in a list. - Value param.Field[string] `json:"value"` } -func (r GatewayListZeroTrustListsNewZeroTrustListParamsItem) MarshalJSON() (data []byte, err error) { +func (r GatewayListReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayListZeroTrustListsNewZeroTrustListResponseEnvelope struct { - Errors []GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessages `json:"messages,required"` - Result GatewayListZeroTrustListsNewZeroTrustListResponse `json:"result,required"` - // Whether the API call was successful - Success GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeJSON `json:"-"` -} - -// gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [GatewayListZeroTrustListsNewZeroTrustListResponseEnvelope] -type gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayListZeroTrustListsNewZeroTrustListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrorsJSON `json:"-"` -} - -// gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrors] -type gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessages] -type gatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeSuccess bool - -const ( - GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeSuccessTrue GatewayListZeroTrustListsNewZeroTrustListResponseEnvelopeSuccess = true -) - -type GatewayListZeroTrustListsListZeroTrustListsResponseEnvelope struct { - Errors []GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayListZeroTrustListsListZeroTrustListsResponse `json:"result,required,nullable"` +type GatewayListReplaceResponseEnvelope struct { + Errors []GatewayListReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayListReplaceResponseEnvelopeMessages `json:"messages,required"` + Result GatewayListReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeJSON `json:"-"` + Success GatewayListReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayListReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [GatewayListZeroTrustListsListZeroTrustListsResponseEnvelope] -type gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeJSON struct { +// gatewayListReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayListReplaceResponseEnvelope] +type gatewayListReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListZeroTrustListsListZeroTrustListsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrorsJSON `json:"-"` +type GatewayListReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrors] -type gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrorsJSON struct { +// gatewayListReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayListReplaceResponseEnvelopeErrors] +type gatewayListReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessagesJSON `json:"-"` +type GatewayListReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessages] -type gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessagesJSON struct { +// gatewayListReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayListReplaceResponseEnvelopeMessages] +type gatewayListReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeSuccess bool +type GatewayListReplaceResponseEnvelopeSuccess bool const ( - GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeSuccessTrue GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeSuccess = true + GatewayListReplaceResponseEnvelopeSuccessTrue GatewayListReplaceResponseEnvelopeSuccess = true ) - -type GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfo] -type gatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayListZeroTrustListsListZeroTrustListsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/gatewaylist_test.go b/gatewaylist_test.go index 2a5117fc0ea..a0b7d934dc2 100644 --- a/gatewaylist_test.go +++ b/gatewaylist_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayListUpdateWithOptionalParams(t *testing.T) { +func TestGatewayListNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,20 @@ func TestGatewayListUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.Update( + _, err := client.Gateways.Lists.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.GatewayListUpdateParams{ + cloudflare.GatewayListNewParams{ Name: cloudflare.F("Admin Serial Numbers"), + Type: cloudflare.F(cloudflare.GatewayListNewParamsTypeSerial), Description: cloudflare.F("The serial numbers for administrators"), + Items: cloudflare.F([]cloudflare.GatewayListNewParamsItem{{ + Value: cloudflare.F("8GE8721REF"), + }, { + Value: cloudflare.F("8GE8721REF"), + }, { + Value: cloudflare.F("8GE8721REF"), + }}), }, ) if err != nil { @@ -47,7 +54,7 @@ func TestGatewayListUpdateWithOptionalParams(t *testing.T) { } } -func TestGatewayListDelete(t *testing.T) { +func TestGatewayListList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +70,7 @@ func TestGatewayListDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Gateways.Lists.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -77,7 +80,7 @@ func TestGatewayListDelete(t *testing.T) { } } -func TestGatewayListGet(t *testing.T) { +func TestGatewayListDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,7 +96,7 @@ func TestGatewayListGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.Get( + _, err := client.Gateways.Lists.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -107,7 +110,7 @@ func TestGatewayListGet(t *testing.T) { } } -func TestGatewayListZeroTrustListsNewZeroTrustListWithOptionalParams(t *testing.T) { +func TestGatewayListGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -123,21 +126,10 @@ func TestGatewayListZeroTrustListsNewZeroTrustListWithOptionalParams(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.ZeroTrustListsNewZeroTrustList( + _, err := client.Gateways.Lists.Get( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayListZeroTrustListsNewZeroTrustListParams{ - Name: cloudflare.F("Admin Serial Numbers"), - Type: cloudflare.F(cloudflare.GatewayListZeroTrustListsNewZeroTrustListParamsTypeSerial), - Description: cloudflare.F("The serial numbers for administrators"), - Items: cloudflare.F([]cloudflare.GatewayListZeroTrustListsNewZeroTrustListParamsItem{{ - Value: cloudflare.F("8GE8721REF"), - }, { - Value: cloudflare.F("8GE8721REF"), - }, { - Value: cloudflare.F("8GE8721REF"), - }}), - }, + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -148,7 +140,7 @@ func TestGatewayListZeroTrustListsNewZeroTrustListWithOptionalParams(t *testing. } } -func TestGatewayListZeroTrustListsListZeroTrustLists(t *testing.T) { +func TestGatewayListReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -164,7 +156,15 @@ func TestGatewayListZeroTrustListsListZeroTrustLists(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.ZeroTrustListsListZeroTrustLists(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.Lists.Replace( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.GatewayListReplaceParams{ + Name: cloudflare.F("Admin Serial Numbers"), + Description: cloudflare.F("The serial numbers for administrators"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewaylistitem.go b/gatewaylistitem.go index 22848758420..3758bede3ff 100644 --- a/gatewaylistitem.go +++ b/gatewaylistitem.go @@ -32,9 +32,9 @@ func NewGatewayListItemService(opts ...option.RequestOption) (r *GatewayListItem } // Fetches all items in a single Zero Trust list. -func (r *GatewayListItemService) ZeroTrustListsZeroTrustListItems(ctx context.Context, accountID interface{}, listID string, opts ...option.RequestOption) (res *[][]GatewayListItemZeroTrustListsZeroTrustListItemsResponse, err error) { +func (r *GatewayListItemService) List(ctx context.Context, accountID interface{}, listID string, opts ...option.RequestOption) (res *[][]GatewayListItemListResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelope + var env GatewayListItemListResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/lists/%s/items", accountID, listID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,41 +44,39 @@ func (r *GatewayListItemService) ZeroTrustListsZeroTrustListItems(ctx context.Co return } -type GatewayListItemZeroTrustListsZeroTrustListItemsResponse struct { +type GatewayListItemListResponse struct { CreatedAt time.Time `json:"created_at" format:"date-time"` // The value of the item in a list. - Value string `json:"value"` - JSON gatewayListItemZeroTrustListsZeroTrustListItemsResponseJSON `json:"-"` + Value string `json:"value"` + JSON gatewayListItemListResponseJSON `json:"-"` } -// gatewayListItemZeroTrustListsZeroTrustListItemsResponseJSON contains the JSON -// metadata for the struct -// [GatewayListItemZeroTrustListsZeroTrustListItemsResponse] -type gatewayListItemZeroTrustListsZeroTrustListItemsResponseJSON struct { +// gatewayListItemListResponseJSON contains the JSON metadata for the struct +// [GatewayListItemListResponse] +type gatewayListItemListResponseJSON struct { CreatedAt apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListItemZeroTrustListsZeroTrustListItemsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListItemListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelope struct { - Errors []GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessages `json:"messages,required"` - Result [][]GatewayListItemZeroTrustListsZeroTrustListItemsResponse `json:"result,required,nullable"` +type GatewayListItemListResponseEnvelope struct { + Errors []GatewayListItemListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayListItemListResponseEnvelopeMessages `json:"messages,required"` + Result [][]GatewayListItemListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeJSON `json:"-"` + Success GatewayListItemListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayListItemListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayListItemListResponseEnvelopeJSON `json:"-"` } -// gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelope] -type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeJSON struct { +// gatewayListItemListResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayListItemListResponseEnvelope] +type gatewayListItemListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -88,58 +86,56 @@ type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListItemListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrorsJSON `json:"-"` +type GatewayListItemListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListItemListResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrors] -type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrorsJSON struct { +// gatewayListItemListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayListItemListResponseEnvelopeErrors] +type gatewayListItemListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListItemListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessagesJSON `json:"-"` +type GatewayListItemListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayListItemListResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessages] -type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessagesJSON struct { +// gatewayListItemListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayListItemListResponseEnvelopeMessages] +type gatewayListItemListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListItemListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeSuccess bool +type GatewayListItemListResponseEnvelopeSuccess bool const ( - GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeSuccessTrue GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeSuccess = true + GatewayListItemListResponseEnvelopeSuccessTrue GatewayListItemListResponseEnvelopeSuccess = true ) -type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfo struct { +type GatewayListItemListResponseEnvelopeResultInfo struct { // Total results returned based on your search parameters. Count float64 `json:"count"` // Current page within paginated list of results. @@ -147,14 +143,13 @@ type GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfo s // Number of results per page of results. PerPage float64 `json:"per_page"` // Total results available without any search parameters. - TotalCount float64 `json:"total_count"` - JSON gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON gatewayListItemListResponseEnvelopeResultInfoJSON `json:"-"` } -// gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfo] -type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfoJSON struct { +// gatewayListItemListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [GatewayListItemListResponseEnvelopeResultInfo] +type gatewayListItemListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -163,6 +158,6 @@ type gatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfoJS ExtraFields map[string]apijson.Field } -func (r *GatewayListItemZeroTrustListsZeroTrustListItemsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayListItemListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/gatewaylistitem_test.go b/gatewaylistitem_test.go index fb785d5097a..3e850e95952 100644 --- a/gatewaylistitem_test.go +++ b/gatewaylistitem_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayListItemZeroTrustListsZeroTrustListItems(t *testing.T) { +func TestGatewayListItemList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestGatewayListItemZeroTrustListsZeroTrustListItems(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Lists.Items.ZeroTrustListsZeroTrustListItems( + _, err := client.Gateways.Lists.Items.List( context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/gatewaylocation.go b/gatewaylocation.go index 6aa0c14a258..3060d46da53 100644 --- a/gatewaylocation.go +++ b/gatewaylocation.go @@ -35,12 +35,25 @@ func NewGatewayLocationService(opts ...option.RequestOption) (r *GatewayLocation return } -// Updates a configured Zero Trust Gateway location. -func (r *GatewayLocationService) Update(ctx context.Context, accountID interface{}, locationID interface{}, body GatewayLocationUpdateParams, opts ...option.RequestOption) (res *GatewayLocationUpdateResponse, err error) { +// Creates a new Zero Trust Gateway location. +func (r *GatewayLocationService) New(ctx context.Context, accountID interface{}, body GatewayLocationNewParams, opts ...option.RequestOption) (res *GatewayLocationNewResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayLocationUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/locations/%v", accountID, locationID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env GatewayLocationNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/locations", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches Zero Trust Gateway locations for an account. +func (r *GatewayLocationService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayLocationListResponse, err error) { + opts = append(r.Options[:], opts...) + var env GatewayLocationListResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/locations", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -74,25 +87,12 @@ func (r *GatewayLocationService) Get(ctx context.Context, accountID interface{}, return } -// Creates a new Zero Trust Gateway location. -func (r *GatewayLocationService) ZeroTrustGatewayLocationsNewZeroTrustGatewayLocation(ctx context.Context, accountID interface{}, body GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams, opts ...option.RequestOption) (res *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse, err error) { - opts = append(r.Options[:], opts...) - var env GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/locations", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches Zero Trust Gateway locations for an account. -func (r *GatewayLocationService) ZeroTrustGatewayLocationsListZeroTrustGatewayLocations(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse, err error) { +// Updates a configured Zero Trust Gateway location. +func (r *GatewayLocationService) Replace(ctx context.Context, accountID interface{}, locationID interface{}, body GatewayLocationReplaceParams, opts ...option.RequestOption) (res *GatewayLocationReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/locations", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env GatewayLocationReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/locations/%v", accountID, locationID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -100,7 +100,7 @@ func (r *GatewayLocationService) ZeroTrustGatewayLocationsListZeroTrustGatewayLo return } -type GatewayLocationUpdateResponse struct { +type GatewayLocationNewResponse struct { ID interface{} `json:"id"` // True if the location is the default location. ClientDefault bool `json:"client_default"` @@ -117,14 +117,14 @@ type GatewayLocationUpdateResponse struct { // The name of the location. Name string `json:"name"` // A list of network ranges that requests from this location would originate from. - Networks []GatewayLocationUpdateResponseNetwork `json:"networks"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayLocationUpdateResponseJSON `json:"-"` + Networks []GatewayLocationNewResponseNetwork `json:"networks"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayLocationNewResponseJSON `json:"-"` } -// gatewayLocationUpdateResponseJSON contains the JSON metadata for the struct -// [GatewayLocationUpdateResponse] -type gatewayLocationUpdateResponseJSON struct { +// gatewayLocationNewResponseJSON contains the JSON metadata for the struct +// [GatewayLocationNewResponse] +type gatewayLocationNewResponseJSON struct { ID apijson.Field ClientDefault apijson.Field CreatedAt apijson.Field @@ -138,46 +138,29 @@ type gatewayLocationUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayLocationUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationUpdateResponseNetwork struct { +type GatewayLocationNewResponseNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. - Network string `json:"network,required"` - JSON gatewayLocationUpdateResponseNetworkJSON `json:"-"` + Network string `json:"network,required"` + JSON gatewayLocationNewResponseNetworkJSON `json:"-"` } -// gatewayLocationUpdateResponseNetworkJSON contains the JSON metadata for the -// struct [GatewayLocationUpdateResponseNetwork] -type gatewayLocationUpdateResponseNetworkJSON struct { +// gatewayLocationNewResponseNetworkJSON contains the JSON metadata for the struct +// [GatewayLocationNewResponseNetwork] +type gatewayLocationNewResponseNetworkJSON struct { Network apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationUpdateResponseNetwork) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationNewResponseNetwork) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [GatewayLocationDeleteResponseUnknown] or -// [shared.UnionString]. -type GatewayLocationDeleteResponse interface { - ImplementsGatewayLocationDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*GatewayLocationDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type GatewayLocationGetResponse struct { +type GatewayLocationListResponse struct { ID interface{} `json:"id"` // True if the location is the default location. ClientDefault bool `json:"client_default"` @@ -194,14 +177,14 @@ type GatewayLocationGetResponse struct { // The name of the location. Name string `json:"name"` // A list of network ranges that requests from this location would originate from. - Networks []GatewayLocationGetResponseNetwork `json:"networks"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayLocationGetResponseJSON `json:"-"` + Networks []GatewayLocationListResponseNetwork `json:"networks"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayLocationListResponseJSON `json:"-"` } -// gatewayLocationGetResponseJSON contains the JSON metadata for the struct -// [GatewayLocationGetResponse] -type gatewayLocationGetResponseJSON struct { +// gatewayLocationListResponseJSON contains the JSON metadata for the struct +// [GatewayLocationListResponse] +type gatewayLocationListResponseJSON struct { ID apijson.Field ClientDefault apijson.Field CreatedAt apijson.Field @@ -215,29 +198,46 @@ type gatewayLocationGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayLocationGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationGetResponseNetwork struct { +type GatewayLocationListResponseNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. - Network string `json:"network,required"` - JSON gatewayLocationGetResponseNetworkJSON `json:"-"` + Network string `json:"network,required"` + JSON gatewayLocationListResponseNetworkJSON `json:"-"` } -// gatewayLocationGetResponseNetworkJSON contains the JSON metadata for the struct -// [GatewayLocationGetResponseNetwork] -type gatewayLocationGetResponseNetworkJSON struct { +// gatewayLocationListResponseNetworkJSON contains the JSON metadata for the struct +// [GatewayLocationListResponseNetwork] +type gatewayLocationListResponseNetworkJSON struct { Network apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationGetResponseNetwork) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationListResponseNetwork) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse struct { +// Union satisfied by [GatewayLocationDeleteResponseUnknown] or +// [shared.UnionString]. +type GatewayLocationDeleteResponse interface { + ImplementsGatewayLocationDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*GatewayLocationDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type GatewayLocationGetResponse struct { ID interface{} `json:"id"` // True if the location is the default location. ClientDefault bool `json:"client_default"` @@ -254,15 +254,14 @@ type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse // The name of the location. Name string `json:"name"` // A list of network ranges that requests from this location would originate from. - Networks []GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetwork `json:"networks"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseJSON `json:"-"` + Networks []GatewayLocationGetResponseNetwork `json:"networks"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayLocationGetResponseJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse] -type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseJSON struct { +// gatewayLocationGetResponseJSON contains the JSON metadata for the struct +// [GatewayLocationGetResponse] +type gatewayLocationGetResponseJSON struct { ID apijson.Field ClientDefault apijson.Field CreatedAt apijson.Field @@ -276,30 +275,29 @@ type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetwork struct { +type GatewayLocationGetResponseNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. - Network string `json:"network,required"` - JSON gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetworkJSON `json:"-"` + Network string `json:"network,required"` + JSON gatewayLocationGetResponseNetworkJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetworkJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetwork] -type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetworkJSON struct { +// gatewayLocationGetResponseNetworkJSON contains the JSON metadata for the struct +// [GatewayLocationGetResponseNetwork] +type gatewayLocationGetResponseNetworkJSON struct { Network apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseNetwork) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationGetResponseNetwork) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse struct { +type GatewayLocationReplaceResponse struct { ID interface{} `json:"id"` // True if the location is the default location. ClientDefault bool `json:"client_default"` @@ -316,15 +314,14 @@ type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsRespon // The name of the location. Name string `json:"name"` // A list of network ranges that requests from this location would originate from. - Networks []GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetwork `json:"networks"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseJSON `json:"-"` + Networks []GatewayLocationReplaceResponseNetwork `json:"networks"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayLocationReplaceResponseJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseJSON struct { +// gatewayLocationReplaceResponseJSON contains the JSON metadata for the struct +// [GatewayLocationReplaceResponse] +type gatewayLocationReplaceResponseJSON struct { ID apijson.Field ClientDefault apijson.Field CreatedAt apijson.Field @@ -338,30 +335,29 @@ type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsRespon ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetwork struct { +type GatewayLocationReplaceResponseNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. - Network string `json:"network,required"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetworkJSON `json:"-"` + Network string `json:"network,required"` + JSON gatewayLocationReplaceResponseNetworkJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetworkJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetwork] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetworkJSON struct { +// gatewayLocationReplaceResponseNetworkJSON contains the JSON metadata for the +// struct [GatewayLocationReplaceResponseNetwork] +type gatewayLocationReplaceResponseNetworkJSON struct { Network apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseNetwork) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationReplaceResponseNetwork) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationUpdateParams struct { +type GatewayLocationNewParams struct { // The name of the location. Name param.Field[string] `json:"name,required"` // True if the location is the default location. @@ -369,34 +365,34 @@ type GatewayLocationUpdateParams struct { // True if the location needs to resolve EDNS queries. EcsSupport param.Field[bool] `json:"ecs_support"` // A list of network ranges that requests from this location would originate from. - Networks param.Field[[]GatewayLocationUpdateParamsNetwork] `json:"networks"` + Networks param.Field[[]GatewayLocationNewParamsNetwork] `json:"networks"` } -func (r GatewayLocationUpdateParams) MarshalJSON() (data []byte, err error) { +func (r GatewayLocationNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayLocationUpdateParamsNetwork struct { +type GatewayLocationNewParamsNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. Network param.Field[string] `json:"network,required"` } -func (r GatewayLocationUpdateParamsNetwork) MarshalJSON() (data []byte, err error) { +func (r GatewayLocationNewParamsNetwork) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayLocationUpdateResponseEnvelope struct { - Errors []GatewayLocationUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayLocationUpdateResponseEnvelopeMessages `json:"messages,required"` - Result GatewayLocationUpdateResponse `json:"result,required"` +type GatewayLocationNewResponseEnvelope struct { + Errors []GatewayLocationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayLocationNewResponseEnvelopeMessages `json:"messages,required"` + Result GatewayLocationNewResponse `json:"result,required"` // Whether the API call was successful - Success GatewayLocationUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayLocationUpdateResponseEnvelopeJSON `json:"-"` + Success GatewayLocationNewResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayLocationNewResponseEnvelopeJSON `json:"-"` } -// gatewayLocationUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [GatewayLocationUpdateResponseEnvelope] -type gatewayLocationUpdateResponseEnvelopeJSON struct { +// gatewayLocationNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayLocationNewResponseEnvelope] +type gatewayLocationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -405,55 +401,153 @@ type gatewayLocationUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayLocationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationUpdateResponseEnvelopeErrorsJSON `json:"-"` +type GatewayLocationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationNewResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayLocationUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [GatewayLocationUpdateResponseEnvelopeErrors] -type gatewayLocationUpdateResponseEnvelopeErrorsJSON struct { +// gatewayLocationNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayLocationNewResponseEnvelopeErrors] +type gatewayLocationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationUpdateResponseEnvelopeMessagesJSON `json:"-"` +type GatewayLocationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// gatewayLocationNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayLocationNewResponseEnvelopeMessages] +type gatewayLocationNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayLocationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// gatewayLocationUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [GatewayLocationUpdateResponseEnvelopeMessages] -type gatewayLocationUpdateResponseEnvelopeMessagesJSON struct { +// Whether the API call was successful +type GatewayLocationNewResponseEnvelopeSuccess bool + +const ( + GatewayLocationNewResponseEnvelopeSuccessTrue GatewayLocationNewResponseEnvelopeSuccess = true +) + +type GatewayLocationListResponseEnvelope struct { + Errors []GatewayLocationListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayLocationListResponseEnvelopeMessages `json:"messages,required"` + Result []GatewayLocationListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success GatewayLocationListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayLocationListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayLocationListResponseEnvelopeJSON `json:"-"` +} + +// gatewayLocationListResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayLocationListResponseEnvelope] +type gatewayLocationListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayLocationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayLocationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationListResponseEnvelopeErrorsJSON `json:"-"` +} + +// gatewayLocationListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayLocationListResponseEnvelopeErrors] +type gatewayLocationListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayLocationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationListResponseEnvelopeMessagesJSON `json:"-"` +} + +// gatewayLocationListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayLocationListResponseEnvelopeMessages] +type gatewayLocationListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayLocationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayLocationUpdateResponseEnvelopeSuccess bool +type GatewayLocationListResponseEnvelopeSuccess bool const ( - GatewayLocationUpdateResponseEnvelopeSuccessTrue GatewayLocationUpdateResponseEnvelopeSuccess = true + GatewayLocationListResponseEnvelopeSuccessTrue GatewayLocationListResponseEnvelopeSuccess = true ) +type GatewayLocationListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON gatewayLocationListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// gatewayLocationListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [GatewayLocationListResponseEnvelopeResultInfo] +type gatewayLocationListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayLocationListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type GatewayLocationDeleteResponseEnvelope struct { Errors []GatewayLocationDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []GatewayLocationDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -592,7 +686,7 @@ const ( GatewayLocationGetResponseEnvelopeSuccessTrue GatewayLocationGetResponseEnvelopeSuccess = true ) -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams struct { +type GatewayLocationReplaceParams struct { // The name of the location. Name param.Field[string] `json:"name,required"` // True if the location is the default location. @@ -600,35 +694,34 @@ type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams s // True if the location needs to resolve EDNS queries. EcsSupport param.Field[bool] `json:"ecs_support"` // A list of network ranges that requests from this location would originate from. - Networks param.Field[[]GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParamsNetwork] `json:"networks"` + Networks param.Field[[]GatewayLocationReplaceParamsNetwork] `json:"networks"` } -func (r GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams) MarshalJSON() (data []byte, err error) { +func (r GatewayLocationReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParamsNetwork struct { +type GatewayLocationReplaceParamsNetwork struct { // The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. Network param.Field[string] `json:"network,required"` } -func (r GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParamsNetwork) MarshalJSON() (data []byte, err error) { +func (r GatewayLocationReplaceParamsNetwork) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelope struct { - Errors []GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessages `json:"messages,required"` - Result GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse `json:"result,required"` +type GatewayLocationReplaceResponseEnvelope struct { + Errors []GatewayLocationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayLocationReplaceResponseEnvelopeMessages `json:"messages,required"` + Result GatewayLocationReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeJSON `json:"-"` + Success GatewayLocationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayLocationReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelope] -type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeJSON struct { +// gatewayLocationReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayLocationReplaceResponseEnvelope] +type gatewayLocationReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -637,155 +730,51 @@ type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponse ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrorsJSON `json:"-"` +type GatewayLocationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrors] -type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrorsJSON struct { +// gatewayLocationReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [GatewayLocationReplaceResponseEnvelopeErrors] +type gatewayLocationReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessagesJSON `json:"-"` +type GatewayLocationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLocationReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessages] -type gatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessagesJSON struct { +// gatewayLocationReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [GatewayLocationReplaceResponseEnvelopeMessages] +type gatewayLocationReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLocationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeSuccess bool +type GatewayLocationReplaceResponseEnvelopeSuccess bool const ( - GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeSuccessTrue GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationResponseEnvelopeSuccess = true + GatewayLocationReplaceResponseEnvelopeSuccessTrue GatewayLocationReplaceResponseEnvelopeSuccess = true ) - -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelope struct { - Errors []GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeJSON `json:"-"` -} - -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelope] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrorsJSON `json:"-"` -} - -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrors] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessages] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeSuccess bool - -const ( - GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeSuccessTrue GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeSuccess = true -) - -type GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfo] -type gatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/gatewaylocation_test.go b/gatewaylocation_test.go index 877726ff4f2..d85b03c4646 100644 --- a/gatewaylocation_test.go +++ b/gatewaylocation_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayLocationUpdateWithOptionalParams(t *testing.T) { +func TestGatewayLocationNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,14 @@ func TestGatewayLocationUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Locations.Update( + _, err := client.Gateways.Locations.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "ed35569b41ce4d1facfe683550f54086", - cloudflare.GatewayLocationUpdateParams{ + cloudflare.GatewayLocationNewParams{ Name: cloudflare.F("Austin Office Location"), ClientDefault: cloudflare.F(false), EcsSupport: cloudflare.F(false), - Networks: cloudflare.F([]cloudflare.GatewayLocationUpdateParamsNetwork{{ + Networks: cloudflare.F([]cloudflare.GatewayLocationNewParamsNetwork{{ Network: cloudflare.F("192.0.2.1/32"), }, { Network: cloudflare.F("192.0.2.1/32"), @@ -55,7 +54,7 @@ func TestGatewayLocationUpdateWithOptionalParams(t *testing.T) { } } -func TestGatewayLocationDelete(t *testing.T) { +func TestGatewayLocationList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -71,11 +70,7 @@ func TestGatewayLocationDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Locations.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "ed35569b41ce4d1facfe683550f54086", - ) + _, err := client.Gateways.Locations.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -85,7 +80,7 @@ func TestGatewayLocationDelete(t *testing.T) { } } -func TestGatewayLocationGet(t *testing.T) { +func TestGatewayLocationDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -101,7 +96,7 @@ func TestGatewayLocationGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Locations.Get( + _, err := client.Gateways.Locations.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", "ed35569b41ce4d1facfe683550f54086", @@ -115,7 +110,7 @@ func TestGatewayLocationGet(t *testing.T) { } } -func TestGatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationWithOptionalParams(t *testing.T) { +func TestGatewayLocationGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -131,21 +126,10 @@ func TestGatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationWith option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Locations.ZeroTrustGatewayLocationsNewZeroTrustGatewayLocation( + _, err := client.Gateways.Locations.Get( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParams{ - Name: cloudflare.F("Austin Office Location"), - ClientDefault: cloudflare.F(false), - EcsSupport: cloudflare.F(false), - Networks: cloudflare.F([]cloudflare.GatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationParamsNetwork{{ - Network: cloudflare.F("192.0.2.1/32"), - }, { - Network: cloudflare.F("192.0.2.1/32"), - }, { - Network: cloudflare.F("192.0.2.1/32"), - }}), - }, + "ed35569b41ce4d1facfe683550f54086", ) if err != nil { var apierr *cloudflare.Error @@ -156,7 +140,7 @@ func TestGatewayLocationZeroTrustGatewayLocationsNewZeroTrustGatewayLocationWith } } -func TestGatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocations(t *testing.T) { +func TestGatewayLocationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -172,7 +156,23 @@ func TestGatewayLocationZeroTrustGatewayLocationsListZeroTrustGatewayLocations(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Locations.ZeroTrustGatewayLocationsListZeroTrustGatewayLocations(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.Locations.Replace( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "ed35569b41ce4d1facfe683550f54086", + cloudflare.GatewayLocationReplaceParams{ + Name: cloudflare.F("Austin Office Location"), + ClientDefault: cloudflare.F(false), + EcsSupport: cloudflare.F(false), + Networks: cloudflare.F([]cloudflare.GatewayLocationReplaceParamsNetwork{{ + Network: cloudflare.F("192.0.2.1/32"), + }, { + Network: cloudflare.F("192.0.2.1/32"), + }, { + Network: cloudflare.F("192.0.2.1/32"), + }}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewaylogging.go b/gatewaylogging.go index a7c0841a0e7..2bd4a43c503 100644 --- a/gatewaylogging.go +++ b/gatewaylogging.go @@ -32,9 +32,9 @@ func NewGatewayLoggingService(opts ...option.RequestOption) (r *GatewayLoggingSe } // Fetches the current logging settings for Zero Trust account. -func (r *GatewayLoggingService) ZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse, err error) { +func (r *GatewayLoggingService) Get(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *GatewayLoggingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelope + var env GatewayLoggingGetResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/logging", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,9 +45,9 @@ func (r *GatewayLoggingService) ZeroTrustAccountsGetLoggingSettingsForTheZeroTru } // Updates logging settings for the current Zero Trust account. -func (r *GatewayLoggingService) ZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccount(ctx context.Context, accountID interface{}, body GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParams, opts ...option.RequestOption) (res *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse, err error) { +func (r *GatewayLoggingService) Replace(ctx context.Context, accountID interface{}, body GatewayLoggingReplaceParams, opts ...option.RequestOption) (res *GatewayLoggingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelope + var env GatewayLoggingReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/gateway/logging", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -57,44 +57,42 @@ func (r *GatewayLoggingService) ZeroTrustAccountsUpdateLoggingSettingsForTheZero return } -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse struct { +type GatewayLoggingGetResponse struct { // Redact personally identifiable information from activity logging (PII fields // are: source IP, user email, user ID, device ID, URL, referrer, user agent). RedactPii bool `json:"redact_pii"` // Logging settings by rule type. - SettingsByRuleType GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType `json:"settings_by_rule_type"` - JSON gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseJSON `json:"-"` + SettingsByRuleType GatewayLoggingGetResponseSettingsByRuleType `json:"settings_by_rule_type"` + JSON gatewayLoggingGetResponseJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse] -type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseJSON struct { +// gatewayLoggingGetResponseJSON contains the JSON metadata for the struct +// [GatewayLoggingGetResponse] +type gatewayLoggingGetResponseJSON struct { RedactPii apijson.Field SettingsByRuleType apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Logging settings by rule type. -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType struct { +type GatewayLoggingGetResponseSettingsByRuleType struct { // Logging settings for DNS firewall. DNS interface{} `json:"dns"` // Logging settings for HTTP/HTTPS firewall. HTTP interface{} `json:"http"` // Logging settings for Network firewall. - L4 interface{} `json:"l4"` - JSON gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON `json:"-"` + L4 interface{} `json:"l4"` + JSON gatewayLoggingGetResponseSettingsByRuleTypeJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType] -type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON struct { +// gatewayLoggingGetResponseSettingsByRuleTypeJSON contains the JSON metadata for +// the struct [GatewayLoggingGetResponseSettingsByRuleType] +type gatewayLoggingGetResponseSettingsByRuleTypeJSON struct { DNS apijson.Field HTTP apijson.Field L4 apijson.Field @@ -102,48 +100,46 @@ type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResp ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingGetResponseSettingsByRuleType) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse struct { +type GatewayLoggingReplaceResponse struct { // Redact personally identifiable information from activity logging (PII fields // are: source IP, user email, user ID, device ID, URL, referrer, user agent). RedactPii bool `json:"redact_pii"` // Logging settings by rule type. - SettingsByRuleType GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType `json:"settings_by_rule_type"` - JSON gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseJSON `json:"-"` + SettingsByRuleType GatewayLoggingReplaceResponseSettingsByRuleType `json:"settings_by_rule_type"` + JSON gatewayLoggingReplaceResponseJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse] -type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseJSON struct { +// gatewayLoggingReplaceResponseJSON contains the JSON metadata for the struct +// [GatewayLoggingReplaceResponse] +type gatewayLoggingReplaceResponseJSON struct { RedactPii apijson.Field SettingsByRuleType apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Logging settings by rule type. -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType struct { +type GatewayLoggingReplaceResponseSettingsByRuleType struct { // Logging settings for DNS firewall. DNS interface{} `json:"dns"` // Logging settings for HTTP/HTTPS firewall. HTTP interface{} `json:"http"` // Logging settings for Network firewall. - L4 interface{} `json:"l4"` - JSON gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON `json:"-"` + L4 interface{} `json:"l4"` + JSON gatewayLoggingReplaceResponseSettingsByRuleTypeJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType] -type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleTypeJSON struct { +// gatewayLoggingReplaceResponseSettingsByRuleTypeJSON contains the JSON metadata +// for the struct [GatewayLoggingReplaceResponseSettingsByRuleType] +type gatewayLoggingReplaceResponseSettingsByRuleTypeJSON struct { DNS apijson.Field HTTP apijson.Field L4 apijson.Field @@ -151,23 +147,22 @@ type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountR ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseSettingsByRuleType) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingReplaceResponseSettingsByRuleType) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelope struct { - Errors []GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages `json:"messages,required"` - Result GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponse `json:"result,required"` +type GatewayLoggingGetResponseEnvelope struct { + Errors []GatewayLoggingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayLoggingGetResponseEnvelopeMessages `json:"messages,required"` + Result GatewayLoggingGetResponse `json:"result,required"` // Whether the API call was successful - Success GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON `json:"-"` + Success GatewayLoggingGetResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayLoggingGetResponseEnvelopeJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelope] -type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON struct { +// gatewayLoggingGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayLoggingGetResponseEnvelope] +type gatewayLoggingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -176,71 +171,69 @@ type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResp ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON `json:"-"` +type GatewayLoggingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLoggingGetResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors] -type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON struct { +// gatewayLoggingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayLoggingGetResponseEnvelopeErrors] +type gatewayLoggingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON `json:"-"` +type GatewayLoggingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLoggingGetResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages] -type gatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON struct { +// gatewayLoggingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayLoggingGetResponseEnvelopeMessages] +type gatewayLoggingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess bool +type GatewayLoggingGetResponseEnvelopeSuccess bool const ( - GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccessTrue GatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess = true + GatewayLoggingGetResponseEnvelopeSuccessTrue GatewayLoggingGetResponseEnvelopeSuccess = true ) -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParams struct { +type GatewayLoggingReplaceParams struct { // Redact personally identifiable information from activity logging (PII fields // are: source IP, user email, user ID, device ID, URL, referrer, user agent). RedactPii param.Field[bool] `json:"redact_pii"` // Logging settings by rule type. - SettingsByRuleType param.Field[GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParamsSettingsByRuleType] `json:"settings_by_rule_type"` + SettingsByRuleType param.Field[GatewayLoggingReplaceParamsSettingsByRuleType] `json:"settings_by_rule_type"` } -func (r GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParams) MarshalJSON() (data []byte, err error) { +func (r GatewayLoggingReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Logging settings by rule type. -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParamsSettingsByRuleType struct { +type GatewayLoggingReplaceParamsSettingsByRuleType struct { // Logging settings for DNS firewall. DNS param.Field[interface{}] `json:"dns"` // Logging settings for HTTP/HTTPS firewall. @@ -249,23 +242,22 @@ type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountP L4 param.Field[interface{}] `json:"l4"` } -func (r GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParamsSettingsByRuleType) MarshalJSON() (data []byte, err error) { +func (r GatewayLoggingReplaceParamsSettingsByRuleType) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelope struct { - Errors []GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages `json:"messages,required"` - Result GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponse `json:"result,required"` +type GatewayLoggingReplaceResponseEnvelope struct { + Errors []GatewayLoggingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayLoggingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result GatewayLoggingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON `json:"-"` + Success GatewayLoggingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayLoggingReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelope] -type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeJSON struct { +// gatewayLoggingReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayLoggingReplaceResponseEnvelope] +type gatewayLoggingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -274,53 +266,51 @@ type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountR ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON `json:"-"` +type GatewayLoggingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLoggingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors] -type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrorsJSON struct { +// gatewayLoggingReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [GatewayLoggingReplaceResponseEnvelopeErrors] +type gatewayLoggingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON `json:"-"` +type GatewayLoggingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayLoggingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages] -type gatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessagesJSON struct { +// gatewayLoggingReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayLoggingReplaceResponseEnvelopeMessages] +type gatewayLoggingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayLoggingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess bool +type GatewayLoggingReplaceResponseEnvelopeSuccess bool const ( - GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccessTrue GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountResponseEnvelopeSuccess = true + GatewayLoggingReplaceResponseEnvelopeSuccessTrue GatewayLoggingReplaceResponseEnvelopeSuccess = true ) diff --git a/gatewaylogging_test.go b/gatewaylogging_test.go index 93f01de6264..01b58d322e6 100644 --- a/gatewaylogging_test.go +++ b/gatewaylogging_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount(t *testing.T) { +func TestGatewayLoggingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestGatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Loggings.ZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount(context.TODO(), "699d98642c564d2e855e9661899b7252") + _, err := client.Gateways.Loggings.Get(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestGatewayLoggingZeroTrustAccountsGetLoggingSettingsForTheZeroTrustAccount } } -func TestGatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountWithOptionalParams(t *testing.T) { +func TestGatewayLoggingReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,12 +55,12 @@ func TestGatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAcco option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Loggings.ZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccount( + _, err := client.Gateways.Loggings.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParams{ + cloudflare.GatewayLoggingReplaceParams{ RedactPii: cloudflare.F(true), - SettingsByRuleType: cloudflare.F(cloudflare.GatewayLoggingZeroTrustAccountsUpdateLoggingSettingsForTheZeroTrustAccountParamsSettingsByRuleType{ + SettingsByRuleType: cloudflare.F(cloudflare.GatewayLoggingReplaceParamsSettingsByRuleType{ DNS: cloudflare.F[any](map[string]interface{}{}), HTTP: cloudflare.F[any](map[string]interface{}{}), L4: cloudflare.F[any](map[string]interface{}{}), diff --git a/gatewayproxyendpoint.go b/gatewayproxyendpoint.go index 6cf4871ae21..2a3924e456d 100644 --- a/gatewayproxyendpoint.go +++ b/gatewayproxyendpoint.go @@ -35,6 +35,19 @@ func NewGatewayProxyEndpointService(opts ...option.RequestOption) (r *GatewayPro return } +// Creates a new Zero Trust Gateway proxy endpoint. +func (r *GatewayProxyEndpointService) New(ctx context.Context, accountID interface{}, body GatewayProxyEndpointNewParams, opts ...option.RequestOption) (res *GatewayProxyEndpointNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env GatewayProxyEndpointNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/proxy_endpoints", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Updates a configured Zero Trust Gateway proxy endpoint. func (r *GatewayProxyEndpointService) Update(ctx context.Context, accountID interface{}, proxyEndpointID interface{}, body GatewayProxyEndpointUpdateParams, opts ...option.RequestOption) (res *GatewayProxyEndpointUpdateResponse, err error) { opts = append(r.Options[:], opts...) @@ -48,11 +61,11 @@ func (r *GatewayProxyEndpointService) Update(ctx context.Context, accountID inte return } -// Fetches all Zero Trust Gateway proxy endpoints for an account. -func (r *GatewayProxyEndpointService) List(ctx context.Context, accountID interface{}, proxyEndpointID interface{}, opts ...option.RequestOption) (res *GatewayProxyEndpointListResponse, err error) { +// Fetches a single Zero Trust Gateway proxy endpoint. +func (r *GatewayProxyEndpointService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayProxyEndpointListResponse, err error) { opts = append(r.Options[:], opts...) var env GatewayProxyEndpointListResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/proxy_endpoints/%v", accountID, proxyEndpointID) + path := fmt.Sprintf("accounts/%v/gateway/proxy_endpoints", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -87,30 +100,34 @@ func (r *GatewayProxyEndpointService) Get(ctx context.Context, accountID interfa return } -// Creates a new Zero Trust Gateway proxy endpoint. -func (r *GatewayProxyEndpointService) ZeroTrustGatewayProxyEndpointsNewProxyEndpoint(ctx context.Context, accountID interface{}, body GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointParams, opts ...option.RequestOption) (res *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse, err error) { - opts = append(r.Options[:], opts...) - var env GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/proxy_endpoints", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type GatewayProxyEndpointNewResponse struct { + ID interface{} `json:"id"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // A list of CIDRs to restrict ingress connections. + IPs []string `json:"ips"` + // The name of the proxy endpoint. + Name string `json:"name"` + // The subdomain to be used as the destination in the proxy client. + Subdomain string `json:"subdomain"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayProxyEndpointNewResponseJSON `json:"-"` } -// Fetches a single Zero Trust Gateway proxy endpoint. -func (r *GatewayProxyEndpointService) ZeroTrustGatewayProxyEndpointsListProxyEndpoints(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse, err error) { - opts = append(r.Options[:], opts...) - var env GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/proxy_endpoints", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +// gatewayProxyEndpointNewResponseJSON contains the JSON metadata for the struct +// [GatewayProxyEndpointNewResponse] +type gatewayProxyEndpointNewResponseJSON struct { + ID apijson.Field + CreatedAt apijson.Field + IPs apijson.Field + Name apijson.Field + Subdomain apijson.Field + UpdatedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayProxyEndpointNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } type GatewayProxyEndpointUpdateResponse struct { @@ -220,68 +237,88 @@ func (r *GatewayProxyEndpointGetResponse) UnmarshalJSON(data []byte) (err error) return apijson.UnmarshalRoot(data, r) } -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse struct { - ID interface{} `json:"id"` - CreatedAt time.Time `json:"created_at" format:"date-time"` +type GatewayProxyEndpointNewParams struct { // A list of CIDRs to restrict ingress connections. - IPs []string `json:"ips"` + IPs param.Field[[]string] `json:"ips,required"` // The name of the proxy endpoint. - Name string `json:"name"` + Name param.Field[string] `json:"name,required"` // The subdomain to be used as the destination in the proxy client. - Subdomain string `json:"subdomain"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseJSON `json:"-"` + Subdomain param.Field[string] `json:"subdomain"` } -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseJSON struct { - ID apijson.Field - CreatedAt apijson.Field - IPs apijson.Field - Name apijson.Field - Subdomain apijson.Field - UpdatedAt apijson.Field +func (r GatewayProxyEndpointNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type GatewayProxyEndpointNewResponseEnvelope struct { + Errors []GatewayProxyEndpointNewResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayProxyEndpointNewResponseEnvelopeMessages `json:"messages,required"` + Result GatewayProxyEndpointNewResponse `json:"result,required"` + // Whether the API call was successful + Success GatewayProxyEndpointNewResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayProxyEndpointNewResponseEnvelopeJSON `json:"-"` +} + +// gatewayProxyEndpointNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [GatewayProxyEndpointNewResponseEnvelope] +type gatewayProxyEndpointNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayProxyEndpointNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse struct { - ID interface{} `json:"id"` - CreatedAt time.Time `json:"created_at" format:"date-time"` - // A list of CIDRs to restrict ingress connections. - IPs []string `json:"ips"` - // The name of the proxy endpoint. - Name string `json:"name"` - // The subdomain to be used as the destination in the proxy client. - Subdomain string `json:"subdomain"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseJSON `json:"-"` +type GatewayProxyEndpointNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayProxyEndpointNewResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseJSON struct { - ID apijson.Field - CreatedAt apijson.Field - IPs apijson.Field - Name apijson.Field - Subdomain apijson.Field - UpdatedAt apijson.Field +// gatewayProxyEndpointNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [GatewayProxyEndpointNewResponseEnvelopeErrors] +type gatewayProxyEndpointNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayProxyEndpointNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type GatewayProxyEndpointNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayProxyEndpointNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// gatewayProxyEndpointNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [GatewayProxyEndpointNewResponseEnvelopeMessages] +type gatewayProxyEndpointNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayProxyEndpointNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type GatewayProxyEndpointNewResponseEnvelopeSuccess bool + +const ( + GatewayProxyEndpointNewResponseEnvelopeSuccessTrue GatewayProxyEndpointNewResponseEnvelopeSuccess = true +) + type GatewayProxyEndpointUpdateParams struct { // A list of CIDRs to restrict ingress connections. IPs param.Field[[]string] `json:"ips"` @@ -367,10 +404,11 @@ const ( type GatewayProxyEndpointListResponseEnvelope struct { Errors []GatewayProxyEndpointListResponseEnvelopeErrors `json:"errors,required"` Messages []GatewayProxyEndpointListResponseEnvelopeMessages `json:"messages,required"` - Result GatewayProxyEndpointListResponse `json:"result,required"` + Result []GatewayProxyEndpointListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success GatewayProxyEndpointListResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayProxyEndpointListResponseEnvelopeJSON `json:"-"` + Success GatewayProxyEndpointListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayProxyEndpointListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayProxyEndpointListResponseEnvelopeJSON `json:"-"` } // gatewayProxyEndpointListResponseEnvelopeJSON contains the JSON metadata for the @@ -380,6 +418,7 @@ type gatewayProxyEndpointListResponseEnvelopeJSON struct { Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -433,6 +472,33 @@ const ( GatewayProxyEndpointListResponseEnvelopeSuccessTrue GatewayProxyEndpointListResponseEnvelopeSuccess = true ) +type GatewayProxyEndpointListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON gatewayProxyEndpointListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// gatewayProxyEndpointListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [GatewayProxyEndpointListResponseEnvelopeResultInfo] +type gatewayProxyEndpointListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayProxyEndpointListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type GatewayProxyEndpointDeleteResponseEnvelope struct { Errors []GatewayProxyEndpointDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []GatewayProxyEndpointDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -570,190 +636,3 @@ type GatewayProxyEndpointGetResponseEnvelopeSuccess bool const ( GatewayProxyEndpointGetResponseEnvelopeSuccessTrue GatewayProxyEndpointGetResponseEnvelopeSuccess = true ) - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointParams struct { - // A list of CIDRs to restrict ingress connections. - IPs param.Field[[]string] `json:"ips,required"` - // The name of the proxy endpoint. - Name param.Field[string] `json:"name,required"` - // The subdomain to be used as the destination in the proxy client. - Subdomain param.Field[string] `json:"subdomain"` -} - -func (r GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelope struct { - Errors []GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessages `json:"messages,required"` - Result GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponse `json:"result,required"` - // Whether the API call was successful - Success GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelope] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrorsJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrors] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessages] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeSuccess bool - -const ( - GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeSuccessTrue GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointResponseEnvelopeSuccess = true -) - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelope struct { - Errors []GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelope] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrorsJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrors] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessages] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeSuccess bool - -const ( - GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeSuccessTrue GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeSuccess = true -) - -type GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfo] -type gatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpointsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/gatewayproxyendpoint_test.go b/gatewayproxyendpoint_test.go index eff13c14c96..7fcc115c14e 100644 --- a/gatewayproxyendpoint_test.go +++ b/gatewayproxyendpoint_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayProxyEndpointUpdateWithOptionalParams(t *testing.T) { +func TestGatewayProxyEndpointNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestGatewayProxyEndpointUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ProxyEndpoints.Update( + _, err := client.Gateways.ProxyEndpoints.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "ed35569b41ce4d1facfe683550f54086", - cloudflare.GatewayProxyEndpointUpdateParams{ + cloudflare.GatewayProxyEndpointNewParams{ IPs: cloudflare.F([]string{"192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"}), Name: cloudflare.F("Devops team"), Subdomain: cloudflare.F("oli3n9zkz5.proxy.cloudflare-gateway.com"), @@ -48,7 +47,7 @@ func TestGatewayProxyEndpointUpdateWithOptionalParams(t *testing.T) { } } -func TestGatewayProxyEndpointList(t *testing.T) { +func TestGatewayProxyEndpointUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,10 +63,15 @@ func TestGatewayProxyEndpointList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ProxyEndpoints.List( + _, err := client.Gateways.ProxyEndpoints.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", "ed35569b41ce4d1facfe683550f54086", + cloudflare.GatewayProxyEndpointUpdateParams{ + IPs: cloudflare.F([]string{"192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"}), + Name: cloudflare.F("Devops team"), + Subdomain: cloudflare.F("oli3n9zkz5.proxy.cloudflare-gateway.com"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +82,7 @@ func TestGatewayProxyEndpointList(t *testing.T) { } } -func TestGatewayProxyEndpointDelete(t *testing.T) { +func TestGatewayProxyEndpointList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,11 +98,7 @@ func TestGatewayProxyEndpointDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ProxyEndpoints.Delete( - context.TODO(), - "699d98642c564d2e855e9661899b7252", - "ed35569b41ce4d1facfe683550f54086", - ) + _, err := client.Gateways.ProxyEndpoints.List(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -108,7 +108,7 @@ func TestGatewayProxyEndpointDelete(t *testing.T) { } } -func TestGatewayProxyEndpointGet(t *testing.T) { +func TestGatewayProxyEndpointDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,7 +124,7 @@ func TestGatewayProxyEndpointGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ProxyEndpoints.Get( + _, err := client.Gateways.ProxyEndpoints.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", "ed35569b41ce4d1facfe683550f54086", @@ -138,7 +138,7 @@ func TestGatewayProxyEndpointGet(t *testing.T) { } } -func TestGatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointWithOptionalParams(t *testing.T) { +func TestGatewayProxyEndpointGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -154,41 +154,11 @@ func TestGatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointWithO option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.ProxyEndpoints.ZeroTrustGatewayProxyEndpointsNewProxyEndpoint( + _, err := client.Gateways.ProxyEndpoints.Get( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayProxyEndpointZeroTrustGatewayProxyEndpointsNewProxyEndpointParams{ - IPs: cloudflare.F([]string{"192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"}), - Name: cloudflare.F("Devops team"), - Subdomain: cloudflare.F("oli3n9zkz5.proxy.cloudflare-gateway.com"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestGatewayProxyEndpointZeroTrustGatewayProxyEndpointsListProxyEndpoints(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), + "ed35569b41ce4d1facfe683550f54086", ) - _, err := client.Gateways.ProxyEndpoints.ZeroTrustGatewayProxyEndpointsListProxyEndpoints(context.TODO(), "699d98642c564d2e855e9661899b7252") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/gatewayrule.go b/gatewayrule.go index 30b83ae1b75..a669a50edc6 100644 --- a/gatewayrule.go +++ b/gatewayrule.go @@ -35,12 +35,25 @@ func NewGatewayRuleService(opts ...option.RequestOption) (r *GatewayRuleService) return } -// Updates a configured Zero Trust Gateway rule. -func (r *GatewayRuleService) Update(ctx context.Context, accountID interface{}, ruleID string, body GatewayRuleUpdateParams, opts ...option.RequestOption) (res *GatewayRuleUpdateResponse, err error) { +// Creates a new Zero Trust Gateway rule. +func (r *GatewayRuleService) New(ctx context.Context, accountID interface{}, body GatewayRuleNewParams, opts ...option.RequestOption) (res *GatewayRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayRuleUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/rules/%s", accountID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env GatewayRuleNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/rules", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches the Zero Trust Gateway rules for an account. +func (r *GatewayRuleService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayRuleListResponse, err error) { + opts = append(r.Options[:], opts...) + var env GatewayRuleListResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/rules", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -74,25 +87,12 @@ func (r *GatewayRuleService) Get(ctx context.Context, accountID interface{}, rul return } -// Creates a new Zero Trust Gateway rule. -func (r *GatewayRuleService) ZeroTrustGatewayRulesNewZeroTrustGatewayRule(ctx context.Context, accountID interface{}, body GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams, opts ...option.RequestOption) (res *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/rules", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches the Zero Trust Gateway rules for an account. -func (r *GatewayRuleService) ZeroTrustGatewayRulesListZeroTrustGatewayRules(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse, err error) { +// Updates a configured Zero Trust Gateway rule. +func (r *GatewayRuleService) Replace(ctx context.Context, accountID interface{}, ruleID string, body GatewayRuleReplaceParams, opts ...option.RequestOption) (res *GatewayRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelope - path := fmt.Sprintf("accounts/%v/gateway/rules", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env GatewayRuleReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/gateway/rules/%s", accountID, ruleID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -100,13 +100,13 @@ func (r *GatewayRuleService) ZeroTrustGatewayRulesListZeroTrustGatewayRules(ctx return } -type GatewayRuleUpdateResponse struct { +type GatewayRuleNewResponse struct { // The API resource UUID. ID string `json:"id"` // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action GatewayRuleUpdateResponseAction `json:"action"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + Action GatewayRuleNewResponseAction `json:"action"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // Date of deletion, if any. DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` // The description of the rule. @@ -117,7 +117,7 @@ type GatewayRuleUpdateResponse struct { Enabled bool `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters []GatewayRuleUpdateResponseFilter `json:"filters"` + Filters []GatewayRuleNewResponseFilter `json:"filters"` // The wirefilter expression used for identity matching. Identity string `json:"identity"` // The name of the rule. @@ -127,19 +127,19 @@ type GatewayRuleUpdateResponse struct { // ascending order of this value. Precedence int64 `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings GatewayRuleUpdateResponseRuleSettings `json:"rule_settings"` + RuleSettings GatewayRuleNewResponseRuleSettings `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule GatewayRuleUpdateResponseSchedule `json:"schedule"` + Schedule GatewayRuleNewResponseSchedule `json:"schedule"` // The wirefilter expression used for traffic matching. - Traffic string `json:"traffic"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayRuleUpdateResponseJSON `json:"-"` + Traffic string `json:"traffic"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayRuleNewResponseJSON `json:"-"` } -// gatewayRuleUpdateResponseJSON contains the JSON metadata for the struct -// [GatewayRuleUpdateResponse] -type gatewayRuleUpdateResponseJSON struct { +// gatewayRuleNewResponseJSON contains the JSON metadata for the struct +// [GatewayRuleNewResponse] +type gatewayRuleNewResponseJSON struct { ID apijson.Field Action apijson.Field CreatedAt apijson.Field @@ -159,52 +159,52 @@ type gatewayRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleUpdateResponseAction string +type GatewayRuleNewResponseAction string const ( - GatewayRuleUpdateResponseActionOn GatewayRuleUpdateResponseAction = "on" - GatewayRuleUpdateResponseActionOff GatewayRuleUpdateResponseAction = "off" - GatewayRuleUpdateResponseActionAllow GatewayRuleUpdateResponseAction = "allow" - GatewayRuleUpdateResponseActionBlock GatewayRuleUpdateResponseAction = "block" - GatewayRuleUpdateResponseActionScan GatewayRuleUpdateResponseAction = "scan" - GatewayRuleUpdateResponseActionNoscan GatewayRuleUpdateResponseAction = "noscan" - GatewayRuleUpdateResponseActionSafesearch GatewayRuleUpdateResponseAction = "safesearch" - GatewayRuleUpdateResponseActionYtrestricted GatewayRuleUpdateResponseAction = "ytrestricted" - GatewayRuleUpdateResponseActionIsolate GatewayRuleUpdateResponseAction = "isolate" - GatewayRuleUpdateResponseActionNoisolate GatewayRuleUpdateResponseAction = "noisolate" - GatewayRuleUpdateResponseActionOverride GatewayRuleUpdateResponseAction = "override" - GatewayRuleUpdateResponseActionL4Override GatewayRuleUpdateResponseAction = "l4_override" - GatewayRuleUpdateResponseActionEgress GatewayRuleUpdateResponseAction = "egress" - GatewayRuleUpdateResponseActionAuditSSH GatewayRuleUpdateResponseAction = "audit_ssh" + GatewayRuleNewResponseActionOn GatewayRuleNewResponseAction = "on" + GatewayRuleNewResponseActionOff GatewayRuleNewResponseAction = "off" + GatewayRuleNewResponseActionAllow GatewayRuleNewResponseAction = "allow" + GatewayRuleNewResponseActionBlock GatewayRuleNewResponseAction = "block" + GatewayRuleNewResponseActionScan GatewayRuleNewResponseAction = "scan" + GatewayRuleNewResponseActionNoscan GatewayRuleNewResponseAction = "noscan" + GatewayRuleNewResponseActionSafesearch GatewayRuleNewResponseAction = "safesearch" + GatewayRuleNewResponseActionYtrestricted GatewayRuleNewResponseAction = "ytrestricted" + GatewayRuleNewResponseActionIsolate GatewayRuleNewResponseAction = "isolate" + GatewayRuleNewResponseActionNoisolate GatewayRuleNewResponseAction = "noisolate" + GatewayRuleNewResponseActionOverride GatewayRuleNewResponseAction = "override" + GatewayRuleNewResponseActionL4Override GatewayRuleNewResponseAction = "l4_override" + GatewayRuleNewResponseActionEgress GatewayRuleNewResponseAction = "egress" + GatewayRuleNewResponseActionAuditSSH GatewayRuleNewResponseAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleUpdateResponseFilter string +type GatewayRuleNewResponseFilter string const ( - GatewayRuleUpdateResponseFilterHTTP GatewayRuleUpdateResponseFilter = "http" - GatewayRuleUpdateResponseFilterDNS GatewayRuleUpdateResponseFilter = "dns" - GatewayRuleUpdateResponseFilterL4 GatewayRuleUpdateResponseFilter = "l4" - GatewayRuleUpdateResponseFilterEgress GatewayRuleUpdateResponseFilter = "egress" + GatewayRuleNewResponseFilterHTTP GatewayRuleNewResponseFilter = "http" + GatewayRuleNewResponseFilterDNS GatewayRuleNewResponseFilter = "dns" + GatewayRuleNewResponseFilterL4 GatewayRuleNewResponseFilter = "l4" + GatewayRuleNewResponseFilterEgress GatewayRuleNewResponseFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleUpdateResponseRuleSettings struct { +type GatewayRuleNewResponseRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders interface{} `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass bool `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH GatewayRuleUpdateResponseRuleSettingsAuditSSH `json:"audit_ssh"` + AuditSSH GatewayRuleNewResponseRuleSettingsAuditSSH `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls GatewayRuleUpdateResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` + BisoAdminControls GatewayRuleNewResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled bool `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -213,15 +213,15 @@ type GatewayRuleUpdateResponseRuleSettings struct { // Set by children MSP accounts to bypass their parent's rules. BypassParentRule bool `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession GatewayRuleUpdateResponseRuleSettingsCheckSession `json:"check_session"` + CheckSession GatewayRuleNewResponseRuleSettingsCheckSession `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers GatewayRuleUpdateResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` + DNSResolvers GatewayRuleNewResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress GatewayRuleUpdateResponseRuleSettingsEgress `json:"egress"` + Egress GatewayRuleNewResponseRuleSettingsEgress `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -231,27 +231,27 @@ type GatewayRuleUpdateResponseRuleSettings struct { // indicator feeds only block based on domain names. IPIndicatorFeeds bool `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override GatewayRuleUpdateResponseRuleSettingsL4override `json:"l4override"` + L4override GatewayRuleNewResponseRuleSettingsL4override `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings GatewayRuleUpdateResponseRuleSettingsNotificationSettings `json:"notification_settings"` + NotificationSettings GatewayRuleNewResponseRuleSettingsNotificationSettings `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost string `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs []string `json:"override_ips"` // Configure DLP payload logging. - PayloadLog GatewayRuleUpdateResponseRuleSettingsPayloadLog `json:"payload_log"` + PayloadLog GatewayRuleNewResponseRuleSettingsPayloadLog `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare bool `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert GatewayRuleUpdateResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` - JSON gatewayRuleUpdateResponseRuleSettingsJSON `json:"-"` + UntrustedCert GatewayRuleNewResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` + JSON gatewayRuleNewResponseRuleSettingsJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsJSON contains the JSON metadata for the -// struct [GatewayRuleUpdateResponseRuleSettings] -type gatewayRuleUpdateResponseRuleSettingsJSON struct { +// gatewayRuleNewResponseRuleSettingsJSON contains the JSON metadata for the struct +// [GatewayRuleNewResponseRuleSettings] +type gatewayRuleNewResponseRuleSettingsJSON struct { AddHeaders apijson.Field AllowChildBypass apijson.Field AuditSSH apijson.Field @@ -276,31 +276,31 @@ type gatewayRuleUpdateResponseRuleSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Settings for the Audit SSH action. -type GatewayRuleUpdateResponseRuleSettingsAuditSSH struct { +type GatewayRuleNewResponseRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. - CommandLogging bool `json:"command_logging"` - JSON gatewayRuleUpdateResponseRuleSettingsAuditSSHJSON `json:"-"` + CommandLogging bool `json:"command_logging"` + JSON gatewayRuleNewResponseRuleSettingsAuditSSHJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsAuditSSHJSON contains the JSON metadata for -// the struct [GatewayRuleUpdateResponseRuleSettingsAuditSSH] -type gatewayRuleUpdateResponseRuleSettingsAuditSSHJSON struct { +// gatewayRuleNewResponseRuleSettingsAuditSSHJSON contains the JSON metadata for +// the struct [GatewayRuleNewResponseRuleSettingsAuditSSH] +type gatewayRuleNewResponseRuleSettingsAuditSSHJSON struct { CommandLogging apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how browser isolation behaves. -type GatewayRuleUpdateResponseRuleSettingsBisoAdminControls struct { +type GatewayRuleNewResponseRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp bool `json:"dcp"` // Set to true to enable downloading. @@ -310,13 +310,13 @@ type GatewayRuleUpdateResponseRuleSettingsBisoAdminControls struct { // Set to true to enable printing. Dp bool `json:"dp"` // Set to true to enable uploading. - Du bool `json:"du"` - JSON gatewayRuleUpdateResponseRuleSettingsBisoAdminControlsJSON `json:"-"` + Du bool `json:"du"` + JSON gatewayRuleNewResponseRuleSettingsBisoAdminControlsJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsBisoAdminControlsJSON contains the JSON -// metadata for the struct [GatewayRuleUpdateResponseRuleSettingsBisoAdminControls] -type gatewayRuleUpdateResponseRuleSettingsBisoAdminControlsJSON struct { +// gatewayRuleNewResponseRuleSettingsBisoAdminControlsJSON contains the JSON +// metadata for the struct [GatewayRuleNewResponseRuleSettingsBisoAdminControls] +type gatewayRuleNewResponseRuleSettingsBisoAdminControlsJSON struct { Dcp apijson.Field Dd apijson.Field Dk apijson.Field @@ -326,55 +326,55 @@ type gatewayRuleUpdateResponseRuleSettingsBisoAdminControlsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how session check behaves. -type GatewayRuleUpdateResponseRuleSettingsCheckSession struct { +type GatewayRuleNewResponseRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration string `json:"duration"` // Set to true to enable session enforcement. - Enforce bool `json:"enforce"` - JSON gatewayRuleUpdateResponseRuleSettingsCheckSessionJSON `json:"-"` + Enforce bool `json:"enforce"` + JSON gatewayRuleNewResponseRuleSettingsCheckSessionJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsCheckSessionJSON contains the JSON metadata -// for the struct [GatewayRuleUpdateResponseRuleSettingsCheckSession] -type gatewayRuleUpdateResponseRuleSettingsCheckSessionJSON struct { +// gatewayRuleNewResponseRuleSettingsCheckSessionJSON contains the JSON metadata +// for the struct [GatewayRuleNewResponseRuleSettingsCheckSession] +type gatewayRuleNewResponseRuleSettingsCheckSessionJSON struct { Duration apijson.Field Enforce apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleUpdateResponseRuleSettingsDNSResolvers struct { - IPV4 []GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` - IPV6 []GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` - JSON gatewayRuleUpdateResponseRuleSettingsDNSResolversJSON `json:"-"` +type GatewayRuleNewResponseRuleSettingsDNSResolvers struct { + IPV4 []GatewayRuleNewResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` + IPV6 []GatewayRuleNewResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` + JSON gatewayRuleNewResponseRuleSettingsDNSResolversJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsDNSResolversJSON contains the JSON metadata -// for the struct [GatewayRuleUpdateResponseRuleSettingsDNSResolvers] -type gatewayRuleUpdateResponseRuleSettingsDNSResolversJSON struct { +// gatewayRuleNewResponseRuleSettingsDNSResolversJSON contains the JSON metadata +// for the struct [GatewayRuleNewResponseRuleSettingsDNSResolvers] +type gatewayRuleNewResponseRuleSettingsDNSResolversJSON struct { IPV4 apijson.Field IPV6 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleNewResponseRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -384,13 +384,13 @@ type GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4 struct { RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleNewResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4JSON contains the JSON -// metadata for the struct [GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4] -type gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4JSON struct { +// gatewayRuleNewResponseRuleSettingsDNSResolversIPV4JSON contains the JSON +// metadata for the struct [GatewayRuleNewResponseRuleSettingsDNSResolversIPV4] +type gatewayRuleNewResponseRuleSettingsDNSResolversIPV4JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -399,11 +399,11 @@ type gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4JSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleNewResponseRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -413,13 +413,13 @@ type GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6 struct { RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleNewResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6JSON contains the JSON -// metadata for the struct [GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6] -type gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6JSON struct { +// gatewayRuleNewResponseRuleSettingsDNSResolversIPV6JSON contains the JSON +// metadata for the struct [GatewayRuleNewResponseRuleSettingsDNSResolversIPV6] +type gatewayRuleNewResponseRuleSettingsDNSResolversIPV6JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -428,14 +428,14 @@ type gatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6JSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleUpdateResponseRuleSettingsEgress struct { +type GatewayRuleNewResponseRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 string `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -443,13 +443,13 @@ type GatewayRuleUpdateResponseRuleSettingsEgress struct { // WARP IPs. IPV4Fallback string `json:"ipv4_fallback"` // The IPv6 range to be used for egress. - IPV6 string `json:"ipv6"` - JSON gatewayRuleUpdateResponseRuleSettingsEgressJSON `json:"-"` + IPV6 string `json:"ipv6"` + JSON gatewayRuleNewResponseRuleSettingsEgressJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsEgressJSON contains the JSON metadata for -// the struct [GatewayRuleUpdateResponseRuleSettingsEgress] -type gatewayRuleUpdateResponseRuleSettingsEgressJSON struct { +// gatewayRuleNewResponseRuleSettingsEgressJSON contains the JSON metadata for the +// struct [GatewayRuleNewResponseRuleSettingsEgress] +type gatewayRuleNewResponseRuleSettingsEgressJSON struct { IPV4 apijson.Field IPV4Fallback apijson.Field IPV6 apijson.Field @@ -457,49 +457,48 @@ type gatewayRuleUpdateResponseRuleSettingsEgressJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleUpdateResponseRuleSettingsL4override struct { +type GatewayRuleNewResponseRuleSettingsL4override struct { // IPv4 or IPv6 address. IP string `json:"ip"` // A port number to use for TCP/UDP overrides. - Port int64 `json:"port"` - JSON gatewayRuleUpdateResponseRuleSettingsL4overrideJSON `json:"-"` + Port int64 `json:"port"` + JSON gatewayRuleNewResponseRuleSettingsL4overrideJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsL4overrideJSON contains the JSON metadata -// for the struct [GatewayRuleUpdateResponseRuleSettingsL4override] -type gatewayRuleUpdateResponseRuleSettingsL4overrideJSON struct { +// gatewayRuleNewResponseRuleSettingsL4overrideJSON contains the JSON metadata for +// the struct [GatewayRuleNewResponseRuleSettingsL4override] +type gatewayRuleNewResponseRuleSettingsL4overrideJSON struct { IP apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleUpdateResponseRuleSettingsNotificationSettings struct { +type GatewayRuleNewResponseRuleSettingsNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayRuleUpdateResponseRuleSettingsNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayRuleNewResponseRuleSettingsNotificationSettingsJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsNotificationSettingsJSON contains the JSON -// metadata for the struct -// [GatewayRuleUpdateResponseRuleSettingsNotificationSettings] -type gatewayRuleUpdateResponseRuleSettingsNotificationSettingsJSON struct { +// gatewayRuleNewResponseRuleSettingsNotificationSettingsJSON contains the JSON +// metadata for the struct [GatewayRuleNewResponseRuleSettingsNotificationSettings] +type gatewayRuleNewResponseRuleSettingsNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -507,62 +506,62 @@ type gatewayRuleUpdateResponseRuleSettingsNotificationSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure DLP payload logging. -type GatewayRuleUpdateResponseRuleSettingsPayloadLog struct { +type GatewayRuleNewResponseRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. - Enabled bool `json:"enabled"` - JSON gatewayRuleUpdateResponseRuleSettingsPayloadLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayRuleNewResponseRuleSettingsPayloadLogJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsPayloadLogJSON contains the JSON metadata -// for the struct [GatewayRuleUpdateResponseRuleSettingsPayloadLog] -type gatewayRuleUpdateResponseRuleSettingsPayloadLogJSON struct { +// gatewayRuleNewResponseRuleSettingsPayloadLogJSON contains the JSON metadata for +// the struct [GatewayRuleNewResponseRuleSettingsPayloadLog] +type gatewayRuleNewResponseRuleSettingsPayloadLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleUpdateResponseRuleSettingsUntrustedCert struct { +type GatewayRuleNewResponseRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action GatewayRuleUpdateResponseRuleSettingsUntrustedCertAction `json:"action"` - JSON gatewayRuleUpdateResponseRuleSettingsUntrustedCertJSON `json:"-"` + Action GatewayRuleNewResponseRuleSettingsUntrustedCertAction `json:"action"` + JSON gatewayRuleNewResponseRuleSettingsUntrustedCertJSON `json:"-"` } -// gatewayRuleUpdateResponseRuleSettingsUntrustedCertJSON contains the JSON -// metadata for the struct [GatewayRuleUpdateResponseRuleSettingsUntrustedCert] -type gatewayRuleUpdateResponseRuleSettingsUntrustedCertJSON struct { +// gatewayRuleNewResponseRuleSettingsUntrustedCertJSON contains the JSON metadata +// for the struct [GatewayRuleNewResponseRuleSettingsUntrustedCert] +type gatewayRuleNewResponseRuleSettingsUntrustedCertJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleUpdateResponseRuleSettingsUntrustedCertAction string +type GatewayRuleNewResponseRuleSettingsUntrustedCertAction string const ( - GatewayRuleUpdateResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleUpdateResponseRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleUpdateResponseRuleSettingsUntrustedCertActionBlock GatewayRuleUpdateResponseRuleSettingsUntrustedCertAction = "block" - GatewayRuleUpdateResponseRuleSettingsUntrustedCertActionError GatewayRuleUpdateResponseRuleSettingsUntrustedCertAction = "error" + GatewayRuleNewResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleNewResponseRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleNewResponseRuleSettingsUntrustedCertActionBlock GatewayRuleNewResponseRuleSettingsUntrustedCertAction = "block" + GatewayRuleNewResponseRuleSettingsUntrustedCertActionError GatewayRuleNewResponseRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleUpdateResponseSchedule struct { +type GatewayRuleNewResponseSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -598,13 +597,13 @@ type GatewayRuleUpdateResponseSchedule struct { // The time intervals when the rule will be active on Wednesdays, in increasing // order from 00:00-24:00. If this parameter is omitted, the rule will be // deactivated on Wednesdays. - Wed string `json:"wed"` - JSON gatewayRuleUpdateResponseScheduleJSON `json:"-"` + Wed string `json:"wed"` + JSON gatewayRuleNewResponseScheduleJSON `json:"-"` } -// gatewayRuleUpdateResponseScheduleJSON contains the JSON metadata for the struct -// [GatewayRuleUpdateResponseSchedule] -type gatewayRuleUpdateResponseScheduleJSON struct { +// gatewayRuleNewResponseScheduleJSON contains the JSON metadata for the struct +// [GatewayRuleNewResponseSchedule] +type gatewayRuleNewResponseScheduleJSON struct { Fri apijson.Field Mon apijson.Field Sat apijson.Field @@ -617,33 +616,17 @@ type gatewayRuleUpdateResponseScheduleJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [GatewayRuleDeleteResponseUnknown] or [shared.UnionString]. -type GatewayRuleDeleteResponse interface { - ImplementsGatewayRuleDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*GatewayRuleDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type GatewayRuleGetResponse struct { +type GatewayRuleListResponse struct { // The API resource UUID. ID string `json:"id"` // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action GatewayRuleGetResponseAction `json:"action"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + Action GatewayRuleListResponseAction `json:"action"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // Date of deletion, if any. DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` // The description of the rule. @@ -654,7 +637,7 @@ type GatewayRuleGetResponse struct { Enabled bool `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters []GatewayRuleGetResponseFilter `json:"filters"` + Filters []GatewayRuleListResponseFilter `json:"filters"` // The wirefilter expression used for identity matching. Identity string `json:"identity"` // The name of the rule. @@ -664,19 +647,19 @@ type GatewayRuleGetResponse struct { // ascending order of this value. Precedence int64 `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings GatewayRuleGetResponseRuleSettings `json:"rule_settings"` + RuleSettings GatewayRuleListResponseRuleSettings `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule GatewayRuleGetResponseSchedule `json:"schedule"` + Schedule GatewayRuleListResponseSchedule `json:"schedule"` // The wirefilter expression used for traffic matching. - Traffic string `json:"traffic"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayRuleGetResponseJSON `json:"-"` + Traffic string `json:"traffic"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayRuleListResponseJSON `json:"-"` } -// gatewayRuleGetResponseJSON contains the JSON metadata for the struct -// [GatewayRuleGetResponse] -type gatewayRuleGetResponseJSON struct { +// gatewayRuleListResponseJSON contains the JSON metadata for the struct +// [GatewayRuleListResponse] +type gatewayRuleListResponseJSON struct { ID apijson.Field Action apijson.Field CreatedAt apijson.Field @@ -696,52 +679,52 @@ type gatewayRuleGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleGetResponseAction string +type GatewayRuleListResponseAction string const ( - GatewayRuleGetResponseActionOn GatewayRuleGetResponseAction = "on" - GatewayRuleGetResponseActionOff GatewayRuleGetResponseAction = "off" - GatewayRuleGetResponseActionAllow GatewayRuleGetResponseAction = "allow" - GatewayRuleGetResponseActionBlock GatewayRuleGetResponseAction = "block" - GatewayRuleGetResponseActionScan GatewayRuleGetResponseAction = "scan" - GatewayRuleGetResponseActionNoscan GatewayRuleGetResponseAction = "noscan" - GatewayRuleGetResponseActionSafesearch GatewayRuleGetResponseAction = "safesearch" - GatewayRuleGetResponseActionYtrestricted GatewayRuleGetResponseAction = "ytrestricted" - GatewayRuleGetResponseActionIsolate GatewayRuleGetResponseAction = "isolate" - GatewayRuleGetResponseActionNoisolate GatewayRuleGetResponseAction = "noisolate" - GatewayRuleGetResponseActionOverride GatewayRuleGetResponseAction = "override" - GatewayRuleGetResponseActionL4Override GatewayRuleGetResponseAction = "l4_override" - GatewayRuleGetResponseActionEgress GatewayRuleGetResponseAction = "egress" - GatewayRuleGetResponseActionAuditSSH GatewayRuleGetResponseAction = "audit_ssh" + GatewayRuleListResponseActionOn GatewayRuleListResponseAction = "on" + GatewayRuleListResponseActionOff GatewayRuleListResponseAction = "off" + GatewayRuleListResponseActionAllow GatewayRuleListResponseAction = "allow" + GatewayRuleListResponseActionBlock GatewayRuleListResponseAction = "block" + GatewayRuleListResponseActionScan GatewayRuleListResponseAction = "scan" + GatewayRuleListResponseActionNoscan GatewayRuleListResponseAction = "noscan" + GatewayRuleListResponseActionSafesearch GatewayRuleListResponseAction = "safesearch" + GatewayRuleListResponseActionYtrestricted GatewayRuleListResponseAction = "ytrestricted" + GatewayRuleListResponseActionIsolate GatewayRuleListResponseAction = "isolate" + GatewayRuleListResponseActionNoisolate GatewayRuleListResponseAction = "noisolate" + GatewayRuleListResponseActionOverride GatewayRuleListResponseAction = "override" + GatewayRuleListResponseActionL4Override GatewayRuleListResponseAction = "l4_override" + GatewayRuleListResponseActionEgress GatewayRuleListResponseAction = "egress" + GatewayRuleListResponseActionAuditSSH GatewayRuleListResponseAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleGetResponseFilter string +type GatewayRuleListResponseFilter string const ( - GatewayRuleGetResponseFilterHTTP GatewayRuleGetResponseFilter = "http" - GatewayRuleGetResponseFilterDNS GatewayRuleGetResponseFilter = "dns" - GatewayRuleGetResponseFilterL4 GatewayRuleGetResponseFilter = "l4" - GatewayRuleGetResponseFilterEgress GatewayRuleGetResponseFilter = "egress" + GatewayRuleListResponseFilterHTTP GatewayRuleListResponseFilter = "http" + GatewayRuleListResponseFilterDNS GatewayRuleListResponseFilter = "dns" + GatewayRuleListResponseFilterL4 GatewayRuleListResponseFilter = "l4" + GatewayRuleListResponseFilterEgress GatewayRuleListResponseFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleGetResponseRuleSettings struct { +type GatewayRuleListResponseRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders interface{} `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass bool `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH GatewayRuleGetResponseRuleSettingsAuditSSH `json:"audit_ssh"` + AuditSSH GatewayRuleListResponseRuleSettingsAuditSSH `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls GatewayRuleGetResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` + BisoAdminControls GatewayRuleListResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled bool `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -750,15 +733,15 @@ type GatewayRuleGetResponseRuleSettings struct { // Set by children MSP accounts to bypass their parent's rules. BypassParentRule bool `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession GatewayRuleGetResponseRuleSettingsCheckSession `json:"check_session"` + CheckSession GatewayRuleListResponseRuleSettingsCheckSession `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers GatewayRuleGetResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` + DNSResolvers GatewayRuleListResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress GatewayRuleGetResponseRuleSettingsEgress `json:"egress"` + Egress GatewayRuleListResponseRuleSettingsEgress `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -768,27 +751,27 @@ type GatewayRuleGetResponseRuleSettings struct { // indicator feeds only block based on domain names. IPIndicatorFeeds bool `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override GatewayRuleGetResponseRuleSettingsL4override `json:"l4override"` + L4override GatewayRuleListResponseRuleSettingsL4override `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings GatewayRuleGetResponseRuleSettingsNotificationSettings `json:"notification_settings"` + NotificationSettings GatewayRuleListResponseRuleSettingsNotificationSettings `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost string `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs []string `json:"override_ips"` // Configure DLP payload logging. - PayloadLog GatewayRuleGetResponseRuleSettingsPayloadLog `json:"payload_log"` + PayloadLog GatewayRuleListResponseRuleSettingsPayloadLog `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare bool `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert GatewayRuleGetResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` - JSON gatewayRuleGetResponseRuleSettingsJSON `json:"-"` + UntrustedCert GatewayRuleListResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` + JSON gatewayRuleListResponseRuleSettingsJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsJSON contains the JSON metadata for the struct -// [GatewayRuleGetResponseRuleSettings] -type gatewayRuleGetResponseRuleSettingsJSON struct { +// gatewayRuleListResponseRuleSettingsJSON contains the JSON metadata for the +// struct [GatewayRuleListResponseRuleSettings] +type gatewayRuleListResponseRuleSettingsJSON struct { AddHeaders apijson.Field AllowChildBypass apijson.Field AuditSSH apijson.Field @@ -813,31 +796,31 @@ type gatewayRuleGetResponseRuleSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Settings for the Audit SSH action. -type GatewayRuleGetResponseRuleSettingsAuditSSH struct { +type GatewayRuleListResponseRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. - CommandLogging bool `json:"command_logging"` - JSON gatewayRuleGetResponseRuleSettingsAuditSSHJSON `json:"-"` + CommandLogging bool `json:"command_logging"` + JSON gatewayRuleListResponseRuleSettingsAuditSSHJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsAuditSSHJSON contains the JSON metadata for -// the struct [GatewayRuleGetResponseRuleSettingsAuditSSH] -type gatewayRuleGetResponseRuleSettingsAuditSSHJSON struct { +// gatewayRuleListResponseRuleSettingsAuditSSHJSON contains the JSON metadata for +// the struct [GatewayRuleListResponseRuleSettingsAuditSSH] +type gatewayRuleListResponseRuleSettingsAuditSSHJSON struct { CommandLogging apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how browser isolation behaves. -type GatewayRuleGetResponseRuleSettingsBisoAdminControls struct { +type GatewayRuleListResponseRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp bool `json:"dcp"` // Set to true to enable downloading. @@ -847,13 +830,13 @@ type GatewayRuleGetResponseRuleSettingsBisoAdminControls struct { // Set to true to enable printing. Dp bool `json:"dp"` // Set to true to enable uploading. - Du bool `json:"du"` - JSON gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON `json:"-"` + Du bool `json:"du"` + JSON gatewayRuleListResponseRuleSettingsBisoAdminControlsJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON contains the JSON -// metadata for the struct [GatewayRuleGetResponseRuleSettingsBisoAdminControls] -type gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON struct { +// gatewayRuleListResponseRuleSettingsBisoAdminControlsJSON contains the JSON +// metadata for the struct [GatewayRuleListResponseRuleSettingsBisoAdminControls] +type gatewayRuleListResponseRuleSettingsBisoAdminControlsJSON struct { Dcp apijson.Field Dd apijson.Field Dk apijson.Field @@ -863,55 +846,55 @@ type gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how session check behaves. -type GatewayRuleGetResponseRuleSettingsCheckSession struct { +type GatewayRuleListResponseRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration string `json:"duration"` // Set to true to enable session enforcement. - Enforce bool `json:"enforce"` - JSON gatewayRuleGetResponseRuleSettingsCheckSessionJSON `json:"-"` + Enforce bool `json:"enforce"` + JSON gatewayRuleListResponseRuleSettingsCheckSessionJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsCheckSessionJSON contains the JSON metadata -// for the struct [GatewayRuleGetResponseRuleSettingsCheckSession] -type gatewayRuleGetResponseRuleSettingsCheckSessionJSON struct { +// gatewayRuleListResponseRuleSettingsCheckSessionJSON contains the JSON metadata +// for the struct [GatewayRuleListResponseRuleSettingsCheckSession] +type gatewayRuleListResponseRuleSettingsCheckSessionJSON struct { Duration apijson.Field Enforce apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleGetResponseRuleSettingsDNSResolvers struct { - IPV4 []GatewayRuleGetResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` - IPV6 []GatewayRuleGetResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` - JSON gatewayRuleGetResponseRuleSettingsDNSResolversJSON `json:"-"` +type GatewayRuleListResponseRuleSettingsDNSResolvers struct { + IPV4 []GatewayRuleListResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` + IPV6 []GatewayRuleListResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` + JSON gatewayRuleListResponseRuleSettingsDNSResolversJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsDNSResolversJSON contains the JSON metadata -// for the struct [GatewayRuleGetResponseRuleSettingsDNSResolvers] -type gatewayRuleGetResponseRuleSettingsDNSResolversJSON struct { +// gatewayRuleListResponseRuleSettingsDNSResolversJSON contains the JSON metadata +// for the struct [GatewayRuleListResponseRuleSettingsDNSResolvers] +type gatewayRuleListResponseRuleSettingsDNSResolversJSON struct { IPV4 apijson.Field IPV6 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleGetResponseRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleListResponseRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -921,13 +904,13 @@ type GatewayRuleGetResponseRuleSettingsDNSResolversIPV4 struct { RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleListResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON contains the JSON -// metadata for the struct [GatewayRuleGetResponseRuleSettingsDNSResolversIPV4] -type gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON struct { +// gatewayRuleListResponseRuleSettingsDNSResolversIPV4JSON contains the JSON +// metadata for the struct [GatewayRuleListResponseRuleSettingsDNSResolversIPV4] +type gatewayRuleListResponseRuleSettingsDNSResolversIPV4JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -936,11 +919,11 @@ type gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleGetResponseRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleListResponseRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -950,13 +933,13 @@ type GatewayRuleGetResponseRuleSettingsDNSResolversIPV6 struct { RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleListResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON contains the JSON -// metadata for the struct [GatewayRuleGetResponseRuleSettingsDNSResolversIPV6] -type gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON struct { +// gatewayRuleListResponseRuleSettingsDNSResolversIPV6JSON contains the JSON +// metadata for the struct [GatewayRuleListResponseRuleSettingsDNSResolversIPV6] +type gatewayRuleListResponseRuleSettingsDNSResolversIPV6JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -965,14 +948,14 @@ type gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleGetResponseRuleSettingsEgress struct { +type GatewayRuleListResponseRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 string `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -980,13 +963,13 @@ type GatewayRuleGetResponseRuleSettingsEgress struct { // WARP IPs. IPV4Fallback string `json:"ipv4_fallback"` // The IPv6 range to be used for egress. - IPV6 string `json:"ipv6"` - JSON gatewayRuleGetResponseRuleSettingsEgressJSON `json:"-"` + IPV6 string `json:"ipv6"` + JSON gatewayRuleListResponseRuleSettingsEgressJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsEgressJSON contains the JSON metadata for the -// struct [GatewayRuleGetResponseRuleSettingsEgress] -type gatewayRuleGetResponseRuleSettingsEgressJSON struct { +// gatewayRuleListResponseRuleSettingsEgressJSON contains the JSON metadata for the +// struct [GatewayRuleListResponseRuleSettingsEgress] +type gatewayRuleListResponseRuleSettingsEgressJSON struct { IPV4 apijson.Field IPV4Fallback apijson.Field IPV6 apijson.Field @@ -994,48 +977,49 @@ type gatewayRuleGetResponseRuleSettingsEgressJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleGetResponseRuleSettingsL4override struct { +type GatewayRuleListResponseRuleSettingsL4override struct { // IPv4 or IPv6 address. IP string `json:"ip"` // A port number to use for TCP/UDP overrides. - Port int64 `json:"port"` - JSON gatewayRuleGetResponseRuleSettingsL4overrideJSON `json:"-"` + Port int64 `json:"port"` + JSON gatewayRuleListResponseRuleSettingsL4overrideJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsL4overrideJSON contains the JSON metadata for -// the struct [GatewayRuleGetResponseRuleSettingsL4override] -type gatewayRuleGetResponseRuleSettingsL4overrideJSON struct { +// gatewayRuleListResponseRuleSettingsL4overrideJSON contains the JSON metadata for +// the struct [GatewayRuleListResponseRuleSettingsL4override] +type gatewayRuleListResponseRuleSettingsL4overrideJSON struct { IP apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleGetResponseRuleSettingsNotificationSettings struct { +type GatewayRuleListResponseRuleSettingsNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayRuleListResponseRuleSettingsNotificationSettingsJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON contains the JSON -// metadata for the struct [GatewayRuleGetResponseRuleSettingsNotificationSettings] -type gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON struct { +// gatewayRuleListResponseRuleSettingsNotificationSettingsJSON contains the JSON +// metadata for the struct +// [GatewayRuleListResponseRuleSettingsNotificationSettings] +type gatewayRuleListResponseRuleSettingsNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -1043,62 +1027,62 @@ type gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure DLP payload logging. -type GatewayRuleGetResponseRuleSettingsPayloadLog struct { +type GatewayRuleListResponseRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. - Enabled bool `json:"enabled"` - JSON gatewayRuleGetResponseRuleSettingsPayloadLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayRuleListResponseRuleSettingsPayloadLogJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsPayloadLogJSON contains the JSON metadata for -// the struct [GatewayRuleGetResponseRuleSettingsPayloadLog] -type gatewayRuleGetResponseRuleSettingsPayloadLogJSON struct { +// gatewayRuleListResponseRuleSettingsPayloadLogJSON contains the JSON metadata for +// the struct [GatewayRuleListResponseRuleSettingsPayloadLog] +type gatewayRuleListResponseRuleSettingsPayloadLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleGetResponseRuleSettingsUntrustedCert struct { +type GatewayRuleListResponseRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action GatewayRuleGetResponseRuleSettingsUntrustedCertAction `json:"action"` - JSON gatewayRuleGetResponseRuleSettingsUntrustedCertJSON `json:"-"` + Action GatewayRuleListResponseRuleSettingsUntrustedCertAction `json:"action"` + JSON gatewayRuleListResponseRuleSettingsUntrustedCertJSON `json:"-"` } -// gatewayRuleGetResponseRuleSettingsUntrustedCertJSON contains the JSON metadata -// for the struct [GatewayRuleGetResponseRuleSettingsUntrustedCert] -type gatewayRuleGetResponseRuleSettingsUntrustedCertJSON struct { +// gatewayRuleListResponseRuleSettingsUntrustedCertJSON contains the JSON metadata +// for the struct [GatewayRuleListResponseRuleSettingsUntrustedCert] +type gatewayRuleListResponseRuleSettingsUntrustedCertJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleGetResponseRuleSettingsUntrustedCertAction string +type GatewayRuleListResponseRuleSettingsUntrustedCertAction string const ( - GatewayRuleGetResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleGetResponseRuleSettingsUntrustedCertActionBlock GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "block" - GatewayRuleGetResponseRuleSettingsUntrustedCertActionError GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "error" + GatewayRuleListResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleListResponseRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleListResponseRuleSettingsUntrustedCertActionBlock GatewayRuleListResponseRuleSettingsUntrustedCertAction = "block" + GatewayRuleListResponseRuleSettingsUntrustedCertActionError GatewayRuleListResponseRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleGetResponseSchedule struct { +type GatewayRuleListResponseSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -1134,13 +1118,13 @@ type GatewayRuleGetResponseSchedule struct { // The time intervals when the rule will be active on Wednesdays, in increasing // order from 00:00-24:00. If this parameter is omitted, the rule will be // deactivated on Wednesdays. - Wed string `json:"wed"` - JSON gatewayRuleGetResponseScheduleJSON `json:"-"` + Wed string `json:"wed"` + JSON gatewayRuleListResponseScheduleJSON `json:"-"` } -// gatewayRuleGetResponseScheduleJSON contains the JSON metadata for the struct -// [GatewayRuleGetResponseSchedule] -type gatewayRuleGetResponseScheduleJSON struct { +// gatewayRuleListResponseScheduleJSON contains the JSON metadata for the struct +// [GatewayRuleListResponseSchedule] +type gatewayRuleListResponseScheduleJSON struct { Fri apijson.Field Mon apijson.Field Sat apijson.Field @@ -1153,17 +1137,33 @@ type gatewayRuleGetResponseScheduleJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleGetResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleListResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse struct { +// Union satisfied by [GatewayRuleDeleteResponseUnknown] or [shared.UnionString]. +type GatewayRuleDeleteResponse interface { + ImplementsGatewayRuleDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*GatewayRuleDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type GatewayRuleGetResponse struct { // The API resource UUID. ID string `json:"id"` // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction `json:"action"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + Action GatewayRuleGetResponseAction `json:"action"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // Date of deletion, if any. DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` // The description of the rule. @@ -1174,7 +1174,7 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse struct { Enabled bool `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters []GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter `json:"filters"` + Filters []GatewayRuleGetResponseFilter `json:"filters"` // The wirefilter expression used for identity matching. Identity string `json:"identity"` // The name of the rule. @@ -1184,20 +1184,19 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse struct { // ascending order of this value. Precedence int64 `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings `json:"rule_settings"` + RuleSettings GatewayRuleGetResponseRuleSettings `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseSchedule `json:"schedule"` + Schedule GatewayRuleGetResponseSchedule `json:"schedule"` // The wirefilter expression used for traffic matching. - Traffic string `json:"traffic"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseJSON `json:"-"` + Traffic string `json:"traffic"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayRuleGetResponseJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseJSON contains the -// JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseJSON struct { +// gatewayRuleGetResponseJSON contains the JSON metadata for the struct +// [GatewayRuleGetResponse] +type gatewayRuleGetResponseJSON struct { ID apijson.Field Action apijson.Field CreatedAt apijson.Field @@ -1217,52 +1216,52 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction string +type GatewayRuleGetResponseAction string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionOn GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "on" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionOff GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "off" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionAllow GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "allow" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionBlock GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "block" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionScan GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "scan" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionNoscan GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "noscan" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionSafesearch GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "safesearch" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionYtrestricted GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "ytrestricted" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionIsolate GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "isolate" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionNoisolate GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "noisolate" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionOverride GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "override" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionL4Override GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "l4_override" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionEgress GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "egress" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseActionAuditSSH GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseAction = "audit_ssh" + GatewayRuleGetResponseActionOn GatewayRuleGetResponseAction = "on" + GatewayRuleGetResponseActionOff GatewayRuleGetResponseAction = "off" + GatewayRuleGetResponseActionAllow GatewayRuleGetResponseAction = "allow" + GatewayRuleGetResponseActionBlock GatewayRuleGetResponseAction = "block" + GatewayRuleGetResponseActionScan GatewayRuleGetResponseAction = "scan" + GatewayRuleGetResponseActionNoscan GatewayRuleGetResponseAction = "noscan" + GatewayRuleGetResponseActionSafesearch GatewayRuleGetResponseAction = "safesearch" + GatewayRuleGetResponseActionYtrestricted GatewayRuleGetResponseAction = "ytrestricted" + GatewayRuleGetResponseActionIsolate GatewayRuleGetResponseAction = "isolate" + GatewayRuleGetResponseActionNoisolate GatewayRuleGetResponseAction = "noisolate" + GatewayRuleGetResponseActionOverride GatewayRuleGetResponseAction = "override" + GatewayRuleGetResponseActionL4Override GatewayRuleGetResponseAction = "l4_override" + GatewayRuleGetResponseActionEgress GatewayRuleGetResponseAction = "egress" + GatewayRuleGetResponseActionAuditSSH GatewayRuleGetResponseAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter string +type GatewayRuleGetResponseFilter string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilterHTTP GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter = "http" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilterDNS GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter = "dns" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilterL4 GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter = "l4" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilterEgress GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseFilter = "egress" + GatewayRuleGetResponseFilterHTTP GatewayRuleGetResponseFilter = "http" + GatewayRuleGetResponseFilterDNS GatewayRuleGetResponseFilter = "dns" + GatewayRuleGetResponseFilterL4 GatewayRuleGetResponseFilter = "l4" + GatewayRuleGetResponseFilterEgress GatewayRuleGetResponseFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings struct { +type GatewayRuleGetResponseRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders interface{} `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass bool `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSH `json:"audit_ssh"` + AuditSSH GatewayRuleGetResponseRuleSettingsAuditSSH `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` + BisoAdminControls GatewayRuleGetResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled bool `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -1271,15 +1270,15 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings // Set by children MSP accounts to bypass their parent's rules. BypassParentRule bool `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSession `json:"check_session"` + CheckSession GatewayRuleGetResponseRuleSettingsCheckSession `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` + DNSResolvers GatewayRuleGetResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgress `json:"egress"` + Egress GatewayRuleGetResponseRuleSettingsEgress `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -1289,28 +1288,27 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings // indicator feeds only block based on domain names. IPIndicatorFeeds bool `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4override `json:"l4override"` + L4override GatewayRuleGetResponseRuleSettingsL4override `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettings `json:"notification_settings"` + NotificationSettings GatewayRuleGetResponseRuleSettingsNotificationSettings `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost string `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs []string `json:"override_ips"` // Configure DLP payload logging. - PayloadLog GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLog `json:"payload_log"` + PayloadLog GatewayRuleGetResponseRuleSettingsPayloadLog `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare bool `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsJSON `json:"-"` + UntrustedCert GatewayRuleGetResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` + JSON gatewayRuleGetResponseRuleSettingsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsJSON struct { +// gatewayRuleGetResponseRuleSettingsJSON contains the JSON metadata for the struct +// [GatewayRuleGetResponseRuleSettings] +type gatewayRuleGetResponseRuleSettingsJSON struct { AddHeaders apijson.Field AllowChildBypass apijson.Field AuditSSH apijson.Field @@ -1335,32 +1333,31 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Settings for the Audit SSH action. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSH struct { +type GatewayRuleGetResponseRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. - CommandLogging bool `json:"command_logging"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSHJSON `json:"-"` + CommandLogging bool `json:"command_logging"` + JSON gatewayRuleGetResponseRuleSettingsAuditSSHJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSHJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSH] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSHJSON struct { +// gatewayRuleGetResponseRuleSettingsAuditSSHJSON contains the JSON metadata for +// the struct [GatewayRuleGetResponseRuleSettingsAuditSSH] +type gatewayRuleGetResponseRuleSettingsAuditSSHJSON struct { CommandLogging apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how browser isolation behaves. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControls struct { +type GatewayRuleGetResponseRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp bool `json:"dcp"` // Set to true to enable downloading. @@ -1370,14 +1367,13 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings // Set to true to enable printing. Dp bool `json:"dp"` // Set to true to enable uploading. - Du bool `json:"du"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControlsJSON `json:"-"` + Du bool `json:"du"` + JSON gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControlsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControls] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControlsJSON struct { +// gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON contains the JSON +// metadata for the struct [GatewayRuleGetResponseRuleSettingsBisoAdminControls] +type gatewayRuleGetResponseRuleSettingsBisoAdminControlsJSON struct { Dcp apijson.Field Dd apijson.Field Dk apijson.Field @@ -1387,57 +1383,55 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how session check behaves. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSession struct { +type GatewayRuleGetResponseRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration string `json:"duration"` // Set to true to enable session enforcement. - Enforce bool `json:"enforce"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSessionJSON `json:"-"` + Enforce bool `json:"enforce"` + JSON gatewayRuleGetResponseRuleSettingsCheckSessionJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSessionJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSession] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSessionJSON struct { +// gatewayRuleGetResponseRuleSettingsCheckSessionJSON contains the JSON metadata +// for the struct [GatewayRuleGetResponseRuleSettingsCheckSession] +type gatewayRuleGetResponseRuleSettingsCheckSessionJSON struct { Duration apijson.Field Enforce apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolvers struct { - IPV4 []GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` - IPV6 []GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversJSON `json:"-"` +type GatewayRuleGetResponseRuleSettingsDNSResolvers struct { + IPV4 []GatewayRuleGetResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` + IPV6 []GatewayRuleGetResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` + JSON gatewayRuleGetResponseRuleSettingsDNSResolversJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolvers] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversJSON struct { +// gatewayRuleGetResponseRuleSettingsDNSResolversJSON contains the JSON metadata +// for the struct [GatewayRuleGetResponseRuleSettingsDNSResolvers] +type gatewayRuleGetResponseRuleSettingsDNSResolversJSON struct { IPV4 apijson.Field IPV6 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleGetResponseRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -1447,14 +1441,13 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4JSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4JSON struct { +// gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON contains the JSON +// metadata for the struct [GatewayRuleGetResponseRuleSettingsDNSResolversIPV4] +type gatewayRuleGetResponseRuleSettingsDNSResolversIPV4JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -1463,11 +1456,11 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleGetResponseRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -1477,14 +1470,13 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6JSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6JSON struct { +// gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON contains the JSON +// metadata for the struct [GatewayRuleGetResponseRuleSettingsDNSResolversIPV6] +type gatewayRuleGetResponseRuleSettingsDNSResolversIPV6JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -1493,14 +1485,14 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgress struct { +type GatewayRuleGetResponseRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 string `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -1508,14 +1500,13 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings // WARP IPs. IPV4Fallback string `json:"ipv4_fallback"` // The IPv6 range to be used for egress. - IPV6 string `json:"ipv6"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgressJSON `json:"-"` + IPV6 string `json:"ipv6"` + JSON gatewayRuleGetResponseRuleSettingsEgressJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgressJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgress] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgressJSON struct { +// gatewayRuleGetResponseRuleSettingsEgressJSON contains the JSON metadata for the +// struct [GatewayRuleGetResponseRuleSettingsEgress] +type gatewayRuleGetResponseRuleSettingsEgressJSON struct { IPV4 apijson.Field IPV4Fallback apijson.Field IPV6 apijson.Field @@ -1523,50 +1514,48 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4override struct { +type GatewayRuleGetResponseRuleSettingsL4override struct { // IPv4 or IPv6 address. IP string `json:"ip"` // A port number to use for TCP/UDP overrides. - Port int64 `json:"port"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4overrideJSON `json:"-"` + Port int64 `json:"port"` + JSON gatewayRuleGetResponseRuleSettingsL4overrideJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4overrideJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4override] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4overrideJSON struct { +// gatewayRuleGetResponseRuleSettingsL4overrideJSON contains the JSON metadata for +// the struct [GatewayRuleGetResponseRuleSettingsL4override] +type gatewayRuleGetResponseRuleSettingsL4overrideJSON struct { IP apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettings struct { +type GatewayRuleGetResponseRuleSettingsNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettingsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettings] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettingsJSON struct { +// gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON contains the JSON +// metadata for the struct [GatewayRuleGetResponseRuleSettingsNotificationSettings] +type gatewayRuleGetResponseRuleSettingsNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -1574,64 +1563,62 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettings ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure DLP payload logging. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLog struct { +type GatewayRuleGetResponseRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. - Enabled bool `json:"enabled"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayRuleGetResponseRuleSettingsPayloadLogJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLogJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLog] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLogJSON struct { +// gatewayRuleGetResponseRuleSettingsPayloadLogJSON contains the JSON metadata for +// the struct [GatewayRuleGetResponseRuleSettingsPayloadLog] +type gatewayRuleGetResponseRuleSettingsPayloadLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCert struct { +type GatewayRuleGetResponseRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertAction `json:"action"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertJSON `json:"-"` + Action GatewayRuleGetResponseRuleSettingsUntrustedCertAction `json:"action"` + JSON gatewayRuleGetResponseRuleSettingsUntrustedCertJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCert] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertJSON struct { +// gatewayRuleGetResponseRuleSettingsUntrustedCertJSON contains the JSON metadata +// for the struct [GatewayRuleGetResponseRuleSettingsUntrustedCert] +type gatewayRuleGetResponseRuleSettingsUntrustedCertJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertAction string +type GatewayRuleGetResponseRuleSettingsUntrustedCertAction string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertActionBlock GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertAction = "block" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertActionError GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseRuleSettingsUntrustedCertAction = "error" + GatewayRuleGetResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleGetResponseRuleSettingsUntrustedCertActionBlock GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "block" + GatewayRuleGetResponseRuleSettingsUntrustedCertActionError GatewayRuleGetResponseRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseSchedule struct { +type GatewayRuleGetResponseSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -1667,14 +1654,13 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseSchedule str // The time intervals when the rule will be active on Wednesdays, in increasing // order from 00:00-24:00. If this parameter is omitted, the rule will be // deactivated on Wednesdays. - Wed string `json:"wed"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseScheduleJSON `json:"-"` + Wed string `json:"wed"` + JSON gatewayRuleGetResponseScheduleJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseScheduleJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseSchedule] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseScheduleJSON struct { +// gatewayRuleGetResponseScheduleJSON contains the JSON metadata for the struct +// [GatewayRuleGetResponseSchedule] +type gatewayRuleGetResponseScheduleJSON struct { Fri apijson.Field Mon apijson.Field Sat apijson.Field @@ -1687,17 +1673,17 @@ type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseScheduleJSON ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleGetResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse struct { +type GatewayRuleReplaceResponse struct { // The API resource UUID. ID string `json:"id"` // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction `json:"action"` - CreatedAt time.Time `json:"created_at" format:"date-time"` + Action GatewayRuleReplaceResponseAction `json:"action"` + CreatedAt time.Time `json:"created_at" format:"date-time"` // Date of deletion, if any. DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` // The description of the rule. @@ -1708,7 +1694,7 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse struct { Enabled bool `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter `json:"filters"` + Filters []GatewayRuleReplaceResponseFilter `json:"filters"` // The wirefilter expression used for identity matching. Identity string `json:"identity"` // The name of the rule. @@ -1718,20 +1704,19 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse struct { // ascending order of this value. Precedence int64 `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettings `json:"rule_settings"` + RuleSettings GatewayRuleReplaceResponseRuleSettings `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseSchedule `json:"schedule"` + Schedule GatewayRuleReplaceResponseSchedule `json:"schedule"` // The wirefilter expression used for traffic matching. - Traffic string `json:"traffic"` - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseJSON `json:"-"` + Traffic string `json:"traffic"` + UpdatedAt time.Time `json:"updated_at" format:"date-time"` + JSON gatewayRuleReplaceResponseJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseJSON contains -// the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseJSON struct { +// gatewayRuleReplaceResponseJSON contains the JSON metadata for the struct +// [GatewayRuleReplaceResponse] +type gatewayRuleReplaceResponseJSON struct { ID apijson.Field Action apijson.Field CreatedAt apijson.Field @@ -1751,52 +1736,52 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseJSON struc ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction string +type GatewayRuleReplaceResponseAction string const ( - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionOn GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "on" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionOff GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "off" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionAllow GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "allow" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionBlock GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "block" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionScan GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "scan" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionNoscan GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "noscan" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionSafesearch GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "safesearch" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionYtrestricted GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "ytrestricted" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionIsolate GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "isolate" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionNoisolate GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "noisolate" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionOverride GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "override" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionL4Override GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "l4_override" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionEgress GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "egress" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseActionAuditSSH GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseAction = "audit_ssh" + GatewayRuleReplaceResponseActionOn GatewayRuleReplaceResponseAction = "on" + GatewayRuleReplaceResponseActionOff GatewayRuleReplaceResponseAction = "off" + GatewayRuleReplaceResponseActionAllow GatewayRuleReplaceResponseAction = "allow" + GatewayRuleReplaceResponseActionBlock GatewayRuleReplaceResponseAction = "block" + GatewayRuleReplaceResponseActionScan GatewayRuleReplaceResponseAction = "scan" + GatewayRuleReplaceResponseActionNoscan GatewayRuleReplaceResponseAction = "noscan" + GatewayRuleReplaceResponseActionSafesearch GatewayRuleReplaceResponseAction = "safesearch" + GatewayRuleReplaceResponseActionYtrestricted GatewayRuleReplaceResponseAction = "ytrestricted" + GatewayRuleReplaceResponseActionIsolate GatewayRuleReplaceResponseAction = "isolate" + GatewayRuleReplaceResponseActionNoisolate GatewayRuleReplaceResponseAction = "noisolate" + GatewayRuleReplaceResponseActionOverride GatewayRuleReplaceResponseAction = "override" + GatewayRuleReplaceResponseActionL4Override GatewayRuleReplaceResponseAction = "l4_override" + GatewayRuleReplaceResponseActionEgress GatewayRuleReplaceResponseAction = "egress" + GatewayRuleReplaceResponseActionAuditSSH GatewayRuleReplaceResponseAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter string +type GatewayRuleReplaceResponseFilter string const ( - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilterHTTP GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter = "http" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilterDNS GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter = "dns" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilterL4 GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter = "l4" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilterEgress GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseFilter = "egress" + GatewayRuleReplaceResponseFilterHTTP GatewayRuleReplaceResponseFilter = "http" + GatewayRuleReplaceResponseFilterDNS GatewayRuleReplaceResponseFilter = "dns" + GatewayRuleReplaceResponseFilterL4 GatewayRuleReplaceResponseFilter = "l4" + GatewayRuleReplaceResponseFilterEgress GatewayRuleReplaceResponseFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettings struct { +type GatewayRuleReplaceResponseRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders interface{} `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass bool `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSH `json:"audit_ssh"` + AuditSSH GatewayRuleReplaceResponseRuleSettingsAuditSSH `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` + BisoAdminControls GatewayRuleReplaceResponseRuleSettingsBisoAdminControls `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled bool `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -1805,15 +1790,15 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin // Set by children MSP accounts to bypass their parent's rules. BypassParentRule bool `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSession `json:"check_session"` + CheckSession GatewayRuleReplaceResponseRuleSettingsCheckSession `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` + DNSResolvers GatewayRuleReplaceResponseRuleSettingsDNSResolvers `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgress `json:"egress"` + Egress GatewayRuleReplaceResponseRuleSettingsEgress `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -1823,28 +1808,27 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin // indicator feeds only block based on domain names. IPIndicatorFeeds bool `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4override `json:"l4override"` + L4override GatewayRuleReplaceResponseRuleSettingsL4override `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettings `json:"notification_settings"` + NotificationSettings GatewayRuleReplaceResponseRuleSettingsNotificationSettings `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost string `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs []string `json:"override_ips"` // Configure DLP payload logging. - PayloadLog GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLog `json:"payload_log"` + PayloadLog GatewayRuleReplaceResponseRuleSettingsPayloadLog `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare bool `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsJSON `json:"-"` + UntrustedCert GatewayRuleReplaceResponseRuleSettingsUntrustedCert `json:"untrusted_cert"` + JSON gatewayRuleReplaceResponseRuleSettingsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettings] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsJSON struct { +// gatewayRuleReplaceResponseRuleSettingsJSON contains the JSON metadata for the +// struct [GatewayRuleReplaceResponseRuleSettings] +type gatewayRuleReplaceResponseRuleSettingsJSON struct { AddHeaders apijson.Field AllowChildBypass apijson.Field AuditSSH apijson.Field @@ -1869,32 +1853,31 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Settings for the Audit SSH action. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSH struct { +type GatewayRuleReplaceResponseRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. - CommandLogging bool `json:"command_logging"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSHJSON `json:"-"` + CommandLogging bool `json:"command_logging"` + JSON gatewayRuleReplaceResponseRuleSettingsAuditSSHJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSHJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSH] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSHJSON struct { +// gatewayRuleReplaceResponseRuleSettingsAuditSSHJSON contains the JSON metadata +// for the struct [GatewayRuleReplaceResponseRuleSettingsAuditSSH] +type gatewayRuleReplaceResponseRuleSettingsAuditSSHJSON struct { CommandLogging apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsAuditSSH) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how browser isolation behaves. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControls struct { +type GatewayRuleReplaceResponseRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp bool `json:"dcp"` // Set to true to enable downloading. @@ -1904,14 +1887,14 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin // Set to true to enable printing. Dp bool `json:"dp"` // Set to true to enable uploading. - Du bool `json:"du"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControlsJSON `json:"-"` + Du bool `json:"du"` + JSON gatewayRuleReplaceResponseRuleSettingsBisoAdminControlsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControlsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControls] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControlsJSON struct { +// gatewayRuleReplaceResponseRuleSettingsBisoAdminControlsJSON contains the JSON +// metadata for the struct +// [GatewayRuleReplaceResponseRuleSettingsBisoAdminControls] +type gatewayRuleReplaceResponseRuleSettingsBisoAdminControlsJSON struct { Dcp apijson.Field Dd apijson.Field Dk apijson.Field @@ -1921,57 +1904,55 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsBisoAdminControls) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how session check behaves. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSession struct { +type GatewayRuleReplaceResponseRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration string `json:"duration"` // Set to true to enable session enforcement. - Enforce bool `json:"enforce"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSessionJSON `json:"-"` + Enforce bool `json:"enforce"` + JSON gatewayRuleReplaceResponseRuleSettingsCheckSessionJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSessionJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSession] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSessionJSON struct { +// gatewayRuleReplaceResponseRuleSettingsCheckSessionJSON contains the JSON +// metadata for the struct [GatewayRuleReplaceResponseRuleSettingsCheckSession] +type gatewayRuleReplaceResponseRuleSettingsCheckSessionJSON struct { Duration apijson.Field Enforce apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsCheckSession) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolvers struct { - IPV4 []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` - IPV6 []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversJSON `json:"-"` +type GatewayRuleReplaceResponseRuleSettingsDNSResolvers struct { + IPV4 []GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4 `json:"ipv4"` + IPV6 []GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6 `json:"ipv6"` + JSON gatewayRuleReplaceResponseRuleSettingsDNSResolversJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolvers] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversJSON struct { +// gatewayRuleReplaceResponseRuleSettingsDNSResolversJSON contains the JSON +// metadata for the struct [GatewayRuleReplaceResponseRuleSettingsDNSResolvers] +type gatewayRuleReplaceResponseRuleSettingsDNSResolversJSON struct { IPV4 apijson.Field IPV6 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsDNSResolvers) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -1981,14 +1962,13 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4JSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4JSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4JSON struct { +// gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4JSON contains the JSON +// metadata for the struct [GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4] +type gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -1997,11 +1977,11 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV4) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP string `json:"ip,required"` // A port number to use for upstream resolver. @@ -2011,14 +1991,13 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin RouteThroughPrivateNetwork bool `json:"route_through_private_network"` // Optionally specify a virtual network for this resolver. Uses default virtual // network id if omitted. - VnetID string `json:"vnet_id"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` + VnetID string `json:"vnet_id"` + JSON gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6JSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6JSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6JSON struct { +// gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6JSON contains the JSON +// metadata for the struct [GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6] +type gatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6JSON struct { IP apijson.Field Port apijson.Field RouteThroughPrivateNetwork apijson.Field @@ -2027,14 +2006,14 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsDNSResolversIPV6) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgress struct { +type GatewayRuleReplaceResponseRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 string `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -2042,14 +2021,13 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin // WARP IPs. IPV4Fallback string `json:"ipv4_fallback"` // The IPv6 range to be used for egress. - IPV6 string `json:"ipv6"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgressJSON `json:"-"` + IPV6 string `json:"ipv6"` + JSON gatewayRuleReplaceResponseRuleSettingsEgressJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgressJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgress] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgressJSON struct { +// gatewayRuleReplaceResponseRuleSettingsEgressJSON contains the JSON metadata for +// the struct [GatewayRuleReplaceResponseRuleSettingsEgress] +type gatewayRuleReplaceResponseRuleSettingsEgressJSON struct { IPV4 apijson.Field IPV4Fallback apijson.Field IPV6 apijson.Field @@ -2057,50 +2035,49 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsEgress) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4override struct { +type GatewayRuleReplaceResponseRuleSettingsL4override struct { // IPv4 or IPv6 address. IP string `json:"ip"` // A port number to use for TCP/UDP overrides. - Port int64 `json:"port"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4overrideJSON `json:"-"` + Port int64 `json:"port"` + JSON gatewayRuleReplaceResponseRuleSettingsL4overrideJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4overrideJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4override] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4overrideJSON struct { +// gatewayRuleReplaceResponseRuleSettingsL4overrideJSON contains the JSON metadata +// for the struct [GatewayRuleReplaceResponseRuleSettingsL4override] +type gatewayRuleReplaceResponseRuleSettingsL4overrideJSON struct { IP apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsL4override) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettings struct { +type GatewayRuleReplaceResponseRuleSettingsNotificationSettings struct { // Set notification on Enabled bool `json:"enabled"` // Customize the message shown in the notification. Msg string `json:"msg"` // Optional URL to direct users to additional information. If not set, the // notification will open a block page. - SupportURL string `json:"support_url"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettingsJSON `json:"-"` + SupportURL string `json:"support_url"` + JSON gatewayRuleReplaceResponseRuleSettingsNotificationSettingsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettingsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettings] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettingsJSON struct { +// gatewayRuleReplaceResponseRuleSettingsNotificationSettingsJSON contains the JSON +// metadata for the struct +// [GatewayRuleReplaceResponseRuleSettingsNotificationSettings] +type gatewayRuleReplaceResponseRuleSettingsNotificationSettingsJSON struct { Enabled apijson.Field Msg apijson.Field SupportURL apijson.Field @@ -2108,64 +2085,62 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettin ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsNotificationSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure DLP payload logging. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLog struct { +type GatewayRuleReplaceResponseRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. - Enabled bool `json:"enabled"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLogJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON gatewayRuleReplaceResponseRuleSettingsPayloadLogJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLogJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLog] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLogJSON struct { +// gatewayRuleReplaceResponseRuleSettingsPayloadLogJSON contains the JSON metadata +// for the struct [GatewayRuleReplaceResponseRuleSettingsPayloadLog] +type gatewayRuleReplaceResponseRuleSettingsPayloadLogJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsPayloadLog) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCert struct { +type GatewayRuleReplaceResponseRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertAction `json:"action"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertJSON `json:"-"` + Action GatewayRuleReplaceResponseRuleSettingsUntrustedCertAction `json:"action"` + JSON gatewayRuleReplaceResponseRuleSettingsUntrustedCertJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCert] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertJSON struct { +// gatewayRuleReplaceResponseRuleSettingsUntrustedCertJSON contains the JSON +// metadata for the struct [GatewayRuleReplaceResponseRuleSettingsUntrustedCert] +type gatewayRuleReplaceResponseRuleSettingsUntrustedCertJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseRuleSettingsUntrustedCert) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertAction string +type GatewayRuleReplaceResponseRuleSettingsUntrustedCertAction string const ( - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertActionBlock GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertAction = "block" - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertActionError GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseRuleSettingsUntrustedCertAction = "error" + GatewayRuleReplaceResponseRuleSettingsUntrustedCertActionPassThrough GatewayRuleReplaceResponseRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleReplaceResponseRuleSettingsUntrustedCertActionBlock GatewayRuleReplaceResponseRuleSettingsUntrustedCertAction = "block" + GatewayRuleReplaceResponseRuleSettingsUntrustedCertActionError GatewayRuleReplaceResponseRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseSchedule struct { +type GatewayRuleReplaceResponseSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -2201,14 +2176,13 @@ type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseSchedule s // The time intervals when the rule will be active on Wednesdays, in increasing // order from 00:00-24:00. If this parameter is omitted, the rule will be // deactivated on Wednesdays. - Wed string `json:"wed"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseScheduleJSON `json:"-"` + Wed string `json:"wed"` + JSON gatewayRuleReplaceResponseScheduleJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseScheduleJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseSchedule] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseScheduleJSON struct { +// gatewayRuleReplaceResponseScheduleJSON contains the JSON metadata for the struct +// [GatewayRuleReplaceResponseSchedule] +type gatewayRuleReplaceResponseScheduleJSON struct { Fri apijson.Field Mon apijson.Field Sat apijson.Field @@ -2221,14 +2195,14 @@ type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseScheduleJS ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleUpdateParams struct { +type GatewayRuleNewParams struct { // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action param.Field[GatewayRuleUpdateParamsAction] `json:"action,required"` + Action param.Field[GatewayRuleNewParamsAction] `json:"action,required"` // The name of the rule. Name param.Field[string] `json:"name,required"` // The description of the rule. @@ -2239,7 +2213,7 @@ type GatewayRuleUpdateParams struct { Enabled param.Field[bool] `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters param.Field[[]GatewayRuleUpdateParamsFilter] `json:"filters"` + Filters param.Field[[]GatewayRuleNewParamsFilter] `json:"filters"` // The wirefilter expression used for identity matching. Identity param.Field[string] `json:"identity"` // Precedence sets the order of your rules. Lower values indicate higher @@ -2247,60 +2221,60 @@ type GatewayRuleUpdateParams struct { // ascending order of this value. Precedence param.Field[int64] `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings param.Field[GatewayRuleUpdateParamsRuleSettings] `json:"rule_settings"` + RuleSettings param.Field[GatewayRuleNewParamsRuleSettings] `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule param.Field[GatewayRuleUpdateParamsSchedule] `json:"schedule"` + Schedule param.Field[GatewayRuleNewParamsSchedule] `json:"schedule"` // The wirefilter expression used for traffic matching. Traffic param.Field[string] `json:"traffic"` } -func (r GatewayRuleUpdateParams) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleUpdateParamsAction string +type GatewayRuleNewParamsAction string const ( - GatewayRuleUpdateParamsActionOn GatewayRuleUpdateParamsAction = "on" - GatewayRuleUpdateParamsActionOff GatewayRuleUpdateParamsAction = "off" - GatewayRuleUpdateParamsActionAllow GatewayRuleUpdateParamsAction = "allow" - GatewayRuleUpdateParamsActionBlock GatewayRuleUpdateParamsAction = "block" - GatewayRuleUpdateParamsActionScan GatewayRuleUpdateParamsAction = "scan" - GatewayRuleUpdateParamsActionNoscan GatewayRuleUpdateParamsAction = "noscan" - GatewayRuleUpdateParamsActionSafesearch GatewayRuleUpdateParamsAction = "safesearch" - GatewayRuleUpdateParamsActionYtrestricted GatewayRuleUpdateParamsAction = "ytrestricted" - GatewayRuleUpdateParamsActionIsolate GatewayRuleUpdateParamsAction = "isolate" - GatewayRuleUpdateParamsActionNoisolate GatewayRuleUpdateParamsAction = "noisolate" - GatewayRuleUpdateParamsActionOverride GatewayRuleUpdateParamsAction = "override" - GatewayRuleUpdateParamsActionL4Override GatewayRuleUpdateParamsAction = "l4_override" - GatewayRuleUpdateParamsActionEgress GatewayRuleUpdateParamsAction = "egress" - GatewayRuleUpdateParamsActionAuditSSH GatewayRuleUpdateParamsAction = "audit_ssh" + GatewayRuleNewParamsActionOn GatewayRuleNewParamsAction = "on" + GatewayRuleNewParamsActionOff GatewayRuleNewParamsAction = "off" + GatewayRuleNewParamsActionAllow GatewayRuleNewParamsAction = "allow" + GatewayRuleNewParamsActionBlock GatewayRuleNewParamsAction = "block" + GatewayRuleNewParamsActionScan GatewayRuleNewParamsAction = "scan" + GatewayRuleNewParamsActionNoscan GatewayRuleNewParamsAction = "noscan" + GatewayRuleNewParamsActionSafesearch GatewayRuleNewParamsAction = "safesearch" + GatewayRuleNewParamsActionYtrestricted GatewayRuleNewParamsAction = "ytrestricted" + GatewayRuleNewParamsActionIsolate GatewayRuleNewParamsAction = "isolate" + GatewayRuleNewParamsActionNoisolate GatewayRuleNewParamsAction = "noisolate" + GatewayRuleNewParamsActionOverride GatewayRuleNewParamsAction = "override" + GatewayRuleNewParamsActionL4Override GatewayRuleNewParamsAction = "l4_override" + GatewayRuleNewParamsActionEgress GatewayRuleNewParamsAction = "egress" + GatewayRuleNewParamsActionAuditSSH GatewayRuleNewParamsAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleUpdateParamsFilter string +type GatewayRuleNewParamsFilter string const ( - GatewayRuleUpdateParamsFilterHTTP GatewayRuleUpdateParamsFilter = "http" - GatewayRuleUpdateParamsFilterDNS GatewayRuleUpdateParamsFilter = "dns" - GatewayRuleUpdateParamsFilterL4 GatewayRuleUpdateParamsFilter = "l4" - GatewayRuleUpdateParamsFilterEgress GatewayRuleUpdateParamsFilter = "egress" + GatewayRuleNewParamsFilterHTTP GatewayRuleNewParamsFilter = "http" + GatewayRuleNewParamsFilterDNS GatewayRuleNewParamsFilter = "dns" + GatewayRuleNewParamsFilterL4 GatewayRuleNewParamsFilter = "l4" + GatewayRuleNewParamsFilterEgress GatewayRuleNewParamsFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleUpdateParamsRuleSettings struct { +type GatewayRuleNewParamsRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders param.Field[interface{}] `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass param.Field[bool] `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH param.Field[GatewayRuleUpdateParamsRuleSettingsAuditSSH] `json:"audit_ssh"` + AuditSSH param.Field[GatewayRuleNewParamsRuleSettingsAuditSSH] `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls param.Field[GatewayRuleUpdateParamsRuleSettingsBisoAdminControls] `json:"biso_admin_controls"` + BisoAdminControls param.Field[GatewayRuleNewParamsRuleSettingsBisoAdminControls] `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled param.Field[bool] `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -2309,15 +2283,15 @@ type GatewayRuleUpdateParamsRuleSettings struct { // Set by children MSP accounts to bypass their parent's rules. BypassParentRule param.Field[bool] `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession param.Field[GatewayRuleUpdateParamsRuleSettingsCheckSession] `json:"check_session"` + CheckSession param.Field[GatewayRuleNewParamsRuleSettingsCheckSession] `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers param.Field[GatewayRuleUpdateParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` + DNSResolvers param.Field[GatewayRuleNewParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress param.Field[GatewayRuleUpdateParamsRuleSettingsEgress] `json:"egress"` + Egress param.Field[GatewayRuleNewParamsRuleSettingsEgress] `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation param.Field[bool] `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -2327,39 +2301,39 @@ type GatewayRuleUpdateParamsRuleSettings struct { // indicator feeds only block based on domain names. IPIndicatorFeeds param.Field[bool] `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override param.Field[GatewayRuleUpdateParamsRuleSettingsL4override] `json:"l4override"` + L4override param.Field[GatewayRuleNewParamsRuleSettingsL4override] `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings param.Field[GatewayRuleUpdateParamsRuleSettingsNotificationSettings] `json:"notification_settings"` + NotificationSettings param.Field[GatewayRuleNewParamsRuleSettingsNotificationSettings] `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost param.Field[string] `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs param.Field[[]string] `json:"override_ips"` // Configure DLP payload logging. - PayloadLog param.Field[GatewayRuleUpdateParamsRuleSettingsPayloadLog] `json:"payload_log"` + PayloadLog param.Field[GatewayRuleNewParamsRuleSettingsPayloadLog] `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare param.Field[bool] `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert param.Field[GatewayRuleUpdateParamsRuleSettingsUntrustedCert] `json:"untrusted_cert"` + UntrustedCert param.Field[GatewayRuleNewParamsRuleSettingsUntrustedCert] `json:"untrusted_cert"` } -func (r GatewayRuleUpdateParamsRuleSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Settings for the Audit SSH action. -type GatewayRuleUpdateParamsRuleSettingsAuditSSH struct { +type GatewayRuleNewParamsRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. CommandLogging param.Field[bool] `json:"command_logging"` } -func (r GatewayRuleUpdateParamsRuleSettingsAuditSSH) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsAuditSSH) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how browser isolation behaves. -type GatewayRuleUpdateParamsRuleSettingsBisoAdminControls struct { +type GatewayRuleNewParamsRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp param.Field[bool] `json:"dcp"` // Set to true to enable downloading. @@ -2372,35 +2346,35 @@ type GatewayRuleUpdateParamsRuleSettingsBisoAdminControls struct { Du param.Field[bool] `json:"du"` } -func (r GatewayRuleUpdateParamsRuleSettingsBisoAdminControls) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsBisoAdminControls) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how session check behaves. -type GatewayRuleUpdateParamsRuleSettingsCheckSession struct { +type GatewayRuleNewParamsRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration param.Field[string] `json:"duration"` // Set to true to enable session enforcement. Enforce param.Field[bool] `json:"enforce"` } -func (r GatewayRuleUpdateParamsRuleSettingsCheckSession) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsCheckSession) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleUpdateParamsRuleSettingsDNSResolvers struct { - IPV4 param.Field[[]GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` - IPV6 param.Field[[]GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` +type GatewayRuleNewParamsRuleSettingsDNSResolvers struct { + IPV4 param.Field[[]GatewayRuleNewParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` + IPV6 param.Field[[]GatewayRuleNewParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` } -func (r GatewayRuleUpdateParamsRuleSettingsDNSResolvers) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsDNSResolvers) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleNewParamsRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP param.Field[string] `json:"ip,required"` // A port number to use for upstream resolver. @@ -2413,11 +2387,11 @@ type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4 struct { VnetID param.Field[string] `json:"vnet_id"` } -func (r GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleNewParamsRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP param.Field[string] `json:"ip,required"` // A port number to use for upstream resolver. @@ -2430,14 +2404,14 @@ type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6 struct { VnetID param.Field[string] `json:"vnet_id"` } -func (r GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsDNSResolversIPV6) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleUpdateParamsRuleSettingsEgress struct { +type GatewayRuleNewParamsRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 param.Field[string] `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -2448,25 +2422,25 @@ type GatewayRuleUpdateParamsRuleSettingsEgress struct { IPV6 param.Field[string] `json:"ipv6"` } -func (r GatewayRuleUpdateParamsRuleSettingsEgress) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsEgress) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleUpdateParamsRuleSettingsL4override struct { +type GatewayRuleNewParamsRuleSettingsL4override struct { // IPv4 or IPv6 address. IP param.Field[string] `json:"ip"` // A port number to use for TCP/UDP overrides. Port param.Field[int64] `json:"port"` } -func (r GatewayRuleUpdateParamsRuleSettingsL4override) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsL4override) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleUpdateParamsRuleSettingsNotificationSettings struct { +type GatewayRuleNewParamsRuleSettingsNotificationSettings struct { // Set notification on Enabled param.Field[bool] `json:"enabled"` // Customize the message shown in the notification. @@ -2476,44 +2450,44 @@ type GatewayRuleUpdateParamsRuleSettingsNotificationSettings struct { SupportURL param.Field[string] `json:"support_url"` } -func (r GatewayRuleUpdateParamsRuleSettingsNotificationSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsNotificationSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure DLP payload logging. -type GatewayRuleUpdateParamsRuleSettingsPayloadLog struct { +type GatewayRuleNewParamsRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayRuleUpdateParamsRuleSettingsPayloadLog) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsPayloadLog) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleUpdateParamsRuleSettingsUntrustedCert struct { +type GatewayRuleNewParamsRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action param.Field[GatewayRuleUpdateParamsRuleSettingsUntrustedCertAction] `json:"action"` + Action param.Field[GatewayRuleNewParamsRuleSettingsUntrustedCertAction] `json:"action"` } -func (r GatewayRuleUpdateParamsRuleSettingsUntrustedCert) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsRuleSettingsUntrustedCert) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleUpdateParamsRuleSettingsUntrustedCertAction string +type GatewayRuleNewParamsRuleSettingsUntrustedCertAction string const ( - GatewayRuleUpdateParamsRuleSettingsUntrustedCertActionPassThrough GatewayRuleUpdateParamsRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleUpdateParamsRuleSettingsUntrustedCertActionBlock GatewayRuleUpdateParamsRuleSettingsUntrustedCertAction = "block" - GatewayRuleUpdateParamsRuleSettingsUntrustedCertActionError GatewayRuleUpdateParamsRuleSettingsUntrustedCertAction = "error" + GatewayRuleNewParamsRuleSettingsUntrustedCertActionPassThrough GatewayRuleNewParamsRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleNewParamsRuleSettingsUntrustedCertActionBlock GatewayRuleNewParamsRuleSettingsUntrustedCertAction = "block" + GatewayRuleNewParamsRuleSettingsUntrustedCertActionError GatewayRuleNewParamsRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleUpdateParamsSchedule struct { +type GatewayRuleNewParamsSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -2552,22 +2526,22 @@ type GatewayRuleUpdateParamsSchedule struct { Wed param.Field[string] `json:"wed"` } -func (r GatewayRuleUpdateParamsSchedule) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleNewParamsSchedule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleUpdateResponseEnvelope struct { - Errors []GatewayRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result GatewayRuleUpdateResponse `json:"result,required"` +type GatewayRuleNewResponseEnvelope struct { + Errors []GatewayRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result GatewayRuleNewResponse `json:"result,required"` // Whether the API call was successful - Success GatewayRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayRuleUpdateResponseEnvelopeJSON `json:"-"` + Success GatewayRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayRuleNewResponseEnvelopeJSON `json:"-"` } -// gatewayRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [GatewayRuleUpdateResponseEnvelope] -type gatewayRuleUpdateResponseEnvelopeJSON struct { +// gatewayRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayRuleNewResponseEnvelope] +type gatewayRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -2576,55 +2550,153 @@ type gatewayRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type GatewayRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [GatewayRuleUpdateResponseEnvelopeErrors] -type gatewayRuleUpdateResponseEnvelopeErrorsJSON struct { +// gatewayRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayRuleNewResponseEnvelopeErrors] +type gatewayRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type GatewayRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [GatewayRuleUpdateResponseEnvelopeMessages] -type gatewayRuleUpdateResponseEnvelopeMessagesJSON struct { +// gatewayRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayRuleNewResponseEnvelopeMessages] +type gatewayRuleNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayRuleUpdateResponseEnvelopeSuccess bool +type GatewayRuleNewResponseEnvelopeSuccess bool const ( - GatewayRuleUpdateResponseEnvelopeSuccessTrue GatewayRuleUpdateResponseEnvelopeSuccess = true + GatewayRuleNewResponseEnvelopeSuccessTrue GatewayRuleNewResponseEnvelopeSuccess = true ) +type GatewayRuleListResponseEnvelope struct { + Errors []GatewayRuleListResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayRuleListResponseEnvelopeMessages `json:"messages,required"` + Result []GatewayRuleListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success GatewayRuleListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo GatewayRuleListResponseEnvelopeResultInfo `json:"result_info"` + JSON gatewayRuleListResponseEnvelopeJSON `json:"-"` +} + +// gatewayRuleListResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayRuleListResponseEnvelope] +type gatewayRuleListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayRuleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleListResponseEnvelopeErrorsJSON `json:"-"` +} + +// gatewayRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayRuleListResponseEnvelopeErrors] +type gatewayRuleListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type GatewayRuleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleListResponseEnvelopeMessagesJSON `json:"-"` +} + +// gatewayRuleListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [GatewayRuleListResponseEnvelopeMessages] +type gatewayRuleListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type GatewayRuleListResponseEnvelopeSuccess bool + +const ( + GatewayRuleListResponseEnvelopeSuccessTrue GatewayRuleListResponseEnvelopeSuccess = true +) + +type GatewayRuleListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON gatewayRuleListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// gatewayRuleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [GatewayRuleListResponseEnvelopeResultInfo] +type gatewayRuleListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *GatewayRuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type GatewayRuleDeleteResponseEnvelope struct { Errors []GatewayRuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []GatewayRuleDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -2763,10 +2835,10 @@ const ( GatewayRuleGetResponseEnvelopeSuccessTrue GatewayRuleGetResponseEnvelopeSuccess = true ) -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams struct { +type GatewayRuleReplaceParams struct { // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. - Action param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction] `json:"action,required"` + Action param.Field[GatewayRuleReplaceParamsAction] `json:"action,required"` // The name of the rule. Name param.Field[string] `json:"name,required"` // The description of the rule. @@ -2777,7 +2849,7 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams struct { Enabled param.Field[bool] `json:"enabled"` // The protocol or layer to evaluate the traffic, identity, and device posture // expressions. - Filters param.Field[[]GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter] `json:"filters"` + Filters param.Field[[]GatewayRuleReplaceParamsFilter] `json:"filters"` // The wirefilter expression used for identity matching. Identity param.Field[string] `json:"identity"` // Precedence sets the order of your rules. Lower values indicate higher @@ -2785,60 +2857,60 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams struct { // ascending order of this value. Precedence param.Field[int64] `json:"precedence"` // Additional settings that modify the rule's action. - RuleSettings param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings] `json:"rule_settings"` + RuleSettings param.Field[GatewayRuleReplaceParamsRuleSettings] `json:"rule_settings"` // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. - Schedule param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsSchedule] `json:"schedule"` + Schedule param.Field[GatewayRuleReplaceParamsSchedule] `json:"schedule"` // The wirefilter expression used for traffic matching. Traffic param.Field[string] `json:"traffic"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to preform when the associated traffic, identity, and device posture // expressions are either absent or evaluate to `true`. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction string +type GatewayRuleReplaceParamsAction string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionOn GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "on" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionOff GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "off" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionAllow GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "allow" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionBlock GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "block" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionScan GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "scan" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionNoscan GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "noscan" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionSafesearch GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "safesearch" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionYtrestricted GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "ytrestricted" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionIsolate GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "isolate" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionNoisolate GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "noisolate" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionOverride GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "override" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionL4Override GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "l4_override" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionEgress GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "egress" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionAuditSSH GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsAction = "audit_ssh" + GatewayRuleReplaceParamsActionOn GatewayRuleReplaceParamsAction = "on" + GatewayRuleReplaceParamsActionOff GatewayRuleReplaceParamsAction = "off" + GatewayRuleReplaceParamsActionAllow GatewayRuleReplaceParamsAction = "allow" + GatewayRuleReplaceParamsActionBlock GatewayRuleReplaceParamsAction = "block" + GatewayRuleReplaceParamsActionScan GatewayRuleReplaceParamsAction = "scan" + GatewayRuleReplaceParamsActionNoscan GatewayRuleReplaceParamsAction = "noscan" + GatewayRuleReplaceParamsActionSafesearch GatewayRuleReplaceParamsAction = "safesearch" + GatewayRuleReplaceParamsActionYtrestricted GatewayRuleReplaceParamsAction = "ytrestricted" + GatewayRuleReplaceParamsActionIsolate GatewayRuleReplaceParamsAction = "isolate" + GatewayRuleReplaceParamsActionNoisolate GatewayRuleReplaceParamsAction = "noisolate" + GatewayRuleReplaceParamsActionOverride GatewayRuleReplaceParamsAction = "override" + GatewayRuleReplaceParamsActionL4Override GatewayRuleReplaceParamsAction = "l4_override" + GatewayRuleReplaceParamsActionEgress GatewayRuleReplaceParamsAction = "egress" + GatewayRuleReplaceParamsActionAuditSSH GatewayRuleReplaceParamsAction = "audit_ssh" ) // The protocol or layer to use. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter string +type GatewayRuleReplaceParamsFilter string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilterHTTP GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter = "http" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilterDNS GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter = "dns" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilterL4 GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter = "l4" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilterEgress GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter = "egress" + GatewayRuleReplaceParamsFilterHTTP GatewayRuleReplaceParamsFilter = "http" + GatewayRuleReplaceParamsFilterDNS GatewayRuleReplaceParamsFilter = "dns" + GatewayRuleReplaceParamsFilterL4 GatewayRuleReplaceParamsFilter = "l4" + GatewayRuleReplaceParamsFilterEgress GatewayRuleReplaceParamsFilter = "egress" ) // Additional settings that modify the rule's action. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings struct { +type GatewayRuleReplaceParamsRuleSettings struct { // Add custom headers to allowed requests, in the form of key-value pairs. Keys are // header names, pointing to an array with its header value(s). AddHeaders param.Field[interface{}] `json:"add_headers"` // Set by parent MSP accounts to enable their children to bypass this rule. AllowChildBypass param.Field[bool] `json:"allow_child_bypass"` // Settings for the Audit SSH action. - AuditSSH param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsAuditSSH] `json:"audit_ssh"` + AuditSSH param.Field[GatewayRuleReplaceParamsRuleSettingsAuditSSH] `json:"audit_ssh"` // Configure how browser isolation behaves. - BisoAdminControls param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsBisoAdminControls] `json:"biso_admin_controls"` + BisoAdminControls param.Field[GatewayRuleReplaceParamsRuleSettingsBisoAdminControls] `json:"biso_admin_controls"` // Enable the custom block page. BlockPageEnabled param.Field[bool] `json:"block_page_enabled"` // The text describing why this block occurred, displayed on the custom block page @@ -2847,15 +2919,15 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings s // Set by children MSP accounts to bypass their parent's rules. BypassParentRule param.Field[bool] `json:"bypass_parent_rule"` // Configure how session check behaves. - CheckSession param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsCheckSession] `json:"check_session"` + CheckSession param.Field[GatewayRuleReplaceParamsRuleSettingsCheckSession] `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. - DNSResolvers param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` + DNSResolvers param.Field[GatewayRuleReplaceParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. - Egress param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsEgress] `json:"egress"` + Egress param.Field[GatewayRuleReplaceParamsRuleSettingsEgress] `json:"egress"` // INSECURE - disable DNSSEC validation (for Allow actions). InsecureDisableDNSSECValidation param.Field[bool] `json:"insecure_disable_dnssec_validation"` // Set to true to enable IPs in DNS resolver category blocks. By default categories @@ -2865,39 +2937,39 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings s // indicator feeds only block based on domain names. IPIndicatorFeeds param.Field[bool] `json:"ip_indicator_feeds"` // Send matching traffic to the supplied destination IP address and port. - L4override param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsL4override] `json:"l4override"` + L4override param.Field[GatewayRuleReplaceParamsRuleSettingsL4override] `json:"l4override"` // Configure a notification to display on the user's device when this rule is // matched. - NotificationSettings param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsNotificationSettings] `json:"notification_settings"` + NotificationSettings param.Field[GatewayRuleReplaceParamsRuleSettingsNotificationSettings] `json:"notification_settings"` // Override matching DNS queries with a hostname. OverrideHost param.Field[string] `json:"override_host"` // Override matching DNS queries with an IP or set of IPs. OverrideIPs param.Field[[]string] `json:"override_ips"` // Configure DLP payload logging. - PayloadLog param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsPayloadLog] `json:"payload_log"` + PayloadLog param.Field[GatewayRuleReplaceParamsRuleSettingsPayloadLog] `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS // resolver. Cannot be set when dns_resolvers are specified. ResolveDNSThroughCloudflare param.Field[bool] `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. - UntrustedCert param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCert] `json:"untrusted_cert"` + UntrustedCert param.Field[GatewayRuleReplaceParamsRuleSettingsUntrustedCert] `json:"untrusted_cert"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Settings for the Audit SSH action. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsAuditSSH struct { +type GatewayRuleReplaceParamsRuleSettingsAuditSSH struct { // Enable to turn on SSH command logging. CommandLogging param.Field[bool] `json:"command_logging"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsAuditSSH) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsAuditSSH) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how browser isolation behaves. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsBisoAdminControls struct { +type GatewayRuleReplaceParamsRuleSettingsBisoAdminControls struct { // Set to true to enable copy-pasting. Dcp param.Field[bool] `json:"dcp"` // Set to true to enable downloading. @@ -2910,35 +2982,35 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsBi Du param.Field[bool] `json:"du"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsBisoAdminControls) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsBisoAdminControls) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how session check behaves. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsCheckSession struct { +type GatewayRuleReplaceParamsRuleSettingsCheckSession struct { // Configure how fresh the session needs to be to be considered valid. Duration param.Field[string] `json:"duration"` // Set to true to enable session enforcement. Enforce param.Field[bool] `json:"enforce"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsCheckSession) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsCheckSession) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will // route to the address closest to their origin. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolvers struct { - IPV4 param.Field[[]GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` - IPV6 param.Field[[]GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` +type GatewayRuleReplaceParamsRuleSettingsDNSResolvers struct { + IPV4 param.Field[[]GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` + IPV6 param.Field[[]GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolvers) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsDNSResolvers) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV4 struct { +type GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV4 struct { // IP address of upstream resolver. IP param.Field[string] `json:"ip,required"` // A port number to use for upstream resolver. @@ -2951,11 +3023,11 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDN VnetID param.Field[string] `json:"vnet_id"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV6 struct { +type GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV6 struct { // IP address of upstream resolver. IP param.Field[string] `json:"ip,required"` // A port number to use for upstream resolver. @@ -2968,14 +3040,14 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDN VnetID param.Field[string] `json:"vnet_id"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV6) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV6) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via // WARP IPs. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsEgress struct { +type GatewayRuleReplaceParamsRuleSettingsEgress struct { // The IPv4 address to be used for egress. IPV4 param.Field[string] `json:"ipv4"` // The fallback IPv4 address to be used for egress in the event of an error @@ -2986,25 +3058,25 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsEg IPV6 param.Field[string] `json:"ipv6"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsEgress) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsEgress) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Send matching traffic to the supplied destination IP address and port. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsL4override struct { +type GatewayRuleReplaceParamsRuleSettingsL4override struct { // IPv4 or IPv6 address. IP param.Field[string] `json:"ip"` // A port number to use for TCP/UDP overrides. Port param.Field[int64] `json:"port"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsL4override) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsL4override) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure a notification to display on the user's device when this rule is // matched. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsNotificationSettings struct { +type GatewayRuleReplaceParamsRuleSettingsNotificationSettings struct { // Set notification on Enabled param.Field[bool] `json:"enabled"` // Customize the message shown in the notification. @@ -3014,44 +3086,44 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsNo SupportURL param.Field[string] `json:"support_url"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsNotificationSettings) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsNotificationSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure DLP payload logging. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsPayloadLog struct { +type GatewayRuleReplaceParamsRuleSettingsPayloadLog struct { // Set to true to enable DLP payload logging for this rule. Enabled param.Field[bool] `json:"enabled"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsPayloadLog) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsPayloadLog) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configure behavior when an upstream cert is invalid or an SSL error occurs. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCert struct { +type GatewayRuleReplaceParamsRuleSettingsUntrustedCert struct { // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. - Action param.Field[GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertAction] `json:"action"` + Action param.Field[GatewayRuleReplaceParamsRuleSettingsUntrustedCertAction] `json:"action"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCert) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsRuleSettingsUntrustedCert) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action performed when an untrusted certificate is seen. The default action // is an error with HTTP code 526. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertAction string +type GatewayRuleReplaceParamsRuleSettingsUntrustedCertAction string const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertActionPassThrough GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertAction = "pass_through" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertActionBlock GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertAction = "block" - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertActionError GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertAction = "error" + GatewayRuleReplaceParamsRuleSettingsUntrustedCertActionPassThrough GatewayRuleReplaceParamsRuleSettingsUntrustedCertAction = "pass_through" + GatewayRuleReplaceParamsRuleSettingsUntrustedCertActionBlock GatewayRuleReplaceParamsRuleSettingsUntrustedCertAction = "block" + GatewayRuleReplaceParamsRuleSettingsUntrustedCertActionError GatewayRuleReplaceParamsRuleSettingsUntrustedCertAction = "error" ) // The schedule for activating DNS policies. This does not apply to HTTP or network // policies. -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsSchedule struct { +type GatewayRuleReplaceParamsSchedule struct { // The time intervals when the rule will be active on Fridays, in increasing order // from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on // Fridays. @@ -3090,180 +3162,75 @@ type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsSchedule struc Wed param.Field[string] `json:"wed"` } -func (r GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsSchedule) MarshalJSON() (data []byte, err error) { +func (r GatewayRuleReplaceParamsSchedule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelope struct { - Errors []GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessages `json:"messages,required"` - Result GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponse `json:"result,required"` - // Whether the API call was successful - Success GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeSuccess `json:"success,required"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeJSON `json:"-"` -} - -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelope] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrorsJSON `json:"-"` -} - -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrors] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessagesJSON `json:"-"` -} - -// gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessages] -type gatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeSuccess bool - -const ( - GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeSuccessTrue GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleResponseEnvelopeSuccess = true -) - -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelope struct { - Errors []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessages `json:"messages,required"` - Result []GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponse `json:"result,required,nullable"` +type GatewayRuleReplaceResponseEnvelope struct { + Errors []GatewayRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []GatewayRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result GatewayRuleReplaceResponse `json:"result,required"` // Whether the API call was successful - Success GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeJSON `json:"-"` + Success GatewayRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON gatewayRuleReplaceResponseEnvelopeJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelope] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeJSON struct { +// gatewayRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [GatewayRuleReplaceResponseEnvelope] +type gatewayRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrorsJSON `json:"-"` +type GatewayRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrors] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrorsJSON struct { +// gatewayRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [GatewayRuleReplaceResponseEnvelopeErrors] +type gatewayRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessagesJSON `json:"-"` +type GatewayRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON gatewayRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessages] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessagesJSON struct { +// gatewayRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [GatewayRuleReplaceResponseEnvelopeMessages] +type gatewayRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *GatewayRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeSuccess bool +type GatewayRuleReplaceResponseEnvelopeSuccess bool const ( - GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeSuccessTrue GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeSuccess = true + GatewayRuleReplaceResponseEnvelopeSuccessTrue GatewayRuleReplaceResponseEnvelopeSuccess = true ) - -type GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfo] -type gatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *GatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/gatewayrule_test.go b/gatewayrule_test.go index 8e1cbb8dcbf..3fea3f061cd 100644 --- a/gatewayrule_test.go +++ b/gatewayrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { +func TestGatewayRuleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,20 +29,19 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Rules.Update( + _, err := client.Gateways.Rules.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.GatewayRuleUpdateParams{ - Action: cloudflare.F(cloudflare.GatewayRuleUpdateParamsActionAllow), + cloudflare.GatewayRuleNewParams{ + Action: cloudflare.F(cloudflare.GatewayRuleNewParamsActionAllow), Name: cloudflare.F("block bad websites"), Description: cloudflare.F("Block bad websites based on their host name."), DevicePosture: cloudflare.F("any(device_posture.checks.passed[*] in {\"1308749e-fcfb-4ebc-b051-fe022b632644\"})"), Enabled: cloudflare.F(true), - Filters: cloudflare.F([]cloudflare.GatewayRuleUpdateParamsFilter{cloudflare.GatewayRuleUpdateParamsFilterHTTP}), + Filters: cloudflare.F([]cloudflare.GatewayRuleNewParamsFilter{cloudflare.GatewayRuleNewParamsFilterHTTP}), Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"), Precedence: cloudflare.F(int64(0)), - RuleSettings: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettings{ + RuleSettings: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettings{ AddHeaders: cloudflare.F[any](map[string]interface{}{ "My-Next-Header": map[string]interface{}{ "0": "foo", @@ -53,10 +52,10 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { }, }), AllowChildBypass: cloudflare.F(false), - AuditSSH: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsAuditSSH{ + AuditSSH: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsAuditSSH{ CommandLogging: cloudflare.F(false), }), - BisoAdminControls: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsBisoAdminControls{ + BisoAdminControls: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsBisoAdminControls{ Dcp: cloudflare.F(false), Dd: cloudflare.F(false), Dk: cloudflare.F(false), @@ -66,12 +65,12 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { BlockPageEnabled: cloudflare.F(true), BlockReason: cloudflare.F("This website is a security risk"), BypassParentRule: cloudflare.F(false), - CheckSession: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsCheckSession{ + CheckSession: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsCheckSession{ Duration: cloudflare.F("300s"), Enforce: cloudflare.F(true), }), - DNSResolvers: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsDNSResolvers{ - IPV4: cloudflare.F([]cloudflare.GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4{{ + DNSResolvers: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsDNSResolvers{ + IPV4: cloudflare.F([]cloudflare.GatewayRuleNewParamsRuleSettingsDNSResolversIPV4{{ IP: cloudflare.F("2001:DB8::/64"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), @@ -87,7 +86,7 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), - IPV6: cloudflare.F([]cloudflare.GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6{{ + IPV6: cloudflare.F([]cloudflare.GatewayRuleNewParamsRuleSettingsDNSResolversIPV6{{ IP: cloudflare.F("2001:DB8::/64"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), @@ -104,7 +103,7 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), }), - Egress: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsEgress{ + Egress: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsEgress{ IPV4: cloudflare.F("192.0.2.2"), IPV4Fallback: cloudflare.F("192.0.2.3"), IPV6: cloudflare.F("2001:DB8::/64"), @@ -112,26 +111,26 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { InsecureDisableDNSSECValidation: cloudflare.F(false), IPCategories: cloudflare.F(true), IPIndicatorFeeds: cloudflare.F(true), - L4override: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsL4override{ + L4override: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsL4override{ IP: cloudflare.F("1.1.1.1"), Port: cloudflare.F(int64(0)), }), - NotificationSettings: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsNotificationSettings{ + NotificationSettings: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsNotificationSettings{ Enabled: cloudflare.F(true), Msg: cloudflare.F("string"), SupportURL: cloudflare.F("string"), }), OverrideHost: cloudflare.F("example.com"), OverrideIPs: cloudflare.F([]string{"1.1.1.1", "2.2.2.2"}), - PayloadLog: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsPayloadLog{ + PayloadLog: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsPayloadLog{ Enabled: cloudflare.F(true), }), ResolveDNSThroughCloudflare: cloudflare.F(true), - UntrustedCert: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsUntrustedCert{ - Action: cloudflare.F(cloudflare.GatewayRuleUpdateParamsRuleSettingsUntrustedCertActionError), + UntrustedCert: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsUntrustedCert{ + Action: cloudflare.F(cloudflare.GatewayRuleNewParamsRuleSettingsUntrustedCertActionError), }), }), - Schedule: cloudflare.F(cloudflare.GatewayRuleUpdateParamsSchedule{ + Schedule: cloudflare.F(cloudflare.GatewayRuleNewParamsSchedule{ Fri: cloudflare.F("08:00-12:30,13:30-17:00"), Mon: cloudflare.F("08:00-12:30,13:30-17:00"), Sat: cloudflare.F("08:00-12:30,13:30-17:00"), @@ -153,6 +152,32 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { } } +func TestGatewayRuleList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Gateways.Rules.List(context.TODO(), "699d98642c564d2e855e9661899b7252") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestGatewayRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -213,7 +238,7 @@ func TestGatewayRuleGet(t *testing.T) { } } -func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalParams(t *testing.T) { +func TestGatewayRuleReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -229,19 +254,20 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Gateways.Rules.ZeroTrustGatewayRulesNewZeroTrustGatewayRule( + _, err := client.Gateways.Rules.Replace( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParams{ - Action: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsActionAllow), + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.GatewayRuleReplaceParams{ + Action: cloudflare.F(cloudflare.GatewayRuleReplaceParamsActionAllow), Name: cloudflare.F("block bad websites"), Description: cloudflare.F("Block bad websites based on their host name."), DevicePosture: cloudflare.F("any(device_posture.checks.passed[*] in {\"1308749e-fcfb-4ebc-b051-fe022b632644\"})"), Enabled: cloudflare.F(true), - Filters: cloudflare.F([]cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilter{cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsFilterHTTP}), + Filters: cloudflare.F([]cloudflare.GatewayRuleReplaceParamsFilter{cloudflare.GatewayRuleReplaceParamsFilterHTTP}), Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"), Precedence: cloudflare.F(int64(0)), - RuleSettings: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettings{ + RuleSettings: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettings{ AddHeaders: cloudflare.F[any](map[string]interface{}{ "My-Next-Header": map[string]interface{}{ "0": "foo", @@ -252,10 +278,10 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara }, }), AllowChildBypass: cloudflare.F(false), - AuditSSH: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsAuditSSH{ + AuditSSH: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsAuditSSH{ CommandLogging: cloudflare.F(false), }), - BisoAdminControls: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsBisoAdminControls{ + BisoAdminControls: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsBisoAdminControls{ Dcp: cloudflare.F(false), Dd: cloudflare.F(false), Dk: cloudflare.F(false), @@ -265,12 +291,12 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara BlockPageEnabled: cloudflare.F(true), BlockReason: cloudflare.F("This website is a security risk"), BypassParentRule: cloudflare.F(false), - CheckSession: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsCheckSession{ + CheckSession: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsCheckSession{ Duration: cloudflare.F("300s"), Enforce: cloudflare.F(true), }), - DNSResolvers: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolvers{ - IPV4: cloudflare.F([]cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV4{{ + DNSResolvers: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsDNSResolvers{ + IPV4: cloudflare.F([]cloudflare.GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV4{{ IP: cloudflare.F("2001:DB8::/64"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), @@ -286,7 +312,7 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), - IPV6: cloudflare.F([]cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsDNSResolversIPV6{{ + IPV6: cloudflare.F([]cloudflare.GatewayRuleReplaceParamsRuleSettingsDNSResolversIPV6{{ IP: cloudflare.F("2001:DB8::/64"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), @@ -303,7 +329,7 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), }), - Egress: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsEgress{ + Egress: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsEgress{ IPV4: cloudflare.F("192.0.2.2"), IPV4Fallback: cloudflare.F("192.0.2.3"), IPV6: cloudflare.F("2001:DB8::/64"), @@ -311,26 +337,26 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara InsecureDisableDNSSECValidation: cloudflare.F(false), IPCategories: cloudflare.F(true), IPIndicatorFeeds: cloudflare.F(true), - L4override: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsL4override{ + L4override: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsL4override{ IP: cloudflare.F("1.1.1.1"), Port: cloudflare.F(int64(0)), }), - NotificationSettings: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsNotificationSettings{ + NotificationSettings: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsNotificationSettings{ Enabled: cloudflare.F(true), Msg: cloudflare.F("string"), SupportURL: cloudflare.F("string"), }), OverrideHost: cloudflare.F("example.com"), OverrideIPs: cloudflare.F([]string{"1.1.1.1", "2.2.2.2"}), - PayloadLog: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsPayloadLog{ + PayloadLog: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsPayloadLog{ Enabled: cloudflare.F(true), }), ResolveDNSThroughCloudflare: cloudflare.F(true), - UntrustedCert: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCert{ - Action: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsRuleSettingsUntrustedCertActionError), + UntrustedCert: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsUntrustedCert{ + Action: cloudflare.F(cloudflare.GatewayRuleReplaceParamsRuleSettingsUntrustedCertActionError), }), }), - Schedule: cloudflare.F(cloudflare.GatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleParamsSchedule{ + Schedule: cloudflare.F(cloudflare.GatewayRuleReplaceParamsSchedule{ Fri: cloudflare.F("08:00-12:30,13:30-17:00"), Mon: cloudflare.F("08:00-12:30,13:30-17:00"), Sat: cloudflare.F("08:00-12:30,13:30-17:00"), @@ -351,29 +377,3 @@ func TestGatewayRuleZeroTrustGatewayRulesNewZeroTrustGatewayRuleWithOptionalPara t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestGatewayRuleZeroTrustGatewayRulesListZeroTrustGatewayRules(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Gateways.Rules.ZeroTrustGatewayRulesListZeroTrustGatewayRules(context.TODO(), "699d98642c564d2e855e9661899b7252") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/healthcheck.go b/healthcheck.go index 2522ef70f87..4779f52416d 100644 --- a/healthcheck.go +++ b/healthcheck.go @@ -34,12 +34,25 @@ func NewHealthcheckService(opts ...option.RequestOption) (r *HealthcheckService) return } -// Update a configured health check. -func (r *HealthcheckService) Update(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckUpdateParams, opts ...option.RequestOption) (res *HealthcheckUpdateResponse, err error) { +// Create a new health check. +func (r *HealthcheckService) New(ctx context.Context, zoneIdentifier string, body HealthcheckNewParams, opts ...option.RequestOption) (res *HealthcheckNewResponse, err error) { opts = append(r.Options[:], opts...) - var env HealthcheckUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env HealthcheckNewResponseEnvelope + path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List configured health checks. +func (r *HealthcheckService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]HealthcheckListResponse, err error) { + opts = append(r.Options[:], opts...) + var env HealthcheckListResponseEnvelope + path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,25 +86,12 @@ func (r *HealthcheckService) Get(ctx context.Context, zoneIdentifier string, ide return } -// Create a new health check. -func (r *HealthcheckService) HealthChecksNewHealthCheck(ctx context.Context, zoneIdentifier string, body HealthcheckHealthChecksNewHealthCheckParams, opts ...option.RequestOption) (res *HealthcheckHealthChecksNewHealthCheckResponse, err error) { - opts = append(r.Options[:], opts...) - var env HealthcheckHealthChecksNewHealthCheckResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// List configured health checks. -func (r *HealthcheckService) HealthChecksListHealthChecks(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]HealthcheckHealthChecksListHealthChecksResponse, err error) { +// Update a configured health check. +func (r *HealthcheckService) Replace(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckReplaceParams, opts ...option.RequestOption) (res *HealthcheckReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env HealthcheckHealthChecksListHealthChecksResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env HealthcheckReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -99,14 +99,14 @@ func (r *HealthcheckService) HealthChecksListHealthChecks(ctx context.Context, z return } -type HealthcheckUpdateResponse struct { +type HealthcheckNewResponse struct { // Identifier ID string `json:"id"` // The hostname or IP address of the origin server to run health checks on. Address string `json:"address"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions []HealthcheckUpdateResponseCheckRegion `json:"check_regions,nullable"` + CheckRegions []HealthcheckNewResponseCheckRegion `json:"check_regions,nullable"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails int64 `json:"consecutive_fails"` @@ -119,7 +119,7 @@ type HealthcheckUpdateResponse struct { // The current failure reason if status is unhealthy. FailureReason string `json:"failure_reason"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig HealthcheckUpdateResponseHTTPConfig `json:"http_config,nullable"` + HTTPConfig HealthcheckNewResponseHTTPConfig `json:"http_config,nullable"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -132,22 +132,22 @@ type HealthcheckUpdateResponse struct { // as unhealthy. Retries are attempted immediately. Retries int64 `json:"retries"` // The current status of the origin server according to the health check. - Status HealthcheckUpdateResponseStatus `json:"status"` + Status HealthcheckNewResponseStatus `json:"status"` // If suspended, no health checks are sent to the origin. Suspended bool `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig HealthcheckUpdateResponseTcpConfig `json:"tcp_config,nullable"` + TcpConfig HealthcheckNewResponseTcpConfig `json:"tcp_config,nullable"` // The timeout (in seconds) before marking the health check as failed. Timeout int64 `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP', 'HTTPS' and 'TCP'. - Type string `json:"type"` - JSON healthcheckUpdateResponseJSON `json:"-"` + Type string `json:"type"` + JSON healthcheckNewResponseJSON `json:"-"` } -// healthcheckUpdateResponseJSON contains the JSON metadata for the struct -// [HealthcheckUpdateResponse] -type healthcheckUpdateResponseJSON struct { +// healthcheckNewResponseJSON contains the JSON metadata for the struct +// [HealthcheckNewResponse] +type healthcheckNewResponseJSON struct { ID apijson.Field Address apijson.Field CheckRegions apijson.Field @@ -170,7 +170,7 @@ type healthcheckUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -179,27 +179,27 @@ func (r *HealthcheckUpdateResponse) UnmarshalJSON(data []byte) (err error) { // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckUpdateResponseCheckRegion string +type HealthcheckNewResponseCheckRegion string const ( - HealthcheckUpdateResponseCheckRegionWnam HealthcheckUpdateResponseCheckRegion = "WNAM" - HealthcheckUpdateResponseCheckRegionEnam HealthcheckUpdateResponseCheckRegion = "ENAM" - HealthcheckUpdateResponseCheckRegionWeu HealthcheckUpdateResponseCheckRegion = "WEU" - HealthcheckUpdateResponseCheckRegionEeu HealthcheckUpdateResponseCheckRegion = "EEU" - HealthcheckUpdateResponseCheckRegionNsam HealthcheckUpdateResponseCheckRegion = "NSAM" - HealthcheckUpdateResponseCheckRegionSsam HealthcheckUpdateResponseCheckRegion = "SSAM" - HealthcheckUpdateResponseCheckRegionOc HealthcheckUpdateResponseCheckRegion = "OC" - HealthcheckUpdateResponseCheckRegionMe HealthcheckUpdateResponseCheckRegion = "ME" - HealthcheckUpdateResponseCheckRegionNaf HealthcheckUpdateResponseCheckRegion = "NAF" - HealthcheckUpdateResponseCheckRegionSaf HealthcheckUpdateResponseCheckRegion = "SAF" - HealthcheckUpdateResponseCheckRegionIn HealthcheckUpdateResponseCheckRegion = "IN" - HealthcheckUpdateResponseCheckRegionSeas HealthcheckUpdateResponseCheckRegion = "SEAS" - HealthcheckUpdateResponseCheckRegionNeas HealthcheckUpdateResponseCheckRegion = "NEAS" - HealthcheckUpdateResponseCheckRegionAllRegions HealthcheckUpdateResponseCheckRegion = "ALL_REGIONS" + HealthcheckNewResponseCheckRegionWnam HealthcheckNewResponseCheckRegion = "WNAM" + HealthcheckNewResponseCheckRegionEnam HealthcheckNewResponseCheckRegion = "ENAM" + HealthcheckNewResponseCheckRegionWeu HealthcheckNewResponseCheckRegion = "WEU" + HealthcheckNewResponseCheckRegionEeu HealthcheckNewResponseCheckRegion = "EEU" + HealthcheckNewResponseCheckRegionNsam HealthcheckNewResponseCheckRegion = "NSAM" + HealthcheckNewResponseCheckRegionSsam HealthcheckNewResponseCheckRegion = "SSAM" + HealthcheckNewResponseCheckRegionOc HealthcheckNewResponseCheckRegion = "OC" + HealthcheckNewResponseCheckRegionMe HealthcheckNewResponseCheckRegion = "ME" + HealthcheckNewResponseCheckRegionNaf HealthcheckNewResponseCheckRegion = "NAF" + HealthcheckNewResponseCheckRegionSaf HealthcheckNewResponseCheckRegion = "SAF" + HealthcheckNewResponseCheckRegionIn HealthcheckNewResponseCheckRegion = "IN" + HealthcheckNewResponseCheckRegionSeas HealthcheckNewResponseCheckRegion = "SEAS" + HealthcheckNewResponseCheckRegionNeas HealthcheckNewResponseCheckRegion = "NEAS" + HealthcheckNewResponseCheckRegionAllRegions HealthcheckNewResponseCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckUpdateResponseHTTPConfig struct { +type HealthcheckNewResponseHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure bool `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -214,18 +214,18 @@ type HealthcheckUpdateResponseHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header interface{} `json:"header,nullable"` // The HTTP method to use for the health check. - Method HealthcheckUpdateResponseHTTPConfigMethod `json:"method"` + Method HealthcheckNewResponseHTTPConfigMethod `json:"method"` // The endpoint path to health check against. Path string `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP // or 443 if type is HTTPS. - Port int64 `json:"port"` - JSON healthcheckUpdateResponseHTTPConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckNewResponseHTTPConfigJSON `json:"-"` } -// healthcheckUpdateResponseHTTPConfigJSON contains the JSON metadata for the -// struct [HealthcheckUpdateResponseHTTPConfig] -type healthcheckUpdateResponseHTTPConfigJSON struct { +// healthcheckNewResponseHTTPConfigJSON contains the JSON metadata for the struct +// [HealthcheckNewResponseHTTPConfig] +type healthcheckNewResponseHTTPConfigJSON struct { AllowInsecure apijson.Field ExpectedBody apijson.Field ExpectedCodes apijson.Field @@ -238,83 +238,65 @@ type healthcheckUpdateResponseHTTPConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The HTTP method to use for the health check. -type HealthcheckUpdateResponseHTTPConfigMethod string +type HealthcheckNewResponseHTTPConfigMethod string const ( - HealthcheckUpdateResponseHTTPConfigMethodGet HealthcheckUpdateResponseHTTPConfigMethod = "GET" - HealthcheckUpdateResponseHTTPConfigMethodHead HealthcheckUpdateResponseHTTPConfigMethod = "HEAD" + HealthcheckNewResponseHTTPConfigMethodGet HealthcheckNewResponseHTTPConfigMethod = "GET" + HealthcheckNewResponseHTTPConfigMethodHead HealthcheckNewResponseHTTPConfigMethod = "HEAD" ) // The current status of the origin server according to the health check. -type HealthcheckUpdateResponseStatus string +type HealthcheckNewResponseStatus string const ( - HealthcheckUpdateResponseStatusUnknown HealthcheckUpdateResponseStatus = "unknown" - HealthcheckUpdateResponseStatusHealthy HealthcheckUpdateResponseStatus = "healthy" - HealthcheckUpdateResponseStatusUnhealthy HealthcheckUpdateResponseStatus = "unhealthy" - HealthcheckUpdateResponseStatusSuspended HealthcheckUpdateResponseStatus = "suspended" + HealthcheckNewResponseStatusUnknown HealthcheckNewResponseStatus = "unknown" + HealthcheckNewResponseStatusHealthy HealthcheckNewResponseStatus = "healthy" + HealthcheckNewResponseStatusUnhealthy HealthcheckNewResponseStatus = "unhealthy" + HealthcheckNewResponseStatusSuspended HealthcheckNewResponseStatus = "suspended" ) // Parameters specific to TCP health check. -type HealthcheckUpdateResponseTcpConfig struct { +type HealthcheckNewResponseTcpConfig struct { // The TCP connection method to use for the health check. - Method HealthcheckUpdateResponseTcpConfigMethod `json:"method"` + Method HealthcheckNewResponseTcpConfigMethod `json:"method"` // Port number to connect to for the health check. Defaults to 80. - Port int64 `json:"port"` - JSON healthcheckUpdateResponseTcpConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckNewResponseTcpConfigJSON `json:"-"` } -// healthcheckUpdateResponseTcpConfigJSON contains the JSON metadata for the struct -// [HealthcheckUpdateResponseTcpConfig] -type healthcheckUpdateResponseTcpConfigJSON struct { +// healthcheckNewResponseTcpConfigJSON contains the JSON metadata for the struct +// [HealthcheckNewResponseTcpConfig] +type healthcheckNewResponseTcpConfigJSON struct { Method apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The TCP connection method to use for the health check. -type HealthcheckUpdateResponseTcpConfigMethod string +type HealthcheckNewResponseTcpConfigMethod string const ( - HealthcheckUpdateResponseTcpConfigMethodConnectionEstablished HealthcheckUpdateResponseTcpConfigMethod = "connection_established" + HealthcheckNewResponseTcpConfigMethodConnectionEstablished HealthcheckNewResponseTcpConfigMethod = "connection_established" ) -type HealthcheckDeleteResponse struct { - // Identifier - ID string `json:"id"` - JSON healthcheckDeleteResponseJSON `json:"-"` -} - -// healthcheckDeleteResponseJSON contains the JSON metadata for the struct -// [HealthcheckDeleteResponse] -type healthcheckDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HealthcheckGetResponse struct { +type HealthcheckListResponse struct { // Identifier ID string `json:"id"` // The hostname or IP address of the origin server to run health checks on. Address string `json:"address"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions []HealthcheckGetResponseCheckRegion `json:"check_regions,nullable"` + CheckRegions []HealthcheckListResponseCheckRegion `json:"check_regions,nullable"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails int64 `json:"consecutive_fails"` @@ -327,7 +309,7 @@ type HealthcheckGetResponse struct { // The current failure reason if status is unhealthy. FailureReason string `json:"failure_reason"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig HealthcheckGetResponseHTTPConfig `json:"http_config,nullable"` + HTTPConfig HealthcheckListResponseHTTPConfig `json:"http_config,nullable"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -340,22 +322,22 @@ type HealthcheckGetResponse struct { // as unhealthy. Retries are attempted immediately. Retries int64 `json:"retries"` // The current status of the origin server according to the health check. - Status HealthcheckGetResponseStatus `json:"status"` + Status HealthcheckListResponseStatus `json:"status"` // If suspended, no health checks are sent to the origin. Suspended bool `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig HealthcheckGetResponseTcpConfig `json:"tcp_config,nullable"` + TcpConfig HealthcheckListResponseTcpConfig `json:"tcp_config,nullable"` // The timeout (in seconds) before marking the health check as failed. Timeout int64 `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP', 'HTTPS' and 'TCP'. - Type string `json:"type"` - JSON healthcheckGetResponseJSON `json:"-"` + Type string `json:"type"` + JSON healthcheckListResponseJSON `json:"-"` } -// healthcheckGetResponseJSON contains the JSON metadata for the struct -// [HealthcheckGetResponse] -type healthcheckGetResponseJSON struct { +// healthcheckListResponseJSON contains the JSON metadata for the struct +// [HealthcheckListResponse] +type healthcheckListResponseJSON struct { ID apijson.Field Address apijson.Field CheckRegions apijson.Field @@ -378,7 +360,7 @@ type healthcheckGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -387,27 +369,27 @@ func (r *HealthcheckGetResponse) UnmarshalJSON(data []byte) (err error) { // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckGetResponseCheckRegion string +type HealthcheckListResponseCheckRegion string const ( - HealthcheckGetResponseCheckRegionWnam HealthcheckGetResponseCheckRegion = "WNAM" - HealthcheckGetResponseCheckRegionEnam HealthcheckGetResponseCheckRegion = "ENAM" - HealthcheckGetResponseCheckRegionWeu HealthcheckGetResponseCheckRegion = "WEU" - HealthcheckGetResponseCheckRegionEeu HealthcheckGetResponseCheckRegion = "EEU" - HealthcheckGetResponseCheckRegionNsam HealthcheckGetResponseCheckRegion = "NSAM" - HealthcheckGetResponseCheckRegionSsam HealthcheckGetResponseCheckRegion = "SSAM" - HealthcheckGetResponseCheckRegionOc HealthcheckGetResponseCheckRegion = "OC" - HealthcheckGetResponseCheckRegionMe HealthcheckGetResponseCheckRegion = "ME" - HealthcheckGetResponseCheckRegionNaf HealthcheckGetResponseCheckRegion = "NAF" - HealthcheckGetResponseCheckRegionSaf HealthcheckGetResponseCheckRegion = "SAF" - HealthcheckGetResponseCheckRegionIn HealthcheckGetResponseCheckRegion = "IN" - HealthcheckGetResponseCheckRegionSeas HealthcheckGetResponseCheckRegion = "SEAS" - HealthcheckGetResponseCheckRegionNeas HealthcheckGetResponseCheckRegion = "NEAS" - HealthcheckGetResponseCheckRegionAllRegions HealthcheckGetResponseCheckRegion = "ALL_REGIONS" + HealthcheckListResponseCheckRegionWnam HealthcheckListResponseCheckRegion = "WNAM" + HealthcheckListResponseCheckRegionEnam HealthcheckListResponseCheckRegion = "ENAM" + HealthcheckListResponseCheckRegionWeu HealthcheckListResponseCheckRegion = "WEU" + HealthcheckListResponseCheckRegionEeu HealthcheckListResponseCheckRegion = "EEU" + HealthcheckListResponseCheckRegionNsam HealthcheckListResponseCheckRegion = "NSAM" + HealthcheckListResponseCheckRegionSsam HealthcheckListResponseCheckRegion = "SSAM" + HealthcheckListResponseCheckRegionOc HealthcheckListResponseCheckRegion = "OC" + HealthcheckListResponseCheckRegionMe HealthcheckListResponseCheckRegion = "ME" + HealthcheckListResponseCheckRegionNaf HealthcheckListResponseCheckRegion = "NAF" + HealthcheckListResponseCheckRegionSaf HealthcheckListResponseCheckRegion = "SAF" + HealthcheckListResponseCheckRegionIn HealthcheckListResponseCheckRegion = "IN" + HealthcheckListResponseCheckRegionSeas HealthcheckListResponseCheckRegion = "SEAS" + HealthcheckListResponseCheckRegionNeas HealthcheckListResponseCheckRegion = "NEAS" + HealthcheckListResponseCheckRegionAllRegions HealthcheckListResponseCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckGetResponseHTTPConfig struct { +type HealthcheckListResponseHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure bool `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -422,18 +404,18 @@ type HealthcheckGetResponseHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header interface{} `json:"header,nullable"` // The HTTP method to use for the health check. - Method HealthcheckGetResponseHTTPConfigMethod `json:"method"` + Method HealthcheckListResponseHTTPConfigMethod `json:"method"` // The endpoint path to health check against. Path string `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP // or 443 if type is HTTPS. - Port int64 `json:"port"` - JSON healthcheckGetResponseHTTPConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckListResponseHTTPConfigJSON `json:"-"` } -// healthcheckGetResponseHTTPConfigJSON contains the JSON metadata for the struct -// [HealthcheckGetResponseHTTPConfig] -type healthcheckGetResponseHTTPConfigJSON struct { +// healthcheckListResponseHTTPConfigJSON contains the JSON metadata for the struct +// [HealthcheckListResponseHTTPConfig] +type healthcheckListResponseHTTPConfigJSON struct { AllowInsecure apijson.Field ExpectedBody apijson.Field ExpectedCodes apijson.Field @@ -446,65 +428,83 @@ type healthcheckGetResponseHTTPConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckGetResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckListResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The HTTP method to use for the health check. -type HealthcheckGetResponseHTTPConfigMethod string +type HealthcheckListResponseHTTPConfigMethod string const ( - HealthcheckGetResponseHTTPConfigMethodGet HealthcheckGetResponseHTTPConfigMethod = "GET" - HealthcheckGetResponseHTTPConfigMethodHead HealthcheckGetResponseHTTPConfigMethod = "HEAD" + HealthcheckListResponseHTTPConfigMethodGet HealthcheckListResponseHTTPConfigMethod = "GET" + HealthcheckListResponseHTTPConfigMethodHead HealthcheckListResponseHTTPConfigMethod = "HEAD" ) // The current status of the origin server according to the health check. -type HealthcheckGetResponseStatus string +type HealthcheckListResponseStatus string const ( - HealthcheckGetResponseStatusUnknown HealthcheckGetResponseStatus = "unknown" - HealthcheckGetResponseStatusHealthy HealthcheckGetResponseStatus = "healthy" - HealthcheckGetResponseStatusUnhealthy HealthcheckGetResponseStatus = "unhealthy" - HealthcheckGetResponseStatusSuspended HealthcheckGetResponseStatus = "suspended" + HealthcheckListResponseStatusUnknown HealthcheckListResponseStatus = "unknown" + HealthcheckListResponseStatusHealthy HealthcheckListResponseStatus = "healthy" + HealthcheckListResponseStatusUnhealthy HealthcheckListResponseStatus = "unhealthy" + HealthcheckListResponseStatusSuspended HealthcheckListResponseStatus = "suspended" ) // Parameters specific to TCP health check. -type HealthcheckGetResponseTcpConfig struct { +type HealthcheckListResponseTcpConfig struct { // The TCP connection method to use for the health check. - Method HealthcheckGetResponseTcpConfigMethod `json:"method"` + Method HealthcheckListResponseTcpConfigMethod `json:"method"` // Port number to connect to for the health check. Defaults to 80. - Port int64 `json:"port"` - JSON healthcheckGetResponseTcpConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckListResponseTcpConfigJSON `json:"-"` } -// healthcheckGetResponseTcpConfigJSON contains the JSON metadata for the struct -// [HealthcheckGetResponseTcpConfig] -type healthcheckGetResponseTcpConfigJSON struct { +// healthcheckListResponseTcpConfigJSON contains the JSON metadata for the struct +// [HealthcheckListResponseTcpConfig] +type healthcheckListResponseTcpConfigJSON struct { Method apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckGetResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckListResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The TCP connection method to use for the health check. -type HealthcheckGetResponseTcpConfigMethod string +type HealthcheckListResponseTcpConfigMethod string const ( - HealthcheckGetResponseTcpConfigMethodConnectionEstablished HealthcheckGetResponseTcpConfigMethod = "connection_established" + HealthcheckListResponseTcpConfigMethodConnectionEstablished HealthcheckListResponseTcpConfigMethod = "connection_established" ) -type HealthcheckHealthChecksNewHealthCheckResponse struct { +type HealthcheckDeleteResponse struct { + // Identifier + ID string `json:"id"` + JSON healthcheckDeleteResponseJSON `json:"-"` +} + +// healthcheckDeleteResponseJSON contains the JSON metadata for the struct +// [HealthcheckDeleteResponse] +type healthcheckDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HealthcheckGetResponse struct { // Identifier ID string `json:"id"` // The hostname or IP address of the origin server to run health checks on. Address string `json:"address"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions []HealthcheckHealthChecksNewHealthCheckResponseCheckRegion `json:"check_regions,nullable"` + CheckRegions []HealthcheckGetResponseCheckRegion `json:"check_regions,nullable"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails int64 `json:"consecutive_fails"` @@ -517,7 +517,7 @@ type HealthcheckHealthChecksNewHealthCheckResponse struct { // The current failure reason if status is unhealthy. FailureReason string `json:"failure_reason"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig HealthcheckHealthChecksNewHealthCheckResponseHTTPConfig `json:"http_config,nullable"` + HTTPConfig HealthcheckGetResponseHTTPConfig `json:"http_config,nullable"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -530,22 +530,22 @@ type HealthcheckHealthChecksNewHealthCheckResponse struct { // as unhealthy. Retries are attempted immediately. Retries int64 `json:"retries"` // The current status of the origin server according to the health check. - Status HealthcheckHealthChecksNewHealthCheckResponseStatus `json:"status"` + Status HealthcheckGetResponseStatus `json:"status"` // If suspended, no health checks are sent to the origin. Suspended bool `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig HealthcheckHealthChecksNewHealthCheckResponseTcpConfig `json:"tcp_config,nullable"` + TcpConfig HealthcheckGetResponseTcpConfig `json:"tcp_config,nullable"` // The timeout (in seconds) before marking the health check as failed. Timeout int64 `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP', 'HTTPS' and 'TCP'. - Type string `json:"type"` - JSON healthcheckHealthChecksNewHealthCheckResponseJSON `json:"-"` + Type string `json:"type"` + JSON healthcheckGetResponseJSON `json:"-"` } -// healthcheckHealthChecksNewHealthCheckResponseJSON contains the JSON metadata for -// the struct [HealthcheckHealthChecksNewHealthCheckResponse] -type healthcheckHealthChecksNewHealthCheckResponseJSON struct { +// healthcheckGetResponseJSON contains the JSON metadata for the struct +// [HealthcheckGetResponse] +type healthcheckGetResponseJSON struct { ID apijson.Field Address apijson.Field CheckRegions apijson.Field @@ -568,7 +568,7 @@ type healthcheckHealthChecksNewHealthCheckResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksNewHealthCheckResponse) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -577,27 +577,27 @@ func (r *HealthcheckHealthChecksNewHealthCheckResponse) UnmarshalJSON(data []byt // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckHealthChecksNewHealthCheckResponseCheckRegion string +type HealthcheckGetResponseCheckRegion string const ( - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionWnam HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "WNAM" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionEnam HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "ENAM" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionWeu HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "WEU" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionEeu HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "EEU" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionNsam HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "NSAM" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionSsam HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "SSAM" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionOc HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "OC" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionMe HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "ME" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionNaf HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "NAF" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionSaf HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "SAF" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionIn HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "IN" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionSeas HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "SEAS" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionNeas HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "NEAS" - HealthcheckHealthChecksNewHealthCheckResponseCheckRegionAllRegions HealthcheckHealthChecksNewHealthCheckResponseCheckRegion = "ALL_REGIONS" + HealthcheckGetResponseCheckRegionWnam HealthcheckGetResponseCheckRegion = "WNAM" + HealthcheckGetResponseCheckRegionEnam HealthcheckGetResponseCheckRegion = "ENAM" + HealthcheckGetResponseCheckRegionWeu HealthcheckGetResponseCheckRegion = "WEU" + HealthcheckGetResponseCheckRegionEeu HealthcheckGetResponseCheckRegion = "EEU" + HealthcheckGetResponseCheckRegionNsam HealthcheckGetResponseCheckRegion = "NSAM" + HealthcheckGetResponseCheckRegionSsam HealthcheckGetResponseCheckRegion = "SSAM" + HealthcheckGetResponseCheckRegionOc HealthcheckGetResponseCheckRegion = "OC" + HealthcheckGetResponseCheckRegionMe HealthcheckGetResponseCheckRegion = "ME" + HealthcheckGetResponseCheckRegionNaf HealthcheckGetResponseCheckRegion = "NAF" + HealthcheckGetResponseCheckRegionSaf HealthcheckGetResponseCheckRegion = "SAF" + HealthcheckGetResponseCheckRegionIn HealthcheckGetResponseCheckRegion = "IN" + HealthcheckGetResponseCheckRegionSeas HealthcheckGetResponseCheckRegion = "SEAS" + HealthcheckGetResponseCheckRegionNeas HealthcheckGetResponseCheckRegion = "NEAS" + HealthcheckGetResponseCheckRegionAllRegions HealthcheckGetResponseCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckHealthChecksNewHealthCheckResponseHTTPConfig struct { +type HealthcheckGetResponseHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure bool `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -612,19 +612,18 @@ type HealthcheckHealthChecksNewHealthCheckResponseHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header interface{} `json:"header,nullable"` // The HTTP method to use for the health check. - Method HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethod `json:"method"` + Method HealthcheckGetResponseHTTPConfigMethod `json:"method"` // The endpoint path to health check against. Path string `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP // or 443 if type is HTTPS. - Port int64 `json:"port"` - JSON healthcheckHealthChecksNewHealthCheckResponseHTTPConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckGetResponseHTTPConfigJSON `json:"-"` } -// healthcheckHealthChecksNewHealthCheckResponseHTTPConfigJSON contains the JSON -// metadata for the struct -// [HealthcheckHealthChecksNewHealthCheckResponseHTTPConfig] -type healthcheckHealthChecksNewHealthCheckResponseHTTPConfigJSON struct { +// healthcheckGetResponseHTTPConfigJSON contains the JSON metadata for the struct +// [HealthcheckGetResponseHTTPConfig] +type healthcheckGetResponseHTTPConfigJSON struct { AllowInsecure apijson.Field ExpectedBody apijson.Field ExpectedCodes apijson.Field @@ -637,65 +636,65 @@ type healthcheckHealthChecksNewHealthCheckResponseHTTPConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksNewHealthCheckResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckGetResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The HTTP method to use for the health check. -type HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethod string +type HealthcheckGetResponseHTTPConfigMethod string const ( - HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethodGet HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethod = "GET" - HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethodHead HealthcheckHealthChecksNewHealthCheckResponseHTTPConfigMethod = "HEAD" + HealthcheckGetResponseHTTPConfigMethodGet HealthcheckGetResponseHTTPConfigMethod = "GET" + HealthcheckGetResponseHTTPConfigMethodHead HealthcheckGetResponseHTTPConfigMethod = "HEAD" ) // The current status of the origin server according to the health check. -type HealthcheckHealthChecksNewHealthCheckResponseStatus string +type HealthcheckGetResponseStatus string const ( - HealthcheckHealthChecksNewHealthCheckResponseStatusUnknown HealthcheckHealthChecksNewHealthCheckResponseStatus = "unknown" - HealthcheckHealthChecksNewHealthCheckResponseStatusHealthy HealthcheckHealthChecksNewHealthCheckResponseStatus = "healthy" - HealthcheckHealthChecksNewHealthCheckResponseStatusUnhealthy HealthcheckHealthChecksNewHealthCheckResponseStatus = "unhealthy" - HealthcheckHealthChecksNewHealthCheckResponseStatusSuspended HealthcheckHealthChecksNewHealthCheckResponseStatus = "suspended" + HealthcheckGetResponseStatusUnknown HealthcheckGetResponseStatus = "unknown" + HealthcheckGetResponseStatusHealthy HealthcheckGetResponseStatus = "healthy" + HealthcheckGetResponseStatusUnhealthy HealthcheckGetResponseStatus = "unhealthy" + HealthcheckGetResponseStatusSuspended HealthcheckGetResponseStatus = "suspended" ) // Parameters specific to TCP health check. -type HealthcheckHealthChecksNewHealthCheckResponseTcpConfig struct { +type HealthcheckGetResponseTcpConfig struct { // The TCP connection method to use for the health check. - Method HealthcheckHealthChecksNewHealthCheckResponseTcpConfigMethod `json:"method"` + Method HealthcheckGetResponseTcpConfigMethod `json:"method"` // Port number to connect to for the health check. Defaults to 80. - Port int64 `json:"port"` - JSON healthcheckHealthChecksNewHealthCheckResponseTcpConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckGetResponseTcpConfigJSON `json:"-"` } -// healthcheckHealthChecksNewHealthCheckResponseTcpConfigJSON contains the JSON -// metadata for the struct [HealthcheckHealthChecksNewHealthCheckResponseTcpConfig] -type healthcheckHealthChecksNewHealthCheckResponseTcpConfigJSON struct { +// healthcheckGetResponseTcpConfigJSON contains the JSON metadata for the struct +// [HealthcheckGetResponseTcpConfig] +type healthcheckGetResponseTcpConfigJSON struct { Method apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksNewHealthCheckResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckGetResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The TCP connection method to use for the health check. -type HealthcheckHealthChecksNewHealthCheckResponseTcpConfigMethod string +type HealthcheckGetResponseTcpConfigMethod string const ( - HealthcheckHealthChecksNewHealthCheckResponseTcpConfigMethodConnectionEstablished HealthcheckHealthChecksNewHealthCheckResponseTcpConfigMethod = "connection_established" + HealthcheckGetResponseTcpConfigMethodConnectionEstablished HealthcheckGetResponseTcpConfigMethod = "connection_established" ) -type HealthcheckHealthChecksListHealthChecksResponse struct { +type HealthcheckReplaceResponse struct { // Identifier ID string `json:"id"` // The hostname or IP address of the origin server to run health checks on. Address string `json:"address"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions []HealthcheckHealthChecksListHealthChecksResponseCheckRegion `json:"check_regions,nullable"` + CheckRegions []HealthcheckReplaceResponseCheckRegion `json:"check_regions,nullable"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails int64 `json:"consecutive_fails"` @@ -708,7 +707,7 @@ type HealthcheckHealthChecksListHealthChecksResponse struct { // The current failure reason if status is unhealthy. FailureReason string `json:"failure_reason"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig HealthcheckHealthChecksListHealthChecksResponseHTTPConfig `json:"http_config,nullable"` + HTTPConfig HealthcheckReplaceResponseHTTPConfig `json:"http_config,nullable"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -721,22 +720,22 @@ type HealthcheckHealthChecksListHealthChecksResponse struct { // as unhealthy. Retries are attempted immediately. Retries int64 `json:"retries"` // The current status of the origin server according to the health check. - Status HealthcheckHealthChecksListHealthChecksResponseStatus `json:"status"` + Status HealthcheckReplaceResponseStatus `json:"status"` // If suspended, no health checks are sent to the origin. Suspended bool `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig HealthcheckHealthChecksListHealthChecksResponseTcpConfig `json:"tcp_config,nullable"` + TcpConfig HealthcheckReplaceResponseTcpConfig `json:"tcp_config,nullable"` // The timeout (in seconds) before marking the health check as failed. Timeout int64 `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP', 'HTTPS' and 'TCP'. - Type string `json:"type"` - JSON healthcheckHealthChecksListHealthChecksResponseJSON `json:"-"` + Type string `json:"type"` + JSON healthcheckReplaceResponseJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseJSON contains the JSON metadata -// for the struct [HealthcheckHealthChecksListHealthChecksResponse] -type healthcheckHealthChecksListHealthChecksResponseJSON struct { +// healthcheckReplaceResponseJSON contains the JSON metadata for the struct +// [HealthcheckReplaceResponse] +type healthcheckReplaceResponseJSON struct { ID apijson.Field Address apijson.Field CheckRegions apijson.Field @@ -759,7 +758,7 @@ type healthcheckHealthChecksListHealthChecksResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponse) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -768,27 +767,27 @@ func (r *HealthcheckHealthChecksListHealthChecksResponse) UnmarshalJSON(data []b // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckHealthChecksListHealthChecksResponseCheckRegion string +type HealthcheckReplaceResponseCheckRegion string const ( - HealthcheckHealthChecksListHealthChecksResponseCheckRegionWnam HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "WNAM" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionEnam HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "ENAM" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionWeu HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "WEU" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionEeu HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "EEU" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionNsam HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "NSAM" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionSsam HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "SSAM" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionOc HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "OC" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionMe HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "ME" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionNaf HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "NAF" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionSaf HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "SAF" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionIn HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "IN" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionSeas HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "SEAS" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionNeas HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "NEAS" - HealthcheckHealthChecksListHealthChecksResponseCheckRegionAllRegions HealthcheckHealthChecksListHealthChecksResponseCheckRegion = "ALL_REGIONS" + HealthcheckReplaceResponseCheckRegionWnam HealthcheckReplaceResponseCheckRegion = "WNAM" + HealthcheckReplaceResponseCheckRegionEnam HealthcheckReplaceResponseCheckRegion = "ENAM" + HealthcheckReplaceResponseCheckRegionWeu HealthcheckReplaceResponseCheckRegion = "WEU" + HealthcheckReplaceResponseCheckRegionEeu HealthcheckReplaceResponseCheckRegion = "EEU" + HealthcheckReplaceResponseCheckRegionNsam HealthcheckReplaceResponseCheckRegion = "NSAM" + HealthcheckReplaceResponseCheckRegionSsam HealthcheckReplaceResponseCheckRegion = "SSAM" + HealthcheckReplaceResponseCheckRegionOc HealthcheckReplaceResponseCheckRegion = "OC" + HealthcheckReplaceResponseCheckRegionMe HealthcheckReplaceResponseCheckRegion = "ME" + HealthcheckReplaceResponseCheckRegionNaf HealthcheckReplaceResponseCheckRegion = "NAF" + HealthcheckReplaceResponseCheckRegionSaf HealthcheckReplaceResponseCheckRegion = "SAF" + HealthcheckReplaceResponseCheckRegionIn HealthcheckReplaceResponseCheckRegion = "IN" + HealthcheckReplaceResponseCheckRegionSeas HealthcheckReplaceResponseCheckRegion = "SEAS" + HealthcheckReplaceResponseCheckRegionNeas HealthcheckReplaceResponseCheckRegion = "NEAS" + HealthcheckReplaceResponseCheckRegionAllRegions HealthcheckReplaceResponseCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckHealthChecksListHealthChecksResponseHTTPConfig struct { +type HealthcheckReplaceResponseHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure bool `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -803,19 +802,18 @@ type HealthcheckHealthChecksListHealthChecksResponseHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header interface{} `json:"header,nullable"` // The HTTP method to use for the health check. - Method HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethod `json:"method"` + Method HealthcheckReplaceResponseHTTPConfigMethod `json:"method"` // The endpoint path to health check against. Path string `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP // or 443 if type is HTTPS. - Port int64 `json:"port"` - JSON healthcheckHealthChecksListHealthChecksResponseHTTPConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckReplaceResponseHTTPConfigJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseHTTPConfigJSON contains the JSON -// metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseHTTPConfig] -type healthcheckHealthChecksListHealthChecksResponseHTTPConfigJSON struct { +// healthcheckReplaceResponseHTTPConfigJSON contains the JSON metadata for the +// struct [HealthcheckReplaceResponseHTTPConfig] +type healthcheckReplaceResponseHTTPConfigJSON struct { AllowInsecure apijson.Field ExpectedBody apijson.Field ExpectedCodes apijson.Field @@ -828,59 +826,58 @@ type healthcheckHealthChecksListHealthChecksResponseHTTPConfigJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The HTTP method to use for the health check. -type HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethod string +type HealthcheckReplaceResponseHTTPConfigMethod string const ( - HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethodGet HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethod = "GET" - HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethodHead HealthcheckHealthChecksListHealthChecksResponseHTTPConfigMethod = "HEAD" + HealthcheckReplaceResponseHTTPConfigMethodGet HealthcheckReplaceResponseHTTPConfigMethod = "GET" + HealthcheckReplaceResponseHTTPConfigMethodHead HealthcheckReplaceResponseHTTPConfigMethod = "HEAD" ) // The current status of the origin server according to the health check. -type HealthcheckHealthChecksListHealthChecksResponseStatus string +type HealthcheckReplaceResponseStatus string const ( - HealthcheckHealthChecksListHealthChecksResponseStatusUnknown HealthcheckHealthChecksListHealthChecksResponseStatus = "unknown" - HealthcheckHealthChecksListHealthChecksResponseStatusHealthy HealthcheckHealthChecksListHealthChecksResponseStatus = "healthy" - HealthcheckHealthChecksListHealthChecksResponseStatusUnhealthy HealthcheckHealthChecksListHealthChecksResponseStatus = "unhealthy" - HealthcheckHealthChecksListHealthChecksResponseStatusSuspended HealthcheckHealthChecksListHealthChecksResponseStatus = "suspended" + HealthcheckReplaceResponseStatusUnknown HealthcheckReplaceResponseStatus = "unknown" + HealthcheckReplaceResponseStatusHealthy HealthcheckReplaceResponseStatus = "healthy" + HealthcheckReplaceResponseStatusUnhealthy HealthcheckReplaceResponseStatus = "unhealthy" + HealthcheckReplaceResponseStatusSuspended HealthcheckReplaceResponseStatus = "suspended" ) // Parameters specific to TCP health check. -type HealthcheckHealthChecksListHealthChecksResponseTcpConfig struct { +type HealthcheckReplaceResponseTcpConfig struct { // The TCP connection method to use for the health check. - Method HealthcheckHealthChecksListHealthChecksResponseTcpConfigMethod `json:"method"` + Method HealthcheckReplaceResponseTcpConfigMethod `json:"method"` // Port number to connect to for the health check. Defaults to 80. - Port int64 `json:"port"` - JSON healthcheckHealthChecksListHealthChecksResponseTcpConfigJSON `json:"-"` + Port int64 `json:"port"` + JSON healthcheckReplaceResponseTcpConfigJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseTcpConfigJSON contains the JSON -// metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseTcpConfig] -type healthcheckHealthChecksListHealthChecksResponseTcpConfigJSON struct { +// healthcheckReplaceResponseTcpConfigJSON contains the JSON metadata for the +// struct [HealthcheckReplaceResponseTcpConfig] +type healthcheckReplaceResponseTcpConfigJSON struct { Method apijson.Field Port apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The TCP connection method to use for the health check. -type HealthcheckHealthChecksListHealthChecksResponseTcpConfigMethod string +type HealthcheckReplaceResponseTcpConfigMethod string const ( - HealthcheckHealthChecksListHealthChecksResponseTcpConfigMethodConnectionEstablished HealthcheckHealthChecksListHealthChecksResponseTcpConfigMethod = "connection_established" + HealthcheckReplaceResponseTcpConfigMethodConnectionEstablished HealthcheckReplaceResponseTcpConfigMethod = "connection_established" ) -type HealthcheckUpdateParams struct { +type HealthcheckNewParams struct { // The hostname or IP address of the origin server to run health checks on. Address param.Field[string] `json:"address,required"` // A short name to identify the health check. Only alphanumeric characters, hyphens @@ -888,7 +885,7 @@ type HealthcheckUpdateParams struct { Name param.Field[string] `json:"name,required"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions param.Field[[]HealthcheckUpdateParamsCheckRegion] `json:"check_regions"` + CheckRegions param.Field[[]HealthcheckNewParamsCheckRegion] `json:"check_regions"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails param.Field[int64] `json:"consecutive_fails"` @@ -898,7 +895,7 @@ type HealthcheckUpdateParams struct { // A human-readable description of the health check. Description param.Field[string] `json:"description"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig param.Field[HealthcheckUpdateParamsHTTPConfig] `json:"http_config"` + HTTPConfig param.Field[HealthcheckNewParamsHTTPConfig] `json:"http_config"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -909,7 +906,7 @@ type HealthcheckUpdateParams struct { // If suspended, no health checks are sent to the origin. Suspended param.Field[bool] `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig param.Field[HealthcheckUpdateParamsTcpConfig] `json:"tcp_config"` + TcpConfig param.Field[HealthcheckNewParamsTcpConfig] `json:"tcp_config"` // The timeout (in seconds) before marking the health check as failed. Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are @@ -917,7 +914,7 @@ type HealthcheckUpdateParams struct { Type param.Field[string] `json:"type"` } -func (r HealthcheckUpdateParams) MarshalJSON() (data []byte, err error) { +func (r HealthcheckNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -926,27 +923,27 @@ func (r HealthcheckUpdateParams) MarshalJSON() (data []byte, err error) { // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckUpdateParamsCheckRegion string +type HealthcheckNewParamsCheckRegion string const ( - HealthcheckUpdateParamsCheckRegionWnam HealthcheckUpdateParamsCheckRegion = "WNAM" - HealthcheckUpdateParamsCheckRegionEnam HealthcheckUpdateParamsCheckRegion = "ENAM" - HealthcheckUpdateParamsCheckRegionWeu HealthcheckUpdateParamsCheckRegion = "WEU" - HealthcheckUpdateParamsCheckRegionEeu HealthcheckUpdateParamsCheckRegion = "EEU" - HealthcheckUpdateParamsCheckRegionNsam HealthcheckUpdateParamsCheckRegion = "NSAM" - HealthcheckUpdateParamsCheckRegionSsam HealthcheckUpdateParamsCheckRegion = "SSAM" - HealthcheckUpdateParamsCheckRegionOc HealthcheckUpdateParamsCheckRegion = "OC" - HealthcheckUpdateParamsCheckRegionMe HealthcheckUpdateParamsCheckRegion = "ME" - HealthcheckUpdateParamsCheckRegionNaf HealthcheckUpdateParamsCheckRegion = "NAF" - HealthcheckUpdateParamsCheckRegionSaf HealthcheckUpdateParamsCheckRegion = "SAF" - HealthcheckUpdateParamsCheckRegionIn HealthcheckUpdateParamsCheckRegion = "IN" - HealthcheckUpdateParamsCheckRegionSeas HealthcheckUpdateParamsCheckRegion = "SEAS" - HealthcheckUpdateParamsCheckRegionNeas HealthcheckUpdateParamsCheckRegion = "NEAS" - HealthcheckUpdateParamsCheckRegionAllRegions HealthcheckUpdateParamsCheckRegion = "ALL_REGIONS" + HealthcheckNewParamsCheckRegionWnam HealthcheckNewParamsCheckRegion = "WNAM" + HealthcheckNewParamsCheckRegionEnam HealthcheckNewParamsCheckRegion = "ENAM" + HealthcheckNewParamsCheckRegionWeu HealthcheckNewParamsCheckRegion = "WEU" + HealthcheckNewParamsCheckRegionEeu HealthcheckNewParamsCheckRegion = "EEU" + HealthcheckNewParamsCheckRegionNsam HealthcheckNewParamsCheckRegion = "NSAM" + HealthcheckNewParamsCheckRegionSsam HealthcheckNewParamsCheckRegion = "SSAM" + HealthcheckNewParamsCheckRegionOc HealthcheckNewParamsCheckRegion = "OC" + HealthcheckNewParamsCheckRegionMe HealthcheckNewParamsCheckRegion = "ME" + HealthcheckNewParamsCheckRegionNaf HealthcheckNewParamsCheckRegion = "NAF" + HealthcheckNewParamsCheckRegionSaf HealthcheckNewParamsCheckRegion = "SAF" + HealthcheckNewParamsCheckRegionIn HealthcheckNewParamsCheckRegion = "IN" + HealthcheckNewParamsCheckRegionSeas HealthcheckNewParamsCheckRegion = "SEAS" + HealthcheckNewParamsCheckRegionNeas HealthcheckNewParamsCheckRegion = "NEAS" + HealthcheckNewParamsCheckRegionAllRegions HealthcheckNewParamsCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckUpdateParamsHTTPConfig struct { +type HealthcheckNewParamsHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure param.Field[bool] `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -961,7 +958,7 @@ type HealthcheckUpdateParamsHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header param.Field[interface{}] `json:"header"` // The HTTP method to use for the health check. - Method param.Field[HealthcheckUpdateParamsHTTPConfigMethod] `json:"method"` + Method param.Field[HealthcheckNewParamsHTTPConfigMethod] `json:"method"` // The endpoint path to health check against. Path param.Field[string] `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP @@ -969,49 +966,49 @@ type HealthcheckUpdateParamsHTTPConfig struct { Port param.Field[int64] `json:"port"` } -func (r HealthcheckUpdateParamsHTTPConfig) MarshalJSON() (data []byte, err error) { +func (r HealthcheckNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The HTTP method to use for the health check. -type HealthcheckUpdateParamsHTTPConfigMethod string +type HealthcheckNewParamsHTTPConfigMethod string const ( - HealthcheckUpdateParamsHTTPConfigMethodGet HealthcheckUpdateParamsHTTPConfigMethod = "GET" - HealthcheckUpdateParamsHTTPConfigMethodHead HealthcheckUpdateParamsHTTPConfigMethod = "HEAD" + HealthcheckNewParamsHTTPConfigMethodGet HealthcheckNewParamsHTTPConfigMethod = "GET" + HealthcheckNewParamsHTTPConfigMethodHead HealthcheckNewParamsHTTPConfigMethod = "HEAD" ) // Parameters specific to TCP health check. -type HealthcheckUpdateParamsTcpConfig struct { +type HealthcheckNewParamsTcpConfig struct { // The TCP connection method to use for the health check. - Method param.Field[HealthcheckUpdateParamsTcpConfigMethod] `json:"method"` + Method param.Field[HealthcheckNewParamsTcpConfigMethod] `json:"method"` // Port number to connect to for the health check. Defaults to 80. Port param.Field[int64] `json:"port"` } -func (r HealthcheckUpdateParamsTcpConfig) MarshalJSON() (data []byte, err error) { +func (r HealthcheckNewParamsTcpConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The TCP connection method to use for the health check. -type HealthcheckUpdateParamsTcpConfigMethod string +type HealthcheckNewParamsTcpConfigMethod string const ( - HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished HealthcheckUpdateParamsTcpConfigMethod = "connection_established" + HealthcheckNewParamsTcpConfigMethodConnectionEstablished HealthcheckNewParamsTcpConfigMethod = "connection_established" ) -type HealthcheckUpdateResponseEnvelope struct { - Errors []HealthcheckUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []HealthcheckUpdateResponseEnvelopeMessages `json:"messages,required"` - Result HealthcheckUpdateResponse `json:"result,required"` +type HealthcheckNewResponseEnvelope struct { + Errors []HealthcheckNewResponseEnvelopeErrors `json:"errors,required"` + Messages []HealthcheckNewResponseEnvelopeMessages `json:"messages,required"` + Result HealthcheckNewResponse `json:"result,required"` // Whether the API call was successful - Success HealthcheckUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON healthcheckUpdateResponseEnvelopeJSON `json:"-"` + Success HealthcheckNewResponseEnvelopeSuccess `json:"success,required"` + JSON healthcheckNewResponseEnvelopeJSON `json:"-"` } -// healthcheckUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [HealthcheckUpdateResponseEnvelope] -type healthcheckUpdateResponseEnvelopeJSON struct { +// healthcheckNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [HealthcheckNewResponseEnvelope] +type healthcheckNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1020,55 +1017,153 @@ type healthcheckUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HealthcheckUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckUpdateResponseEnvelopeErrorsJSON `json:"-"` +type HealthcheckNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckNewResponseEnvelopeErrorsJSON `json:"-"` } -// healthcheckUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [HealthcheckUpdateResponseEnvelopeErrors] -type healthcheckUpdateResponseEnvelopeErrorsJSON struct { +// healthcheckNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [HealthcheckNewResponseEnvelopeErrors] +type healthcheckNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HealthcheckUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckUpdateResponseEnvelopeMessagesJSON `json:"-"` +type HealthcheckNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckNewResponseEnvelopeMessagesJSON `json:"-"` } -// healthcheckUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [HealthcheckUpdateResponseEnvelopeMessages] -type healthcheckUpdateResponseEnvelopeMessagesJSON struct { +// healthcheckNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [HealthcheckNewResponseEnvelopeMessages] +type healthcheckNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type HealthcheckUpdateResponseEnvelopeSuccess bool +type HealthcheckNewResponseEnvelopeSuccess bool const ( - HealthcheckUpdateResponseEnvelopeSuccessTrue HealthcheckUpdateResponseEnvelopeSuccess = true + HealthcheckNewResponseEnvelopeSuccessTrue HealthcheckNewResponseEnvelopeSuccess = true ) +type HealthcheckListResponseEnvelope struct { + Errors []HealthcheckListResponseEnvelopeErrors `json:"errors,required"` + Messages []HealthcheckListResponseEnvelopeMessages `json:"messages,required"` + Result []HealthcheckListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success HealthcheckListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo HealthcheckListResponseEnvelopeResultInfo `json:"result_info"` + JSON healthcheckListResponseEnvelopeJSON `json:"-"` +} + +// healthcheckListResponseEnvelopeJSON contains the JSON metadata for the struct +// [HealthcheckListResponseEnvelope] +type healthcheckListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HealthcheckListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckListResponseEnvelopeErrorsJSON `json:"-"` +} + +// healthcheckListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [HealthcheckListResponseEnvelopeErrors] +type healthcheckListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HealthcheckListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckListResponseEnvelopeMessagesJSON `json:"-"` +} + +// healthcheckListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [HealthcheckListResponseEnvelopeMessages] +type healthcheckListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type HealthcheckListResponseEnvelopeSuccess bool + +const ( + HealthcheckListResponseEnvelopeSuccessTrue HealthcheckListResponseEnvelopeSuccess = true +) + +type HealthcheckListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON healthcheckListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// healthcheckListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [HealthcheckListResponseEnvelopeResultInfo] +type healthcheckListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type HealthcheckDeleteResponseEnvelope struct { Errors []HealthcheckDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []HealthcheckDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -1207,7 +1302,7 @@ const ( HealthcheckGetResponseEnvelopeSuccessTrue HealthcheckGetResponseEnvelopeSuccess = true ) -type HealthcheckHealthChecksNewHealthCheckParams struct { +type HealthcheckReplaceParams struct { // The hostname or IP address of the origin server to run health checks on. Address param.Field[string] `json:"address,required"` // A short name to identify the health check. Only alphanumeric characters, hyphens @@ -1215,7 +1310,7 @@ type HealthcheckHealthChecksNewHealthCheckParams struct { Name param.Field[string] `json:"name,required"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions param.Field[[]HealthcheckHealthChecksNewHealthCheckParamsCheckRegion] `json:"check_regions"` + CheckRegions param.Field[[]HealthcheckReplaceParamsCheckRegion] `json:"check_regions"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. ConsecutiveFails param.Field[int64] `json:"consecutive_fails"` @@ -1225,7 +1320,7 @@ type HealthcheckHealthChecksNewHealthCheckParams struct { // A human-readable description of the health check. Description param.Field[string] `json:"description"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig param.Field[HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig] `json:"http_config"` + HTTPConfig param.Field[HealthcheckReplaceParamsHTTPConfig] `json:"http_config"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. @@ -1236,7 +1331,7 @@ type HealthcheckHealthChecksNewHealthCheckParams struct { // If suspended, no health checks are sent to the origin. Suspended param.Field[bool] `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig param.Field[HealthcheckHealthChecksNewHealthCheckParamsTcpConfig] `json:"tcp_config"` + TcpConfig param.Field[HealthcheckReplaceParamsTcpConfig] `json:"tcp_config"` // The timeout (in seconds) before marking the health check as failed. Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are @@ -1244,7 +1339,7 @@ type HealthcheckHealthChecksNewHealthCheckParams struct { Type param.Field[string] `json:"type"` } -func (r HealthcheckHealthChecksNewHealthCheckParams) MarshalJSON() (data []byte, err error) { +func (r HealthcheckReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -1253,27 +1348,27 @@ func (r HealthcheckHealthChecksNewHealthCheckParams) MarshalJSON() (data []byte, // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckHealthChecksNewHealthCheckParamsCheckRegion string +type HealthcheckReplaceParamsCheckRegion string const ( - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionWnam HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "WNAM" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionEnam HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "ENAM" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionWeu HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "WEU" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionEeu HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "EEU" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionNsam HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "NSAM" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionSsam HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "SSAM" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionOc HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "OC" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionMe HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "ME" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionNaf HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "NAF" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionSaf HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "SAF" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionIn HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "IN" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionSeas HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "SEAS" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionNeas HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "NEAS" - HealthcheckHealthChecksNewHealthCheckParamsCheckRegionAllRegions HealthcheckHealthChecksNewHealthCheckParamsCheckRegion = "ALL_REGIONS" + HealthcheckReplaceParamsCheckRegionWnam HealthcheckReplaceParamsCheckRegion = "WNAM" + HealthcheckReplaceParamsCheckRegionEnam HealthcheckReplaceParamsCheckRegion = "ENAM" + HealthcheckReplaceParamsCheckRegionWeu HealthcheckReplaceParamsCheckRegion = "WEU" + HealthcheckReplaceParamsCheckRegionEeu HealthcheckReplaceParamsCheckRegion = "EEU" + HealthcheckReplaceParamsCheckRegionNsam HealthcheckReplaceParamsCheckRegion = "NSAM" + HealthcheckReplaceParamsCheckRegionSsam HealthcheckReplaceParamsCheckRegion = "SSAM" + HealthcheckReplaceParamsCheckRegionOc HealthcheckReplaceParamsCheckRegion = "OC" + HealthcheckReplaceParamsCheckRegionMe HealthcheckReplaceParamsCheckRegion = "ME" + HealthcheckReplaceParamsCheckRegionNaf HealthcheckReplaceParamsCheckRegion = "NAF" + HealthcheckReplaceParamsCheckRegionSaf HealthcheckReplaceParamsCheckRegion = "SAF" + HealthcheckReplaceParamsCheckRegionIn HealthcheckReplaceParamsCheckRegion = "IN" + HealthcheckReplaceParamsCheckRegionSeas HealthcheckReplaceParamsCheckRegion = "SEAS" + HealthcheckReplaceParamsCheckRegionNeas HealthcheckReplaceParamsCheckRegion = "NEAS" + HealthcheckReplaceParamsCheckRegionAllRegions HealthcheckReplaceParamsCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig struct { +type HealthcheckReplaceParamsHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. AllowInsecure param.Field[bool] `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string @@ -1288,7 +1383,7 @@ type HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig struct { // a Host header by default. The User-Agent header cannot be overridden. Header param.Field[interface{}] `json:"header"` // The HTTP method to use for the health check. - Method param.Field[HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethod] `json:"method"` + Method param.Field[HealthcheckReplaceParamsHTTPConfigMethod] `json:"method"` // The endpoint path to health check against. Path param.Field[string] `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP @@ -1296,206 +1391,102 @@ type HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig struct { Port param.Field[int64] `json:"port"` } -func (r HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig) MarshalJSON() (data []byte, err error) { +func (r HealthcheckReplaceParamsHTTPConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The HTTP method to use for the health check. -type HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethod string +type HealthcheckReplaceParamsHTTPConfigMethod string const ( - HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethodGet HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethod = "GET" - HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethodHead HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethod = "HEAD" + HealthcheckReplaceParamsHTTPConfigMethodGet HealthcheckReplaceParamsHTTPConfigMethod = "GET" + HealthcheckReplaceParamsHTTPConfigMethodHead HealthcheckReplaceParamsHTTPConfigMethod = "HEAD" ) // Parameters specific to TCP health check. -type HealthcheckHealthChecksNewHealthCheckParamsTcpConfig struct { +type HealthcheckReplaceParamsTcpConfig struct { // The TCP connection method to use for the health check. - Method param.Field[HealthcheckHealthChecksNewHealthCheckParamsTcpConfigMethod] `json:"method"` + Method param.Field[HealthcheckReplaceParamsTcpConfigMethod] `json:"method"` // Port number to connect to for the health check. Defaults to 80. Port param.Field[int64] `json:"port"` } -func (r HealthcheckHealthChecksNewHealthCheckParamsTcpConfig) MarshalJSON() (data []byte, err error) { +func (r HealthcheckReplaceParamsTcpConfig) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The TCP connection method to use for the health check. -type HealthcheckHealthChecksNewHealthCheckParamsTcpConfigMethod string - -const ( - HealthcheckHealthChecksNewHealthCheckParamsTcpConfigMethodConnectionEstablished HealthcheckHealthChecksNewHealthCheckParamsTcpConfigMethod = "connection_established" -) - -type HealthcheckHealthChecksNewHealthCheckResponseEnvelope struct { - Errors []HealthcheckHealthChecksNewHealthCheckResponseEnvelopeErrors `json:"errors,required"` - Messages []HealthcheckHealthChecksNewHealthCheckResponseEnvelopeMessages `json:"messages,required"` - Result HealthcheckHealthChecksNewHealthCheckResponse `json:"result,required"` - // Whether the API call was successful - Success HealthcheckHealthChecksNewHealthCheckResponseEnvelopeSuccess `json:"success,required"` - JSON healthcheckHealthChecksNewHealthCheckResponseEnvelopeJSON `json:"-"` -} - -// healthcheckHealthChecksNewHealthCheckResponseEnvelopeJSON contains the JSON -// metadata for the struct [HealthcheckHealthChecksNewHealthCheckResponseEnvelope] -type healthcheckHealthChecksNewHealthCheckResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckHealthChecksNewHealthCheckResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HealthcheckHealthChecksNewHealthCheckResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckHealthChecksNewHealthCheckResponseEnvelopeErrorsJSON `json:"-"` -} - -// healthcheckHealthChecksNewHealthCheckResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [HealthcheckHealthChecksNewHealthCheckResponseEnvelopeErrors] -type healthcheckHealthChecksNewHealthCheckResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckHealthChecksNewHealthCheckResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HealthcheckHealthChecksNewHealthCheckResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckHealthChecksNewHealthCheckResponseEnvelopeMessagesJSON `json:"-"` -} - -// healthcheckHealthChecksNewHealthCheckResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [HealthcheckHealthChecksNewHealthCheckResponseEnvelopeMessages] -type healthcheckHealthChecksNewHealthCheckResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckHealthChecksNewHealthCheckResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type HealthcheckHealthChecksNewHealthCheckResponseEnvelopeSuccess bool +type HealthcheckReplaceParamsTcpConfigMethod string const ( - HealthcheckHealthChecksNewHealthCheckResponseEnvelopeSuccessTrue HealthcheckHealthChecksNewHealthCheckResponseEnvelopeSuccess = true + HealthcheckReplaceParamsTcpConfigMethodConnectionEstablished HealthcheckReplaceParamsTcpConfigMethod = "connection_established" ) -type HealthcheckHealthChecksListHealthChecksResponseEnvelope struct { - Errors []HealthcheckHealthChecksListHealthChecksResponseEnvelopeErrors `json:"errors,required"` - Messages []HealthcheckHealthChecksListHealthChecksResponseEnvelopeMessages `json:"messages,required"` - Result []HealthcheckHealthChecksListHealthChecksResponse `json:"result,required,nullable"` +type HealthcheckReplaceResponseEnvelope struct { + Errors []HealthcheckReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []HealthcheckReplaceResponseEnvelopeMessages `json:"messages,required"` + Result HealthcheckReplaceResponse `json:"result,required"` // Whether the API call was successful - Success HealthcheckHealthChecksListHealthChecksResponseEnvelopeSuccess `json:"success,required"` - ResultInfo HealthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfo `json:"result_info"` - JSON healthcheckHealthChecksListHealthChecksResponseEnvelopeJSON `json:"-"` + Success HealthcheckReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON healthcheckReplaceResponseEnvelopeJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseEnvelope] -type healthcheckHealthChecksListHealthChecksResponseEnvelopeJSON struct { +// healthcheckReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [HealthcheckReplaceResponseEnvelope] +type healthcheckReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HealthcheckHealthChecksListHealthChecksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckHealthChecksListHealthChecksResponseEnvelopeErrorsJSON `json:"-"` +type HealthcheckReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseEnvelopeErrors] -type healthcheckHealthChecksListHealthChecksResponseEnvelopeErrorsJSON struct { +// healthcheckReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [HealthcheckReplaceResponseEnvelopeErrors] +type healthcheckReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HealthcheckHealthChecksListHealthChecksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckHealthChecksListHealthChecksResponseEnvelopeMessagesJSON `json:"-"` +type HealthcheckReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// healthcheckHealthChecksListHealthChecksResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseEnvelopeMessages] -type healthcheckHealthChecksListHealthChecksResponseEnvelopeMessagesJSON struct { +// healthcheckReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [HealthcheckReplaceResponseEnvelopeMessages] +type healthcheckReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckHealthChecksListHealthChecksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type HealthcheckHealthChecksListHealthChecksResponseEnvelopeSuccess bool +type HealthcheckReplaceResponseEnvelopeSuccess bool const ( - HealthcheckHealthChecksListHealthChecksResponseEnvelopeSuccessTrue HealthcheckHealthChecksListHealthChecksResponseEnvelopeSuccess = true + HealthcheckReplaceResponseEnvelopeSuccessTrue HealthcheckReplaceResponseEnvelopeSuccess = true ) - -type HealthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON healthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfoJSON `json:"-"` -} - -// healthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [HealthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfo] -type healthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckHealthChecksListHealthChecksResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/healthcheck_test.go b/healthcheck_test.go index e91343f3c4d..9fa4dcef897 100644 --- a/healthcheck_test.go +++ b/healthcheck_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestHealthcheckUpdateWithOptionalParams(t *testing.T) { +func TestHealthcheckNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,18 +29,17 @@ func TestHealthcheckUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Healthchecks.Update( + _, err := client.Healthchecks.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HealthcheckUpdateParams{ + cloudflare.HealthcheckNewParams{ Address: cloudflare.F("www.example.com"), Name: cloudflare.F("server-1"), - CheckRegions: cloudflare.F([]cloudflare.HealthcheckUpdateParamsCheckRegion{cloudflare.HealthcheckUpdateParamsCheckRegionWeu, cloudflare.HealthcheckUpdateParamsCheckRegionEnam}), + CheckRegions: cloudflare.F([]cloudflare.HealthcheckNewParamsCheckRegion{cloudflare.HealthcheckNewParamsCheckRegionWeu, cloudflare.HealthcheckNewParamsCheckRegionEnam}), ConsecutiveFails: cloudflare.F(int64(0)), ConsecutiveSuccesses: cloudflare.F(int64(0)), Description: cloudflare.F("Health check for www.example.com"), - HTTPConfig: cloudflare.F(cloudflare.HealthcheckUpdateParamsHTTPConfig{ + HTTPConfig: cloudflare.F(cloudflare.HealthcheckNewParamsHTTPConfig{ AllowInsecure: cloudflare.F(true), ExpectedBody: cloudflare.F("success"), ExpectedCodes: cloudflare.F([]string{"2xx", "302"}), @@ -53,15 +52,15 @@ func TestHealthcheckUpdateWithOptionalParams(t *testing.T) { "0": "abc123", }, }), - Method: cloudflare.F(cloudflare.HealthcheckUpdateParamsHTTPConfigMethodGet), + Method: cloudflare.F(cloudflare.HealthcheckNewParamsHTTPConfigMethodGet), Path: cloudflare.F("/health"), Port: cloudflare.F(int64(0)), }), Interval: cloudflare.F(int64(0)), Retries: cloudflare.F(int64(0)), Suspended: cloudflare.F(true), - TcpConfig: cloudflare.F(cloudflare.HealthcheckUpdateParamsTcpConfig{ - Method: cloudflare.F(cloudflare.HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished), + TcpConfig: cloudflare.F(cloudflare.HealthcheckNewParamsTcpConfig{ + Method: cloudflare.F(cloudflare.HealthcheckNewParamsTcpConfigMethodConnectionEstablished), Port: cloudflare.F(int64(0)), }), Timeout: cloudflare.F(int64(0)), @@ -77,6 +76,32 @@ func TestHealthcheckUpdateWithOptionalParams(t *testing.T) { } } +func TestHealthcheckList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Healthchecks.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestHealthcheckDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -137,7 +162,7 @@ func TestHealthcheckGet(t *testing.T) { } } -func TestHealthcheckHealthChecksNewHealthCheckWithOptionalParams(t *testing.T) { +func TestHealthcheckReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -153,17 +178,18 @@ func TestHealthcheckHealthChecksNewHealthCheckWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Healthchecks.HealthChecksNewHealthCheck( + _, err := client.Healthchecks.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HealthcheckHealthChecksNewHealthCheckParams{ + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.HealthcheckReplaceParams{ Address: cloudflare.F("www.example.com"), Name: cloudflare.F("server-1"), - CheckRegions: cloudflare.F([]cloudflare.HealthcheckHealthChecksNewHealthCheckParamsCheckRegion{cloudflare.HealthcheckHealthChecksNewHealthCheckParamsCheckRegionWeu, cloudflare.HealthcheckHealthChecksNewHealthCheckParamsCheckRegionEnam}), + CheckRegions: cloudflare.F([]cloudflare.HealthcheckReplaceParamsCheckRegion{cloudflare.HealthcheckReplaceParamsCheckRegionWeu, cloudflare.HealthcheckReplaceParamsCheckRegionEnam}), ConsecutiveFails: cloudflare.F(int64(0)), ConsecutiveSuccesses: cloudflare.F(int64(0)), Description: cloudflare.F("Health check for www.example.com"), - HTTPConfig: cloudflare.F(cloudflare.HealthcheckHealthChecksNewHealthCheckParamsHTTPConfig{ + HTTPConfig: cloudflare.F(cloudflare.HealthcheckReplaceParamsHTTPConfig{ AllowInsecure: cloudflare.F(true), ExpectedBody: cloudflare.F("success"), ExpectedCodes: cloudflare.F([]string{"2xx", "302"}), @@ -176,15 +202,15 @@ func TestHealthcheckHealthChecksNewHealthCheckWithOptionalParams(t *testing.T) { "0": "abc123", }, }), - Method: cloudflare.F(cloudflare.HealthcheckHealthChecksNewHealthCheckParamsHTTPConfigMethodGet), + Method: cloudflare.F(cloudflare.HealthcheckReplaceParamsHTTPConfigMethodGet), Path: cloudflare.F("/health"), Port: cloudflare.F(int64(0)), }), Interval: cloudflare.F(int64(0)), Retries: cloudflare.F(int64(0)), Suspended: cloudflare.F(true), - TcpConfig: cloudflare.F(cloudflare.HealthcheckHealthChecksNewHealthCheckParamsTcpConfig{ - Method: cloudflare.F(cloudflare.HealthcheckHealthChecksNewHealthCheckParamsTcpConfigMethodConnectionEstablished), + TcpConfig: cloudflare.F(cloudflare.HealthcheckReplaceParamsTcpConfig{ + Method: cloudflare.F(cloudflare.HealthcheckReplaceParamsTcpConfigMethodConnectionEstablished), Port: cloudflare.F(int64(0)), }), Timeout: cloudflare.F(int64(0)), @@ -199,29 +225,3 @@ func TestHealthcheckHealthChecksNewHealthCheckWithOptionalParams(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestHealthcheckHealthChecksListHealthChecks(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Healthchecks.HealthChecksListHealthChecks(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/healthcheckpreview.go b/healthcheckpreview.go index b87af8d23fc..a1d0c44c5b2 100644 --- a/healthcheckpreview.go +++ b/healthcheckpreview.go @@ -32,6 +32,19 @@ func NewHealthcheckPreviewService(opts ...option.RequestOption) (r *HealthcheckP return } +// Create a new preview health check. +func (r *HealthcheckPreviewService) New(ctx context.Context, zoneIdentifier string, body HealthcheckPreviewNewParams, opts ...option.RequestOption) (res *HealthcheckPreviewNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env HealthcheckPreviewNewResponseEnvelope + path := fmt.Sprintf("zones/%s/healthchecks/preview", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Delete a health check. func (r *HealthcheckPreviewService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckPreviewDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -58,19 +71,196 @@ func (r *HealthcheckPreviewService) Get(ctx context.Context, zoneIdentifier stri return } -// Create a new preview health check. -func (r *HealthcheckPreviewService) HealthChecksNewPreviewHealthCheck(ctx context.Context, zoneIdentifier string, body HealthcheckPreviewHealthChecksNewPreviewHealthCheckParams, opts ...option.RequestOption) (res *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse, err error) { - opts = append(r.Options[:], opts...) - var env HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks/preview", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type HealthcheckPreviewNewResponse struct { + // Identifier + ID string `json:"id"` + // The hostname or IP address of the origin server to run health checks on. + Address string `json:"address"` + // A list of regions from which to run health checks. Null means Cloudflare will + // pick a default region. + CheckRegions []HealthcheckPreviewNewResponseCheckRegion `json:"check_regions,nullable"` + // The number of consecutive fails required from a health check before changing the + // health to unhealthy. + ConsecutiveFails int64 `json:"consecutive_fails"` + // The number of consecutive successes required from a health check before changing + // the health to healthy. + ConsecutiveSuccesses int64 `json:"consecutive_successes"` + CreatedOn time.Time `json:"created_on" format:"date-time"` + // A human-readable description of the health check. + Description string `json:"description"` + // The current failure reason if status is unhealthy. + FailureReason string `json:"failure_reason"` + // Parameters specific to an HTTP or HTTPS health check. + HTTPConfig HealthcheckPreviewNewResponseHTTPConfig `json:"http_config,nullable"` + // The interval between each health check. Shorter intervals may give quicker + // notifications if the origin status changes, but will increase load on the origin + // as we check from multiple locations. + Interval int64 `json:"interval"` + ModifiedOn time.Time `json:"modified_on" format:"date-time"` + // A short name to identify the health check. Only alphanumeric characters, hyphens + // and underscores are allowed. + Name string `json:"name"` + // The number of retries to attempt in case of a timeout before marking the origin + // as unhealthy. Retries are attempted immediately. + Retries int64 `json:"retries"` + // The current status of the origin server according to the health check. + Status HealthcheckPreviewNewResponseStatus `json:"status"` + // If suspended, no health checks are sent to the origin. + Suspended bool `json:"suspended"` + // Parameters specific to TCP health check. + TcpConfig HealthcheckPreviewNewResponseTcpConfig `json:"tcp_config,nullable"` + // The timeout (in seconds) before marking the health check as failed. + Timeout int64 `json:"timeout"` + // The protocol to use for the health check. Currently supported protocols are + // 'HTTP', 'HTTPS' and 'TCP'. + Type string `json:"type"` + JSON healthcheckPreviewNewResponseJSON `json:"-"` +} + +// healthcheckPreviewNewResponseJSON contains the JSON metadata for the struct +// [HealthcheckPreviewNewResponse] +type healthcheckPreviewNewResponseJSON struct { + ID apijson.Field + Address apijson.Field + CheckRegions apijson.Field + ConsecutiveFails apijson.Field + ConsecutiveSuccesses apijson.Field + CreatedOn apijson.Field + Description apijson.Field + FailureReason apijson.Field + HTTPConfig apijson.Field + Interval apijson.Field + ModifiedOn apijson.Field + Name apijson.Field + Retries apijson.Field + Status apijson.Field + Suspended apijson.Field + TcpConfig apijson.Field + Timeout apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckPreviewNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, +// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, +// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, +// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS +// and ENTERPRISE customers only). +type HealthcheckPreviewNewResponseCheckRegion string + +const ( + HealthcheckPreviewNewResponseCheckRegionWnam HealthcheckPreviewNewResponseCheckRegion = "WNAM" + HealthcheckPreviewNewResponseCheckRegionEnam HealthcheckPreviewNewResponseCheckRegion = "ENAM" + HealthcheckPreviewNewResponseCheckRegionWeu HealthcheckPreviewNewResponseCheckRegion = "WEU" + HealthcheckPreviewNewResponseCheckRegionEeu HealthcheckPreviewNewResponseCheckRegion = "EEU" + HealthcheckPreviewNewResponseCheckRegionNsam HealthcheckPreviewNewResponseCheckRegion = "NSAM" + HealthcheckPreviewNewResponseCheckRegionSsam HealthcheckPreviewNewResponseCheckRegion = "SSAM" + HealthcheckPreviewNewResponseCheckRegionOc HealthcheckPreviewNewResponseCheckRegion = "OC" + HealthcheckPreviewNewResponseCheckRegionMe HealthcheckPreviewNewResponseCheckRegion = "ME" + HealthcheckPreviewNewResponseCheckRegionNaf HealthcheckPreviewNewResponseCheckRegion = "NAF" + HealthcheckPreviewNewResponseCheckRegionSaf HealthcheckPreviewNewResponseCheckRegion = "SAF" + HealthcheckPreviewNewResponseCheckRegionIn HealthcheckPreviewNewResponseCheckRegion = "IN" + HealthcheckPreviewNewResponseCheckRegionSeas HealthcheckPreviewNewResponseCheckRegion = "SEAS" + HealthcheckPreviewNewResponseCheckRegionNeas HealthcheckPreviewNewResponseCheckRegion = "NEAS" + HealthcheckPreviewNewResponseCheckRegionAllRegions HealthcheckPreviewNewResponseCheckRegion = "ALL_REGIONS" +) + +// Parameters specific to an HTTP or HTTPS health check. +type HealthcheckPreviewNewResponseHTTPConfig struct { + // Do not validate the certificate when the health check uses HTTPS. + AllowInsecure bool `json:"allow_insecure"` + // A case-insensitive sub-string to look for in the response body. If this string + // is not found, the origin will be marked as unhealthy. + ExpectedBody string `json:"expected_body"` + // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all + // codes starting with 2) of the health check. + ExpectedCodes []string `json:"expected_codes,nullable"` + // Follow redirects if the origin returns a 3xx status code. + FollowRedirects bool `json:"follow_redirects"` + // The HTTP request headers to send in the health check. It is recommended you set + // a Host header by default. The User-Agent header cannot be overridden. + Header interface{} `json:"header,nullable"` + // The HTTP method to use for the health check. + Method HealthcheckPreviewNewResponseHTTPConfigMethod `json:"method"` + // The endpoint path to health check against. + Path string `json:"path"` + // Port number to connect to for the health check. Defaults to 80 if type is HTTP + // or 443 if type is HTTPS. + Port int64 `json:"port"` + JSON healthcheckPreviewNewResponseHTTPConfigJSON `json:"-"` } +// healthcheckPreviewNewResponseHTTPConfigJSON contains the JSON metadata for the +// struct [HealthcheckPreviewNewResponseHTTPConfig] +type healthcheckPreviewNewResponseHTTPConfigJSON struct { + AllowInsecure apijson.Field + ExpectedBody apijson.Field + ExpectedCodes apijson.Field + FollowRedirects apijson.Field + Header apijson.Field + Method apijson.Field + Path apijson.Field + Port apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckPreviewNewResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The HTTP method to use for the health check. +type HealthcheckPreviewNewResponseHTTPConfigMethod string + +const ( + HealthcheckPreviewNewResponseHTTPConfigMethodGet HealthcheckPreviewNewResponseHTTPConfigMethod = "GET" + HealthcheckPreviewNewResponseHTTPConfigMethodHead HealthcheckPreviewNewResponseHTTPConfigMethod = "HEAD" +) + +// The current status of the origin server according to the health check. +type HealthcheckPreviewNewResponseStatus string + +const ( + HealthcheckPreviewNewResponseStatusUnknown HealthcheckPreviewNewResponseStatus = "unknown" + HealthcheckPreviewNewResponseStatusHealthy HealthcheckPreviewNewResponseStatus = "healthy" + HealthcheckPreviewNewResponseStatusUnhealthy HealthcheckPreviewNewResponseStatus = "unhealthy" + HealthcheckPreviewNewResponseStatusSuspended HealthcheckPreviewNewResponseStatus = "suspended" +) + +// Parameters specific to TCP health check. +type HealthcheckPreviewNewResponseTcpConfig struct { + // The TCP connection method to use for the health check. + Method HealthcheckPreviewNewResponseTcpConfigMethod `json:"method"` + // Port number to connect to for the health check. Defaults to 80. + Port int64 `json:"port"` + JSON healthcheckPreviewNewResponseTcpConfigJSON `json:"-"` +} + +// healthcheckPreviewNewResponseTcpConfigJSON contains the JSON metadata for the +// struct [HealthcheckPreviewNewResponseTcpConfig] +type healthcheckPreviewNewResponseTcpConfigJSON struct { + Method apijson.Field + Port apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckPreviewNewResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The TCP connection method to use for the health check. +type HealthcheckPreviewNewResponseTcpConfigMethod string + +const ( + HealthcheckPreviewNewResponseTcpConfigMethodConnectionEstablished HealthcheckPreviewNewResponseTcpConfigMethod = "connection_established" +) + type HealthcheckPreviewDeleteResponse struct { // Identifier ID string `json:"id"` @@ -279,80 +469,45 @@ const ( HealthcheckPreviewGetResponseTcpConfigMethodConnectionEstablished HealthcheckPreviewGetResponseTcpConfigMethod = "connection_established" ) -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse struct { - // Identifier - ID string `json:"id"` +type HealthcheckPreviewNewParams struct { // The hostname or IP address of the origin server to run health checks on. - Address string `json:"address"` + Address param.Field[string] `json:"address,required"` + // A short name to identify the health check. Only alphanumeric characters, hyphens + // and underscores are allowed. + Name param.Field[string] `json:"name,required"` // A list of regions from which to run health checks. Null means Cloudflare will // pick a default region. - CheckRegions []HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion `json:"check_regions,nullable"` + CheckRegions param.Field[[]HealthcheckPreviewNewParamsCheckRegion] `json:"check_regions"` // The number of consecutive fails required from a health check before changing the // health to unhealthy. - ConsecutiveFails int64 `json:"consecutive_fails"` + ConsecutiveFails param.Field[int64] `json:"consecutive_fails"` // The number of consecutive successes required from a health check before changing // the health to healthy. - ConsecutiveSuccesses int64 `json:"consecutive_successes"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"` // A human-readable description of the health check. - Description string `json:"description"` - // The current failure reason if status is unhealthy. - FailureReason string `json:"failure_reason"` + Description param.Field[string] `json:"description"` // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfig `json:"http_config,nullable"` + HTTPConfig param.Field[HealthcheckPreviewNewParamsHTTPConfig] `json:"http_config"` // The interval between each health check. Shorter intervals may give quicker // notifications if the origin status changes, but will increase load on the origin // as we check from multiple locations. - Interval int64 `json:"interval"` - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // A short name to identify the health check. Only alphanumeric characters, hyphens - // and underscores are allowed. - Name string `json:"name"` + Interval param.Field[int64] `json:"interval"` // The number of retries to attempt in case of a timeout before marking the origin // as unhealthy. Retries are attempted immediately. - Retries int64 `json:"retries"` - // The current status of the origin server according to the health check. - Status HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus `json:"status"` + Retries param.Field[int64] `json:"retries"` // If suspended, no health checks are sent to the origin. - Suspended bool `json:"suspended"` + Suspended param.Field[bool] `json:"suspended"` // Parameters specific to TCP health check. - TcpConfig HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfig `json:"tcp_config,nullable"` + TcpConfig param.Field[HealthcheckPreviewNewParamsTcpConfig] `json:"tcp_config"` // The timeout (in seconds) before marking the health check as failed. - Timeout int64 `json:"timeout"` + Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP', 'HTTPS' and 'TCP'. - Type string `json:"type"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseJSON `json:"-"` -} - -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseJSON contains the -// JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseJSON struct { - ID apijson.Field - Address apijson.Field - CheckRegions apijson.Field - ConsecutiveFails apijson.Field - ConsecutiveSuccesses apijson.Field - CreatedOn apijson.Field - Description apijson.Field - FailureReason apijson.Field - HTTPConfig apijson.Field - Interval apijson.Field - ModifiedOn apijson.Field - Name apijson.Field - Retries apijson.Field - Status apijson.Field - Suspended apijson.Field - TcpConfig apijson.Field - Timeout apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field + Type param.Field[string] `json:"type"` } -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r HealthcheckPreviewNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, @@ -360,116 +515,147 @@ func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse) UnmarshalJ // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, // SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS // and ENTERPRISE customers only). -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion string +type HealthcheckPreviewNewParamsCheckRegion string const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionWnam HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "WNAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionEnam HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "ENAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionWeu HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "WEU" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionEeu HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "EEU" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionNsam HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "NSAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionSsam HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "SSAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionOc HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "OC" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionMe HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "ME" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionNaf HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "NAF" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionSaf HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "SAF" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionIn HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "IN" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionSeas HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "SEAS" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionNeas HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "NEAS" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegionAllRegions HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseCheckRegion = "ALL_REGIONS" + HealthcheckPreviewNewParamsCheckRegionWnam HealthcheckPreviewNewParamsCheckRegion = "WNAM" + HealthcheckPreviewNewParamsCheckRegionEnam HealthcheckPreviewNewParamsCheckRegion = "ENAM" + HealthcheckPreviewNewParamsCheckRegionWeu HealthcheckPreviewNewParamsCheckRegion = "WEU" + HealthcheckPreviewNewParamsCheckRegionEeu HealthcheckPreviewNewParamsCheckRegion = "EEU" + HealthcheckPreviewNewParamsCheckRegionNsam HealthcheckPreviewNewParamsCheckRegion = "NSAM" + HealthcheckPreviewNewParamsCheckRegionSsam HealthcheckPreviewNewParamsCheckRegion = "SSAM" + HealthcheckPreviewNewParamsCheckRegionOc HealthcheckPreviewNewParamsCheckRegion = "OC" + HealthcheckPreviewNewParamsCheckRegionMe HealthcheckPreviewNewParamsCheckRegion = "ME" + HealthcheckPreviewNewParamsCheckRegionNaf HealthcheckPreviewNewParamsCheckRegion = "NAF" + HealthcheckPreviewNewParamsCheckRegionSaf HealthcheckPreviewNewParamsCheckRegion = "SAF" + HealthcheckPreviewNewParamsCheckRegionIn HealthcheckPreviewNewParamsCheckRegion = "IN" + HealthcheckPreviewNewParamsCheckRegionSeas HealthcheckPreviewNewParamsCheckRegion = "SEAS" + HealthcheckPreviewNewParamsCheckRegionNeas HealthcheckPreviewNewParamsCheckRegion = "NEAS" + HealthcheckPreviewNewParamsCheckRegionAllRegions HealthcheckPreviewNewParamsCheckRegion = "ALL_REGIONS" ) // Parameters specific to an HTTP or HTTPS health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfig struct { +type HealthcheckPreviewNewParamsHTTPConfig struct { // Do not validate the certificate when the health check uses HTTPS. - AllowInsecure bool `json:"allow_insecure"` + AllowInsecure param.Field[bool] `json:"allow_insecure"` // A case-insensitive sub-string to look for in the response body. If this string // is not found, the origin will be marked as unhealthy. - ExpectedBody string `json:"expected_body"` + ExpectedBody param.Field[string] `json:"expected_body"` // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all // codes starting with 2) of the health check. - ExpectedCodes []string `json:"expected_codes,nullable"` + ExpectedCodes param.Field[[]string] `json:"expected_codes"` // Follow redirects if the origin returns a 3xx status code. - FollowRedirects bool `json:"follow_redirects"` + FollowRedirects param.Field[bool] `json:"follow_redirects"` // The HTTP request headers to send in the health check. It is recommended you set // a Host header by default. The User-Agent header cannot be overridden. - Header interface{} `json:"header,nullable"` + Header param.Field[interface{}] `json:"header"` // The HTTP method to use for the health check. - Method HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethod `json:"method"` + Method param.Field[HealthcheckPreviewNewParamsHTTPConfigMethod] `json:"method"` // The endpoint path to health check against. - Path string `json:"path"` + Path param.Field[string] `json:"path"` // Port number to connect to for the health check. Defaults to 80 if type is HTTP // or 443 if type is HTTPS. - Port int64 `json:"port"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigJSON `json:"-"` -} - -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigJSON -// contains the JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfig] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigJSON struct { - AllowInsecure apijson.Field - ExpectedBody apijson.Field - ExpectedCodes apijson.Field - FollowRedirects apijson.Field - Header apijson.Field - Method apijson.Field - Path apijson.Field - Port apijson.Field - raw string - ExtraFields map[string]apijson.Field + Port param.Field[int64] `json:"port"` } -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r HealthcheckPreviewNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // The HTTP method to use for the health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethod string +type HealthcheckPreviewNewParamsHTTPConfigMethod string const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethodGet HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethod = "GET" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethodHead HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseHTTPConfigMethod = "HEAD" + HealthcheckPreviewNewParamsHTTPConfigMethodGet HealthcheckPreviewNewParamsHTTPConfigMethod = "GET" + HealthcheckPreviewNewParamsHTTPConfigMethodHead HealthcheckPreviewNewParamsHTTPConfigMethod = "HEAD" ) -// The current status of the origin server according to the health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus string +// Parameters specific to TCP health check. +type HealthcheckPreviewNewParamsTcpConfig struct { + // The TCP connection method to use for the health check. + Method param.Field[HealthcheckPreviewNewParamsTcpConfigMethod] `json:"method"` + // Port number to connect to for the health check. Defaults to 80. + Port param.Field[int64] `json:"port"` +} + +func (r HealthcheckPreviewNewParamsTcpConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The TCP connection method to use for the health check. +type HealthcheckPreviewNewParamsTcpConfigMethod string const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatusUnknown HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus = "unknown" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatusHealthy HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus = "healthy" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatusUnhealthy HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus = "unhealthy" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatusSuspended HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseStatus = "suspended" + HealthcheckPreviewNewParamsTcpConfigMethodConnectionEstablished HealthcheckPreviewNewParamsTcpConfigMethod = "connection_established" ) -// Parameters specific to TCP health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfig struct { - // The TCP connection method to use for the health check. - Method HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigMethod `json:"method"` - // Port number to connect to for the health check. Defaults to 80. - Port int64 `json:"port"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigJSON `json:"-"` +type HealthcheckPreviewNewResponseEnvelope struct { + Errors []HealthcheckPreviewNewResponseEnvelopeErrors `json:"errors,required"` + Messages []HealthcheckPreviewNewResponseEnvelopeMessages `json:"messages,required"` + Result HealthcheckPreviewNewResponse `json:"result,required"` + // Whether the API call was successful + Success HealthcheckPreviewNewResponseEnvelopeSuccess `json:"success,required"` + JSON healthcheckPreviewNewResponseEnvelopeJSON `json:"-"` } -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigJSON -// contains the JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfig] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigJSON struct { - Method apijson.Field - Port apijson.Field +// healthcheckPreviewNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [HealthcheckPreviewNewResponseEnvelope] +type healthcheckPreviewNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfig) UnmarshalJSON(data []byte) (err error) { +func (r *HealthcheckPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The TCP connection method to use for the health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigMethod string +type HealthcheckPreviewNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckPreviewNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// healthcheckPreviewNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [HealthcheckPreviewNewResponseEnvelopeErrors] +type healthcheckPreviewNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HealthcheckPreviewNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON healthcheckPreviewNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// healthcheckPreviewNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [HealthcheckPreviewNewResponseEnvelopeMessages] +type healthcheckPreviewNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HealthcheckPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type HealthcheckPreviewNewResponseEnvelopeSuccess bool const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigMethodConnectionEstablished HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseTcpConfigMethod = "connection_established" + HealthcheckPreviewNewResponseEnvelopeSuccessTrue HealthcheckPreviewNewResponseEnvelopeSuccess = true ) type HealthcheckPreviewDeleteResponseEnvelope struct { @@ -609,195 +795,3 @@ type HealthcheckPreviewGetResponseEnvelopeSuccess bool const ( HealthcheckPreviewGetResponseEnvelopeSuccessTrue HealthcheckPreviewGetResponseEnvelopeSuccess = true ) - -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParams struct { - // The hostname or IP address of the origin server to run health checks on. - Address param.Field[string] `json:"address,required"` - // A short name to identify the health check. Only alphanumeric characters, hyphens - // and underscores are allowed. - Name param.Field[string] `json:"name,required"` - // A list of regions from which to run health checks. Null means Cloudflare will - // pick a default region. - CheckRegions param.Field[[]HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion] `json:"check_regions"` - // The number of consecutive fails required from a health check before changing the - // health to unhealthy. - ConsecutiveFails param.Field[int64] `json:"consecutive_fails"` - // The number of consecutive successes required from a health check before changing - // the health to healthy. - ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"` - // A human-readable description of the health check. - Description param.Field[string] `json:"description"` - // Parameters specific to an HTTP or HTTPS health check. - HTTPConfig param.Field[HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfig] `json:"http_config"` - // The interval between each health check. Shorter intervals may give quicker - // notifications if the origin status changes, but will increase load on the origin - // as we check from multiple locations. - Interval param.Field[int64] `json:"interval"` - // The number of retries to attempt in case of a timeout before marking the origin - // as unhealthy. Retries are attempted immediately. - Retries param.Field[int64] `json:"retries"` - // If suspended, no health checks are sent to the origin. - Suspended param.Field[bool] `json:"suspended"` - // Parameters specific to TCP health check. - TcpConfig param.Field[HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfig] `json:"tcp_config"` - // The timeout (in seconds) before marking the health check as failed. - Timeout param.Field[int64] `json:"timeout"` - // The protocol to use for the health check. Currently supported protocols are - // 'HTTP', 'HTTPS' and 'TCP'. - Type param.Field[string] `json:"type"` -} - -func (r HealthcheckPreviewHealthChecksNewPreviewHealthCheckParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, -// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, -// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, -// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS -// and ENTERPRISE customers only). -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion string - -const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionWnam HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "WNAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionEnam HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "ENAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionWeu HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "WEU" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionEeu HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "EEU" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionNsam HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "NSAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionSsam HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "SSAM" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionOc HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "OC" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionMe HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "ME" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionNaf HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "NAF" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionSaf HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "SAF" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionIn HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "IN" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionSeas HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "SEAS" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionNeas HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "NEAS" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionAllRegions HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion = "ALL_REGIONS" -) - -// Parameters specific to an HTTP or HTTPS health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfig struct { - // Do not validate the certificate when the health check uses HTTPS. - AllowInsecure param.Field[bool] `json:"allow_insecure"` - // A case-insensitive sub-string to look for in the response body. If this string - // is not found, the origin will be marked as unhealthy. - ExpectedBody param.Field[string] `json:"expected_body"` - // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all - // codes starting with 2) of the health check. - ExpectedCodes param.Field[[]string] `json:"expected_codes"` - // Follow redirects if the origin returns a 3xx status code. - FollowRedirects param.Field[bool] `json:"follow_redirects"` - // The HTTP request headers to send in the health check. It is recommended you set - // a Host header by default. The User-Agent header cannot be overridden. - Header param.Field[interface{}] `json:"header"` - // The HTTP method to use for the health check. - Method param.Field[HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethod] `json:"method"` - // The endpoint path to health check against. - Path param.Field[string] `json:"path"` - // Port number to connect to for the health check. Defaults to 80 if type is HTTP - // or 443 if type is HTTPS. - Port param.Field[int64] `json:"port"` -} - -func (r HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The HTTP method to use for the health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethod string - -const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethodGet HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethod = "GET" - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethodHead HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethod = "HEAD" -) - -// Parameters specific to TCP health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfig struct { - // The TCP connection method to use for the health check. - Method param.Field[HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfigMethod] `json:"method"` - // Port number to connect to for the health check. Defaults to 80. - Port param.Field[int64] `json:"port"` -} - -func (r HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The TCP connection method to use for the health check. -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfigMethod string - -const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfigMethodConnectionEstablished HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfigMethod = "connection_established" -) - -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelope struct { - Errors []HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrors `json:"errors,required"` - Messages []HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessages `json:"messages,required"` - Result HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponse `json:"result,required"` - // Whether the API call was successful - Success HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeSuccess `json:"success,required"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeJSON `json:"-"` -} - -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelope] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrorsJSON `json:"-"` -} - -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrors] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessagesJSON `json:"-"` -} - -// healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessages] -type healthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeSuccess bool - -const ( - HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeSuccessTrue HealthcheckPreviewHealthChecksNewPreviewHealthCheckResponseEnvelopeSuccess = true -) diff --git a/healthcheckpreview_test.go b/healthcheckpreview_test.go index 09efe19c19e..2de008e795e 100644 --- a/healthcheckpreview_test.go +++ b/healthcheckpreview_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestHealthcheckPreviewDelete(t *testing.T) { +func TestHealthcheckPreviewNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,43 @@ func TestHealthcheckPreviewDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Healthchecks.Previews.Delete( + _, err := client.Healthchecks.Previews.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.HealthcheckPreviewNewParams{ + Address: cloudflare.F("www.example.com"), + Name: cloudflare.F("server-1"), + CheckRegions: cloudflare.F([]cloudflare.HealthcheckPreviewNewParamsCheckRegion{cloudflare.HealthcheckPreviewNewParamsCheckRegionWeu, cloudflare.HealthcheckPreviewNewParamsCheckRegionEnam}), + ConsecutiveFails: cloudflare.F(int64(0)), + ConsecutiveSuccesses: cloudflare.F(int64(0)), + Description: cloudflare.F("Health check for www.example.com"), + HTTPConfig: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsHTTPConfig{ + AllowInsecure: cloudflare.F(true), + ExpectedBody: cloudflare.F("success"), + ExpectedCodes: cloudflare.F([]string{"2xx", "302"}), + FollowRedirects: cloudflare.F(true), + Header: cloudflare.F[any](map[string]interface{}{ + "Host": map[string]interface{}{ + "0": "example.com", + }, + "X-App-ID": map[string]interface{}{ + "0": "abc123", + }, + }), + Method: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsHTTPConfigMethodGet), + Path: cloudflare.F("/health"), + Port: cloudflare.F(int64(0)), + }), + Interval: cloudflare.F(int64(0)), + Retries: cloudflare.F(int64(0)), + Suspended: cloudflare.F(true), + TcpConfig: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsTcpConfig{ + Method: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsTcpConfigMethodConnectionEstablished), + Port: cloudflare.F(int64(0)), + }), + Timeout: cloudflare.F(int64(0)), + Type: cloudflare.F("HTTPS"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +76,7 @@ func TestHealthcheckPreviewDelete(t *testing.T) { } } -func TestHealthcheckPreviewGet(t *testing.T) { +func TestHealthcheckPreviewDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +92,7 @@ func TestHealthcheckPreviewGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Healthchecks.Previews.Get( + _, err := client.Healthchecks.Previews.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -73,7 +106,7 @@ func TestHealthcheckPreviewGet(t *testing.T) { } } -func TestHealthcheckPreviewHealthChecksNewPreviewHealthCheckWithOptionalParams(t *testing.T) { +func TestHealthcheckPreviewGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,43 +122,10 @@ func TestHealthcheckPreviewHealthChecksNewPreviewHealthCheckWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Healthchecks.Previews.HealthChecksNewPreviewHealthCheck( + _, err := client.Healthchecks.Previews.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParams{ - Address: cloudflare.F("www.example.com"), - Name: cloudflare.F("server-1"), - CheckRegions: cloudflare.F([]cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegion{cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionWeu, cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsCheckRegionEnam}), - ConsecutiveFails: cloudflare.F(int64(0)), - ConsecutiveSuccesses: cloudflare.F(int64(0)), - Description: cloudflare.F("Health check for www.example.com"), - HTTPConfig: cloudflare.F(cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfig{ - AllowInsecure: cloudflare.F(true), - ExpectedBody: cloudflare.F("success"), - ExpectedCodes: cloudflare.F([]string{"2xx", "302"}), - FollowRedirects: cloudflare.F(true), - Header: cloudflare.F[any](map[string]interface{}{ - "Host": map[string]interface{}{ - "0": "example.com", - }, - "X-App-ID": map[string]interface{}{ - "0": "abc123", - }, - }), - Method: cloudflare.F(cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsHTTPConfigMethodGet), - Path: cloudflare.F("/health"), - Port: cloudflare.F(int64(0)), - }), - Interval: cloudflare.F(int64(0)), - Retries: cloudflare.F(int64(0)), - Suspended: cloudflare.F(true), - TcpConfig: cloudflare.F(cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfig{ - Method: cloudflare.F(cloudflare.HealthcheckPreviewHealthChecksNewPreviewHealthCheckParamsTcpConfigMethodConnectionEstablished), - Port: cloudflare.F(int64(0)), - }), - Timeout: cloudflare.F(int64(0)), - Type: cloudflare.F("HTTPS"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error diff --git a/hostnamesettingtls.go b/hostnamesettingtls.go index 5f3a6de88d0..472782fee10 100644 --- a/hostnamesettingtls.go +++ b/hostnamesettingtls.go @@ -35,19 +35,6 @@ func NewHostnameSettingTLSService(opts ...option.RequestOption) (r *HostnameSett return } -// Update the tls setting value for the hostname. -func (r *HostnameSettingTLSService) Update(ctx context.Context, zoneID string, settingID HostnameSettingTLSUpdateParamsSettingID, hostname string, body HostnameSettingTLSUpdateParams, opts ...option.RequestOption) (res *HostnameSettingTLSUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env HostnameSettingTLSUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", zoneID, settingID, hostname) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Delete the tls setting value for the hostname. func (r *HostnameSettingTLSService) Delete(ctx context.Context, zoneID string, settingID HostnameSettingTLSDeleteParamsSettingID, hostname string, opts ...option.RequestOption) (res *HostnameSettingTLSDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -74,62 +61,17 @@ func (r *HostnameSettingTLSService) Get(ctx context.Context, zoneID string, sett return } -type HostnameSettingTLSUpdateResponse struct { - // This is the time the tls setting was originally created for this hostname. - CreatedAt time.Time `json:"created_at" format:"date-time"` - // The hostname for which the tls settings are set. - Hostname string `json:"hostname"` - // Deployment status for the given tls setting. - Status string `json:"status"` - // This is the time the tls setting was updated. - UpdatedAt time.Time `json:"updated_at" format:"date-time"` - // The tls setting value. - Value HostnameSettingTLSUpdateResponseValue `json:"value"` - JSON hostnameSettingTLSUpdateResponseJSON `json:"-"` -} - -// hostnameSettingTLSUpdateResponseJSON contains the JSON metadata for the struct -// [HostnameSettingTLSUpdateResponse] -type hostnameSettingTLSUpdateResponseJSON struct { - CreatedAt apijson.Field - Hostname apijson.Field - Status apijson.Field - UpdatedAt apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HostnameSettingTLSUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The tls setting value. -// -// Union satisfied by [shared.UnionFloat], [shared.UnionString] or -// [HostnameSettingTLSUpdateResponseValueArray]. -type HostnameSettingTLSUpdateResponseValue interface { - ImplementsHostnameSettingTLSUpdateResponseValue() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*HostnameSettingTLSUpdateResponseValue)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.Number, - Type: reflect.TypeOf(shared.UnionFloat(0)), - }, - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type HostnameSettingTLSUpdateResponseValueArray []string - -func (r HostnameSettingTLSUpdateResponseValueArray) ImplementsHostnameSettingTLSUpdateResponseValue() { +// Update the tls setting value for the hostname. +func (r *HostnameSettingTLSService) Replace(ctx context.Context, zoneID string, settingID HostnameSettingTLSReplaceParamsSettingID, hostname string, body HostnameSettingTLSReplaceParams, opts ...option.RequestOption) (res *HostnameSettingTLSReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env HostnameSettingTLSReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", zoneID, settingID, hostname) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } type HostnameSettingTLSDeleteResponse struct { @@ -217,105 +159,64 @@ type HostnameSettingTLSGetResponseValueArray []string func (r HostnameSettingTLSGetResponseValueArray) ImplementsHostnameSettingTLSGetResponseValue() {} -type HostnameSettingTLSUpdateParams struct { +type HostnameSettingTLSReplaceResponse struct { + // This is the time the tls setting was originally created for this hostname. + CreatedAt time.Time `json:"created_at" format:"date-time"` + // The hostname for which the tls settings are set. + Hostname string `json:"hostname"` + // Deployment status for the given tls setting. + Status string `json:"status"` + // This is the time the tls setting was updated. + UpdatedAt time.Time `json:"updated_at" format:"date-time"` // The tls setting value. - Value param.Field[HostnameSettingTLSUpdateParamsValue] `json:"value,required"` -} - -func (r HostnameSettingTLSUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) + Value HostnameSettingTLSReplaceResponseValue `json:"value"` + JSON hostnameSettingTLSReplaceResponseJSON `json:"-"` } -// The TLS Setting name. -type HostnameSettingTLSUpdateParamsSettingID string - -const ( - HostnameSettingTLSUpdateParamsSettingIDCiphers HostnameSettingTLSUpdateParamsSettingID = "ciphers" - HostnameSettingTLSUpdateParamsSettingIDMinTLSVersion HostnameSettingTLSUpdateParamsSettingID = "min_tls_version" - HostnameSettingTLSUpdateParamsSettingIDHTTP2 HostnameSettingTLSUpdateParamsSettingID = "http2" -) - -// The tls setting value. -// -// Satisfied by [shared.UnionFloat], [shared.UnionString], -// [HostnameSettingTLSUpdateParamsValueArray]. -type HostnameSettingTLSUpdateParamsValue interface { - ImplementsHostnameSettingTLSUpdateParamsValue() -} - -type HostnameSettingTLSUpdateParamsValueArray []string - -func (r HostnameSettingTLSUpdateParamsValueArray) ImplementsHostnameSettingTLSUpdateParamsValue() {} - -type HostnameSettingTLSUpdateResponseEnvelope struct { - Errors []HostnameSettingTLSUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []HostnameSettingTLSUpdateResponseEnvelopeMessages `json:"messages,required"` - Result HostnameSettingTLSUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success HostnameSettingTLSUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON hostnameSettingTLSUpdateResponseEnvelopeJSON `json:"-"` -} - -// hostnameSettingTLSUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [HostnameSettingTLSUpdateResponseEnvelope] -type hostnameSettingTLSUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field +// hostnameSettingTLSReplaceResponseJSON contains the JSON metadata for the struct +// [HostnameSettingTLSReplaceResponse] +type hostnameSettingTLSReplaceResponseJSON struct { + CreatedAt apijson.Field + Hostname apijson.Field + Status apijson.Field + UpdatedAt apijson.Field + Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *HostnameSettingTLSUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *HostnameSettingTLSReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HostnameSettingTLSUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [HostnameSettingTLSUpdateResponseEnvelopeErrors] -type hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HostnameSettingTLSUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// The tls setting value. +// +// Union satisfied by [shared.UnionFloat], [shared.UnionString] or +// [HostnameSettingTLSReplaceResponseValueArray]. +type HostnameSettingTLSReplaceResponseValue interface { + ImplementsHostnameSettingTLSReplaceResponseValue() } -type HostnameSettingTLSUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON `json:"-"` +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*HostnameSettingTLSReplaceResponseValue)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.Number, + Type: reflect.TypeOf(shared.UnionFloat(0)), + }, + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [HostnameSettingTLSUpdateResponseEnvelopeMessages] -type hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +type HostnameSettingTLSReplaceResponseValueArray []string -func (r *HostnameSettingTLSUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r HostnameSettingTLSReplaceResponseValueArray) ImplementsHostnameSettingTLSReplaceResponseValue() { } -// Whether the API call was successful -type HostnameSettingTLSUpdateResponseEnvelopeSuccess bool - -const ( - HostnameSettingTLSUpdateResponseEnvelopeSuccessTrue HostnameSettingTLSUpdateResponseEnvelopeSuccess = true -) - // The TLS Setting name. type HostnameSettingTLSDeleteParamsSettingID string @@ -503,3 +404,102 @@ type hostnameSettingTLSGetResponseEnvelopeResultInfoJSON struct { func (r *HostnameSettingTLSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type HostnameSettingTLSReplaceParams struct { + // The tls setting value. + Value param.Field[HostnameSettingTLSReplaceParamsValue] `json:"value,required"` +} + +func (r HostnameSettingTLSReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The TLS Setting name. +type HostnameSettingTLSReplaceParamsSettingID string + +const ( + HostnameSettingTLSReplaceParamsSettingIDCiphers HostnameSettingTLSReplaceParamsSettingID = "ciphers" + HostnameSettingTLSReplaceParamsSettingIDMinTLSVersion HostnameSettingTLSReplaceParamsSettingID = "min_tls_version" + HostnameSettingTLSReplaceParamsSettingIDHTTP2 HostnameSettingTLSReplaceParamsSettingID = "http2" +) + +// The tls setting value. +// +// Satisfied by [shared.UnionFloat], [shared.UnionString], +// [HostnameSettingTLSReplaceParamsValueArray]. +type HostnameSettingTLSReplaceParamsValue interface { + ImplementsHostnameSettingTLSReplaceParamsValue() +} + +type HostnameSettingTLSReplaceParamsValueArray []string + +func (r HostnameSettingTLSReplaceParamsValueArray) ImplementsHostnameSettingTLSReplaceParamsValue() {} + +type HostnameSettingTLSReplaceResponseEnvelope struct { + Errors []HostnameSettingTLSReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []HostnameSettingTLSReplaceResponseEnvelopeMessages `json:"messages,required"` + Result HostnameSettingTLSReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success HostnameSettingTLSReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON hostnameSettingTLSReplaceResponseEnvelopeJSON `json:"-"` +} + +// hostnameSettingTLSReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [HostnameSettingTLSReplaceResponseEnvelope] +type hostnameSettingTLSReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HostnameSettingTLSReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HostnameSettingTLSReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON hostnameSettingTLSReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// hostnameSettingTLSReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [HostnameSettingTLSReplaceResponseEnvelopeErrors] +type hostnameSettingTLSReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HostnameSettingTLSReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HostnameSettingTLSReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON hostnameSettingTLSReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// hostnameSettingTLSReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [HostnameSettingTLSReplaceResponseEnvelopeMessages] +type hostnameSettingTLSReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HostnameSettingTLSReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type HostnameSettingTLSReplaceResponseEnvelopeSuccess bool + +const ( + HostnameSettingTLSReplaceResponseEnvelopeSuccessTrue HostnameSettingTLSReplaceResponseEnvelopeSuccess = true +) diff --git a/hostnamesettingtls_test.go b/hostnamesettingtls_test.go index 275d5d47a4c..9f2741a81b5 100644 --- a/hostnamesettingtls_test.go +++ b/hostnamesettingtls_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestHostnameSettingTLSUpdate(t *testing.T) { +func TestHostnameSettingTLSDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,11 @@ func TestHostnameSettingTLSUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hostnames.Settings.TLS.Update( + _, err := client.Hostnames.Settings.TLS.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HostnameSettingTLSUpdateParamsSettingIDCiphers, + cloudflare.HostnameSettingTLSDeleteParamsSettingIDCiphers, "app.example.com", - cloudflare.HostnameSettingTLSUpdateParams{ - Value: cloudflare.F[cloudflare.HostnameSettingTLSUpdateParamsValue](cloudflare.HostnameSettingTLSUpdateParamsValueArray([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"})), - }, ) if err != nil { var apierr *cloudflare.Error @@ -47,7 +44,7 @@ func TestHostnameSettingTLSUpdate(t *testing.T) { } } -func TestHostnameSettingTLSDelete(t *testing.T) { +func TestHostnameSettingTLSGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +60,10 @@ func TestHostnameSettingTLSDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hostnames.Settings.TLS.Delete( + _, err := client.Hostnames.Settings.TLS.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HostnameSettingTLSDeleteParamsSettingIDCiphers, - "app.example.com", + cloudflare.HostnameSettingTLSGetParamsSettingIDCiphers, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +74,7 @@ func TestHostnameSettingTLSDelete(t *testing.T) { } } -func TestHostnameSettingTLSGet(t *testing.T) { +func TestHostnameSettingTLSReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,10 +90,14 @@ func TestHostnameSettingTLSGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hostnames.Settings.TLS.Get( + _, err := client.Hostnames.Settings.TLS.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HostnameSettingTLSGetParamsSettingIDCiphers, + cloudflare.HostnameSettingTLSReplaceParamsSettingIDCiphers, + "app.example.com", + cloudflare.HostnameSettingTLSReplaceParams{ + Value: cloudflare.F[cloudflare.HostnameSettingTLSReplaceParamsValue](cloudflare.HostnameSettingTLSReplaceParamsValueArray([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"})), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/hyperdriveconfig.go b/hyperdriveconfig.go index 4df2fa56ea7..100d2cc87d8 100644 --- a/hyperdriveconfig.go +++ b/hyperdriveconfig.go @@ -47,19 +47,6 @@ func (r *HyperdriveConfigService) New(ctx context.Context, accountID string, bod return } -// Updates and returns the specified Hyperdrive configuration. -func (r *HyperdriveConfigService) Update(ctx context.Context, accountID string, hyperdriveID string, body HyperdriveConfigUpdateParams, opts ...option.RequestOption) (res *HyperdriveConfigUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env HyperdriveConfigUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", accountID, hyperdriveID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Returns a list of Hyperdrives func (r *HyperdriveConfigService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]HyperdriveConfigListResponse, err error) { opts = append(r.Options[:], opts...) @@ -99,6 +86,19 @@ func (r *HyperdriveConfigService) Get(ctx context.Context, accountID string, hyp return } +// Updates and returns the specified Hyperdrive configuration. +func (r *HyperdriveConfigService) Replace(ctx context.Context, accountID string, hyperdriveID string, body HyperdriveConfigReplaceParams, opts ...option.RequestOption) (res *HyperdriveConfigReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env HyperdriveConfigReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", accountID, hyperdriveID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type HyperdriveConfigNewResponse struct { // Identifier ID string `json:"id"` @@ -117,24 +117,6 @@ func (r *HyperdriveConfigNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type HyperdriveConfigUpdateResponse struct { - // Identifier - ID string `json:"id"` - JSON hyperdriveConfigUpdateResponseJSON `json:"-"` -} - -// hyperdriveConfigUpdateResponseJSON contains the JSON metadata for the struct -// [HyperdriveConfigUpdateResponse] -type hyperdriveConfigUpdateResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HyperdriveConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type HyperdriveConfigListResponse struct { // Identifier ID string `json:"id"` @@ -188,6 +170,24 @@ func (r *HyperdriveConfigGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type HyperdriveConfigReplaceResponse struct { + // Identifier + ID string `json:"id"` + JSON hyperdriveConfigReplaceResponseJSON `json:"-"` +} + +// hyperdriveConfigReplaceResponseJSON contains the JSON metadata for the struct +// [HyperdriveConfigReplaceResponse] +type hyperdriveConfigReplaceResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HyperdriveConfigReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type HyperdriveConfigNewParams struct { Origin param.Field[HyperdriveConfigNewParamsOrigin] `json:"origin,required"` } @@ -275,93 +275,6 @@ const ( HyperdriveConfigNewResponseEnvelopeSuccessTrue HyperdriveConfigNewResponseEnvelopeSuccess = true ) -type HyperdriveConfigUpdateParams struct { - Origin param.Field[HyperdriveConfigUpdateParamsOrigin] `json:"origin,required"` -} - -func (r HyperdriveConfigUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type HyperdriveConfigUpdateParamsOrigin struct { - // The password required to access your origin database. This value is write-only - // and never returned by the API. - Password param.Field[string] `json:"password,required"` -} - -func (r HyperdriveConfigUpdateParamsOrigin) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type HyperdriveConfigUpdateResponseEnvelope struct { - Errors []HyperdriveConfigUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []HyperdriveConfigUpdateResponseEnvelopeMessages `json:"messages,required"` - Result HyperdriveConfigUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success HyperdriveConfigUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON hyperdriveConfigUpdateResponseEnvelopeJSON `json:"-"` -} - -// hyperdriveConfigUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [HyperdriveConfigUpdateResponseEnvelope] -type hyperdriveConfigUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HyperdriveConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HyperdriveConfigUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON hyperdriveConfigUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// hyperdriveConfigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [HyperdriveConfigUpdateResponseEnvelopeErrors] -type hyperdriveConfigUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HyperdriveConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type HyperdriveConfigUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON hyperdriveConfigUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// hyperdriveConfigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [HyperdriveConfigUpdateResponseEnvelopeMessages] -type hyperdriveConfigUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *HyperdriveConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type HyperdriveConfigUpdateResponseEnvelopeSuccess bool - -const ( - HyperdriveConfigUpdateResponseEnvelopeSuccessTrue HyperdriveConfigUpdateResponseEnvelopeSuccess = true -) - type HyperdriveConfigListResponseEnvelope struct { Errors []HyperdriveConfigListResponseEnvelopeErrors `json:"errors,required"` Messages []HyperdriveConfigListResponseEnvelopeMessages `json:"messages,required"` @@ -568,3 +481,90 @@ type HyperdriveConfigGetResponseEnvelopeSuccess bool const ( HyperdriveConfigGetResponseEnvelopeSuccessTrue HyperdriveConfigGetResponseEnvelopeSuccess = true ) + +type HyperdriveConfigReplaceParams struct { + Origin param.Field[HyperdriveConfigReplaceParamsOrigin] `json:"origin,required"` +} + +func (r HyperdriveConfigReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type HyperdriveConfigReplaceParamsOrigin struct { + // The password required to access your origin database. This value is write-only + // and never returned by the API. + Password param.Field[string] `json:"password,required"` +} + +func (r HyperdriveConfigReplaceParamsOrigin) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type HyperdriveConfigReplaceResponseEnvelope struct { + Errors []HyperdriveConfigReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []HyperdriveConfigReplaceResponseEnvelopeMessages `json:"messages,required"` + Result HyperdriveConfigReplaceResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success HyperdriveConfigReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON hyperdriveConfigReplaceResponseEnvelopeJSON `json:"-"` +} + +// hyperdriveConfigReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [HyperdriveConfigReplaceResponseEnvelope] +type hyperdriveConfigReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HyperdriveConfigReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HyperdriveConfigReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON hyperdriveConfigReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// hyperdriveConfigReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [HyperdriveConfigReplaceResponseEnvelopeErrors] +type hyperdriveConfigReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HyperdriveConfigReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type HyperdriveConfigReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON hyperdriveConfigReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// hyperdriveConfigReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [HyperdriveConfigReplaceResponseEnvelopeMessages] +type hyperdriveConfigReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *HyperdriveConfigReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type HyperdriveConfigReplaceResponseEnvelopeSuccess bool + +const ( + HyperdriveConfigReplaceResponseEnvelopeSuccessTrue HyperdriveConfigReplaceResponseEnvelopeSuccess = true +) diff --git a/hyperdriveconfig_test.go b/hyperdriveconfig_test.go index 322ad06bd5b..2be039b2d5e 100644 --- a/hyperdriveconfig_test.go +++ b/hyperdriveconfig_test.go @@ -47,7 +47,7 @@ func TestHyperdriveConfigNew(t *testing.T) { } } -func TestHyperdriveConfigUpdate(t *testing.T) { +func TestHyperdriveConfigList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,16 +63,7 @@ func TestHyperdriveConfigUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hyperdrive.Configs.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.HyperdriveConfigUpdateParams{ - Origin: cloudflare.F(cloudflare.HyperdriveConfigUpdateParamsOrigin{ - Password: cloudflare.F("password1234!"), - }), - }, - ) + _, err := client.Hyperdrive.Configs.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -82,7 +73,7 @@ func TestHyperdriveConfigUpdate(t *testing.T) { } } -func TestHyperdriveConfigList(t *testing.T) { +func TestHyperdriveConfigDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -98,7 +89,11 @@ func TestHyperdriveConfigList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hyperdrive.Configs.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Hyperdrive.Configs.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -108,7 +103,7 @@ func TestHyperdriveConfigList(t *testing.T) { } } -func TestHyperdriveConfigDelete(t *testing.T) { +func TestHyperdriveConfigGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,7 +119,7 @@ func TestHyperdriveConfigDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hyperdrive.Configs.Delete( + _, err := client.Hyperdrive.Configs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -138,7 +133,7 @@ func TestHyperdriveConfigDelete(t *testing.T) { } } -func TestHyperdriveConfigGet(t *testing.T) { +func TestHyperdriveConfigReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -154,10 +149,15 @@ func TestHyperdriveConfigGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Hyperdrive.Configs.Get( + _, err := client.Hyperdrive.Configs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.HyperdriveConfigReplaceParams{ + Origin: cloudflare.F(cloudflare.HyperdriveConfigReplaceParamsOrigin{ + Password: cloudflare.F("password1234!"), + }), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/imagev1.go b/imagev1.go index f461dd1dd81..73a97e1dafb 100644 --- a/imagev1.go +++ b/imagev1.go @@ -44,13 +44,14 @@ func NewImageV1Service(opts ...option.RequestOption) (r *ImageV1Service) { return } -// Update image access control. On access control change, all copies of the image -// are purged from cache. -func (r *ImageV1Service) Update(ctx context.Context, accountID string, imageID string, body ImageV1UpdateParams, opts ...option.RequestOption) (res *ImageV1UpdateResponse, err error) { +// Upload an image with up to 10 Megabytes using a single HTTP POST +// (multipart/form-data) request. An image can be uploaded by sending an image file +// or passing an accessible to an API url. +func (r *ImageV1Service) New(ctx context.Context, accountID string, body ImageV1NewParams, opts ...option.RequestOption) (res *ImageV1NewResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1UpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1/%s", accountID, imageID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env ImageV1NewResponseEnvelope + path := fmt.Sprintf("accounts/%s/images/v1", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -58,13 +59,13 @@ func (r *ImageV1Service) Update(ctx context.Context, accountID string, imageID s return } -// Delete an image on Cloudflare Images. On success, all copies of the image are -// deleted and purged from cache. -func (r *ImageV1Service) Delete(ctx context.Context, accountID string, imageID string, opts ...option.RequestOption) (res *ImageV1DeleteResponse, err error) { +// Update image access control. On access control change, all copies of the image +// are purged from cache. +func (r *ImageV1Service) Update(ctx context.Context, accountID string, imageID string, body ImageV1UpdateParams, opts ...option.RequestOption) (res *ImageV1UpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1DeleteResponseEnvelope + var env ImageV1UpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v1/%s", accountID, imageID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -74,26 +75,36 @@ func (r *ImageV1Service) Delete(ctx context.Context, accountID string, imageID s // List up to 100 images with one request. Use the optional parameters below to get // a specific range of images. -func (r *ImageV1Service) CloudflareImagesListImages(ctx context.Context, accountID string, query ImageV1CloudflareImagesListImagesParams, opts ...option.RequestOption) (res *ImageV1CloudflareImagesListImagesResponse, err error) { - opts = append(r.Options[:], opts...) - var env ImageV1CloudflareImagesListImagesResponseEnvelope +func (r *ImageV1Service) List(ctx context.Context, accountID string, query ImageV1ListParams, opts ...option.RequestOption) (res *shared.V4PagePagination[ImageV1ListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/images/v1", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } -// Upload an image with up to 10 Megabytes using a single HTTP POST -// (multipart/form-data) request. An image can be uploaded by sending an image file -// or passing an accessible to an API url. -func (r *ImageV1Service) CloudflareImagesUploadAnImageViaURL(ctx context.Context, accountID string, body ImageV1CloudflareImagesUploadAnImageViaURLParams, opts ...option.RequestOption) (res *ImageV1CloudflareImagesUploadAnImageViaURLResponse, err error) { +// List up to 100 images with one request. Use the optional parameters below to get +// a specific range of images. +func (r *ImageV1Service) ListAutoPaging(ctx context.Context, accountID string, query ImageV1ListParams, opts ...option.RequestOption) *shared.V4PagePaginationAutoPager[ImageV1ListResponse] { + return shared.NewV4PagePaginationAutoPager(r.List(ctx, accountID, query, opts...)) +} + +// Delete an image on Cloudflare Images. On success, all copies of the image are +// deleted and purged from cache. +func (r *ImageV1Service) Delete(ctx context.Context, accountID string, imageID string, opts ...option.RequestOption) (res *ImageV1DeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env ImageV1DeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/images/v1/%s", accountID, imageID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -114,7 +125,7 @@ func (r *ImageV1Service) Get(ctx context.Context, accountID string, imageID stri return } -type ImageV1UpdateResponse struct { +type ImageV1NewResponse struct { // Image unique identifier. ID string `json:"id"` // Image file name. @@ -128,13 +139,13 @@ type ImageV1UpdateResponse struct { // When the media item was uploaded. Uploaded time.Time `json:"uploaded" format:"date-time"` // Object specifying available variants for an image. - Variants []ImageV1UpdateResponseVariant `json:"variants" format:"uri"` - JSON imageV1UpdateResponseJSON `json:"-"` + Variants []ImageV1NewResponseVariant `json:"variants" format:"uri"` + JSON imageV1NewResponseJSON `json:"-"` } -// imageV1UpdateResponseJSON contains the JSON metadata for the struct -// [ImageV1UpdateResponse] -type imageV1UpdateResponseJSON struct { +// imageV1NewResponseJSON contains the JSON metadata for the struct +// [ImageV1NewResponse] +type imageV1NewResponseJSON struct { ID apijson.Field Filename apijson.Field Meta apijson.Field @@ -145,7 +156,7 @@ type imageV1UpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1UpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1NewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -153,13 +164,13 @@ func (r *ImageV1UpdateResponse) UnmarshalJSON(data []byte) (err error) { // // Union satisfied by [shared.UnionString], [shared.UnionString] or // [shared.UnionString]. -type ImageV1UpdateResponseVariant interface { - ImplementsImageV1UpdateResponseVariant() +type ImageV1NewResponseVariant interface { + ImplementsImageV1NewResponseVariant() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ImageV1UpdateResponseVariant)(nil)).Elem(), + reflect.TypeOf((*ImageV1NewResponseVariant)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -176,40 +187,7 @@ func init() { ) } -// Union satisfied by [ImageV1DeleteResponseUnknown] or [shared.UnionString]. -type ImageV1DeleteResponse interface { - ImplementsImageV1DeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*ImageV1DeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type ImageV1CloudflareImagesListImagesResponse struct { - Images []ImageV1CloudflareImagesListImagesResponseImage `json:"images"` - JSON imageV1CloudflareImagesListImagesResponseJSON `json:"-"` -} - -// imageV1CloudflareImagesListImagesResponseJSON contains the JSON metadata for the -// struct [ImageV1CloudflareImagesListImagesResponse] -type imageV1CloudflareImagesListImagesResponseJSON struct { - Images apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesListImagesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ImageV1CloudflareImagesListImagesResponseImage struct { +type ImageV1UpdateResponse struct { // Image unique identifier. ID string `json:"id"` // Image file name. @@ -223,13 +201,13 @@ type ImageV1CloudflareImagesListImagesResponseImage struct { // When the media item was uploaded. Uploaded time.Time `json:"uploaded" format:"date-time"` // Object specifying available variants for an image. - Variants []ImageV1CloudflareImagesListImagesResponseImagesVariant `json:"variants" format:"uri"` - JSON imageV1CloudflareImagesListImagesResponseImageJSON `json:"-"` + Variants []ImageV1UpdateResponseVariant `json:"variants" format:"uri"` + JSON imageV1UpdateResponseJSON `json:"-"` } -// imageV1CloudflareImagesListImagesResponseImageJSON contains the JSON metadata -// for the struct [ImageV1CloudflareImagesListImagesResponseImage] -type imageV1CloudflareImagesListImagesResponseImageJSON struct { +// imageV1UpdateResponseJSON contains the JSON metadata for the struct +// [ImageV1UpdateResponse] +type imageV1UpdateResponseJSON struct { ID apijson.Field Filename apijson.Field Meta apijson.Field @@ -240,7 +218,7 @@ type imageV1CloudflareImagesListImagesResponseImageJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1CloudflareImagesListImagesResponseImage) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1UpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -248,13 +226,13 @@ func (r *ImageV1CloudflareImagesListImagesResponseImage) UnmarshalJSON(data []by // // Union satisfied by [shared.UnionString], [shared.UnionString] or // [shared.UnionString]. -type ImageV1CloudflareImagesListImagesResponseImagesVariant interface { - ImplementsImageV1CloudflareImagesListImagesResponseImagesVariant() +type ImageV1UpdateResponseVariant interface { + ImplementsImageV1UpdateResponseVariant() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ImageV1CloudflareImagesListImagesResponseImagesVariant)(nil)).Elem(), + reflect.TypeOf((*ImageV1UpdateResponseVariant)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -271,7 +249,86 @@ func init() { ) } -type ImageV1CloudflareImagesUploadAnImageViaURLResponse struct { +type ImageV1ListResponse struct { + Errors []ImageV1ListResponseError `json:"errors,required"` + Messages []ImageV1ListResponseMessage `json:"messages,required"` + Result ImageV1ListResponseResult `json:"result,required"` + // Whether the API call was successful + Success ImageV1ListResponseSuccess `json:"success,required"` + JSON imageV1ListResponseJSON `json:"-"` +} + +// imageV1ListResponseJSON contains the JSON metadata for the struct +// [ImageV1ListResponse] +type imageV1ListResponseJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1ListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1ListResponseError struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1ListResponseErrorJSON `json:"-"` +} + +// imageV1ListResponseErrorJSON contains the JSON metadata for the struct +// [ImageV1ListResponseError] +type imageV1ListResponseErrorJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1ListResponseError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1ListResponseMessage struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1ListResponseMessageJSON `json:"-"` +} + +// imageV1ListResponseMessageJSON contains the JSON metadata for the struct +// [ImageV1ListResponseMessage] +type imageV1ListResponseMessageJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1ListResponseMessage) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1ListResponseResult struct { + Images []ImageV1ListResponseResultImage `json:"images"` + JSON imageV1ListResponseResultJSON `json:"-"` +} + +// imageV1ListResponseResultJSON contains the JSON metadata for the struct +// [ImageV1ListResponseResult] +type imageV1ListResponseResultJSON struct { + Images apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1ListResponseResult) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1ListResponseResultImage struct { // Image unique identifier. ID string `json:"id"` // Image file name. @@ -285,13 +342,13 @@ type ImageV1CloudflareImagesUploadAnImageViaURLResponse struct { // When the media item was uploaded. Uploaded time.Time `json:"uploaded" format:"date-time"` // Object specifying available variants for an image. - Variants []ImageV1CloudflareImagesUploadAnImageViaURLResponseVariant `json:"variants" format:"uri"` - JSON imageV1CloudflareImagesUploadAnImageViaURLResponseJSON `json:"-"` + Variants []ImageV1ListResponseResultImagesVariant `json:"variants" format:"uri"` + JSON imageV1ListResponseResultImageJSON `json:"-"` } -// imageV1CloudflareImagesUploadAnImageViaURLResponseJSON contains the JSON -// metadata for the struct [ImageV1CloudflareImagesUploadAnImageViaURLResponse] -type imageV1CloudflareImagesUploadAnImageViaURLResponseJSON struct { +// imageV1ListResponseResultImageJSON contains the JSON metadata for the struct +// [ImageV1ListResponseResultImage] +type imageV1ListResponseResultImageJSON struct { ID apijson.Field Filename apijson.Field Meta apijson.Field @@ -302,7 +359,7 @@ type imageV1CloudflareImagesUploadAnImageViaURLResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1CloudflareImagesUploadAnImageViaURLResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1ListResponseResultImage) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -310,13 +367,13 @@ func (r *ImageV1CloudflareImagesUploadAnImageViaURLResponse) UnmarshalJSON(data // // Union satisfied by [shared.UnionString], [shared.UnionString] or // [shared.UnionString]. -type ImageV1CloudflareImagesUploadAnImageViaURLResponseVariant interface { - ImplementsImageV1CloudflareImagesUploadAnImageViaURLResponseVariant() +type ImageV1ListResponseResultImagesVariant interface { + ImplementsImageV1ListResponseResultImagesVariant() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ImageV1CloudflareImagesUploadAnImageViaURLResponseVariant)(nil)).Elem(), + reflect.TypeOf((*ImageV1ListResponseResultImagesVariant)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -333,6 +390,29 @@ func init() { ) } +// Whether the API call was successful +type ImageV1ListResponseSuccess bool + +const ( + ImageV1ListResponseSuccessTrue ImageV1ListResponseSuccess = true +) + +// Union satisfied by [ImageV1DeleteResponseUnknown] or [shared.UnionString]. +type ImageV1DeleteResponse interface { + ImplementsImageV1DeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*ImageV1DeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + type ImageV1GetResponse struct { // Image unique identifier. ID string `json:"id"` @@ -395,6 +475,108 @@ func init() { ) } +// This interface is a union satisfied by one of the following: +// [ImageV1NewParamsImagesImageUploadViaFile], +// [ImageV1NewParamsImagesImageUploadViaURL]. +type ImageV1NewParams interface { + ImplementsImageV1NewParams() +} + +type ImageV1NewParamsImagesImageUploadViaFile struct { + // An image binary data. + File param.Field[interface{}] `json:"file,required"` +} + +func (r ImageV1NewParamsImagesImageUploadViaFile) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (ImageV1NewParamsImagesImageUploadViaFile) ImplementsImageV1NewParams() { + +} + +type ImageV1NewParamsImagesImageUploadViaURL struct { + // A URL to fetch an image from origin. + URL param.Field[string] `json:"url,required"` +} + +func (r ImageV1NewParamsImagesImageUploadViaURL) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (ImageV1NewParamsImagesImageUploadViaURL) ImplementsImageV1NewParams() { + +} + +type ImageV1NewResponseEnvelope struct { + Errors []ImageV1NewResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1NewResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1NewResponse `json:"result,required"` + // Whether the API call was successful + Success ImageV1NewResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1NewResponseEnvelopeJSON `json:"-"` +} + +// imageV1NewResponseEnvelopeJSON contains the JSON metadata for the struct +// [ImageV1NewResponseEnvelope] +type imageV1NewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1NewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1NewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1NewResponseEnvelopeErrorsJSON `json:"-"` +} + +// imageV1NewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [ImageV1NewResponseEnvelopeErrors] +type imageV1NewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1NewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ImageV1NewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1NewResponseEnvelopeMessagesJSON `json:"-"` +} + +// imageV1NewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [ImageV1NewResponseEnvelopeMessages] +type imageV1NewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ImageV1NewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type ImageV1NewResponseEnvelopeSuccess bool + +const ( + ImageV1NewResponseEnvelopeSuccessTrue ImageV1NewResponseEnvelopeSuccess = true +) + type ImageV1UpdateParams struct { // User modifiable key-value store. Can be used for keeping references to another // system of record for managing images. No change if not specified. @@ -478,6 +660,21 @@ const ( ImageV1UpdateResponseEnvelopeSuccessTrue ImageV1UpdateResponseEnvelopeSuccess = true ) +type ImageV1ListParams struct { + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // Number of items per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [ImageV1ListParams]'s query parameters as `url.Values`. +func (r ImageV1ListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + type ImageV1DeleteResponseEnvelope struct { Errors []ImageV1DeleteResponseEnvelopeErrors `json:"errors,required"` Messages []ImageV1DeleteResponseEnvelopeMessages `json:"messages,required"` @@ -547,198 +744,6 @@ const ( ImageV1DeleteResponseEnvelopeSuccessTrue ImageV1DeleteResponseEnvelopeSuccess = true ) -type ImageV1CloudflareImagesListImagesParams struct { - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Number of items per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes [ImageV1CloudflareImagesListImagesParams]'s query parameters -// as `url.Values`. -func (r ImageV1CloudflareImagesListImagesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type ImageV1CloudflareImagesListImagesResponseEnvelope struct { - Errors []ImageV1CloudflareImagesListImagesResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1CloudflareImagesListImagesResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1CloudflareImagesListImagesResponse `json:"result,required"` - // Whether the API call was successful - Success ImageV1CloudflareImagesListImagesResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1CloudflareImagesListImagesResponseEnvelopeJSON `json:"-"` -} - -// imageV1CloudflareImagesListImagesResponseEnvelopeJSON contains the JSON metadata -// for the struct [ImageV1CloudflareImagesListImagesResponseEnvelope] -type imageV1CloudflareImagesListImagesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesListImagesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ImageV1CloudflareImagesListImagesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1CloudflareImagesListImagesResponseEnvelopeErrorsJSON `json:"-"` -} - -// imageV1CloudflareImagesListImagesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [ImageV1CloudflareImagesListImagesResponseEnvelopeErrors] -type imageV1CloudflareImagesListImagesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesListImagesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ImageV1CloudflareImagesListImagesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1CloudflareImagesListImagesResponseEnvelopeMessagesJSON `json:"-"` -} - -// imageV1CloudflareImagesListImagesResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [ImageV1CloudflareImagesListImagesResponseEnvelopeMessages] -type imageV1CloudflareImagesListImagesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesListImagesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type ImageV1CloudflareImagesListImagesResponseEnvelopeSuccess bool - -const ( - ImageV1CloudflareImagesListImagesResponseEnvelopeSuccessTrue ImageV1CloudflareImagesListImagesResponseEnvelopeSuccess = true -) - -// This interface is a union satisfied by one of the following: -// [ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaFile], -// [ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaURL]. -type ImageV1CloudflareImagesUploadAnImageViaURLParams interface { - ImplementsImageV1CloudflareImagesUploadAnImageViaURLParams() -} - -type ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaFile struct { - // An image binary data. - File param.Field[interface{}] `json:"file,required"` -} - -func (r ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaFile) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaFile) ImplementsImageV1CloudflareImagesUploadAnImageViaURLParams() { - -} - -type ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaURL struct { - // A URL to fetch an image from origin. - URL param.Field[string] `json:"url,required"` -} - -func (r ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaURL) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaURL) ImplementsImageV1CloudflareImagesUploadAnImageViaURLParams() { - -} - -type ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelope struct { - Errors []ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1CloudflareImagesUploadAnImageViaURLResponse `json:"result,required"` - // Whether the API call was successful - Success ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeJSON `json:"-"` -} - -// imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelope] -type imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrorsJSON `json:"-"` -} - -// imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrors] -type imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessagesJSON `json:"-"` -} - -// imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessages] -type imageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeSuccess bool - -const ( - ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeSuccessTrue ImageV1CloudflareImagesUploadAnImageViaURLResponseEnvelopeSuccess = true -) - type ImageV1GetResponseEnvelope struct { Errors []ImageV1GetResponseEnvelopeErrors `json:"errors,required"` Messages []ImageV1GetResponseEnvelopeMessages `json:"messages,required"` diff --git a/imagev1_test.go b/imagev1_test.go index 1f45edb2955..09b9c6a1cd7 100644 --- a/imagev1_test.go +++ b/imagev1_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV1UpdateWithOptionalParams(t *testing.T) { +func TestImageV1New(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,11 @@ func TestImageV1UpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Update( + _, err := client.Images.V1s.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "string", - cloudflare.ImageV1UpdateParams{ - Metadata: cloudflare.F[any](map[string]interface{}{}), - RequireSignedURLs: cloudflare.F(true), + cloudflare.ImageV1NewParamsImagesImageUploadViaFile{ + File: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -47,7 +45,7 @@ func TestImageV1UpdateWithOptionalParams(t *testing.T) { } } -func TestImageV1Delete(t *testing.T) { +func TestImageV1UpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,10 +61,14 @@ func TestImageV1Delete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Delete( + _, err := client.Images.V1s.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "string", + cloudflare.ImageV1UpdateParams{ + Metadata: cloudflare.F[any](map[string]interface{}{}), + RequireSignedURLs: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error @@ -77,7 +79,7 @@ func TestImageV1Delete(t *testing.T) { } } -func TestImageV1CloudflareImagesListImagesWithOptionalParams(t *testing.T) { +func TestImageV1ListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,10 +95,10 @@ func TestImageV1CloudflareImagesListImagesWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.CloudflareImagesListImages( + _, err := client.Images.V1s.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ImageV1CloudflareImagesListImagesParams{ + cloudflare.ImageV1ListParams{ Page: cloudflare.F(1.000000), PerPage: cloudflare.F(10.000000), }, @@ -110,7 +112,7 @@ func TestImageV1CloudflareImagesListImagesWithOptionalParams(t *testing.T) { } } -func TestImageV1CloudflareImagesUploadAnImageViaURL(t *testing.T) { +func TestImageV1Delete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,12 +128,10 @@ func TestImageV1CloudflareImagesUploadAnImageViaURL(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.CloudflareImagesUploadAnImageViaURL( + _, err := client.Images.V1s.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ImageV1CloudflareImagesUploadAnImageViaURLParamsImagesImageUploadViaFile{ - File: cloudflare.F[any](map[string]interface{}{}), - }, + "string", ) if err != nil { var apierr *cloudflare.Error diff --git a/imagev1blob.go b/imagev1blob.go index f483859cc9e..38f4684b3ad 100644 --- a/imagev1blob.go +++ b/imagev1blob.go @@ -31,7 +31,7 @@ func NewImageV1BlobService(opts ...option.RequestOption) (r *ImageV1BlobService) // Fetch base image. For most images this will be the originally uploaded file. For // larger images it can be a near-lossless version of the original. -func (r *ImageV1BlobService) CloudflareImagesBaseImage(ctx context.Context, accountID string, imageID string, opts ...option.RequestOption) (res *http.Response, err error) { +func (r *ImageV1BlobService) Get(ctx context.Context, accountID string, imageID string, opts ...option.RequestOption) (res *http.Response, err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "image/*")}, opts...) path := fmt.Sprintf("accounts/%s/images/v1/%s/blob", accountID, imageID) diff --git a/imagev1blob_test.go b/imagev1blob_test.go index 71f5676ecb1..88c7b955f20 100644 --- a/imagev1blob_test.go +++ b/imagev1blob_test.go @@ -15,7 +15,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV1BlobCloudflareImagesBaseImage(t *testing.T) { +func TestImageV1BlobGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) @@ -30,7 +30,7 @@ func TestImageV1BlobCloudflareImagesBaseImage(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - resp, err := client.Images.V1s.Blobs.CloudflareImagesBaseImage( + resp, err := client.Images.V1s.Blobs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "string", diff --git a/imagev1key.go b/imagev1key.go index 5be38e5ebaa..1b6cb5394a0 100644 --- a/imagev1key.go +++ b/imagev1key.go @@ -30,9 +30,9 @@ func NewImageV1KeyService(opts ...option.RequestOption) (r *ImageV1KeyService) { } // Lists your signing keys. These can be found on your Cloudflare Images dashboard. -func (r *ImageV1KeyService) CloudflareImagesKeysListSigningKeys(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1KeyCloudflareImagesKeysListSigningKeysResponse, err error) { +func (r *ImageV1KeyService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1KeyListResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelope + var env ImageV1KeyListResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v1/keys", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -42,58 +42,56 @@ func (r *ImageV1KeyService) CloudflareImagesKeysListSigningKeys(ctx context.Cont return } -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponse struct { - Keys []ImageV1KeyCloudflareImagesKeysListSigningKeysResponseKey `json:"keys"` - JSON imageV1KeyCloudflareImagesKeysListSigningKeysResponseJSON `json:"-"` +type ImageV1KeyListResponse struct { + Keys []ImageV1KeyListResponseKey `json:"keys"` + JSON imageV1KeyListResponseJSON `json:"-"` } -// imageV1KeyCloudflareImagesKeysListSigningKeysResponseJSON contains the JSON -// metadata for the struct [ImageV1KeyCloudflareImagesKeysListSigningKeysResponse] -type imageV1KeyCloudflareImagesKeysListSigningKeysResponseJSON struct { +// imageV1KeyListResponseJSON contains the JSON metadata for the struct +// [ImageV1KeyListResponse] +type imageV1KeyListResponseJSON struct { Keys apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1KeyCloudflareImagesKeysListSigningKeysResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1KeyListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponseKey struct { +type ImageV1KeyListResponseKey struct { // Key name. Name string `json:"name"` // Key value. - Value string `json:"value"` - JSON imageV1KeyCloudflareImagesKeysListSigningKeysResponseKeyJSON `json:"-"` + Value string `json:"value"` + JSON imageV1KeyListResponseKeyJSON `json:"-"` } -// imageV1KeyCloudflareImagesKeysListSigningKeysResponseKeyJSON contains the JSON -// metadata for the struct -// [ImageV1KeyCloudflareImagesKeysListSigningKeysResponseKey] -type imageV1KeyCloudflareImagesKeysListSigningKeysResponseKeyJSON struct { +// imageV1KeyListResponseKeyJSON contains the JSON metadata for the struct +// [ImageV1KeyListResponseKey] +type imageV1KeyListResponseKeyJSON struct { Name apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1KeyCloudflareImagesKeysListSigningKeysResponseKey) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1KeyListResponseKey) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelope struct { - Errors []ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1KeyCloudflareImagesKeysListSigningKeysResponse `json:"result,required"` +type ImageV1KeyListResponseEnvelope struct { + Errors []ImageV1KeyListResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1KeyListResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1KeyListResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeJSON `json:"-"` + Success ImageV1KeyListResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1KeyListResponseEnvelopeJSON `json:"-"` } -// imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelope] -type imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeJSON struct { +// imageV1KeyListResponseEnvelopeJSON contains the JSON metadata for the struct +// [ImageV1KeyListResponseEnvelope] +type imageV1KeyListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -102,53 +100,51 @@ type imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1KeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrorsJSON `json:"-"` +type ImageV1KeyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1KeyListResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrors] -type imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrorsJSON struct { +// imageV1KeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ImageV1KeyListResponseEnvelopeErrors] +type imageV1KeyListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1KeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessagesJSON `json:"-"` +type ImageV1KeyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1KeyListResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessages] -type imageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessagesJSON struct { +// imageV1KeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ImageV1KeyListResponseEnvelopeMessages] +type imageV1KeyListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1KeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeSuccess bool +type ImageV1KeyListResponseEnvelopeSuccess bool const ( - ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeSuccessTrue ImageV1KeyCloudflareImagesKeysListSigningKeysResponseEnvelopeSuccess = true + ImageV1KeyListResponseEnvelopeSuccessTrue ImageV1KeyListResponseEnvelopeSuccess = true ) diff --git a/imagev1key_test.go b/imagev1key_test.go index cc0a5d79dbe..fc1ead92801 100644 --- a/imagev1key_test.go +++ b/imagev1key_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV1KeyCloudflareImagesKeysListSigningKeys(t *testing.T) { +func TestImageV1KeyList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestImageV1KeyCloudflareImagesKeysListSigningKeys(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Keys.CloudflareImagesKeysListSigningKeys(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Images.V1s.Keys.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/imagev1stat.go b/imagev1stat.go index 8ff6228a213..29a50115c99 100644 --- a/imagev1stat.go +++ b/imagev1stat.go @@ -31,9 +31,9 @@ func NewImageV1StatService(opts ...option.RequestOption) (r *ImageV1StatService) } // Fetch usage statistics details for Cloudflare Images. -func (r *ImageV1StatService) CloudflareImagesImagesUsageStatistics(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1StatCloudflareImagesImagesUsageStatisticsResponse, err error) { +func (r *ImageV1StatService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1StatGetResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelope + var env ImageV1StatGetResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v1/stats", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,59 +43,56 @@ func (r *ImageV1StatService) CloudflareImagesImagesUsageStatistics(ctx context.C return } -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponse struct { - Count ImageV1StatCloudflareImagesImagesUsageStatisticsResponseCount `json:"count"` - JSON imageV1StatCloudflareImagesImagesUsageStatisticsResponseJSON `json:"-"` +type ImageV1StatGetResponse struct { + Count ImageV1StatGetResponseCount `json:"count"` + JSON imageV1StatGetResponseJSON `json:"-"` } -// imageV1StatCloudflareImagesImagesUsageStatisticsResponseJSON contains the JSON -// metadata for the struct -// [ImageV1StatCloudflareImagesImagesUsageStatisticsResponse] -type imageV1StatCloudflareImagesImagesUsageStatisticsResponseJSON struct { +// imageV1StatGetResponseJSON contains the JSON metadata for the struct +// [ImageV1StatGetResponse] +type imageV1StatGetResponseJSON struct { Count apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1StatCloudflareImagesImagesUsageStatisticsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1StatGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponseCount struct { +type ImageV1StatGetResponseCount struct { // Cloudflare Images allowed usage. Allowed float64 `json:"allowed"` // Cloudflare Images current usage. - Current float64 `json:"current"` - JSON imageV1StatCloudflareImagesImagesUsageStatisticsResponseCountJSON `json:"-"` + Current float64 `json:"current"` + JSON imageV1StatGetResponseCountJSON `json:"-"` } -// imageV1StatCloudflareImagesImagesUsageStatisticsResponseCountJSON contains the -// JSON metadata for the struct -// [ImageV1StatCloudflareImagesImagesUsageStatisticsResponseCount] -type imageV1StatCloudflareImagesImagesUsageStatisticsResponseCountJSON struct { +// imageV1StatGetResponseCountJSON contains the JSON metadata for the struct +// [ImageV1StatGetResponseCount] +type imageV1StatGetResponseCountJSON struct { Allowed apijson.Field Current apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1StatCloudflareImagesImagesUsageStatisticsResponseCount) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1StatGetResponseCount) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelope struct { - Errors []ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1StatCloudflareImagesImagesUsageStatisticsResponse `json:"result,required"` +type ImageV1StatGetResponseEnvelope struct { + Errors []ImageV1StatGetResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1StatGetResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1StatGetResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeJSON `json:"-"` + Success ImageV1StatGetResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1StatGetResponseEnvelopeJSON `json:"-"` } -// imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelope] -type imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeJSON struct { +// imageV1StatGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [ImageV1StatGetResponseEnvelope] +type imageV1StatGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -104,53 +101,51 @@ type imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1StatGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrorsJSON `json:"-"` +type ImageV1StatGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1StatGetResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrors] -type imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrorsJSON struct { +// imageV1StatGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ImageV1StatGetResponseEnvelopeErrors] +type imageV1StatGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1StatGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessagesJSON `json:"-"` +type ImageV1StatGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1StatGetResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessages] -type imageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessagesJSON struct { +// imageV1StatGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ImageV1StatGetResponseEnvelopeMessages] +type imageV1StatGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1StatGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeSuccess bool +type ImageV1StatGetResponseEnvelopeSuccess bool const ( - ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeSuccessTrue ImageV1StatCloudflareImagesImagesUsageStatisticsResponseEnvelopeSuccess = true + ImageV1StatGetResponseEnvelopeSuccessTrue ImageV1StatGetResponseEnvelopeSuccess = true ) diff --git a/imagev1stat_test.go b/imagev1stat_test.go index a59723c63e4..3024909cc0c 100644 --- a/imagev1stat_test.go +++ b/imagev1stat_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV1StatCloudflareImagesImagesUsageStatistics(t *testing.T) { +func TestImageV1StatGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestImageV1StatCloudflareImagesImagesUsageStatistics(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Stats.CloudflareImagesImagesUsageStatistics(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Images.V1s.Stats.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/imagev1variant.go b/imagev1variant.go index d716b8ab312..f36151fd7d2 100644 --- a/imagev1variant.go +++ b/imagev1variant.go @@ -34,12 +34,12 @@ func NewImageV1VariantService(opts ...option.RequestOption) (r *ImageV1VariantSe return } -// Updating a variant purges the cache for all images associated with the variant. -func (r *ImageV1VariantService) Update(ctx context.Context, accountID string, variantID interface{}, body ImageV1VariantUpdateParams, opts ...option.RequestOption) (res *ImageV1VariantUpdateResponse, err error) { +// Specify variants that allow you to resize images for different use cases. +func (r *ImageV1VariantService) New(ctx context.Context, accountID string, body ImageV1VariantNewParams, opts ...option.RequestOption) (res *ImageV1VariantNewResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1VariantUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", accountID, variantID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env ImageV1VariantNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/images/v1/variants", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *ImageV1VariantService) Update(ctx context.Context, accountID string, va return } -// Deleting a variant purges the cache for all images associated with the variant. -func (r *ImageV1VariantService) Delete(ctx context.Context, accountID string, variantID interface{}, opts ...option.RequestOption) (res *ImageV1VariantDeleteResponse, err error) { +// Updating a variant purges the cache for all images associated with the variant. +func (r *ImageV1VariantService) Update(ctx context.Context, accountID string, variantID interface{}, body ImageV1VariantUpdateParams, opts ...option.RequestOption) (res *ImageV1VariantUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1VariantDeleteResponseEnvelope + var env ImageV1VariantUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", accountID, variantID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -60,12 +60,12 @@ func (r *ImageV1VariantService) Delete(ctx context.Context, accountID string, va return } -// Specify variants that allow you to resize images for different use cases. -func (r *ImageV1VariantService) CloudflareImagesVariantsNewAVariant(ctx context.Context, accountID string, body ImageV1VariantCloudflareImagesVariantsNewAVariantParams, opts ...option.RequestOption) (res *ImageV1VariantCloudflareImagesVariantsNewAVariantResponse, err error) { +// Lists existing variants. +func (r *ImageV1VariantService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1VariantListResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelope + var env ImageV1VariantListResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v1/variants", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,12 +73,12 @@ func (r *ImageV1VariantService) CloudflareImagesVariantsNewAVariant(ctx context. return } -// Lists existing variants. -func (r *ImageV1VariantService) CloudflareImagesVariantsListVariants(ctx context.Context, accountID string, opts ...option.RequestOption) (res *ImageV1VariantCloudflareImagesVariantsListVariantsResponse, err error) { +// Deleting a variant purges the cache for all images associated with the variant. +func (r *ImageV1VariantService) Delete(ctx context.Context, accountID string, variantID interface{}, opts ...option.RequestOption) (res *ImageV1VariantDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1/variants", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env ImageV1VariantDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", accountID, variantID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -99,36 +99,36 @@ func (r *ImageV1VariantService) Get(ctx context.Context, accountID string, varia return } -type ImageV1VariantUpdateResponse struct { - Variant ImageV1VariantUpdateResponseVariant `json:"variant"` - JSON imageV1VariantUpdateResponseJSON `json:"-"` +type ImageV1VariantNewResponse struct { + Variant ImageV1VariantNewResponseVariant `json:"variant"` + JSON imageV1VariantNewResponseJSON `json:"-"` } -// imageV1VariantUpdateResponseJSON contains the JSON metadata for the struct -// [ImageV1VariantUpdateResponse] -type imageV1VariantUpdateResponseJSON struct { +// imageV1VariantNewResponseJSON contains the JSON metadata for the struct +// [ImageV1VariantNewResponse] +type imageV1VariantNewResponseJSON struct { Variant apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantUpdateResponseVariant struct { +type ImageV1VariantNewResponseVariant struct { ID interface{} `json:"id,required"` // Allows you to define image resizing sizes for different use cases. - Options ImageV1VariantUpdateResponseVariantOptions `json:"options,required"` + Options ImageV1VariantNewResponseVariantOptions `json:"options,required"` // Indicates whether the variant can access an image without a signature, // regardless of image access control. - NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` - JSON imageV1VariantUpdateResponseVariantJSON `json:"-"` + NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` + JSON imageV1VariantNewResponseVariantJSON `json:"-"` } -// imageV1VariantUpdateResponseVariantJSON contains the JSON metadata for the -// struct [ImageV1VariantUpdateResponseVariant] -type imageV1VariantUpdateResponseVariantJSON struct { +// imageV1VariantNewResponseVariantJSON contains the JSON metadata for the struct +// [ImageV1VariantNewResponseVariant] +type imageV1VariantNewResponseVariantJSON struct { ID apijson.Field Options apijson.Field NeverRequireSignedURLs apijson.Field @@ -136,27 +136,27 @@ type imageV1VariantUpdateResponseVariantJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponseVariant) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponseVariant) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Allows you to define image resizing sizes for different use cases. -type ImageV1VariantUpdateResponseVariantOptions struct { +type ImageV1VariantNewResponseVariantOptions struct { // The fit property describes how the width and height dimensions should be // interpreted. - Fit ImageV1VariantUpdateResponseVariantOptionsFit `json:"fit,required"` + Fit ImageV1VariantNewResponseVariantOptionsFit `json:"fit,required"` // Maximum height in image pixels. Height float64 `json:"height,required"` // What EXIF data should be preserved in the output image. - Metadata ImageV1VariantUpdateResponseVariantOptionsMetadata `json:"metadata,required"` + Metadata ImageV1VariantNewResponseVariantOptionsMetadata `json:"metadata,required"` // Maximum width in image pixels. - Width float64 `json:"width,required"` - JSON imageV1VariantUpdateResponseVariantOptionsJSON `json:"-"` + Width float64 `json:"width,required"` + JSON imageV1VariantNewResponseVariantOptionsJSON `json:"-"` } -// imageV1VariantUpdateResponseVariantOptionsJSON contains the JSON metadata for -// the struct [ImageV1VariantUpdateResponseVariantOptions] -type imageV1VariantUpdateResponseVariantOptionsJSON struct { +// imageV1VariantNewResponseVariantOptionsJSON contains the JSON metadata for the +// struct [ImageV1VariantNewResponseVariantOptions] +type imageV1VariantNewResponseVariantOptionsJSON struct { Fit apijson.Field Height apijson.Field Metadata apijson.Field @@ -165,80 +165,61 @@ type imageV1VariantUpdateResponseVariantOptionsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponseVariantOptions) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponseVariantOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The fit property describes how the width and height dimensions should be // interpreted. -type ImageV1VariantUpdateResponseVariantOptionsFit string +type ImageV1VariantNewResponseVariantOptionsFit string const ( - ImageV1VariantUpdateResponseVariantOptionsFitScaleDown ImageV1VariantUpdateResponseVariantOptionsFit = "scale-down" - ImageV1VariantUpdateResponseVariantOptionsFitContain ImageV1VariantUpdateResponseVariantOptionsFit = "contain" - ImageV1VariantUpdateResponseVariantOptionsFitCover ImageV1VariantUpdateResponseVariantOptionsFit = "cover" - ImageV1VariantUpdateResponseVariantOptionsFitCrop ImageV1VariantUpdateResponseVariantOptionsFit = "crop" - ImageV1VariantUpdateResponseVariantOptionsFitPad ImageV1VariantUpdateResponseVariantOptionsFit = "pad" + ImageV1VariantNewResponseVariantOptionsFitScaleDown ImageV1VariantNewResponseVariantOptionsFit = "scale-down" + ImageV1VariantNewResponseVariantOptionsFitContain ImageV1VariantNewResponseVariantOptionsFit = "contain" + ImageV1VariantNewResponseVariantOptionsFitCover ImageV1VariantNewResponseVariantOptionsFit = "cover" + ImageV1VariantNewResponseVariantOptionsFitCrop ImageV1VariantNewResponseVariantOptionsFit = "crop" + ImageV1VariantNewResponseVariantOptionsFitPad ImageV1VariantNewResponseVariantOptionsFit = "pad" ) // What EXIF data should be preserved in the output image. -type ImageV1VariantUpdateResponseVariantOptionsMetadata string +type ImageV1VariantNewResponseVariantOptionsMetadata string const ( - ImageV1VariantUpdateResponseVariantOptionsMetadataKeep ImageV1VariantUpdateResponseVariantOptionsMetadata = "keep" - ImageV1VariantUpdateResponseVariantOptionsMetadataCopyright ImageV1VariantUpdateResponseVariantOptionsMetadata = "copyright" - ImageV1VariantUpdateResponseVariantOptionsMetadataNone ImageV1VariantUpdateResponseVariantOptionsMetadata = "none" + ImageV1VariantNewResponseVariantOptionsMetadataKeep ImageV1VariantNewResponseVariantOptionsMetadata = "keep" + ImageV1VariantNewResponseVariantOptionsMetadataCopyright ImageV1VariantNewResponseVariantOptionsMetadata = "copyright" + ImageV1VariantNewResponseVariantOptionsMetadataNone ImageV1VariantNewResponseVariantOptionsMetadata = "none" ) -// Union satisfied by [ImageV1VariantDeleteResponseUnknown] or -// [shared.UnionString]. -type ImageV1VariantDeleteResponse interface { - ImplementsImageV1VariantDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*ImageV1VariantDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponse struct { - Variant ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariant `json:"variant"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseJSON `json:"-"` +type ImageV1VariantUpdateResponse struct { + Variant ImageV1VariantUpdateResponseVariant `json:"variant"` + JSON imageV1VariantUpdateResponseJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseJSON contains the JSON -// metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponse] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseJSON struct { +// imageV1VariantUpdateResponseJSON contains the JSON metadata for the struct +// [ImageV1VariantUpdateResponse] +type imageV1VariantUpdateResponseJSON struct { Variant apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariant struct { +type ImageV1VariantUpdateResponseVariant struct { ID interface{} `json:"id,required"` // Allows you to define image resizing sizes for different use cases. - Options ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptions `json:"options,required"` + Options ImageV1VariantUpdateResponseVariantOptions `json:"options,required"` // Indicates whether the variant can access an image without a signature, // regardless of image access control. - NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantJSON `json:"-"` + NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` + JSON imageV1VariantUpdateResponseVariantJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantJSON contains -// the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariant] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantJSON struct { +// imageV1VariantUpdateResponseVariantJSON contains the JSON metadata for the +// struct [ImageV1VariantUpdateResponseVariant] +type imageV1VariantUpdateResponseVariantJSON struct { ID apijson.Field Options apijson.Field NeverRequireSignedURLs apijson.Field @@ -246,28 +227,27 @@ type imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantJSON struct ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariant) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponseVariant) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Allows you to define image resizing sizes for different use cases. -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptions struct { +type ImageV1VariantUpdateResponseVariantOptions struct { // The fit property describes how the width and height dimensions should be // interpreted. - Fit ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit `json:"fit,required"` + Fit ImageV1VariantUpdateResponseVariantOptionsFit `json:"fit,required"` // Maximum height in image pixels. Height float64 `json:"height,required"` // What EXIF data should be preserved in the output image. - Metadata ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadata `json:"metadata,required"` + Metadata ImageV1VariantUpdateResponseVariantOptionsMetadata `json:"metadata,required"` // Maximum width in image pixels. - Width float64 `json:"width,required"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsJSON `json:"-"` + Width float64 `json:"width,required"` + JSON imageV1VariantUpdateResponseVariantOptionsJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptions] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsJSON struct { +// imageV1VariantUpdateResponseVariantOptionsJSON contains the JSON metadata for +// the struct [ImageV1VariantUpdateResponseVariantOptions] +type imageV1VariantUpdateResponseVariantOptionsJSON struct { Fit apijson.Field Height apijson.Field Metadata apijson.Field @@ -276,81 +256,78 @@ type imageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsJSON ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptions) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponseVariantOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The fit property describes how the width and height dimensions should be // interpreted. -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit string +type ImageV1VariantUpdateResponseVariantOptionsFit string const ( - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFitScaleDown ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit = "scale-down" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFitContain ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit = "contain" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFitCover ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit = "cover" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFitCrop ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit = "crop" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFitPad ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsFit = "pad" + ImageV1VariantUpdateResponseVariantOptionsFitScaleDown ImageV1VariantUpdateResponseVariantOptionsFit = "scale-down" + ImageV1VariantUpdateResponseVariantOptionsFitContain ImageV1VariantUpdateResponseVariantOptionsFit = "contain" + ImageV1VariantUpdateResponseVariantOptionsFitCover ImageV1VariantUpdateResponseVariantOptionsFit = "cover" + ImageV1VariantUpdateResponseVariantOptionsFitCrop ImageV1VariantUpdateResponseVariantOptionsFit = "crop" + ImageV1VariantUpdateResponseVariantOptionsFitPad ImageV1VariantUpdateResponseVariantOptionsFit = "pad" ) // What EXIF data should be preserved in the output image. -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadata string +type ImageV1VariantUpdateResponseVariantOptionsMetadata string const ( - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadataKeep ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadata = "keep" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadataCopyright ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadata = "copyright" - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadataNone ImageV1VariantCloudflareImagesVariantsNewAVariantResponseVariantOptionsMetadata = "none" + ImageV1VariantUpdateResponseVariantOptionsMetadataKeep ImageV1VariantUpdateResponseVariantOptionsMetadata = "keep" + ImageV1VariantUpdateResponseVariantOptionsMetadataCopyright ImageV1VariantUpdateResponseVariantOptionsMetadata = "copyright" + ImageV1VariantUpdateResponseVariantOptionsMetadataNone ImageV1VariantUpdateResponseVariantOptionsMetadata = "none" ) -type ImageV1VariantCloudflareImagesVariantsListVariantsResponse struct { - Variants ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariants `json:"variants"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseJSON `json:"-"` +type ImageV1VariantListResponse struct { + Variants ImageV1VariantListResponseVariants `json:"variants"` + JSON imageV1VariantListResponseJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseJSON contains the JSON -// metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponse] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseJSON struct { +// imageV1VariantListResponseJSON contains the JSON metadata for the struct +// [ImageV1VariantListResponse] +type imageV1VariantListResponseJSON struct { Variants apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariants struct { - Hero ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHero `json:"hero"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsJSON `json:"-"` +type ImageV1VariantListResponseVariants struct { + Hero ImageV1VariantListResponseVariantsHero `json:"hero"` + JSON imageV1VariantListResponseVariantsJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsJSON contains -// the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariants] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsJSON struct { +// imageV1VariantListResponseVariantsJSON contains the JSON metadata for the struct +// [ImageV1VariantListResponseVariants] +type imageV1VariantListResponseVariantsJSON struct { Hero apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariants) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseVariants) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHero struct { +type ImageV1VariantListResponseVariantsHero struct { ID interface{} `json:"id,required"` // Allows you to define image resizing sizes for different use cases. - Options ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptions `json:"options,required"` + Options ImageV1VariantListResponseVariantsHeroOptions `json:"options,required"` // Indicates whether the variant can access an image without a signature, // regardless of image access control. - NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroJSON `json:"-"` + NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"` + JSON imageV1VariantListResponseVariantsHeroJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHero] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroJSON struct { +// imageV1VariantListResponseVariantsHeroJSON contains the JSON metadata for the +// struct [ImageV1VariantListResponseVariantsHero] +type imageV1VariantListResponseVariantsHeroJSON struct { ID apijson.Field Options apijson.Field NeverRequireSignedURLs apijson.Field @@ -358,28 +335,27 @@ type imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroJSON ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHero) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseVariantsHero) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Allows you to define image resizing sizes for different use cases. -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptions struct { +type ImageV1VariantListResponseVariantsHeroOptions struct { // The fit property describes how the width and height dimensions should be // interpreted. - Fit ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit `json:"fit,required"` + Fit ImageV1VariantListResponseVariantsHeroOptionsFit `json:"fit,required"` // Maximum height in image pixels. Height float64 `json:"height,required"` // What EXIF data should be preserved in the output image. - Metadata ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadata `json:"metadata,required"` + Metadata ImageV1VariantListResponseVariantsHeroOptionsMetadata `json:"metadata,required"` // Maximum width in image pixels. - Width float64 `json:"width,required"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsJSON `json:"-"` + Width float64 `json:"width,required"` + JSON imageV1VariantListResponseVariantsHeroOptionsJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptions] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsJSON struct { +// imageV1VariantListResponseVariantsHeroOptionsJSON contains the JSON metadata for +// the struct [ImageV1VariantListResponseVariantsHeroOptions] +type imageV1VariantListResponseVariantsHeroOptionsJSON struct { Fit apijson.Field Height apijson.Field Metadata apijson.Field @@ -388,31 +364,48 @@ type imageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptio ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptions) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseVariantsHeroOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The fit property describes how the width and height dimensions should be // interpreted. -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit string +type ImageV1VariantListResponseVariantsHeroOptionsFit string const ( - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFitScaleDown ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit = "scale-down" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFitContain ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit = "contain" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFitCover ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit = "cover" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFitCrop ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit = "crop" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFitPad ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsFit = "pad" + ImageV1VariantListResponseVariantsHeroOptionsFitScaleDown ImageV1VariantListResponseVariantsHeroOptionsFit = "scale-down" + ImageV1VariantListResponseVariantsHeroOptionsFitContain ImageV1VariantListResponseVariantsHeroOptionsFit = "contain" + ImageV1VariantListResponseVariantsHeroOptionsFitCover ImageV1VariantListResponseVariantsHeroOptionsFit = "cover" + ImageV1VariantListResponseVariantsHeroOptionsFitCrop ImageV1VariantListResponseVariantsHeroOptionsFit = "crop" + ImageV1VariantListResponseVariantsHeroOptionsFitPad ImageV1VariantListResponseVariantsHeroOptionsFit = "pad" ) // What EXIF data should be preserved in the output image. -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadata string +type ImageV1VariantListResponseVariantsHeroOptionsMetadata string const ( - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadataKeep ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadata = "keep" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadataCopyright ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadata = "copyright" - ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadataNone ImageV1VariantCloudflareImagesVariantsListVariantsResponseVariantsHeroOptionsMetadata = "none" + ImageV1VariantListResponseVariantsHeroOptionsMetadataKeep ImageV1VariantListResponseVariantsHeroOptionsMetadata = "keep" + ImageV1VariantListResponseVariantsHeroOptionsMetadataCopyright ImageV1VariantListResponseVariantsHeroOptionsMetadata = "copyright" + ImageV1VariantListResponseVariantsHeroOptionsMetadataNone ImageV1VariantListResponseVariantsHeroOptionsMetadata = "none" ) +// Union satisfied by [ImageV1VariantDeleteResponseUnknown] or +// [shared.UnionString]. +type ImageV1VariantDeleteResponse interface { + ImplementsImageV1VariantDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*ImageV1VariantDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + type ImageV1VariantGetResponse struct { Variant ImageV1VariantGetResponseVariant `json:"variant"` JSON imageV1VariantGetResponseJSON `json:"-"` @@ -504,68 +497,69 @@ const ( ImageV1VariantGetResponseVariantOptionsMetadataNone ImageV1VariantGetResponseVariantOptionsMetadata = "none" ) -type ImageV1VariantUpdateParams struct { +type ImageV1VariantNewParams struct { + ID param.Field[interface{}] `json:"id,required"` // Allows you to define image resizing sizes for different use cases. - Options param.Field[ImageV1VariantUpdateParamsOptions] `json:"options,required"` + Options param.Field[ImageV1VariantNewParamsOptions] `json:"options,required"` // Indicates whether the variant can access an image without a signature, // regardless of image access control. NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"` } -func (r ImageV1VariantUpdateParams) MarshalJSON() (data []byte, err error) { +func (r ImageV1VariantNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Allows you to define image resizing sizes for different use cases. -type ImageV1VariantUpdateParamsOptions struct { +type ImageV1VariantNewParamsOptions struct { // The fit property describes how the width and height dimensions should be // interpreted. - Fit param.Field[ImageV1VariantUpdateParamsOptionsFit] `json:"fit,required"` + Fit param.Field[ImageV1VariantNewParamsOptionsFit] `json:"fit,required"` // Maximum height in image pixels. Height param.Field[float64] `json:"height,required"` // What EXIF data should be preserved in the output image. - Metadata param.Field[ImageV1VariantUpdateParamsOptionsMetadata] `json:"metadata,required"` + Metadata param.Field[ImageV1VariantNewParamsOptionsMetadata] `json:"metadata,required"` // Maximum width in image pixels. Width param.Field[float64] `json:"width,required"` } -func (r ImageV1VariantUpdateParamsOptions) MarshalJSON() (data []byte, err error) { +func (r ImageV1VariantNewParamsOptions) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The fit property describes how the width and height dimensions should be // interpreted. -type ImageV1VariantUpdateParamsOptionsFit string +type ImageV1VariantNewParamsOptionsFit string const ( - ImageV1VariantUpdateParamsOptionsFitScaleDown ImageV1VariantUpdateParamsOptionsFit = "scale-down" - ImageV1VariantUpdateParamsOptionsFitContain ImageV1VariantUpdateParamsOptionsFit = "contain" - ImageV1VariantUpdateParamsOptionsFitCover ImageV1VariantUpdateParamsOptionsFit = "cover" - ImageV1VariantUpdateParamsOptionsFitCrop ImageV1VariantUpdateParamsOptionsFit = "crop" - ImageV1VariantUpdateParamsOptionsFitPad ImageV1VariantUpdateParamsOptionsFit = "pad" + ImageV1VariantNewParamsOptionsFitScaleDown ImageV1VariantNewParamsOptionsFit = "scale-down" + ImageV1VariantNewParamsOptionsFitContain ImageV1VariantNewParamsOptionsFit = "contain" + ImageV1VariantNewParamsOptionsFitCover ImageV1VariantNewParamsOptionsFit = "cover" + ImageV1VariantNewParamsOptionsFitCrop ImageV1VariantNewParamsOptionsFit = "crop" + ImageV1VariantNewParamsOptionsFitPad ImageV1VariantNewParamsOptionsFit = "pad" ) // What EXIF data should be preserved in the output image. -type ImageV1VariantUpdateParamsOptionsMetadata string +type ImageV1VariantNewParamsOptionsMetadata string const ( - ImageV1VariantUpdateParamsOptionsMetadataKeep ImageV1VariantUpdateParamsOptionsMetadata = "keep" - ImageV1VariantUpdateParamsOptionsMetadataCopyright ImageV1VariantUpdateParamsOptionsMetadata = "copyright" - ImageV1VariantUpdateParamsOptionsMetadataNone ImageV1VariantUpdateParamsOptionsMetadata = "none" + ImageV1VariantNewParamsOptionsMetadataKeep ImageV1VariantNewParamsOptionsMetadata = "keep" + ImageV1VariantNewParamsOptionsMetadataCopyright ImageV1VariantNewParamsOptionsMetadata = "copyright" + ImageV1VariantNewParamsOptionsMetadataNone ImageV1VariantNewParamsOptionsMetadata = "none" ) -type ImageV1VariantUpdateResponseEnvelope struct { - Errors []ImageV1VariantUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1VariantUpdateResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1VariantUpdateResponse `json:"result,required"` +type ImageV1VariantNewResponseEnvelope struct { + Errors []ImageV1VariantNewResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1VariantNewResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1VariantNewResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1VariantUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1VariantUpdateResponseEnvelopeJSON `json:"-"` + Success ImageV1VariantNewResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1VariantNewResponseEnvelopeJSON `json:"-"` } -// imageV1VariantUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [ImageV1VariantUpdateResponseEnvelope] -type imageV1VariantUpdateResponseEnvelopeJSON struct { +// imageV1VariantNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [ImageV1VariantNewResponseEnvelope] +type imageV1VariantNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -574,67 +568,117 @@ type imageV1VariantUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantUpdateResponseEnvelopeErrorsJSON `json:"-"` +type ImageV1VariantNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantNewResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1VariantUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [ImageV1VariantUpdateResponseEnvelopeErrors] -type imageV1VariantUpdateResponseEnvelopeErrorsJSON struct { +// imageV1VariantNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ImageV1VariantNewResponseEnvelopeErrors] +type imageV1VariantNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantUpdateResponseEnvelopeMessagesJSON `json:"-"` +type ImageV1VariantNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantNewResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1VariantUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [ImageV1VariantUpdateResponseEnvelopeMessages] -type imageV1VariantUpdateResponseEnvelopeMessagesJSON struct { +// imageV1VariantNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ImageV1VariantNewResponseEnvelopeMessages] +type imageV1VariantNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1VariantUpdateResponseEnvelopeSuccess bool +type ImageV1VariantNewResponseEnvelopeSuccess bool const ( - ImageV1VariantUpdateResponseEnvelopeSuccessTrue ImageV1VariantUpdateResponseEnvelopeSuccess = true + ImageV1VariantNewResponseEnvelopeSuccessTrue ImageV1VariantNewResponseEnvelopeSuccess = true ) -type ImageV1VariantDeleteResponseEnvelope struct { - Errors []ImageV1VariantDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1VariantDeleteResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1VariantDeleteResponse `json:"result,required"` +type ImageV1VariantUpdateParams struct { + // Allows you to define image resizing sizes for different use cases. + Options param.Field[ImageV1VariantUpdateParamsOptions] `json:"options,required"` + // Indicates whether the variant can access an image without a signature, + // regardless of image access control. + NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"` +} + +func (r ImageV1VariantUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Allows you to define image resizing sizes for different use cases. +type ImageV1VariantUpdateParamsOptions struct { + // The fit property describes how the width and height dimensions should be + // interpreted. + Fit param.Field[ImageV1VariantUpdateParamsOptionsFit] `json:"fit,required"` + // Maximum height in image pixels. + Height param.Field[float64] `json:"height,required"` + // What EXIF data should be preserved in the output image. + Metadata param.Field[ImageV1VariantUpdateParamsOptionsMetadata] `json:"metadata,required"` + // Maximum width in image pixels. + Width param.Field[float64] `json:"width,required"` +} + +func (r ImageV1VariantUpdateParamsOptions) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The fit property describes how the width and height dimensions should be +// interpreted. +type ImageV1VariantUpdateParamsOptionsFit string + +const ( + ImageV1VariantUpdateParamsOptionsFitScaleDown ImageV1VariantUpdateParamsOptionsFit = "scale-down" + ImageV1VariantUpdateParamsOptionsFitContain ImageV1VariantUpdateParamsOptionsFit = "contain" + ImageV1VariantUpdateParamsOptionsFitCover ImageV1VariantUpdateParamsOptionsFit = "cover" + ImageV1VariantUpdateParamsOptionsFitCrop ImageV1VariantUpdateParamsOptionsFit = "crop" + ImageV1VariantUpdateParamsOptionsFitPad ImageV1VariantUpdateParamsOptionsFit = "pad" +) + +// What EXIF data should be preserved in the output image. +type ImageV1VariantUpdateParamsOptionsMetadata string + +const ( + ImageV1VariantUpdateParamsOptionsMetadataKeep ImageV1VariantUpdateParamsOptionsMetadata = "keep" + ImageV1VariantUpdateParamsOptionsMetadataCopyright ImageV1VariantUpdateParamsOptionsMetadata = "copyright" + ImageV1VariantUpdateParamsOptionsMetadataNone ImageV1VariantUpdateParamsOptionsMetadata = "none" +) + +type ImageV1VariantUpdateResponseEnvelope struct { + Errors []ImageV1VariantUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1VariantUpdateResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1VariantUpdateResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1VariantDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1VariantDeleteResponseEnvelopeJSON `json:"-"` + Success ImageV1VariantUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1VariantUpdateResponseEnvelopeJSON `json:"-"` } -// imageV1VariantDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [ImageV1VariantDeleteResponseEnvelope] -type imageV1VariantDeleteResponseEnvelopeJSON struct { +// imageV1VariantUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [ImageV1VariantUpdateResponseEnvelope] +type imageV1VariantUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -643,119 +687,67 @@ type imageV1VariantDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantDeleteResponseEnvelopeErrors struct { +type ImageV1VariantUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON imageV1VariantDeleteResponseEnvelopeErrorsJSON `json:"-"` + JSON imageV1VariantUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1VariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [ImageV1VariantDeleteResponseEnvelopeErrors] -type imageV1VariantDeleteResponseEnvelopeErrorsJSON struct { +// imageV1VariantUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ImageV1VariantUpdateResponseEnvelopeErrors] +type imageV1VariantUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantDeleteResponseEnvelopeMessages struct { +type ImageV1VariantUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON imageV1VariantDeleteResponseEnvelopeMessagesJSON `json:"-"` + JSON imageV1VariantUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1VariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [ImageV1VariantDeleteResponseEnvelopeMessages] -type imageV1VariantDeleteResponseEnvelopeMessagesJSON struct { +// imageV1VariantUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ImageV1VariantUpdateResponseEnvelopeMessages] +type imageV1VariantUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1VariantDeleteResponseEnvelopeSuccess bool - -const ( - ImageV1VariantDeleteResponseEnvelopeSuccessTrue ImageV1VariantDeleteResponseEnvelopeSuccess = true -) - -type ImageV1VariantCloudflareImagesVariantsNewAVariantParams struct { - ID param.Field[interface{}] `json:"id,required"` - // Allows you to define image resizing sizes for different use cases. - Options param.Field[ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptions] `json:"options,required"` - // Indicates whether the variant can access an image without a signature, - // regardless of image access control. - NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"` -} - -func (r ImageV1VariantCloudflareImagesVariantsNewAVariantParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Allows you to define image resizing sizes for different use cases. -type ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptions struct { - // The fit property describes how the width and height dimensions should be - // interpreted. - Fit param.Field[ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit] `json:"fit,required"` - // Maximum height in image pixels. - Height param.Field[float64] `json:"height,required"` - // What EXIF data should be preserved in the output image. - Metadata param.Field[ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadata] `json:"metadata,required"` - // Maximum width in image pixels. - Width param.Field[float64] `json:"width,required"` -} - -func (r ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptions) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The fit property describes how the width and height dimensions should be -// interpreted. -type ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit string - -const ( - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitScaleDown ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit = "scale-down" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitContain ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit = "contain" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitCover ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit = "cover" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitCrop ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit = "crop" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitPad ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFit = "pad" -) - -// What EXIF data should be preserved in the output image. -type ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadata string +type ImageV1VariantUpdateResponseEnvelopeSuccess bool const ( - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadataKeep ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadata = "keep" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadataCopyright ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadata = "copyright" - ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadataNone ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadata = "none" + ImageV1VariantUpdateResponseEnvelopeSuccessTrue ImageV1VariantUpdateResponseEnvelopeSuccess = true ) -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelope struct { - Errors []ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1VariantCloudflareImagesVariantsNewAVariantResponse `json:"result,required"` +type ImageV1VariantListResponseEnvelope struct { + Errors []ImageV1VariantListResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1VariantListResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1VariantListResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeJSON `json:"-"` + Success ImageV1VariantListResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1VariantListResponseEnvelopeJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelope] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeJSON struct { +// imageV1VariantListResponseEnvelopeJSON contains the JSON metadata for the struct +// [ImageV1VariantListResponseEnvelope] +type imageV1VariantListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -764,70 +756,67 @@ type imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrorsJSON `json:"-"` +type ImageV1VariantListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantListResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrors] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrorsJSON struct { +// imageV1VariantListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ImageV1VariantListResponseEnvelopeErrors] +type imageV1VariantListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessagesJSON `json:"-"` +type ImageV1VariantListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantListResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessages] -type imageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessagesJSON struct { +// imageV1VariantListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ImageV1VariantListResponseEnvelopeMessages] +type imageV1VariantListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeSuccess bool +type ImageV1VariantListResponseEnvelopeSuccess bool const ( - ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeSuccessTrue ImageV1VariantCloudflareImagesVariantsNewAVariantResponseEnvelopeSuccess = true + ImageV1VariantListResponseEnvelopeSuccessTrue ImageV1VariantListResponseEnvelopeSuccess = true ) -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelope struct { - Errors []ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessages `json:"messages,required"` - Result ImageV1VariantCloudflareImagesVariantsListVariantsResponse `json:"result,required"` +type ImageV1VariantDeleteResponseEnvelope struct { + Errors []ImageV1VariantDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV1VariantDeleteResponseEnvelopeMessages `json:"messages,required"` + Result ImageV1VariantDeleteResponse `json:"result,required"` // Whether the API call was successful - Success ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeSuccess `json:"success,required"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeJSON `json:"-"` + Success ImageV1VariantDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON imageV1VariantDeleteResponseEnvelopeJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelope] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeJSON struct { +// imageV1VariantDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [ImageV1VariantDeleteResponseEnvelope] +type imageV1VariantDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -836,55 +825,53 @@ type imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeJSON stru ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrorsJSON `json:"-"` +type ImageV1VariantDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrors] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrorsJSON struct { +// imageV1VariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ImageV1VariantDeleteResponseEnvelopeErrors] +type imageV1VariantDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessagesJSON `json:"-"` +type ImageV1VariantDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV1VariantDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessages] -type imageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessagesJSON struct { +// imageV1VariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ImageV1VariantDeleteResponseEnvelopeMessages] +type imageV1VariantDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeSuccess bool +type ImageV1VariantDeleteResponseEnvelopeSuccess bool const ( - ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeSuccessTrue ImageV1VariantCloudflareImagesVariantsListVariantsResponseEnvelopeSuccess = true + ImageV1VariantDeleteResponseEnvelopeSuccessTrue ImageV1VariantDeleteResponseEnvelopeSuccess = true ) type ImageV1VariantGetResponseEnvelope struct { diff --git a/imagev1variant_test.go b/imagev1variant_test.go index 8f5481b6dd8..b83aef8c2f8 100644 --- a/imagev1variant_test.go +++ b/imagev1variant_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV1VariantUpdateWithOptionalParams(t *testing.T) { +func TestImageV1VariantNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,15 @@ func TestImageV1VariantUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Variants.Update( + _, err := client.Images.V1s.Variants.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "hero", - cloudflare.ImageV1VariantUpdateParams{ - Options: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptions{ - Fit: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptionsFitScaleDown), + cloudflare.ImageV1VariantNewParams{ + ID: cloudflare.F[any]("hero"), + Options: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptions{ + Fit: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptionsFitScaleDown), Height: cloudflare.F(768.000000), - Metadata: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptionsMetadataNone), + Metadata: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptionsMetadataNone), Width: cloudflare.F(1366.000000), }), NeverRequireSignedURLs: cloudflare.F(true), @@ -52,7 +52,7 @@ func TestImageV1VariantUpdateWithOptionalParams(t *testing.T) { } } -func TestImageV1VariantDelete(t *testing.T) { +func TestImageV1VariantUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -68,10 +68,19 @@ func TestImageV1VariantDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Variants.Delete( + _, err := client.Images.V1s.Variants.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "hero", + cloudflare.ImageV1VariantUpdateParams{ + Options: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptions{ + Fit: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptionsFitScaleDown), + Height: cloudflare.F(768.000000), + Metadata: cloudflare.F(cloudflare.ImageV1VariantUpdateParamsOptionsMetadataNone), + Width: cloudflare.F(1366.000000), + }), + NeverRequireSignedURLs: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error @@ -82,7 +91,7 @@ func TestImageV1VariantDelete(t *testing.T) { } } -func TestImageV1VariantCloudflareImagesVariantsNewAVariantWithOptionalParams(t *testing.T) { +func TestImageV1VariantList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -98,20 +107,7 @@ func TestImageV1VariantCloudflareImagesVariantsNewAVariantWithOptionalParams(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Variants.CloudflareImagesVariantsNewAVariant( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantParams{ - ID: cloudflare.F[any]("hero"), - Options: cloudflare.F(cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptions{ - Fit: cloudflare.F(cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsFitScaleDown), - Height: cloudflare.F(768.000000), - Metadata: cloudflare.F(cloudflare.ImageV1VariantCloudflareImagesVariantsNewAVariantParamsOptionsMetadataNone), - Width: cloudflare.F(1366.000000), - }), - NeverRequireSignedURLs: cloudflare.F(true), - }, - ) + _, err := client.Images.V1s.Variants.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -121,7 +117,7 @@ func TestImageV1VariantCloudflareImagesVariantsNewAVariantWithOptionalParams(t * } } -func TestImageV1VariantCloudflareImagesVariantsListVariants(t *testing.T) { +func TestImageV1VariantDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -137,7 +133,11 @@ func TestImageV1VariantCloudflareImagesVariantsListVariants(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V1s.Variants.CloudflareImagesVariantsListVariants(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Images.V1s.Variants.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "hero", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/imagev2directupload.go b/imagev2directupload.go index 7f25d46f0cc..307ae385939 100644 --- a/imagev2directupload.go +++ b/imagev2directupload.go @@ -39,9 +39,9 @@ func NewImageV2DirectUploadService(opts ...option.RequestOption) (r *ImageV2Dire // image itself has been uploaded, send an image details request // (accounts/:account_identifier/images/v1/:identifier), and check that the // `draft: true` property is not present. -func (r *ImageV2DirectUploadService) CloudflareImagesNewAuthenticatedDirectUploadURLV2(ctx context.Context, accountID string, body ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params, opts ...option.RequestOption) (res *ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response, err error) { +func (r *ImageV2DirectUploadService) New(ctx context.Context, accountID string, body ImageV2DirectUploadNewParams, opts ...option.RequestOption) (res *ImageV2DirectUploadNewResponse, err error) { opts = append(r.Options[:], opts...) - var env ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelope + var env ImageV2DirectUploadNewResponseEnvelope path := fmt.Sprintf("accounts/%s/images/v2/direct_upload", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -51,30 +51,29 @@ func (r *ImageV2DirectUploadService) CloudflareImagesNewAuthenticatedDirectUploa return } -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response struct { +type ImageV2DirectUploadNewResponse struct { // Image unique identifier. ID string `json:"id"` // The URL the unauthenticated upload can be performed to using a single HTTP POST // (multipart/form-data) request. - UploadURL string `json:"uploadURL"` - JSON imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseJSON `json:"-"` + UploadURL string `json:"uploadURL"` + JSON imageV2DirectUploadNewResponseJSON `json:"-"` } -// imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseJSON -// contains the JSON metadata for the struct -// [ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response] -type imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseJSON struct { +// imageV2DirectUploadNewResponseJSON contains the JSON metadata for the struct +// [ImageV2DirectUploadNewResponse] +type imageV2DirectUploadNewResponseJSON struct { ID apijson.Field UploadURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV2DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params struct { +type ImageV2DirectUploadNewParams struct { // The date after which the upload will not be accepted. Minimum: Now + 2 minutes. // Maximum: Now + 6 hours. Expiry param.Field[time.Time] `json:"expiry" format:"date-time"` @@ -85,23 +84,22 @@ type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` } -func (r ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params) MarshalJSON() (data []byte, err error) { +func (r ImageV2DirectUploadNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelope struct { - Errors []ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrors `json:"errors,required"` - Messages []ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessages `json:"messages,required"` - Result ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Response `json:"result,required"` +type ImageV2DirectUploadNewResponseEnvelope struct { + Errors []ImageV2DirectUploadNewResponseEnvelopeErrors `json:"errors,required"` + Messages []ImageV2DirectUploadNewResponseEnvelopeMessages `json:"messages,required"` + Result ImageV2DirectUploadNewResponse `json:"result,required"` // Whether the API call was successful - Success ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeSuccess `json:"success,required"` - JSON imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeJSON `json:"-"` + Success ImageV2DirectUploadNewResponseEnvelopeSuccess `json:"success,required"` + JSON imageV2DirectUploadNewResponseEnvelopeJSON `json:"-"` } -// imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelope] -type imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeJSON struct { +// imageV2DirectUploadNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [ImageV2DirectUploadNewResponseEnvelope] +type imageV2DirectUploadNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -110,53 +108,51 @@ type imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2Respons ExtraFields map[string]apijson.Field } -func (r *ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV2DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrorsJSON `json:"-"` +type ImageV2DirectUploadNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV2DirectUploadNewResponseEnvelopeErrorsJSON `json:"-"` } -// imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrors] -type imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrorsJSON struct { +// imageV2DirectUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [ImageV2DirectUploadNewResponseEnvelopeErrors] +type imageV2DirectUploadNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV2DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessagesJSON `json:"-"` +type ImageV2DirectUploadNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON imageV2DirectUploadNewResponseEnvelopeMessagesJSON `json:"-"` } -// imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessages] -type imageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessagesJSON struct { +// imageV2DirectUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [ImageV2DirectUploadNewResponseEnvelopeMessages] +type imageV2DirectUploadNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ImageV2DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeSuccess bool +type ImageV2DirectUploadNewResponseEnvelopeSuccess bool const ( - ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeSuccessTrue ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadUrlv2ResponseEnvelopeSuccess = true + ImageV2DirectUploadNewResponseEnvelopeSuccessTrue ImageV2DirectUploadNewResponseEnvelopeSuccess = true ) diff --git a/imagev2directupload_test.go b/imagev2directupload_test.go index 8bd29c10255..04492c8dcf8 100644 --- a/imagev2directupload_test.go +++ b/imagev2directupload_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2WithOptionalParams(t *testing.T) { +func TestImageV2DirectUploadNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,10 +30,10 @@ func TestImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Wit option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Images.V2s.DirectUploads.CloudflareImagesNewAuthenticatedDirectUploadURLV2( + _, err := client.Images.V2s.DirectUploads.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ImageV2DirectUploadCloudflareImagesNewAuthenticatedDirectUploadURLV2Params{ + cloudflare.ImageV2DirectUploadNewParams{ Expiry: cloudflare.F(time.Now()), Metadata: cloudflare.F[any](map[string]interface{}{}), RequireSignedURLs: cloudflare.F(true), diff --git a/intel.go b/intel.go index d721220f455..4d66bcf95d7 100644 --- a/intel.go +++ b/intel.go @@ -20,6 +20,8 @@ type IntelService struct { IPLists *IntelIPListService Miscategorizations *IntelMiscategorizationService Whois *IntelWhoisService + IndicatorFeeds *IntelIndicatorFeedService + Sinkholes *IntelSinkholeService } // NewIntelService generates a new service that applies the given options to each @@ -36,5 +38,7 @@ func NewIntelService(opts ...option.RequestOption) (r *IntelService) { r.IPLists = NewIntelIPListService(opts...) r.Miscategorizations = NewIntelMiscategorizationService(opts...) r.Whois = NewIntelWhoisService(opts...) + r.IndicatorFeeds = NewIntelIndicatorFeedService(opts...) + r.Sinkholes = NewIntelSinkholeService(opts...) return } diff --git a/intelasn_test.go b/intelasn_test.go index e1180f23278..0d8f7318002 100644 --- a/intelasn_test.go +++ b/intelasn_test.go @@ -29,7 +29,7 @@ func TestIntelAsnGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Asn.Get( + _, err := client.Intel.Asn.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", int64(0), diff --git a/intelasnsubnet_test.go b/intelasnsubnet_test.go index 1a7a0e0aa84..0b834dee255 100644 --- a/intelasnsubnet_test.go +++ b/intelasnsubnet_test.go @@ -29,7 +29,7 @@ func TestIntelAsnSubnetList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Asn.Subnets.List( + _, err := client.Intel.Asn.Subnets.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", int64(0), diff --git a/inteldns.go b/inteldns.go index 58b67c87775..6885576652d 100644 --- a/inteldns.go +++ b/inteldns.go @@ -34,9 +34,9 @@ func NewIntelDNSService(opts ...option.RequestOption) (r *IntelDNSService) { } // Get Passive DNS by IP -func (r *IntelDNSService) PassiveDNSByIPGetPassiveDNSByIP(ctx context.Context, accountID string, query IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams, opts ...option.RequestOption) (res *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse, err error) { +func (r *IntelDNSService) Get(ctx context.Context, accountID string, query IntelDNSGetParams, opts ...option.RequestOption) (res *IntelDNSGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelope + var env IntelDNSGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/dns", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,7 +46,7 @@ func (r *IntelDNSService) PassiveDNSByIPGetPassiveDNSByIP(ctx context.Context, a return } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse struct { +type IntelDNSGetResponse struct { // Total results returned based on your search parameters. Count float64 `json:"count"` // Current page within paginated list of results. @@ -54,13 +54,13 @@ type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse struct { // Number of results per page of results. PerPage float64 `json:"per_page"` // Reverse DNS look-ups observed during the time period. - ReverseRecords []IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecord `json:"reverse_records"` - JSON intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseJSON `json:"-"` + ReverseRecords []IntelDNSGetResponseReverseRecord `json:"reverse_records"` + JSON intelDNSGetResponseJSON `json:"-"` } -// intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseJSON contains the JSON metadata -// for the struct [IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse] -type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseJSON struct { +// intelDNSGetResponseJSON contains the JSON metadata for the struct +// [IntelDNSGetResponse] +type intelDNSGetResponseJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -69,24 +69,23 @@ type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDNSGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecord struct { +type IntelDNSGetResponseReverseRecord struct { // First seen date of the DNS record during the time period. FirstSeen time.Time `json:"first_seen" format:"date"` // Hostname that the IP was observed resolving to. Hostname interface{} `json:"hostname"` // Last seen date of the DNS record during the time period. - LastSeen time.Time `json:"last_seen" format:"date"` - JSON intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecordJSON `json:"-"` + LastSeen time.Time `json:"last_seen" format:"date"` + JSON intelDNSGetResponseReverseRecordJSON `json:"-"` } -// intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecordJSON contains the -// JSON metadata for the struct -// [IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecord] -type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecordJSON struct { +// intelDNSGetResponseReverseRecordJSON contains the JSON metadata for the struct +// [IntelDNSGetResponseReverseRecord] +type intelDNSGetResponseReverseRecordJSON struct { FirstSeen apijson.Field Hostname apijson.Field LastSeen apijson.Field @@ -94,58 +93,55 @@ type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecordJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseReverseRecord) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDNSGetResponseReverseRecord) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams struct { +type IntelDNSGetParams struct { IPV4 param.Field[string] `query:"ipv4"` // Requested page within paginated list of results. Page param.Field[float64] `query:"page"` // Maximum number of results requested. - PerPage param.Field[float64] `query:"per_page"` - StartEndParams param.Field[IntelDNSPassiveDNSByIPGetPassiveDNSByIPParamsStartEndParams] `query:"start_end_params"` + PerPage param.Field[float64] `query:"per_page"` + StartEndParams param.Field[IntelDNSGetParamsStartEndParams] `query:"start_end_params"` } -// URLQuery serializes [IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams]'s query -// parameters as `url.Values`. -func (r IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelDNSGetParams]'s query parameters as `url.Values`. +func (r IntelDNSGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPParamsStartEndParams struct { +type IntelDNSGetParamsStartEndParams struct { // Defaults to the current date. End param.Field[time.Time] `query:"end" format:"date"` // Defaults to 30 days before the end parameter value. Start param.Field[time.Time] `query:"start" format:"date"` } -// URLQuery serializes -// [IntelDNSPassiveDNSByIPGetPassiveDNSByIPParamsStartEndParams]'s query parameters -// as `url.Values`. -func (r IntelDNSPassiveDNSByIPGetPassiveDNSByIPParamsStartEndParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelDNSGetParamsStartEndParams]'s query parameters as +// `url.Values`. +func (r IntelDNSGetParamsStartEndParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelope struct { - Errors []IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessages `json:"messages,required"` - Result IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponse `json:"result,required"` +type IntelDNSGetResponseEnvelope struct { + Errors []IntelDNSGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelDNSGetResponseEnvelopeMessages `json:"messages,required"` + Result IntelDNSGetResponse `json:"result,required"` // Whether the API call was successful - Success IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeSuccess `json:"success,required"` - JSON intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeJSON `json:"-"` + Success IntelDNSGetResponseEnvelopeSuccess `json:"success,required"` + JSON intelDNSGetResponseEnvelopeJSON `json:"-"` } -// intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelope] -type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeJSON struct { +// intelDNSGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelDNSGetResponseEnvelope] +type intelDNSGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -154,53 +150,51 @@ type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrorsJSON `json:"-"` +type IntelDNSGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDNSGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrors] -type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrorsJSON struct { +// intelDNSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [IntelDNSGetResponseEnvelopeErrors] +type intelDNSGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessagesJSON `json:"-"` +type IntelDNSGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDNSGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessages] -type intelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessagesJSON struct { +// intelDNSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [IntelDNSGetResponseEnvelopeMessages] +type intelDNSGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeSuccess bool +type IntelDNSGetResponseEnvelopeSuccess bool const ( - IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeSuccessTrue IntelDNSPassiveDNSByIPGetPassiveDNSByIPResponseEnvelopeSuccess = true + IntelDNSGetResponseEnvelopeSuccessTrue IntelDNSGetResponseEnvelopeSuccess = true ) diff --git a/inteldns_test.go b/inteldns_test.go index 5d3b6dcc8d3..eae5b1f8a85 100644 --- a/inteldns_test.go +++ b/inteldns_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelDNSPassiveDNSByIPGetPassiveDNSByIPWithOptionalParams(t *testing.T) { +func TestIntelDNSGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,14 +30,14 @@ func TestIntelDNSPassiveDNSByIPGetPassiveDNSByIPWithOptionalParams(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.DNS.PassiveDNSByIPGetPassiveDNSByIP( + _, err := client.Intel.DNS.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelDNSPassiveDNSByIPGetPassiveDNSByIPParams{ + cloudflare.IntelDNSGetParams{ IPV4: cloudflare.F("string"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(20.000000), - StartEndParams: cloudflare.F(cloudflare.IntelDNSPassiveDNSByIPGetPassiveDNSByIPParamsStartEndParams{ + StartEndParams: cloudflare.F(cloudflare.IntelDNSGetParamsStartEndParams{ End: cloudflare.F(time.Now()), Start: cloudflare.F(time.Now()), }), diff --git a/inteldomain.go b/inteldomain.go index af489b18a37..9b2e5bb5e64 100644 --- a/inteldomain.go +++ b/inteldomain.go @@ -36,9 +36,9 @@ func NewIntelDomainService(opts ...option.RequestOption) (r *IntelDomainService) } // Get Domain Details -func (r *IntelDomainService) DomainIntelligenceGetDomainDetails(ctx context.Context, accountID string, query IntelDomainDomainIntelligenceGetDomainDetailsParams, opts ...option.RequestOption) (res *IntelDomainDomainIntelligenceGetDomainDetailsResponse, err error) { +func (r *IntelDomainService) Get(ctx context.Context, accountID string, query IntelDomainGetParams, opts ...option.RequestOption) (res *IntelDomainGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelope + var env IntelDomainGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/domain", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -48,35 +48,35 @@ func (r *IntelDomainService) DomainIntelligenceGetDomainDetails(ctx context.Cont return } -type IntelDomainDomainIntelligenceGetDomainDetailsResponse struct { +type IntelDomainGetResponse struct { // Additional information related to the host name. - AdditionalInformation IntelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformation `json:"additional_information"` + AdditionalInformation IntelDomainGetResponseAdditionalInformation `json:"additional_information"` // Application that the hostname belongs to. - Application IntelDomainDomainIntelligenceGetDomainDetailsResponseApplication `json:"application"` + Application IntelDomainGetResponseApplication `json:"application"` // Current content categories. - ContentCategories interface{} `json:"content_categories"` - Domain string `json:"domain"` - InheritedContentCategories []IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategory `json:"inherited_content_categories"` + ContentCategories interface{} `json:"content_categories"` + Domain string `json:"domain"` + InheritedContentCategories []IntelDomainGetResponseInheritedContentCategory `json:"inherited_content_categories"` // Domain from which `inherited_content_categories` and `inherited_risk_types` are // inherited, if applicable. - InheritedFrom string `json:"inherited_from"` - InheritedRiskTypes []IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskType `json:"inherited_risk_types"` + InheritedFrom string `json:"inherited_from"` + InheritedRiskTypes []IntelDomainGetResponseInheritedRiskType `json:"inherited_risk_types"` // Global Cloudflare 100k ranking for the last 30 days, if available for the // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000. PopularityRank int64 `json:"popularity_rank"` // Specifies a list of references to one or more IP addresses or domain names that // the domain name currently resolves to. - ResolvesToRefs []IntelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRef `json:"resolves_to_refs"` + ResolvesToRefs []IntelDomainGetResponseResolvesToRef `json:"resolves_to_refs"` // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest // risk). - RiskScore float64 `json:"risk_score"` - RiskTypes interface{} `json:"risk_types"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseJSON `json:"-"` + RiskScore float64 `json:"risk_score"` + RiskTypes interface{} `json:"risk_types"` + JSON intelDomainGetResponseJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseJSON contains the JSON -// metadata for the struct [IntelDomainDomainIntelligenceGetDomainDetailsResponse] -type intelDomainDomainIntelligenceGetDomainDetailsResponseJSON struct { +// intelDomainGetResponseJSON contains the JSON metadata for the struct +// [IntelDomainGetResponse] +type intelDomainGetResponseJSON struct { AdditionalInformation apijson.Field Application apijson.Field ContentCategories apijson.Field @@ -92,62 +92,59 @@ type intelDomainDomainIntelligenceGetDomainDetailsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Additional information related to the host name. -type IntelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformation struct { +type IntelDomainGetResponseAdditionalInformation struct { // Suspected DGA malware family. - SuspectedMalwareFamily string `json:"suspected_malware_family"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformationJSON `json:"-"` + SuspectedMalwareFamily string `json:"suspected_malware_family"` + JSON intelDomainGetResponseAdditionalInformationJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformationJSON -// contains the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformation] -type intelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformationJSON struct { +// intelDomainGetResponseAdditionalInformationJSON contains the JSON metadata for +// the struct [IntelDomainGetResponseAdditionalInformation] +type intelDomainGetResponseAdditionalInformationJSON struct { SuspectedMalwareFamily apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Application that the hostname belongs to. -type IntelDomainDomainIntelligenceGetDomainDetailsResponseApplication struct { - ID int64 `json:"id"` - Name string `json:"name"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseApplicationJSON `json:"-"` +type IntelDomainGetResponseApplication struct { + ID int64 `json:"id"` + Name string `json:"name"` + JSON intelDomainGetResponseApplicationJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseApplicationJSON contains -// the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseApplication] -type intelDomainDomainIntelligenceGetDomainDetailsResponseApplicationJSON struct { +// intelDomainGetResponseApplicationJSON contains the JSON metadata for the struct +// [IntelDomainGetResponseApplication] +type intelDomainGetResponseApplicationJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseApplication) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseApplication) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategory struct { - ID int64 `json:"id"` - Name string `json:"name"` - SuperCategoryID int64 `json:"super_category_id"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategoryJSON `json:"-"` +type IntelDomainGetResponseInheritedContentCategory struct { + ID int64 `json:"id"` + Name string `json:"name"` + SuperCategoryID int64 `json:"super_category_id"` + JSON intelDomainGetResponseInheritedContentCategoryJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategoryJSON -// contains the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategory] -type intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategoryJSON struct { +// intelDomainGetResponseInheritedContentCategoryJSON contains the JSON metadata +// for the struct [IntelDomainGetResponseInheritedContentCategory] +type intelDomainGetResponseInheritedContentCategoryJSON struct { ID apijson.Field Name apijson.Field SuperCategoryID apijson.Field @@ -155,21 +152,20 @@ type intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCatego ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskType struct { - ID int64 `json:"id"` - Name string `json:"name"` - SuperCategoryID int64 `json:"super_category_id"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskTypeJSON `json:"-"` +type IntelDomainGetResponseInheritedRiskType struct { + ID int64 `json:"id"` + Name string `json:"name"` + SuperCategoryID int64 `json:"super_category_id"` + JSON intelDomainGetResponseInheritedRiskTypeJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskTypeJSON -// contains the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskType] -type intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskTypeJSON struct { +// intelDomainGetResponseInheritedRiskTypeJSON contains the JSON metadata for the +// struct [IntelDomainGetResponseInheritedRiskType] +type intelDomainGetResponseInheritedRiskTypeJSON struct { ID apijson.Field Name apijson.Field SuperCategoryID apijson.Field @@ -177,59 +173,56 @@ type intelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskTypeJSON ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRef struct { +type IntelDomainGetResponseResolvesToRef struct { // STIX 2.1 identifier: // https://docs.oasis-open.org/cti/stix/v2.1/cs02/stix-v2.1-cs02.html#_64yvzeku5a5c ID string `json:"id"` // IP address or domain name. - Value string `json:"value"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRefJSON `json:"-"` + Value string `json:"value"` + JSON intelDomainGetResponseResolvesToRefJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRefJSON contains -// the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRef] -type intelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRefJSON struct { +// intelDomainGetResponseResolvesToRefJSON contains the JSON metadata for the +// struct [IntelDomainGetResponseResolvesToRef] +type intelDomainGetResponseResolvesToRefJSON struct { ID apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseResolvesToRef) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseResolvesToRef) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsParams struct { +type IntelDomainGetParams struct { Domain param.Field[string] `query:"domain"` } -// URLQuery serializes [IntelDomainDomainIntelligenceGetDomainDetailsParams]'s -// query parameters as `url.Values`. -func (r IntelDomainDomainIntelligenceGetDomainDetailsParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelDomainGetParams]'s query parameters as `url.Values`. +func (r IntelDomainGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelope struct { - Errors []IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessages `json:"messages,required"` - Result IntelDomainDomainIntelligenceGetDomainDetailsResponse `json:"result,required"` +type IntelDomainGetResponseEnvelope struct { + Errors []IntelDomainGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelDomainGetResponseEnvelopeMessages `json:"messages,required"` + Result IntelDomainGetResponse `json:"result,required"` // Whether the API call was successful - Success IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeJSON `json:"-"` + Success IntelDomainGetResponseEnvelopeSuccess `json:"success,required"` + JSON intelDomainGetResponseEnvelopeJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelope] -type intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeJSON struct { +// intelDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelDomainGetResponseEnvelope] +type intelDomainGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -238,53 +231,51 @@ type intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrorsJSON `json:"-"` +type IntelDomainGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDomainGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrors] -type intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrorsJSON struct { +// intelDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [IntelDomainGetResponseEnvelopeErrors] +type intelDomainGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessagesJSON `json:"-"` +type IntelDomainGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDomainGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessages] -type intelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessagesJSON struct { +// intelDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [IntelDomainGetResponseEnvelopeMessages] +type intelDomainGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeSuccess bool +type IntelDomainGetResponseEnvelopeSuccess bool const ( - IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeSuccessTrue IntelDomainDomainIntelligenceGetDomainDetailsResponseEnvelopeSuccess = true + IntelDomainGetResponseEnvelopeSuccessTrue IntelDomainGetResponseEnvelopeSuccess = true ) diff --git a/inteldomain_test.go b/inteldomain_test.go index f56dd4603d3..16a7d50eb3b 100644 --- a/inteldomain_test.go +++ b/inteldomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelDomainDomainIntelligenceGetDomainDetailsWithOptionalParams(t *testing.T) { +func TestIntelDomainGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestIntelDomainDomainIntelligenceGetDomainDetailsWithOptionalParams(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Domains.DomainIntelligenceGetDomainDetails( + _, err := client.Intel.Domains.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelDomainDomainIntelligenceGetDomainDetailsParams{ + cloudflare.IntelDomainGetParams{ Domain: cloudflare.F("string"), }, ) diff --git a/inteldomainbulk.go b/inteldomainbulk.go index 81c97ab6182..c07b30248f3 100644 --- a/inteldomainbulk.go +++ b/inteldomainbulk.go @@ -34,9 +34,9 @@ func NewIntelDomainBulkService(opts ...option.RequestOption) (r *IntelDomainBulk } // Get Multiple Domain Details -func (r *IntelDomainBulkService) DomainIntelligenceGetMultipleDomainDetails(ctx context.Context, accountID string, query IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams, opts ...option.RequestOption) (res *[]IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse, err error) { +func (r *IntelDomainBulkService) Get(ctx context.Context, accountID string, query IntelDomainBulkGetParams, opts ...option.RequestOption) (res *[]IntelDomainBulkGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelope + var env IntelDomainBulkGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/domain/bulk", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,33 +46,32 @@ func (r *IntelDomainBulkService) DomainIntelligenceGetMultipleDomainDetails(ctx return } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse struct { +type IntelDomainBulkGetResponse struct { // Additional information related to the host name. - AdditionalInformation IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformation `json:"additional_information"` + AdditionalInformation IntelDomainBulkGetResponseAdditionalInformation `json:"additional_information"` // Application that the hostname belongs to. - Application IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplication `json:"application"` + Application IntelDomainBulkGetResponseApplication `json:"application"` // Current content categories. - ContentCategories interface{} `json:"content_categories"` - Domain string `json:"domain"` - InheritedContentCategories []IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategory `json:"inherited_content_categories"` + ContentCategories interface{} `json:"content_categories"` + Domain string `json:"domain"` + InheritedContentCategories []IntelDomainBulkGetResponseInheritedContentCategory `json:"inherited_content_categories"` // Domain from which `inherited_content_categories` and `inherited_risk_types` are // inherited, if applicable. - InheritedFrom string `json:"inherited_from"` - InheritedRiskTypes []IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskType `json:"inherited_risk_types"` + InheritedFrom string `json:"inherited_from"` + InheritedRiskTypes []IntelDomainBulkGetResponseInheritedRiskType `json:"inherited_risk_types"` // Global Cloudflare 100k ranking for the last 30 days, if available for the // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000. PopularityRank int64 `json:"popularity_rank"` // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest // risk). - RiskScore float64 `json:"risk_score"` - RiskTypes interface{} `json:"risk_types"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseJSON `json:"-"` + RiskScore float64 `json:"risk_score"` + RiskTypes interface{} `json:"risk_types"` + JSON intelDomainBulkGetResponseJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseJSON contains -// the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseJSON struct { +// intelDomainBulkGetResponseJSON contains the JSON metadata for the struct +// [IntelDomainBulkGetResponse] +type intelDomainBulkGetResponseJSON struct { AdditionalInformation apijson.Field Application apijson.Field ContentCategories apijson.Field @@ -87,62 +86,59 @@ type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseJSON struc ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Additional information related to the host name. -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformation struct { +type IntelDomainBulkGetResponseAdditionalInformation struct { // Suspected DGA malware family. - SuspectedMalwareFamily string `json:"suspected_malware_family"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformationJSON `json:"-"` + SuspectedMalwareFamily string `json:"suspected_malware_family"` + JSON intelDomainBulkGetResponseAdditionalInformationJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformationJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformation] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformationJSON struct { +// intelDomainBulkGetResponseAdditionalInformationJSON contains the JSON metadata +// for the struct [IntelDomainBulkGetResponseAdditionalInformation] +type intelDomainBulkGetResponseAdditionalInformationJSON struct { SuspectedMalwareFamily apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Application that the hostname belongs to. -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplication struct { - ID int64 `json:"id"` - Name string `json:"name"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplicationJSON `json:"-"` +type IntelDomainBulkGetResponseApplication struct { + ID int64 `json:"id"` + Name string `json:"name"` + JSON intelDomainBulkGetResponseApplicationJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplicationJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplication] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplicationJSON struct { +// intelDomainBulkGetResponseApplicationJSON contains the JSON metadata for the +// struct [IntelDomainBulkGetResponseApplication] +type intelDomainBulkGetResponseApplicationJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseApplication) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseApplication) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategory struct { - ID int64 `json:"id"` - Name string `json:"name"` - SuperCategoryID int64 `json:"super_category_id"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategoryJSON `json:"-"` +type IntelDomainBulkGetResponseInheritedContentCategory struct { + ID int64 `json:"id"` + Name string `json:"name"` + SuperCategoryID int64 `json:"super_category_id"` + JSON intelDomainBulkGetResponseInheritedContentCategoryJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategoryJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategory] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategoryJSON struct { +// intelDomainBulkGetResponseInheritedContentCategoryJSON contains the JSON +// metadata for the struct [IntelDomainBulkGetResponseInheritedContentCategory] +type intelDomainBulkGetResponseInheritedContentCategoryJSON struct { ID apijson.Field Name apijson.Field SuperCategoryID apijson.Field @@ -150,21 +146,20 @@ type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedC ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskType struct { - ID int64 `json:"id"` - Name string `json:"name"` - SuperCategoryID int64 `json:"super_category_id"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskTypeJSON `json:"-"` +type IntelDomainBulkGetResponseInheritedRiskType struct { + ID int64 `json:"id"` + Name string `json:"name"` + SuperCategoryID int64 `json:"super_category_id"` + JSON intelDomainBulkGetResponseInheritedRiskTypeJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskTypeJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskType] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskTypeJSON struct { +// intelDomainBulkGetResponseInheritedRiskTypeJSON contains the JSON metadata for +// the struct [IntelDomainBulkGetResponseInheritedRiskType] +type intelDomainBulkGetResponseInheritedRiskTypeJSON struct { ID apijson.Field Name apijson.Field SuperCategoryID apijson.Field @@ -172,39 +167,37 @@ type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedR ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams struct { +type IntelDomainBulkGetParams struct { // Accepts multiple values, i.e. `?domain=cloudflare.com&domain=example.com`. Domain param.Field[interface{}] `query:"domain"` } -// URLQuery serializes -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams]'s query -// parameters as `url.Values`. -func (r IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelDomainBulkGetParams]'s query parameters as +// `url.Values`. +func (r IntelDomainBulkGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelope struct { - Errors []IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessages `json:"messages,required"` - Result []IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponse `json:"result,required,nullable"` +type IntelDomainBulkGetResponseEnvelope struct { + Errors []IntelDomainBulkGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelDomainBulkGetResponseEnvelopeMessages `json:"messages,required"` + Result []IntelDomainBulkGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfo `json:"result_info"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeJSON `json:"-"` + Success IntelDomainBulkGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo IntelDomainBulkGetResponseEnvelopeResultInfo `json:"result_info"` + JSON intelDomainBulkGetResponseEnvelopeJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelope] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeJSON struct { +// intelDomainBulkGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelDomainBulkGetResponseEnvelope] +type intelDomainBulkGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -214,58 +207,56 @@ type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeJS ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrorsJSON `json:"-"` +type IntelDomainBulkGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDomainBulkGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrors] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrorsJSON struct { +// intelDomainBulkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [IntelDomainBulkGetResponseEnvelopeErrors] +type intelDomainBulkGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessagesJSON `json:"-"` +type IntelDomainBulkGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelDomainBulkGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessages] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessagesJSON struct { +// intelDomainBulkGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [IntelDomainBulkGetResponseEnvelopeMessages] +type intelDomainBulkGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeSuccess bool +type IntelDomainBulkGetResponseEnvelopeSuccess bool const ( - IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeSuccessTrue IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeSuccess = true + IntelDomainBulkGetResponseEnvelopeSuccessTrue IntelDomainBulkGetResponseEnvelopeSuccess = true ) -type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfo struct { +type IntelDomainBulkGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -273,14 +264,13 @@ type IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeRe // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON intelDomainBulkGetResponseEnvelopeResultInfoJSON `json:"-"` } -// intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfo] -type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfoJSON struct { +// intelDomainBulkGetResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [IntelDomainBulkGetResponseEnvelopeResultInfo] +type intelDomainBulkGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -289,6 +279,6 @@ type intelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeRe ExtraFields map[string]apijson.Field } -func (r *IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *IntelDomainBulkGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/inteldomainbulk_test.go b/inteldomainbulk_test.go index ef40bfd7656..9c1d593e347 100644 --- a/inteldomainbulk_test.go +++ b/inteldomainbulk_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsWithOptionalParams(t *testing.T) { +func TestIntelDomainBulkGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestIntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsWithOptionalPa option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Domains.Bulks.DomainIntelligenceGetMultipleDomainDetails( + _, err := client.Intel.Domains.Bulks.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelDomainBulkDomainIntelligenceGetMultipleDomainDetailsParams{ + cloudflare.IntelDomainBulkGetParams{ Domain: cloudflare.F[any](map[string]interface{}{}), }, ) diff --git a/inteldomainhistory_test.go b/inteldomainhistory_test.go index 060f8a928e1..169aaa6ea77 100644 --- a/inteldomainhistory_test.go +++ b/inteldomainhistory_test.go @@ -29,7 +29,7 @@ func TestIntelDomainHistoryListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.DomainHistories.List( + _, err := client.Intel.DomainHistories.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.IntelDomainHistoryListParams{ diff --git a/intelindicatorfeed.go b/intelindicatorfeed.go index a7c28e6d607..4e310fb1301 100644 --- a/intelindicatorfeed.go +++ b/intelindicatorfeed.go @@ -20,7 +20,8 @@ import ( // this service directly, and instead use the [NewIntelIndicatorFeedService] method // instead. type IntelIndicatorFeedService struct { - Options []option.RequestOption + Options []option.RequestOption + Permissions *IntelIndicatorFeedPermissionService } // NewIntelIndicatorFeedService generates a new service that applies the given @@ -29,6 +30,7 @@ type IntelIndicatorFeedService struct { func NewIntelIndicatorFeedService(opts ...option.RequestOption) (r *IntelIndicatorFeedService) { r = &IntelIndicatorFeedService{} r.Options = opts + r.Permissions = NewIntelIndicatorFeedPermissionService(opts...) return } @@ -80,49 +82,10 @@ func (r *IntelIndicatorFeedService) Get(ctx context.Context, accountID string, f return } -// Grant permission to indicator feed -func (r *IntelIndicatorFeedService) PermissionsAdd(ctx context.Context, accountID string, body IntelIndicatorFeedPermissionsAddParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionsAddResponse, err error) { - opts = append(r.Options[:], opts...) - var env IntelIndicatorFeedPermissionsAddResponseEnvelope - path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/add", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Revoke permission to indicator feed -func (r *IntelIndicatorFeedService) PermissionsRemove(ctx context.Context, accountID string, body IntelIndicatorFeedPermissionsRemoveParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionsRemoveResponse, err error) { - opts = append(r.Options[:], opts...) - var env IntelIndicatorFeedPermissionsRemoveResponseEnvelope - path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/remove", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// List indicator feed permissions -func (r *IntelIndicatorFeedService) PermissionsView(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]IntelIndicatorFeedPermissionsViewResponse, err error) { - opts = append(r.Options[:], opts...) - var env IntelIndicatorFeedPermissionsViewResponseEnvelope - path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/view", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Update indicator feed data -func (r *IntelIndicatorFeedService) Snapshot(ctx context.Context, accountID string, feedID int64, body IntelIndicatorFeedSnapshotParams, opts ...option.RequestOption) (res *IntelIndicatorFeedSnapshotResponse, err error) { +func (r *IntelIndicatorFeedService) Replace(ctx context.Context, accountID string, feedID int64, body IntelIndicatorFeedReplaceParams, opts ...option.RequestOption) (res *IntelIndicatorFeedReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelIndicatorFeedSnapshotResponseEnvelope + var env IntelIndicatorFeedReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v/snapshot", accountID, feedID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -237,79 +200,19 @@ const ( IntelIndicatorFeedGetResponseLatestUploadStatusError IntelIndicatorFeedGetResponseLatestUploadStatus = "Error" ) -type IntelIndicatorFeedPermissionsAddResponse struct { - // Whether the update succeeded or not - Success bool `json:"success"` - JSON intelIndicatorFeedPermissionsAddResponseJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsAddResponseJSON contains the JSON metadata for the -// struct [IntelIndicatorFeedPermissionsAddResponse] -type intelIndicatorFeedPermissionsAddResponseJSON struct { - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsAddResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsRemoveResponse struct { - // Whether the update succeeded or not - Success bool `json:"success"` - JSON intelIndicatorFeedPermissionsRemoveResponseJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsRemoveResponseJSON contains the JSON metadata for -// the struct [IntelIndicatorFeedPermissionsRemoveResponse] -type intelIndicatorFeedPermissionsRemoveResponseJSON struct { - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsRemoveResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsViewResponse struct { - // The unique identifier for the indicator feed - ID int64 `json:"id"` - // The description of the example test - Description string `json:"description"` - // The name of the indicator feed - Name string `json:"name"` - JSON intelIndicatorFeedPermissionsViewResponseJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsViewResponseJSON contains the JSON metadata for the -// struct [IntelIndicatorFeedPermissionsViewResponse] -type intelIndicatorFeedPermissionsViewResponseJSON struct { - ID apijson.Field - Description apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsViewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedSnapshotResponse struct { +type IntelIndicatorFeedReplaceResponse struct { // Feed id FileID int64 `json:"file_id"` // Name of the file unified in our system Filename string `json:"filename"` // Current status of upload, should be unified - Status string `json:"status"` - JSON intelIndicatorFeedSnapshotResponseJSON `json:"-"` + Status string `json:"status"` + JSON intelIndicatorFeedReplaceResponseJSON `json:"-"` } -// intelIndicatorFeedSnapshotResponseJSON contains the JSON metadata for the struct -// [IntelIndicatorFeedSnapshotResponse] -type intelIndicatorFeedSnapshotResponseJSON struct { +// intelIndicatorFeedReplaceResponseJSON contains the JSON metadata for the struct +// [IntelIndicatorFeedReplaceResponse] +type intelIndicatorFeedReplaceResponseJSON struct { FileID apijson.Field Filename apijson.Field Status apijson.Field @@ -317,7 +220,7 @@ type intelIndicatorFeedSnapshotResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIndicatorFeedSnapshotResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIndicatorFeedReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -539,261 +442,27 @@ const ( IntelIndicatorFeedGetResponseEnvelopeSuccessTrue IntelIndicatorFeedGetResponseEnvelopeSuccess = true ) -type IntelIndicatorFeedPermissionsAddParams struct { - // The Cloudflare account tag of the account to change permissions on - AccountTag param.Field[string] `json:"account_tag"` - // The ID of the feed to add/remove permissions on - FeedID param.Field[int64] `json:"feed_id"` -} - -func (r IntelIndicatorFeedPermissionsAddParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type IntelIndicatorFeedPermissionsAddResponseEnvelope struct { - Errors []IntelIndicatorFeedPermissionsAddResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIndicatorFeedPermissionsAddResponseEnvelopeMessages `json:"messages,required"` - Result IntelIndicatorFeedPermissionsAddResponse `json:"result,required"` - // Whether the API call was successful - Success IntelIndicatorFeedPermissionsAddResponseEnvelopeSuccess `json:"success,required"` - JSON intelIndicatorFeedPermissionsAddResponseEnvelopeJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsAddResponseEnvelopeJSON contains the JSON metadata -// for the struct [IntelIndicatorFeedPermissionsAddResponseEnvelope] -type intelIndicatorFeedPermissionsAddResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsAddResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsAddResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsAddResponseEnvelopeErrorsJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsAddResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [IntelIndicatorFeedPermissionsAddResponseEnvelopeErrors] -type intelIndicatorFeedPermissionsAddResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsAddResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsAddResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsAddResponseEnvelopeMessagesJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsAddResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [IntelIndicatorFeedPermissionsAddResponseEnvelopeMessages] -type intelIndicatorFeedPermissionsAddResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsAddResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type IntelIndicatorFeedPermissionsAddResponseEnvelopeSuccess bool - -const ( - IntelIndicatorFeedPermissionsAddResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionsAddResponseEnvelopeSuccess = true -) - -type IntelIndicatorFeedPermissionsRemoveParams struct { - // The Cloudflare account tag of the account to change permissions on - AccountTag param.Field[string] `json:"account_tag"` - // The ID of the feed to add/remove permissions on - FeedID param.Field[int64] `json:"feed_id"` -} - -func (r IntelIndicatorFeedPermissionsRemoveParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type IntelIndicatorFeedPermissionsRemoveResponseEnvelope struct { - Errors []IntelIndicatorFeedPermissionsRemoveResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIndicatorFeedPermissionsRemoveResponseEnvelopeMessages `json:"messages,required"` - Result IntelIndicatorFeedPermissionsRemoveResponse `json:"result,required"` - // Whether the API call was successful - Success IntelIndicatorFeedPermissionsRemoveResponseEnvelopeSuccess `json:"success,required"` - JSON intelIndicatorFeedPermissionsRemoveResponseEnvelopeJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsRemoveResponseEnvelopeJSON contains the JSON -// metadata for the struct [IntelIndicatorFeedPermissionsRemoveResponseEnvelope] -type intelIndicatorFeedPermissionsRemoveResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsRemoveResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsRemoveResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsRemoveResponseEnvelopeErrorsJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsRemoveResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [IntelIndicatorFeedPermissionsRemoveResponseEnvelopeErrors] -type intelIndicatorFeedPermissionsRemoveResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsRemoveResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsRemoveResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsRemoveResponseEnvelopeMessagesJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsRemoveResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [IntelIndicatorFeedPermissionsRemoveResponseEnvelopeMessages] -type intelIndicatorFeedPermissionsRemoveResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsRemoveResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type IntelIndicatorFeedPermissionsRemoveResponseEnvelopeSuccess bool - -const ( - IntelIndicatorFeedPermissionsRemoveResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionsRemoveResponseEnvelopeSuccess = true -) - -type IntelIndicatorFeedPermissionsViewResponseEnvelope struct { - Errors []IntelIndicatorFeedPermissionsViewResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIndicatorFeedPermissionsViewResponseEnvelopeMessages `json:"messages,required"` - Result []IntelIndicatorFeedPermissionsViewResponse `json:"result,required"` - // Whether the API call was successful - Success IntelIndicatorFeedPermissionsViewResponseEnvelopeSuccess `json:"success,required"` - JSON intelIndicatorFeedPermissionsViewResponseEnvelopeJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsViewResponseEnvelopeJSON contains the JSON metadata -// for the struct [IntelIndicatorFeedPermissionsViewResponseEnvelope] -type intelIndicatorFeedPermissionsViewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsViewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsViewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsViewResponseEnvelopeErrorsJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsViewResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [IntelIndicatorFeedPermissionsViewResponseEnvelopeErrors] -type intelIndicatorFeedPermissionsViewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsViewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type IntelIndicatorFeedPermissionsViewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedPermissionsViewResponseEnvelopeMessagesJSON `json:"-"` -} - -// intelIndicatorFeedPermissionsViewResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [IntelIndicatorFeedPermissionsViewResponseEnvelopeMessages] -type intelIndicatorFeedPermissionsViewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *IntelIndicatorFeedPermissionsViewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type IntelIndicatorFeedPermissionsViewResponseEnvelopeSuccess bool - -const ( - IntelIndicatorFeedPermissionsViewResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionsViewResponseEnvelopeSuccess = true -) - -type IntelIndicatorFeedSnapshotParams struct { +type IntelIndicatorFeedReplaceParams struct { // The file to upload Source param.Field[string] `json:"source"` } -func (r IntelIndicatorFeedSnapshotParams) MarshalJSON() (data []byte, err error) { +func (r IntelIndicatorFeedReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type IntelIndicatorFeedSnapshotResponseEnvelope struct { - Errors []IntelIndicatorFeedSnapshotResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIndicatorFeedSnapshotResponseEnvelopeMessages `json:"messages,required"` - Result IntelIndicatorFeedSnapshotResponse `json:"result,required"` +type IntelIndicatorFeedReplaceResponseEnvelope struct { + Errors []IntelIndicatorFeedReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIndicatorFeedReplaceResponseEnvelopeMessages `json:"messages,required"` + Result IntelIndicatorFeedReplaceResponse `json:"result,required"` // Whether the API call was successful - Success IntelIndicatorFeedSnapshotResponseEnvelopeSuccess `json:"success,required"` - JSON intelIndicatorFeedSnapshotResponseEnvelopeJSON `json:"-"` + Success IntelIndicatorFeedReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON intelIndicatorFeedReplaceResponseEnvelopeJSON `json:"-"` } -// intelIndicatorFeedSnapshotResponseEnvelopeJSON contains the JSON metadata for -// the struct [IntelIndicatorFeedSnapshotResponseEnvelope] -type intelIndicatorFeedSnapshotResponseEnvelopeJSON struct { +// intelIndicatorFeedReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [IntelIndicatorFeedReplaceResponseEnvelope] +type intelIndicatorFeedReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -802,51 +471,51 @@ type intelIndicatorFeedSnapshotResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIndicatorFeedSnapshotResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIndicatorFeedReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIndicatorFeedSnapshotResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedSnapshotResponseEnvelopeErrorsJSON `json:"-"` +type IntelIndicatorFeedReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// intelIndicatorFeedSnapshotResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [IntelIndicatorFeedSnapshotResponseEnvelopeErrors] -type intelIndicatorFeedSnapshotResponseEnvelopeErrorsJSON struct { +// intelIndicatorFeedReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [IntelIndicatorFeedReplaceResponseEnvelopeErrors] +type intelIndicatorFeedReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIndicatorFeedSnapshotResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIndicatorFeedReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIndicatorFeedSnapshotResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIndicatorFeedSnapshotResponseEnvelopeMessagesJSON `json:"-"` +type IntelIndicatorFeedReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// intelIndicatorFeedSnapshotResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [IntelIndicatorFeedSnapshotResponseEnvelopeMessages] -type intelIndicatorFeedSnapshotResponseEnvelopeMessagesJSON struct { +// intelIndicatorFeedReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [IntelIndicatorFeedReplaceResponseEnvelopeMessages] +type intelIndicatorFeedReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIndicatorFeedSnapshotResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIndicatorFeedReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelIndicatorFeedSnapshotResponseEnvelopeSuccess bool +type IntelIndicatorFeedReplaceResponseEnvelopeSuccess bool const ( - IntelIndicatorFeedSnapshotResponseEnvelopeSuccessTrue IntelIndicatorFeedSnapshotResponseEnvelopeSuccess = true + IntelIndicatorFeedReplaceResponseEnvelopeSuccessTrue IntelIndicatorFeedReplaceResponseEnvelopeSuccess = true ) diff --git a/intelindicatorfeed_test.go b/intelindicatorfeed_test.go index 889f4c67959..54b3bcb416e 100644 --- a/intelindicatorfeed_test.go +++ b/intelindicatorfeed_test.go @@ -132,7 +132,7 @@ func TestIntelIndicatorFeedGet(t *testing.T) { } } -func TestIntelIndicatorFeedPermissionsAddWithOptionalParams(t *testing.T) { +func TestIntelIndicatorFeedReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -148,103 +148,11 @@ func TestIntelIndicatorFeedPermissionsAddWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intel.IndicatorFeeds.PermissionsAdd( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelIndicatorFeedPermissionsAddParams{ - AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"), - FeedID: cloudflare.F(int64(1)), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestIntelIndicatorFeedPermissionsRemoveWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Intel.IndicatorFeeds.PermissionsRemove( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelIndicatorFeedPermissionsRemoveParams{ - AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"), - FeedID: cloudflare.F(int64(1)), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestIntelIndicatorFeedPermissionsView(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Intel.IndicatorFeeds.PermissionsView(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestIntelIndicatorFeedSnapshotWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Intel.IndicatorFeeds.Snapshot( + _, err := client.Intel.IndicatorFeeds.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", int64(12), - cloudflare.IntelIndicatorFeedSnapshotParams{ + cloudflare.IntelIndicatorFeedReplaceParams{ Source: cloudflare.F("@/Users/me/test.stix2"), }, ) diff --git a/intelindicatorfeedpermission.go b/intelindicatorfeedpermission.go new file mode 100644 index 00000000000..cb90e0be5c5 --- /dev/null +++ b/intelindicatorfeedpermission.go @@ -0,0 +1,364 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + + "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/option" +) + +// IntelIndicatorFeedPermissionService contains methods and other services that +// help with interacting with the cloudflare API. Note, unlike clients, this +// service does not read variables from the environment automatically. You should +// not instantiate this service directly, and instead use the +// [NewIntelIndicatorFeedPermissionService] method instead. +type IntelIndicatorFeedPermissionService struct { + Options []option.RequestOption +} + +// NewIntelIndicatorFeedPermissionService generates a new service that applies the +// given options to each request. These options are applied after the parent +// client's options (if there is one), and before any request-specific options. +func NewIntelIndicatorFeedPermissionService(opts ...option.RequestOption) (r *IntelIndicatorFeedPermissionService) { + r = &IntelIndicatorFeedPermissionService{} + r.Options = opts + return +} + +// Grant permission to indicator feed +func (r *IntelIndicatorFeedPermissionService) New(ctx context.Context, accountID string, body IntelIndicatorFeedPermissionNewParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env IntelIndicatorFeedPermissionNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/add", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List indicator feed permissions +func (r *IntelIndicatorFeedPermissionService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]IntelIndicatorFeedPermissionListResponse, err error) { + opts = append(r.Options[:], opts...) + var env IntelIndicatorFeedPermissionListResponseEnvelope + path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/view", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Revoke permission to indicator feed +func (r *IntelIndicatorFeedPermissionService) Delete(ctx context.Context, accountID string, body IntelIndicatorFeedPermissionDeleteParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env IntelIndicatorFeedPermissionDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/remove", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type IntelIndicatorFeedPermissionNewResponse struct { + // Whether the update succeeded or not + Success bool `json:"success"` + JSON intelIndicatorFeedPermissionNewResponseJSON `json:"-"` +} + +// intelIndicatorFeedPermissionNewResponseJSON contains the JSON metadata for the +// struct [IntelIndicatorFeedPermissionNewResponse] +type intelIndicatorFeedPermissionNewResponseJSON struct { + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionListResponse struct { + // The unique identifier for the indicator feed + ID int64 `json:"id"` + // The description of the example test + Description string `json:"description"` + // The name of the indicator feed + Name string `json:"name"` + JSON intelIndicatorFeedPermissionListResponseJSON `json:"-"` +} + +// intelIndicatorFeedPermissionListResponseJSON contains the JSON metadata for the +// struct [IntelIndicatorFeedPermissionListResponse] +type intelIndicatorFeedPermissionListResponseJSON struct { + ID apijson.Field + Description apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionDeleteResponse struct { + // Whether the update succeeded or not + Success bool `json:"success"` + JSON intelIndicatorFeedPermissionDeleteResponseJSON `json:"-"` +} + +// intelIndicatorFeedPermissionDeleteResponseJSON contains the JSON metadata for +// the struct [IntelIndicatorFeedPermissionDeleteResponse] +type intelIndicatorFeedPermissionDeleteResponseJSON struct { + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionNewParams struct { + // The Cloudflare account tag of the account to change permissions on + AccountTag param.Field[string] `json:"account_tag"` + // The ID of the feed to add/remove permissions on + FeedID param.Field[int64] `json:"feed_id"` +} + +func (r IntelIndicatorFeedPermissionNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type IntelIndicatorFeedPermissionNewResponseEnvelope struct { + Errors []IntelIndicatorFeedPermissionNewResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIndicatorFeedPermissionNewResponseEnvelopeMessages `json:"messages,required"` + Result IntelIndicatorFeedPermissionNewResponse `json:"result,required"` + // Whether the API call was successful + Success IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess `json:"success,required"` + JSON intelIndicatorFeedPermissionNewResponseEnvelopeJSON `json:"-"` +} + +// intelIndicatorFeedPermissionNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [IntelIndicatorFeedPermissionNewResponseEnvelope] +type intelIndicatorFeedPermissionNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [IntelIndicatorFeedPermissionNewResponseEnvelopeErrors] +type intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [IntelIndicatorFeedPermissionNewResponseEnvelopeMessages] +type intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess bool + +const ( + IntelIndicatorFeedPermissionNewResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess = true +) + +type IntelIndicatorFeedPermissionListResponseEnvelope struct { + Errors []IntelIndicatorFeedPermissionListResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIndicatorFeedPermissionListResponseEnvelopeMessages `json:"messages,required"` + Result []IntelIndicatorFeedPermissionListResponse `json:"result,required"` + // Whether the API call was successful + Success IntelIndicatorFeedPermissionListResponseEnvelopeSuccess `json:"success,required"` + JSON intelIndicatorFeedPermissionListResponseEnvelopeJSON `json:"-"` +} + +// intelIndicatorFeedPermissionListResponseEnvelopeJSON contains the JSON metadata +// for the struct [IntelIndicatorFeedPermissionListResponseEnvelope] +type intelIndicatorFeedPermissionListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON `json:"-"` +} + +// intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [IntelIndicatorFeedPermissionListResponseEnvelopeErrors] +type intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON `json:"-"` +} + +// intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [IntelIndicatorFeedPermissionListResponseEnvelopeMessages] +type intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type IntelIndicatorFeedPermissionListResponseEnvelopeSuccess bool + +const ( + IntelIndicatorFeedPermissionListResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionListResponseEnvelopeSuccess = true +) + +type IntelIndicatorFeedPermissionDeleteParams struct { + // The Cloudflare account tag of the account to change permissions on + AccountTag param.Field[string] `json:"account_tag"` + // The ID of the feed to add/remove permissions on + FeedID param.Field[int64] `json:"feed_id"` +} + +func (r IntelIndicatorFeedPermissionDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type IntelIndicatorFeedPermissionDeleteResponseEnvelope struct { + Errors []IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages `json:"messages,required"` + Result IntelIndicatorFeedPermissionDeleteResponse `json:"result,required"` + // Whether the API call was successful + Success IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON `json:"-"` +} + +// intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON contains the JSON +// metadata for the struct [IntelIndicatorFeedPermissionDeleteResponseEnvelope] +type intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors] +type intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages] +type intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess bool + +const ( + IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess = true +) diff --git a/cachtieredcachesmarttopologyenable_test.go b/intelindicatorfeedpermission_test.go similarity index 73% rename from cachtieredcachesmarttopologyenable_test.go rename to intelindicatorfeedpermission_test.go index 4f26dd49ee4..19e403fac05 100644 --- a/cachtieredcachesmarttopologyenable_test.go +++ b/intelindicatorfeedpermission_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCachTieredCacheSmartTopologyEnableDelete(t *testing.T) { +func TestIntelIndicatorFeedPermissionNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,14 @@ func TestCachTieredCacheSmartTopologyEnableDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.TieredCacheSmartTopologyEnables.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Intel.IndicatorFeeds.Permissions.New( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.IntelIndicatorFeedPermissionNewParams{ + AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"), + FeedID: cloudflare.F(int64(1)), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +46,7 @@ func TestCachTieredCacheSmartTopologyEnableDelete(t *testing.T) { } } -func TestCachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSetting(t *testing.T) { +func TestIntelIndicatorFeedPermissionList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +62,7 @@ func TestCachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSe option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.TieredCacheSmartTopologyEnables.SmartTieredCacheGetSmartTieredCacheSetting(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Intel.IndicatorFeeds.Permissions.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +72,7 @@ func TestCachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSe } } -func TestCachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSetting(t *testing.T) { +func TestIntelIndicatorFeedPermissionDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,11 +88,12 @@ func TestCachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCache option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.TieredCacheSmartTopologyEnables.SmartTieredCachePatchSmartTieredCacheSetting( + _, err := client.Intel.IndicatorFeeds.Permissions.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParams{ - Value: cloudflare.F(cloudflare.CachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingParamsValueOn), + cloudflare.IntelIndicatorFeedPermissionDeleteParams{ + AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"), + FeedID: cloudflare.F(int64(1)), }, ) if err != nil { diff --git a/intelip.go b/intelip.go index aede7e1a0d0..ee85fec7507 100644 --- a/intelip.go +++ b/intelip.go @@ -36,9 +36,9 @@ func NewIntelIPService(opts ...option.RequestOption) (r *IntelIPService) { } // Get IP Overview -func (r *IntelIPService) IPIntelligenceGetIPOverview(ctx context.Context, accountID string, query IntelIPIPIntelligenceGetIPOverviewParams, opts ...option.RequestOption) (res *[]IntelIpipIntelligenceGetIPOverviewResponse, err error) { +func (r *IntelIPService) Get(ctx context.Context, accountID string, query IntelIPGetParams, opts ...option.RequestOption) (res *[]IntelIPGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelIpipIntelligenceGetIPOverviewResponseEnvelope + var env IntelIPGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/ip", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -48,18 +48,18 @@ func (r *IntelIPService) IPIntelligenceGetIPOverview(ctx context.Context, accoun return } -type IntelIpipIntelligenceGetIPOverviewResponse struct { +type IntelIPGetResponse struct { // Specifies a reference to the autonomous systems (AS) that the IP address belongs // to. - BelongsToRef IntelIpipIntelligenceGetIPOverviewResponseBelongsToRef `json:"belongs_to_ref"` - IP IntelIpipIntelligenceGetIPOverviewResponseIP `json:"ip" format:"ipv4"` - RiskTypes interface{} `json:"risk_types"` - JSON intelIpipIntelligenceGetIPOverviewResponseJSON `json:"-"` + BelongsToRef IntelIPGetResponseBelongsToRef `json:"belongs_to_ref"` + IP IntelIPGetResponseIP `json:"ip" format:"ipv4"` + RiskTypes interface{} `json:"risk_types"` + JSON intelIPGetResponseJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseJSON contains the JSON metadata for -// the struct [IntelIpipIntelligenceGetIPOverviewResponse] -type intelIpipIntelligenceGetIPOverviewResponseJSON struct { +// intelIPGetResponseJSON contains the JSON metadata for the struct +// [IntelIPGetResponse] +type intelIPGetResponseJSON struct { BelongsToRef apijson.Field IP apijson.Field RiskTypes apijson.Field @@ -67,25 +67,25 @@ type intelIpipIntelligenceGetIPOverviewResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies a reference to the autonomous systems (AS) that the IP address belongs // to. -type IntelIpipIntelligenceGetIPOverviewResponseBelongsToRef struct { +type IntelIPGetResponseBelongsToRef struct { ID interface{} `json:"id"` Country string `json:"country"` Description string `json:"description"` // Infrastructure type of this ASN. - Type IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefType `json:"type"` - Value string `json:"value"` - JSON intelIpipIntelligenceGetIPOverviewResponseBelongsToRefJSON `json:"-"` + Type IntelIPGetResponseBelongsToRefType `json:"type"` + Value string `json:"value"` + JSON intelIPGetResponseBelongsToRefJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseBelongsToRefJSON contains the JSON -// metadata for the struct [IntelIpipIntelligenceGetIPOverviewResponseBelongsToRef] -type intelIpipIntelligenceGetIPOverviewResponseBelongsToRefJSON struct { +// intelIPGetResponseBelongsToRefJSON contains the JSON metadata for the struct +// [IntelIPGetResponseBelongsToRef] +type intelIPGetResponseBelongsToRefJSON struct { ID apijson.Field Country apijson.Field Description apijson.Field @@ -95,27 +95,27 @@ type intelIpipIntelligenceGetIPOverviewResponseBelongsToRefJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponseBelongsToRef) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponseBelongsToRef) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Infrastructure type of this ASN. -type IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefType string +type IntelIPGetResponseBelongsToRefType string const ( - IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefTypeHostingProvider IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefType = "hosting_provider" - IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefTypeIsp IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefType = "isp" - IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefTypeOrganization IntelIpipIntelligenceGetIPOverviewResponseBelongsToRefType = "organization" + IntelIPGetResponseBelongsToRefTypeHostingProvider IntelIPGetResponseBelongsToRefType = "hosting_provider" + IntelIPGetResponseBelongsToRefTypeIsp IntelIPGetResponseBelongsToRefType = "isp" + IntelIPGetResponseBelongsToRefTypeOrganization IntelIPGetResponseBelongsToRefType = "organization" ) // Union satisfied by [shared.UnionString] or [shared.UnionString]. -type IntelIpipIntelligenceGetIPOverviewResponseIP interface { - ImplementsIntelIpipIntelligenceGetIPOverviewResponseIP() +type IntelIPGetResponseIP interface { + ImplementsIntelIPGetResponseIP() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*IntelIpipIntelligenceGetIPOverviewResponseIP)(nil)).Elem(), + reflect.TypeOf((*IntelIPGetResponseIP)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -128,33 +128,32 @@ func init() { ) } -type IntelIPIPIntelligenceGetIPOverviewParams struct { +type IntelIPGetParams struct { IPV4 param.Field[string] `query:"ipv4"` IPV6 param.Field[string] `query:"ipv6"` } -// URLQuery serializes [IntelIPIPIntelligenceGetIPOverviewParams]'s query -// parameters as `url.Values`. -func (r IntelIPIPIntelligenceGetIPOverviewParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelIPGetParams]'s query parameters as `url.Values`. +func (r IntelIPGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelIpipIntelligenceGetIPOverviewResponseEnvelope struct { - Errors []IntelIpipIntelligenceGetIPOverviewResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIpipIntelligenceGetIPOverviewResponseEnvelopeMessages `json:"messages,required"` - Result []IntelIpipIntelligenceGetIPOverviewResponse `json:"result,required,nullable"` +type IntelIPGetResponseEnvelope struct { + Errors []IntelIPGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIPGetResponseEnvelopeMessages `json:"messages,required"` + Result []IntelIPGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success IntelIpipIntelligenceGetIPOverviewResponseEnvelopeSuccess `json:"success,required"` - ResultInfo IntelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfo `json:"result_info"` - JSON intelIpipIntelligenceGetIPOverviewResponseEnvelopeJSON `json:"-"` + Success IntelIPGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo IntelIPGetResponseEnvelopeResultInfo `json:"result_info"` + JSON intelIPGetResponseEnvelopeJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseEnvelopeJSON contains the JSON -// metadata for the struct [IntelIpipIntelligenceGetIPOverviewResponseEnvelope] -type intelIpipIntelligenceGetIPOverviewResponseEnvelopeJSON struct { +// intelIPGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelIPGetResponseEnvelope] +type intelIPGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -164,58 +163,56 @@ type intelIpipIntelligenceGetIPOverviewResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIpipIntelligenceGetIPOverviewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIpipIntelligenceGetIPOverviewResponseEnvelopeErrorsJSON `json:"-"` +type IntelIPGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIPGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [IntelIpipIntelligenceGetIPOverviewResponseEnvelopeErrors] -type intelIpipIntelligenceGetIPOverviewResponseEnvelopeErrorsJSON struct { +// intelIPGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [IntelIPGetResponseEnvelopeErrors] +type intelIPGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIpipIntelligenceGetIPOverviewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIpipIntelligenceGetIPOverviewResponseEnvelopeMessagesJSON `json:"-"` +type IntelIPGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIPGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [IntelIpipIntelligenceGetIPOverviewResponseEnvelopeMessages] -type intelIpipIntelligenceGetIPOverviewResponseEnvelopeMessagesJSON struct { +// intelIPGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [IntelIPGetResponseEnvelopeMessages] +type intelIPGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelIpipIntelligenceGetIPOverviewResponseEnvelopeSuccess bool +type IntelIPGetResponseEnvelopeSuccess bool const ( - IntelIpipIntelligenceGetIPOverviewResponseEnvelopeSuccessTrue IntelIpipIntelligenceGetIPOverviewResponseEnvelopeSuccess = true + IntelIPGetResponseEnvelopeSuccessTrue IntelIPGetResponseEnvelopeSuccess = true ) -type IntelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfo struct { +type IntelIPGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -223,14 +220,13 @@ type IntelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON intelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON intelIPGetResponseEnvelopeResultInfoJSON `json:"-"` } -// intelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [IntelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfo] -type intelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfoJSON struct { +// intelIPGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [IntelIPGetResponseEnvelopeResultInfo] +type intelIPGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -239,6 +235,6 @@ type intelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIpipIntelligenceGetIPOverviewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/intelip_test.go b/intelip_test.go index 0420c3d2fcc..13200199798 100644 --- a/intelip_test.go +++ b/intelip_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelIPIPIntelligenceGetIPOverviewWithOptionalParams(t *testing.T) { +func TestIntelIPGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestIntelIPIPIntelligenceGetIPOverviewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.IPs.IPIntelligenceGetIPOverview( + _, err := client.Intel.IPs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelIPIPIntelligenceGetIPOverviewParams{ + cloudflare.IntelIPGetParams{ IPV4: cloudflare.F("string"), IPV6: cloudflare.F("string"), }, diff --git a/inteliplist.go b/inteliplist.go index f900a1cf4b3..c5054ccd882 100644 --- a/inteliplist.go +++ b/inteliplist.go @@ -31,9 +31,9 @@ func NewIntelIPListService(opts ...option.RequestOption) (r *IntelIPListService) } // Get IP Lists -func (r *IntelIPListService) IPListGetIPLists(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]IntelIPListIPListGetIPListsResponse, err error) { +func (r *IntelIPListService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]IntelIPListGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelIPListIPListGetIPListsResponseEnvelope + var env IntelIPListGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/ip-list", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,16 +43,16 @@ func (r *IntelIPListService) IPListGetIPLists(ctx context.Context, accountID str return } -type IntelIPListIPListGetIPListsResponse struct { - ID int64 `json:"id"` - Description string `json:"description"` - Name string `json:"name"` - JSON intelIPListIPListGetIPListsResponseJSON `json:"-"` +type IntelIPListGetResponse struct { + ID int64 `json:"id"` + Description string `json:"description"` + Name string `json:"name"` + JSON intelIPListGetResponseJSON `json:"-"` } -// intelIPListIPListGetIPListsResponseJSON contains the JSON metadata for the -// struct [IntelIPListIPListGetIPListsResponse] -type intelIPListIPListGetIPListsResponseJSON struct { +// intelIPListGetResponseJSON contains the JSON metadata for the struct +// [IntelIPListGetResponse] +type intelIPListGetResponseJSON struct { ID apijson.Field Description apijson.Field Name apijson.Field @@ -60,23 +60,23 @@ type intelIPListIPListGetIPListsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIPListIPListGetIPListsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPListGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIPListIPListGetIPListsResponseEnvelope struct { - Errors []IntelIPListIPListGetIPListsResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelIPListIPListGetIPListsResponseEnvelopeMessages `json:"messages,required"` - Result []IntelIPListIPListGetIPListsResponse `json:"result,required,nullable"` +type IntelIPListGetResponseEnvelope struct { + Errors []IntelIPListGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelIPListGetResponseEnvelopeMessages `json:"messages,required"` + Result []IntelIPListGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success IntelIPListIPListGetIPListsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo IntelIPListIPListGetIPListsResponseEnvelopeResultInfo `json:"result_info"` - JSON intelIPListIPListGetIPListsResponseEnvelopeJSON `json:"-"` + Success IntelIPListGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo IntelIPListGetResponseEnvelopeResultInfo `json:"result_info"` + JSON intelIPListGetResponseEnvelopeJSON `json:"-"` } -// intelIPListIPListGetIPListsResponseEnvelopeJSON contains the JSON metadata for -// the struct [IntelIPListIPListGetIPListsResponseEnvelope] -type intelIPListIPListGetIPListsResponseEnvelopeJSON struct { +// intelIPListGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelIPListGetResponseEnvelope] +type intelIPListGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -86,56 +86,56 @@ type intelIPListIPListGetIPListsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIPListIPListGetIPListsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIPListIPListGetIPListsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIPListIPListGetIPListsResponseEnvelopeErrorsJSON `json:"-"` +type IntelIPListGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIPListGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelIPListIPListGetIPListsResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [IntelIPListIPListGetIPListsResponseEnvelopeErrors] -type intelIPListIPListGetIPListsResponseEnvelopeErrorsJSON struct { +// intelIPListGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [IntelIPListGetResponseEnvelopeErrors] +type intelIPListGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIPListIPListGetIPListsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelIPListIPListGetIPListsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelIPListIPListGetIPListsResponseEnvelopeMessagesJSON `json:"-"` +type IntelIPListGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelIPListGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelIPListIPListGetIPListsResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [IntelIPListIPListGetIPListsResponseEnvelopeMessages] -type intelIPListIPListGetIPListsResponseEnvelopeMessagesJSON struct { +// intelIPListGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [IntelIPListGetResponseEnvelopeMessages] +type intelIPListGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelIPListIPListGetIPListsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelIPListIPListGetIPListsResponseEnvelopeSuccess bool +type IntelIPListGetResponseEnvelopeSuccess bool const ( - IntelIPListIPListGetIPListsResponseEnvelopeSuccessTrue IntelIPListIPListGetIPListsResponseEnvelopeSuccess = true + IntelIPListGetResponseEnvelopeSuccessTrue IntelIPListGetResponseEnvelopeSuccess = true ) -type IntelIPListIPListGetIPListsResponseEnvelopeResultInfo struct { +type IntelIPListGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -143,13 +143,13 @@ type IntelIPListIPListGetIPListsResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON intelIPListIPListGetIPListsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON intelIPListGetResponseEnvelopeResultInfoJSON `json:"-"` } -// intelIPListIPListGetIPListsResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [IntelIPListIPListGetIPListsResponseEnvelopeResultInfo] -type intelIPListIPListGetIPListsResponseEnvelopeResultInfoJSON struct { +// intelIPListGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [IntelIPListGetResponseEnvelopeResultInfo] +type intelIPListGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -158,6 +158,6 @@ type intelIPListIPListGetIPListsResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelIPListIPListGetIPListsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *IntelIPListGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/inteliplist_test.go b/inteliplist_test.go index 9c22a1d931c..ce472773fa3 100644 --- a/inteliplist_test.go +++ b/inteliplist_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelIPListIPListGetIPLists(t *testing.T) { +func TestIntelIPListGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestIntelIPListIPListGetIPLists(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.IPLists.IPListGetIPLists(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Intel.IPLists.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/intelmiscategorization.go b/intelmiscategorization.go index ba842d9f9ac..568b747bdcc 100644 --- a/intelmiscategorization.go +++ b/intelmiscategorization.go @@ -35,9 +35,9 @@ func NewIntelMiscategorizationService(opts ...option.RequestOption) (r *IntelMis } // Create Miscategorization -func (r *IntelMiscategorizationService) MiscategorizationNewMiscategorization(ctx context.Context, accountID string, body IntelMiscategorizationMiscategorizationNewMiscategorizationParams, opts ...option.RequestOption) (res *IntelMiscategorizationMiscategorizationNewMiscategorizationResponse, err error) { +func (r *IntelMiscategorizationService) New(ctx context.Context, accountID string, body IntelMiscategorizationNewParams, opts ...option.RequestOption) (res *IntelMiscategorizationNewResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelope + var env IntelMiscategorizationNewResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/miscategorization", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -47,16 +47,15 @@ func (r *IntelMiscategorizationService) MiscategorizationNewMiscategorization(ct return } -// Union satisfied by -// [IntelMiscategorizationMiscategorizationNewMiscategorizationResponseUnknown] or +// Union satisfied by [IntelMiscategorizationNewResponseUnknown] or // [shared.UnionString]. -type IntelMiscategorizationMiscategorizationNewMiscategorizationResponse interface { - ImplementsIntelMiscategorizationMiscategorizationNewMiscategorizationResponse() +type IntelMiscategorizationNewResponse interface { + ImplementsIntelMiscategorizationNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*IntelMiscategorizationMiscategorizationNewMiscategorizationResponse)(nil)).Elem(), + reflect.TypeOf((*IntelMiscategorizationNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -65,12 +64,12 @@ func init() { ) } -type IntelMiscategorizationMiscategorizationNewMiscategorizationParams struct { +type IntelMiscategorizationNewParams struct { // Content category IDs to add. ContentAdds param.Field[interface{}] `json:"content_adds"` // Content category IDs to remove. - ContentRemoves param.Field[interface{}] `json:"content_removes"` - IndicatorType param.Field[IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType] `json:"indicator_type"` + ContentRemoves param.Field[interface{}] `json:"content_removes"` + IndicatorType param.Field[IntelMiscategorizationNewParamsIndicatorType] `json:"indicator_type"` // Provide only if indicator_type is `ipv4` or `ipv6`. IP param.Field[interface{}] `json:"ip"` // Security category IDs to add. @@ -83,32 +82,31 @@ type IntelMiscategorizationMiscategorizationNewMiscategorizationParams struct { URL param.Field[string] `json:"url"` } -func (r IntelMiscategorizationMiscategorizationNewMiscategorizationParams) MarshalJSON() (data []byte, err error) { +func (r IntelMiscategorizationNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType string +type IntelMiscategorizationNewParamsIndicatorType string const ( - IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorTypeDomain IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType = "domain" - IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorTypeIPV4 IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType = "ipv4" - IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorTypeIPV6 IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType = "ipv6" - IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorTypeURL IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorType = "url" + IntelMiscategorizationNewParamsIndicatorTypeDomain IntelMiscategorizationNewParamsIndicatorType = "domain" + IntelMiscategorizationNewParamsIndicatorTypeIPV4 IntelMiscategorizationNewParamsIndicatorType = "ipv4" + IntelMiscategorizationNewParamsIndicatorTypeIPV6 IntelMiscategorizationNewParamsIndicatorType = "ipv6" + IntelMiscategorizationNewParamsIndicatorTypeURL IntelMiscategorizationNewParamsIndicatorType = "url" ) -type IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelope struct { - Errors []IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessages `json:"messages,required"` - Result IntelMiscategorizationMiscategorizationNewMiscategorizationResponse `json:"result,required"` +type IntelMiscategorizationNewResponseEnvelope struct { + Errors []IntelMiscategorizationNewResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelMiscategorizationNewResponseEnvelopeMessages `json:"messages,required"` + Result IntelMiscategorizationNewResponse `json:"result,required"` // Whether the API call was successful - Success IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeSuccess `json:"success,required"` - JSON intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeJSON `json:"-"` + Success IntelMiscategorizationNewResponseEnvelopeSuccess `json:"success,required"` + JSON intelMiscategorizationNewResponseEnvelopeJSON `json:"-"` } -// intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelope] -type intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeJSON struct { +// intelMiscategorizationNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [IntelMiscategorizationNewResponseEnvelope] +type intelMiscategorizationNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -117,53 +115,51 @@ type intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelMiscategorizationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrorsJSON `json:"-"` +type IntelMiscategorizationNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelMiscategorizationNewResponseEnvelopeErrorsJSON `json:"-"` } -// intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrors] -type intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrorsJSON struct { +// intelMiscategorizationNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [IntelMiscategorizationNewResponseEnvelopeErrors] +type intelMiscategorizationNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelMiscategorizationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessagesJSON `json:"-"` +type IntelMiscategorizationNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelMiscategorizationNewResponseEnvelopeMessagesJSON `json:"-"` } -// intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessages] -type intelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessagesJSON struct { +// intelMiscategorizationNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [IntelMiscategorizationNewResponseEnvelopeMessages] +type intelMiscategorizationNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelMiscategorizationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeSuccess bool +type IntelMiscategorizationNewResponseEnvelopeSuccess bool const ( - IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeSuccessTrue IntelMiscategorizationMiscategorizationNewMiscategorizationResponseEnvelopeSuccess = true + IntelMiscategorizationNewResponseEnvelopeSuccessTrue IntelMiscategorizationNewResponseEnvelopeSuccess = true ) diff --git a/intelmiscategorization_test.go b/intelmiscategorization_test.go index 5d928f4464f..b7a0e2f0368 100644 --- a/intelmiscategorization_test.go +++ b/intelmiscategorization_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelMiscategorizationMiscategorizationNewMiscategorizationWithOptionalParams(t *testing.T) { +func TestIntelMiscategorizationNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,17 +29,17 @@ func TestIntelMiscategorizationMiscategorizationNewMiscategorizationWithOptional option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Miscategorizations.MiscategorizationNewMiscategorization( + _, err := client.Intel.Miscategorizations.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelMiscategorizationMiscategorizationNewMiscategorizationParams{ + cloudflare.IntelMiscategorizationNewParams{ ContentAdds: cloudflare.F[any](map[string]interface{}{ "0": int64(82), }), ContentRemoves: cloudflare.F[any](map[string]interface{}{ "0": int64(155), }), - IndicatorType: cloudflare.F(cloudflare.IntelMiscategorizationMiscategorizationNewMiscategorizationParamsIndicatorTypeDomain), + IndicatorType: cloudflare.F(cloudflare.IntelMiscategorizationNewParamsIndicatorTypeDomain), IP: cloudflare.F[any](map[string]interface{}{}), SecurityAdds: cloudflare.F[any](map[string]interface{}{ "0": int64(117), diff --git a/intelwhois.go b/intelwhois.go index 4dcda4710c7..e2268e270c8 100644 --- a/intelwhois.go +++ b/intelwhois.go @@ -34,9 +34,9 @@ func NewIntelWhoisService(opts ...option.RequestOption) (r *IntelWhoisService) { } // Get WHOIS Record -func (r *IntelWhoisService) WhoisRecordGetWhoisRecord(ctx context.Context, accountID string, query IntelWhoisWhoisRecordGetWhoisRecordParams, opts ...option.RequestOption) (res *IntelWhoisWhoisRecordGetWhoisRecordResponse, err error) { +func (r *IntelWhoisService) Get(ctx context.Context, accountID string, query IntelWhoisGetParams, opts ...option.RequestOption) (res *IntelWhoisGetResponse, err error) { opts = append(r.Options[:], opts...) - var env IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelope + var env IntelWhoisGetResponseEnvelope path := fmt.Sprintf("accounts/%s/intel/whois", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,22 +46,22 @@ func (r *IntelWhoisService) WhoisRecordGetWhoisRecord(ctx context.Context, accou return } -type IntelWhoisWhoisRecordGetWhoisRecordResponse struct { - CreatedDate time.Time `json:"created_date" format:"date"` - Domain string `json:"domain"` - Nameservers []string `json:"nameservers"` - Registrant string `json:"registrant"` - RegistrantCountry string `json:"registrant_country"` - RegistrantEmail string `json:"registrant_email"` - RegistrantOrg string `json:"registrant_org"` - Registrar string `json:"registrar"` - UpdatedDate time.Time `json:"updated_date" format:"date"` - JSON intelWhoisWhoisRecordGetWhoisRecordResponseJSON `json:"-"` +type IntelWhoisGetResponse struct { + CreatedDate time.Time `json:"created_date" format:"date"` + Domain string `json:"domain"` + Nameservers []string `json:"nameservers"` + Registrant string `json:"registrant"` + RegistrantCountry string `json:"registrant_country"` + RegistrantEmail string `json:"registrant_email"` + RegistrantOrg string `json:"registrant_org"` + Registrar string `json:"registrar"` + UpdatedDate time.Time `json:"updated_date" format:"date"` + JSON intelWhoisGetResponseJSON `json:"-"` } -// intelWhoisWhoisRecordGetWhoisRecordResponseJSON contains the JSON metadata for -// the struct [IntelWhoisWhoisRecordGetWhoisRecordResponse] -type intelWhoisWhoisRecordGetWhoisRecordResponseJSON struct { +// intelWhoisGetResponseJSON contains the JSON metadata for the struct +// [IntelWhoisGetResponse] +type intelWhoisGetResponseJSON struct { CreatedDate apijson.Field Domain apijson.Field Nameservers apijson.Field @@ -75,35 +75,34 @@ type intelWhoisWhoisRecordGetWhoisRecordResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelWhoisWhoisRecordGetWhoisRecordResponse) UnmarshalJSON(data []byte) (err error) { +func (r *IntelWhoisGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelWhoisWhoisRecordGetWhoisRecordParams struct { +type IntelWhoisGetParams struct { Domain param.Field[string] `query:"domain"` } -// URLQuery serializes [IntelWhoisWhoisRecordGetWhoisRecordParams]'s query -// parameters as `url.Values`. -func (r IntelWhoisWhoisRecordGetWhoisRecordParams) URLQuery() (v url.Values) { +// URLQuery serializes [IntelWhoisGetParams]'s query parameters as `url.Values`. +func (r IntelWhoisGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelope struct { - Errors []IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrors `json:"errors,required"` - Messages []IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessages `json:"messages,required"` - Result IntelWhoisWhoisRecordGetWhoisRecordResponse `json:"result,required"` +type IntelWhoisGetResponseEnvelope struct { + Errors []IntelWhoisGetResponseEnvelopeErrors `json:"errors,required"` + Messages []IntelWhoisGetResponseEnvelopeMessages `json:"messages,required"` + Result IntelWhoisGetResponse `json:"result,required"` // Whether the API call was successful - Success IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeSuccess `json:"success,required"` - JSON intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeJSON `json:"-"` + Success IntelWhoisGetResponseEnvelopeSuccess `json:"success,required"` + JSON intelWhoisGetResponseEnvelopeJSON `json:"-"` } -// intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeJSON contains the JSON -// metadata for the struct [IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelope] -type intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeJSON struct { +// intelWhoisGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [IntelWhoisGetResponseEnvelope] +type intelWhoisGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -112,53 +111,51 @@ type intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *IntelWhoisGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrorsJSON `json:"-"` +type IntelWhoisGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelWhoisGetResponseEnvelopeErrorsJSON `json:"-"` } -// intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrors] -type intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrorsJSON struct { +// intelWhoisGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [IntelWhoisGetResponseEnvelopeErrors] +type intelWhoisGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *IntelWhoisGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessagesJSON `json:"-"` +type IntelWhoisGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON intelWhoisGetResponseEnvelopeMessagesJSON `json:"-"` } -// intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessages] -type intelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessagesJSON struct { +// intelWhoisGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [IntelWhoisGetResponseEnvelopeMessages] +type intelWhoisGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *IntelWhoisGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeSuccess bool +type IntelWhoisGetResponseEnvelopeSuccess bool const ( - IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeSuccessTrue IntelWhoisWhoisRecordGetWhoisRecordResponseEnvelopeSuccess = true + IntelWhoisGetResponseEnvelopeSuccessTrue IntelWhoisGetResponseEnvelopeSuccess = true ) diff --git a/intelwhois_test.go b/intelwhois_test.go index 73892ced607..3dd0fcb1fef 100644 --- a/intelwhois_test.go +++ b/intelwhois_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestIntelWhoisWhoisRecordGetWhoisRecordWithOptionalParams(t *testing.T) { +func TestIntelWhoisGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestIntelWhoisWhoisRecordGetWhoisRecordWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Intels.Whois.WhoisRecordGetWhoisRecord( + _, err := client.Intel.Whois.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.IntelWhoisWhoisRecordGetWhoisRecordParams{ + cloudflare.IntelWhoisGetParams{ Domain: cloudflare.F("string"), }, ) diff --git a/internal/shared/union.go b/internal/shared/union.go index a7dc9ad9e15..e1f778389ee 100644 --- a/internal/shared/union.go +++ b/internal/shared/union.go @@ -4,109 +4,70 @@ package shared type UnionString string -func (UnionString) ImplementsAccountUpdateResponse() {} -func (UnionString) ImplementsAccountGetResponse() {} -func (UnionString) ImplementsCertificateGetResponse() {} -func (UnionString) ImplementsCertificateOriginCaNewCertificateResponse() {} -func (UnionString) ImplementsMembershipUpdateResponse() {} -func (UnionString) ImplementsMembershipGetResponse() {} -func (UnionString) ImplementsUserUserEditUserResponse() {} -func (UnionString) ImplementsUserUserUserDetailsResponse() {} -func (UnionString) ImplementsUserAuditLogListResponseWtf() {} -func (UnionString) ImplementsUserBillingProfileUserBillingProfileBillingProfileDetailsResponse() {} -func (UnionString) ImplementsUserInviteUpdateResponse() {} -func (UnionString) ImplementsUserInviteGetResponse() {} -func (UnionString) ImplementsUserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse() {} -func (UnionString) ImplementsUserOrganizationGetResponse() {} -func (UnionString) ImplementsUserSubscriptionUpdateResponse() {} -func (UnionString) ImplementsUserTokenUpdateResponse() {} -func (UnionString) ImplementsUserTokenGetResponse() {} -func (UnionString) ImplementsLoadBalancerPoolHealthGetResponse() {} -func (UnionString) ImplementsLoadBalancerRegionGetResponse() {} -func (UnionString) ImplementsLoadBalancerRegionLoadBalancerRegionsListRegionsResponse() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant0AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant1AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant2AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant3AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant4AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant5AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant6AppID() {} -func (UnionString) ImplementsAccessAppUpdateParamsVariant7AppID() {} -func (UnionString) ImplementsAccessAppDeleteParamsAppID() {} -func (UnionString) ImplementsAccessAppGetParamsAppID() {} -func (UnionString) ImplementsAccessAppCaNewResponse() {} -func (UnionString) ImplementsAccessAppCaGetResponse() {} -func (UnionString) ImplementsAccessAppRevokeTokenAccessApplicationsRevokeServiceTokensParamsAppID() {} -func (UnionString) ImplementsAccessAppUserPolicyCheckAccessApplicationsTestAccessPoliciesParamsAppID() { -} -func (UnionString) ImplementsAccessKeyAccessKeyConfigurationGetTheAccessKeyConfigurationResponse() {} -func (UnionString) ImplementsAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse() { -} -func (UnionString) ImplementsAccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse() {} -func (UnionString) ImplementsPurgeCachZonePurgeParamsABb3jQf9FilesFile() {} -func (UnionString) ImplementsSSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse() {} -func (UnionString) ImplementsSSLCertificatePackGetResponse() {} -func (UnionString) ImplementsSubscriptionUpdateResponse() {} -func (UnionString) ImplementsSubscriptionAccountSubscriptionsNewSubscriptionResponse() {} -func (UnionString) ImplementsSubscriptionZoneSubscriptionNewZoneSubscriptionResponse() {} -func (UnionString) ImplementsSubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse() {} -func (UnionString) ImplementsSubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse() {} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince() { -} -func (UnionString) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince() {} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil() {} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince() { -} -func (UnionString) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil() { -} -func (UnionString) ImplementsAnalyticsLatencyArgoAnalyticsForZoneArgoAnalyticsForAZoneResponse() {} -func (UnionString) ImplementsAnalyticsLatencyColoArgoAnalyticsForGeolocationArgoAnalyticsForAZoneAtDifferentPoPsResponse() { -} -func (UnionString) ImplementsArgoSmartRoutingUpdateResponse() {} -func (UnionString) ImplementsArgoSmartRoutingGetResponse() {} -func (UnionString) ImplementsArgoTieredCachingTieredCachingGetTieredCachingSettingResponse() {} -func (UnionString) ImplementsArgoTieredCachingTieredCachingPatchTieredCachingSettingResponse() {} -func (UnionString) ImplementsCachTieredCacheSmartTopologyEnableDeleteResponse() {} -func (UnionString) ImplementsCachTieredCacheSmartTopologyEnableSmartTieredCacheGetSmartTieredCacheSettingResponse() { -} -func (UnionString) ImplementsCachTieredCacheSmartTopologyEnableSmartTieredCachePatchSmartTieredCacheSettingResponse() { -} -func (UnionString) ImplementsCustomCertificateNewResponse() {} -func (UnionString) ImplementsCustomCertificateUpdateResponse() {} -func (UnionString) ImplementsCustomCertificateGetResponse() {} -func (UnionString) ImplementsCustomHostnameFallbackOriginUpdateResponse() {} -func (UnionString) ImplementsCustomHostnameFallbackOriginDeleteResponse() {} -func (UnionString) ImplementsCustomHostnameFallbackOriginGetResponse() {} -func (UnionString) ImplementsCustomNDeleteResponse() {} -func (UnionString) ImplementsFirewallAccessRuleNewResponse() {} -func (UnionString) ImplementsFirewallAccessRuleUpdateResponse() {} -func (UnionString) ImplementsFirewallAccessRuleGetResponse() {} -func (UnionString) ImplementsFirewallUaRuleUpdateResponse() {} -func (UnionString) ImplementsFirewallUaRuleGetResponse() {} -func (UnionString) ImplementsFirewallUaRuleUserAgentBlockingRulesNewAUserAgentBlockingRuleResponse() { -} +func (UnionString) ImplementsAccountGetResponse() {} +func (UnionString) ImplementsAccountReplaceResponse() {} +func (UnionString) ImplementsCertificateNewResponse() {} +func (UnionString) ImplementsCertificateGetResponse() {} +func (UnionString) ImplementsMembershipGetResponse() {} +func (UnionString) ImplementsMembershipReplaceResponse() {} +func (UnionString) ImplementsUserUpdateResponse() {} +func (UnionString) ImplementsUserListResponse() {} +func (UnionString) ImplementsUserAuditLogListResponseWtf() {} +func (UnionString) ImplementsUserBillingProfileListResponse() {} +func (UnionString) ImplementsUserInviteUpdateResponse() {} +func (UnionString) ImplementsUserInviteGetResponse() {} +func (UnionString) ImplementsUserLoadBalancerPoolHealthListResponse() {} +func (UnionString) ImplementsUserOrganizationGetResponse() {} +func (UnionString) ImplementsUserSubscriptionReplaceResponse() {} +func (UnionString) ImplementsUserTokenGetResponse() {} +func (UnionString) ImplementsUserTokenReplaceResponse() {} +func (UnionString) ImplementsLoadBalancerPoolHealthGetResponse() {} +func (UnionString) ImplementsLoadBalancerRegionListResponse() {} +func (UnionString) ImplementsLoadBalancerRegionGetResponse() {} +func (UnionString) ImplementsAccessApplicationDeleteParamsAppID() {} +func (UnionString) ImplementsAccessApplicationGetParamsAppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant0AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant1AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant2AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant3AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant4AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant5AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant6AppID() {} +func (UnionString) ImplementsAccessApplicationReplaceParamsVariant7AppID() {} +func (UnionString) ImplementsAccessApplicationRevokeTokensParamsAppID() {} +func (UnionString) ImplementsAccessApplicationCaNewResponse() {} +func (UnionString) ImplementsAccessApplicationCaGetResponse() {} +func (UnionString) ImplementsAccessApplicationUserPolicyCheckListParamsAppID() {} +func (UnionString) ImplementsAccessKeyListResponse() {} +func (UnionString) ImplementsAccessKeyReplaceResponse() {} +func (UnionString) ImplementsAccessKeyRotateResponse() {} +func (UnionString) ImplementsCachePurgeParamsKtBnhzJvFilesFile() {} +func (UnionString) ImplementsCacheTieredCacheSmartTopologyUpdateResponse() {} +func (UnionString) ImplementsCacheTieredCacheSmartTopologyDeleteResponse() {} +func (UnionString) ImplementsCacheTieredCacheSmartTopologyGetResponse() {} +func (UnionString) ImplementsSSLAnalyzeNewResponse() {} +func (UnionString) ImplementsSSLCertificatePackGetResponse() {} +func (UnionString) ImplementsSubscriptionNewResponse() {} +func (UnionString) ImplementsSubscriptionGetResponse() {} +func (UnionString) ImplementsSubscriptionReplaceResponse() {} +func (UnionString) ImplementsArgoSmartRoutingUpdateResponse() {} +func (UnionString) ImplementsArgoSmartRoutingGetResponse() {} +func (UnionString) ImplementsArgoTieredCachingUpdateResponse() {} +func (UnionString) ImplementsArgoTieredCachingGetResponse() {} +func (UnionString) ImplementsCustomCertificateNewResponse() {} +func (UnionString) ImplementsCustomCertificateUpdateResponse() {} +func (UnionString) ImplementsCustomCertificateGetResponse() {} +func (UnionString) ImplementsCustomHostnameFallbackOriginDeleteResponse() {} +func (UnionString) ImplementsCustomHostnameFallbackOriginGetResponse() {} +func (UnionString) ImplementsCustomHostnameFallbackOriginReplaceResponse() {} +func (UnionString) ImplementsCustomNameserverDeleteResponse() {} +func (UnionString) ImplementsDNSSECDeleteResponse() {} +func (UnionString) ImplementsFirewallAccessRuleNewResponse() {} +func (UnionString) ImplementsFirewallAccessRuleUpdateResponse() {} +func (UnionString) ImplementsFirewallAccessRuleGetResponse() {} +func (UnionString) ImplementsFirewallUaRuleNewResponse() {} +func (UnionString) ImplementsFirewallUaRuleGetResponse() {} +func (UnionString) ImplementsFirewallUaRuleReplaceResponse() {} func (UnionString) ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult() {} func (UnionString) ImplementsFirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult() {} func (UnionString) ImplementsFirewallWAFPackageGroupUpdateResponse() {} @@ -115,164 +76,151 @@ func (UnionString) ImplementsFirewallWAFPackageRuleGetResponse() func (UnionString) ImplementsLogpushJobDeleteResponse() {} func (UnionString) ImplementsLogControlCmbConfigDeleteResponse() {} func (UnionString) ImplementsLogRayidGetResponse() {} -func (UnionString) ImplementsLogReceivedReceivedGetLogsReceivedResponse() {} -func (UnionString) ImplementsLogReceivedReceivedGetLogsReceivedParamsEnd() {} -func (UnionString) ImplementsLogReceivedReceivedGetLogsReceivedParamsStart() {} +func (UnionString) ImplementsLogReceivedGetResponse() {} +func (UnionString) ImplementsLogReceivedGetParamsEnd() {} +func (UnionString) ImplementsLogReceivedGetParamsStart() {} func (UnionString) ImplementsOriginTLSClientAuthNewResponse() {} func (UnionString) ImplementsOriginTLSClientAuthDeleteResponse() {} func (UnionString) ImplementsOriginTLSClientAuthGetResponse() {} func (UnionString) ImplementsPageruleNewResponse() {} -func (UnionString) ImplementsPageruleUpdateResponse() {} func (UnionString) ImplementsPageruleGetResponse() {} +func (UnionString) ImplementsPageruleReplaceResponse() {} +func (UnionString) ImplementsRateLimitNewResponse() {} func (UnionString) ImplementsRateLimitUpdateResponse() {} func (UnionString) ImplementsRateLimitGetResponse() {} -func (UnionString) ImplementsWorkerScriptNewResponse() {} func (UnionString) ImplementsWorkerScriptTailDeleteResponse() {} +func (UnionString) ImplementsWorkerRouteNewResponse() {} func (UnionString) ImplementsWorkerRouteDeleteResponse() {} -func (UnionString) ImplementsWorkerRouteWorkerRoutesNewRouteResponse() {} func (UnionString) ImplementsWorkerQueueDeleteResponse() {} func (UnionString) ImplementsWorkerQueueConsumerDeleteResponse() {} -func (UnionString) ImplementsSpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse() { -} -func (UnionString) ImplementsSpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse() { -} -func (UnionString) ImplementsSpectrumAppUpdateResponseOriginPort() {} -func (UnionString) ImplementsSpectrumAppGetResponse() {} -func (UnionString) ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort() { -} -func (UnionString) ImplementsSpectrumAppUpdateParamsOriginPort() {} -func (UnionString) ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort() { -} -func (UnionString) ImplementsAddressAddressMapDeleteResponse() {} -func (UnionString) ImplementsAddressAddressMapAccountUpdateResponse() {} -func (UnionString) ImplementsAddressAddressMapAccountDeleteResponse() {} -func (UnionString) ImplementsAddressAddressMapIPUpdateResponse() {} -func (UnionString) ImplementsAddressAddressMapIPDeleteResponse() {} -func (UnionString) ImplementsAddressAddressMapZoneUpdateResponse() {} -func (UnionString) ImplementsAddressAddressMapZoneDeleteResponse() {} -func (UnionString) ImplementsAddressPrefixDeleteResponse() {} -func (UnionString) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseVHtGuEw1APIResponseCommonResult() { -} -func (UnionString) ImplementsBillingProfileAccountBillingProfileBillingProfileDetailsResponse() {} -func (UnionString) ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse() { -} -func (UnionString) ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationResponse() { -} -func (UnionString) ImplementsCfdTunnelConnectionDeleteResponse() {} -func (UnionString) ImplementsCfdTunnelTokenCloudflareTunnelGetACloudflareTunnelTokenResponse() {} -func (UnionString) ImplementsCfdTunnelManagementNewResponse() {} -func (UnionString) ImplementsDLPProfileCustomDeleteResponse() {} -func (UnionString) ImplementsDNSFirewallNewResponseDNSFirewallIP() {} -func (UnionString) ImplementsDNSFirewallNewResponseUpstreamIP() {} -func (UnionString) ImplementsDNSFirewallUpdateResponseDNSFirewallIP() {} -func (UnionString) ImplementsDNSFirewallUpdateResponseUpstreamIP() {} -func (UnionString) ImplementsDNSFirewallListResponseDNSFirewallIP() {} -func (UnionString) ImplementsDNSFirewallListResponseUpstreamIP() {} -func (UnionString) ImplementsDNSFirewallGetResponseDNSFirewallIP() {} -func (UnionString) ImplementsDNSFirewallGetResponseUpstreamIP() {} -func (UnionString) ImplementsDNSFirewallNewParamsUpstreamIP() {} -func (UnionString) ImplementsDNSFirewallUpdateParamsDNSFirewallIP() {} -func (UnionString) ImplementsDNSFirewallUpdateParamsUpstreamIP() {} -func (UnionString) ImplementsImageV1UpdateResponseVariant() {} -func (UnionString) ImplementsImageV1DeleteResponse() {} -func (UnionString) ImplementsImageV1CloudflareImagesListImagesResponseImagesVariant() {} -func (UnionString) ImplementsImageV1CloudflareImagesUploadAnImageViaURLResponseVariant() {} -func (UnionString) ImplementsImageV1GetResponseVariant() {} -func (UnionString) ImplementsImageV1VariantDeleteResponse() {} -func (UnionString) ImplementsImagesImagesListResponseV2ResultImagesVariant() {} -func (UnionString) ImplementsImageV2ListResponseImagesVariant() {} -func (UnionString) ImplementsIntelIpipIntelligenceGetIPOverviewResponseIP() {} -func (UnionString) ImplementsIntelMiscategorizationMiscategorizationNewMiscategorizationResponse() {} -func (UnionString) ImplementsPageProjectNewResponse() {} -func (UnionString) ImplementsPageProjectUpdateResponse() {} -func (UnionString) ImplementsPageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse() { -} -func (UnionString) ImplementsPageProjectDomainUpdateResponse() {} -func (UnionString) ImplementsPageProjectDomainGetResponse() {} -func (UnionString) ImplementsPageProjectDomainPagesDomainsAddDomainResponse() {} -func (UnionString) ImplementsRegistrarDomainUpdateResponse() {} -func (UnionString) ImplementsRegistrarDomainGetResponse() {} -func (UnionString) ImplementsRoleGetResponse() {} -func (UnionString) ImplementsRuleListItemGetResponse() {} -func (UnionString) ImplementsStorageKvNamespaceUpdateResponse() {} -func (UnionString) ImplementsStorageKvNamespaceDeleteResponse() {} -func (UnionString) ImplementsStorageKvNamespaceBulkDeleteResponse() {} -func (UnionString) ImplementsStorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse() { -} -func (UnionString) ImplementsStorageKvNamespaceValueUpdateResponse() {} -func (UnionString) ImplementsStorageKvNamespaceValueDeleteResponse() {} -func (UnionString) ImplementsStreamAudioTrackDeleteResponse() {} -func (UnionString) ImplementsStreamKeyDeleteResponse() {} -func (UnionString) ImplementsStreamWatermarkDeleteResponse() {} -func (UnionString) ImplementsStreamWatermarkGetResponse() {} -func (UnionString) ImplementsStreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse() { -} -func (UnionString) ImplementsStreamWebhookDeleteResponse() {} -func (UnionString) ImplementsStreamWebhookStreamWebhookNewWebhooksResponse() {} -func (UnionString) ImplementsStreamWebhookStreamWebhookViewWebhooksResponse() {} -func (UnionString) ImplementsStreamCaptionUpdateResponse() {} -func (UnionString) ImplementsStreamCaptionDeleteResponse() {} -func (UnionString) ImplementsStreamDownloadDeleteResponse() {} -func (UnionString) ImplementsStreamDownloadStreamMP4DownloadsNewDownloadsResponse() {} -func (UnionString) ImplementsStreamDownloadStreamMP4DownloadsListDownloadsResponse() {} -func (UnionString) ImplementsTeamnetVirtualNetworkUpdateResponse() {} -func (UnionString) ImplementsTeamnetVirtualNetworkDeleteResponse() {} -func (UnionString) ImplementsTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse() {} -func (UnionString) ImplementsTunnelConnectionDeleteResponse() {} -func (UnionString) ImplementsGatewayListDeleteResponse() {} -func (UnionString) ImplementsGatewayLocationDeleteResponse() {} -func (UnionString) ImplementsGatewayProxyEndpointDeleteResponse() {} -func (UnionString) ImplementsGatewayRuleDeleteResponse() {} -func (UnionString) ImplementsAlertingV3DestinationEligibleNotificationMechanismEligibilityGetDeliveryMechanismEligibilityResponse() { -} -func (UnionString) ImplementsAlertingV3DestinationWebhookDeleteResponse() {} -func (UnionString) ImplementsAlertingV3PolicyDeleteResponse() {} -func (UnionString) ImplementsAlertingV3PolicyGetResponseMechanismsID() {} -func (UnionString) ImplementsAlertingV3PolicyNotificationPoliciesListNotificationPoliciesResponseMechanismsID() { -} -func (UnionString) ImplementsAlertingV3PolicyUpdateParamsMechanismsID() {} -func (UnionString) ImplementsAlertingV3PolicyNotificationPoliciesNewANotificationPolicyParamsMechanismsID() { -} -func (UnionString) ImplementsAlertingV3AvailableAlertListResponse() {} -func (UnionString) ImplementsAlertingV3DestinationPagerdutyDeleteAllResponse() {} -func (UnionString) ImplementsDeviceGetResponse() {} -func (UnionString) ImplementsDevicePostureIntegrationDeleteResponse() {} -func (UnionString) ImplementsDeviceRevokeDevicesRevokeDevicesResponse() {} -func (UnionString) ImplementsDeviceUnrevokeDevicesUnrevokeDevicesResponse() {} -func (UnionString) ImplementsD1DatabaseDeleteResponse() {} -func (UnionString) ImplementsAddressingPrefixBindingDeleteResponse() {} -func (UnionString) ImplementsHyperdriveConfigDeleteResponse() {} -func (UnionString) ImplementsVectorizeIndexDeleteResponse() {} -func (UnionString) ImplementsRadarRankingTimeseriesGroupListResponseSerie0() {} -func (UnionString) ImplementsOriginPostQuantumEncryptionUpdateResponse() {} -func (UnionString) ImplementsOriginPostQuantumEncryptionGetResponse() {} -func (UnionString) ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentSetting() {} -func (UnionString) ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField() { -} -func (UnionString) ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionString) ImplementsZarazConfigGetResponseToolsZarazManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazConfigGetResponseToolsZarazManagedComponentSetting() {} -func (UnionString) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionString) ImplementsZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields() {} -func (UnionString) ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentDefaultFields() {} -func (UnionString) ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentSettings() {} -func (UnionString) ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentDefaultFields() {} -func (UnionString) ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentSettings() {} -func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentSetting() {} -func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazCustomManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionString) ImplementsZarazExportGetResponseToolsZarazManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazExportGetResponseToolsZarazManagedComponentSetting() {} -func (UnionString) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionString) ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField() {} -func (UnionString) ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentSetting() {} -func (UnionString) ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField() { -} -func (UnionString) ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionString) ImplementsSpectrumAnalyticsEventBytimeGetResponse() {} +func (UnionString) ImplementsSpectrumAnalyticsEventSummaryGetResponse() {} +func (UnionString) ImplementsSpectrumAppNewResponseOriginPort() {} +func (UnionString) ImplementsSpectrumAppGetResponse() {} +func (UnionString) ImplementsSpectrumAppReplaceResponseOriginPort() {} +func (UnionString) ImplementsSpectrumAppNewParamsOriginPort() {} +func (UnionString) ImplementsSpectrumAppReplaceParamsOriginPort() {} +func (UnionString) ImplementsAddressAddressMapDeleteResponse() {} +func (UnionString) ImplementsAddressAddressMapAccountDeleteResponse() {} +func (UnionString) ImplementsAddressAddressMapAccountReplaceResponse() {} +func (UnionString) ImplementsAddressAddressMapIPDeleteResponse() {} +func (UnionString) ImplementsAddressAddressMapIPReplaceResponse() {} +func (UnionString) ImplementsAddressAddressMapZoneDeleteResponse() {} +func (UnionString) ImplementsAddressAddressMapZoneReplaceResponse() {} +func (UnionString) ImplementsAddressPrefixDeleteResponse() {} +func (UnionString) ImplementsAuditLogListResponseWtf() {} +func (UnionString) ImplementsBillingProfileGetResponse() {} +func (UnionString) ImplementsTunnelConfigurationListResponse() {} +func (UnionString) ImplementsTunnelConfigurationReplaceResponse() {} +func (UnionString) ImplementsTunnelConnectionDeleteResponse() {} +func (UnionString) ImplementsTunnelTokenGetResponse() {} +func (UnionString) ImplementsTunnelManagementNewResponse() {} +func (UnionString) ImplementsDLPProfileCustomDeleteResponse() {} +func (UnionString) ImplementsDNSFirewallNewResponseDNSFirewallIP() {} +func (UnionString) ImplementsDNSFirewallNewResponseUpstreamIP() {} +func (UnionString) ImplementsDNSFirewallUpdateResponseDNSFirewallIP() {} +func (UnionString) ImplementsDNSFirewallUpdateResponseUpstreamIP() {} +func (UnionString) ImplementsDNSFirewallListResponseDNSFirewallIP() {} +func (UnionString) ImplementsDNSFirewallListResponseUpstreamIP() {} +func (UnionString) ImplementsDNSFirewallGetResponseDNSFirewallIP() {} +func (UnionString) ImplementsDNSFirewallGetResponseUpstreamIP() {} +func (UnionString) ImplementsDNSFirewallNewParamsUpstreamIP() {} +func (UnionString) ImplementsDNSFirewallUpdateParamsDNSFirewallIP() {} +func (UnionString) ImplementsDNSFirewallUpdateParamsUpstreamIP() {} +func (UnionString) ImplementsImageV1NewResponseVariant() {} +func (UnionString) ImplementsImageV1UpdateResponseVariant() {} +func (UnionString) ImplementsImageV1ListResponseResultImagesVariant() {} +func (UnionString) ImplementsImageV1DeleteResponse() {} +func (UnionString) ImplementsImageV1GetResponseVariant() {} +func (UnionString) ImplementsImageV1VariantDeleteResponse() {} +func (UnionString) ImplementsImagesImagesListResponseV2ResultImagesVariant() {} +func (UnionString) ImplementsImageV2ListResponseImagesVariant() {} +func (UnionString) ImplementsIntelIPGetResponseIP() {} +func (UnionString) ImplementsIntelMiscategorizationNewResponse() {} +func (UnionString) ImplementsPageProjectNewResponse() {} +func (UnionString) ImplementsPageProjectUpdateResponse() {} +func (UnionString) ImplementsPageProjectDeploymentHistoryLogListResponse() {} +func (UnionString) ImplementsPageProjectDomainNewResponse() {} +func (UnionString) ImplementsPageProjectDomainUpdateResponse() {} +func (UnionString) ImplementsPageProjectDomainGetResponse() {} +func (UnionString) ImplementsRegistrarDomainGetResponse() {} +func (UnionString) ImplementsRegistrarDomainReplaceResponse() {} +func (UnionString) ImplementsRoleGetResponse() {} +func (UnionString) ImplementsRuleListItemGetResponse() {} +func (UnionString) ImplementsStorageKvNamespaceDeleteResponse() {} +func (UnionString) ImplementsStorageKvNamespaceReplaceResponse() {} +func (UnionString) ImplementsStorageKvNamespaceBulkDeleteResponse() {} +func (UnionString) ImplementsStorageKvNamespaceBulkReplaceResponse() {} +func (UnionString) ImplementsStorageKvNamespaceValueDeleteResponse() {} +func (UnionString) ImplementsStorageKvNamespaceValueReplaceResponse() {} +func (UnionString) ImplementsStreamAudioTrackDeleteResponse() {} +func (UnionString) ImplementsStreamKeyDeleteResponse() {} +func (UnionString) ImplementsStreamWatermarkNewResponse() {} +func (UnionString) ImplementsStreamWatermarkDeleteResponse() {} +func (UnionString) ImplementsStreamWatermarkGetResponse() {} +func (UnionString) ImplementsStreamWebhookDeleteResponse() {} +func (UnionString) ImplementsStreamWebhookGetResponse() {} +func (UnionString) ImplementsStreamWebhookReplaceResponse() {} +func (UnionString) ImplementsStreamCaptionDeleteResponse() {} +func (UnionString) ImplementsStreamCaptionReplaceResponse() {} +func (UnionString) ImplementsStreamDownloadNewResponse() {} +func (UnionString) ImplementsStreamDownloadListResponse() {} +func (UnionString) ImplementsStreamDownloadDeleteResponse() {} +func (UnionString) ImplementsTeamnetVirtualNetworkNewResponse() {} +func (UnionString) ImplementsTeamnetVirtualNetworkUpdateResponse() {} +func (UnionString) ImplementsTeamnetVirtualNetworkDeleteResponse() {} +func (UnionString) ImplementsGatewayListDeleteResponse() {} +func (UnionString) ImplementsGatewayLocationDeleteResponse() {} +func (UnionString) ImplementsGatewayProxyEndpointDeleteResponse() {} +func (UnionString) ImplementsGatewayRuleDeleteResponse() {} +func (UnionString) ImplementsAlertingV3ListResponse() {} +func (UnionString) ImplementsAlertingV3DestinationEligibleGetResponse() {} +func (UnionString) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() {} +func (UnionString) ImplementsAlertingV3DestinationWebhookDeleteResponse() {} +func (UnionString) ImplementsAlertingV3PolicyListResponseMechanismsID() {} +func (UnionString) ImplementsAlertingV3PolicyDeleteResponse() {} +func (UnionString) ImplementsAlertingV3PolicyGetResponseMechanismsID() {} +func (UnionString) ImplementsAlertingV3PolicyNewParamsMechanismsID() {} +func (UnionString) ImplementsAlertingV3PolicyReplaceParamsMechanismsID() {} +func (UnionString) ImplementsDeviceGetResponse() {} +func (UnionString) ImplementsDevicePostureIntegrationDeleteResponse() {} +func (UnionString) ImplementsDeviceRevokeNewResponse() {} +func (UnionString) ImplementsDeviceUnrevokeNewResponse() {} +func (UnionString) ImplementsD1DatabaseDeleteResponse() {} +func (UnionString) ImplementsAddressingPrefixBindingDeleteResponse() {} +func (UnionString) ImplementsHyperdriveConfigDeleteResponse() {} +func (UnionString) ImplementsVectorizeIndexDeleteResponse() {} +func (UnionString) ImplementsRadarRankingTimeseriesGroupListResponseSerie0() {} +func (UnionString) ImplementsOriginPostQuantumEncryptionGetResponse() {} +func (UnionString) ImplementsOriginPostQuantumEncryptionReplaceResponse() {} +func (UnionString) ImplementsZarazConfigGetResponseToolsZarazManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazConfigGetResponseToolsZarazManagedComponentSetting() {} +func (UnionString) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionString) ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentSetting() {} +func (UnionString) ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField() { +} +func (UnionString) ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionString) ImplementsZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields() {} +func (UnionString) ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentDefaultFields() {} +func (UnionString) ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentSettings() {} +func (UnionString) ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentDefaultFields() { +} +func (UnionString) ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentSettings() {} +func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentSetting() {} +func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazCustomManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazDefaultGetResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionString) ImplementsZarazExportGetResponseToolsZarazManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazExportGetResponseToolsZarazManagedComponentSetting() {} +func (UnionString) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionString) ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField() {} +func (UnionString) ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentSetting() {} +func (UnionString) ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField() { +} +func (UnionString) ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting() {} func (UnionString) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazManagedComponentDefaultField() { } func (UnionString) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazManagedComponentSetting() {} @@ -280,26 +228,26 @@ func (UnionString) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazCustom } func (UnionString) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazCustomManagedComponentSetting() { } -func (UnionString) ImplementsHostnameSettingTLSUpdateResponseValue() {} -func (UnionString) ImplementsHostnameSettingTLSGetResponseValue() {} -func (UnionString) ImplementsHostnameSettingTLSUpdateParamsValue() {} -func (UnionString) ImplementsSnippetDeleteResponse() {} +func (UnionString) ImplementsHostnameSettingTLSGetResponseValue() {} +func (UnionString) ImplementsHostnameSettingTLSReplaceResponseValue() {} +func (UnionString) ImplementsHostnameSettingTLSReplaceParamsValue() {} +func (UnionString) ImplementsSnippetDeleteResponse() {} type UnionBool bool -func (UnionBool) ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField() {} -func (UnionBool) ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentSetting() {} -func (UnionBool) ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField() {} -func (UnionBool) ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting() {} func (UnionBool) ImplementsZarazConfigGetResponseToolsZarazManagedComponentDefaultField() {} func (UnionBool) ImplementsZarazConfigGetResponseToolsZarazManagedComponentSetting() {} func (UnionBool) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField() {} func (UnionBool) ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionBool) ImplementsZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields() {} -func (UnionBool) ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentDefaultFields() {} -func (UnionBool) ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentSettings() {} -func (UnionBool) ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentDefaultFields() {} -func (UnionBool) ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentSettings() {} +func (UnionBool) ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField() {} +func (UnionBool) ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentSetting() {} +func (UnionBool) ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField() {} +func (UnionBool) ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionBool) ImplementsZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields() {} +func (UnionBool) ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentDefaultFields() {} +func (UnionBool) ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentSettings() {} +func (UnionBool) ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentDefaultFields() {} +func (UnionBool) ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentSettings() {} func (UnionBool) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentDefaultField() {} func (UnionBool) ImplementsZarazDefaultGetResponseToolsZarazManagedComponentSetting() {} func (UnionBool) ImplementsZarazDefaultGetResponseToolsZarazCustomManagedComponentDefaultField() {} @@ -308,10 +256,11 @@ func (UnionBool) ImplementsZarazExportGetResponseToolsZarazManagedComponentDefau func (UnionBool) ImplementsZarazExportGetResponseToolsZarazManagedComponentSetting() {} func (UnionBool) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentDefaultField() {} func (UnionBool) ImplementsZarazExportGetResponseToolsZarazCustomManagedComponentSetting() {} -func (UnionBool) ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField() {} -func (UnionBool) ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentSetting() {} -func (UnionBool) ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField() {} -func (UnionBool) ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting() {} +func (UnionBool) ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField() {} +func (UnionBool) ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentSetting() {} +func (UnionBool) ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField() { +} +func (UnionBool) ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting() {} func (UnionBool) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazManagedComponentDefaultField() { } func (UnionBool) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazManagedComponentSetting() {} @@ -322,170 +271,138 @@ func (UnionBool) ImplementsZarazHistoryConfigGetResponseConfigToolsZarazCustomMa type UnionInt int64 -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesSince() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTimeseriesUntil() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsSince() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseTotalsUntil() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsSince() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsParamsUntil() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQuerySince() { -} -func (UnionInt) ImplementsAnalyticsColoZoneAnalyticsDeprecatedGetAnalyticsByCoLocationsResponseEnvelopeQueryUntil() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesSince() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTimeseriesUntil() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsSince() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseTotalsUntil() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsSince() {} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardParamsUntil() {} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQuerySince() { -} -func (UnionInt) ImplementsAnalyticsDashboardZoneAnalyticsDeprecatedGetDashboardResponseEnvelopeQueryUntil() { -} -func (UnionInt) ImplementsLogReceivedReceivedGetLogsReceivedParamsEnd() {} -func (UnionInt) ImplementsLogReceivedReceivedGetLogsReceivedParamsStart() {} -func (UnionInt) ImplementsSpectrumAppUpdateResponseOriginPort() {} -func (UnionInt) ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort() { -} -func (UnionInt) ImplementsSpectrumAppUpdateParamsOriginPort() {} -func (UnionInt) ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort() { -} -func (UnionInt) ImplementsRuleListItemGetResponse() {} +func (UnionInt) ImplementsLogReceivedGetParamsEnd() {} +func (UnionInt) ImplementsLogReceivedGetParamsStart() {} +func (UnionInt) ImplementsSpectrumAppNewResponseOriginPort() {} +func (UnionInt) ImplementsSpectrumAppReplaceResponseOriginPort() {} +func (UnionInt) ImplementsSpectrumAppNewParamsOriginPort() {} +func (UnionInt) ImplementsSpectrumAppReplaceParamsOriginPort() {} +func (UnionInt) ImplementsRuleListItemGetResponse() {} type UnionFloat float64 -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateResponseDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsARecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsAaaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsCaaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsCertRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsCnameRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsDnskeyRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsDsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsHTTPSRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsLocRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsMxRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsNaptrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsNsRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsPtrRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsSmimeaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsSrvRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsSshfpRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsSvcbRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsTlsaRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsTxtRecordTTL() {} -func (UnionFloat) ImplementsDNSRecordUpdateParamsDNSRecordsUriRecordTTL() {} -func (UnionFloat) ImplementsEmailRoutingDNSEmailRoutingSettingsEmailRoutingDNSSettingsResponseTTL() {} -func (UnionFloat) ImplementsRadarRankingTimeseriesGroupListResponseSerie0() {} -func (UnionFloat) ImplementsHostnameSettingTLSUpdateResponseValue() {} -func (UnionFloat) ImplementsHostnameSettingTLSGetResponseValue() {} -func (UnionFloat) ImplementsHostnameSettingTLSUpdateParamsValue() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewResponseDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordListResponseDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordGetResponseDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceResponseDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordNewParamsDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsARecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsAaaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsCaaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsCertRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsCnameRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsDnskeyRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsDsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsHTTPSRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsLocRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsMxRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsNaptrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsNsRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsPtrRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsSmimeaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsSrvRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsSshfpRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsSvcbRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsTlsaRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsTxtRecordTTL() {} +func (UnionFloat) ImplementsDNSRecordReplaceParamsDNSRecordsUriRecordTTL() {} +func (UnionFloat) ImplementsEmailRoutingDNSGetResponseTTL() {} +func (UnionFloat) ImplementsRadarRankingTimeseriesGroupListResponseSerie0() {} +func (UnionFloat) ImplementsHostnameSettingTLSGetResponseValue() {} +func (UnionFloat) ImplementsHostnameSettingTLSReplaceResponseValue() {} +func (UnionFloat) ImplementsHostnameSettingTLSReplaceParamsValue() {} diff --git a/loadbalancermonitorpreview.go b/loadbalancermonitorpreview.go index 8dcc9de0785..981f33e81dd 100644 --- a/loadbalancermonitorpreview.go +++ b/loadbalancermonitorpreview.go @@ -33,9 +33,9 @@ func NewLoadBalancerMonitorPreviewService(opts ...option.RequestOption) (r *Load // Preview pools using the specified monitor with provided monitor details. The // returned preview_id can be used in the preview endpoint to retrieve the results. -func (r *LoadBalancerMonitorPreviewService) AccountLoadBalancerMonitorsPreviewMonitor(ctx context.Context, accountID string, monitorID string, body LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams, opts ...option.RequestOption) (res *LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse, err error) { +func (r *LoadBalancerMonitorPreviewService) New(ctx context.Context, accountID string, monitorID string, body LoadBalancerMonitorPreviewNewParams, opts ...option.RequestOption) (res *LoadBalancerMonitorPreviewNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelope + var env LoadBalancerMonitorPreviewNewResponseEnvelope path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/preview", accountID, monitorID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -45,28 +45,27 @@ func (r *LoadBalancerMonitorPreviewService) AccountLoadBalancerMonitorsPreviewMo return } -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse struct { +type LoadBalancerMonitorPreviewNewResponse struct { // Monitored pool IDs mapped to their respective names. - Pools map[string]string `json:"pools"` - PreviewID string `json:"preview_id"` - JSON loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseJSON `json:"-"` + Pools map[string]string `json:"pools"` + PreviewID string `json:"preview_id"` + JSON loadBalancerMonitorPreviewNewResponseJSON `json:"-"` } -// loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse] -type loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseJSON struct { +// loadBalancerMonitorPreviewNewResponseJSON contains the JSON metadata for the +// struct [LoadBalancerMonitorPreviewNewResponse] +type loadBalancerMonitorPreviewNewResponseJSON struct { Pools apijson.Field PreviewID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorPreviewNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams struct { +type LoadBalancerMonitorPreviewNewParams struct { // The expected HTTP response code or code range of the health check. This // parameter is only valid for HTTP and HTTPS monitors. ExpectedCodes param.Field[string] `json:"expected_codes,required"` @@ -115,39 +114,38 @@ type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams s Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - Type param.Field[LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType] `json:"type"` + Type param.Field[LoadBalancerMonitorPreviewNewParamsType] `json:"type"` } -func (r LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams) MarshalJSON() (data []byte, err error) { +func (r LoadBalancerMonitorPreviewNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType string +type LoadBalancerMonitorPreviewNewParamsType string const ( - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeHTTP LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "http" - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeHTTPS LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "https" - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeTcp LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "tcp" - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeUdpIcmp LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "udp_icmp" - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeIcmpPing LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "icmp_ping" - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeSmtp LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsType = "smtp" + LoadBalancerMonitorPreviewNewParamsTypeHTTP LoadBalancerMonitorPreviewNewParamsType = "http" + LoadBalancerMonitorPreviewNewParamsTypeHTTPS LoadBalancerMonitorPreviewNewParamsType = "https" + LoadBalancerMonitorPreviewNewParamsTypeTcp LoadBalancerMonitorPreviewNewParamsType = "tcp" + LoadBalancerMonitorPreviewNewParamsTypeUdpIcmp LoadBalancerMonitorPreviewNewParamsType = "udp_icmp" + LoadBalancerMonitorPreviewNewParamsTypeIcmpPing LoadBalancerMonitorPreviewNewParamsType = "icmp_ping" + LoadBalancerMonitorPreviewNewParamsTypeSmtp LoadBalancerMonitorPreviewNewParamsType = "smtp" ) -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelope struct { - Errors []LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors `json:"errors,required"` - Messages []LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages `json:"messages,required"` - Result LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse `json:"result,required"` +type LoadBalancerMonitorPreviewNewResponseEnvelope struct { + Errors []LoadBalancerMonitorPreviewNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LoadBalancerMonitorPreviewNewResponseEnvelopeMessages `json:"messages,required"` + Result LoadBalancerMonitorPreviewNewResponse `json:"result,required"` // Whether the API call was successful - Success LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess `json:"success,required"` - JSON loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON `json:"-"` + Success LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess `json:"success,required"` + JSON loadBalancerMonitorPreviewNewResponseEnvelopeJSON `json:"-"` } -// loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelope] -type loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON struct { +// loadBalancerMonitorPreviewNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [LoadBalancerMonitorPreviewNewResponseEnvelope] +type loadBalancerMonitorPreviewNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -156,53 +154,51 @@ type loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponse ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON `json:"-"` +type LoadBalancerMonitorPreviewNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON `json:"-"` } -// loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors] -type loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON struct { +// loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [LoadBalancerMonitorPreviewNewResponseEnvelopeErrors] +type loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON `json:"-"` +type LoadBalancerMonitorPreviewNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON `json:"-"` } -// loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages] -type loadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON struct { +// loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [LoadBalancerMonitorPreviewNewResponseEnvelopeMessages] +type loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess bool +type LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess bool const ( - LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccessTrue LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess = true + LoadBalancerMonitorPreviewNewResponseEnvelopeSuccessTrue LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess = true ) diff --git a/loadbalancermonitorpreview_test.go b/loadbalancermonitorpreview_test.go index e45688a4df2..529a95187cc 100644 --- a/loadbalancermonitorpreview_test.go +++ b/loadbalancermonitorpreview_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorWithOptionalParams(t *testing.T) { +func TestLoadBalancerMonitorPreviewNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestLoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorWith option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Monitors.Previews.AccountLoadBalancerMonitorsPreviewMonitor( + _, err := client.LoadBalancers.Monitors.Previews.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f1aba936b94213e5b8dca0c0dbf1f9cc", - cloudflare.LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParams{ + cloudflare.LoadBalancerMonitorPreviewNewParams{ ExpectedCodes: cloudflare.F("2xx"), AllowInsecure: cloudflare.F(true), ConsecutiveDown: cloudflare.F(int64(0)), @@ -56,7 +56,7 @@ func TestLoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorWith ProbeZone: cloudflare.F("example.com"), Retries: cloudflare.F(int64(0)), Timeout: cloudflare.F(int64(0)), - Type: cloudflare.F(cloudflare.LoadBalancerMonitorPreviewAccountLoadBalancerMonitorsPreviewMonitorParamsTypeHTTPS), + Type: cloudflare.F(cloudflare.LoadBalancerMonitorPreviewNewParamsTypeHTTPS), }, ) if err != nil { diff --git a/loadbalancermonitorreference.go b/loadbalancermonitorreference.go index c0028327d4a..ae9fe7839a7 100644 --- a/loadbalancermonitorreference.go +++ b/loadbalancermonitorreference.go @@ -31,9 +31,9 @@ func NewLoadBalancerMonitorReferenceService(opts ...option.RequestOption) (r *Lo } // Get the list of resources that reference the provided monitor. -func (r *LoadBalancerMonitorReferenceService) AccountLoadBalancerMonitorsListMonitorReferences(ctx context.Context, accountID string, monitorID string, opts ...option.RequestOption) (res *[]LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse, err error) { +func (r *LoadBalancerMonitorReferenceService) List(ctx context.Context, accountID string, monitorID string, opts ...option.RequestOption) (res *[]LoadBalancerMonitorReferenceListResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelope + var env LoadBalancerMonitorReferenceListResponseEnvelope path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/references", accountID, monitorID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,18 +43,17 @@ func (r *LoadBalancerMonitorReferenceService) AccountLoadBalancerMonitorsListMon return } -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse struct { - ReferenceType LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceType `json:"reference_type"` - ResourceID string `json:"resource_id"` - ResourceName string `json:"resource_name"` - ResourceType string `json:"resource_type"` - JSON loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseJSON `json:"-"` +type LoadBalancerMonitorReferenceListResponse struct { + ReferenceType LoadBalancerMonitorReferenceListResponseReferenceType `json:"reference_type"` + ResourceID string `json:"resource_id"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + JSON loadBalancerMonitorReferenceListResponseJSON `json:"-"` } -// loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse] -type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseJSON struct { +// loadBalancerMonitorReferenceListResponseJSON contains the JSON metadata for the +// struct [LoadBalancerMonitorReferenceListResponse] +type loadBalancerMonitorReferenceListResponseJSON struct { ReferenceType apijson.Field ResourceID apijson.Field ResourceName apijson.Field @@ -63,33 +62,32 @@ type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReference ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorReferenceListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceType string +type LoadBalancerMonitorReferenceListResponseReferenceType string const ( - LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceTypeStar LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceType = "*" - LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceTypeReferral LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceType = "referral" - LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceTypeReferrer LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseReferenceType = "referrer" + LoadBalancerMonitorReferenceListResponseReferenceTypeStar LoadBalancerMonitorReferenceListResponseReferenceType = "*" + LoadBalancerMonitorReferenceListResponseReferenceTypeReferral LoadBalancerMonitorReferenceListResponseReferenceType = "referral" + LoadBalancerMonitorReferenceListResponseReferenceTypeReferrer LoadBalancerMonitorReferenceListResponseReferenceType = "referrer" ) -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelope struct { - Errors []LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrors `json:"errors,required"` - Messages []LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessages `json:"messages,required"` +type LoadBalancerMonitorReferenceListResponseEnvelope struct { + Errors []LoadBalancerMonitorReferenceListResponseEnvelopeErrors `json:"errors,required"` + Messages []LoadBalancerMonitorReferenceListResponseEnvelopeMessages `json:"messages,required"` // List of resources that reference a given monitor. - Result []LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponse `json:"result,required,nullable"` + Result []LoadBalancerMonitorReferenceListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfo `json:"result_info"` - JSON loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeJSON `json:"-"` + Success LoadBalancerMonitorReferenceListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo LoadBalancerMonitorReferenceListResponseEnvelopeResultInfo `json:"result_info"` + JSON loadBalancerMonitorReferenceListResponseEnvelopeJSON `json:"-"` } -// loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelope] -type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeJSON struct { +// loadBalancerMonitorReferenceListResponseEnvelopeJSON contains the JSON metadata +// for the struct [LoadBalancerMonitorReferenceListResponseEnvelope] +type loadBalancerMonitorReferenceListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -99,58 +97,57 @@ type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReference ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorReferenceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrorsJSON `json:"-"` +type LoadBalancerMonitorReferenceListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerMonitorReferenceListResponseEnvelopeErrorsJSON `json:"-"` } -// loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrors] -type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrorsJSON struct { +// loadBalancerMonitorReferenceListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [LoadBalancerMonitorReferenceListResponseEnvelopeErrors] +type loadBalancerMonitorReferenceListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorReferenceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessagesJSON `json:"-"` +type LoadBalancerMonitorReferenceListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerMonitorReferenceListResponseEnvelopeMessagesJSON `json:"-"` } -// loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessages] -type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessagesJSON struct { +// loadBalancerMonitorReferenceListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [LoadBalancerMonitorReferenceListResponseEnvelopeMessages] +type loadBalancerMonitorReferenceListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorReferenceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeSuccess bool +type LoadBalancerMonitorReferenceListResponseEnvelopeSuccess bool const ( - LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeSuccessTrue LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeSuccess = true + LoadBalancerMonitorReferenceListResponseEnvelopeSuccessTrue LoadBalancerMonitorReferenceListResponseEnvelopeSuccess = true ) -type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfo struct { +type LoadBalancerMonitorReferenceListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -158,14 +155,14 @@ type LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReference // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON loadBalancerMonitorReferenceListResponseEnvelopeResultInfoJSON `json:"-"` } -// loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfo] -type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfoJSON struct { +// loadBalancerMonitorReferenceListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct +// [LoadBalancerMonitorReferenceListResponseEnvelopeResultInfo] +type loadBalancerMonitorReferenceListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -174,6 +171,6 @@ type loadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReference ExtraFields map[string]apijson.Field } -func (r *LoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferencesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerMonitorReferenceListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/loadbalancermonitorreference_test.go b/loadbalancermonitorreference_test.go index 3e444d0d611..29cc9bedfcc 100644 --- a/loadbalancermonitorreference_test.go +++ b/loadbalancermonitorreference_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorReferences(t *testing.T) { +func TestLoadBalancerMonitorReferenceList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestLoadBalancerMonitorReferenceAccountLoadBalancerMonitorsListMonitorRefer option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Monitors.References.AccountLoadBalancerMonitorsListMonitorReferences( + _, err := client.LoadBalancers.Monitors.References.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f1aba936b94213e5b8dca0c0dbf1f9cc", diff --git a/loadbalancerpoolhealth.go b/loadbalancerpoolhealth.go index 18c26e1238b..b9c2b1afdae 100644 --- a/loadbalancerpoolhealth.go +++ b/loadbalancerpoolhealth.go @@ -34,12 +34,13 @@ func NewLoadBalancerPoolHealthService(opts ...option.RequestOption) (r *LoadBala return } -// Fetch the latest pool health status for a single pool. -func (r *LoadBalancerPoolHealthService) Get(ctx context.Context, accountID string, poolID string, opts ...option.RequestOption) (res *LoadBalancerPoolHealthGetResponse, err error) { +// Preview pool health using provided monitor details. The returned preview_id can +// be used in the preview endpoint to retrieve the results. +func (r *LoadBalancerPoolHealthService) New(ctx context.Context, accountID string, poolID string, body LoadBalancerPoolHealthNewParams, opts ...option.RequestOption) (res *LoadBalancerPoolHealthNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerPoolHealthGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/health", accountID, poolID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env LoadBalancerPoolHealthNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/preview", accountID, poolID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,13 +48,12 @@ func (r *LoadBalancerPoolHealthService) Get(ctx context.Context, accountID strin return } -// Preview pool health using provided monitor details. The returned preview_id can -// be used in the preview endpoint to retrieve the results. -func (r *LoadBalancerPoolHealthService) Preview(ctx context.Context, accountID string, poolID string, body LoadBalancerPoolHealthPreviewParams, opts ...option.RequestOption) (res *LoadBalancerPoolHealthPreviewResponse, err error) { +// Fetch the latest pool health status for a single pool. +func (r *LoadBalancerPoolHealthService) Get(ctx context.Context, accountID string, poolID string, opts ...option.RequestOption) (res *LoadBalancerPoolHealthGetResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerPoolHealthPreviewResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/preview", accountID, poolID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env LoadBalancerPoolHealthGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/health", accountID, poolID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -61,6 +61,26 @@ func (r *LoadBalancerPoolHealthService) Preview(ctx context.Context, accountID s return } +type LoadBalancerPoolHealthNewResponse struct { + // Monitored pool IDs mapped to their respective names. + Pools map[string]string `json:"pools"` + PreviewID string `json:"preview_id"` + JSON loadBalancerPoolHealthNewResponseJSON `json:"-"` +} + +// loadBalancerPoolHealthNewResponseJSON contains the JSON metadata for the struct +// [LoadBalancerPoolHealthNewResponse] +type loadBalancerPoolHealthNewResponseJSON struct { + Pools apijson.Field + PreviewID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerPoolHealthNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // A list of regions from which to run health checks. Null means every Cloudflare // data center. // @@ -81,98 +101,7 @@ func init() { ) } -type LoadBalancerPoolHealthPreviewResponse struct { - // Monitored pool IDs mapped to their respective names. - Pools map[string]string `json:"pools"` - PreviewID string `json:"preview_id"` - JSON loadBalancerPoolHealthPreviewResponseJSON `json:"-"` -} - -// loadBalancerPoolHealthPreviewResponseJSON contains the JSON metadata for the -// struct [LoadBalancerPoolHealthPreviewResponse] -type loadBalancerPoolHealthPreviewResponseJSON struct { - Pools apijson.Field - PreviewID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerPoolHealthPreviewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LoadBalancerPoolHealthGetResponseEnvelope struct { - Errors []LoadBalancerPoolHealthGetResponseEnvelopeErrors `json:"errors,required"` - Messages []LoadBalancerPoolHealthGetResponseEnvelopeMessages `json:"messages,required"` - // A list of regions from which to run health checks. Null means every Cloudflare - // data center. - Result LoadBalancerPoolHealthGetResponse `json:"result,required"` - // Whether the API call was successful - Success LoadBalancerPoolHealthGetResponseEnvelopeSuccess `json:"success,required"` - JSON loadBalancerPoolHealthGetResponseEnvelopeJSON `json:"-"` -} - -// loadBalancerPoolHealthGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [LoadBalancerPoolHealthGetResponseEnvelope] -type loadBalancerPoolHealthGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerPoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LoadBalancerPoolHealthGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeErrors] -type loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerPoolHealthGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LoadBalancerPoolHealthGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeMessages] -type loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerPoolHealthGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LoadBalancerPoolHealthGetResponseEnvelopeSuccess bool - -const ( - LoadBalancerPoolHealthGetResponseEnvelopeSuccessTrue LoadBalancerPoolHealthGetResponseEnvelopeSuccess = true -) - -type LoadBalancerPoolHealthPreviewParams struct { +type LoadBalancerPoolHealthNewParams struct { // The expected HTTP response code or code range of the health check. This // parameter is only valid for HTTP and HTTPS monitors. ExpectedCodes param.Field[string] `json:"expected_codes,required"` @@ -221,38 +150,109 @@ type LoadBalancerPoolHealthPreviewParams struct { Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - Type param.Field[LoadBalancerPoolHealthPreviewParamsType] `json:"type"` + Type param.Field[LoadBalancerPoolHealthNewParamsType] `json:"type"` } -func (r LoadBalancerPoolHealthPreviewParams) MarshalJSON() (data []byte, err error) { +func (r LoadBalancerPoolHealthNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. -type LoadBalancerPoolHealthPreviewParamsType string +type LoadBalancerPoolHealthNewParamsType string + +const ( + LoadBalancerPoolHealthNewParamsTypeHTTP LoadBalancerPoolHealthNewParamsType = "http" + LoadBalancerPoolHealthNewParamsTypeHTTPS LoadBalancerPoolHealthNewParamsType = "https" + LoadBalancerPoolHealthNewParamsTypeTcp LoadBalancerPoolHealthNewParamsType = "tcp" + LoadBalancerPoolHealthNewParamsTypeUdpIcmp LoadBalancerPoolHealthNewParamsType = "udp_icmp" + LoadBalancerPoolHealthNewParamsTypeIcmpPing LoadBalancerPoolHealthNewParamsType = "icmp_ping" + LoadBalancerPoolHealthNewParamsTypeSmtp LoadBalancerPoolHealthNewParamsType = "smtp" +) + +type LoadBalancerPoolHealthNewResponseEnvelope struct { + Errors []LoadBalancerPoolHealthNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LoadBalancerPoolHealthNewResponseEnvelopeMessages `json:"messages,required"` + Result LoadBalancerPoolHealthNewResponse `json:"result,required"` + // Whether the API call was successful + Success LoadBalancerPoolHealthNewResponseEnvelopeSuccess `json:"success,required"` + JSON loadBalancerPoolHealthNewResponseEnvelopeJSON `json:"-"` +} + +// loadBalancerPoolHealthNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [LoadBalancerPoolHealthNewResponseEnvelope] +type loadBalancerPoolHealthNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerPoolHealthNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LoadBalancerPoolHealthNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LoadBalancerPoolHealthNewResponseEnvelopeErrors] +type loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerPoolHealthNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LoadBalancerPoolHealthNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LoadBalancerPoolHealthNewResponseEnvelopeMessages] +type loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerPoolHealthNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LoadBalancerPoolHealthNewResponseEnvelopeSuccess bool const ( - LoadBalancerPoolHealthPreviewParamsTypeHTTP LoadBalancerPoolHealthPreviewParamsType = "http" - LoadBalancerPoolHealthPreviewParamsTypeHTTPS LoadBalancerPoolHealthPreviewParamsType = "https" - LoadBalancerPoolHealthPreviewParamsTypeTcp LoadBalancerPoolHealthPreviewParamsType = "tcp" - LoadBalancerPoolHealthPreviewParamsTypeUdpIcmp LoadBalancerPoolHealthPreviewParamsType = "udp_icmp" - LoadBalancerPoolHealthPreviewParamsTypeIcmpPing LoadBalancerPoolHealthPreviewParamsType = "icmp_ping" - LoadBalancerPoolHealthPreviewParamsTypeSmtp LoadBalancerPoolHealthPreviewParamsType = "smtp" + LoadBalancerPoolHealthNewResponseEnvelopeSuccessTrue LoadBalancerPoolHealthNewResponseEnvelopeSuccess = true ) -type LoadBalancerPoolHealthPreviewResponseEnvelope struct { - Errors []LoadBalancerPoolHealthPreviewResponseEnvelopeErrors `json:"errors,required"` - Messages []LoadBalancerPoolHealthPreviewResponseEnvelopeMessages `json:"messages,required"` - Result LoadBalancerPoolHealthPreviewResponse `json:"result,required"` +type LoadBalancerPoolHealthGetResponseEnvelope struct { + Errors []LoadBalancerPoolHealthGetResponseEnvelopeErrors `json:"errors,required"` + Messages []LoadBalancerPoolHealthGetResponseEnvelopeMessages `json:"messages,required"` + // A list of regions from which to run health checks. Null means every Cloudflare + // data center. + Result LoadBalancerPoolHealthGetResponse `json:"result,required"` // Whether the API call was successful - Success LoadBalancerPoolHealthPreviewResponseEnvelopeSuccess `json:"success,required"` - JSON loadBalancerPoolHealthPreviewResponseEnvelopeJSON `json:"-"` + Success LoadBalancerPoolHealthGetResponseEnvelopeSuccess `json:"success,required"` + JSON loadBalancerPoolHealthGetResponseEnvelopeJSON `json:"-"` } -// loadBalancerPoolHealthPreviewResponseEnvelopeJSON contains the JSON metadata for -// the struct [LoadBalancerPoolHealthPreviewResponseEnvelope] -type loadBalancerPoolHealthPreviewResponseEnvelopeJSON struct { +// loadBalancerPoolHealthGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [LoadBalancerPoolHealthGetResponseEnvelope] +type loadBalancerPoolHealthGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -261,51 +261,51 @@ type loadBalancerPoolHealthPreviewResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *LoadBalancerPoolHealthPreviewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerPoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerPoolHealthPreviewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerPoolHealthPreviewResponseEnvelopeErrorsJSON `json:"-"` +type LoadBalancerPoolHealthGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON `json:"-"` } -// loadBalancerPoolHealthPreviewResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [LoadBalancerPoolHealthPreviewResponseEnvelopeErrors] -type loadBalancerPoolHealthPreviewResponseEnvelopeErrorsJSON struct { +// loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeErrors] +type loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerPoolHealthPreviewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerPoolHealthGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LoadBalancerPoolHealthPreviewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerPoolHealthPreviewResponseEnvelopeMessagesJSON `json:"-"` +type LoadBalancerPoolHealthGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON `json:"-"` } -// loadBalancerPoolHealthPreviewResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [LoadBalancerPoolHealthPreviewResponseEnvelopeMessages] -type loadBalancerPoolHealthPreviewResponseEnvelopeMessagesJSON struct { +// loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeMessages] +type loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LoadBalancerPoolHealthPreviewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LoadBalancerPoolHealthGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LoadBalancerPoolHealthPreviewResponseEnvelopeSuccess bool +type LoadBalancerPoolHealthGetResponseEnvelopeSuccess bool const ( - LoadBalancerPoolHealthPreviewResponseEnvelopeSuccessTrue LoadBalancerPoolHealthPreviewResponseEnvelopeSuccess = true + LoadBalancerPoolHealthGetResponseEnvelopeSuccessTrue LoadBalancerPoolHealthGetResponseEnvelopeSuccess = true ) diff --git a/loadbalancerpoolhealth_test.go b/loadbalancerpoolhealth_test.go index 0c45ff2a7d5..b193e45d9e3 100644 --- a/loadbalancerpoolhealth_test.go +++ b/loadbalancerpoolhealth_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLoadBalancerPoolHealthGet(t *testing.T) { +func TestLoadBalancerPoolHealthNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,35 @@ func TestLoadBalancerPoolHealthGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Pools.Health.Get( + _, err := client.LoadBalancers.Pools.Health.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "17b5962d775c646f3f9725cbc7a53df4", + cloudflare.LoadBalancerPoolHealthNewParams{ + ExpectedCodes: cloudflare.F("2xx"), + AllowInsecure: cloudflare.F(true), + ConsecutiveDown: cloudflare.F(int64(0)), + ConsecutiveUp: cloudflare.F(int64(0)), + Description: cloudflare.F("Login page monitor"), + ExpectedBody: cloudflare.F("alive"), + FollowRedirects: cloudflare.F(true), + Header: cloudflare.F[any](map[string]interface{}{ + "Host": map[string]interface{}{ + "0": "example.com", + }, + "X-App-ID": map[string]interface{}{ + "0": "abc123", + }, + }), + Interval: cloudflare.F(int64(0)), + Method: cloudflare.F("GET"), + Path: cloudflare.F("/health"), + Port: cloudflare.F(int64(0)), + ProbeZone: cloudflare.F("example.com"), + Retries: cloudflare.F(int64(0)), + Timeout: cloudflare.F(int64(0)), + Type: cloudflare.F(cloudflare.LoadBalancerPoolHealthNewParamsTypeHTTPS), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +68,7 @@ func TestLoadBalancerPoolHealthGet(t *testing.T) { } } -func TestLoadBalancerPoolHealthPreviewWithOptionalParams(t *testing.T) { +func TestLoadBalancerPoolHealthGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,35 +84,10 @@ func TestLoadBalancerPoolHealthPreviewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Pools.Health.Preview( + _, err := client.LoadBalancers.Pools.Health.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "17b5962d775c646f3f9725cbc7a53df4", - cloudflare.LoadBalancerPoolHealthPreviewParams{ - ExpectedCodes: cloudflare.F("2xx"), - AllowInsecure: cloudflare.F(true), - ConsecutiveDown: cloudflare.F(int64(0)), - ConsecutiveUp: cloudflare.F(int64(0)), - Description: cloudflare.F("Login page monitor"), - ExpectedBody: cloudflare.F("alive"), - FollowRedirects: cloudflare.F(true), - Header: cloudflare.F[any](map[string]interface{}{ - "Host": map[string]interface{}{ - "0": "example.com", - }, - "X-App-ID": map[string]interface{}{ - "0": "abc123", - }, - }), - Interval: cloudflare.F(int64(0)), - Method: cloudflare.F("GET"), - Path: cloudflare.F("/health"), - Port: cloudflare.F(int64(0)), - ProbeZone: cloudflare.F("example.com"), - Retries: cloudflare.F(int64(0)), - Timeout: cloudflare.F(int64(0)), - Type: cloudflare.F(cloudflare.LoadBalancerPoolHealthPreviewParamsTypeHTTPS), - }, ) if err != nil { var apierr *cloudflare.Error diff --git a/loadbalancerregion.go b/loadbalancerregion.go index 0802583c224..0353e331059 100644 --- a/loadbalancerregion.go +++ b/loadbalancerregion.go @@ -36,12 +36,12 @@ func NewLoadBalancerRegionService(opts ...option.RequestOption) (r *LoadBalancer return } -// Get a single region mapping. -func (r *LoadBalancerRegionService) Get(ctx context.Context, accountID string, regionID LoadBalancerRegionGetParamsRegionID, opts ...option.RequestOption) (res *LoadBalancerRegionGetResponse, err error) { +// List all region mappings. +func (r *LoadBalancerRegionService) List(ctx context.Context, accountID string, query LoadBalancerRegionListParams, opts ...option.RequestOption) (res *LoadBalancerRegionListResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerRegionGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/regions/%v", accountID, regionID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env LoadBalancerRegionListResponseEnvelope + path := fmt.Sprintf("accounts/%s/load_balancers/regions", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -49,12 +49,12 @@ func (r *LoadBalancerRegionService) Get(ctx context.Context, accountID string, r return } -// List all region mappings. -func (r *LoadBalancerRegionService) LoadBalancerRegionsListRegions(ctx context.Context, accountID string, query LoadBalancerRegionLoadBalancerRegionsListRegionsParams, opts ...option.RequestOption) (res *LoadBalancerRegionLoadBalancerRegionsListRegionsResponse, err error) { +// Get a single region mapping. +func (r *LoadBalancerRegionService) Get(ctx context.Context, accountID string, regionID LoadBalancerRegionGetParamsRegionID, opts ...option.RequestOption) (res *LoadBalancerRegionGetResponse, err error) { opts = append(r.Options[:], opts...) - var env LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/regions", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env LoadBalancerRegionGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/load_balancers/regions/%v", accountID, regionID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -62,17 +62,15 @@ func (r *LoadBalancerRegionService) LoadBalancerRegionsListRegions(ctx context.C return } -// A list of countries and subdivisions mapped to a region. -// -// Union satisfied by [LoadBalancerRegionGetResponseUnknown] or +// Union satisfied by [LoadBalancerRegionListResponseUnknown] or // [shared.UnionString]. -type LoadBalancerRegionGetResponse interface { - ImplementsLoadBalancerRegionGetResponse() +type LoadBalancerRegionListResponse interface { + ImplementsLoadBalancerRegionListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*LoadBalancerRegionGetResponse)(nil)).Elem(), + reflect.TypeOf((*LoadBalancerRegionListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -81,16 +79,17 @@ func init() { ) } -// Union satisfied by -// [LoadBalancerRegionLoadBalancerRegionsListRegionsResponseUnknown] or +// A list of countries and subdivisions mapped to a region. +// +// Union satisfied by [LoadBalancerRegionGetResponseUnknown] or // [shared.UnionString]. -type LoadBalancerRegionLoadBalancerRegionsListRegionsResponse interface { - ImplementsLoadBalancerRegionLoadBalancerRegionsListRegionsResponse() +type LoadBalancerRegionGetResponse interface { + ImplementsLoadBalancerRegionGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*LoadBalancerRegionLoadBalancerRegionsListRegionsResponse)(nil)).Elem(), + reflect.TypeOf((*LoadBalancerRegionGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -99,6 +98,93 @@ func init() { ) } +type LoadBalancerRegionListParams struct { + // Two-letter alpha-2 country code followed in ISO 3166-1. + CountryCodeA2 param.Field[string] `query:"country_code_a2"` + // Two-letter subdivision code followed in ISO 3166-2. + SubdivisionCode param.Field[string] `query:"subdivision_code"` + // Two-letter subdivision code followed in ISO 3166-2. + SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"` +} + +// URLQuery serializes [LoadBalancerRegionListParams]'s query parameters as +// `url.Values`. +func (r LoadBalancerRegionListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type LoadBalancerRegionListResponseEnvelope struct { + Errors []LoadBalancerRegionListResponseEnvelopeErrors `json:"errors,required"` + Messages []LoadBalancerRegionListResponseEnvelopeMessages `json:"messages,required"` + Result LoadBalancerRegionListResponse `json:"result,required"` + // Whether the API call was successful + Success LoadBalancerRegionListResponseEnvelopeSuccess `json:"success,required"` + JSON loadBalancerRegionListResponseEnvelopeJSON `json:"-"` +} + +// loadBalancerRegionListResponseEnvelopeJSON contains the JSON metadata for the +// struct [LoadBalancerRegionListResponseEnvelope] +type loadBalancerRegionListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerRegionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LoadBalancerRegionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerRegionListResponseEnvelopeErrorsJSON `json:"-"` +} + +// loadBalancerRegionListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [LoadBalancerRegionListResponseEnvelopeErrors] +type loadBalancerRegionListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerRegionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LoadBalancerRegionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON loadBalancerRegionListResponseEnvelopeMessagesJSON `json:"-"` +} + +// loadBalancerRegionListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LoadBalancerRegionListResponseEnvelopeMessages] +type loadBalancerRegionListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LoadBalancerRegionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LoadBalancerRegionListResponseEnvelopeSuccess bool + +const ( + LoadBalancerRegionListResponseEnvelopeSuccessTrue LoadBalancerRegionListResponseEnvelopeSuccess = true +) + // A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North // America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, // SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, @@ -191,93 +277,3 @@ type LoadBalancerRegionGetResponseEnvelopeSuccess bool const ( LoadBalancerRegionGetResponseEnvelopeSuccessTrue LoadBalancerRegionGetResponseEnvelopeSuccess = true ) - -type LoadBalancerRegionLoadBalancerRegionsListRegionsParams struct { - // Two-letter alpha-2 country code followed in ISO 3166-1. - CountryCodeA2 param.Field[string] `query:"country_code_a2"` - // Two-letter subdivision code followed in ISO 3166-2. - SubdivisionCode param.Field[string] `query:"subdivision_code"` - // Two-letter subdivision code followed in ISO 3166-2. - SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"` -} - -// URLQuery serializes [LoadBalancerRegionLoadBalancerRegionsListRegionsParams]'s -// query parameters as `url.Values`. -func (r LoadBalancerRegionLoadBalancerRegionsListRegionsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelope struct { - Errors []LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrors `json:"errors,required"` - Messages []LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessages `json:"messages,required"` - Result LoadBalancerRegionLoadBalancerRegionsListRegionsResponse `json:"result,required"` - // Whether the API call was successful - Success LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeSuccess `json:"success,required"` - JSON loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeJSON `json:"-"` -} - -// loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelope] -type loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrorsJSON `json:"-"` -} - -// loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrors] -type loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessagesJSON `json:"-"` -} - -// loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessages] -type loadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeSuccess bool - -const ( - LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeSuccessTrue LoadBalancerRegionLoadBalancerRegionsListRegionsResponseEnvelopeSuccess = true -) diff --git a/loadbalancerregion_test.go b/loadbalancerregion_test.go index 2d2962137a1..ec2cd510a0f 100644 --- a/loadbalancerregion_test.go +++ b/loadbalancerregion_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLoadBalancerRegionGet(t *testing.T) { +func TestLoadBalancerRegionListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,14 @@ func TestLoadBalancerRegionGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Regions.Get( + _, err := client.LoadBalancers.Regions.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LoadBalancerRegionGetParamsRegionIDWnam, + cloudflare.LoadBalancerRegionListParams{ + CountryCodeA2: cloudflare.F("US"), + SubdivisionCode: cloudflare.F("CA"), + SubdivisionCodeA2: cloudflare.F("CA"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +47,7 @@ func TestLoadBalancerRegionGet(t *testing.T) { } } -func TestLoadBalancerRegionLoadBalancerRegionsListRegionsWithOptionalParams(t *testing.T) { +func TestLoadBalancerRegionGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,14 +63,10 @@ func TestLoadBalancerRegionLoadBalancerRegionsListRegionsWithOptionalParams(t *t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.LoadBalancers.Regions.LoadBalancerRegionsListRegions( + _, err := client.LoadBalancers.Regions.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LoadBalancerRegionLoadBalancerRegionsListRegionsParams{ - CountryCodeA2: cloudflare.F("US"), - SubdivisionCode: cloudflare.F("CA"), - SubdivisionCodeA2: cloudflare.F("CA"), - }, + cloudflare.LoadBalancerRegionGetParamsRegionIDWnam, ) if err != nil { var apierr *cloudflare.Error diff --git a/log.go b/log.go index 1fb9d47288f..c1343549bb1 100644 --- a/log.go +++ b/log.go @@ -11,10 +11,10 @@ import ( // from the environment automatically. You should not instantiate this service // directly, and instead use the [NewLogService] method instead. type LogService struct { - Options []option.RequestOption - Controls *LogControlService - Rayids *LogRayidService - Receiveds *LogReceivedService + Options []option.RequestOption + Controls *LogControlService + Rayids *LogRayidService + Received *LogReceivedService } // NewLogService generates a new service that applies the given options to each @@ -25,6 +25,6 @@ func NewLogService(opts ...option.RequestOption) (r *LogService) { r.Options = opts r.Controls = NewLogControlService(opts...) r.Rayids = NewLogRayidService(opts...) - r.Receiveds = NewLogReceivedService(opts...) + r.Received = NewLogReceivedService(opts...) return } diff --git a/logcontrolcmb.go b/logcontrolcmb.go index ac282467c88..d252a029697 100644 --- a/logcontrolcmb.go +++ b/logcontrolcmb.go @@ -13,7 +13,7 @@ import ( // instead. type LogControlCmbService struct { Options []option.RequestOption - Configs *LogControlCmbConfigService + Config *LogControlCmbConfigService } // NewLogControlCmbService generates a new service that applies the given options @@ -22,6 +22,6 @@ type LogControlCmbService struct { func NewLogControlCmbService(opts ...option.RequestOption) (r *LogControlCmbService) { r = &LogControlCmbService{} r.Options = opts - r.Configs = NewLogControlCmbConfigService(opts...) + r.Config = NewLogControlCmbConfigService(opts...) return } diff --git a/logcontrolcmbconfig.go b/logcontrolcmbconfig.go index 5f480ae1ca1..b4b284dd585 100644 --- a/logcontrolcmbconfig.go +++ b/logcontrolcmbconfig.go @@ -34,12 +34,12 @@ func NewLogControlCmbConfigService(opts ...option.RequestOption) (r *LogControlC return } -// Deletes CMB config. -func (r *LogControlCmbConfigService) Delete(ctx context.Context, accountID string, opts ...option.RequestOption) (res *LogControlCmbConfigDeleteResponse, err error) { +// Updates CMB config. +func (r *LogControlCmbConfigService) New(ctx context.Context, accountID string, body LogControlCmbConfigNewParams, opts ...option.RequestOption) (res *LogControlCmbConfigNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LogControlCmbConfigDeleteResponseEnvelope + var env LogControlCmbConfigNewResponseEnvelope path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *LogControlCmbConfigService) Delete(ctx context.Context, accountID strin return } -// Gets CMB config. -func (r *LogControlCmbConfigService) GetAccountsAccountIdentifierLogsControlCmbConfig(ctx context.Context, accountID string, opts ...option.RequestOption) (res *LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse, err error) { +// Deletes CMB config. +func (r *LogControlCmbConfigService) Delete(ctx context.Context, accountID string, opts ...option.RequestOption) (res *LogControlCmbConfigDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope + var env LogControlCmbConfigDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -60,12 +60,12 @@ func (r *LogControlCmbConfigService) GetAccountsAccountIdentifierLogsControlCmbC return } -// Updates CMB config. -func (r *LogControlCmbConfigService) PutAccountsAccountIdentifierLogsControlCmbConfig(ctx context.Context, accountID string, body LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigParams, opts ...option.RequestOption) (res *LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse, err error) { +// Gets CMB config. +func (r *LogControlCmbConfigService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *LogControlCmbConfigGetResponse, err error) { opts = append(r.Options[:], opts...) - var env LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope + var env LogControlCmbConfigGetResponseEnvelope path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,6 +73,24 @@ func (r *LogControlCmbConfigService) PutAccountsAccountIdentifierLogsControlCmbC return } +type LogControlCmbConfigNewResponse struct { + // Comma-separated list of regions. + Regions string `json:"regions"` + JSON logControlCmbConfigNewResponseJSON `json:"-"` +} + +// logControlCmbConfigNewResponseJSON contains the JSON metadata for the struct +// [LogControlCmbConfigNewResponse] +type logControlCmbConfigNewResponseJSON struct { + Regions apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogControlCmbConfigNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // Union satisfied by [LogControlCmbConfigDeleteResponseUnknown], // [LogControlCmbConfigDeleteResponseArray] or [shared.UnionString]. type LogControlCmbConfigDeleteResponse interface { @@ -94,56 +112,45 @@ type LogControlCmbConfigDeleteResponseArray []interface{} func (r LogControlCmbConfigDeleteResponseArray) ImplementsLogControlCmbConfigDeleteResponse() {} -type LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse struct { +type LogControlCmbConfigGetResponse struct { // Comma-separated list of regions. - Regions string `json:"regions"` - JSON logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseJSON `json:"-"` + Regions string `json:"regions"` + JSON logControlCmbConfigGetResponseJSON `json:"-"` } -// logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse] -type logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseJSON struct { +// logControlCmbConfigGetResponseJSON contains the JSON metadata for the struct +// [LogControlCmbConfigGetResponse] +type logControlCmbConfigGetResponseJSON struct { Regions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse struct { +type LogControlCmbConfigNewParams struct { // Comma-separated list of regions. - Regions string `json:"regions"` - JSON logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseJSON `json:"-"` -} - -// logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse] -type logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseJSON struct { - Regions apijson.Field - raw string - ExtraFields map[string]apijson.Field + Regions param.Field[string] `json:"regions"` } -func (r *LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r LogControlCmbConfigNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type LogControlCmbConfigDeleteResponseEnvelope struct { - Errors []LogControlCmbConfigDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []LogControlCmbConfigDeleteResponseEnvelopeMessages `json:"messages,required"` - Result LogControlCmbConfigDeleteResponse `json:"result,required,nullable"` +type LogControlCmbConfigNewResponseEnvelope struct { + Errors []LogControlCmbConfigNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LogControlCmbConfigNewResponseEnvelopeMessages `json:"messages,required"` + Result LogControlCmbConfigNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LogControlCmbConfigDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON logControlCmbConfigDeleteResponseEnvelopeJSON `json:"-"` + Success LogControlCmbConfigNewResponseEnvelopeSuccess `json:"success,required"` + JSON logControlCmbConfigNewResponseEnvelopeJSON `json:"-"` } -// logControlCmbConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [LogControlCmbConfigDeleteResponseEnvelope] -type logControlCmbConfigDeleteResponseEnvelopeJSON struct { +// logControlCmbConfigNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogControlCmbConfigNewResponseEnvelope] +type logControlCmbConfigNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -152,68 +159,67 @@ type logControlCmbConfigDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigDeleteResponseEnvelopeErrorsJSON `json:"-"` +type LogControlCmbConfigNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigNewResponseEnvelopeErrorsJSON `json:"-"` } -// logControlCmbConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [LogControlCmbConfigDeleteResponseEnvelopeErrors] -type logControlCmbConfigDeleteResponseEnvelopeErrorsJSON struct { +// logControlCmbConfigNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [LogControlCmbConfigNewResponseEnvelopeErrors] +type logControlCmbConfigNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigDeleteResponseEnvelopeMessagesJSON `json:"-"` +type LogControlCmbConfigNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigNewResponseEnvelopeMessagesJSON `json:"-"` } -// logControlCmbConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [LogControlCmbConfigDeleteResponseEnvelopeMessages] -type logControlCmbConfigDeleteResponseEnvelopeMessagesJSON struct { +// logControlCmbConfigNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LogControlCmbConfigNewResponseEnvelopeMessages] +type logControlCmbConfigNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogControlCmbConfigDeleteResponseEnvelopeSuccess bool +type LogControlCmbConfigNewResponseEnvelopeSuccess bool const ( - LogControlCmbConfigDeleteResponseEnvelopeSuccessTrue LogControlCmbConfigDeleteResponseEnvelopeSuccess = true + LogControlCmbConfigNewResponseEnvelopeSuccessTrue LogControlCmbConfigNewResponseEnvelopeSuccess = true ) -type LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope struct { - Errors []LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors `json:"errors,required"` - Messages []LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages `json:"messages,required"` - Result LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse `json:"result,required,nullable"` +type LogControlCmbConfigDeleteResponseEnvelope struct { + Errors []LogControlCmbConfigDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []LogControlCmbConfigDeleteResponseEnvelopeMessages `json:"messages,required"` + Result LogControlCmbConfigDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess `json:"success,required"` - JSON logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON `json:"-"` + Success LogControlCmbConfigDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON logControlCmbConfigDeleteResponseEnvelopeJSON `json:"-"` } -// logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope] -type logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON struct { +// logControlCmbConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogControlCmbConfigDeleteResponseEnvelope] +type logControlCmbConfigDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -222,79 +228,67 @@ type logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponse ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON `json:"-"` +type LogControlCmbConfigDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors] -type logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON struct { +// logControlCmbConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LogControlCmbConfigDeleteResponseEnvelopeErrors] +type logControlCmbConfigDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON `json:"-"` +type LogControlCmbConfigDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages] -type logControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON struct { +// logControlCmbConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LogControlCmbConfigDeleteResponseEnvelopeMessages] +type logControlCmbConfigDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess bool +type LogControlCmbConfigDeleteResponseEnvelopeSuccess bool const ( - LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccessTrue LogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess = true + LogControlCmbConfigDeleteResponseEnvelopeSuccessTrue LogControlCmbConfigDeleteResponseEnvelopeSuccess = true ) -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigParams struct { - // Comma-separated list of regions. - Regions param.Field[string] `json:"regions"` -} - -func (r LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope struct { - Errors []LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors `json:"errors,required"` - Messages []LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages `json:"messages,required"` - Result LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse `json:"result,required,nullable"` +type LogControlCmbConfigGetResponseEnvelope struct { + Errors []LogControlCmbConfigGetResponseEnvelopeErrors `json:"errors,required"` + Messages []LogControlCmbConfigGetResponseEnvelopeMessages `json:"messages,required"` + Result LogControlCmbConfigGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess `json:"success,required"` - JSON logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON `json:"-"` + Success LogControlCmbConfigGetResponseEnvelopeSuccess `json:"success,required"` + JSON logControlCmbConfigGetResponseEnvelopeJSON `json:"-"` } -// logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope] -type logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeJSON struct { +// logControlCmbConfigGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogControlCmbConfigGetResponseEnvelope] +type logControlCmbConfigGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -303,53 +297,51 @@ type logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponse ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON `json:"-"` +type LogControlCmbConfigGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigGetResponseEnvelopeErrorsJSON `json:"-"` } -// logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors] -type logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrorsJSON struct { +// logControlCmbConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [LogControlCmbConfigGetResponseEnvelopeErrors] +type logControlCmbConfigGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON `json:"-"` +type LogControlCmbConfigGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlCmbConfigGetResponseEnvelopeMessagesJSON `json:"-"` } -// logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages] -type logControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessagesJSON struct { +// logControlCmbConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LogControlCmbConfigGetResponseEnvelopeMessages] +type logControlCmbConfigGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlCmbConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess bool +type LogControlCmbConfigGetResponseEnvelopeSuccess bool const ( - LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccessTrue LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigResponseEnvelopeSuccess = true + LogControlCmbConfigGetResponseEnvelopeSuccessTrue LogControlCmbConfigGetResponseEnvelopeSuccess = true ) diff --git a/logcontrolcmbconfig_test.go b/logcontrolcmbconfig_test.go index c3376f3ea48..1744bc6e167 100644 --- a/logcontrolcmbconfig_test.go +++ b/logcontrolcmbconfig_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogControlCmbConfigDelete(t *testing.T) { +func TestLogControlCmbConfigNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,13 @@ func TestLogControlCmbConfigDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Controls.Cmb.Configs.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Logs.Controls.Cmb.Config.New( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.LogControlCmbConfigNewParams{ + Regions: cloudflare.F("eu"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +45,7 @@ func TestLogControlCmbConfigDelete(t *testing.T) { } } -func TestLogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfig(t *testing.T) { +func TestLogControlCmbConfigDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +61,7 @@ func TestLogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfig(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Controls.Cmb.Configs.GetAccountsAccountIdentifierLogsControlCmbConfig(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Logs.Controls.Cmb.Config.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +71,7 @@ func TestLogControlCmbConfigGetAccountsAccountIdentifierLogsControlCmbConfig(t * } } -func TestLogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigWithOptionalParams(t *testing.T) { +func TestLogControlCmbConfigGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,13 +87,7 @@ func TestLogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigWith option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Controls.Cmb.Configs.PutAccountsAccountIdentifierLogsControlCmbConfig( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogControlCmbConfigPutAccountsAccountIdentifierLogsControlCmbConfigParams{ - Regions: cloudflare.F("eu"), - }, - ) + _, err := client.Logs.Controls.Cmb.Config.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/logcontrolretentionflag.go b/logcontrolretentionflag.go index 311efb24cab..7c6851583e3 100644 --- a/logcontrolretentionflag.go +++ b/logcontrolretentionflag.go @@ -31,12 +31,12 @@ func NewLogControlRetentionFlagService(opts ...option.RequestOption) (r *LogCont return } -// Gets log retention flag for Logpull API. -func (r *LogControlRetentionFlagService) LogsReceivedGetLogRetentionFlag(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse, err error) { +// Updates log retention flag for Logpull API. +func (r *LogControlRetentionFlagService) New(ctx context.Context, zoneIdentifier string, body LogControlRetentionFlagNewParams, opts ...option.RequestOption) (res *LogControlRetentionFlagNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope + var env LogControlRetentionFlagNewResponseEnvelope path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *LogControlRetentionFlagService) LogsReceivedGetLogRetentionFlag(ctx con return } -// Updates log retention flag for Logpull API. -func (r *LogControlRetentionFlagService) LogsReceivedUpdateLogRetentionFlag(ctx context.Context, zoneIdentifier string, body LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagParams, opts ...option.RequestOption) (res *LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse, err error) { +// Gets log retention flag for Logpull API. +func (r *LogControlRetentionFlagService) LogsReceivedGetLogRetentionFlag(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse, err error) { opts = append(r.Options[:], opts...) - var env LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelope + var env LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -57,6 +57,23 @@ func (r *LogControlRetentionFlagService) LogsReceivedUpdateLogRetentionFlag(ctx return } +type LogControlRetentionFlagNewResponse struct { + Flag bool `json:"flag"` + JSON logControlRetentionFlagNewResponseJSON `json:"-"` +} + +// logControlRetentionFlagNewResponseJSON contains the JSON metadata for the struct +// [LogControlRetentionFlagNewResponse] +type logControlRetentionFlagNewResponseJSON struct { + Flag apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogControlRetentionFlagNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse struct { Flag bool `json:"flag"` JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseJSON `json:"-"` @@ -75,37 +92,27 @@ func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse) Unmarsh return apijson.UnmarshalRoot(data, r) } -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse struct { - Flag bool `json:"flag"` - JSON logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseJSON `json:"-"` -} - -// logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseJSON contains -// the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse] -type logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseJSON struct { - Flag apijson.Field - raw string - ExtraFields map[string]apijson.Field +type LogControlRetentionFlagNewParams struct { + // The log retention flag for Logpull API. + Flag param.Field[bool] `json:"flag,required"` } -func (r *LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r LogControlRetentionFlagNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope struct { - Errors []LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors `json:"errors,required"` - Messages []LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages `json:"messages,required"` - Result LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse `json:"result,required"` +type LogControlRetentionFlagNewResponseEnvelope struct { + Errors []LogControlRetentionFlagNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LogControlRetentionFlagNewResponseEnvelopeMessages `json:"messages,required"` + Result LogControlRetentionFlagNewResponse `json:"result,required"` // Whether the API call was successful - Success LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess `json:"success,required"` - JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON `json:"-"` + Success LogControlRetentionFlagNewResponseEnvelopeSuccess `json:"success,required"` + JSON logControlRetentionFlagNewResponseEnvelopeJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope] -type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON struct { +// logControlRetentionFlagNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [LogControlRetentionFlagNewResponseEnvelope] +type logControlRetentionFlagNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -114,79 +121,68 @@ type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON `json:"-"` +type LogControlRetentionFlagNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlRetentionFlagNewResponseEnvelopeErrorsJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors] -type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON struct { +// logControlRetentionFlagNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LogControlRetentionFlagNewResponseEnvelopeErrors] +type logControlRetentionFlagNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON `json:"-"` +type LogControlRetentionFlagNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlRetentionFlagNewResponseEnvelopeMessagesJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages] -type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON struct { +// logControlRetentionFlagNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [LogControlRetentionFlagNewResponseEnvelopeMessages] +type logControlRetentionFlagNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess bool +type LogControlRetentionFlagNewResponseEnvelopeSuccess bool const ( - LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccessTrue LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess = true + LogControlRetentionFlagNewResponseEnvelopeSuccessTrue LogControlRetentionFlagNewResponseEnvelopeSuccess = true ) -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagParams struct { - // The log retention flag for Logpull API. - Flag param.Field[bool] `json:"flag,required"` -} - -func (r LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelope struct { - Errors []LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrors `json:"errors,required"` - Messages []LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessages `json:"messages,required"` - Result LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponse `json:"result,required"` +type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope struct { + Errors []LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors `json:"errors,required"` + Messages []LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages `json:"messages,required"` + Result LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponse `json:"result,required"` // Whether the API call was successful - Success LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeSuccess `json:"success,required"` - JSON logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeJSON `json:"-"` + Success LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess `json:"success,required"` + JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeJSON +// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON // contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelope] -type logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeJSON struct { +// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope] +type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -195,53 +191,53 @@ type logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeJS ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrorsJSON `json:"-"` +type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrorsJSON +// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrors] -type logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrorsJSON struct { +// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors] +type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessagesJSON `json:"-"` +type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON `json:"-"` } -// logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessagesJSON +// logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessages] -type logControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessagesJSON struct { +// [LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages] +type logControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeSuccess bool +type LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess bool const ( - LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeSuccessTrue LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagResponseEnvelopeSuccess = true + LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccessTrue LogControlRetentionFlagLogsReceivedGetLogRetentionFlagResponseEnvelopeSuccess = true ) diff --git a/logcontrolretentionflag_test.go b/logcontrolretentionflag_test.go index 8b6a66a39b8..a490800876a 100644 --- a/logcontrolretentionflag_test.go +++ b/logcontrolretentionflag_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogControlRetentionFlagLogsReceivedGetLogRetentionFlag(t *testing.T) { +func TestLogControlRetentionFlagNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,13 @@ func TestLogControlRetentionFlagLogsReceivedGetLogRetentionFlag(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Controls.Retentions.Flags.LogsReceivedGetLogRetentionFlag(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Logs.Controls.Retentions.Flags.New( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.LogControlRetentionFlagNewParams{ + Flag: cloudflare.F(true), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +45,7 @@ func TestLogControlRetentionFlagLogsReceivedGetLogRetentionFlag(t *testing.T) { } } -func TestLogControlRetentionFlagLogsReceivedUpdateLogRetentionFlag(t *testing.T) { +func TestLogControlRetentionFlagLogsReceivedGetLogRetentionFlag(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,13 +61,7 @@ func TestLogControlRetentionFlagLogsReceivedUpdateLogRetentionFlag(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Controls.Retentions.Flags.LogsReceivedUpdateLogRetentionFlag( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogControlRetentionFlagLogsReceivedUpdateLogRetentionFlagParams{ - Flag: cloudflare.F(true), - }, - ) + _, err := client.Logs.Controls.Retentions.Flags.LogsReceivedGetLogRetentionFlag(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/logpush.go b/logpush.go index ded82449828..2d46a31cebc 100644 --- a/logpush.go +++ b/logpush.go @@ -11,12 +11,12 @@ import ( // variables from the environment automatically. You should not instantiate this // service directly, and instead use the [NewLogpushService] method instead. type LogpushService struct { - Options []option.RequestOption - Datasets *LogpushDatasetService - Edges *LogpushEdgeService - Jobs *LogpushJobService - Ownerships *LogpushOwnershipService - Validates *LogpushValidateService + Options []option.RequestOption + Datasets *LogpushDatasetService + Edge *LogpushEdgeService + Jobs *LogpushJobService + Ownership *LogpushOwnershipService + Validate *LogpushValidateService } // NewLogpushService generates a new service that applies the given options to each @@ -26,9 +26,9 @@ func NewLogpushService(opts ...option.RequestOption) (r *LogpushService) { r = &LogpushService{} r.Options = opts r.Datasets = NewLogpushDatasetService(opts...) - r.Edges = NewLogpushEdgeService(opts...) + r.Edge = NewLogpushEdgeService(opts...) r.Jobs = NewLogpushJobService(opts...) - r.Ownerships = NewLogpushOwnershipService(opts...) - r.Validates = NewLogpushValidateService(opts...) + r.Ownership = NewLogpushOwnershipService(opts...) + r.Validate = NewLogpushValidateService(opts...) return } diff --git a/logpushedge.go b/logpushedge.go index 5936fcc861b..13e6b186a0c 100644 --- a/logpushedge.go +++ b/logpushedge.go @@ -32,9 +32,9 @@ func NewLogpushEdgeService(opts ...option.RequestOption) (r *LogpushEdgeService) } // Creates a new Instant Logs job for a zone. -func (r *LogpushEdgeService) Update(ctx context.Context, zoneID string, body LogpushEdgeUpdateParams, opts ...option.RequestOption) (res *LogpushEdgeUpdateResponse, err error) { +func (r *LogpushEdgeService) New(ctx context.Context, zoneID string, body LogpushEdgeNewParams, opts ...option.RequestOption) (res *LogpushEdgeNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LogpushEdgeUpdateResponseEnvelope + var env LogpushEdgeNewResponseEnvelope path := fmt.Sprintf("zones/%s/logpush/edge", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -57,7 +57,7 @@ func (r *LogpushEdgeService) Get(ctx context.Context, zoneID string, opts ...opt return } -type LogpushEdgeUpdateResponse struct { +type LogpushEdgeNewResponse struct { // Unique WebSocket address that will receive messages from Cloudflare’s edge. DestinationConf string `json:"destination_conf" format:"uri"` // Comma-separated list of fields. @@ -68,13 +68,13 @@ type LogpushEdgeUpdateResponse struct { // "sample": 1 is 100% of records "sample": 10 is 10% and so on. Sample int64 `json:"sample"` // Unique session id of the job. - SessionID string `json:"session_id"` - JSON logpushEdgeUpdateResponseJSON `json:"-"` + SessionID string `json:"session_id"` + JSON logpushEdgeNewResponseJSON `json:"-"` } -// logpushEdgeUpdateResponseJSON contains the JSON metadata for the struct -// [LogpushEdgeUpdateResponse] -type logpushEdgeUpdateResponseJSON struct { +// logpushEdgeNewResponseJSON contains the JSON metadata for the struct +// [LogpushEdgeNewResponse] +type logpushEdgeNewResponseJSON struct { DestinationConf apijson.Field Fields apijson.Field Filter apijson.Field @@ -84,7 +84,7 @@ type logpushEdgeUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushEdgeUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushEdgeNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -119,7 +119,7 @@ func (r *LogpushEdgeGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushEdgeUpdateParams struct { +type LogpushEdgeNewParams struct { // Comma-separated list of fields. Fields param.Field[string] `json:"fields"` // Filters to drill down into specific events. @@ -129,22 +129,22 @@ type LogpushEdgeUpdateParams struct { Sample param.Field[int64] `json:"sample"` } -func (r LogpushEdgeUpdateParams) MarshalJSON() (data []byte, err error) { +func (r LogpushEdgeNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type LogpushEdgeUpdateResponseEnvelope struct { - Errors []LogpushEdgeUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushEdgeUpdateResponseEnvelopeMessages `json:"messages,required"` - Result LogpushEdgeUpdateResponse `json:"result,required,nullable"` +type LogpushEdgeNewResponseEnvelope struct { + Errors []LogpushEdgeNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushEdgeNewResponseEnvelopeMessages `json:"messages,required"` + Result LogpushEdgeNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LogpushEdgeUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON logpushEdgeUpdateResponseEnvelopeJSON `json:"-"` + Success LogpushEdgeNewResponseEnvelopeSuccess `json:"success,required"` + JSON logpushEdgeNewResponseEnvelopeJSON `json:"-"` } -// logpushEdgeUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [LogpushEdgeUpdateResponseEnvelope] -type logpushEdgeUpdateResponseEnvelopeJSON struct { +// logpushEdgeNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [LogpushEdgeNewResponseEnvelope] +type logpushEdgeNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -153,53 +153,53 @@ type logpushEdgeUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushEdgeUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushEdgeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushEdgeUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushEdgeUpdateResponseEnvelopeErrorsJSON `json:"-"` +type LogpushEdgeNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushEdgeNewResponseEnvelopeErrorsJSON `json:"-"` } -// logpushEdgeUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [LogpushEdgeUpdateResponseEnvelopeErrors] -type logpushEdgeUpdateResponseEnvelopeErrorsJSON struct { +// logpushEdgeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [LogpushEdgeNewResponseEnvelopeErrors] +type logpushEdgeNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogpushEdgeUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushEdgeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushEdgeUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushEdgeUpdateResponseEnvelopeMessagesJSON `json:"-"` +type LogpushEdgeNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushEdgeNewResponseEnvelopeMessagesJSON `json:"-"` } -// logpushEdgeUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [LogpushEdgeUpdateResponseEnvelopeMessages] -type logpushEdgeUpdateResponseEnvelopeMessagesJSON struct { +// logpushEdgeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [LogpushEdgeNewResponseEnvelopeMessages] +type logpushEdgeNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogpushEdgeUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushEdgeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogpushEdgeUpdateResponseEnvelopeSuccess bool +type LogpushEdgeNewResponseEnvelopeSuccess bool const ( - LogpushEdgeUpdateResponseEnvelopeSuccessTrue LogpushEdgeUpdateResponseEnvelopeSuccess = true + LogpushEdgeNewResponseEnvelopeSuccessTrue LogpushEdgeNewResponseEnvelopeSuccess = true ) type LogpushEdgeGetResponseEnvelope struct { diff --git a/logpushedge_test.go b/logpushedge_test.go index 24f139a115d..e1e5b2eb082 100644 --- a/logpushedge_test.go +++ b/logpushedge_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogpushEdgeUpdateWithOptionalParams(t *testing.T) { +func TestLogpushEdgeNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestLogpushEdgeUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Edges.Update( + _, err := client.Logpush.Edge.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogpushEdgeUpdateParams{ + cloudflare.LogpushEdgeNewParams{ Fields: cloudflare.F("ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID"), Filter: cloudflare.F("{\"where\":{\"and\":[{\"key\":\"ClientCountry\",\"operator\":\"neq\",\"value\":\"ca\"}]}}"), Sample: cloudflare.F(int64(1)), @@ -63,7 +63,7 @@ func TestLogpushEdgeGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Edges.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Logpush.Edge.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/logpushjob.go b/logpushjob.go index bd60df8b792..a68e102d958 100644 --- a/logpushjob.go +++ b/logpushjob.go @@ -47,19 +47,6 @@ func (r *LogpushJobService) New(ctx context.Context, accountOrZone string, accou return } -// Updates a Logpush job. -func (r *LogpushJobService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64, body LogpushJobUpdateParams, opts ...option.RequestOption) (res *LogpushJobUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env LogpushJobUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists Logpush jobs for an account or zone. func (r *LogpushJobService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]LogpushJobListResponse, err error) { opts = append(r.Options[:], opts...) @@ -99,6 +86,19 @@ func (r *LogpushJobService) Get(ctx context.Context, accountOrZone string, accou return } +// Updates a Logpush job. +func (r *LogpushJobService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, jobID int64, body LogpushJobReplaceParams, opts ...option.RequestOption) (res *LogpushJobReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env LogpushJobReplaceResponseEnvelope + path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type LogpushJobNewResponse struct { // Unique id of the job. ID int64 `json:"id"` @@ -259,7 +259,7 @@ const ( LogpushJobNewResponseOutputOptionsTimestampFormatRfc3339 LogpushJobNewResponseOutputOptionsTimestampFormat = "rfc3339" ) -type LogpushJobUpdateResponse struct { +type LogpushJobListResponse struct { // Unique id of the job. ID int64 `json:"id"` // Name of the dataset. @@ -278,7 +278,7 @@ type LogpushJobUpdateResponse struct { // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. - Frequency LogpushJobUpdateResponseFrequency `json:"frequency,nullable"` + Frequency LogpushJobListResponseFrequency `json:"frequency,nullable"` // Records the last time for which logs have been successfully pushed. If the last // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never @@ -300,13 +300,13 @@ type LogpushJobUpdateResponse struct { Name string `json:"name,nullable"` // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. - OutputOptions LogpushJobUpdateResponseOutputOptions `json:"output_options,nullable"` - JSON logpushJobUpdateResponseJSON `json:"-"` + OutputOptions LogpushJobListResponseOutputOptions `json:"output_options,nullable"` + JSON logpushJobListResponseJSON `json:"-"` } -// logpushJobUpdateResponseJSON contains the JSON metadata for the struct -// [LogpushJobUpdateResponse] -type logpushJobUpdateResponseJSON struct { +// logpushJobListResponseJSON contains the JSON metadata for the struct +// [LogpushJobListResponse] +type logpushJobListResponseJSON struct { ID apijson.Field Dataset apijson.Field DestinationConf apijson.Field @@ -322,23 +322,23 @@ type logpushJobUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. -type LogpushJobUpdateResponseFrequency string +type LogpushJobListResponseFrequency string const ( - LogpushJobUpdateResponseFrequencyHigh LogpushJobUpdateResponseFrequency = "high" - LogpushJobUpdateResponseFrequencyLow LogpushJobUpdateResponseFrequency = "low" + LogpushJobListResponseFrequencyHigh LogpushJobListResponseFrequency = "high" + LogpushJobListResponseFrequencyLow LogpushJobListResponseFrequency = "low" ) // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. -type LogpushJobUpdateResponseOutputOptions struct { +type LogpushJobListResponseOutputOptions struct { // String to be prepended before each batch. BatchPrefix string `json:"batch_prefix,nullable"` // String to be appended after each batch. @@ -355,7 +355,7 @@ type LogpushJobUpdateResponseOutputOptions struct { // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. - OutputType LogpushJobUpdateResponseOutputOptionsOutputType `json:"output_type"` + OutputType LogpushJobListResponseOutputOptionsOutputType `json:"output_type"` // String to be inserted in-between the records as separator. RecordDelimiter string `json:"record_delimiter,nullable"` // String to be prepended before each record. @@ -372,13 +372,13 @@ type LogpushJobUpdateResponseOutputOptions struct { SampleRate float64 `json:"sample_rate,nullable"` // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. - TimestampFormat LogpushJobUpdateResponseOutputOptionsTimestampFormat `json:"timestamp_format"` - JSON logpushJobUpdateResponseOutputOptionsJSON `json:"-"` + TimestampFormat LogpushJobListResponseOutputOptionsTimestampFormat `json:"timestamp_format"` + JSON logpushJobListResponseOutputOptionsJSON `json:"-"` } -// logpushJobUpdateResponseOutputOptionsJSON contains the JSON metadata for the -// struct [LogpushJobUpdateResponseOutputOptions] -type logpushJobUpdateResponseOutputOptionsJSON struct { +// logpushJobListResponseOutputOptionsJSON contains the JSON metadata for the +// struct [LogpushJobListResponseOutputOptions] +type logpushJobListResponseOutputOptionsJSON struct { BatchPrefix apijson.Field BatchSuffix apijson.Field Cve2021_4428 apijson.Field @@ -395,31 +395,52 @@ type logpushJobUpdateResponseOutputOptionsJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobUpdateResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobListResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. -type LogpushJobUpdateResponseOutputOptionsOutputType string +type LogpushJobListResponseOutputOptionsOutputType string const ( - LogpushJobUpdateResponseOutputOptionsOutputTypeNdjson LogpushJobUpdateResponseOutputOptionsOutputType = "ndjson" - LogpushJobUpdateResponseOutputOptionsOutputTypeCsv LogpushJobUpdateResponseOutputOptionsOutputType = "csv" + LogpushJobListResponseOutputOptionsOutputTypeNdjson LogpushJobListResponseOutputOptionsOutputType = "ndjson" + LogpushJobListResponseOutputOptionsOutputTypeCsv LogpushJobListResponseOutputOptionsOutputType = "csv" ) // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. -type LogpushJobUpdateResponseOutputOptionsTimestampFormat string +type LogpushJobListResponseOutputOptionsTimestampFormat string const ( - LogpushJobUpdateResponseOutputOptionsTimestampFormatUnixnano LogpushJobUpdateResponseOutputOptionsTimestampFormat = "unixnano" - LogpushJobUpdateResponseOutputOptionsTimestampFormatUnix LogpushJobUpdateResponseOutputOptionsTimestampFormat = "unix" - LogpushJobUpdateResponseOutputOptionsTimestampFormatRfc3339 LogpushJobUpdateResponseOutputOptionsTimestampFormat = "rfc3339" + LogpushJobListResponseOutputOptionsTimestampFormatUnixnano LogpushJobListResponseOutputOptionsTimestampFormat = "unixnano" + LogpushJobListResponseOutputOptionsTimestampFormatUnix LogpushJobListResponseOutputOptionsTimestampFormat = "unix" + LogpushJobListResponseOutputOptionsTimestampFormatRfc3339 LogpushJobListResponseOutputOptionsTimestampFormat = "rfc3339" ) -type LogpushJobListResponse struct { +// Union satisfied by [LogpushJobDeleteResponseUnknown], +// [LogpushJobDeleteResponseArray] or [shared.UnionString]. +type LogpushJobDeleteResponse interface { + ImplementsLogpushJobDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*LogpushJobDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type LogpushJobDeleteResponseArray []interface{} + +func (r LogpushJobDeleteResponseArray) ImplementsLogpushJobDeleteResponse() {} + +type LogpushJobGetResponse struct { // Unique id of the job. ID int64 `json:"id"` // Name of the dataset. @@ -438,7 +459,7 @@ type LogpushJobListResponse struct { // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. - Frequency LogpushJobListResponseFrequency `json:"frequency,nullable"` + Frequency LogpushJobGetResponseFrequency `json:"frequency,nullable"` // Records the last time for which logs have been successfully pushed. If the last // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never @@ -460,13 +481,13 @@ type LogpushJobListResponse struct { Name string `json:"name,nullable"` // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. - OutputOptions LogpushJobListResponseOutputOptions `json:"output_options,nullable"` - JSON logpushJobListResponseJSON `json:"-"` + OutputOptions LogpushJobGetResponseOutputOptions `json:"output_options,nullable"` + JSON logpushJobGetResponseJSON `json:"-"` } -// logpushJobListResponseJSON contains the JSON metadata for the struct -// [LogpushJobListResponse] -type logpushJobListResponseJSON struct { +// logpushJobGetResponseJSON contains the JSON metadata for the struct +// [LogpushJobGetResponse] +type logpushJobGetResponseJSON struct { ID apijson.Field Dataset apijson.Field DestinationConf apijson.Field @@ -482,23 +503,23 @@ type logpushJobListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. -type LogpushJobListResponseFrequency string +type LogpushJobGetResponseFrequency string const ( - LogpushJobListResponseFrequencyHigh LogpushJobListResponseFrequency = "high" - LogpushJobListResponseFrequencyLow LogpushJobListResponseFrequency = "low" + LogpushJobGetResponseFrequencyHigh LogpushJobGetResponseFrequency = "high" + LogpushJobGetResponseFrequencyLow LogpushJobGetResponseFrequency = "low" ) // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. -type LogpushJobListResponseOutputOptions struct { +type LogpushJobGetResponseOutputOptions struct { // String to be prepended before each batch. BatchPrefix string `json:"batch_prefix,nullable"` // String to be appended after each batch. @@ -515,7 +536,7 @@ type LogpushJobListResponseOutputOptions struct { // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. - OutputType LogpushJobListResponseOutputOptionsOutputType `json:"output_type"` + OutputType LogpushJobGetResponseOutputOptionsOutputType `json:"output_type"` // String to be inserted in-between the records as separator. RecordDelimiter string `json:"record_delimiter,nullable"` // String to be prepended before each record. @@ -532,13 +553,13 @@ type LogpushJobListResponseOutputOptions struct { SampleRate float64 `json:"sample_rate,nullable"` // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. - TimestampFormat LogpushJobListResponseOutputOptionsTimestampFormat `json:"timestamp_format"` - JSON logpushJobListResponseOutputOptionsJSON `json:"-"` + TimestampFormat LogpushJobGetResponseOutputOptionsTimestampFormat `json:"timestamp_format"` + JSON logpushJobGetResponseOutputOptionsJSON `json:"-"` } -// logpushJobListResponseOutputOptionsJSON contains the JSON metadata for the -// struct [LogpushJobListResponseOutputOptions] -type logpushJobListResponseOutputOptionsJSON struct { +// logpushJobGetResponseOutputOptionsJSON contains the JSON metadata for the struct +// [LogpushJobGetResponseOutputOptions] +type logpushJobGetResponseOutputOptionsJSON struct { BatchPrefix apijson.Field BatchSuffix apijson.Field Cve2021_4428 apijson.Field @@ -555,52 +576,31 @@ type logpushJobListResponseOutputOptionsJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobListResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobGetResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. -type LogpushJobListResponseOutputOptionsOutputType string +type LogpushJobGetResponseOutputOptionsOutputType string const ( - LogpushJobListResponseOutputOptionsOutputTypeNdjson LogpushJobListResponseOutputOptionsOutputType = "ndjson" - LogpushJobListResponseOutputOptionsOutputTypeCsv LogpushJobListResponseOutputOptionsOutputType = "csv" + LogpushJobGetResponseOutputOptionsOutputTypeNdjson LogpushJobGetResponseOutputOptionsOutputType = "ndjson" + LogpushJobGetResponseOutputOptionsOutputTypeCsv LogpushJobGetResponseOutputOptionsOutputType = "csv" ) // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. -type LogpushJobListResponseOutputOptionsTimestampFormat string +type LogpushJobGetResponseOutputOptionsTimestampFormat string const ( - LogpushJobListResponseOutputOptionsTimestampFormatUnixnano LogpushJobListResponseOutputOptionsTimestampFormat = "unixnano" - LogpushJobListResponseOutputOptionsTimestampFormatUnix LogpushJobListResponseOutputOptionsTimestampFormat = "unix" - LogpushJobListResponseOutputOptionsTimestampFormatRfc3339 LogpushJobListResponseOutputOptionsTimestampFormat = "rfc3339" + LogpushJobGetResponseOutputOptionsTimestampFormatUnixnano LogpushJobGetResponseOutputOptionsTimestampFormat = "unixnano" + LogpushJobGetResponseOutputOptionsTimestampFormatUnix LogpushJobGetResponseOutputOptionsTimestampFormat = "unix" + LogpushJobGetResponseOutputOptionsTimestampFormatRfc3339 LogpushJobGetResponseOutputOptionsTimestampFormat = "rfc3339" ) -// Union satisfied by [LogpushJobDeleteResponseUnknown], -// [LogpushJobDeleteResponseArray] or [shared.UnionString]. -type LogpushJobDeleteResponse interface { - ImplementsLogpushJobDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*LogpushJobDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type LogpushJobDeleteResponseArray []interface{} - -func (r LogpushJobDeleteResponseArray) ImplementsLogpushJobDeleteResponse() {} - -type LogpushJobGetResponse struct { +type LogpushJobReplaceResponse struct { // Unique id of the job. ID int64 `json:"id"` // Name of the dataset. @@ -619,7 +619,7 @@ type LogpushJobGetResponse struct { // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. - Frequency LogpushJobGetResponseFrequency `json:"frequency,nullable"` + Frequency LogpushJobReplaceResponseFrequency `json:"frequency,nullable"` // Records the last time for which logs have been successfully pushed. If the last // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never @@ -641,13 +641,13 @@ type LogpushJobGetResponse struct { Name string `json:"name,nullable"` // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. - OutputOptions LogpushJobGetResponseOutputOptions `json:"output_options,nullable"` - JSON logpushJobGetResponseJSON `json:"-"` + OutputOptions LogpushJobReplaceResponseOutputOptions `json:"output_options,nullable"` + JSON logpushJobReplaceResponseJSON `json:"-"` } -// logpushJobGetResponseJSON contains the JSON metadata for the struct -// [LogpushJobGetResponse] -type logpushJobGetResponseJSON struct { +// logpushJobReplaceResponseJSON contains the JSON metadata for the struct +// [LogpushJobReplaceResponse] +type logpushJobReplaceResponseJSON struct { ID apijson.Field Dataset apijson.Field DestinationConf apijson.Field @@ -663,23 +663,23 @@ type logpushJobGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The frequency at which Cloudflare sends batches of logs to your destination. // Setting frequency to high sends your logs in larger quantities of smaller files. // Setting frequency to low sends logs in smaller quantities of larger files. -type LogpushJobGetResponseFrequency string +type LogpushJobReplaceResponseFrequency string const ( - LogpushJobGetResponseFrequencyHigh LogpushJobGetResponseFrequency = "high" - LogpushJobGetResponseFrequencyLow LogpushJobGetResponseFrequency = "low" + LogpushJobReplaceResponseFrequencyHigh LogpushJobReplaceResponseFrequency = "high" + LogpushJobReplaceResponseFrequencyLow LogpushJobReplaceResponseFrequency = "low" ) // The structured replacement for `logpull_options`. When including this field, the // `logpull_option` field will be ignored. -type LogpushJobGetResponseOutputOptions struct { +type LogpushJobReplaceResponseOutputOptions struct { // String to be prepended before each batch. BatchPrefix string `json:"batch_prefix,nullable"` // String to be appended after each batch. @@ -696,7 +696,7 @@ type LogpushJobGetResponseOutputOptions struct { // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. - OutputType LogpushJobGetResponseOutputOptionsOutputType `json:"output_type"` + OutputType LogpushJobReplaceResponseOutputOptionsOutputType `json:"output_type"` // String to be inserted in-between the records as separator. RecordDelimiter string `json:"record_delimiter,nullable"` // String to be prepended before each record. @@ -713,13 +713,13 @@ type LogpushJobGetResponseOutputOptions struct { SampleRate float64 `json:"sample_rate,nullable"` // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. - TimestampFormat LogpushJobGetResponseOutputOptionsTimestampFormat `json:"timestamp_format"` - JSON logpushJobGetResponseOutputOptionsJSON `json:"-"` + TimestampFormat LogpushJobReplaceResponseOutputOptionsTimestampFormat `json:"timestamp_format"` + JSON logpushJobReplaceResponseOutputOptionsJSON `json:"-"` } -// logpushJobGetResponseOutputOptionsJSON contains the JSON metadata for the struct -// [LogpushJobGetResponseOutputOptions] -type logpushJobGetResponseOutputOptionsJSON struct { +// logpushJobReplaceResponseOutputOptionsJSON contains the JSON metadata for the +// struct [LogpushJobReplaceResponseOutputOptions] +type logpushJobReplaceResponseOutputOptionsJSON struct { BatchPrefix apijson.Field BatchSuffix apijson.Field Cve2021_4428 apijson.Field @@ -736,28 +736,28 @@ type logpushJobGetResponseOutputOptionsJSON struct { ExtraFields map[string]apijson.Field } -func (r *LogpushJobGetResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushJobReplaceResponseOutputOptions) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the output type, such as `ndjson` or `csv`. This sets default values // for the rest of the settings, depending on the chosen output type. Some // formatting rules, like string quoting, are different between output types. -type LogpushJobGetResponseOutputOptionsOutputType string +type LogpushJobReplaceResponseOutputOptionsOutputType string const ( - LogpushJobGetResponseOutputOptionsOutputTypeNdjson LogpushJobGetResponseOutputOptionsOutputType = "ndjson" - LogpushJobGetResponseOutputOptionsOutputTypeCsv LogpushJobGetResponseOutputOptionsOutputType = "csv" + LogpushJobReplaceResponseOutputOptionsOutputTypeNdjson LogpushJobReplaceResponseOutputOptionsOutputType = "ndjson" + LogpushJobReplaceResponseOutputOptionsOutputTypeCsv LogpushJobReplaceResponseOutputOptionsOutputType = "csv" ) // String to specify the format for timestamps, such as `unixnano`, `unix`, or // `rfc3339`. -type LogpushJobGetResponseOutputOptionsTimestampFormat string +type LogpushJobReplaceResponseOutputOptionsTimestampFormat string const ( - LogpushJobGetResponseOutputOptionsTimestampFormatUnixnano LogpushJobGetResponseOutputOptionsTimestampFormat = "unixnano" - LogpushJobGetResponseOutputOptionsTimestampFormatUnix LogpushJobGetResponseOutputOptionsTimestampFormat = "unix" - LogpushJobGetResponseOutputOptionsTimestampFormatRfc3339 LogpushJobGetResponseOutputOptionsTimestampFormat = "rfc3339" + LogpushJobReplaceResponseOutputOptionsTimestampFormatUnixnano LogpushJobReplaceResponseOutputOptionsTimestampFormat = "unixnano" + LogpushJobReplaceResponseOutputOptionsTimestampFormatUnix LogpushJobReplaceResponseOutputOptionsTimestampFormat = "unix" + LogpushJobReplaceResponseOutputOptionsTimestampFormatRfc3339 LogpushJobReplaceResponseOutputOptionsTimestampFormat = "rfc3339" ) type LogpushJobNewParams struct { @@ -936,176 +936,6 @@ const ( LogpushJobNewResponseEnvelopeSuccessTrue LogpushJobNewResponseEnvelopeSuccess = true ) -type LogpushJobUpdateParams struct { - // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - // Additional configuration parameters supported by the destination may be - // included. - DestinationConf param.Field[string] `json:"destination_conf" format:"uri"` - // Flag that indicates if the job is enabled. - Enabled param.Field[bool] `json:"enabled"` - // The frequency at which Cloudflare sends batches of logs to your destination. - // Setting frequency to high sends your logs in larger quantities of smaller files. - // Setting frequency to low sends logs in smaller quantities of larger files. - Frequency param.Field[LogpushJobUpdateParamsFrequency] `json:"frequency"` - // This field is deprecated. Use `output_options` instead. Configuration string. It - // specifies things like requested fields and timestamp formats. If migrating from - // the logpull api, copy the url (full url or just the query string) of your call - // here, and logpush will keep on making this call for you, setting start and end - // times appropriately. - LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"` - // The structured replacement for `logpull_options`. When including this field, the - // `logpull_option` field will be ignored. - OutputOptions param.Field[LogpushJobUpdateParamsOutputOptions] `json:"output_options"` - // Ownership challenge token to prove destination ownership. - OwnershipChallenge param.Field[string] `json:"ownership_challenge"` -} - -func (r LogpushJobUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The frequency at which Cloudflare sends batches of logs to your destination. -// Setting frequency to high sends your logs in larger quantities of smaller files. -// Setting frequency to low sends logs in smaller quantities of larger files. -type LogpushJobUpdateParamsFrequency string - -const ( - LogpushJobUpdateParamsFrequencyHigh LogpushJobUpdateParamsFrequency = "high" - LogpushJobUpdateParamsFrequencyLow LogpushJobUpdateParamsFrequency = "low" -) - -// The structured replacement for `logpull_options`. When including this field, the -// `logpull_option` field will be ignored. -type LogpushJobUpdateParamsOutputOptions struct { - // String to be prepended before each batch. - BatchPrefix param.Field[string] `json:"batch_prefix"` - // String to be appended after each batch. - BatchSuffix param.Field[string] `json:"batch_suffix"` - // If set to true, will cause all occurrences of `${` in the generated files to be - // replaced with `x{`. - Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"` - // String to join fields. This field be ignored when `record_template` is set. - FieldDelimiter param.Field[string] `json:"field_delimiter"` - // List of field names to be included in the Logpush output. For the moment, there - // is no option to add all fields at once, so you must specify all the fields names - // you are interested in. - FieldNames param.Field[[]string] `json:"field_names"` - // Specifies the output type, such as `ndjson` or `csv`. This sets default values - // for the rest of the settings, depending on the chosen output type. Some - // formatting rules, like string quoting, are different between output types. - OutputType param.Field[LogpushJobUpdateParamsOutputOptionsOutputType] `json:"output_type"` - // String to be inserted in-between the records as separator. - RecordDelimiter param.Field[string] `json:"record_delimiter"` - // String to be prepended before each record. - RecordPrefix param.Field[string] `json:"record_prefix"` - // String to be appended after each record. - RecordSuffix param.Field[string] `json:"record_suffix"` - // String to use as template for each record instead of the default comma-separated - // list. All fields used in the template must be present in `field_names` as well, - // otherwise they will end up as null. Format as a Go `text/template` without any - // standard functions, like conditionals, loops, sub-templates, etc. - RecordTemplate param.Field[string] `json:"record_template"` - // Floating number to specify sampling rate. Sampling is applied on top of - // filtering, and regardless of the current `sample_interval` of the data. - SampleRate param.Field[float64] `json:"sample_rate"` - // String to specify the format for timestamps, such as `unixnano`, `unix`, or - // `rfc3339`. - TimestampFormat param.Field[LogpushJobUpdateParamsOutputOptionsTimestampFormat] `json:"timestamp_format"` -} - -func (r LogpushJobUpdateParamsOutputOptions) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Specifies the output type, such as `ndjson` or `csv`. This sets default values -// for the rest of the settings, depending on the chosen output type. Some -// formatting rules, like string quoting, are different between output types. -type LogpushJobUpdateParamsOutputOptionsOutputType string - -const ( - LogpushJobUpdateParamsOutputOptionsOutputTypeNdjson LogpushJobUpdateParamsOutputOptionsOutputType = "ndjson" - LogpushJobUpdateParamsOutputOptionsOutputTypeCsv LogpushJobUpdateParamsOutputOptionsOutputType = "csv" -) - -// String to specify the format for timestamps, such as `unixnano`, `unix`, or -// `rfc3339`. -type LogpushJobUpdateParamsOutputOptionsTimestampFormat string - -const ( - LogpushJobUpdateParamsOutputOptionsTimestampFormatUnixnano LogpushJobUpdateParamsOutputOptionsTimestampFormat = "unixnano" - LogpushJobUpdateParamsOutputOptionsTimestampFormatUnix LogpushJobUpdateParamsOutputOptionsTimestampFormat = "unix" - LogpushJobUpdateParamsOutputOptionsTimestampFormatRfc3339 LogpushJobUpdateParamsOutputOptionsTimestampFormat = "rfc3339" -) - -type LogpushJobUpdateResponseEnvelope struct { - Errors []LogpushJobUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushJobUpdateResponseEnvelopeMessages `json:"messages,required"` - Result LogpushJobUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success LogpushJobUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON logpushJobUpdateResponseEnvelopeJSON `json:"-"` -} - -// logpushJobUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [LogpushJobUpdateResponseEnvelope] -type logpushJobUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushJobUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushJobUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushJobUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// logpushJobUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [LogpushJobUpdateResponseEnvelopeErrors] -type logpushJobUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushJobUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushJobUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushJobUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// logpushJobUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [LogpushJobUpdateResponseEnvelopeMessages] -type logpushJobUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushJobUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LogpushJobUpdateResponseEnvelopeSuccess bool - -const ( - LogpushJobUpdateResponseEnvelopeSuccessTrue LogpushJobUpdateResponseEnvelopeSuccess = true -) - type LogpushJobListResponseEnvelope struct { Errors []LogpushJobListResponseEnvelopeErrors `json:"errors,required"` Messages []LogpushJobListResponseEnvelopeMessages `json:"messages,required"` @@ -1312,3 +1142,173 @@ type LogpushJobGetResponseEnvelopeSuccess bool const ( LogpushJobGetResponseEnvelopeSuccessTrue LogpushJobGetResponseEnvelopeSuccess = true ) + +type LogpushJobReplaceParams struct { + // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + // Additional configuration parameters supported by the destination may be + // included. + DestinationConf param.Field[string] `json:"destination_conf" format:"uri"` + // Flag that indicates if the job is enabled. + Enabled param.Field[bool] `json:"enabled"` + // The frequency at which Cloudflare sends batches of logs to your destination. + // Setting frequency to high sends your logs in larger quantities of smaller files. + // Setting frequency to low sends logs in smaller quantities of larger files. + Frequency param.Field[LogpushJobReplaceParamsFrequency] `json:"frequency"` + // This field is deprecated. Use `output_options` instead. Configuration string. It + // specifies things like requested fields and timestamp formats. If migrating from + // the logpull api, copy the url (full url or just the query string) of your call + // here, and logpush will keep on making this call for you, setting start and end + // times appropriately. + LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"` + // The structured replacement for `logpull_options`. When including this field, the + // `logpull_option` field will be ignored. + OutputOptions param.Field[LogpushJobReplaceParamsOutputOptions] `json:"output_options"` + // Ownership challenge token to prove destination ownership. + OwnershipChallenge param.Field[string] `json:"ownership_challenge"` +} + +func (r LogpushJobReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The frequency at which Cloudflare sends batches of logs to your destination. +// Setting frequency to high sends your logs in larger quantities of smaller files. +// Setting frequency to low sends logs in smaller quantities of larger files. +type LogpushJobReplaceParamsFrequency string + +const ( + LogpushJobReplaceParamsFrequencyHigh LogpushJobReplaceParamsFrequency = "high" + LogpushJobReplaceParamsFrequencyLow LogpushJobReplaceParamsFrequency = "low" +) + +// The structured replacement for `logpull_options`. When including this field, the +// `logpull_option` field will be ignored. +type LogpushJobReplaceParamsOutputOptions struct { + // String to be prepended before each batch. + BatchPrefix param.Field[string] `json:"batch_prefix"` + // String to be appended after each batch. + BatchSuffix param.Field[string] `json:"batch_suffix"` + // If set to true, will cause all occurrences of `${` in the generated files to be + // replaced with `x{`. + Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"` + // String to join fields. This field be ignored when `record_template` is set. + FieldDelimiter param.Field[string] `json:"field_delimiter"` + // List of field names to be included in the Logpush output. For the moment, there + // is no option to add all fields at once, so you must specify all the fields names + // you are interested in. + FieldNames param.Field[[]string] `json:"field_names"` + // Specifies the output type, such as `ndjson` or `csv`. This sets default values + // for the rest of the settings, depending on the chosen output type. Some + // formatting rules, like string quoting, are different between output types. + OutputType param.Field[LogpushJobReplaceParamsOutputOptionsOutputType] `json:"output_type"` + // String to be inserted in-between the records as separator. + RecordDelimiter param.Field[string] `json:"record_delimiter"` + // String to be prepended before each record. + RecordPrefix param.Field[string] `json:"record_prefix"` + // String to be appended after each record. + RecordSuffix param.Field[string] `json:"record_suffix"` + // String to use as template for each record instead of the default comma-separated + // list. All fields used in the template must be present in `field_names` as well, + // otherwise they will end up as null. Format as a Go `text/template` without any + // standard functions, like conditionals, loops, sub-templates, etc. + RecordTemplate param.Field[string] `json:"record_template"` + // Floating number to specify sampling rate. Sampling is applied on top of + // filtering, and regardless of the current `sample_interval` of the data. + SampleRate param.Field[float64] `json:"sample_rate"` + // String to specify the format for timestamps, such as `unixnano`, `unix`, or + // `rfc3339`. + TimestampFormat param.Field[LogpushJobReplaceParamsOutputOptionsTimestampFormat] `json:"timestamp_format"` +} + +func (r LogpushJobReplaceParamsOutputOptions) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Specifies the output type, such as `ndjson` or `csv`. This sets default values +// for the rest of the settings, depending on the chosen output type. Some +// formatting rules, like string quoting, are different between output types. +type LogpushJobReplaceParamsOutputOptionsOutputType string + +const ( + LogpushJobReplaceParamsOutputOptionsOutputTypeNdjson LogpushJobReplaceParamsOutputOptionsOutputType = "ndjson" + LogpushJobReplaceParamsOutputOptionsOutputTypeCsv LogpushJobReplaceParamsOutputOptionsOutputType = "csv" +) + +// String to specify the format for timestamps, such as `unixnano`, `unix`, or +// `rfc3339`. +type LogpushJobReplaceParamsOutputOptionsTimestampFormat string + +const ( + LogpushJobReplaceParamsOutputOptionsTimestampFormatUnixnano LogpushJobReplaceParamsOutputOptionsTimestampFormat = "unixnano" + LogpushJobReplaceParamsOutputOptionsTimestampFormatUnix LogpushJobReplaceParamsOutputOptionsTimestampFormat = "unix" + LogpushJobReplaceParamsOutputOptionsTimestampFormatRfc3339 LogpushJobReplaceParamsOutputOptionsTimestampFormat = "rfc3339" +) + +type LogpushJobReplaceResponseEnvelope struct { + Errors []LogpushJobReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushJobReplaceResponseEnvelopeMessages `json:"messages,required"` + Result LogpushJobReplaceResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success LogpushJobReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON logpushJobReplaceResponseEnvelopeJSON `json:"-"` +} + +// logpushJobReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [LogpushJobReplaceResponseEnvelope] +type logpushJobReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushJobReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushJobReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushJobReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// logpushJobReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [LogpushJobReplaceResponseEnvelopeErrors] +type logpushJobReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushJobReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushJobReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushJobReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// logpushJobReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [LogpushJobReplaceResponseEnvelopeMessages] +type logpushJobReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushJobReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LogpushJobReplaceResponseEnvelopeSuccess bool + +const ( + LogpushJobReplaceResponseEnvelopeSuccessTrue LogpushJobReplaceResponseEnvelopeSuccess = true +) diff --git a/logpushjob_test.go b/logpushjob_test.go index 62175d0711c..ccfe453ac0b 100644 --- a/logpushjob_test.go +++ b/logpushjob_test.go @@ -66,7 +66,7 @@ func TestLogpushJobNewWithOptionalParams(t *testing.T) { } } -func TestLogpushJobUpdateWithOptionalParams(t *testing.T) { +func TestLogpushJobList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -82,32 +82,10 @@ func TestLogpushJobUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Jobs.Update( + _, err := client.Logpush.Jobs.List( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - int64(1), - cloudflare.LogpushJobUpdateParams{ - DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), - Enabled: cloudflare.F(false), - Frequency: cloudflare.F(cloudflare.LogpushJobUpdateParamsFrequencyHigh), - LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"), - OutputOptions: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptions{ - Cve2021_4428: cloudflare.F(true), - BatchPrefix: cloudflare.F("string"), - BatchSuffix: cloudflare.F("string"), - FieldDelimiter: cloudflare.F("string"), - FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}), - OutputType: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptionsOutputTypeNdjson), - RecordDelimiter: cloudflare.F("string"), - RecordPrefix: cloudflare.F("string"), - RecordSuffix: cloudflare.F("string"), - RecordTemplate: cloudflare.F("string"), - SampleRate: cloudflare.F(0.000000), - TimestampFormat: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptionsTimestampFormatUnixnano), - }), - OwnershipChallenge: cloudflare.F("00000000000000000000"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -118,7 +96,7 @@ func TestLogpushJobUpdateWithOptionalParams(t *testing.T) { } } -func TestLogpushJobList(t *testing.T) { +func TestLogpushJobDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -134,10 +112,11 @@ func TestLogpushJobList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Jobs.List( + _, err := client.Logpush.Jobs.Delete( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", + int64(1), ) if err != nil { var apierr *cloudflare.Error @@ -148,7 +127,7 @@ func TestLogpushJobList(t *testing.T) { } } -func TestLogpushJobDelete(t *testing.T) { +func TestLogpushJobGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -164,7 +143,7 @@ func TestLogpushJobDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Jobs.Delete( + _, err := client.Logpush.Jobs.Get( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", @@ -179,7 +158,7 @@ func TestLogpushJobDelete(t *testing.T) { } } -func TestLogpushJobGet(t *testing.T) { +func TestLogpushJobReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -195,11 +174,32 @@ func TestLogpushJobGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Jobs.Get( + _, err := client.Logpush.Jobs.Replace( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", int64(1), + cloudflare.LogpushJobReplaceParams{ + DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), + Enabled: cloudflare.F(false), + Frequency: cloudflare.F(cloudflare.LogpushJobReplaceParamsFrequencyHigh), + LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"), + OutputOptions: cloudflare.F(cloudflare.LogpushJobReplaceParamsOutputOptions{ + Cve2021_4428: cloudflare.F(true), + BatchPrefix: cloudflare.F("string"), + BatchSuffix: cloudflare.F("string"), + FieldDelimiter: cloudflare.F("string"), + FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}), + OutputType: cloudflare.F(cloudflare.LogpushJobReplaceParamsOutputOptionsOutputTypeNdjson), + RecordDelimiter: cloudflare.F("string"), + RecordPrefix: cloudflare.F("string"), + RecordSuffix: cloudflare.F("string"), + RecordTemplate: cloudflare.F("string"), + SampleRate: cloudflare.F(0.000000), + TimestampFormat: cloudflare.F(cloudflare.LogpushJobReplaceParamsOutputOptionsTimestampFormatUnixnano), + }), + OwnershipChallenge: cloudflare.F("00000000000000000000"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/logpushownership.go b/logpushownership.go index 7ee72bdebc4..24b15376eeb 100644 --- a/logpushownership.go +++ b/logpushownership.go @@ -19,8 +19,7 @@ import ( // this service directly, and instead use the [NewLogpushOwnershipService] method // instead. type LogpushOwnershipService struct { - Options []option.RequestOption - Validates *LogpushOwnershipValidateService + Options []option.RequestOption } // NewLogpushOwnershipService generates a new service that applies the given @@ -29,14 +28,13 @@ type LogpushOwnershipService struct { func NewLogpushOwnershipService(opts ...option.RequestOption) (r *LogpushOwnershipService) { r = &LogpushOwnershipService{} r.Options = opts - r.Validates = NewLogpushOwnershipValidateService(opts...) return } // Gets a new ownership challenge sent to your destination. -func (r *LogpushOwnershipService) PostAccountsAccountIdentifierLogpushOwnership(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipParams, opts ...option.RequestOption) (res *LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse, err error) { +func (r *LogpushOwnershipService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushOwnershipNewParams, opts ...option.RequestOption) (res *LogpushOwnershipNewResponse, err error) { opts = append(r.Options[:], opts...) - var env LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelope + var env LogpushOwnershipNewResponseEnvelope path := fmt.Sprintf("%s/%s/logpush/ownership", accountOrZone, accountOrZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -46,17 +44,29 @@ func (r *LogpushOwnershipService) PostAccountsAccountIdentifierLogpushOwnership( return } -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse struct { - Filename string `json:"filename"` - Message string `json:"message"` - Valid bool `json:"valid"` - JSON logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseJSON `json:"-"` +// Validates ownership challenge of the destination. +func (r *LogpushOwnershipService) Validate(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushOwnershipValidateParams, opts ...option.RequestOption) (res *LogpushOwnershipValidateResponse, err error) { + opts = append(r.Options[:], opts...) + var env LogpushOwnershipValidateResponseEnvelope + path := fmt.Sprintf("%s/%s/logpush/ownership/validate", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type LogpushOwnershipNewResponse struct { + Filename string `json:"filename"` + Message string `json:"message"` + Valid bool `json:"valid"` + JSON logpushOwnershipNewResponseJSON `json:"-"` } -// logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse] -type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseJSON struct { +// logpushOwnershipNewResponseJSON contains the JSON metadata for the struct +// [LogpushOwnershipNewResponse] +type logpushOwnershipNewResponseJSON struct { Filename apijson.Field Message apijson.Field Valid apijson.Field @@ -64,34 +74,132 @@ type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseJSON s ExtraFields map[string]apijson.Field } -func (r *LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushOwnershipNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipParams struct { +type LogpushOwnershipValidateResponse struct { + Valid bool `json:"valid"` + JSON logpushOwnershipValidateResponseJSON `json:"-"` +} + +// logpushOwnershipValidateResponseJSON contains the JSON metadata for the struct +// [LogpushOwnershipValidateResponse] +type logpushOwnershipValidateResponseJSON struct { + Valid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushOwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushOwnershipNewParams struct { + // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + // Additional configuration parameters supported by the destination may be + // included. + DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"` +} + +func (r LogpushOwnershipNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type LogpushOwnershipNewResponseEnvelope struct { + Errors []LogpushOwnershipNewResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushOwnershipNewResponseEnvelopeMessages `json:"messages,required"` + Result LogpushOwnershipNewResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success LogpushOwnershipNewResponseEnvelopeSuccess `json:"success,required"` + JSON logpushOwnershipNewResponseEnvelopeJSON `json:"-"` +} + +// logpushOwnershipNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogpushOwnershipNewResponseEnvelope] +type logpushOwnershipNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushOwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushOwnershipNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushOwnershipNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// logpushOwnershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [LogpushOwnershipNewResponseEnvelopeErrors] +type logpushOwnershipNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushOwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushOwnershipNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushOwnershipNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// logpushOwnershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [LogpushOwnershipNewResponseEnvelopeMessages] +type logpushOwnershipNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushOwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LogpushOwnershipNewResponseEnvelopeSuccess bool + +const ( + LogpushOwnershipNewResponseEnvelopeSuccessTrue LogpushOwnershipNewResponseEnvelopeSuccess = true +) + +type LogpushOwnershipValidateParams struct { // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. // Additional configuration parameters supported by the destination may be // included. DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"` + // Ownership challenge token to prove destination ownership. + OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"` } -func (r LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipParams) MarshalJSON() (data []byte, err error) { +func (r LogpushOwnershipValidateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelope struct { - Errors []LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessages `json:"messages,required"` - Result LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponse `json:"result,required,nullable"` +type LogpushOwnershipValidateResponseEnvelope struct { + Errors []LogpushOwnershipValidateResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushOwnershipValidateResponseEnvelopeMessages `json:"messages,required"` + Result LogpushOwnershipValidateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeSuccess `json:"success,required"` - JSON logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeJSON `json:"-"` + Success LogpushOwnershipValidateResponseEnvelopeSuccess `json:"success,required"` + JSON logpushOwnershipValidateResponseEnvelopeJSON `json:"-"` } -// logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelope] -type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeJSON struct { +// logpushOwnershipValidateResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogpushOwnershipValidateResponseEnvelope] +type logpushOwnershipValidateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -100,53 +208,51 @@ type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelo ExtraFields map[string]apijson.Field } -func (r *LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushOwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrorsJSON `json:"-"` +type LogpushOwnershipValidateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushOwnershipValidateResponseEnvelopeErrorsJSON `json:"-"` } -// logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrors] -type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrorsJSON struct { +// logpushOwnershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LogpushOwnershipValidateResponseEnvelopeErrors] +type logpushOwnershipValidateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushOwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessagesJSON `json:"-"` +type LogpushOwnershipValidateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushOwnershipValidateResponseEnvelopeMessagesJSON `json:"-"` } -// logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessages] -type logpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessagesJSON struct { +// logpushOwnershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [LogpushOwnershipValidateResponseEnvelopeMessages] +type logpushOwnershipValidateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *LogpushOwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeSuccess bool +type LogpushOwnershipValidateResponseEnvelopeSuccess bool const ( - LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeSuccessTrue LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipResponseEnvelopeSuccess = true + LogpushOwnershipValidateResponseEnvelopeSuccessTrue LogpushOwnershipValidateResponseEnvelopeSuccess = true ) diff --git a/logpushownership_test.go b/logpushownership_test.go index fe7491a5267..1e7dd41dffe 100644 --- a/logpushownership_test.go +++ b/logpushownership_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogpushOwnershipPostAccountsAccountIdentifierLogpushOwnership(t *testing.T) { +func TestLogpushOwnershipNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestLogpushOwnershipPostAccountsAccountIdentifierLogpushOwnership(t *testin option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logpush.Ownerships.PostAccountsAccountIdentifierLogpushOwnership( + _, err := client.Logpush.Ownership.New( context.TODO(), "string", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogpushOwnershipPostAccountsAccountIdentifierLogpushOwnershipParams{ + cloudflare.LogpushOwnershipNewParams{ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), }, ) @@ -45,3 +45,37 @@ func TestLogpushOwnershipPostAccountsAccountIdentifierLogpushOwnership(t *testin t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestLogpushOwnershipValidate(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Logpush.Ownership.Validate( + context.TODO(), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.LogpushOwnershipValidateParams{ + DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), + OwnershipChallenge: cloudflare.F("00000000000000000000"), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/logpushownershipvalidate.go b/logpushownershipvalidate.go deleted file mode 100644 index e8dd2acf0a4..00000000000 --- a/logpushownershipvalidate.go +++ /dev/null @@ -1,148 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// LogpushOwnershipValidateService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewLogpushOwnershipValidateService] method instead. -type LogpushOwnershipValidateService struct { - Options []option.RequestOption -} - -// NewLogpushOwnershipValidateService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewLogpushOwnershipValidateService(opts ...option.RequestOption) (r *LogpushOwnershipValidateService) { - r = &LogpushOwnershipValidateService{} - r.Options = opts - return -} - -// Validates ownership challenge of the destination. -func (r *LogpushOwnershipValidateService) PostAccountsAccountIdentifierLogpushOwnershipValidate(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateParams, opts ...option.RequestOption) (res *LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse, err error) { - opts = append(r.Options[:], opts...) - var env LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelope - path := fmt.Sprintf("%s/%s/logpush/ownership/validate", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse struct { - Valid bool `json:"valid"` - JSON logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseJSON `json:"-"` -} - -// logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse] -type logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseJSON struct { - Valid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateParams struct { - // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - // Additional configuration parameters supported by the destination may be - // included. - DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"` - // Ownership challenge token to prove destination ownership. - OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"` -} - -func (r LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelope struct { - Errors []LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessages `json:"messages,required"` - Result LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeSuccess `json:"success,required"` - JSON logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeJSON `json:"-"` -} - -// logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelope] -type logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrorsJSON `json:"-"` -} - -// logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrors] -type logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessagesJSON `json:"-"` -} - -// logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessages] -type logpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeSuccess bool - -const ( - LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeSuccessTrue LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateResponseEnvelopeSuccess = true -) diff --git a/logpushownershipvalidate_test.go b/logpushownershipvalidate_test.go deleted file mode 100644 index 39cf3a02b40..00000000000 --- a/logpushownershipvalidate_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestLogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidate(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Logpush.Ownerships.Validates.PostAccountsAccountIdentifierLogpushOwnershipValidate( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogpushOwnershipValidatePostAccountsAccountIdentifierLogpushOwnershipValidateParams{ - DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), - OwnershipChallenge: cloudflare.F("00000000000000000000"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/logpushvalidate.go b/logpushvalidate.go index 6f183b205a2..fea4e4956ad 100644 --- a/logpushvalidate.go +++ b/logpushvalidate.go @@ -3,6 +3,13 @@ package cloudflare import ( + "context" + "fmt" + "net/http" + + "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/option" ) @@ -12,9 +19,7 @@ import ( // this service directly, and instead use the [NewLogpushValidateService] method // instead. type LogpushValidateService struct { - Options []option.RequestOption - Destinations *LogpushValidateDestinationService - Origins *LogpushValidateOriginService + Options []option.RequestOption } // NewLogpushValidateService generates a new service that applies the given options @@ -23,7 +28,229 @@ type LogpushValidateService struct { func NewLogpushValidateService(opts ...option.RequestOption) (r *LogpushValidateService) { r = &LogpushValidateService{} r.Options = opts - r.Destinations = NewLogpushValidateDestinationService(opts...) - r.Origins = NewLogpushValidateOriginService(opts...) return } + +// Checks if there is an existing job with a destination. +func (r *LogpushValidateService) Destination(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushValidateDestinationParams, opts ...option.RequestOption) (res *LogpushValidateDestinationResponse, err error) { + opts = append(r.Options[:], opts...) + var env LogpushValidateDestinationResponseEnvelope + path := fmt.Sprintf("%s/%s/logpush/validate/destination/exists", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Validates logpull origin with logpull_options. +func (r *LogpushValidateService) Origin(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushValidateOriginParams, opts ...option.RequestOption) (res *LogpushValidateOriginResponse, err error) { + opts = append(r.Options[:], opts...) + var env LogpushValidateOriginResponseEnvelope + path := fmt.Sprintf("%s/%s/logpush/validate/origin", accountOrZone, accountOrZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type LogpushValidateDestinationResponse struct { + Exists bool `json:"exists"` + JSON logpushValidateDestinationResponseJSON `json:"-"` +} + +// logpushValidateDestinationResponseJSON contains the JSON metadata for the struct +// [LogpushValidateDestinationResponse] +type logpushValidateDestinationResponseJSON struct { + Exists apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateDestinationResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateOriginResponse struct { + Message string `json:"message"` + Valid bool `json:"valid"` + JSON logpushValidateOriginResponseJSON `json:"-"` +} + +// logpushValidateOriginResponseJSON contains the JSON metadata for the struct +// [LogpushValidateOriginResponse] +type logpushValidateOriginResponseJSON struct { + Message apijson.Field + Valid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateOriginResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateDestinationParams struct { + // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + // Additional configuration parameters supported by the destination may be + // included. + DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"` +} + +func (r LogpushValidateDestinationParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type LogpushValidateDestinationResponseEnvelope struct { + Errors []LogpushValidateDestinationResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushValidateDestinationResponseEnvelopeMessages `json:"messages,required"` + Result LogpushValidateDestinationResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success LogpushValidateDestinationResponseEnvelopeSuccess `json:"success,required"` + JSON logpushValidateDestinationResponseEnvelopeJSON `json:"-"` +} + +// logpushValidateDestinationResponseEnvelopeJSON contains the JSON metadata for +// the struct [LogpushValidateDestinationResponseEnvelope] +type logpushValidateDestinationResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateDestinationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateDestinationResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushValidateDestinationResponseEnvelopeErrorsJSON `json:"-"` +} + +// logpushValidateDestinationResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [LogpushValidateDestinationResponseEnvelopeErrors] +type logpushValidateDestinationResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateDestinationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateDestinationResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushValidateDestinationResponseEnvelopeMessagesJSON `json:"-"` +} + +// logpushValidateDestinationResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [LogpushValidateDestinationResponseEnvelopeMessages] +type logpushValidateDestinationResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateDestinationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LogpushValidateDestinationResponseEnvelopeSuccess bool + +const ( + LogpushValidateDestinationResponseEnvelopeSuccessTrue LogpushValidateDestinationResponseEnvelopeSuccess = true +) + +type LogpushValidateOriginParams struct { + // This field is deprecated. Use `output_options` instead. Configuration string. It + // specifies things like requested fields and timestamp formats. If migrating from + // the logpull api, copy the url (full url or just the query string) of your call + // here, and logpush will keep on making this call for you, setting start and end + // times appropriately. + LogpullOptions param.Field[string] `json:"logpull_options,required" format:"uri-reference"` +} + +func (r LogpushValidateOriginParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type LogpushValidateOriginResponseEnvelope struct { + Errors []LogpushValidateOriginResponseEnvelopeErrors `json:"errors,required"` + Messages []LogpushValidateOriginResponseEnvelopeMessages `json:"messages,required"` + Result LogpushValidateOriginResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success LogpushValidateOriginResponseEnvelopeSuccess `json:"success,required"` + JSON logpushValidateOriginResponseEnvelopeJSON `json:"-"` +} + +// logpushValidateOriginResponseEnvelopeJSON contains the JSON metadata for the +// struct [LogpushValidateOriginResponseEnvelope] +type logpushValidateOriginResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateOriginResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushValidateOriginResponseEnvelopeErrorsJSON `json:"-"` +} + +// logpushValidateOriginResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [LogpushValidateOriginResponseEnvelopeErrors] +type logpushValidateOriginResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type LogpushValidateOriginResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON logpushValidateOriginResponseEnvelopeMessagesJSON `json:"-"` +} + +// logpushValidateOriginResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [LogpushValidateOriginResponseEnvelopeMessages] +type logpushValidateOriginResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *LogpushValidateOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type LogpushValidateOriginResponseEnvelopeSuccess bool + +const ( + LogpushValidateOriginResponseEnvelopeSuccessTrue LogpushValidateOriginResponseEnvelopeSuccess = true +) diff --git a/cfdtunnelconnection_test.go b/logpushvalidate_test.go similarity index 74% rename from cfdtunnelconnection_test.go rename to logpushvalidate_test.go index 78d54a0040c..823c56caf15 100644 --- a/cfdtunnelconnection_test.go +++ b/logpushvalidate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelConnectionDeleteWithOptionalParams(t *testing.T) { +func TestLogpushValidateDestination(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,12 @@ func TestCfdTunnelConnectionDeleteWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Connections.Delete( + _, err := client.Logpush.Validate.Destination( context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.CfdTunnelConnectionDeleteParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - ClientID: cloudflare.F("string"), + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.LogpushValidateDestinationParams{ + DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), }, ) if err != nil { @@ -47,7 +46,7 @@ func TestCfdTunnelConnectionDeleteWithOptionalParams(t *testing.T) { } } -func TestCfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnections(t *testing.T) { +func TestLogpushValidateOrigin(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,10 +62,13 @@ func TestCfdTunnelConnectionCloudflareTunnelListCloudflareTunnelConnections(t *t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Connections.CloudflareTunnelListCloudflareTunnelConnections( + _, err := client.Logpush.Validate.Origin( context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + "string", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.LogpushValidateOriginParams{ + LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/logpushvalidatedestination.go b/logpushvalidatedestination.go deleted file mode 100644 index 4cd26e27c72..00000000000 --- a/logpushvalidatedestination.go +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// LogpushValidateDestinationService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewLogpushValidateDestinationService] method instead. -type LogpushValidateDestinationService struct { - Options []option.RequestOption - Exists *LogpushValidateDestinationExistService -} - -// NewLogpushValidateDestinationService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewLogpushValidateDestinationService(opts ...option.RequestOption) (r *LogpushValidateDestinationService) { - r = &LogpushValidateDestinationService{} - r.Options = opts - r.Exists = NewLogpushValidateDestinationExistService(opts...) - return -} diff --git a/logpushvalidatedestinationexist.go b/logpushvalidatedestinationexist.go deleted file mode 100644 index dd52dcf83e0..00000000000 --- a/logpushvalidatedestinationexist.go +++ /dev/null @@ -1,146 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// LogpushValidateDestinationExistService contains methods and other services that -// help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewLogpushValidateDestinationExistService] method instead. -type LogpushValidateDestinationExistService struct { - Options []option.RequestOption -} - -// NewLogpushValidateDestinationExistService generates a new service that applies -// the given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewLogpushValidateDestinationExistService(opts ...option.RequestOption) (r *LogpushValidateDestinationExistService) { - r = &LogpushValidateDestinationExistService{} - r.Options = opts - return -} - -// Checks if there is an existing job with a destination. -func (r *LogpushValidateDestinationExistService) DeleteAccountsAccountIdentifierLogpushValidateDestinationExists(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsParams, opts ...option.RequestOption) (res *LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse, err error) { - opts = append(r.Options[:], opts...) - var env LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelope - path := fmt.Sprintf("%s/%s/logpush/validate/destination/exists", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse struct { - Exists bool `json:"exists"` - JSON logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseJSON `json:"-"` -} - -// logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseJSON -// contains the JSON metadata for the struct -// [LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse] -type logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseJSON struct { - Exists apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsParams struct { - // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - // Additional configuration parameters supported by the destination may be - // included. - DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"` -} - -func (r LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelope struct { - Errors []LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessages `json:"messages,required"` - Result LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeSuccess `json:"success,required"` - JSON logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeJSON `json:"-"` -} - -// logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelope] -type logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrorsJSON `json:"-"` -} - -// logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrors] -type logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessagesJSON `json:"-"` -} - -// logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessages] -type logpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeSuccess bool - -const ( - LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeSuccessTrue LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsResponseEnvelopeSuccess = true -) diff --git a/logpushvalidatedestinationexist_test.go b/logpushvalidatedestinationexist_test.go deleted file mode 100644 index b92951c716d..00000000000 --- a/logpushvalidatedestinationexist_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestLogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExists(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Logpush.Validates.Destinations.Exists.DeleteAccountsAccountIdentifierLogpushValidateDestinationExists( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogpushValidateDestinationExistDeleteAccountsAccountIdentifierLogpushValidateDestinationExistsParams{ - DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/logpushvalidateorigin.go b/logpushvalidateorigin.go deleted file mode 100644 index 0ace51d01d3..00000000000 --- a/logpushvalidateorigin.go +++ /dev/null @@ -1,150 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// LogpushValidateOriginService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewLogpushValidateOriginService] -// method instead. -type LogpushValidateOriginService struct { - Options []option.RequestOption -} - -// NewLogpushValidateOriginService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewLogpushValidateOriginService(opts ...option.RequestOption) (r *LogpushValidateOriginService) { - r = &LogpushValidateOriginService{} - r.Options = opts - return -} - -// Validates logpull origin with logpull_options. -func (r *LogpushValidateOriginService) PostAccountsAccountIdentifierLogpushValidateOrigin(ctx context.Context, accountOrZone string, accountOrZoneID string, body LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginParams, opts ...option.RequestOption) (res *LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse, err error) { - opts = append(r.Options[:], opts...) - var env LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelope - path := fmt.Sprintf("%s/%s/logpush/validate/origin", accountOrZone, accountOrZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse struct { - Message string `json:"message"` - Valid bool `json:"valid"` - JSON logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseJSON `json:"-"` -} - -// logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseJSON -// contains the JSON metadata for the struct -// [LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse] -type logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseJSON struct { - Message apijson.Field - Valid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginParams struct { - // This field is deprecated. Use `output_options` instead. Configuration string. It - // specifies things like requested fields and timestamp formats. If migrating from - // the logpull api, copy the url (full url or just the query string) of your call - // here, and logpush will keep on making this call for you, setting start and end - // times appropriately. - LogpullOptions param.Field[string] `json:"logpull_options,required" format:"uri-reference"` -} - -func (r LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelope struct { - Errors []LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrors `json:"errors,required"` - Messages []LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessages `json:"messages,required"` - Result LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeSuccess `json:"success,required"` - JSON logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeJSON `json:"-"` -} - -// logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelope] -type logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrorsJSON `json:"-"` -} - -// logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrors] -type logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessagesJSON `json:"-"` -} - -// logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessages] -type logpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeSuccess bool - -const ( - LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeSuccessTrue LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginResponseEnvelopeSuccess = true -) diff --git a/logpushvalidateorigin_test.go b/logpushvalidateorigin_test.go deleted file mode 100644 index aaac94def94..00000000000 --- a/logpushvalidateorigin_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestLogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOrigin(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Logpush.Validates.Origins.PostAccountsAccountIdentifierLogpushValidateOrigin( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogpushValidateOriginPostAccountsAccountIdentifierLogpushValidateOriginParams{ - LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/logreceived.go b/logreceived.go index 6afb19b6430..ba68e73dce4 100644 --- a/logreceived.go +++ b/logreceived.go @@ -46,22 +46,21 @@ func NewLogReceivedService(opts ...option.RequestOption) (r *LogReceivedService) // `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then // `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap // will be handled properly. -func (r *LogReceivedService) ReceivedGetLogsReceived(ctx context.Context, zoneIdentifier string, query LogReceivedReceivedGetLogsReceivedParams, opts ...option.RequestOption) (res *LogReceivedReceivedGetLogsReceivedResponse, err error) { +func (r *LogReceivedService) Get(ctx context.Context, zoneIdentifier string, query LogReceivedGetParams, opts ...option.RequestOption) (res *LogReceivedGetResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/logs/received", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) return } -// Union satisfied by [shared.UnionString] or -// [LogReceivedReceivedGetLogsReceivedResponseUnknown]. -type LogReceivedReceivedGetLogsReceivedResponse interface { - ImplementsLogReceivedReceivedGetLogsReceivedResponse() +// Union satisfied by [shared.UnionString] or [LogReceivedGetResponseUnknown]. +type LogReceivedGetResponse interface { + ImplementsLogReceivedGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*LogReceivedReceivedGetLogsReceivedResponse)(nil)).Elem(), + reflect.TypeOf((*LogReceivedGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -70,13 +69,13 @@ func init() { ) } -type LogReceivedReceivedGetLogsReceivedParams struct { +type LogReceivedGetParams struct { // Sets the (exclusive) end of the requested time frame. This can be a unix // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to // RFC 3339. `end` must be at least five minutes earlier than now and must be later // than `start`. Difference between `start` and `end` must be not greater than one // hour. - End param.Field[LogReceivedReceivedGetLogsReceivedParamsEnd] `query:"end,required"` + End param.Field[LogReceivedGetParamsEnd] `query:"end,required"` // When `?count=` is provided, the response will contain up to `count` results. // Since results are not sorted, you are likely to get different data for repeated // requests. `count` must be an integer > 0. @@ -106,18 +105,17 @@ type LogReceivedReceivedGetLogsReceivedParams struct { // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to // RFC 3339. At this point in time, it cannot exceed a time in the past greater // than seven days. - Start param.Field[LogReceivedReceivedGetLogsReceivedParamsStart] `query:"start"` + Start param.Field[LogReceivedGetParamsStart] `query:"start"` // By default, timestamps in responses are returned as Unix nanosecond integers. // The `?timestamps=` argument can be set to change the format in which response // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns // timestamps as strings. - Timestamps param.Field[LogReceivedReceivedGetLogsReceivedParamsTimestamps] `query:"timestamps"` + Timestamps param.Field[LogReceivedGetParamsTimestamps] `query:"timestamps"` } -// URLQuery serializes [LogReceivedReceivedGetLogsReceivedParams]'s query -// parameters as `url.Values`. -func (r LogReceivedReceivedGetLogsReceivedParams) URLQuery() (v url.Values) { +// URLQuery serializes [LogReceivedGetParams]'s query parameters as `url.Values`. +func (r LogReceivedGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -131,8 +129,8 @@ func (r LogReceivedReceivedGetLogsReceivedParams) URLQuery() (v url.Values) { // hour. // // Satisfied by [shared.UnionString], [shared.UnionInt]. -type LogReceivedReceivedGetLogsReceivedParamsEnd interface { - ImplementsLogReceivedReceivedGetLogsReceivedParamsEnd() +type LogReceivedGetParamsEnd interface { + ImplementsLogReceivedGetParamsEnd() } // Sets the (inclusive) beginning of the requested time frame. This can be a unix @@ -141,8 +139,8 @@ type LogReceivedReceivedGetLogsReceivedParamsEnd interface { // than seven days. // // Satisfied by [shared.UnionString], [shared.UnionInt]. -type LogReceivedReceivedGetLogsReceivedParamsStart interface { - ImplementsLogReceivedReceivedGetLogsReceivedParamsStart() +type LogReceivedGetParamsStart interface { + ImplementsLogReceivedGetParamsStart() } // By default, timestamps in responses are returned as Unix nanosecond integers. @@ -150,10 +148,10 @@ type LogReceivedReceivedGetLogsReceivedParamsStart interface { // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns // timestamps as strings. -type LogReceivedReceivedGetLogsReceivedParamsTimestamps string +type LogReceivedGetParamsTimestamps string const ( - LogReceivedReceivedGetLogsReceivedParamsTimestampsUnix LogReceivedReceivedGetLogsReceivedParamsTimestamps = "unix" - LogReceivedReceivedGetLogsReceivedParamsTimestampsUnixnano LogReceivedReceivedGetLogsReceivedParamsTimestamps = "unixnano" - LogReceivedReceivedGetLogsReceivedParamsTimestampsRfc3339 LogReceivedReceivedGetLogsReceivedParamsTimestamps = "rfc3339" + LogReceivedGetParamsTimestampsUnix LogReceivedGetParamsTimestamps = "unix" + LogReceivedGetParamsTimestampsUnixnano LogReceivedGetParamsTimestamps = "unixnano" + LogReceivedGetParamsTimestampsRfc3339 LogReceivedGetParamsTimestamps = "rfc3339" ) diff --git a/logreceived_test.go b/logreceived_test.go index dac1b8d19c2..4c6db4181fe 100644 --- a/logreceived_test.go +++ b/logreceived_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogReceivedReceivedGetLogsReceivedWithOptionalParams(t *testing.T) { +func TestLogReceivedGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,16 +30,16 @@ func TestLogReceivedReceivedGetLogsReceivedWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Receiveds.ReceivedGetLogsReceived( + _, err := client.Logs.Received.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.LogReceivedReceivedGetLogsReceivedParams{ - End: cloudflare.F[cloudflare.LogReceivedReceivedGetLogsReceivedParamsEnd](shared.UnionString("2018-05-20T10:01:00Z")), + cloudflare.LogReceivedGetParams{ + End: cloudflare.F[cloudflare.LogReceivedGetParamsEnd](shared.UnionString("2018-05-20T10:01:00Z")), Count: cloudflare.F(int64(1)), Fields: cloudflare.F("ClientIP,RayID,EdgeStartTimestamp"), Sample: cloudflare.F(0.100000), - Start: cloudflare.F[cloudflare.LogReceivedReceivedGetLogsReceivedParamsStart](shared.UnionString("2018-05-20T10:00:00Z")), - Timestamps: cloudflare.F(cloudflare.LogReceivedReceivedGetLogsReceivedParamsTimestampsUnixnano), + Start: cloudflare.F[cloudflare.LogReceivedGetParamsStart](shared.UnionString("2018-05-20T10:00:00Z")), + Timestamps: cloudflare.F(cloudflare.LogReceivedGetParamsTimestampsUnixnano), }, ) if err != nil { diff --git a/logreceivedfield.go b/logreceivedfield.go index 962d53dfa6f..4dcd73d8bc3 100644 --- a/logreceivedfield.go +++ b/logreceivedfield.go @@ -32,26 +32,26 @@ func NewLogReceivedFieldService(opts ...option.RequestOption) (r *LogReceivedFie // Lists all fields available. The response is json object with key-value pairs, // where keys are field names, and values are descriptions. -func (r *LogReceivedFieldService) LogsReceivedListFields(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogReceivedFieldLogsReceivedListFieldsResponse, err error) { +func (r *LogReceivedFieldService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogReceivedFieldListResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/logs/received/fields", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) return } -type LogReceivedFieldLogsReceivedListFieldsResponse struct { - Key string `json:"key"` - JSON logReceivedFieldLogsReceivedListFieldsResponseJSON `json:"-"` +type LogReceivedFieldListResponse struct { + Key string `json:"key"` + JSON logReceivedFieldListResponseJSON `json:"-"` } -// logReceivedFieldLogsReceivedListFieldsResponseJSON contains the JSON metadata -// for the struct [LogReceivedFieldLogsReceivedListFieldsResponse] -type logReceivedFieldLogsReceivedListFieldsResponseJSON struct { +// logReceivedFieldListResponseJSON contains the JSON metadata for the struct +// [LogReceivedFieldListResponse] +type logReceivedFieldListResponseJSON struct { Key apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *LogReceivedFieldLogsReceivedListFieldsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *LogReceivedFieldListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/logreceivedfield_test.go b/logreceivedfield_test.go index 8a576a4a206..14ffbe46aa1 100644 --- a/logreceivedfield_test.go +++ b/logreceivedfield_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestLogReceivedFieldLogsReceivedListFields(t *testing.T) { +func TestLogReceivedFieldList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestLogReceivedFieldLogsReceivedListFields(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Logs.Receiveds.Fields.LogsReceivedListFields(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Logs.Received.Fields.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/magiccfinterconnect.go b/magiccfinterconnect.go index 18c44960115..f3ed3d9f763 100644 --- a/magiccfinterconnect.go +++ b/magiccfinterconnect.go @@ -32,14 +32,12 @@ func NewMagicCfInterconnectService(opts ...option.RequestOption) (r *MagicCfInte return } -// Updates a specific interconnect associated with an account. Use -// `?validate_only=true` as an optional query parameter to only run validation -// without persisting changes. -func (r *MagicCfInterconnectService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicCfInterconnectUpdateParams, opts ...option.RequestOption) (res *MagicCfInterconnectUpdateResponse, err error) { +// Lists interconnects associated with an account. +func (r *MagicCfInterconnectService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicCfInterconnectListResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicCfInterconnectUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env MagicCfInterconnectListResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/cf_interconnects", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -60,26 +58,13 @@ func (r *MagicCfInterconnectService) Get(ctx context.Context, accountIdentifier return } -// Lists interconnects associated with an account. -func (r *MagicCfInterconnectService) MagicInterconnectsListInterconnects(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicCfInterconnectMagicInterconnectsListInterconnectsResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/cf_interconnects", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Updates multiple interconnects associated with an account. Use +// Updates a specific interconnect associated with an account. Use // `?validate_only=true` as an optional query parameter to only run validation // without persisting changes. -func (r *MagicCfInterconnectService) MagicInterconnectsUpdateMultipleInterconnects(ctx context.Context, accountIdentifier string, body MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsParams, opts ...option.RequestOption) (res *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse, err error) { +func (r *MagicCfInterconnectService) Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicCfInterconnectReplaceParams, opts ...option.RequestOption) (res *MagicCfInterconnectReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/cf_interconnects", accountIdentifier) + var env MagicCfInterconnectReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return @@ -88,61 +73,24 @@ func (r *MagicCfInterconnectService) MagicInterconnectsUpdateMultipleInterconnec return } -type MagicCfInterconnectUpdateResponse struct { - Modified bool `json:"modified"` - ModifiedInterconnect interface{} `json:"modified_interconnect"` - JSON magicCfInterconnectUpdateResponseJSON `json:"-"` -} - -// magicCfInterconnectUpdateResponseJSON contains the JSON metadata for the struct -// [MagicCfInterconnectUpdateResponse] -type magicCfInterconnectUpdateResponseJSON struct { - Modified apijson.Field - ModifiedInterconnect apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicCfInterconnectUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicCfInterconnectGetResponse struct { - Interconnect interface{} `json:"interconnect"` - JSON magicCfInterconnectGetResponseJSON `json:"-"` -} - -// magicCfInterconnectGetResponseJSON contains the JSON metadata for the struct -// [MagicCfInterconnectGetResponse] -type magicCfInterconnectGetResponseJSON struct { - Interconnect apijson.Field - raw string - ExtraFields map[string]apijson.Field +type MagicCfInterconnectListResponse struct { + Interconnects []MagicCfInterconnectListResponseInterconnect `json:"interconnects"` + JSON magicCfInterconnectListResponseJSON `json:"-"` } -func (r *MagicCfInterconnectGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponse struct { - Interconnects []MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect `json:"interconnects"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseJSON `json:"-"` -} - -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseJSON contains the -// JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponse] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseJSON struct { +// magicCfInterconnectListResponseJSON contains the JSON metadata for the struct +// [MagicCfInterconnectListResponse] +type magicCfInterconnectListResponseJSON struct { Interconnects apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect struct { +type MagicCfInterconnectListResponseInterconnect struct { // Tunnel identifier tag. ID string `json:"id"` // The name of the interconnect. The name cannot share a name with other tunnels. @@ -152,8 +100,8 @@ type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect // An optional description of the interconnect. Description string `json:"description"` // The configuration specific to GRE interconnects. - Gre MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGre `json:"gre"` - HealthCheck MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheck `json:"health_check"` + Gre MagicCfInterconnectListResponseInterconnectsGre `json:"gre"` + HealthCheck MagicCfInterconnectListResponseInterconnectsHealthCheck `json:"health_check"` // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side // of the tunnel. Select the subnet from the following private IP space: // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. @@ -164,14 +112,13 @@ type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect // value is 576. Mtu int64 `json:"mtu"` // The name of the interconnect. The name cannot share a name with other tunnels. - Name string `json:"name"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectJSON `json:"-"` + Name string `json:"name"` + JSON magicCfInterconnectListResponseInterconnectJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectJSON struct { +// magicCfInterconnectListResponseInterconnectJSON contains the JSON metadata for +// the struct [MagicCfInterconnectListResponseInterconnect] +type magicCfInterconnectListResponseInterconnectJSON struct { ID apijson.Field ColoName apijson.Field CreatedOn apijson.Field @@ -186,49 +133,48 @@ type magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectJ ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnect) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseInterconnect) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration specific to GRE interconnects. -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGre struct { +type MagicCfInterconnectListResponseInterconnectsGre struct { // The IP address assigned to the Cloudflare side of the GRE tunnel created as part // of the Interconnect. - CloudflareEndpoint string `json:"cloudflare_endpoint"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGreJSON `json:"-"` + CloudflareEndpoint string `json:"cloudflare_endpoint"` + JSON magicCfInterconnectListResponseInterconnectsGreJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGreJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGre] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGreJSON struct { +// magicCfInterconnectListResponseInterconnectsGreJSON contains the JSON metadata +// for the struct [MagicCfInterconnectListResponseInterconnectsGre] +type magicCfInterconnectListResponseInterconnectsGreJSON struct { CloudflareEndpoint apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsGre) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseInterconnectsGre) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheck struct { +type MagicCfInterconnectListResponseInterconnectsHealthCheck struct { // Determines whether to run healthchecks for a tunnel. Enabled bool `json:"enabled"` // How frequent the health check is run. The default value is `mid`. - Rate MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRate `json:"rate"` + Rate MagicCfInterconnectListResponseInterconnectsHealthCheckRate `json:"rate"` // The destination address in a request type health check. After the healthcheck is // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded // to this address. This field defaults to `customer_gre_endpoint address`. Target string `json:"target"` // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckType `json:"type"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckJSON `json:"-"` + Type MagicCfInterconnectListResponseInterconnectsHealthCheckType `json:"type"` + JSON magicCfInterconnectListResponseInterconnectsHealthCheckJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheck] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckJSON struct { +// magicCfInterconnectListResponseInterconnectsHealthCheckJSON contains the JSON +// metadata for the struct +// [MagicCfInterconnectListResponseInterconnectsHealthCheck] +type magicCfInterconnectListResponseInterconnectsHealthCheckJSON struct { Enabled apijson.Field Rate apijson.Field Target apijson.Field @@ -237,239 +183,75 @@ type magicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnects ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseInterconnectsHealthCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // How frequent the health check is run. The default value is `mid`. -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRate string +type MagicCfInterconnectListResponseInterconnectsHealthCheckRate string const ( - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRateLow MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRate = "low" - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRateMid MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRate = "mid" - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRateHigh MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckRate = "high" + MagicCfInterconnectListResponseInterconnectsHealthCheckRateLow MagicCfInterconnectListResponseInterconnectsHealthCheckRate = "low" + MagicCfInterconnectListResponseInterconnectsHealthCheckRateMid MagicCfInterconnectListResponseInterconnectsHealthCheckRate = "mid" + MagicCfInterconnectListResponseInterconnectsHealthCheckRateHigh MagicCfInterconnectListResponseInterconnectsHealthCheckRate = "high" ) // The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckType string +type MagicCfInterconnectListResponseInterconnectsHealthCheckType string const ( - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckTypeReply MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckType = "reply" - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckTypeRequest MagicCfInterconnectMagicInterconnectsListInterconnectsResponseInterconnectsHealthCheckType = "request" + MagicCfInterconnectListResponseInterconnectsHealthCheckTypeReply MagicCfInterconnectListResponseInterconnectsHealthCheckType = "reply" + MagicCfInterconnectListResponseInterconnectsHealthCheckTypeRequest MagicCfInterconnectListResponseInterconnectsHealthCheckType = "request" ) -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse struct { - Modified bool `json:"modified"` - ModifiedInterconnects []MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnect `json:"modified_interconnects"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseJSON `json:"-"` -} - -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseJSON struct { - Modified apijson.Field - ModifiedInterconnects apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnect struct { - // Tunnel identifier tag. - ID string `json:"id"` - // The name of the interconnect. The name cannot share a name with other tunnels. - ColoName string `json:"colo_name"` - // The date and time the tunnel was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // An optional description of the interconnect. - Description string `json:"description"` - // The configuration specific to GRE interconnects. - Gre MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGre `json:"gre"` - HealthCheck MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheck `json:"health_check"` - // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - // of the tunnel. Select the subnet from the following private IP space: - // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - InterfaceAddress string `json:"interface_address"` - // The date and time the tunnel was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum - // value is 576. - Mtu int64 `json:"mtu"` - // The name of the interconnect. The name cannot share a name with other tunnels. - Name string `json:"name"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectJSON `json:"-"` -} - -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnect] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectJSON struct { - ID apijson.Field - ColoName apijson.Field - CreatedOn apijson.Field - Description apijson.Field - Gre apijson.Field - HealthCheck apijson.Field - InterfaceAddress apijson.Field - ModifiedOn apijson.Field - Mtu apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnect) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The configuration specific to GRE interconnects. -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGre struct { - // The IP address assigned to the Cloudflare side of the GRE tunnel created as part - // of the Interconnect. - CloudflareEndpoint string `json:"cloudflare_endpoint"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGreJSON `json:"-"` +type MagicCfInterconnectGetResponse struct { + Interconnect interface{} `json:"interconnect"` + JSON magicCfInterconnectGetResponseJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGreJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGre] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGreJSON struct { - CloudflareEndpoint apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicCfInterconnectGetResponseJSON contains the JSON metadata for the struct +// [MagicCfInterconnectGetResponse] +type magicCfInterconnectGetResponseJSON struct { + Interconnect apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsGre) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheck struct { - // Determines whether to run healthchecks for a tunnel. - Enabled bool `json:"enabled"` - // How frequent the health check is run. The default value is `mid`. - Rate MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRate `json:"rate"` - // The destination address in a request type health check. After the healthcheck is - // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded - // to this address. This field defaults to `customer_gre_endpoint address`. - Target string `json:"target"` - // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckType `json:"type"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckJSON `json:"-"` +type MagicCfInterconnectReplaceResponse struct { + Modified bool `json:"modified"` + ModifiedInterconnect interface{} `json:"modified_interconnect"` + JSON magicCfInterconnectReplaceResponseJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheck] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckJSON struct { - Enabled apijson.Field - Rate apijson.Field - Target apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicCfInterconnectReplaceResponseJSON contains the JSON metadata for the struct +// [MagicCfInterconnectReplaceResponse] +type magicCfInterconnectReplaceResponseJSON struct { + Modified apijson.Field + ModifiedInterconnect apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// How frequent the health check is run. The default value is `mid`. -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRate string - -const ( - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRateLow MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRate = "low" - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRateMid MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRate = "mid" - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRateHigh MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckRate = "high" -) - -// The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckType string - -const ( - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckTypeReply MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckType = "reply" - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckTypeRequest MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseModifiedInterconnectsHealthCheckType = "request" -) - -type MagicCfInterconnectUpdateParams struct { - // An optional description of the interconnect. - Description param.Field[string] `json:"description"` - // The configuration specific to GRE interconnects. - Gre param.Field[MagicCfInterconnectUpdateParamsGre] `json:"gre"` - HealthCheck param.Field[MagicCfInterconnectUpdateParamsHealthCheck] `json:"health_check"` - // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - // of the tunnel. Select the subnet from the following private IP space: - // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - InterfaceAddress param.Field[string] `json:"interface_address"` - // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum - // value is 576. - Mtu param.Field[int64] `json:"mtu"` -} - -func (r MagicCfInterconnectUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The configuration specific to GRE interconnects. -type MagicCfInterconnectUpdateParamsGre struct { - // The IP address assigned to the Cloudflare side of the GRE tunnel created as part - // of the Interconnect. - CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint"` -} - -func (r MagicCfInterconnectUpdateParamsGre) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type MagicCfInterconnectUpdateParamsHealthCheck struct { - // Determines whether to run healthchecks for a tunnel. - Enabled param.Field[bool] `json:"enabled"` - // How frequent the health check is run. The default value is `mid`. - Rate param.Field[MagicCfInterconnectUpdateParamsHealthCheckRate] `json:"rate"` - // The destination address in a request type health check. After the healthcheck is - // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded - // to this address. This field defaults to `customer_gre_endpoint address`. - Target param.Field[string] `json:"target"` - // The type of healthcheck to run, reply or request. The default value is `reply`. - Type param.Field[MagicCfInterconnectUpdateParamsHealthCheckType] `json:"type"` -} - -func (r MagicCfInterconnectUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// How frequent the health check is run. The default value is `mid`. -type MagicCfInterconnectUpdateParamsHealthCheckRate string - -const ( - MagicCfInterconnectUpdateParamsHealthCheckRateLow MagicCfInterconnectUpdateParamsHealthCheckRate = "low" - MagicCfInterconnectUpdateParamsHealthCheckRateMid MagicCfInterconnectUpdateParamsHealthCheckRate = "mid" - MagicCfInterconnectUpdateParamsHealthCheckRateHigh MagicCfInterconnectUpdateParamsHealthCheckRate = "high" -) - -// The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicCfInterconnectUpdateParamsHealthCheckType string - -const ( - MagicCfInterconnectUpdateParamsHealthCheckTypeReply MagicCfInterconnectUpdateParamsHealthCheckType = "reply" - MagicCfInterconnectUpdateParamsHealthCheckTypeRequest MagicCfInterconnectUpdateParamsHealthCheckType = "request" -) - -type MagicCfInterconnectUpdateResponseEnvelope struct { - Errors []MagicCfInterconnectUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicCfInterconnectUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MagicCfInterconnectUpdateResponse `json:"result,required"` +type MagicCfInterconnectListResponseEnvelope struct { + Errors []MagicCfInterconnectListResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicCfInterconnectListResponseEnvelopeMessages `json:"messages,required"` + Result MagicCfInterconnectListResponse `json:"result,required"` // Whether the API call was successful - Success MagicCfInterconnectUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON magicCfInterconnectUpdateResponseEnvelopeJSON `json:"-"` + Success MagicCfInterconnectListResponseEnvelopeSuccess `json:"success,required"` + JSON magicCfInterconnectListResponseEnvelopeJSON `json:"-"` } -// magicCfInterconnectUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [MagicCfInterconnectUpdateResponseEnvelope] -type magicCfInterconnectUpdateResponseEnvelopeJSON struct { +// magicCfInterconnectListResponseEnvelopeJSON contains the JSON metadata for the +// struct [MagicCfInterconnectListResponseEnvelope] +type magicCfInterconnectListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -478,53 +260,53 @@ type magicCfInterconnectUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MagicCfInterconnectListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicCfInterconnectListResponseEnvelopeErrorsJSON `json:"-"` } -// magicCfInterconnectUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [MagicCfInterconnectUpdateResponseEnvelopeErrors] -type magicCfInterconnectUpdateResponseEnvelopeErrorsJSON struct { +// magicCfInterconnectListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [MagicCfInterconnectListResponseEnvelopeErrors] +type magicCfInterconnectListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MagicCfInterconnectListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicCfInterconnectListResponseEnvelopeMessagesJSON `json:"-"` } -// magicCfInterconnectUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [MagicCfInterconnectUpdateResponseEnvelopeMessages] -type magicCfInterconnectUpdateResponseEnvelopeMessagesJSON struct { +// magicCfInterconnectListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [MagicCfInterconnectListResponseEnvelopeMessages] +type magicCfInterconnectListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicCfInterconnectUpdateResponseEnvelopeSuccess bool +type MagicCfInterconnectListResponseEnvelopeSuccess bool const ( - MagicCfInterconnectUpdateResponseEnvelopeSuccessTrue MagicCfInterconnectUpdateResponseEnvelopeSuccess = true + MagicCfInterconnectListResponseEnvelopeSuccessTrue MagicCfInterconnectListResponseEnvelopeSuccess = true ) type MagicCfInterconnectGetResponseEnvelope struct { @@ -596,99 +378,82 @@ const ( MagicCfInterconnectGetResponseEnvelopeSuccessTrue MagicCfInterconnectGetResponseEnvelopeSuccess = true ) -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelope struct { - Errors []MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessages `json:"messages,required"` - Result MagicCfInterconnectMagicInterconnectsListInterconnectsResponse `json:"result,required"` - // Whether the API call was successful - Success MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeSuccess `json:"success,required"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeJSON `json:"-"` -} - -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelope] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrorsJSON `json:"-"` +type MagicCfInterconnectReplaceParams struct { + // An optional description of the interconnect. + Description param.Field[string] `json:"description"` + // The configuration specific to GRE interconnects. + Gre param.Field[MagicCfInterconnectReplaceParamsGre] `json:"gre"` + HealthCheck param.Field[MagicCfInterconnectReplaceParamsHealthCheck] `json:"health_check"` + // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side + // of the tunnel. Select the subnet from the following private IP space: + // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. + InterfaceAddress param.Field[string] `json:"interface_address"` + // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum + // value is 576. + Mtu param.Field[int64] `json:"mtu"` } -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrors] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r MagicCfInterconnectReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// The configuration specific to GRE interconnects. +type MagicCfInterconnectReplaceParamsGre struct { + // The IP address assigned to the Cloudflare side of the GRE tunnel created as part + // of the Interconnect. + CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint"` } -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessagesJSON `json:"-"` +func (r MagicCfInterconnectReplaceParamsGre) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessages] -type magicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type MagicCfInterconnectReplaceParamsHealthCheck struct { + // Determines whether to run healthchecks for a tunnel. + Enabled param.Field[bool] `json:"enabled"` + // How frequent the health check is run. The default value is `mid`. + Rate param.Field[MagicCfInterconnectReplaceParamsHealthCheckRate] `json:"rate"` + // The destination address in a request type health check. After the healthcheck is + // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded + // to this address. This field defaults to `customer_gre_endpoint address`. + Target param.Field[string] `json:"target"` + // The type of healthcheck to run, reply or request. The default value is `reply`. + Type param.Field[MagicCfInterconnectReplaceParamsHealthCheckType] `json:"type"` } -func (r *MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r MagicCfInterconnectReplaceParamsHealthCheck) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeSuccess bool +// How frequent the health check is run. The default value is `mid`. +type MagicCfInterconnectReplaceParamsHealthCheckRate string const ( - MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeSuccessTrue MagicCfInterconnectMagicInterconnectsListInterconnectsResponseEnvelopeSuccess = true + MagicCfInterconnectReplaceParamsHealthCheckRateLow MagicCfInterconnectReplaceParamsHealthCheckRate = "low" + MagicCfInterconnectReplaceParamsHealthCheckRateMid MagicCfInterconnectReplaceParamsHealthCheckRate = "mid" + MagicCfInterconnectReplaceParamsHealthCheckRateHigh MagicCfInterconnectReplaceParamsHealthCheckRate = "high" ) -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsParams struct { - Body param.Field[interface{}] `json:"body,required"` -} +// The type of healthcheck to run, reply or request. The default value is `reply`. +type MagicCfInterconnectReplaceParamsHealthCheckType string -func (r MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} +const ( + MagicCfInterconnectReplaceParamsHealthCheckTypeReply MagicCfInterconnectReplaceParamsHealthCheckType = "reply" + MagicCfInterconnectReplaceParamsHealthCheckTypeRequest MagicCfInterconnectReplaceParamsHealthCheckType = "request" +) -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelope struct { - Errors []MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessages `json:"messages,required"` - Result MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponse `json:"result,required"` +type MagicCfInterconnectReplaceResponseEnvelope struct { + Errors []MagicCfInterconnectReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicCfInterconnectReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MagicCfInterconnectReplaceResponse `json:"result,required"` // Whether the API call was successful - Success MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeSuccess `json:"success,required"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeJSON `json:"-"` + Success MagicCfInterconnectReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON magicCfInterconnectReplaceResponseEnvelopeJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelope] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeJSON struct { +// magicCfInterconnectReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [MagicCfInterconnectReplaceResponseEnvelope] +type magicCfInterconnectReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -697,53 +462,51 @@ type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnv ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrorsJSON `json:"-"` +type MagicCfInterconnectReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicCfInterconnectReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrors] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrorsJSON struct { +// magicCfInterconnectReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [MagicCfInterconnectReplaceResponseEnvelopeErrors] +type magicCfInterconnectReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessagesJSON `json:"-"` +type MagicCfInterconnectReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicCfInterconnectReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessages] -type magicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessagesJSON struct { +// magicCfInterconnectReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [MagicCfInterconnectReplaceResponseEnvelopeMessages] +type magicCfInterconnectReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicCfInterconnectReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeSuccess bool +type MagicCfInterconnectReplaceResponseEnvelopeSuccess bool const ( - MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeSuccessTrue MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsResponseEnvelopeSuccess = true + MagicCfInterconnectReplaceResponseEnvelopeSuccessTrue MagicCfInterconnectReplaceResponseEnvelopeSuccess = true ) diff --git a/magiccfinterconnect_test.go b/magiccfinterconnect_test.go index 61eee824236..bd991315d72 100644 --- a/magiccfinterconnect_test.go +++ b/magiccfinterconnect_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMagicCfInterconnectUpdateWithOptionalParams(t *testing.T) { +func TestMagicCfInterconnectList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,25 +29,7 @@ func TestMagicCfInterconnectUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.CfInterconnects.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicCfInterconnectUpdateParams{ - Description: cloudflare.F("Tunnel for Interconnect to ORD"), - Gre: cloudflare.F(cloudflare.MagicCfInterconnectUpdateParamsGre{ - CloudflareEndpoint: cloudflare.F("203.0.113.1"), - }), - HealthCheck: cloudflare.F(cloudflare.MagicCfInterconnectUpdateParamsHealthCheck{ - Enabled: cloudflare.F(true), - Rate: cloudflare.F(cloudflare.MagicCfInterconnectUpdateParamsHealthCheckRateLow), - Target: cloudflare.F("203.0.113.1"), - Type: cloudflare.F(cloudflare.MagicCfInterconnectUpdateParamsHealthCheckTypeRequest), - }), - InterfaceAddress: cloudflare.F("192.0.2.0/31"), - Mtu: cloudflare.F(int64(0)), - }, - ) + _, err := client.Magics.CfInterconnects.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -87,33 +69,7 @@ func TestMagicCfInterconnectGet(t *testing.T) { } } -func TestMagicCfInterconnectMagicInterconnectsListInterconnects(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Magics.CfInterconnects.MagicInterconnectsListInterconnects(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestMagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnects(t *testing.T) { +func TestMagicCfInterconnectReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -129,11 +85,23 @@ func TestMagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnects(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.CfInterconnects.MagicInterconnectsUpdateMultipleInterconnects( + _, err := client.Magics.CfInterconnects.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicCfInterconnectMagicInterconnectsUpdateMultipleInterconnectsParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.MagicCfInterconnectReplaceParams{ + Description: cloudflare.F("Tunnel for Interconnect to ORD"), + Gre: cloudflare.F(cloudflare.MagicCfInterconnectReplaceParamsGre{ + CloudflareEndpoint: cloudflare.F("203.0.113.1"), + }), + HealthCheck: cloudflare.F(cloudflare.MagicCfInterconnectReplaceParamsHealthCheck{ + Enabled: cloudflare.F(true), + Rate: cloudflare.F(cloudflare.MagicCfInterconnectReplaceParamsHealthCheckRateLow), + Target: cloudflare.F("203.0.113.1"), + Type: cloudflare.F(cloudflare.MagicCfInterconnectReplaceParamsHealthCheckTypeRequest), + }), + InterfaceAddress: cloudflare.F("192.0.2.0/31"), + Mtu: cloudflare.F(int64(0)), }, ) if err != nil { diff --git a/magicgretunnel.go b/magicgretunnel.go index d5cc85230a9..cec7212a1ab 100644 --- a/magicgretunnel.go +++ b/magicgretunnel.go @@ -32,13 +32,26 @@ func NewMagicGreTunnelService(opts ...option.RequestOption) (r *MagicGreTunnelSe return } -// Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query +// Creates new GRE tunnels. Use `?validate_only=true` as an optional query // parameter to only run validation without persisting changes. -func (r *MagicGreTunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicGreTunnelUpdateParams, opts ...option.RequestOption) (res *MagicGreTunnelUpdateResponse, err error) { +func (r *MagicGreTunnelService) New(ctx context.Context, accountIdentifier string, body MagicGreTunnelNewParams, opts ...option.RequestOption) (res *MagicGreTunnelNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicGreTunnelUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env MagicGreTunnelNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists GRE tunnels associated with an account. +func (r *MagicGreTunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicGreTunnelListResponse, err error) { + opts = append(r.Options[:], opts...) + var env MagicGreTunnelListResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,39 +86,12 @@ func (r *MagicGreTunnelService) Get(ctx context.Context, accountIdentifier strin return } -// Creates new GRE tunnels. Use `?validate_only=true` as an optional query -// parameter to only run validation without persisting changes. -func (r *MagicGreTunnelService) MagicGreTunnelsNewGreTunnels(ctx context.Context, accountIdentifier string, body MagicGreTunnelMagicGreTunnelsNewGreTunnelsParams, opts ...option.RequestOption) (res *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists GRE tunnels associated with an account. -func (r *MagicGreTunnelService) MagicGreTunnelsListGreTunnels(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Updates multiple GRE tunnels. Use `?validate_only=true` as an optional query +// Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query // parameter to only run validation without persisting changes. -func (r *MagicGreTunnelService) MagicGreTunnelsUpdateMultipleGreTunnels(ctx context.Context, accountIdentifier string, body MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsParams, opts ...option.RequestOption) (res *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse, err error) { +func (r *MagicGreTunnelService) Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicGreTunnelReplaceParams, opts ...option.RequestOption) (res *MagicGreTunnelReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier) + var env MagicGreTunnelReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return @@ -114,79 +100,24 @@ func (r *MagicGreTunnelService) MagicGreTunnelsUpdateMultipleGreTunnels(ctx cont return } -type MagicGreTunnelUpdateResponse struct { - Modified bool `json:"modified"` - ModifiedGreTunnel interface{} `json:"modified_gre_tunnel"` - JSON magicGreTunnelUpdateResponseJSON `json:"-"` +type MagicGreTunnelNewResponse struct { + GreTunnels []MagicGreTunnelNewResponseGreTunnel `json:"gre_tunnels"` + JSON magicGreTunnelNewResponseJSON `json:"-"` } -// magicGreTunnelUpdateResponseJSON contains the JSON metadata for the struct -// [MagicGreTunnelUpdateResponse] -type magicGreTunnelUpdateResponseJSON struct { - Modified apijson.Field - ModifiedGreTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelDeleteResponse struct { - Deleted bool `json:"deleted"` - DeletedGreTunnel interface{} `json:"deleted_gre_tunnel"` - JSON magicGreTunnelDeleteResponseJSON `json:"-"` -} - -// magicGreTunnelDeleteResponseJSON contains the JSON metadata for the struct -// [MagicGreTunnelDeleteResponse] -type magicGreTunnelDeleteResponseJSON struct { - Deleted apijson.Field - DeletedGreTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelGetResponse struct { - GreTunnel interface{} `json:"gre_tunnel"` - JSON magicGreTunnelGetResponseJSON `json:"-"` -} - -// magicGreTunnelGetResponseJSON contains the JSON metadata for the struct -// [MagicGreTunnelGetResponse] -type magicGreTunnelGetResponseJSON struct { - GreTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse struct { - GreTunnels []MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnel `json:"gre_tunnels"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseJSON contains the JSON -// metadata for the struct [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseJSON struct { +// magicGreTunnelNewResponseJSON contains the JSON metadata for the struct +// [MagicGreTunnelNewResponse] +type magicGreTunnelNewResponseJSON struct { GreTunnels apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnel struct { +type MagicGreTunnelNewResponseGreTunnel struct { // The IP address assigned to the Cloudflare side of the GRE tunnel. CloudflareGreEndpoint string `json:"cloudflare_gre_endpoint,required"` // The IP address assigned to the customer side of the GRE tunnel. @@ -203,22 +134,21 @@ type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnel struct { // The date and time the tunnel was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // An optional description of the GRE tunnel. - Description string `json:"description"` - HealthCheck MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheck `json:"health_check"` + Description string `json:"description"` + HealthCheck MagicGreTunnelNewResponseGreTunnelsHealthCheck `json:"health_check"` // The date and time the tunnel was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value // is 576. Mtu int64 `json:"mtu"` // Time To Live (TTL) in number of hops of the GRE tunnel. - TTL int64 `json:"ttl"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelJSON `json:"-"` + TTL int64 `json:"ttl"` + JSON magicGreTunnelNewResponseGreTunnelJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelJSON contains the -// JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnel] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelJSON struct { +// magicGreTunnelNewResponseGreTunnelJSON contains the JSON metadata for the struct +// [MagicGreTunnelNewResponseGreTunnel] +type magicGreTunnelNewResponseGreTunnelJSON struct { CloudflareGreEndpoint apijson.Field CustomerGreEndpoint apijson.Field InterfaceAddress apijson.Field @@ -234,33 +164,32 @@ type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelNewResponseGreTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheck struct { +type MagicGreTunnelNewResponseGreTunnelsHealthCheck struct { // The direction of the flow of the healthcheck. Either unidirectional, where the // probe comes to you via the tunnel and the result comes back to Cloudflare via // the open Internet, or bidirectional where both the probe and result come and go // via the tunnel. - Direction MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirection `json:"direction"` + Direction MagicGreTunnelNewResponseGreTunnelsHealthCheckDirection `json:"direction"` // Determines whether to run healthchecks for a tunnel. Enabled bool `json:"enabled"` // How frequent the health check is run. The default value is `mid`. - Rate MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRate `json:"rate"` + Rate MagicGreTunnelNewResponseGreTunnelsHealthCheckRate `json:"rate"` // The destination address in a request type health check. After the healthcheck is // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded // to this address. This field defaults to `customer_gre_endpoint address`. Target string `json:"target"` // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckType `json:"type"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckJSON `json:"-"` + Type MagicGreTunnelNewResponseGreTunnelsHealthCheckType `json:"type"` + JSON magicGreTunnelNewResponseGreTunnelsHealthCheckJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheck] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckJSON struct { +// magicGreTunnelNewResponseGreTunnelsHealthCheckJSON contains the JSON metadata +// for the struct [MagicGreTunnelNewResponseGreTunnelsHealthCheck] +type magicGreTunnelNewResponseGreTunnelsHealthCheckJSON struct { Direction apijson.Field Enabled apijson.Field Rate apijson.Field @@ -270,7 +199,7 @@ type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckJSON ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelNewResponseGreTunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -278,48 +207,48 @@ func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheck // probe comes to you via the tunnel and the result comes back to Cloudflare via // the open Internet, or bidirectional where both the probe and result come and go // via the tunnel. -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirection string +type MagicGreTunnelNewResponseGreTunnelsHealthCheckDirection string const ( - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirectionUnidirectional MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirection = "unidirectional" - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirectionBidirectional MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckDirection = "bidirectional" + MagicGreTunnelNewResponseGreTunnelsHealthCheckDirectionUnidirectional MagicGreTunnelNewResponseGreTunnelsHealthCheckDirection = "unidirectional" + MagicGreTunnelNewResponseGreTunnelsHealthCheckDirectionBidirectional MagicGreTunnelNewResponseGreTunnelsHealthCheckDirection = "bidirectional" ) // How frequent the health check is run. The default value is `mid`. -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRate string +type MagicGreTunnelNewResponseGreTunnelsHealthCheckRate string const ( - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRateLow MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRate = "low" - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRateMid MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRate = "mid" - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRateHigh MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckRate = "high" + MagicGreTunnelNewResponseGreTunnelsHealthCheckRateLow MagicGreTunnelNewResponseGreTunnelsHealthCheckRate = "low" + MagicGreTunnelNewResponseGreTunnelsHealthCheckRateMid MagicGreTunnelNewResponseGreTunnelsHealthCheckRate = "mid" + MagicGreTunnelNewResponseGreTunnelsHealthCheckRateHigh MagicGreTunnelNewResponseGreTunnelsHealthCheckRate = "high" ) // The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckType string +type MagicGreTunnelNewResponseGreTunnelsHealthCheckType string const ( - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckTypeReply MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckType = "reply" - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckTypeRequest MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseGreTunnelsHealthCheckType = "request" + MagicGreTunnelNewResponseGreTunnelsHealthCheckTypeReply MagicGreTunnelNewResponseGreTunnelsHealthCheckType = "reply" + MagicGreTunnelNewResponseGreTunnelsHealthCheckTypeRequest MagicGreTunnelNewResponseGreTunnelsHealthCheckType = "request" ) -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse struct { - GreTunnels []MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnel `json:"gre_tunnels"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseJSON `json:"-"` +type MagicGreTunnelListResponse struct { + GreTunnels []MagicGreTunnelListResponseGreTunnel `json:"gre_tunnels"` + JSON magicGreTunnelListResponseJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseJSON contains the JSON -// metadata for the struct [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseJSON struct { +// magicGreTunnelListResponseJSON contains the JSON metadata for the struct +// [MagicGreTunnelListResponse] +type magicGreTunnelListResponseJSON struct { GreTunnels apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnel struct { +type MagicGreTunnelListResponseGreTunnel struct { // The IP address assigned to the Cloudflare side of the GRE tunnel. CloudflareGreEndpoint string `json:"cloudflare_gre_endpoint,required"` // The IP address assigned to the customer side of the GRE tunnel. @@ -336,22 +265,21 @@ type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnel struct { // The date and time the tunnel was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // An optional description of the GRE tunnel. - Description string `json:"description"` - HealthCheck MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheck `json:"health_check"` + Description string `json:"description"` + HealthCheck MagicGreTunnelListResponseGreTunnelsHealthCheck `json:"health_check"` // The date and time the tunnel was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value // is 576. Mtu int64 `json:"mtu"` // Time To Live (TTL) in number of hops of the GRE tunnel. - TTL int64 `json:"ttl"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelJSON `json:"-"` + TTL int64 `json:"ttl"` + JSON magicGreTunnelListResponseGreTunnelJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelJSON contains the -// JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnel] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelJSON struct { +// magicGreTunnelListResponseGreTunnelJSON contains the JSON metadata for the +// struct [MagicGreTunnelListResponseGreTunnel] +type magicGreTunnelListResponseGreTunnelJSON struct { CloudflareGreEndpoint apijson.Field CustomerGreEndpoint apijson.Field InterfaceAddress apijson.Field @@ -367,33 +295,32 @@ type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponseGreTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheck struct { +type MagicGreTunnelListResponseGreTunnelsHealthCheck struct { // The direction of the flow of the healthcheck. Either unidirectional, where the // probe comes to you via the tunnel and the result comes back to Cloudflare via // the open Internet, or bidirectional where both the probe and result come and go // via the tunnel. - Direction MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirection `json:"direction"` + Direction MagicGreTunnelListResponseGreTunnelsHealthCheckDirection `json:"direction"` // Determines whether to run healthchecks for a tunnel. Enabled bool `json:"enabled"` // How frequent the health check is run. The default value is `mid`. - Rate MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRate `json:"rate"` + Rate MagicGreTunnelListResponseGreTunnelsHealthCheckRate `json:"rate"` // The destination address in a request type health check. After the healthcheck is // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded // to this address. This field defaults to `customer_gre_endpoint address`. Target string `json:"target"` // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckType `json:"type"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckJSON `json:"-"` + Type MagicGreTunnelListResponseGreTunnelsHealthCheckType `json:"type"` + JSON magicGreTunnelListResponseGreTunnelsHealthCheckJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheck] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckJSON struct { +// magicGreTunnelListResponseGreTunnelsHealthCheckJSON contains the JSON metadata +// for the struct [MagicGreTunnelListResponseGreTunnelsHealthCheck] +type magicGreTunnelListResponseGreTunnelsHealthCheckJSON struct { Direction apijson.Field Enabled apijson.Field Rate apijson.Field @@ -403,7 +330,7 @@ type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckJSO ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponseGreTunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -411,254 +338,174 @@ func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthChec // probe comes to you via the tunnel and the result comes back to Cloudflare via // the open Internet, or bidirectional where both the probe and result come and go // via the tunnel. -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirection string +type MagicGreTunnelListResponseGreTunnelsHealthCheckDirection string const ( - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirectionUnidirectional MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirection = "unidirectional" - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirectionBidirectional MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckDirection = "bidirectional" + MagicGreTunnelListResponseGreTunnelsHealthCheckDirectionUnidirectional MagicGreTunnelListResponseGreTunnelsHealthCheckDirection = "unidirectional" + MagicGreTunnelListResponseGreTunnelsHealthCheckDirectionBidirectional MagicGreTunnelListResponseGreTunnelsHealthCheckDirection = "bidirectional" ) // How frequent the health check is run. The default value is `mid`. -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRate string +type MagicGreTunnelListResponseGreTunnelsHealthCheckRate string const ( - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRateLow MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRate = "low" - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRateMid MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRate = "mid" - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRateHigh MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckRate = "high" + MagicGreTunnelListResponseGreTunnelsHealthCheckRateLow MagicGreTunnelListResponseGreTunnelsHealthCheckRate = "low" + MagicGreTunnelListResponseGreTunnelsHealthCheckRateMid MagicGreTunnelListResponseGreTunnelsHealthCheckRate = "mid" + MagicGreTunnelListResponseGreTunnelsHealthCheckRateHigh MagicGreTunnelListResponseGreTunnelsHealthCheckRate = "high" ) // The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckType string +type MagicGreTunnelListResponseGreTunnelsHealthCheckType string const ( - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckTypeReply MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckType = "reply" - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckTypeRequest MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseGreTunnelsHealthCheckType = "request" + MagicGreTunnelListResponseGreTunnelsHealthCheckTypeReply MagicGreTunnelListResponseGreTunnelsHealthCheckType = "reply" + MagicGreTunnelListResponseGreTunnelsHealthCheckTypeRequest MagicGreTunnelListResponseGreTunnelsHealthCheckType = "request" ) -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse struct { - Modified bool `json:"modified"` - ModifiedGreTunnels []MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnel `json:"modified_gre_tunnels"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseJSON `json:"-"` +type MagicGreTunnelDeleteResponse struct { + Deleted bool `json:"deleted"` + DeletedGreTunnel interface{} `json:"deleted_gre_tunnel"` + JSON magicGreTunnelDeleteResponseJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseJSON contains the -// JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseJSON struct { - Modified apijson.Field - ModifiedGreTunnels apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicGreTunnelDeleteResponseJSON contains the JSON metadata for the struct +// [MagicGreTunnelDeleteResponse] +type magicGreTunnelDeleteResponseJSON struct { + Deleted apijson.Field + DeletedGreTunnel apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnel struct { - // The IP address assigned to the Cloudflare side of the GRE tunnel. - CloudflareGreEndpoint string `json:"cloudflare_gre_endpoint,required"` - // The IP address assigned to the customer side of the GRE tunnel. - CustomerGreEndpoint string `json:"customer_gre_endpoint,required"` - // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - // of the tunnel. Select the subnet from the following private IP space: - // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - InterfaceAddress string `json:"interface_address,required"` - // The name of the tunnel. The name cannot contain spaces or special characters, - // must be 15 characters or less, and cannot share a name with another GRE tunnel. - Name string `json:"name,required"` - // Tunnel identifier tag. - ID string `json:"id"` - // The date and time the tunnel was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // An optional description of the GRE tunnel. - Description string `json:"description"` - HealthCheck MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheck `json:"health_check"` - // The date and time the tunnel was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value - // is 576. - Mtu int64 `json:"mtu"` - // Time To Live (TTL) in number of hops of the GRE tunnel. - TTL int64 `json:"ttl"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelJSON `json:"-"` +type MagicGreTunnelGetResponse struct { + GreTunnel interface{} `json:"gre_tunnel"` + JSON magicGreTunnelGetResponseJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnel] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelJSON struct { - CloudflareGreEndpoint apijson.Field - CustomerGreEndpoint apijson.Field - InterfaceAddress apijson.Field - Name apijson.Field - ID apijson.Field - CreatedOn apijson.Field - Description apijson.Field - HealthCheck apijson.Field - ModifiedOn apijson.Field - Mtu apijson.Field - TTL apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicGreTunnelGetResponseJSON contains the JSON metadata for the struct +// [MagicGreTunnelGetResponse] +type magicGreTunnelGetResponseJSON struct { + GreTunnel apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheck struct { - // The direction of the flow of the healthcheck. Either unidirectional, where the - // probe comes to you via the tunnel and the result comes back to Cloudflare via - // the open Internet, or bidirectional where both the probe and result come and go - // via the tunnel. - Direction MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirection `json:"direction"` - // Determines whether to run healthchecks for a tunnel. - Enabled bool `json:"enabled"` - // How frequent the health check is run. The default value is `mid`. - Rate MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRate `json:"rate"` - // The destination address in a request type health check. After the healthcheck is - // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded - // to this address. This field defaults to `customer_gre_endpoint address`. - Target string `json:"target"` - // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckType `json:"type"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckJSON `json:"-"` +type MagicGreTunnelReplaceResponse struct { + Modified bool `json:"modified"` + ModifiedGreTunnel interface{} `json:"modified_gre_tunnel"` + JSON magicGreTunnelReplaceResponseJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheck] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckJSON struct { - Direction apijson.Field - Enabled apijson.Field - Rate apijson.Field - Target apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicGreTunnelReplaceResponseJSON contains the JSON metadata for the struct +// [MagicGreTunnelReplaceResponse] +type magicGreTunnelReplaceResponseJSON struct { + Modified apijson.Field + ModifiedGreTunnel apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The direction of the flow of the healthcheck. Either unidirectional, where the -// probe comes to you via the tunnel and the result comes back to Cloudflare via -// the open Internet, or bidirectional where both the probe and result come and go -// via the tunnel. -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirection string - -const ( - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirectionUnidirectional MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirection = "unidirectional" - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirectionBidirectional MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckDirection = "bidirectional" -) - -// How frequent the health check is run. The default value is `mid`. -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRate string - -const ( - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRateLow MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRate = "low" - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRateMid MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRate = "mid" - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRateHigh MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckRate = "high" -) +type MagicGreTunnelNewParams struct { + Body param.Field[interface{}] `json:"body,required"` +} -// The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckType string +func (r MagicGreTunnelNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} -const ( - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckTypeReply MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckType = "reply" - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckTypeRequest MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseModifiedGreTunnelsHealthCheckType = "request" -) +type MagicGreTunnelNewResponseEnvelope struct { + Errors []MagicGreTunnelNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicGreTunnelNewResponseEnvelopeMessages `json:"messages,required"` + Result MagicGreTunnelNewResponse `json:"result,required"` + // Whether the API call was successful + Success MagicGreTunnelNewResponseEnvelopeSuccess `json:"success,required"` + JSON magicGreTunnelNewResponseEnvelopeJSON `json:"-"` +} -type MagicGreTunnelUpdateParams struct { - // The IP address assigned to the Cloudflare side of the GRE tunnel. - CloudflareGreEndpoint param.Field[string] `json:"cloudflare_gre_endpoint,required"` - // The IP address assigned to the customer side of the GRE tunnel. - CustomerGreEndpoint param.Field[string] `json:"customer_gre_endpoint,required"` - // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - // of the tunnel. Select the subnet from the following private IP space: - // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - InterfaceAddress param.Field[string] `json:"interface_address,required"` - // The name of the tunnel. The name cannot contain spaces or special characters, - // must be 15 characters or less, and cannot share a name with another GRE tunnel. - Name param.Field[string] `json:"name,required"` - // An optional description of the GRE tunnel. - Description param.Field[string] `json:"description"` - HealthCheck param.Field[MagicGreTunnelUpdateParamsHealthCheck] `json:"health_check"` - // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value - // is 576. - Mtu param.Field[int64] `json:"mtu"` - // Time To Live (TTL) in number of hops of the GRE tunnel. - TTL param.Field[int64] `json:"ttl"` +// magicGreTunnelNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [MagicGreTunnelNewResponseEnvelope] +type magicGreTunnelNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r MagicGreTunnelUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *MagicGreTunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelUpdateParamsHealthCheck struct { - // The direction of the flow of the healthcheck. Either unidirectional, where the - // probe comes to you via the tunnel and the result comes back to Cloudflare via - // the open Internet, or bidirectional where both the probe and result come and go - // via the tunnel. - Direction param.Field[MagicGreTunnelUpdateParamsHealthCheckDirection] `json:"direction"` - // Determines whether to run healthchecks for a tunnel. - Enabled param.Field[bool] `json:"enabled"` - // How frequent the health check is run. The default value is `mid`. - Rate param.Field[MagicGreTunnelUpdateParamsHealthCheckRate] `json:"rate"` - // The destination address in a request type health check. After the healthcheck is - // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded - // to this address. This field defaults to `customer_gre_endpoint address`. - Target param.Field[string] `json:"target"` - // The type of healthcheck to run, reply or request. The default value is `reply`. - Type param.Field[MagicGreTunnelUpdateParamsHealthCheckType] `json:"type"` +type MagicGreTunnelNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelNewResponseEnvelopeErrorsJSON `json:"-"` } -func (r MagicGreTunnelUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// magicGreTunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MagicGreTunnelNewResponseEnvelopeErrors] +type magicGreTunnelNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// The direction of the flow of the healthcheck. Either unidirectional, where the -// probe comes to you via the tunnel and the result comes back to Cloudflare via -// the open Internet, or bidirectional where both the probe and result come and go -// via the tunnel. -type MagicGreTunnelUpdateParamsHealthCheckDirection string +func (r *MagicGreTunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -const ( - MagicGreTunnelUpdateParamsHealthCheckDirectionUnidirectional MagicGreTunnelUpdateParamsHealthCheckDirection = "unidirectional" - MagicGreTunnelUpdateParamsHealthCheckDirectionBidirectional MagicGreTunnelUpdateParamsHealthCheckDirection = "bidirectional" -) +type MagicGreTunnelNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelNewResponseEnvelopeMessagesJSON `json:"-"` +} -// How frequent the health check is run. The default value is `mid`. -type MagicGreTunnelUpdateParamsHealthCheckRate string +// magicGreTunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MagicGreTunnelNewResponseEnvelopeMessages] +type magicGreTunnelNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} -const ( - MagicGreTunnelUpdateParamsHealthCheckRateLow MagicGreTunnelUpdateParamsHealthCheckRate = "low" - MagicGreTunnelUpdateParamsHealthCheckRateMid MagicGreTunnelUpdateParamsHealthCheckRate = "mid" - MagicGreTunnelUpdateParamsHealthCheckRateHigh MagicGreTunnelUpdateParamsHealthCheckRate = "high" -) +func (r *MagicGreTunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -// The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicGreTunnelUpdateParamsHealthCheckType string +// Whether the API call was successful +type MagicGreTunnelNewResponseEnvelopeSuccess bool const ( - MagicGreTunnelUpdateParamsHealthCheckTypeReply MagicGreTunnelUpdateParamsHealthCheckType = "reply" - MagicGreTunnelUpdateParamsHealthCheckTypeRequest MagicGreTunnelUpdateParamsHealthCheckType = "request" + MagicGreTunnelNewResponseEnvelopeSuccessTrue MagicGreTunnelNewResponseEnvelopeSuccess = true ) -type MagicGreTunnelUpdateResponseEnvelope struct { - Errors []MagicGreTunnelUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicGreTunnelUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MagicGreTunnelUpdateResponse `json:"result,required"` +type MagicGreTunnelListResponseEnvelope struct { + Errors []MagicGreTunnelListResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicGreTunnelListResponseEnvelopeMessages `json:"messages,required"` + Result MagicGreTunnelListResponse `json:"result,required"` // Whether the API call was successful - Success MagicGreTunnelUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON magicGreTunnelUpdateResponseEnvelopeJSON `json:"-"` + Success MagicGreTunnelListResponseEnvelopeSuccess `json:"success,required"` + JSON magicGreTunnelListResponseEnvelopeJSON `json:"-"` } -// magicGreTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [MagicGreTunnelUpdateResponseEnvelope] -type magicGreTunnelUpdateResponseEnvelopeJSON struct { +// magicGreTunnelListResponseEnvelopeJSON contains the JSON metadata for the struct +// [MagicGreTunnelListResponseEnvelope] +type magicGreTunnelListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -667,53 +514,53 @@ type magicGreTunnelUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MagicGreTunnelListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelListResponseEnvelopeErrorsJSON `json:"-"` } -// magicGreTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [MagicGreTunnelUpdateResponseEnvelopeErrors] -type magicGreTunnelUpdateResponseEnvelopeErrorsJSON struct { +// magicGreTunnelListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MagicGreTunnelListResponseEnvelopeErrors] +type magicGreTunnelListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MagicGreTunnelListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelListResponseEnvelopeMessagesJSON `json:"-"` } -// magicGreTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [MagicGreTunnelUpdateResponseEnvelopeMessages] -type magicGreTunnelUpdateResponseEnvelopeMessagesJSON struct { +// magicGreTunnelListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [MagicGreTunnelListResponseEnvelopeMessages] +type magicGreTunnelListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicGreTunnelUpdateResponseEnvelopeSuccess bool +type MagicGreTunnelListResponseEnvelopeSuccess bool const ( - MagicGreTunnelUpdateResponseEnvelopeSuccessTrue MagicGreTunnelUpdateResponseEnvelopeSuccess = true + MagicGreTunnelListResponseEnvelopeSuccessTrue MagicGreTunnelListResponseEnvelopeSuccess = true ) type MagicGreTunnelDeleteResponseEnvelope struct { @@ -854,179 +701,94 @@ const ( MagicGreTunnelGetResponseEnvelopeSuccessTrue MagicGreTunnelGetResponseEnvelopeSuccess = true ) -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r MagicGreTunnelMagicGreTunnelsNewGreTunnelsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelope struct { - Errors []MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponse `json:"result,required"` - // Whether the API call was successful - Success MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelope] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrorsJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrors] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +type MagicGreTunnelReplaceParams struct { + // The IP address assigned to the Cloudflare side of the GRE tunnel. + CloudflareGreEndpoint param.Field[string] `json:"cloudflare_gre_endpoint,required"` + // The IP address assigned to the customer side of the GRE tunnel. + CustomerGreEndpoint param.Field[string] `json:"customer_gre_endpoint,required"` + // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side + // of the tunnel. Select the subnet from the following private IP space: + // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. + InterfaceAddress param.Field[string] `json:"interface_address,required"` + // The name of the tunnel. The name cannot contain spaces or special characters, + // must be 15 characters or less, and cannot share a name with another GRE tunnel. + Name param.Field[string] `json:"name,required"` + // An optional description of the GRE tunnel. + Description param.Field[string] `json:"description"` + HealthCheck param.Field[MagicGreTunnelReplaceParamsHealthCheck] `json:"health_check"` + // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value + // is 576. + Mtu param.Field[int64] `json:"mtu"` + // Time To Live (TTL) in number of hops of the GRE tunnel. + TTL param.Field[int64] `json:"ttl"` } -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessagesJSON `json:"-"` +func (r MagicGreTunnelReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessages] -type magicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type MagicGreTunnelReplaceParamsHealthCheck struct { + // The direction of the flow of the healthcheck. Either unidirectional, where the + // probe comes to you via the tunnel and the result comes back to Cloudflare via + // the open Internet, or bidirectional where both the probe and result come and go + // via the tunnel. + Direction param.Field[MagicGreTunnelReplaceParamsHealthCheckDirection] `json:"direction"` + // Determines whether to run healthchecks for a tunnel. + Enabled param.Field[bool] `json:"enabled"` + // How frequent the health check is run. The default value is `mid`. + Rate param.Field[MagicGreTunnelReplaceParamsHealthCheckRate] `json:"rate"` + // The destination address in a request type health check. After the healthcheck is + // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded + // to this address. This field defaults to `customer_gre_endpoint address`. + Target param.Field[string] `json:"target"` + // The type of healthcheck to run, reply or request. The default value is `reply`. + Type param.Field[MagicGreTunnelReplaceParamsHealthCheckType] `json:"type"` } -func (r *MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r MagicGreTunnelReplaceParamsHealthCheck) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeSuccess bool +// The direction of the flow of the healthcheck. Either unidirectional, where the +// probe comes to you via the tunnel and the result comes back to Cloudflare via +// the open Internet, or bidirectional where both the probe and result come and go +// via the tunnel. +type MagicGreTunnelReplaceParamsHealthCheckDirection string const ( - MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeSuccessTrue MagicGreTunnelMagicGreTunnelsNewGreTunnelsResponseEnvelopeSuccess = true + MagicGreTunnelReplaceParamsHealthCheckDirectionUnidirectional MagicGreTunnelReplaceParamsHealthCheckDirection = "unidirectional" + MagicGreTunnelReplaceParamsHealthCheckDirectionBidirectional MagicGreTunnelReplaceParamsHealthCheckDirection = "bidirectional" ) -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelope struct { - Errors []MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicGreTunnelMagicGreTunnelsListGreTunnelsResponse `json:"result,required"` - // Whether the API call was successful - Success MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelope] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrorsJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrors] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessagesJSON `json:"-"` -} - -// magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessages] -type magicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeSuccess bool +// How frequent the health check is run. The default value is `mid`. +type MagicGreTunnelReplaceParamsHealthCheckRate string const ( - MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeSuccessTrue MagicGreTunnelMagicGreTunnelsListGreTunnelsResponseEnvelopeSuccess = true + MagicGreTunnelReplaceParamsHealthCheckRateLow MagicGreTunnelReplaceParamsHealthCheckRate = "low" + MagicGreTunnelReplaceParamsHealthCheckRateMid MagicGreTunnelReplaceParamsHealthCheckRate = "mid" + MagicGreTunnelReplaceParamsHealthCheckRateHigh MagicGreTunnelReplaceParamsHealthCheckRate = "high" ) -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsParams struct { - Body param.Field[interface{}] `json:"body,required"` -} +// The type of healthcheck to run, reply or request. The default value is `reply`. +type MagicGreTunnelReplaceParamsHealthCheckType string -func (r MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} +const ( + MagicGreTunnelReplaceParamsHealthCheckTypeReply MagicGreTunnelReplaceParamsHealthCheckType = "reply" + MagicGreTunnelReplaceParamsHealthCheckTypeRequest MagicGreTunnelReplaceParamsHealthCheckType = "request" +) -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelope struct { - Errors []MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponse `json:"result,required"` +type MagicGreTunnelReplaceResponseEnvelope struct { + Errors []MagicGreTunnelReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicGreTunnelReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MagicGreTunnelReplaceResponse `json:"result,required"` // Whether the API call was successful - Success MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeJSON `json:"-"` + Success MagicGreTunnelReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON magicGreTunnelReplaceResponseEnvelopeJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelope] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeJSON struct { +// magicGreTunnelReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [MagicGreTunnelReplaceResponseEnvelope] +type magicGreTunnelReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1035,53 +797,51 @@ type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeJSON s ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrorsJSON `json:"-"` +type MagicGreTunnelReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrors] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrorsJSON struct { +// magicGreTunnelReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [MagicGreTunnelReplaceResponseEnvelopeErrors] +type magicGreTunnelReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessagesJSON `json:"-"` +type MagicGreTunnelReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicGreTunnelReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessages] -type magicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessagesJSON struct { +// magicGreTunnelReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [MagicGreTunnelReplaceResponseEnvelopeMessages] +type magicGreTunnelReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicGreTunnelReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeSuccess bool +type MagicGreTunnelReplaceResponseEnvelopeSuccess bool const ( - MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeSuccessTrue MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsResponseEnvelopeSuccess = true + MagicGreTunnelReplaceResponseEnvelopeSuccessTrue MagicGreTunnelReplaceResponseEnvelopeSuccess = true ) diff --git a/magicgretunnel_test.go b/magicgretunnel_test.go index 7d67699cadd..b6d496edeb6 100644 --- a/magicgretunnel_test.go +++ b/magicgretunnel_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMagicGreTunnelUpdateWithOptionalParams(t *testing.T) { +func TestMagicGreTunnelNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,25 +29,11 @@ func TestMagicGreTunnelUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.GreTunnels.Update( + _, err := client.Magics.GreTunnels.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicGreTunnelUpdateParams{ - CloudflareGreEndpoint: cloudflare.F("203.0.113.1"), - CustomerGreEndpoint: cloudflare.F("203.0.113.1"), - InterfaceAddress: cloudflare.F("192.0.2.0/31"), - Name: cloudflare.F("GRE_1"), - Description: cloudflare.F("Tunnel for ISP X"), - HealthCheck: cloudflare.F(cloudflare.MagicGreTunnelUpdateParamsHealthCheck{ - Direction: cloudflare.F(cloudflare.MagicGreTunnelUpdateParamsHealthCheckDirectionBidirectional), - Enabled: cloudflare.F(true), - Rate: cloudflare.F(cloudflare.MagicGreTunnelUpdateParamsHealthCheckRateLow), - Target: cloudflare.F("203.0.113.1"), - Type: cloudflare.F(cloudflare.MagicGreTunnelUpdateParamsHealthCheckTypeRequest), - }), - Mtu: cloudflare.F(int64(0)), - TTL: cloudflare.F(int64(0)), + cloudflare.MagicGreTunnelNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -59,7 +45,7 @@ func TestMagicGreTunnelUpdateWithOptionalParams(t *testing.T) { } } -func TestMagicGreTunnelDelete(t *testing.T) { +func TestMagicGreTunnelList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -75,11 +61,7 @@ func TestMagicGreTunnelDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.GreTunnels.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Magics.GreTunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -89,7 +71,7 @@ func TestMagicGreTunnelDelete(t *testing.T) { } } -func TestMagicGreTunnelGet(t *testing.T) { +func TestMagicGreTunnelDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -105,7 +87,7 @@ func TestMagicGreTunnelGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.GreTunnels.Get( + _, err := client.Magics.GreTunnels.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -119,7 +101,7 @@ func TestMagicGreTunnelGet(t *testing.T) { } } -func TestMagicGreTunnelMagicGreTunnelsNewGreTunnels(t *testing.T) { +func TestMagicGreTunnelGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -135,39 +117,11 @@ func TestMagicGreTunnelMagicGreTunnelsNewGreTunnels(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.GreTunnels.MagicGreTunnelsNewGreTunnels( + _, err := client.Magics.GreTunnels.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicGreTunnelMagicGreTunnelsNewGreTunnelsParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestMagicGreTunnelMagicGreTunnelsListGreTunnels(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), + "023e105f4ecef8ad9ca31a8372d0c353", ) - _, err := client.Magics.GreTunnels.MagicGreTunnelsListGreTunnels(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -177,7 +131,7 @@ func TestMagicGreTunnelMagicGreTunnelsListGreTunnels(t *testing.T) { } } -func TestMagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnels(t *testing.T) { +func TestMagicGreTunnelReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -193,11 +147,25 @@ func TestMagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnels(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.GreTunnels.MagicGreTunnelsUpdateMultipleGreTunnels( + _, err := client.Magics.GreTunnels.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicGreTunnelMagicGreTunnelsUpdateMultipleGreTunnelsParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.MagicGreTunnelReplaceParams{ + CloudflareGreEndpoint: cloudflare.F("203.0.113.1"), + CustomerGreEndpoint: cloudflare.F("203.0.113.1"), + InterfaceAddress: cloudflare.F("192.0.2.0/31"), + Name: cloudflare.F("GRE_1"), + Description: cloudflare.F("Tunnel for ISP X"), + HealthCheck: cloudflare.F(cloudflare.MagicGreTunnelReplaceParamsHealthCheck{ + Direction: cloudflare.F(cloudflare.MagicGreTunnelReplaceParamsHealthCheckDirectionBidirectional), + Enabled: cloudflare.F(true), + Rate: cloudflare.F(cloudflare.MagicGreTunnelReplaceParamsHealthCheckRateLow), + Target: cloudflare.F("203.0.113.1"), + Type: cloudflare.F(cloudflare.MagicGreTunnelReplaceParamsHealthCheckTypeRequest), + }), + Mtu: cloudflare.F(int64(0)), + TTL: cloudflare.F(int64(0)), }, ) if err != nil { diff --git a/magicipsectunnel.go b/magicipsectunnel.go index 8a45f12e1af..aec3cc20185 100644 --- a/magicipsectunnel.go +++ b/magicipsectunnel.go @@ -34,14 +34,27 @@ func NewMagicIpsecTunnelService(opts ...option.RequestOption) (r *MagicIpsecTunn return } -// Updates a specific IPsec tunnel associated with an account. Use -// `?validate_only=true` as an optional query parameter to only run validation -// without persisting changes. -func (r *MagicIpsecTunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicIpsecTunnelUpdateParams, opts ...option.RequestOption) (res *MagicIpsecTunnelUpdateResponse, err error) { +// Creates new IPsec tunnels associated with an account. Use `?validate_only=true` +// as an optional query parameter to only run validation without persisting +// changes. +func (r *MagicIpsecTunnelService) New(ctx context.Context, accountIdentifier string, body MagicIpsecTunnelNewParams, opts ...option.RequestOption) (res *MagicIpsecTunnelNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicIpsecTunnelUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env MagicIpsecTunnelNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists IPsec tunnels associated with an account. +func (r *MagicIpsecTunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicIpsecTunnelListResponse, err error) { + opts = append(r.Options[:], opts...) + var env MagicIpsecTunnelListResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -77,41 +90,13 @@ func (r *MagicIpsecTunnelService) Get(ctx context.Context, accountIdentifier str return } -// Creates new IPsec tunnels associated with an account. Use `?validate_only=true` -// as an optional query parameter to only run validation without persisting -// changes. -func (r *MagicIpsecTunnelService) MagicIPsecTunnelsNewIPsecTunnels(ctx context.Context, accountIdentifier string, body MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams, opts ...option.RequestOption) (res *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists IPsec tunnels associated with an account. -func (r *MagicIpsecTunnelService) MagicIPsecTunnelsListIPsecTunnels(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Update multiple IPsec tunnels associated with an account. Use +// Updates a specific IPsec tunnel associated with an account. Use // `?validate_only=true` as an optional query parameter to only run validation // without persisting changes. -func (r *MagicIpsecTunnelService) MagicIPsecTunnelsUpdateMultipleIPsecTunnels(ctx context.Context, accountIdentifier string, body MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsParams, opts ...option.RequestOption) (res *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse, err error) { +func (r *MagicIpsecTunnelService) Replace(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicIpsecTunnelReplaceParams, opts ...option.RequestOption) (res *MagicIpsecTunnelReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier) + var env MagicIpsecTunnelReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return @@ -120,80 +105,24 @@ func (r *MagicIpsecTunnelService) MagicIPsecTunnelsUpdateMultipleIPsecTunnels(ct return } -type MagicIpsecTunnelUpdateResponse struct { - Modified bool `json:"modified"` - ModifiedIpsecTunnel interface{} `json:"modified_ipsec_tunnel"` - JSON magicIpsecTunnelUpdateResponseJSON `json:"-"` -} - -// magicIpsecTunnelUpdateResponseJSON contains the JSON metadata for the struct -// [MagicIpsecTunnelUpdateResponse] -type magicIpsecTunnelUpdateResponseJSON struct { - Modified apijson.Field - ModifiedIpsecTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelDeleteResponse struct { - Deleted bool `json:"deleted"` - DeletedIpsecTunnel interface{} `json:"deleted_ipsec_tunnel"` - JSON magicIpsecTunnelDeleteResponseJSON `json:"-"` -} - -// magicIpsecTunnelDeleteResponseJSON contains the JSON metadata for the struct -// [MagicIpsecTunnelDeleteResponse] -type magicIpsecTunnelDeleteResponseJSON struct { - Deleted apijson.Field - DeletedIpsecTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelGetResponse struct { - IpsecTunnel interface{} `json:"ipsec_tunnel"` - JSON magicIpsecTunnelGetResponseJSON `json:"-"` -} - -// magicIpsecTunnelGetResponseJSON contains the JSON metadata for the struct -// [MagicIpsecTunnelGetResponse] -type magicIpsecTunnelGetResponseJSON struct { - IpsecTunnel apijson.Field - raw string - ExtraFields map[string]apijson.Field +type MagicIpsecTunnelNewResponse struct { + IpsecTunnels []MagicIpsecTunnelNewResponseIpsecTunnel `json:"ipsec_tunnels"` + JSON magicIpsecTunnelNewResponseJSON `json:"-"` } -func (r *MagicIpsecTunnelGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse struct { - IpsecTunnels []MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnel `json:"ipsec_tunnels"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseJSON contains the JSON -// metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseJSON struct { +// magicIpsecTunnelNewResponseJSON contains the JSON metadata for the struct +// [MagicIpsecTunnelNewResponse] +type magicIpsecTunnelNewResponseJSON struct { IpsecTunnels apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnel struct { +type MagicIpsecTunnelNewResponseIpsecTunnel struct { // The IP address assigned to the Cloudflare side of the IPsec tunnel. CloudflareEndpoint string `json:"cloudflare_endpoint,required"` // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side @@ -216,18 +145,17 @@ type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnel struct // The date and time the tunnel was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The PSK metadata that includes when the PSK was generated. - PskMetadata MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadata `json:"psk_metadata"` + PskMetadata MagicIpsecTunnelNewResponseIpsecTunnelsPskMetadata `json:"psk_metadata"` // If `true`, then IPsec replay protection will be supported in the // Cloudflare-to-customer direction. - ReplayProtection bool `json:"replay_protection"` - TunnelHealthCheck MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck `json:"tunnel_health_check"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelJSON `json:"-"` + ReplayProtection bool `json:"replay_protection"` + TunnelHealthCheck MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheck `json:"tunnel_health_check"` + JSON magicIpsecTunnelNewResponseIpsecTunnelJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelJSON contains -// the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnel] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelJSON struct { +// magicIpsecTunnelNewResponseIpsecTunnelJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelNewResponseIpsecTunnel] +type magicIpsecTunnelNewResponseIpsecTunnelJSON struct { CloudflareEndpoint apijson.Field InterfaceAddress apijson.Field Name apijson.Field @@ -244,48 +172,47 @@ type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelJSON str ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseIpsecTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The PSK metadata that includes when the PSK was generated. -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadata struct { +type MagicIpsecTunnelNewResponseIpsecTunnelsPskMetadata struct { // The date and time the tunnel was last modified. - LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON `json:"-"` + LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` + JSON magicIpsecTunnelNewResponseIpsecTunnelsPskMetadataJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadata] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON struct { +// magicIpsecTunnelNewResponseIpsecTunnelsPskMetadataJSON contains the JSON +// metadata for the struct [MagicIpsecTunnelNewResponseIpsecTunnelsPskMetadata] +type magicIpsecTunnelNewResponseIpsecTunnelsPskMetadataJSON struct { LastGeneratedOn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsPskMetadata) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseIpsecTunnelsPskMetadata) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck struct { +type MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheck struct { // Determines whether to run healthchecks for a tunnel. Enabled bool `json:"enabled"` // How frequent the health check is run. The default value is `mid`. - Rate MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate `json:"rate"` + Rate MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRate `json:"rate"` // The destination address in a request type health check. After the healthcheck is // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded // to this address. This field defaults to `customer_gre_endpoint address`. Target string `json:"target"` // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType `json:"type"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON `json:"-"` + Type MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckType `json:"type"` + JSON magicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON struct { +// magicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckJSON contains the JSON +// metadata for the struct +// [MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheck] +type magicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckJSON struct { Enabled apijson.Field Rate apijson.Field Target apijson.Field @@ -294,46 +221,45 @@ type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelH ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // How frequent the health check is run. The default value is `mid`. -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate string +type MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRate string const ( - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateLow MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "low" - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateMid MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "mid" - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateHigh MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "high" + MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRateLow MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRate = "low" + MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRateMid MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRate = "mid" + MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRateHigh MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckRate = "high" ) // The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType string +type MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckType string const ( - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckTypeReply MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType = "reply" - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckTypeRequest MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType = "request" + MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckTypeReply MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckType = "reply" + MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckTypeRequest MagicIpsecTunnelNewResponseIpsecTunnelsTunnelHealthCheckType = "request" ) -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse struct { - IpsecTunnels []MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnel `json:"ipsec_tunnels"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseJSON `json:"-"` +type MagicIpsecTunnelListResponse struct { + IpsecTunnels []MagicIpsecTunnelListResponseIpsecTunnel `json:"ipsec_tunnels"` + JSON magicIpsecTunnelListResponseJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseJSON contains the JSON -// metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseJSON struct { +// magicIpsecTunnelListResponseJSON contains the JSON metadata for the struct +// [MagicIpsecTunnelListResponse] +type magicIpsecTunnelListResponseJSON struct { IpsecTunnels apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnel struct { +type MagicIpsecTunnelListResponseIpsecTunnel struct { // The IP address assigned to the Cloudflare side of the IPsec tunnel. CloudflareEndpoint string `json:"cloudflare_endpoint,required"` // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side @@ -356,18 +282,17 @@ type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnel struct // The date and time the tunnel was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The PSK metadata that includes when the PSK was generated. - PskMetadata MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadata `json:"psk_metadata"` + PskMetadata MagicIpsecTunnelListResponseIpsecTunnelsPskMetadata `json:"psk_metadata"` // If `true`, then IPsec replay protection will be supported in the // Cloudflare-to-customer direction. - ReplayProtection bool `json:"replay_protection"` - TunnelHealthCheck MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck `json:"tunnel_health_check"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelJSON `json:"-"` + ReplayProtection bool `json:"replay_protection"` + TunnelHealthCheck MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheck `json:"tunnel_health_check"` + JSON magicIpsecTunnelListResponseIpsecTunnelJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnel] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelJSON struct { +// magicIpsecTunnelListResponseIpsecTunnelJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelListResponseIpsecTunnel] +type magicIpsecTunnelListResponseIpsecTunnelJSON struct { CloudflareEndpoint apijson.Field InterfaceAddress apijson.Field Name apijson.Field @@ -384,48 +309,47 @@ type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelJSON st ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelListResponseIpsecTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The PSK metadata that includes when the PSK was generated. -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadata struct { +type MagicIpsecTunnelListResponseIpsecTunnelsPskMetadata struct { // The date and time the tunnel was last modified. - LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON `json:"-"` + LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` + JSON magicIpsecTunnelListResponseIpsecTunnelsPskMetadataJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadata] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadataJSON struct { +// magicIpsecTunnelListResponseIpsecTunnelsPskMetadataJSON contains the JSON +// metadata for the struct [MagicIpsecTunnelListResponseIpsecTunnelsPskMetadata] +type magicIpsecTunnelListResponseIpsecTunnelsPskMetadataJSON struct { LastGeneratedOn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsPskMetadata) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelListResponseIpsecTunnelsPskMetadata) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck struct { +type MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheck struct { // Determines whether to run healthchecks for a tunnel. Enabled bool `json:"enabled"` // How frequent the health check is run. The default value is `mid`. - Rate MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate `json:"rate"` + Rate MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRate `json:"rate"` // The destination address in a request type health check. After the healthcheck is // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded // to this address. This field defaults to `customer_gre_endpoint address`. Target string `json:"target"` // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType `json:"type"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON `json:"-"` + Type MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckType `json:"type"` + JSON magicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckJSON struct { +// magicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckJSON contains the JSON +// metadata for the struct +// [MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheck] +type magicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckJSON struct { Enabled apijson.Field Rate apijson.Field Target apijson.Field @@ -434,170 +358,83 @@ type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnel ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // How frequent the health check is run. The default value is `mid`. -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate string +type MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRate string const ( - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateLow MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "low" - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateMid MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "mid" - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRateHigh MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckRate = "high" + MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRateLow MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRate = "low" + MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRateMid MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRate = "mid" + MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRateHigh MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckRate = "high" ) // The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType string +type MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckType string const ( - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckTypeReply MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType = "reply" - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckTypeRequest MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseIpsecTunnelsTunnelHealthCheckType = "request" + MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckTypeReply MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckType = "reply" + MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckTypeRequest MagicIpsecTunnelListResponseIpsecTunnelsTunnelHealthCheckType = "request" ) -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse struct { - Modified bool `json:"modified"` - ModifiedIpsecTunnels []MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnel `json:"modified_ipsec_tunnels"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseJSON contains -// the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseJSON struct { - Modified apijson.Field - ModifiedIpsecTunnels apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnel struct { - // The IP address assigned to the Cloudflare side of the IPsec tunnel. - CloudflareEndpoint string `json:"cloudflare_endpoint,required"` - // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side - // of the tunnel. Select the subnet from the following private IP space: - // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. - InterfaceAddress string `json:"interface_address,required"` - // The name of the IPsec tunnel. The name cannot share a name with other tunnels. - Name string `json:"name,required"` - // Tunnel identifier tag. - ID string `json:"id"` - // When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel - // (Phase 2). - AllowNullCipher bool `json:"allow_null_cipher"` - // The date and time the tunnel was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // The IP address assigned to the customer side of the IPsec tunnel. - CustomerEndpoint string `json:"customer_endpoint"` - // An optional description forthe IPsec tunnel. - Description string `json:"description"` - // The date and time the tunnel was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // The PSK metadata that includes when the PSK was generated. - PskMetadata MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadata `json:"psk_metadata"` - // If `true`, then IPsec replay protection will be supported in the - // Cloudflare-to-customer direction. - ReplayProtection bool `json:"replay_protection"` - TunnelHealthCheck MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheck `json:"tunnel_health_check"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelJSON `json:"-"` +type MagicIpsecTunnelDeleteResponse struct { + Deleted bool `json:"deleted"` + DeletedIpsecTunnel interface{} `json:"deleted_ipsec_tunnel"` + JSON magicIpsecTunnelDeleteResponseJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnel] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelJSON struct { - CloudflareEndpoint apijson.Field - InterfaceAddress apijson.Field - Name apijson.Field - ID apijson.Field - AllowNullCipher apijson.Field - CreatedOn apijson.Field - CustomerEndpoint apijson.Field - Description apijson.Field - ModifiedOn apijson.Field - PskMetadata apijson.Field - ReplayProtection apijson.Field - TunnelHealthCheck apijson.Field +// magicIpsecTunnelDeleteResponseJSON contains the JSON metadata for the struct +// [MagicIpsecTunnelDeleteResponse] +type magicIpsecTunnelDeleteResponseJSON struct { + Deleted apijson.Field + DeletedIpsecTunnel apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The PSK metadata that includes when the PSK was generated. -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadata struct { - // The date and time the tunnel was last modified. - LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadataJSON `json:"-"` +type MagicIpsecTunnelGetResponse struct { + IpsecTunnel interface{} `json:"ipsec_tunnel"` + JSON magicIpsecTunnelGetResponseJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadataJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadata] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadataJSON struct { - LastGeneratedOn apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicIpsecTunnelGetResponseJSON contains the JSON metadata for the struct +// [MagicIpsecTunnelGetResponse] +type magicIpsecTunnelGetResponseJSON struct { + IpsecTunnel apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsPskMetadata) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheck struct { - // Determines whether to run healthchecks for a tunnel. - Enabled bool `json:"enabled"` - // How frequent the health check is run. The default value is `mid`. - Rate MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRate `json:"rate"` - // The destination address in a request type health check. After the healthcheck is - // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded - // to this address. This field defaults to `customer_gre_endpoint address`. - Target string `json:"target"` - // The type of healthcheck to run, reply or request. The default value is `reply`. - Type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckType `json:"type"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckJSON `json:"-"` +type MagicIpsecTunnelReplaceResponse struct { + Modified bool `json:"modified"` + ModifiedIpsecTunnel interface{} `json:"modified_ipsec_tunnel"` + JSON magicIpsecTunnelReplaceResponseJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheck] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckJSON struct { - Enabled apijson.Field - Rate apijson.Field - Target apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicIpsecTunnelReplaceResponseJSON contains the JSON metadata for the struct +// [MagicIpsecTunnelReplaceResponse] +type magicIpsecTunnelReplaceResponseJSON struct { + Modified apijson.Field + ModifiedIpsecTunnel apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// How frequent the health check is run. The default value is `mid`. -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRate string - -const ( - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRateLow MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRate = "low" - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRateMid MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRate = "mid" - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRateHigh MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckRate = "high" -) - -// The type of healthcheck to run, reply or request. The default value is `reply`. -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckType string - -const ( - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckTypeReply MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckType = "reply" - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckTypeRequest MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseModifiedIpsecTunnelsTunnelHealthCheckType = "request" -) - -type MagicIpsecTunnelUpdateParams struct { +type MagicIpsecTunnelNewParams struct { // The IP address assigned to the Cloudflare side of the IPsec tunnel. CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"` // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side @@ -617,22 +454,22 @@ type MagicIpsecTunnelUpdateParams struct { ReplayProtection param.Field[bool] `json:"replay_protection"` } -func (r MagicIpsecTunnelUpdateParams) MarshalJSON() (data []byte, err error) { +func (r MagicIpsecTunnelNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type MagicIpsecTunnelUpdateResponseEnvelope struct { - Errors []MagicIpsecTunnelUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicIpsecTunnelUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MagicIpsecTunnelUpdateResponse `json:"result,required"` +type MagicIpsecTunnelNewResponseEnvelope struct { + Errors []MagicIpsecTunnelNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicIpsecTunnelNewResponseEnvelopeMessages `json:"messages,required"` + Result MagicIpsecTunnelNewResponse `json:"result,required"` // Whether the API call was successful - Success MagicIpsecTunnelUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON magicIpsecTunnelUpdateResponseEnvelopeJSON `json:"-"` + Success MagicIpsecTunnelNewResponseEnvelopeSuccess `json:"success,required"` + JSON magicIpsecTunnelNewResponseEnvelopeJSON `json:"-"` } -// magicIpsecTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [MagicIpsecTunnelUpdateResponseEnvelope] -type magicIpsecTunnelUpdateResponseEnvelopeJSON struct { +// magicIpsecTunnelNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelNewResponseEnvelope] +type magicIpsecTunnelNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -641,53 +478,122 @@ type magicIpsecTunnelUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MagicIpsecTunnelNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelNewResponseEnvelopeErrorsJSON `json:"-"` } -// magicIpsecTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [MagicIpsecTunnelUpdateResponseEnvelopeErrors] -type magicIpsecTunnelUpdateResponseEnvelopeErrorsJSON struct { +// magicIpsecTunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelNewResponseEnvelopeErrors] +type magicIpsecTunnelNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MagicIpsecTunnelNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelNewResponseEnvelopeMessagesJSON `json:"-"` } -// magicIpsecTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [MagicIpsecTunnelUpdateResponseEnvelopeMessages] -type magicIpsecTunnelUpdateResponseEnvelopeMessagesJSON struct { +// magicIpsecTunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [MagicIpsecTunnelNewResponseEnvelopeMessages] +type magicIpsecTunnelNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicIpsecTunnelUpdateResponseEnvelopeSuccess bool +type MagicIpsecTunnelNewResponseEnvelopeSuccess bool const ( - MagicIpsecTunnelUpdateResponseEnvelopeSuccessTrue MagicIpsecTunnelUpdateResponseEnvelopeSuccess = true + MagicIpsecTunnelNewResponseEnvelopeSuccessTrue MagicIpsecTunnelNewResponseEnvelopeSuccess = true +) + +type MagicIpsecTunnelListResponseEnvelope struct { + Errors []MagicIpsecTunnelListResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicIpsecTunnelListResponseEnvelopeMessages `json:"messages,required"` + Result MagicIpsecTunnelListResponse `json:"result,required"` + // Whether the API call was successful + Success MagicIpsecTunnelListResponseEnvelopeSuccess `json:"success,required"` + JSON magicIpsecTunnelListResponseEnvelopeJSON `json:"-"` +} + +// magicIpsecTunnelListResponseEnvelopeJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelListResponseEnvelope] +type magicIpsecTunnelListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MagicIpsecTunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MagicIpsecTunnelListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelListResponseEnvelopeErrorsJSON `json:"-"` +} + +// magicIpsecTunnelListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [MagicIpsecTunnelListResponseEnvelopeErrors] +type magicIpsecTunnelListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MagicIpsecTunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MagicIpsecTunnelListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelListResponseEnvelopeMessagesJSON `json:"-"` +} + +// magicIpsecTunnelListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [MagicIpsecTunnelListResponseEnvelopeMessages] +type magicIpsecTunnelListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MagicIpsecTunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type MagicIpsecTunnelListResponseEnvelopeSuccess bool + +const ( + MagicIpsecTunnelListResponseEnvelopeSuccessTrue MagicIpsecTunnelListResponseEnvelopeSuccess = true ) type MagicIpsecTunnelDeleteResponseEnvelope struct { @@ -828,7 +734,7 @@ const ( MagicIpsecTunnelGetResponseEnvelopeSuccessTrue MagicIpsecTunnelGetResponseEnvelopeSuccess = true ) -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams struct { +type MagicIpsecTunnelReplaceParams struct { // The IP address assigned to the Cloudflare side of the IPsec tunnel. CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"` // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side @@ -848,175 +754,22 @@ type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams struct { ReplayProtection param.Field[bool] `json:"replay_protection"` } -func (r MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams) MarshalJSON() (data []byte, err error) { +func (r MagicIpsecTunnelReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelope struct { - Errors []MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponse `json:"result,required"` - // Whether the API call was successful - Success MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelope] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrorsJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrors] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessagesJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessages] -type magicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeSuccess bool - -const ( - MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeSuccessTrue MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsResponseEnvelopeSuccess = true -) - -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelope struct { - Errors []MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponse `json:"result,required"` - // Whether the API call was successful - Success MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelope] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrorsJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrors] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessagesJSON `json:"-"` -} - -// magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessages] -type magicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeSuccess bool - -const ( - MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeSuccessTrue MagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnelsResponseEnvelopeSuccess = true -) - -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelope struct { - Errors []MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponse `json:"result,required"` +type MagicIpsecTunnelReplaceResponseEnvelope struct { + Errors []MagicIpsecTunnelReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicIpsecTunnelReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MagicIpsecTunnelReplaceResponse `json:"result,required"` // Whether the API call was successful - Success MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeJSON `json:"-"` + Success MagicIpsecTunnelReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON magicIpsecTunnelReplaceResponseEnvelopeJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelope] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeJSON struct { +// magicIpsecTunnelReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelReplaceResponseEnvelope] +type magicIpsecTunnelReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1025,53 +778,51 @@ type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrorsJSON `json:"-"` +type MagicIpsecTunnelReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrors] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrorsJSON struct { +// magicIpsecTunnelReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [MagicIpsecTunnelReplaceResponseEnvelopeErrors] +type magicIpsecTunnelReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessagesJSON `json:"-"` +type MagicIpsecTunnelReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessages] -type magicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessagesJSON struct { +// magicIpsecTunnelReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [MagicIpsecTunnelReplaceResponseEnvelopeMessages] +type magicIpsecTunnelReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeSuccess bool +type MagicIpsecTunnelReplaceResponseEnvelopeSuccess bool const ( - MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeSuccessTrue MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsResponseEnvelopeSuccess = true + MagicIpsecTunnelReplaceResponseEnvelopeSuccessTrue MagicIpsecTunnelReplaceResponseEnvelopeSuccess = true ) diff --git a/magicipsectunnel_test.go b/magicipsectunnel_test.go index 736e4f30609..77a3ac1c548 100644 --- a/magicipsectunnel_test.go +++ b/magicipsectunnel_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMagicIpsecTunnelUpdateWithOptionalParams(t *testing.T) { +func TestMagicIpsecTunnelNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestMagicIpsecTunnelUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.Update( + _, err := client.Magics.IpsecTunnels.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicIpsecTunnelUpdateParams{ + cloudflare.MagicIpsecTunnelNewParams{ CloudflareEndpoint: cloudflare.F("203.0.113.1"), InterfaceAddress: cloudflare.F("192.0.2.0/31"), Name: cloudflare.F("IPsec_1"), @@ -52,7 +51,7 @@ func TestMagicIpsecTunnelUpdateWithOptionalParams(t *testing.T) { } } -func TestMagicIpsecTunnelDelete(t *testing.T) { +func TestMagicIpsecTunnelList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -68,11 +67,7 @@ func TestMagicIpsecTunnelDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Magics.IpsecTunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -82,7 +77,7 @@ func TestMagicIpsecTunnelDelete(t *testing.T) { } } -func TestMagicIpsecTunnelGet(t *testing.T) { +func TestMagicIpsecTunnelDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -98,7 +93,7 @@ func TestMagicIpsecTunnelGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.Get( + _, err := client.Magics.IpsecTunnels.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -112,7 +107,7 @@ func TestMagicIpsecTunnelGet(t *testing.T) { } } -func TestMagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsWithOptionalParams(t *testing.T) { +func TestMagicIpsecTunnelGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -128,45 +123,11 @@ func TestMagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsWithOptionalParams(t *t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.MagicIPsecTunnelsNewIPsecTunnels( + _, err := client.Magics.IpsecTunnels.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicIpsecTunnelMagicIPsecTunnelsNewIPsecTunnelsParams{ - CloudflareEndpoint: cloudflare.F("203.0.113.1"), - InterfaceAddress: cloudflare.F("192.0.2.0/31"), - Name: cloudflare.F("IPsec_1"), - CustomerEndpoint: cloudflare.F("203.0.113.1"), - Description: cloudflare.F("Tunnel for ISP X"), - Psk: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"), - ReplayProtection: cloudflare.F(false), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestMagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnels(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), + "023e105f4ecef8ad9ca31a8372d0c353", ) - _, err := client.Magics.IpsecTunnels.MagicIPsecTunnelsListIPsecTunnels(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -176,7 +137,7 @@ func TestMagicIpsecTunnelMagicIPsecTunnelsListIPsecTunnels(t *testing.T) { } } -func TestMagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnels(t *testing.T) { +func TestMagicIpsecTunnelReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -192,11 +153,18 @@ func TestMagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnels(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.MagicIPsecTunnelsUpdateMultipleIPsecTunnels( + _, err := client.Magics.IpsecTunnels.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicIpsecTunnelMagicIPsecTunnelsUpdateMultipleIPsecTunnelsParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.MagicIpsecTunnelReplaceParams{ + CloudflareEndpoint: cloudflare.F("203.0.113.1"), + InterfaceAddress: cloudflare.F("192.0.2.0/31"), + Name: cloudflare.F("IPsec_1"), + CustomerEndpoint: cloudflare.F("203.0.113.1"), + Description: cloudflare.F("Tunnel for ISP X"), + Psk: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"), + ReplayProtection: cloudflare.F(false), }, ) if err != nil { diff --git a/magicipsectunnelpskgenerate.go b/magicipsectunnelpskgenerate.go index 4b3ee924dc0..464881b8368 100644 --- a/magicipsectunnelpskgenerate.go +++ b/magicipsectunnelpskgenerate.go @@ -36,9 +36,9 @@ func NewMagicIpsecTunnelPskGenerateService(opts ...option.RequestOption) (r *Mag // without persisting changes. After a PSK is generated, the PSK is immediately // persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a // safe place. -func (r *MagicIpsecTunnelPskGenerateService) MagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnels(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse, err error) { +func (r *MagicIpsecTunnelPskGenerateService) New(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicIpsecTunnelPskGenerateNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelope + var env MagicIpsecTunnelPskGenerateNewResponseEnvelope path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", accountIdentifier, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -48,20 +48,19 @@ func (r *MagicIpsecTunnelPskGenerateService) MagicIPsecTunnelsGeneratePreSharedK return } -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse struct { +type MagicIpsecTunnelPskGenerateNewResponse struct { // Identifier IpsecTunnelID string `json:"ipsec_tunnel_id"` // A randomly generated or provided string for use in the IPsec tunnel. Psk string `json:"psk"` // The PSK metadata that includes when the PSK was generated. - PskMetadata MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadata `json:"psk_metadata"` - JSON magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseJSON `json:"-"` + PskMetadata MagicIpsecTunnelPskGenerateNewResponsePskMetadata `json:"psk_metadata"` + JSON magicIpsecTunnelPskGenerateNewResponseJSON `json:"-"` } -// magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse] -type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseJSON struct { +// magicIpsecTunnelPskGenerateNewResponseJSON contains the JSON metadata for the +// struct [MagicIpsecTunnelPskGenerateNewResponse] +type magicIpsecTunnelPskGenerateNewResponseJSON struct { IpsecTunnelID apijson.Field Psk apijson.Field PskMetadata apijson.Field @@ -69,43 +68,41 @@ type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsec ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelPskGenerateNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The PSK metadata that includes when the PSK was generated. -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadata struct { +type MagicIpsecTunnelPskGenerateNewResponsePskMetadata struct { // The date and time the tunnel was last modified. - LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` - JSON magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadataJSON `json:"-"` + LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"` + JSON magicIpsecTunnelPskGenerateNewResponsePskMetadataJSON `json:"-"` } -// magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadataJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadata] -type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadataJSON struct { +// magicIpsecTunnelPskGenerateNewResponsePskMetadataJSON contains the JSON metadata +// for the struct [MagicIpsecTunnelPskGenerateNewResponsePskMetadata] +type magicIpsecTunnelPskGenerateNewResponsePskMetadataJSON struct { LastGeneratedOn apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponsePskMetadata) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelPskGenerateNewResponsePskMetadata) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelope struct { - Errors []MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponse `json:"result,required"` +type MagicIpsecTunnelPskGenerateNewResponseEnvelope struct { + Errors []MagicIpsecTunnelPskGenerateNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicIpsecTunnelPskGenerateNewResponseEnvelopeMessages `json:"messages,required"` + Result MagicIpsecTunnelPskGenerateNewResponse `json:"result,required"` // Whether the API call was successful - Success MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeSuccess `json:"success,required"` - JSON magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeJSON `json:"-"` + Success MagicIpsecTunnelPskGenerateNewResponseEnvelopeSuccess `json:"success,required"` + JSON magicIpsecTunnelPskGenerateNewResponseEnvelopeJSON `json:"-"` } -// magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelope] -type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeJSON struct { +// magicIpsecTunnelPskGenerateNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [MagicIpsecTunnelPskGenerateNewResponseEnvelope] +type magicIpsecTunnelPskGenerateNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -114,53 +111,51 @@ type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsec ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelPskGenerateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrorsJSON `json:"-"` +type MagicIpsecTunnelPskGenerateNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelPskGenerateNewResponseEnvelopeErrorsJSON `json:"-"` } -// magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrors] -type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrorsJSON struct { +// magicIpsecTunnelPskGenerateNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [MagicIpsecTunnelPskGenerateNewResponseEnvelopeErrors] +type magicIpsecTunnelPskGenerateNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelPskGenerateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessagesJSON `json:"-"` +type MagicIpsecTunnelPskGenerateNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicIpsecTunnelPskGenerateNewResponseEnvelopeMessagesJSON `json:"-"` } -// magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessages] -type magicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessagesJSON struct { +// magicIpsecTunnelPskGenerateNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [MagicIpsecTunnelPskGenerateNewResponseEnvelopeMessages] +type magicIpsecTunnelPskGenerateNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicIpsecTunnelPskGenerateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeSuccess bool +type MagicIpsecTunnelPskGenerateNewResponseEnvelopeSuccess bool const ( - MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeSuccessTrue MagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnelsResponseEnvelopeSuccess = true + MagicIpsecTunnelPskGenerateNewResponseEnvelopeSuccessTrue MagicIpsecTunnelPskGenerateNewResponseEnvelopeSuccess = true ) diff --git a/magicipsectunnelpskgenerate_test.go b/magicipsectunnelpskgenerate_test.go index 2247743fe1f..56330c7c8fb 100644 --- a/magicipsectunnelpskgenerate_test.go +++ b/magicipsectunnelpskgenerate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnels(t *testing.T) { +func TestMagicIpsecTunnelPskGenerateNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestMagicIpsecTunnelPskGenerateMagicIPsecTunnelsGeneratePreSharedKeyPskForI option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.IpsecTunnels.PskGenerates.MagicIPsecTunnelsGeneratePreSharedKeyPskForIPsecTunnels( + _, err := client.Magics.IpsecTunnels.PskGenerates.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/magicroute.go b/magicroute.go index a1c7e7ab993..13a1a65e0f0 100644 --- a/magicroute.go +++ b/magicroute.go @@ -31,13 +31,13 @@ func NewMagicRouteService(opts ...option.RequestOption) (r *MagicRouteService) { return } -// Update a specific Magic static route. Use `?validate_only=true` as an optional -// query parameter to run validation only without persisting changes. -func (r *MagicRouteService) Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body MagicRouteUpdateParams, opts ...option.RequestOption) (res *MagicRouteUpdateResponse, err error) { +// Creates a new Magic static route. Use `?validate_only=true` as an optional query +// parameter to run validation only without persisting changes. +func (r *MagicRouteService) New(ctx context.Context, accountIdentifier string, body MagicRouteNewParams, opts ...option.RequestOption) (res *MagicRouteNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicRouteUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env MagicRouteNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -71,20 +71,6 @@ func (r *MagicRouteService) Get(ctx context.Context, accountIdentifier string, r return } -// Creates a new Magic static route. Use `?validate_only=true` as an optional query -// parameter to run validation only without persisting changes. -func (r *MagicRouteService) MagicStaticRoutesNewRoutes(ctx context.Context, accountIdentifier string, body MagicRouteMagicStaticRoutesNewRoutesParams, opts ...option.RequestOption) (res *MagicRouteMagicStaticRoutesNewRoutesResponse, err error) { - opts = append(r.Options[:], opts...) - var env MagicRouteMagicStaticRoutesNewRoutesResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List all Magic static routes. func (r *MagicRouteService) MagicStaticRoutesListRoutes(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicRouteMagicStaticRoutesListRoutesResponse, err error) { opts = append(r.Options[:], opts...) @@ -98,13 +84,12 @@ func (r *MagicRouteService) MagicStaticRoutesListRoutes(ctx context.Context, acc return } -// Update multiple Magic static routes. Use `?validate_only=true` as an optional -// query parameter to run validation only without persisting changes. Only fields -// for a route that need to be changed need be provided. -func (r *MagicRouteService) MagicStaticRoutesUpdateManyRoutes(ctx context.Context, accountIdentifier string, body MagicRouteMagicStaticRoutesUpdateManyRoutesParams, opts ...option.RequestOption) (res *MagicRouteMagicStaticRoutesUpdateManyRoutesResponse, err error) { +// Update a specific Magic static route. Use `?validate_only=true` as an optional +// query parameter to run validation only without persisting changes. +func (r *MagicRouteService) Replace(ctx context.Context, accountIdentifier string, routeIdentifier string, body MagicRouteReplaceParams, opts ...option.RequestOption) (res *MagicRouteReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier) + var env MagicRouteReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return @@ -113,79 +98,24 @@ func (r *MagicRouteService) MagicStaticRoutesUpdateManyRoutes(ctx context.Contex return } -type MagicRouteUpdateResponse struct { - Modified bool `json:"modified"` - ModifiedRoute interface{} `json:"modified_route"` - JSON magicRouteUpdateResponseJSON `json:"-"` -} - -// magicRouteUpdateResponseJSON contains the JSON metadata for the struct -// [MagicRouteUpdateResponse] -type magicRouteUpdateResponseJSON struct { - Modified apijson.Field - ModifiedRoute apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteDeleteResponse struct { - Deleted bool `json:"deleted"` - DeletedRoute interface{} `json:"deleted_route"` - JSON magicRouteDeleteResponseJSON `json:"-"` -} - -// magicRouteDeleteResponseJSON contains the JSON metadata for the struct -// [MagicRouteDeleteResponse] -type magicRouteDeleteResponseJSON struct { - Deleted apijson.Field - DeletedRoute apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteGetResponse struct { - Route interface{} `json:"route"` - JSON magicRouteGetResponseJSON `json:"-"` -} - -// magicRouteGetResponseJSON contains the JSON metadata for the struct -// [MagicRouteGetResponse] -type magicRouteGetResponseJSON struct { - Route apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteMagicStaticRoutesNewRoutesResponse struct { - Routes []MagicRouteMagicStaticRoutesNewRoutesResponseRoute `json:"routes"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseJSON `json:"-"` +type MagicRouteNewResponse struct { + Routes []MagicRouteNewResponseRoute `json:"routes"` + JSON magicRouteNewResponseJSON `json:"-"` } -// magicRouteMagicStaticRoutesNewRoutesResponseJSON contains the JSON metadata for -// the struct [MagicRouteMagicStaticRoutesNewRoutesResponse] -type magicRouteMagicStaticRoutesNewRoutesResponseJSON struct { +// magicRouteNewResponseJSON contains the JSON metadata for the struct +// [MagicRouteNewResponse] +type magicRouteNewResponseJSON struct { Routes apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesNewRoutesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteMagicStaticRoutesNewRoutesResponseRoute struct { +type MagicRouteNewResponseRoute struct { // The next-hop IP Address for the static route. Nexthop string `json:"nexthop,required"` // IP Prefix in Classless Inter-Domain Routing format. @@ -201,15 +131,15 @@ type MagicRouteMagicStaticRoutesNewRoutesResponseRoute struct { // When the route was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Used only for ECMP routes. - Scope MagicRouteMagicStaticRoutesNewRoutesResponseRoutesScope `json:"scope"` + Scope MagicRouteNewResponseRoutesScope `json:"scope"` // Optional weight of the ECMP scope - if provided. - Weight int64 `json:"weight"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseRouteJSON `json:"-"` + Weight int64 `json:"weight"` + JSON magicRouteNewResponseRouteJSON `json:"-"` } -// magicRouteMagicStaticRoutesNewRoutesResponseRouteJSON contains the JSON metadata -// for the struct [MagicRouteMagicStaticRoutesNewRoutesResponseRoute] -type magicRouteMagicStaticRoutesNewRoutesResponseRouteJSON struct { +// magicRouteNewResponseRouteJSON contains the JSON metadata for the struct +// [MagicRouteNewResponseRoute] +type magicRouteNewResponseRouteJSON struct { Nexthop apijson.Field Prefix apijson.Field Priority apijson.Field @@ -223,30 +153,65 @@ type magicRouteMagicStaticRoutesNewRoutesResponseRouteJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesNewRoutesResponseRoute) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponseRoute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Used only for ECMP routes. -type MagicRouteMagicStaticRoutesNewRoutesResponseRoutesScope struct { +type MagicRouteNewResponseRoutesScope struct { // List of colo names for the ECMP scope. ColoNames []string `json:"colo_names"` // List of colo regions for the ECMP scope. - ColoRegions []string `json:"colo_regions"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseRoutesScopeJSON `json:"-"` + ColoRegions []string `json:"colo_regions"` + JSON magicRouteNewResponseRoutesScopeJSON `json:"-"` } -// magicRouteMagicStaticRoutesNewRoutesResponseRoutesScopeJSON contains the JSON -// metadata for the struct -// [MagicRouteMagicStaticRoutesNewRoutesResponseRoutesScope] -type magicRouteMagicStaticRoutesNewRoutesResponseRoutesScopeJSON struct { +// magicRouteNewResponseRoutesScopeJSON contains the JSON metadata for the struct +// [MagicRouteNewResponseRoutesScope] +type magicRouteNewResponseRoutesScopeJSON struct { ColoNames apijson.Field ColoRegions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesNewRoutesResponseRoutesScope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponseRoutesScope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MagicRouteDeleteResponse struct { + Deleted bool `json:"deleted"` + DeletedRoute interface{} `json:"deleted_route"` + JSON magicRouteDeleteResponseJSON `json:"-"` +} + +// magicRouteDeleteResponseJSON contains the JSON metadata for the struct +// [MagicRouteDeleteResponse] +type magicRouteDeleteResponseJSON struct { + Deleted apijson.Field + DeletedRoute apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MagicRouteDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MagicRouteGetResponse struct { + Route interface{} `json:"route"` + JSON magicRouteGetResponseJSON `json:"-"` +} + +// magicRouteGetResponseJSON contains the JSON metadata for the struct +// [MagicRouteGetResponse] +type magicRouteGetResponseJSON struct { + Route apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MagicRouteGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -332,134 +297,45 @@ func (r *MagicRouteMagicStaticRoutesListRoutesResponseRoutesScope) UnmarshalJSON return apijson.UnmarshalRoot(data, r) } -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponse struct { - Modified bool `json:"modified"` - ModifiedRoutes []MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoute `json:"modified_routes"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseJSON `json:"-"` -} - -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseJSON contains the JSON -// metadata for the struct [MagicRouteMagicStaticRoutesUpdateManyRoutesResponse] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseJSON struct { - Modified apijson.Field - ModifiedRoutes apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoute struct { - // The next-hop IP Address for the static route. - Nexthop string `json:"nexthop,required"` - // IP Prefix in Classless Inter-Domain Routing format. - Prefix string `json:"prefix,required"` - // Priority of the static route. - Priority int64 `json:"priority,required"` - // Identifier - ID string `json:"id"` - // When the route was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // An optional human provided description of the static route. - Description string `json:"description"` - // When the route was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // Used only for ECMP routes. - Scope MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScope `json:"scope"` - // Optional weight of the ECMP scope - if provided. - Weight int64 `json:"weight"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRouteJSON `json:"-"` -} - -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRouteJSON contains -// the JSON metadata for the struct -// [MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoute] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRouteJSON struct { - Nexthop apijson.Field - Prefix apijson.Field - Priority apijson.Field - ID apijson.Field - CreatedOn apijson.Field - Description apijson.Field - ModifiedOn apijson.Field - Scope apijson.Field - Weight apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoute) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Used only for ECMP routes. -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScope struct { - // List of colo names for the ECMP scope. - ColoNames []string `json:"colo_names"` - // List of colo regions for the ECMP scope. - ColoRegions []string `json:"colo_regions"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScopeJSON `json:"-"` +type MagicRouteReplaceResponse struct { + Modified bool `json:"modified"` + ModifiedRoute interface{} `json:"modified_route"` + JSON magicRouteReplaceResponseJSON `json:"-"` } -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScopeJSON -// contains the JSON metadata for the struct -// [MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScope] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScopeJSON struct { - ColoNames apijson.Field - ColoRegions apijson.Field - raw string - ExtraFields map[string]apijson.Field +// magicRouteReplaceResponseJSON contains the JSON metadata for the struct +// [MagicRouteReplaceResponse] +type magicRouteReplaceResponseJSON struct { + Modified apijson.Field + ModifiedRoute apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponseModifiedRoutesScope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteUpdateParams struct { - // The next-hop IP Address for the static route. - Nexthop param.Field[string] `json:"nexthop,required"` - // IP Prefix in Classless Inter-Domain Routing format. - Prefix param.Field[string] `json:"prefix,required"` - // Priority of the static route. - Priority param.Field[int64] `json:"priority,required"` - // An optional human provided description of the static route. - Description param.Field[string] `json:"description"` - // Used only for ECMP routes. - Scope param.Field[MagicRouteUpdateParamsScope] `json:"scope"` - // Optional weight of the ECMP scope - if provided. - Weight param.Field[int64] `json:"weight"` -} - -func (r MagicRouteUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Used only for ECMP routes. -type MagicRouteUpdateParamsScope struct { - // List of colo names for the ECMP scope. - ColoNames param.Field[[]string] `json:"colo_names"` - // List of colo regions for the ECMP scope. - ColoRegions param.Field[[]string] `json:"colo_regions"` +type MagicRouteNewParams struct { + Body param.Field[interface{}] `json:"body,required"` } -func (r MagicRouteUpdateParamsScope) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r MagicRouteNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } -type MagicRouteUpdateResponseEnvelope struct { - Errors []MagicRouteUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicRouteUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MagicRouteUpdateResponse `json:"result,required"` +type MagicRouteNewResponseEnvelope struct { + Errors []MagicRouteNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicRouteNewResponseEnvelopeMessages `json:"messages,required"` + Result MagicRouteNewResponse `json:"result,required"` // Whether the API call was successful - Success MagicRouteUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON magicRouteUpdateResponseEnvelopeJSON `json:"-"` + Success MagicRouteNewResponseEnvelopeSuccess `json:"success,required"` + JSON magicRouteNewResponseEnvelopeJSON `json:"-"` } -// magicRouteUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [MagicRouteUpdateResponseEnvelope] -type magicRouteUpdateResponseEnvelopeJSON struct { +// magicRouteNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [MagicRouteNewResponseEnvelope] +type magicRouteNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -468,53 +344,53 @@ type magicRouteUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicRouteUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MagicRouteNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicRouteNewResponseEnvelopeErrorsJSON `json:"-"` } -// magicRouteUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [MagicRouteUpdateResponseEnvelopeErrors] -type magicRouteUpdateResponseEnvelopeErrorsJSON struct { +// magicRouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MagicRouteNewResponseEnvelopeErrors] +type magicRouteNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MagicRouteNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicRouteNewResponseEnvelopeMessagesJSON `json:"-"` } -// magicRouteUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [MagicRouteUpdateResponseEnvelopeMessages] -type magicRouteUpdateResponseEnvelopeMessagesJSON struct { +// magicRouteNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MagicRouteNewResponseEnvelopeMessages] +type magicRouteNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicRouteUpdateResponseEnvelopeSuccess bool +type MagicRouteNewResponseEnvelopeSuccess bool const ( - MagicRouteUpdateResponseEnvelopeSuccessTrue MagicRouteUpdateResponseEnvelopeSuccess = true + MagicRouteNewResponseEnvelopeSuccessTrue MagicRouteNewResponseEnvelopeSuccess = true ) type MagicRouteDeleteResponseEnvelope struct { @@ -655,85 +531,6 @@ const ( MagicRouteGetResponseEnvelopeSuccessTrue MagicRouteGetResponseEnvelopeSuccess = true ) -type MagicRouteMagicStaticRoutesNewRoutesParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r MagicRouteMagicStaticRoutesNewRoutesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type MagicRouteMagicStaticRoutesNewRoutesResponseEnvelope struct { - Errors []MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessages `json:"messages,required"` - Result MagicRouteMagicStaticRoutesNewRoutesResponse `json:"result,required"` - // Whether the API call was successful - Success MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeSuccess `json:"success,required"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeJSON `json:"-"` -} - -// magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeJSON contains the JSON -// metadata for the struct [MagicRouteMagicStaticRoutesNewRoutesResponseEnvelope] -type magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteMagicStaticRoutesNewRoutesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrorsJSON `json:"-"` -} - -// magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrors] -type magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessagesJSON `json:"-"` -} - -// magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessages] -type magicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeSuccess bool - -const ( - MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeSuccessTrue MagicRouteMagicStaticRoutesNewRoutesResponseEnvelopeSuccess = true -) - type MagicRouteMagicStaticRoutesListRoutesResponseEnvelope struct { Errors []MagicRouteMagicStaticRoutesListRoutesResponseEnvelopeErrors `json:"errors,required"` Messages []MagicRouteMagicStaticRoutesListRoutesResponseEnvelopeMessages `json:"messages,required"` @@ -805,15 +602,7 @@ const ( MagicRouteMagicStaticRoutesListRoutesResponseEnvelopeSuccessTrue MagicRouteMagicStaticRoutesListRoutesResponseEnvelopeSuccess = true ) -type MagicRouteMagicStaticRoutesUpdateManyRoutesParams struct { - Routes param.Field[[]MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoute] `json:"routes,required"` -} - -func (r MagicRouteMagicStaticRoutesUpdateManyRoutesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoute struct { +type MagicRouteReplaceParams struct { // The next-hop IP Address for the static route. Nexthop param.Field[string] `json:"nexthop,required"` // IP Prefix in Classless Inter-Domain Routing format. @@ -823,40 +612,39 @@ type MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoute struct { // An optional human provided description of the static route. Description param.Field[string] `json:"description"` // Used only for ECMP routes. - Scope param.Field[MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope] `json:"scope"` + Scope param.Field[MagicRouteReplaceParamsScope] `json:"scope"` // Optional weight of the ECMP scope - if provided. Weight param.Field[int64] `json:"weight"` } -func (r MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoute) MarshalJSON() (data []byte, err error) { +func (r MagicRouteReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Used only for ECMP routes. -type MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope struct { +type MagicRouteReplaceParamsScope struct { // List of colo names for the ECMP scope. ColoNames param.Field[[]string] `json:"colo_names"` // List of colo regions for the ECMP scope. ColoRegions param.Field[[]string] `json:"colo_regions"` } -func (r MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope) MarshalJSON() (data []byte, err error) { +func (r MagicRouteReplaceParamsScope) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelope struct { - Errors []MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrors `json:"errors,required"` - Messages []MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessages `json:"messages,required"` - Result MagicRouteMagicStaticRoutesUpdateManyRoutesResponse `json:"result,required"` +type MagicRouteReplaceResponseEnvelope struct { + Errors []MagicRouteReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MagicRouteReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MagicRouteReplaceResponse `json:"result,required"` // Whether the API call was successful - Success MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeSuccess `json:"success,required"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeJSON `json:"-"` + Success MagicRouteReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON magicRouteReplaceResponseEnvelopeJSON `json:"-"` } -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelope] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeJSON struct { +// magicRouteReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [MagicRouteReplaceResponseEnvelope] +type magicRouteReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -865,53 +653,51 @@ type magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrorsJSON `json:"-"` +type MagicRouteReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicRouteReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrors] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrorsJSON struct { +// magicRouteReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MagicRouteReplaceResponseEnvelopeErrors] +type magicRouteReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessagesJSON `json:"-"` +type MagicRouteReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON magicRouteReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessages] -type magicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessagesJSON struct { +// magicRouteReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MagicRouteReplaceResponseEnvelopeMessages] +type magicRouteReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MagicRouteReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeSuccess bool +type MagicRouteReplaceResponseEnvelopeSuccess bool const ( - MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeSuccessTrue MagicRouteMagicStaticRoutesUpdateManyRoutesResponseEnvelopeSuccess = true + MagicRouteReplaceResponseEnvelopeSuccessTrue MagicRouteReplaceResponseEnvelopeSuccess = true ) diff --git a/magicroute_test.go b/magicroute_test.go index adc2faa60d6..364d069852f 100644 --- a/magicroute_test.go +++ b/magicroute_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMagicRouteUpdateWithOptionalParams(t *testing.T) { +func TestMagicRouteNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,20 +29,11 @@ func TestMagicRouteUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.Routes.Update( + _, err := client.Magics.Routes.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicRouteUpdateParams{ - Nexthop: cloudflare.F("203.0.113.1"), - Prefix: cloudflare.F("192.0.2.0/24"), - Priority: cloudflare.F(int64(0)), - Description: cloudflare.F("New route for new prefix 203.0.113.1"), - Scope: cloudflare.F(cloudflare.MagicRouteUpdateParamsScope{ - ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}), - ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}), - }), - Weight: cloudflare.F(int64(0)), + cloudflare.MagicRouteNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -114,38 +105,6 @@ func TestMagicRouteGet(t *testing.T) { } } -func TestMagicRouteMagicStaticRoutesNewRoutes(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Magics.Routes.MagicStaticRoutesNewRoutes( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicRouteMagicStaticRoutesNewRoutesParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - func TestMagicRouteMagicStaticRoutesListRoutes(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -172,7 +131,7 @@ func TestMagicRouteMagicStaticRoutesListRoutes(t *testing.T) { } } -func TestMagicRouteMagicStaticRoutesUpdateManyRoutes(t *testing.T) { +func TestMagicRouteReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -188,41 +147,20 @@ func TestMagicRouteMagicStaticRoutesUpdateManyRoutes(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Magics.Routes.MagicStaticRoutesUpdateManyRoutes( + _, err := client.Magics.Routes.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParams{ - Routes: cloudflare.F([]cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoute{{ - Description: cloudflare.F("New route for new prefix 203.0.113.1"), - Nexthop: cloudflare.F("203.0.113.1"), - Prefix: cloudflare.F("192.0.2.0/24"), - Priority: cloudflare.F(int64(0)), - Scope: cloudflare.F(cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope{ - ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}), - ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}), - }), - Weight: cloudflare.F(int64(0)), - }, { - Description: cloudflare.F("New route for new prefix 203.0.113.1"), - Nexthop: cloudflare.F("203.0.113.1"), - Prefix: cloudflare.F("192.0.2.0/24"), - Priority: cloudflare.F(int64(0)), - Scope: cloudflare.F(cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope{ - ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}), - ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}), - }), - Weight: cloudflare.F(int64(0)), - }, { - Description: cloudflare.F("New route for new prefix 203.0.113.1"), - Nexthop: cloudflare.F("203.0.113.1"), - Prefix: cloudflare.F("192.0.2.0/24"), - Priority: cloudflare.F(int64(0)), - Scope: cloudflare.F(cloudflare.MagicRouteMagicStaticRoutesUpdateManyRoutesParamsRoutesScope{ - ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}), - ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}), - }), - Weight: cloudflare.F(int64(0)), - }}), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.MagicRouteReplaceParams{ + Nexthop: cloudflare.F("203.0.113.1"), + Prefix: cloudflare.F("192.0.2.0/24"), + Priority: cloudflare.F(int64(0)), + Description: cloudflare.F("New route for new prefix 203.0.113.1"), + Scope: cloudflare.F(cloudflare.MagicRouteReplaceParamsScope{ + ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}), + ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}), + }), + Weight: cloudflare.F(int64(0)), }, ) if err != nil { diff --git a/managedheader.go b/managedheader.go index b4ed8072b04..2f6074b9d1d 100644 --- a/managedheader.go +++ b/managedheader.go @@ -31,180 +31,177 @@ func NewManagedHeaderService(opts ...option.RequestOption) (r *ManagedHeaderServ return } -// Fetches a list of all Managed Transforms. -func (r *ManagedHeaderService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ManagedHeaderListResponse, err error) { +// Updates the status of one or more Managed Transforms. +func (r *ManagedHeaderService) Update(ctx context.Context, zoneID string, body ManagedHeaderUpdateParams, opts ...option.RequestOption) (res *ManagedHeaderUpdateResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/managed_headers", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &res, opts...) return } -// Updates the status of one or more Managed Transforms. -func (r *ManagedHeaderService) ManagedTransformsUpdateStatusOfManagedTransforms(ctx context.Context, zoneID string, body ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParams, opts ...option.RequestOption) (res *ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse, err error) { +// Fetches a list of all Managed Transforms. +func (r *ManagedHeaderService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ManagedHeaderListResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/managed_headers", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &res, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) return } -type ManagedHeaderListResponse struct { - ManagedRequestHeaders []ManagedHeaderListResponseManagedRequestHeader `json:"managed_request_headers"` - ManagedResponseHeaders []ManagedHeaderListResponseManagedResponseHeader `json:"managed_response_headers"` - JSON managedHeaderListResponseJSON `json:"-"` +type ManagedHeaderUpdateResponse struct { + ManagedRequestHeaders []ManagedHeaderUpdateResponseManagedRequestHeader `json:"managed_request_headers"` + ManagedResponseHeaders []ManagedHeaderUpdateResponseManagedResponseHeader `json:"managed_response_headers"` + JSON managedHeaderUpdateResponseJSON `json:"-"` } -// managedHeaderListResponseJSON contains the JSON metadata for the struct -// [ManagedHeaderListResponse] -type managedHeaderListResponseJSON struct { +// managedHeaderUpdateResponseJSON contains the JSON metadata for the struct +// [ManagedHeaderUpdateResponse] +type managedHeaderUpdateResponseJSON struct { ManagedRequestHeaders apijson.Field ManagedResponseHeaders apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderListResponseManagedRequestHeader struct { +type ManagedHeaderUpdateResponseManagedRequestHeader struct { // Human-readable identifier of the Managed Transform. ID string `json:"id"` + // When true, the Managed Transform is available in the current Cloudflare plan. + Available bool `json:"available"` // When true, the Managed Transform is enabled. - Enabled bool `json:"enabled"` - JSON managedHeaderListResponseManagedRequestHeaderJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON managedHeaderUpdateResponseManagedRequestHeaderJSON `json:"-"` } -// managedHeaderListResponseManagedRequestHeaderJSON contains the JSON metadata for -// the struct [ManagedHeaderListResponseManagedRequestHeader] -type managedHeaderListResponseManagedRequestHeaderJSON struct { +// managedHeaderUpdateResponseManagedRequestHeaderJSON contains the JSON metadata +// for the struct [ManagedHeaderUpdateResponseManagedRequestHeader] +type managedHeaderUpdateResponseManagedRequestHeaderJSON struct { ID apijson.Field + Available apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderListResponseManagedRequestHeader) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderUpdateResponseManagedRequestHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderListResponseManagedResponseHeader struct { +type ManagedHeaderUpdateResponseManagedResponseHeader struct { // Human-readable identifier of the Managed Transform. ID string `json:"id"` + // When true, the Managed Transform is available in the current Cloudflare plan. + Available bool `json:"available"` // When true, the Managed Transform is enabled. - Enabled bool `json:"enabled"` - JSON managedHeaderListResponseManagedResponseHeaderJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON managedHeaderUpdateResponseManagedResponseHeaderJSON `json:"-"` } -// managedHeaderListResponseManagedResponseHeaderJSON contains the JSON metadata -// for the struct [ManagedHeaderListResponseManagedResponseHeader] -type managedHeaderListResponseManagedResponseHeaderJSON struct { +// managedHeaderUpdateResponseManagedResponseHeaderJSON contains the JSON metadata +// for the struct [ManagedHeaderUpdateResponseManagedResponseHeader] +type managedHeaderUpdateResponseManagedResponseHeaderJSON struct { ID apijson.Field + Available apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderListResponseManagedResponseHeader) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderUpdateResponseManagedResponseHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse struct { - ManagedRequestHeaders []ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeader `json:"managed_request_headers"` - ManagedResponseHeaders []ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeader `json:"managed_response_headers"` - JSON managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseJSON `json:"-"` +type ManagedHeaderListResponse struct { + ManagedRequestHeaders []ManagedHeaderListResponseManagedRequestHeader `json:"managed_request_headers"` + ManagedResponseHeaders []ManagedHeaderListResponseManagedResponseHeader `json:"managed_response_headers"` + JSON managedHeaderListResponseJSON `json:"-"` } -// managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseJSON -// contains the JSON metadata for the struct -// [ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse] -type managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseJSON struct { +// managedHeaderListResponseJSON contains the JSON metadata for the struct +// [ManagedHeaderListResponse] +type managedHeaderListResponseJSON struct { ManagedRequestHeaders apijson.Field ManagedResponseHeaders apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeader struct { +type ManagedHeaderListResponseManagedRequestHeader struct { // Human-readable identifier of the Managed Transform. ID string `json:"id"` - // When true, the Managed Transform is available in the current Cloudflare plan. - Available bool `json:"available"` // When true, the Managed Transform is enabled. - Enabled bool `json:"enabled"` - JSON managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeaderJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON managedHeaderListResponseManagedRequestHeaderJSON `json:"-"` } -// managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeaderJSON -// contains the JSON metadata for the struct -// [ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeader] -type managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeaderJSON struct { +// managedHeaderListResponseManagedRequestHeaderJSON contains the JSON metadata for +// the struct [ManagedHeaderListResponseManagedRequestHeader] +type managedHeaderListResponseManagedRequestHeaderJSON struct { ID apijson.Field - Available apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedRequestHeader) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderListResponseManagedRequestHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeader struct { +type ManagedHeaderListResponseManagedResponseHeader struct { // Human-readable identifier of the Managed Transform. ID string `json:"id"` - // When true, the Managed Transform is available in the current Cloudflare plan. - Available bool `json:"available"` // When true, the Managed Transform is enabled. - Enabled bool `json:"enabled"` - JSON managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeaderJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON managedHeaderListResponseManagedResponseHeaderJSON `json:"-"` } -// managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeaderJSON -// contains the JSON metadata for the struct -// [ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeader] -type managedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeaderJSON struct { +// managedHeaderListResponseManagedResponseHeaderJSON contains the JSON metadata +// for the struct [ManagedHeaderListResponseManagedResponseHeader] +type managedHeaderListResponseManagedResponseHeaderJSON struct { ID apijson.Field - Available apijson.Field Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsResponseManagedResponseHeader) UnmarshalJSON(data []byte) (err error) { +func (r *ManagedHeaderListResponseManagedResponseHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParams struct { - ManagedRequestHeaders param.Field[[]ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedRequestHeader] `json:"managed_request_headers,required"` - ManagedResponseHeaders param.Field[[]ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedResponseHeader] `json:"managed_response_headers,required"` +type ManagedHeaderUpdateParams struct { + ManagedRequestHeaders param.Field[[]ManagedHeaderUpdateParamsManagedRequestHeader] `json:"managed_request_headers,required"` + ManagedResponseHeaders param.Field[[]ManagedHeaderUpdateParamsManagedResponseHeader] `json:"managed_response_headers,required"` } -func (r ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParams) MarshalJSON() (data []byte, err error) { +func (r ManagedHeaderUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedRequestHeader struct { +type ManagedHeaderUpdateParamsManagedRequestHeader struct { // Human-readable identifier of the Managed Transform. ID param.Field[string] `json:"id"` // When true, the Managed Transform is enabled. Enabled param.Field[bool] `json:"enabled"` } -func (r ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedRequestHeader) MarshalJSON() (data []byte, err error) { +func (r ManagedHeaderUpdateParamsManagedRequestHeader) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedResponseHeader struct { +type ManagedHeaderUpdateParamsManagedResponseHeader struct { // Human-readable identifier of the Managed Transform. ID param.Field[string] `json:"id"` // When true, the Managed Transform is enabled. Enabled param.Field[bool] `json:"enabled"` } -func (r ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedResponseHeader) MarshalJSON() (data []byte, err error) { +func (r ManagedHeaderUpdateParamsManagedResponseHeader) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } diff --git a/managedheader_test.go b/managedheader_test.go index 196e24ffd07..a72bc5fa2a1 100644 --- a/managedheader_test.go +++ b/managedheader_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestManagedHeaderList(t *testing.T) { +func TestManagedHeaderUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,32 @@ func TestManagedHeaderList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ManagedHeaders.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.ManagedHeaders.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.ManagedHeaderUpdateParams{ + ManagedRequestHeaders: cloudflare.F([]cloudflare.ManagedHeaderUpdateParamsManagedRequestHeader{{ + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }, { + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }, { + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }}), + ManagedResponseHeaders: cloudflare.F([]cloudflare.ManagedHeaderUpdateParamsManagedResponseHeader{{ + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }, { + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }, { + Enabled: cloudflare.F(true), + ID: cloudflare.F("add_cf-bot-score_header"), + }}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +64,7 @@ func TestManagedHeaderList(t *testing.T) { } } -func TestManagedHeaderManagedTransformsUpdateStatusOfManagedTransforms(t *testing.T) { +func TestManagedHeaderList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,32 +80,7 @@ func TestManagedHeaderManagedTransformsUpdateStatusOfManagedTransforms(t *testin option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.ManagedHeaders.ManagedTransformsUpdateStatusOfManagedTransforms( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParams{ - ManagedRequestHeaders: cloudflare.F([]cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedRequestHeader{{ - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }, { - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }, { - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }}), - ManagedResponseHeaders: cloudflare.F([]cloudflare.ManagedHeaderManagedTransformsUpdateStatusOfManagedTransformsParamsManagedResponseHeader{{ - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }, { - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }, { - Enabled: cloudflare.F(true), - ID: cloudflare.F("add_cf-bot-score_header"), - }}), - }, - ) + _, err := client.ManagedHeaders.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/membership.go b/membership.go index 080eb6f75b2..3e60e15c4df 100644 --- a/membership.go +++ b/membership.go @@ -36,19 +36,6 @@ func NewMembershipService(opts ...option.RequestOption) (r *MembershipService) { return } -// Accept or reject this account invitation. -func (r *MembershipService) Update(ctx context.Context, membershipID string, body MembershipUpdateParams, opts ...option.RequestOption) (res *MembershipUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env MembershipUpdateResponseEnvelope - path := fmt.Sprintf("memberships/%s", membershipID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List memberships of accounts the user can access. func (r *MembershipService) List(ctx context.Context, query MembershipListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[MembershipListResponse], err error) { var raw *http.Response @@ -98,20 +85,17 @@ func (r *MembershipService) Get(ctx context.Context, membershipID string, opts . return } -// Union satisfied by [MembershipUpdateResponseUnknown] or [shared.UnionString]. -type MembershipUpdateResponse interface { - ImplementsMembershipUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*MembershipUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Accept or reject this account invitation. +func (r *MembershipService) Replace(ctx context.Context, membershipID string, body MembershipReplaceParams, opts ...option.RequestOption) (res *MembershipReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env MembershipReplaceResponseEnvelope + path := fmt.Sprintf("memberships/%s", membershipID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } type MembershipListResponse struct { @@ -544,92 +528,22 @@ func init() { ) } -type MembershipUpdateParams struct { - // Whether to accept or reject this account invitation. - Status param.Field[MembershipUpdateParamsStatus] `json:"status,required"` -} - -func (r MembershipUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Whether to accept or reject this account invitation. -type MembershipUpdateParamsStatus string - -const ( - MembershipUpdateParamsStatusAccepted MembershipUpdateParamsStatus = "accepted" - MembershipUpdateParamsStatusRejected MembershipUpdateParamsStatus = "rejected" -) - -type MembershipUpdateResponseEnvelope struct { - Errors []MembershipUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MembershipUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MembershipUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success MembershipUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON membershipUpdateResponseEnvelopeJSON `json:"-"` -} - -// membershipUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [MembershipUpdateResponseEnvelope] -type membershipUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MembershipUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MembershipUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON membershipUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// membershipUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [MembershipUpdateResponseEnvelopeErrors] -type membershipUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MembershipUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MembershipUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON membershipUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// membershipUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [MembershipUpdateResponseEnvelopeMessages] -type membershipUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Union satisfied by [MembershipReplaceResponseUnknown] or [shared.UnionString]. +type MembershipReplaceResponse interface { + ImplementsMembershipReplaceResponse() } -func (r *MembershipUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*MembershipReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// Whether the API call was successful -type MembershipUpdateResponseEnvelopeSuccess bool - -const ( - MembershipUpdateResponseEnvelopeSuccessTrue MembershipUpdateResponseEnvelopeSuccess = true -) - type MembershipListParams struct { Account param.Field[MembershipListParamsAccount] `query:"account"` // Direction to order memberships. @@ -831,3 +745,89 @@ type MembershipGetResponseEnvelopeSuccess bool const ( MembershipGetResponseEnvelopeSuccessTrue MembershipGetResponseEnvelopeSuccess = true ) + +type MembershipReplaceParams struct { + // Whether to accept or reject this account invitation. + Status param.Field[MembershipReplaceParamsStatus] `json:"status,required"` +} + +func (r MembershipReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Whether to accept or reject this account invitation. +type MembershipReplaceParamsStatus string + +const ( + MembershipReplaceParamsStatusAccepted MembershipReplaceParamsStatus = "accepted" + MembershipReplaceParamsStatusRejected MembershipReplaceParamsStatus = "rejected" +) + +type MembershipReplaceResponseEnvelope struct { + Errors []MembershipReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MembershipReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MembershipReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success MembershipReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON membershipReplaceResponseEnvelopeJSON `json:"-"` +} + +// membershipReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [MembershipReplaceResponseEnvelope] +type membershipReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MembershipReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MembershipReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON membershipReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// membershipReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MembershipReplaceResponseEnvelopeErrors] +type membershipReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MembershipReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MembershipReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON membershipReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// membershipReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MembershipReplaceResponseEnvelopeMessages] +type membershipReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MembershipReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type MembershipReplaceResponseEnvelopeSuccess bool + +const ( + MembershipReplaceResponseEnvelopeSuccessTrue MembershipReplaceResponseEnvelopeSuccess = true +) diff --git a/membership_test.go b/membership_test.go index 8d76e6ac55b..26512e917c3 100644 --- a/membership_test.go +++ b/membership_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMembershipUpdate(t *testing.T) { +func TestMembershipListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,17 @@ func TestMembershipUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Memberships.Update( - context.TODO(), - "4536bcfad5faccb111b47003c79917fa", - cloudflare.MembershipUpdateParams{ - Status: cloudflare.F(cloudflare.MembershipUpdateParamsStatusAccepted), - }, - ) + _, err := client.Memberships.List(context.TODO(), cloudflare.MembershipListParams{ + Account: cloudflare.F(cloudflare.MembershipListParamsAccount{ + Name: cloudflare.F("Demo Account"), + }), + Direction: cloudflare.F(cloudflare.MembershipListParamsDirectionDesc), + Name: cloudflare.F("Demo Account"), + Order: cloudflare.F(cloudflare.MembershipListParamsOrderStatus), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Status: cloudflare.F(cloudflare.MembershipListParamsStatusAccepted), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -45,7 +49,7 @@ func TestMembershipUpdate(t *testing.T) { } } -func TestMembershipListWithOptionalParams(t *testing.T) { +func TestMembershipDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,17 +65,7 @@ func TestMembershipListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Memberships.List(context.TODO(), cloudflare.MembershipListParams{ - Account: cloudflare.F(cloudflare.MembershipListParamsAccount{ - Name: cloudflare.F("Demo Account"), - }), - Direction: cloudflare.F(cloudflare.MembershipListParamsDirectionDesc), - Name: cloudflare.F("Demo Account"), - Order: cloudflare.F(cloudflare.MembershipListParamsOrderStatus), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - Status: cloudflare.F(cloudflare.MembershipListParamsStatusAccepted), - }) + _, err := client.Memberships.Delete(context.TODO(), "4536bcfad5faccb111b47003c79917fa") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -81,7 +75,7 @@ func TestMembershipListWithOptionalParams(t *testing.T) { } } -func TestMembershipDelete(t *testing.T) { +func TestMembershipGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -97,7 +91,7 @@ func TestMembershipDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Memberships.Delete(context.TODO(), "4536bcfad5faccb111b47003c79917fa") + _, err := client.Memberships.Get(context.TODO(), "4536bcfad5faccb111b47003c79917fa") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -107,7 +101,7 @@ func TestMembershipDelete(t *testing.T) { } } -func TestMembershipGet(t *testing.T) { +func TestMembershipReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -123,7 +117,13 @@ func TestMembershipGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Memberships.Get(context.TODO(), "4536bcfad5faccb111b47003c79917fa") + _, err := client.Memberships.Replace( + context.TODO(), + "4536bcfad5faccb111b47003c79917fa", + cloudflare.MembershipReplaceParams{ + Status: cloudflare.F(cloudflare.MembershipReplaceParamsStatusAccepted), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/mnmconfig.go b/mnmconfig.go index 4a9dfd952c4..c85a6d8e5a9 100644 --- a/mnmconfig.go +++ b/mnmconfig.go @@ -31,12 +31,12 @@ func NewMnmConfigService(opts ...option.RequestOption) (r *MnmConfigService) { return } -// Delete an existing network monitoring configuration. -func (r *MnmConfigService) Delete(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigDeleteResponse, err error) { +// Create a new network monitoring configuration. +func (r *MnmConfigService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigDeleteResponseEnvelope + var env MnmConfigNewResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *MnmConfigService) Delete(ctx context.Context, accountIdentifier interfa return } -// Create a new network monitoring configuration. -func (r *MnmConfigService) MagicNetworkMonitoringConfigurationNewAccountConfiguration(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse, err error) { +// Update fields in an existing network monitoring configuration. +func (r *MnmConfigService) Update(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelope + var env MnmConfigUpdateResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return } @@ -58,9 +58,9 @@ func (r *MnmConfigService) MagicNetworkMonitoringConfigurationNewAccountConfigur } // Lists default sampling and router IPs for account. -func (r *MnmConfigService) MagicNetworkMonitoringConfigurationListAccountConfiguration(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse, err error) { +func (r *MnmConfigService) List(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigListResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelope + var env MnmConfigListResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -70,12 +70,12 @@ func (r *MnmConfigService) MagicNetworkMonitoringConfigurationListAccountConfigu return } -// Update fields in an existing network monitoring configuration. -func (r *MnmConfigService) MagicNetworkMonitoringConfigurationUpdateAccountConfigurationFields(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse, err error) { +// Delete an existing network monitoring configuration. +func (r *MnmConfigService) Delete(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelope + var env MnmConfigDeleteResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -85,9 +85,9 @@ func (r *MnmConfigService) MagicNetworkMonitoringConfigurationUpdateAccountConfi // Update an existing network monitoring configuration, requires the entire // configuration to be updated at once. -func (r *MnmConfigService) MagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfiguration(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse, err error) { +func (r *MnmConfigService) Replace(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelope + var env MnmConfigReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { @@ -97,19 +97,19 @@ func (r *MnmConfigService) MagicNetworkMonitoringConfigurationUpdateAnEntireAcco return } -type MnmConfigDeleteResponse struct { +type MnmConfigNewResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigDeleteResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigNewResponseJSON `json:"-"` } -// mnmConfigDeleteResponseJSON contains the JSON metadata for the struct -// [MnmConfigDeleteResponse] -type mnmConfigDeleteResponseJSON struct { +// mnmConfigNewResponseJSON contains the JSON metadata for the struct +// [MnmConfigNewResponse] +type mnmConfigNewResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -117,24 +117,23 @@ type mnmConfigDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmConfigDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse struct { +type MnmConfigUpdateResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigUpdateResponseJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse] -type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseJSON struct { +// mnmConfigUpdateResponseJSON contains the JSON metadata for the struct +// [MnmConfigUpdateResponse] +type mnmConfigUpdateResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -142,24 +141,23 @@ type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse struct { +type MnmConfigListResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigListResponseJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse] -type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseJSON struct { +// mnmConfigListResponseJSON contains the JSON metadata for the struct +// [MnmConfigListResponse] +type mnmConfigListResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -167,24 +165,23 @@ type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationRespons ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse struct { +type MnmConfigDeleteResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigDeleteResponseJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseJSON struct { +// mnmConfigDeleteResponseJSON contains the JSON metadata for the struct +// [MnmConfigDeleteResponse] +type mnmConfigDeleteResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -192,24 +189,23 @@ type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationField ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse struct { +type MnmConfigReplaceResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigReplaceResponseJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseJSON struct { +// mnmConfigReplaceResponseJSON contains the JSON metadata for the struct +// [MnmConfigReplaceResponse] +type mnmConfigReplaceResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -217,22 +213,22 @@ type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurat ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigDeleteResponseEnvelope struct { - Errors []MnmConfigDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigDeleteResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigDeleteResponse `json:"result,required"` +type MnmConfigNewResponseEnvelope struct { + Errors []MnmConfigNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigNewResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigNewResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigDeleteResponseEnvelopeJSON `json:"-"` + Success MnmConfigNewResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigNewResponseEnvelopeJSON `json:"-"` } -// mnmConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [MnmConfigDeleteResponseEnvelope] -type mnmConfigDeleteResponseEnvelopeJSON struct { +// mnmConfigNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigNewResponseEnvelope] +type mnmConfigNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -241,68 +237,67 @@ type mnmConfigDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigDeleteResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigNewResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [MnmConfigDeleteResponseEnvelopeErrors] -type mnmConfigDeleteResponseEnvelopeErrorsJSON struct { +// mnmConfigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [MnmConfigNewResponseEnvelopeErrors] +type mnmConfigNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigDeleteResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigNewResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [MnmConfigDeleteResponseEnvelopeMessages] -type mnmConfigDeleteResponseEnvelopeMessagesJSON struct { +// mnmConfigNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigNewResponseEnvelopeMessages] +type mnmConfigNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigDeleteResponseEnvelopeSuccess bool +type MnmConfigNewResponseEnvelopeSuccess bool const ( - MnmConfigDeleteResponseEnvelopeSuccessTrue MnmConfigDeleteResponseEnvelopeSuccess = true + MnmConfigNewResponseEnvelopeSuccessTrue MnmConfigNewResponseEnvelopeSuccess = true ) -type MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelope struct { - Errors []MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse `json:"result,required"` +type MnmConfigUpdateResponseEnvelope struct { + Errors []MnmConfigUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigUpdateResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigUpdateResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success MnmConfigUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigUpdateResponseEnvelopeJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelope] -type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeJSON struct { +// mnmConfigUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigUpdateResponseEnvelope] +type mnmConfigUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -311,70 +306,67 @@ type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponse ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrors] -type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrorsJSON struct { +// mnmConfigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmConfigUpdateResponseEnvelopeErrors] +type mnmConfigUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessages] -type mnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessagesJSON struct { +// mnmConfigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigUpdateResponseEnvelopeMessages] +type mnmConfigUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeSuccess bool +type MnmConfigUpdateResponseEnvelopeSuccess bool const ( - MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeSuccessTrue MnmConfigMagicNetworkMonitoringConfigurationNewAccountConfigurationResponseEnvelopeSuccess = true + MnmConfigUpdateResponseEnvelopeSuccessTrue MnmConfigUpdateResponseEnvelopeSuccess = true ) -type MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelope struct { - Errors []MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponse `json:"result,required"` +type MnmConfigListResponseEnvelope struct { + Errors []MnmConfigListResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigListResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigListResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success MnmConfigListResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigListResponseEnvelopeJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelope] -type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeJSON struct { +// mnmConfigListResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigListResponseEnvelope] +type mnmConfigListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -383,70 +375,67 @@ type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationRespons ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigListResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrors] -type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrorsJSON struct { +// mnmConfigListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmConfigListResponseEnvelopeErrors] +type mnmConfigListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigListResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessages] -type mnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessagesJSON struct { +// mnmConfigListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigListResponseEnvelopeMessages] +type mnmConfigListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeSuccess bool +type MnmConfigListResponseEnvelopeSuccess bool const ( - MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeSuccessTrue MnmConfigMagicNetworkMonitoringConfigurationListAccountConfigurationResponseEnvelopeSuccess = true + MnmConfigListResponseEnvelopeSuccessTrue MnmConfigListResponseEnvelopeSuccess = true ) -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelope struct { - Errors []MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponse `json:"result,required"` +type MnmConfigDeleteResponseEnvelope struct { + Errors []MnmConfigDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigDeleteResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigDeleteResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeJSON `json:"-"` + Success MnmConfigDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigDeleteResponseEnvelopeJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelope] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeJSON struct { +// mnmConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigDeleteResponseEnvelope] +type mnmConfigDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -455,70 +444,67 @@ type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationField ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrors] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrorsJSON struct { +// mnmConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmConfigDeleteResponseEnvelopeErrors] +type mnmConfigDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessages] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessagesJSON struct { +// mnmConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigDeleteResponseEnvelopeMessages] +type mnmConfigDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeSuccess bool +type MnmConfigDeleteResponseEnvelopeSuccess bool const ( - MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeSuccessTrue MnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFieldsResponseEnvelopeSuccess = true + MnmConfigDeleteResponseEnvelopeSuccessTrue MnmConfigDeleteResponseEnvelopeSuccess = true ) -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelope struct { - Errors []MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponse `json:"result,required"` +type MnmConfigReplaceResponseEnvelope struct { + Errors []MnmConfigReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigReplaceResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success MnmConfigReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigReplaceResponseEnvelopeJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelope] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeJSON struct { +// mnmConfigReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigReplaceResponseEnvelope] +type mnmConfigReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -527,53 +513,51 @@ type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurat ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrors] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrorsJSON struct { +// mnmConfigReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmConfigReplaceResponseEnvelopeErrors] +type mnmConfigReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessages] -type mnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessagesJSON struct { +// mnmConfigReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigReplaceResponseEnvelopeMessages] +type mnmConfigReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeSuccess bool +type MnmConfigReplaceResponseEnvelopeSuccess bool const ( - MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeSuccessTrue MnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfigurationResponseEnvelopeSuccess = true + MnmConfigReplaceResponseEnvelopeSuccessTrue MnmConfigReplaceResponseEnvelopeSuccess = true ) diff --git a/mnmconfig_test.go b/mnmconfig_test.go index 224105710bb..98dbd5c7ae5 100644 --- a/mnmconfig_test.go +++ b/mnmconfig_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMnmConfigDelete(t *testing.T) { +func TestMnmConfigNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestMnmConfigDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.Delete(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestMnmConfigDelete(t *testing.T) { } } -func TestMnmConfigMagicNetworkMonitoringConfigurationNewAccountConfiguration(t *testing.T) { +func TestMnmConfigUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +55,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationNewAccountConfiguration(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.MagicNetworkMonitoringConfigurationNewAccountConfiguration(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.Update(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +65,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationNewAccountConfiguration(t * } } -func TestMnmConfigMagicNetworkMonitoringConfigurationListAccountConfiguration(t *testing.T) { +func TestMnmConfigList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,7 +81,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationListAccountConfiguration(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.MagicNetworkMonitoringConfigurationListAccountConfiguration(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.List(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -91,7 +91,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationListAccountConfiguration(t } } -func TestMnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationFields(t *testing.T) { +func TestMnmConfigDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -107,7 +107,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationF option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.MagicNetworkMonitoringConfigurationUpdateAccountConfigurationFields(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.Delete(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -117,7 +117,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationUpdateAccountConfigurationF } } -func TestMnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfiguration(t *testing.T) { +func TestMnmConfigReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -133,7 +133,7 @@ func TestMnmConfigMagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfig option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.MagicNetworkMonitoringConfigurationUpdateAnEntireAccountConfiguration(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.Replace(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/mnmconfigfull.go b/mnmconfigfull.go index a9964fe8840..23710a67688 100644 --- a/mnmconfigfull.go +++ b/mnmconfigfull.go @@ -31,9 +31,9 @@ func NewMnmConfigFullService(opts ...option.RequestOption) (r *MnmConfigFullServ } // Lists default sampling, router IPs, and rules for account. -func (r *MnmConfigFullService) MagicNetworkMonitoringConfigurationListRulesAndAccountConfiguration(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse, err error) { +func (r *MnmConfigFullService) List(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmConfigFullListResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelope + var env MnmConfigFullListResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/config/full", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,20 +43,19 @@ func (r *MnmConfigFullService) MagicNetworkMonitoringConfigurationListRulesAndAc return } -type MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse struct { +type MnmConfigFullListResponse struct { // Fallback sampling rate of flow messages being sent in packets per second. This // should match the packet sampling rate configured on the router. DefaultSampling float64 `json:"default_sampling,required"` // The account name. - Name string `json:"name,required"` - RouterIPs []string `json:"router_ips,required"` - JSON mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseJSON `json:"-"` + Name string `json:"name,required"` + RouterIPs []string `json:"router_ips,required"` + JSON mnmConfigFullListResponseJSON `json:"-"` } -// mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseJSON -// contains the JSON metadata for the struct -// [MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse] -type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseJSON struct { +// mnmConfigFullListResponseJSON contains the JSON metadata for the struct +// [MnmConfigFullListResponse] +type mnmConfigFullListResponseJSON struct { DefaultSampling apijson.Field Name apijson.Field RouterIPs apijson.Field @@ -64,23 +63,22 @@ type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigur ExtraFields map[string]apijson.Field } -func (r *MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigFullListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelope struct { - Errors []MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponse `json:"result,required"` +type MnmConfigFullListResponseEnvelope struct { + Errors []MnmConfigFullListResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmConfigFullListResponseEnvelopeMessages `json:"messages,required"` + Result MnmConfigFullListResponse `json:"result,required"` // Whether the API call was successful - Success MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeJSON `json:"-"` + Success MnmConfigFullListResponseEnvelopeSuccess `json:"success,required"` + JSON mnmConfigFullListResponseEnvelopeJSON `json:"-"` } -// mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelope] -type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeJSON struct { +// mnmConfigFullListResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmConfigFullListResponseEnvelope] +type mnmConfigFullListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -89,53 +87,51 @@ type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigur ExtraFields map[string]apijson.Field } -func (r *MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigFullListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type MnmConfigFullListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigFullListResponseEnvelopeErrorsJSON `json:"-"` } -// mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrors] -type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrorsJSON struct { +// mnmConfigFullListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmConfigFullListResponseEnvelopeErrors] +type mnmConfigFullListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigFullListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type MnmConfigFullListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmConfigFullListResponseEnvelopeMessagesJSON `json:"-"` } -// mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessages] -type mnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessagesJSON struct { +// mnmConfigFullListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmConfigFullListResponseEnvelopeMessages] +type mnmConfigFullListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmConfigFullListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeSuccess bool +type MnmConfigFullListResponseEnvelopeSuccess bool const ( - MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeSuccessTrue MnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfigurationResponseEnvelopeSuccess = true + MnmConfigFullListResponseEnvelopeSuccessTrue MnmConfigFullListResponseEnvelopeSuccess = true ) diff --git a/mnmconfigfull_test.go b/mnmconfigfull_test.go index a2b1030ef4d..d61666057ef 100644 --- a/mnmconfigfull_test.go +++ b/mnmconfigfull_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConfiguration(t *testing.T) { +func TestMnmConfigFullList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestMnmConfigFullMagicNetworkMonitoringConfigurationListRulesAndAccountConf option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Configs.Fulls.MagicNetworkMonitoringConfigurationListRulesAndAccountConfiguration(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Configs.Fulls.List(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/mnmrule.go b/mnmrule.go index f17bad37575..a2760e91be3 100644 --- a/mnmrule.go +++ b/mnmrule.go @@ -31,12 +31,13 @@ func NewMnmRuleService(opts ...option.RequestOption) (r *MnmRuleService) { return } -// Update a network monitoring rule for account. -func (r *MnmRuleService) Update(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleUpdateResponse, err error) { +// Create network monitoring rules for account. Currently only supports creating a +// single rule per API request. +func (r *MnmRuleService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + var env MnmRuleNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +45,12 @@ func (r *MnmRuleService) Update(ctx context.Context, accountIdentifier interface return } -// Delete a network monitoring rule for account. -func (r *MnmRuleService) Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleDeleteResponse, err error) { +// Update a network monitoring rule for account. +func (r *MnmRuleService) Update(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleDeleteResponseEnvelope + var env MnmRuleUpdateResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return } @@ -57,11 +58,11 @@ func (r *MnmRuleService) Delete(ctx context.Context, accountIdentifier interface return } -// List a single network monitoring rule for account. -func (r *MnmRuleService) Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleGetResponse, err error) { +// Lists network monitoring rules for account. +func (r *MnmRuleService) List(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *[]MnmRuleListResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleGetResponseEnvelope - path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier) + var env MnmRuleListResponseEnvelope + path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -70,13 +71,12 @@ func (r *MnmRuleService) Get(ctx context.Context, accountIdentifier interface{}, return } -// Create network monitoring rules for account. Currently only supports creating a -// single rule per API request. -func (r *MnmRuleService) MagicNetworkMonitoringRulesNewRules(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleMagicNetworkMonitoringRulesNewRulesResponse, err error) { +// Delete a network monitoring rule for account. +func (r *MnmRuleService) Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelope - path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + var env MnmRuleDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -84,11 +84,11 @@ func (r *MnmRuleService) MagicNetworkMonitoringRulesNewRules(ctx context.Context return } -// Lists network monitoring rules for account. -func (r *MnmRuleService) MagicNetworkMonitoringRulesListRules(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *[]MnmRuleMagicNetworkMonitoringRulesListRulesResponse, err error) { +// List a single network monitoring rule for account. +func (r *MnmRuleService) Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleGetResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelope - path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier) + var env MnmRuleGetResponseEnvelope + path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -98,9 +98,9 @@ func (r *MnmRuleService) MagicNetworkMonitoringRulesListRules(ctx context.Contex } // Update network monitoring rules for account. -func (r *MnmRuleService) MagicNetworkMonitoringRulesUpdateRules(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse, err error) { +func (r *MnmRuleService) Replace(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelope + var env MnmRuleReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { @@ -110,7 +110,7 @@ func (r *MnmRuleService) MagicNetworkMonitoringRulesUpdateRules(ctx context.Cont return } -type MnmRuleUpdateResponse struct { +type MnmRuleNewResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -132,13 +132,13 @@ type MnmRuleUpdateResponse struct { BandwidthThreshold float64 `json:"bandwidth_threshold"` // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. - PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleUpdateResponseJSON `json:"-"` + PacketThreshold float64 `json:"packet_threshold"` + JSON mnmRuleNewResponseJSON `json:"-"` } -// mnmRuleUpdateResponseJSON contains the JSON metadata for the struct -// [MnmRuleUpdateResponse] -type mnmRuleUpdateResponseJSON struct { +// mnmRuleNewResponseJSON contains the JSON metadata for the struct +// [MnmRuleNewResponse] +type mnmRuleNewResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -150,11 +150,11 @@ type mnmRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleDeleteResponse struct { +type MnmRuleUpdateResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -177,12 +177,12 @@ type MnmRuleDeleteResponse struct { // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleDeleteResponseJSON `json:"-"` + JSON mnmRuleUpdateResponseJSON `json:"-"` } -// mnmRuleDeleteResponseJSON contains the JSON metadata for the struct -// [MnmRuleDeleteResponse] -type mnmRuleDeleteResponseJSON struct { +// mnmRuleUpdateResponseJSON contains the JSON metadata for the struct +// [MnmRuleUpdateResponse] +type mnmRuleUpdateResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -194,11 +194,11 @@ type mnmRuleDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleGetResponse struct { +type MnmRuleListResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -220,13 +220,13 @@ type MnmRuleGetResponse struct { BandwidthThreshold float64 `json:"bandwidth_threshold"` // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. - PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleGetResponseJSON `json:"-"` + PacketThreshold float64 `json:"packet_threshold"` + JSON mnmRuleListResponseJSON `json:"-"` } -// mnmRuleGetResponseJSON contains the JSON metadata for the struct -// [MnmRuleGetResponse] -type mnmRuleGetResponseJSON struct { +// mnmRuleListResponseJSON contains the JSON metadata for the struct +// [MnmRuleListResponse] +type mnmRuleListResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -238,11 +238,11 @@ type mnmRuleGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesNewRulesResponse struct { +type MnmRuleDeleteResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -264,13 +264,13 @@ type MnmRuleMagicNetworkMonitoringRulesNewRulesResponse struct { BandwidthThreshold float64 `json:"bandwidth_threshold"` // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. - PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleMagicNetworkMonitoringRulesNewRulesResponseJSON `json:"-"` + PacketThreshold float64 `json:"packet_threshold"` + JSON mnmRuleDeleteResponseJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesNewRulesResponseJSON contains the JSON -// metadata for the struct [MnmRuleMagicNetworkMonitoringRulesNewRulesResponse] -type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseJSON struct { +// mnmRuleDeleteResponseJSON contains the JSON metadata for the struct +// [MnmRuleDeleteResponse] +type mnmRuleDeleteResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -282,11 +282,11 @@ type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesNewRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesListRulesResponse struct { +type MnmRuleGetResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -308,13 +308,13 @@ type MnmRuleMagicNetworkMonitoringRulesListRulesResponse struct { BandwidthThreshold float64 `json:"bandwidth_threshold"` // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. - PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleMagicNetworkMonitoringRulesListRulesResponseJSON `json:"-"` + PacketThreshold float64 `json:"packet_threshold"` + JSON mnmRuleGetResponseJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesListRulesResponseJSON contains the JSON -// metadata for the struct [MnmRuleMagicNetworkMonitoringRulesListRulesResponse] -type mnmRuleMagicNetworkMonitoringRulesListRulesResponseJSON struct { +// mnmRuleGetResponseJSON contains the JSON metadata for the struct +// [MnmRuleGetResponse] +type mnmRuleGetResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -326,11 +326,11 @@ type mnmRuleMagicNetworkMonitoringRulesListRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesListRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse struct { +type MnmRuleReplaceResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. @@ -352,13 +352,13 @@ type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse struct { BandwidthThreshold float64 `json:"bandwidth_threshold"` // The number of packets per second for the rule. When this value is exceeded for // the set duration, an alert notification is sent. Minimum of 1 and no maximum. - PacketThreshold float64 `json:"packet_threshold"` - JSON mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseJSON `json:"-"` + PacketThreshold float64 `json:"packet_threshold"` + JSON mnmRuleReplaceResponseJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseJSON contains the JSON -// metadata for the struct [MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse] -type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseJSON struct { +// mnmRuleReplaceResponseJSON contains the JSON metadata for the struct +// [MnmRuleReplaceResponse] +type mnmRuleReplaceResponseJSON struct { AutomaticAdvertisement apijson.Field Duration apijson.Field Name apijson.Field @@ -370,22 +370,22 @@ type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleUpdateResponseEnvelope struct { - Errors []MnmRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleUpdateResponse `json:"result,required,nullable"` +type MnmRuleNewResponseEnvelope struct { + Errors []MnmRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleUpdateResponseEnvelopeJSON `json:"-"` + Success MnmRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleNewResponseEnvelopeJSON `json:"-"` } -// mnmRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [MnmRuleUpdateResponseEnvelope] -type mnmRuleUpdateResponseEnvelopeJSON struct { +// mnmRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleNewResponseEnvelope] +type mnmRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -394,67 +394,67 @@ type mnmRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [MnmRuleUpdateResponseEnvelopeErrors] -type mnmRuleUpdateResponseEnvelopeErrorsJSON struct { +// mnmRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [MnmRuleNewResponseEnvelopeErrors] +type mnmRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [MnmRuleUpdateResponseEnvelopeMessages] -type mnmRuleUpdateResponseEnvelopeMessagesJSON struct { +// mnmRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [MnmRuleNewResponseEnvelopeMessages] +type mnmRuleNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleUpdateResponseEnvelopeSuccess bool +type MnmRuleNewResponseEnvelopeSuccess bool const ( - MnmRuleUpdateResponseEnvelopeSuccessTrue MnmRuleUpdateResponseEnvelopeSuccess = true + MnmRuleNewResponseEnvelopeSuccessTrue MnmRuleNewResponseEnvelopeSuccess = true ) -type MnmRuleDeleteResponseEnvelope struct { - Errors []MnmRuleDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleDeleteResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleDeleteResponse `json:"result,required,nullable"` +type MnmRuleUpdateResponseEnvelope struct { + Errors []MnmRuleUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleUpdateResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleDeleteResponseEnvelopeJSON `json:"-"` + Success MnmRuleUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleUpdateResponseEnvelopeJSON `json:"-"` } -// mnmRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [MnmRuleDeleteResponseEnvelope] -type mnmRuleDeleteResponseEnvelopeJSON struct { +// mnmRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleUpdateResponseEnvelope] +type mnmRuleUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -463,137 +463,165 @@ type mnmRuleDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleDeleteResponseEnvelopeErrors struct { +type MnmRuleUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON mnmRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` + JSON mnmRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [MnmRuleDeleteResponseEnvelopeErrors] -type mnmRuleDeleteResponseEnvelopeErrorsJSON struct { +// mnmRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmRuleUpdateResponseEnvelopeErrors] +type mnmRuleUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleDeleteResponseEnvelopeMessages struct { +type MnmRuleUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON mnmRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` + JSON mnmRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [MnmRuleDeleteResponseEnvelopeMessages] -type mnmRuleDeleteResponseEnvelopeMessagesJSON struct { +// mnmRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmRuleUpdateResponseEnvelopeMessages] +type mnmRuleUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleDeleteResponseEnvelopeSuccess bool +type MnmRuleUpdateResponseEnvelopeSuccess bool const ( - MnmRuleDeleteResponseEnvelopeSuccessTrue MnmRuleDeleteResponseEnvelopeSuccess = true + MnmRuleUpdateResponseEnvelopeSuccessTrue MnmRuleUpdateResponseEnvelopeSuccess = true ) -type MnmRuleGetResponseEnvelope struct { - Errors []MnmRuleGetResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleGetResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleGetResponse `json:"result,required,nullable"` +type MnmRuleListResponseEnvelope struct { + Errors []MnmRuleListResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleListResponseEnvelopeMessages `json:"messages,required"` + Result []MnmRuleListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleGetResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleGetResponseEnvelopeJSON `json:"-"` + Success MnmRuleListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo MnmRuleListResponseEnvelopeResultInfo `json:"result_info"` + JSON mnmRuleListResponseEnvelopeJSON `json:"-"` } -// mnmRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [MnmRuleGetResponseEnvelope] -type mnmRuleGetResponseEnvelopeJSON struct { +// mnmRuleListResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleListResponseEnvelope] +type mnmRuleListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleGetResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleListResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [MnmRuleGetResponseEnvelopeErrors] -type mnmRuleGetResponseEnvelopeErrorsJSON struct { +// mnmRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [MnmRuleListResponseEnvelopeErrors] +type mnmRuleListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleGetResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleListResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [MnmRuleGetResponseEnvelopeMessages] -type mnmRuleGetResponseEnvelopeMessagesJSON struct { +// mnmRuleListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmRuleListResponseEnvelopeMessages] +type mnmRuleListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleGetResponseEnvelopeSuccess bool +type MnmRuleListResponseEnvelopeSuccess bool const ( - MnmRuleGetResponseEnvelopeSuccessTrue MnmRuleGetResponseEnvelopeSuccess = true + MnmRuleListResponseEnvelopeSuccessTrue MnmRuleListResponseEnvelopeSuccess = true ) -type MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelope struct { - Errors []MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleMagicNetworkMonitoringRulesNewRulesResponse `json:"result,required,nullable"` +type MnmRuleListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON mnmRuleListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// mnmRuleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [MnmRuleListResponseEnvelopeResultInfo] +type mnmRuleListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *MnmRuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type MnmRuleDeleteResponseEnvelope struct { + Errors []MnmRuleDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleDeleteResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeJSON `json:"-"` + Success MnmRuleDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleDeleteResponseEnvelopeJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelope] -type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeJSON struct { +// mnmRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleDeleteResponseEnvelope] +type mnmRuleDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -602,172 +630,136 @@ type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrors] -type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrorsJSON struct { +// mnmRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmRuleDeleteResponseEnvelopeErrors] +type mnmRuleDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessages] -type mnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessagesJSON struct { +// mnmRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmRuleDeleteResponseEnvelopeMessages] +type mnmRuleDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeSuccess bool +type MnmRuleDeleteResponseEnvelopeSuccess bool const ( - MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeSuccessTrue MnmRuleMagicNetworkMonitoringRulesNewRulesResponseEnvelopeSuccess = true + MnmRuleDeleteResponseEnvelopeSuccessTrue MnmRuleDeleteResponseEnvelopeSuccess = true ) -type MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelope struct { - Errors []MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessages `json:"messages,required"` - Result []MnmRuleMagicNetworkMonitoringRulesListRulesResponse `json:"result,required,nullable"` +type MnmRuleGetResponseEnvelope struct { + Errors []MnmRuleGetResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleGetResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeJSON `json:"-"` + Success MnmRuleGetResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleGetResponseEnvelopeJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelope] -type mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeJSON struct { +// mnmRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleGetResponseEnvelope] +type mnmRuleGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleGetResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrors] -type mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrorsJSON struct { +// mnmRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [MnmRuleGetResponseEnvelopeErrors] +type mnmRuleGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleGetResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessages] -type mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessagesJSON struct { +// mnmRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [MnmRuleGetResponseEnvelopeMessages] +type mnmRuleGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeSuccess bool +type MnmRuleGetResponseEnvelopeSuccess bool const ( - MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeSuccessTrue MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeSuccess = true + MnmRuleGetResponseEnvelopeSuccessTrue MnmRuleGetResponseEnvelopeSuccess = true ) -type MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfo] -type mnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *MnmRuleMagicNetworkMonitoringRulesListRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelope struct { - Errors []MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponse `json:"result,required,nullable"` +type MnmRuleReplaceResponseEnvelope struct { + Errors []MnmRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeJSON `json:"-"` + Success MnmRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleReplaceResponseEnvelopeJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelope] -type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeJSON struct { +// mnmRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [MnmRuleReplaceResponseEnvelope] +type mnmRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -776,53 +768,51 @@ type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrors] -type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrorsJSON struct { +// mnmRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MnmRuleReplaceResponseEnvelopeErrors] +type mnmRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessages] -type mnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessagesJSON struct { +// mnmRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [MnmRuleReplaceResponseEnvelopeMessages] +type mnmRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeSuccess bool +type MnmRuleReplaceResponseEnvelopeSuccess bool const ( - MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeSuccessTrue MnmRuleMagicNetworkMonitoringRulesUpdateRulesResponseEnvelopeSuccess = true + MnmRuleReplaceResponseEnvelopeSuccessTrue MnmRuleReplaceResponseEnvelopeSuccess = true ) diff --git a/mnmrule_test.go b/mnmrule_test.go index 6c2c131c214..aa813049698 100644 --- a/mnmrule_test.go +++ b/mnmrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMnmRuleUpdate(t *testing.T) { +func TestMnmRuleNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,7 @@ func TestMnmRuleUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.Update( - context.TODO(), - "6f91088a406011ed95aed352566e8d4c", - "2890e6fa406311ed9b5a23f70f6fb8cf", - ) + _, err := client.Mnms.Rules.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -43,7 +39,7 @@ func TestMnmRuleUpdate(t *testing.T) { } } -func TestMnmRuleDelete(t *testing.T) { +func TestMnmRuleUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +55,7 @@ func TestMnmRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.Delete( + _, err := client.Mnms.Rules.Update( context.TODO(), "6f91088a406011ed95aed352566e8d4c", "2890e6fa406311ed9b5a23f70f6fb8cf", @@ -73,7 +69,7 @@ func TestMnmRuleDelete(t *testing.T) { } } -func TestMnmRuleGet(t *testing.T) { +func TestMnmRuleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,11 +85,7 @@ func TestMnmRuleGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.Get( - context.TODO(), - "6f91088a406011ed95aed352566e8d4c", - "2890e6fa406311ed9b5a23f70f6fb8cf", - ) + _, err := client.Mnms.Rules.List(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -103,7 +95,7 @@ func TestMnmRuleGet(t *testing.T) { } } -func TestMnmRuleMagicNetworkMonitoringRulesNewRules(t *testing.T) { +func TestMnmRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -119,7 +111,11 @@ func TestMnmRuleMagicNetworkMonitoringRulesNewRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.MagicNetworkMonitoringRulesNewRules(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Rules.Delete( + context.TODO(), + "6f91088a406011ed95aed352566e8d4c", + "2890e6fa406311ed9b5a23f70f6fb8cf", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -129,7 +125,7 @@ func TestMnmRuleMagicNetworkMonitoringRulesNewRules(t *testing.T) { } } -func TestMnmRuleMagicNetworkMonitoringRulesListRules(t *testing.T) { +func TestMnmRuleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -145,7 +141,11 @@ func TestMnmRuleMagicNetworkMonitoringRulesListRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.MagicNetworkMonitoringRulesListRules(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Rules.Get( + context.TODO(), + "6f91088a406011ed95aed352566e8d4c", + "2890e6fa406311ed9b5a23f70f6fb8cf", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -155,7 +155,7 @@ func TestMnmRuleMagicNetworkMonitoringRulesListRules(t *testing.T) { } } -func TestMnmRuleMagicNetworkMonitoringRulesUpdateRules(t *testing.T) { +func TestMnmRuleReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -171,7 +171,7 @@ func TestMnmRuleMagicNetworkMonitoringRulesUpdateRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.MagicNetworkMonitoringRulesUpdateRules(context.TODO(), "6f91088a406011ed95aed352566e8d4c") + _, err := client.Mnms.Rules.Replace(context.TODO(), "6f91088a406011ed95aed352566e8d4c") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/mnmruleadvertisement.go b/mnmruleadvertisement.go index b5d5c732ac3..a8e89e9f6a2 100644 --- a/mnmruleadvertisement.go +++ b/mnmruleadvertisement.go @@ -31,9 +31,9 @@ func NewMnmRuleAdvertisementService(opts ...option.RequestOption) (r *MnmRuleAdv } // Update advertisement for rule. -func (r *MnmRuleAdvertisementService) MagicNetworkMonitoringRulesUpdateAdvertisementForRule(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse, err error) { +func (r *MnmRuleAdvertisementService) Update(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MnmRuleAdvertisementUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelope + var env MnmRuleAdvertisementUpdateResponseEnvelope path := fmt.Sprintf("accounts/%v/mnm/rules/%v/advertisement", accountIdentifier, ruleIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { @@ -43,40 +43,38 @@ func (r *MnmRuleAdvertisementService) MagicNetworkMonitoringRulesUpdateAdvertise return } -type MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse struct { +type MnmRuleAdvertisementUpdateResponse struct { // Toggle on if you would like Cloudflare to automatically advertise the IP // Prefixes within the rule via Magic Transit when the rule is triggered. Only // available for users of Magic Transit. - AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"` - JSON mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseJSON `json:"-"` + AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"` + JSON mnmRuleAdvertisementUpdateResponseJSON `json:"-"` } -// mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseJSON -// contains the JSON metadata for the struct -// [MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse] -type mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseJSON struct { +// mnmRuleAdvertisementUpdateResponseJSON contains the JSON metadata for the struct +// [MnmRuleAdvertisementUpdateResponse] +type mnmRuleAdvertisementUpdateResponseJSON struct { AutomaticAdvertisement apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleAdvertisementUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelope struct { - Errors []MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessages `json:"messages,required"` - Result MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponse `json:"result,required,nullable"` +type MnmRuleAdvertisementUpdateResponseEnvelope struct { + Errors []MnmRuleAdvertisementUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []MnmRuleAdvertisementUpdateResponseEnvelopeMessages `json:"messages,required"` + Result MnmRuleAdvertisementUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeSuccess `json:"success,required"` - JSON mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeJSON `json:"-"` + Success MnmRuleAdvertisementUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON mnmRuleAdvertisementUpdateResponseEnvelopeJSON `json:"-"` } -// mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelope] -type mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeJSON struct { +// mnmRuleAdvertisementUpdateResponseEnvelopeJSON contains the JSON metadata for +// the struct [MnmRuleAdvertisementUpdateResponseEnvelope] +type mnmRuleAdvertisementUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -85,53 +83,51 @@ type mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleRe ExtraFields map[string]apijson.Field } -func (r *MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleAdvertisementUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrorsJSON `json:"-"` +type MnmRuleAdvertisementUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleAdvertisementUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrors] -type mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrorsJSON struct { +// mnmRuleAdvertisementUpdateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [MnmRuleAdvertisementUpdateResponseEnvelopeErrors] +type mnmRuleAdvertisementUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleAdvertisementUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessagesJSON `json:"-"` +type MnmRuleAdvertisementUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mnmRuleAdvertisementUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessages] -type mnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessagesJSON struct { +// mnmRuleAdvertisementUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [MnmRuleAdvertisementUpdateResponseEnvelopeMessages] +type mnmRuleAdvertisementUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MnmRuleAdvertisementUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeSuccess bool +type MnmRuleAdvertisementUpdateResponseEnvelopeSuccess bool const ( - MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeSuccessTrue MnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRuleResponseEnvelopeSuccess = true + MnmRuleAdvertisementUpdateResponseEnvelopeSuccessTrue MnmRuleAdvertisementUpdateResponseEnvelopeSuccess = true ) diff --git a/mnmruleadvertisement_test.go b/mnmruleadvertisement_test.go index 1a2a8d0c8c8..6eb3af7fc10 100644 --- a/mnmruleadvertisement_test.go +++ b/mnmruleadvertisement_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRule(t *testing.T) { +func TestMnmRuleAdvertisementUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestMnmRuleAdvertisementMagicNetworkMonitoringRulesUpdateAdvertisementForRu option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Mnms.Rules.Advertisements.MagicNetworkMonitoringRulesUpdateAdvertisementForRule( + _, err := client.Mnms.Rules.Advertisements.Update( context.TODO(), "6f91088a406011ed95aed352566e8d4c", "2890e6fa406311ed9b5a23f70f6fb8cf", diff --git a/mtlscertificate.go b/mtlscertificate.go index 31ebdc8968a..f171444b44b 100644 --- a/mtlscertificate.go +++ b/mtlscertificate.go @@ -35,9 +35,9 @@ func NewMtlsCertificateService(opts ...option.RequestOption) (r *MtlsCertificate } // Upload a certificate that you want to use with mTLS-enabled Cloudflare services. -func (r *MtlsCertificateService) Update(ctx context.Context, accountID string, body MtlsCertificateUpdateParams, opts ...option.RequestOption) (res *MtlsCertificateUpdateResponse, err error) { +func (r *MtlsCertificateService) New(ctx context.Context, accountID string, body MtlsCertificateNewParams, opts ...option.RequestOption) (res *MtlsCertificateNewResponse, err error) { opts = append(r.Options[:], opts...) - var env MtlsCertificateUpdateResponseEnvelope + var env MtlsCertificateNewResponseEnvelope path := fmt.Sprintf("accounts/%s/mtls_certificates", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -87,7 +87,7 @@ func (r *MtlsCertificateService) Get(ctx context.Context, accountID string, mtls return } -type MtlsCertificateUpdateResponse struct { +type MtlsCertificateNewResponse struct { // Identifier ID string `json:"id"` // Indicates whether the certificate is a CA or leaf certificate. @@ -107,13 +107,13 @@ type MtlsCertificateUpdateResponse struct { // This is the time the certificate was updated. UpdatedAt time.Time `json:"updated_at" format:"date-time"` // This is the time the certificate was uploaded. - UploadedOn time.Time `json:"uploaded_on" format:"date-time"` - JSON mtlsCertificateUpdateResponseJSON `json:"-"` + UploadedOn time.Time `json:"uploaded_on" format:"date-time"` + JSON mtlsCertificateNewResponseJSON `json:"-"` } -// mtlsCertificateUpdateResponseJSON contains the JSON metadata for the struct -// [MtlsCertificateUpdateResponse] -type mtlsCertificateUpdateResponseJSON struct { +// mtlsCertificateNewResponseJSON contains the JSON metadata for the struct +// [MtlsCertificateNewResponse] +type mtlsCertificateNewResponseJSON struct { ID apijson.Field Ca apijson.Field Certificates apijson.Field @@ -128,7 +128,7 @@ type mtlsCertificateUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *MtlsCertificateUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *MtlsCertificateNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -258,7 +258,7 @@ func (r *MtlsCertificateGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MtlsCertificateUpdateParams struct { +type MtlsCertificateNewParams struct { // Indicates whether the certificate is a CA or leaf certificate. Ca param.Field[bool] `json:"ca,required"` // The uploaded root CA certificate. @@ -269,22 +269,22 @@ type MtlsCertificateUpdateParams struct { PrivateKey param.Field[string] `json:"private_key"` } -func (r MtlsCertificateUpdateParams) MarshalJSON() (data []byte, err error) { +func (r MtlsCertificateNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type MtlsCertificateUpdateResponseEnvelope struct { - Errors []MtlsCertificateUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []MtlsCertificateUpdateResponseEnvelopeMessages `json:"messages,required"` - Result MtlsCertificateUpdateResponse `json:"result,required"` +type MtlsCertificateNewResponseEnvelope struct { + Errors []MtlsCertificateNewResponseEnvelopeErrors `json:"errors,required"` + Messages []MtlsCertificateNewResponseEnvelopeMessages `json:"messages,required"` + Result MtlsCertificateNewResponse `json:"result,required"` // Whether the API call was successful - Success MtlsCertificateUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON mtlsCertificateUpdateResponseEnvelopeJSON `json:"-"` + Success MtlsCertificateNewResponseEnvelopeSuccess `json:"success,required"` + JSON mtlsCertificateNewResponseEnvelopeJSON `json:"-"` } -// mtlsCertificateUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [MtlsCertificateUpdateResponseEnvelope] -type mtlsCertificateUpdateResponseEnvelopeJSON struct { +// mtlsCertificateNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [MtlsCertificateNewResponseEnvelope] +type mtlsCertificateNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -293,53 +293,53 @@ type mtlsCertificateUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *MtlsCertificateUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *MtlsCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MtlsCertificateUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mtlsCertificateUpdateResponseEnvelopeErrorsJSON `json:"-"` +type MtlsCertificateNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mtlsCertificateNewResponseEnvelopeErrorsJSON `json:"-"` } -// mtlsCertificateUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [MtlsCertificateUpdateResponseEnvelopeErrors] -type mtlsCertificateUpdateResponseEnvelopeErrorsJSON struct { +// mtlsCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [MtlsCertificateNewResponseEnvelopeErrors] +type mtlsCertificateNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MtlsCertificateUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *MtlsCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type MtlsCertificateUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON mtlsCertificateUpdateResponseEnvelopeMessagesJSON `json:"-"` +type MtlsCertificateNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON mtlsCertificateNewResponseEnvelopeMessagesJSON `json:"-"` } -// mtlsCertificateUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [MtlsCertificateUpdateResponseEnvelopeMessages] -type mtlsCertificateUpdateResponseEnvelopeMessagesJSON struct { +// mtlsCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [MtlsCertificateNewResponseEnvelopeMessages] +type mtlsCertificateNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *MtlsCertificateUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *MtlsCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type MtlsCertificateUpdateResponseEnvelopeSuccess bool +type MtlsCertificateNewResponseEnvelopeSuccess bool const ( - MtlsCertificateUpdateResponseEnvelopeSuccessTrue MtlsCertificateUpdateResponseEnvelopeSuccess = true + MtlsCertificateNewResponseEnvelopeSuccessTrue MtlsCertificateNewResponseEnvelopeSuccess = true ) type MtlsCertificateListResponseEnvelope struct { diff --git a/mtlscertificate_test.go b/mtlscertificate_test.go index 22f67bad403..459821159c3 100644 --- a/mtlscertificate_test.go +++ b/mtlscertificate_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestMtlsCertificateUpdateWithOptionalParams(t *testing.T) { +func TestMtlsCertificateNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestMtlsCertificateUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.MtlsCertificates.Update( + _, err := client.MtlsCertificates.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.MtlsCertificateUpdateParams{ + cloudflare.MtlsCertificateNewParams{ Ca: cloudflare.F(true), Certificates: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----"), Name: cloudflare.F("example_ca_cert"), diff --git a/originpostquantumencryption.go b/originpostquantumencryption.go index 593bcffdfe0..3065c616d08 100644 --- a/originpostquantumencryption.go +++ b/originpostquantumencryption.go @@ -40,11 +40,11 @@ func NewOriginPostQuantumEncryptionService(opts ...option.RequestOption) (r *Ori // connections when the origin supports and prefers PQ), supported means that PQ // algorithms are advertised but only used when requested by the origin, and off // means that PQ algorithms are not advertised -func (r *OriginPostQuantumEncryptionService) Update(ctx context.Context, zoneID string, body OriginPostQuantumEncryptionUpdateParams, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionUpdateResponse, err error) { +func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionGetResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginPostQuantumEncryptionUpdateResponseEnvelope + var env OriginPostQuantumEncryptionGetResponseEnvelope path := fmt.Sprintf("zones/%s/cache/origin_post_quantum_encryption", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,11 +58,11 @@ func (r *OriginPostQuantumEncryptionService) Update(ctx context.Context, zoneID // connections when the origin supports and prefers PQ), supported means that PQ // algorithms are advertised but only used when requested by the origin, and off // means that PQ algorithms are not advertised -func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionGetResponse, err error) { +func (r *OriginPostQuantumEncryptionService) Replace(ctx context.Context, zoneID string, body OriginPostQuantumEncryptionReplaceParams, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginPostQuantumEncryptionGetResponseEnvelope + var env OriginPostQuantumEncryptionReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/cache/origin_post_quantum_encryption", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -70,15 +70,15 @@ func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, zoneID str return } -// Union satisfied by [OriginPostQuantumEncryptionUpdateResponseUnknown] or +// Union satisfied by [OriginPostQuantumEncryptionGetResponseUnknown] or // [shared.UnionString]. -type OriginPostQuantumEncryptionUpdateResponse interface { - ImplementsOriginPostQuantumEncryptionUpdateResponse() +type OriginPostQuantumEncryptionGetResponse interface { + ImplementsOriginPostQuantumEncryptionGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*OriginPostQuantumEncryptionUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*OriginPostQuantumEncryptionGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -87,15 +87,15 @@ func init() { ) } -// Union satisfied by [OriginPostQuantumEncryptionGetResponseUnknown] or +// Union satisfied by [OriginPostQuantumEncryptionReplaceResponseUnknown] or // [shared.UnionString]. -type OriginPostQuantumEncryptionGetResponse interface { - ImplementsOriginPostQuantumEncryptionGetResponse() +type OriginPostQuantumEncryptionReplaceResponse interface { + ImplementsOriginPostQuantumEncryptionReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*OriginPostQuantumEncryptionGetResponse)(nil)).Elem(), + reflect.TypeOf((*OriginPostQuantumEncryptionReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -104,36 +104,18 @@ func init() { ) } -type OriginPostQuantumEncryptionUpdateParams struct { - // Value of the Origin Post Quantum Encryption Setting. - Value param.Field[OriginPostQuantumEncryptionUpdateParamsValue] `json:"value,required"` -} - -func (r OriginPostQuantumEncryptionUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Value of the Origin Post Quantum Encryption Setting. -type OriginPostQuantumEncryptionUpdateParamsValue string - -const ( - OriginPostQuantumEncryptionUpdateParamsValuePreferred OriginPostQuantumEncryptionUpdateParamsValue = "preferred" - OriginPostQuantumEncryptionUpdateParamsValueSupported OriginPostQuantumEncryptionUpdateParamsValue = "supported" - OriginPostQuantumEncryptionUpdateParamsValueOff OriginPostQuantumEncryptionUpdateParamsValue = "off" -) - -type OriginPostQuantumEncryptionUpdateResponseEnvelope struct { - Errors []OriginPostQuantumEncryptionUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginPostQuantumEncryptionUpdateResponseEnvelopeMessages `json:"messages,required"` - Result OriginPostQuantumEncryptionUpdateResponse `json:"result,required"` +type OriginPostQuantumEncryptionGetResponseEnvelope struct { + Errors []OriginPostQuantumEncryptionGetResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginPostQuantumEncryptionGetResponseEnvelopeMessages `json:"messages,required"` + Result OriginPostQuantumEncryptionGetResponse `json:"result,required"` // Whether the API call was successful - Success OriginPostQuantumEncryptionUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON originPostQuantumEncryptionUpdateResponseEnvelopeJSON `json:"-"` + Success OriginPostQuantumEncryptionGetResponseEnvelopeSuccess `json:"success,required"` + JSON originPostQuantumEncryptionGetResponseEnvelopeJSON `json:"-"` } -// originPostQuantumEncryptionUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [OriginPostQuantumEncryptionUpdateResponseEnvelope] -type originPostQuantumEncryptionUpdateResponseEnvelopeJSON struct { +// originPostQuantumEncryptionGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [OriginPostQuantumEncryptionGetResponseEnvelope] +type originPostQuantumEncryptionGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -142,69 +124,85 @@ type originPostQuantumEncryptionUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginPostQuantumEncryptionUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originPostQuantumEncryptionUpdateResponseEnvelopeErrorsJSON `json:"-"` +type OriginPostQuantumEncryptionGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON `json:"-"` } -// originPostQuantumEncryptionUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [OriginPostQuantumEncryptionUpdateResponseEnvelopeErrors] -type originPostQuantumEncryptionUpdateResponseEnvelopeErrorsJSON struct { +// originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [OriginPostQuantumEncryptionGetResponseEnvelopeErrors] +type originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginPostQuantumEncryptionUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originPostQuantumEncryptionUpdateResponseEnvelopeMessagesJSON `json:"-"` +type OriginPostQuantumEncryptionGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON `json:"-"` } -// originPostQuantumEncryptionUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [OriginPostQuantumEncryptionUpdateResponseEnvelopeMessages] -type originPostQuantumEncryptionUpdateResponseEnvelopeMessagesJSON struct { +// originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [OriginPostQuantumEncryptionGetResponseEnvelopeMessages] +type originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginPostQuantumEncryptionUpdateResponseEnvelopeSuccess bool +type OriginPostQuantumEncryptionGetResponseEnvelopeSuccess bool const ( - OriginPostQuantumEncryptionUpdateResponseEnvelopeSuccessTrue OriginPostQuantumEncryptionUpdateResponseEnvelopeSuccess = true + OriginPostQuantumEncryptionGetResponseEnvelopeSuccessTrue OriginPostQuantumEncryptionGetResponseEnvelopeSuccess = true ) -type OriginPostQuantumEncryptionGetResponseEnvelope struct { - Errors []OriginPostQuantumEncryptionGetResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginPostQuantumEncryptionGetResponseEnvelopeMessages `json:"messages,required"` - Result OriginPostQuantumEncryptionGetResponse `json:"result,required"` +type OriginPostQuantumEncryptionReplaceParams struct { + // Value of the Origin Post Quantum Encryption Setting. + Value param.Field[OriginPostQuantumEncryptionReplaceParamsValue] `json:"value,required"` +} + +func (r OriginPostQuantumEncryptionReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Value of the Origin Post Quantum Encryption Setting. +type OriginPostQuantumEncryptionReplaceParamsValue string + +const ( + OriginPostQuantumEncryptionReplaceParamsValuePreferred OriginPostQuantumEncryptionReplaceParamsValue = "preferred" + OriginPostQuantumEncryptionReplaceParamsValueSupported OriginPostQuantumEncryptionReplaceParamsValue = "supported" + OriginPostQuantumEncryptionReplaceParamsValueOff OriginPostQuantumEncryptionReplaceParamsValue = "off" +) + +type OriginPostQuantumEncryptionReplaceResponseEnvelope struct { + Errors []OriginPostQuantumEncryptionReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginPostQuantumEncryptionReplaceResponseEnvelopeMessages `json:"messages,required"` + Result OriginPostQuantumEncryptionReplaceResponse `json:"result,required"` // Whether the API call was successful - Success OriginPostQuantumEncryptionGetResponseEnvelopeSuccess `json:"success,required"` - JSON originPostQuantumEncryptionGetResponseEnvelopeJSON `json:"-"` + Success OriginPostQuantumEncryptionReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON originPostQuantumEncryptionReplaceResponseEnvelopeJSON `json:"-"` } -// originPostQuantumEncryptionGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [OriginPostQuantumEncryptionGetResponseEnvelope] -type originPostQuantumEncryptionGetResponseEnvelopeJSON struct { +// originPostQuantumEncryptionReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [OriginPostQuantumEncryptionReplaceResponseEnvelope] +type originPostQuantumEncryptionReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -213,51 +211,53 @@ type originPostQuantumEncryptionGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginPostQuantumEncryptionGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON `json:"-"` +type OriginPostQuantumEncryptionReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originPostQuantumEncryptionReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [OriginPostQuantumEncryptionGetResponseEnvelopeErrors] -type originPostQuantumEncryptionGetResponseEnvelopeErrorsJSON struct { +// originPostQuantumEncryptionReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [OriginPostQuantumEncryptionReplaceResponseEnvelopeErrors] +type originPostQuantumEncryptionReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginPostQuantumEncryptionGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON `json:"-"` +type OriginPostQuantumEncryptionReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originPostQuantumEncryptionReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [OriginPostQuantumEncryptionGetResponseEnvelopeMessages] -type originPostQuantumEncryptionGetResponseEnvelopeMessagesJSON struct { +// originPostQuantumEncryptionReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [OriginPostQuantumEncryptionReplaceResponseEnvelopeMessages] +type originPostQuantumEncryptionReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginPostQuantumEncryptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginPostQuantumEncryptionReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginPostQuantumEncryptionGetResponseEnvelopeSuccess bool +type OriginPostQuantumEncryptionReplaceResponseEnvelopeSuccess bool const ( - OriginPostQuantumEncryptionGetResponseEnvelopeSuccessTrue OriginPostQuantumEncryptionGetResponseEnvelopeSuccess = true + OriginPostQuantumEncryptionReplaceResponseEnvelopeSuccessTrue OriginPostQuantumEncryptionReplaceResponseEnvelopeSuccess = true ) diff --git a/originpostquantumencryption_test.go b/originpostquantumencryption_test.go index 06a634005d7..b274422691a 100644 --- a/originpostquantumencryption_test.go +++ b/originpostquantumencryption_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestOriginPostQuantumEncryptionUpdate(t *testing.T) { +func TestOriginPostQuantumEncryptionGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,7 @@ func TestOriginPostQuantumEncryptionUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginPostQuantumEncryptions.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.OriginPostQuantumEncryptionUpdateParams{ - Value: cloudflare.F(cloudflare.OriginPostQuantumEncryptionUpdateParamsValuePreferred), - }, - ) + _, err := client.OriginPostQuantumEncryption.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -45,7 +39,7 @@ func TestOriginPostQuantumEncryptionUpdate(t *testing.T) { } } -func TestOriginPostQuantumEncryptionGet(t *testing.T) { +func TestOriginPostQuantumEncryptionReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +55,13 @@ func TestOriginPostQuantumEncryptionGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginPostQuantumEncryptions.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.OriginPostQuantumEncryption.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.OriginPostQuantumEncryptionReplaceParams{ + Value: cloudflare.F(cloudflare.OriginPostQuantumEncryptionReplaceParamsValuePreferred), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/origintlsclientauthhostname.go b/origintlsclientauthhostname.go index d2ff6c62e42..9c641c5e6e2 100644 --- a/origintlsclientauthhostname.go +++ b/origintlsclientauthhostname.go @@ -34,16 +34,12 @@ func NewOriginTLSClientAuthHostnameService(opts ...option.RequestOption) (r *Ori return } -// Associate a hostname to a certificate and enable, disable or invalidate the -// association. If disabled, client certificate will not be sent to the hostname -// even if activated at the zone level. 100 maximum associations on a single -// certificate are allowed. Note: Use a null value for parameter _enabled_ to -// invalidate the association. -func (r *OriginTLSClientAuthHostnameService) Update(ctx context.Context, zoneID string, body OriginTLSClientAuthHostnameUpdateParams, opts ...option.RequestOption) (res *[]OriginTLSClientAuthHostnameUpdateResponse, err error) { +// Get the Hostname Status for Client Authentication +func (r *OriginTLSClientAuthHostnameService) Get(ctx context.Context, zoneID string, hostname string, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameGetResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginTLSClientAuthHostnameUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env OriginTLSClientAuthHostnameGetResponseEnvelope + path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/%s", zoneID, hostname) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -51,12 +47,16 @@ func (r *OriginTLSClientAuthHostnameService) Update(ctx context.Context, zoneID return } -// Get the Hostname Status for Client Authentication -func (r *OriginTLSClientAuthHostnameService) Get(ctx context.Context, zoneID string, hostname string, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameGetResponse, err error) { +// Associate a hostname to a certificate and enable, disable or invalidate the +// association. If disabled, client certificate will not be sent to the hostname +// even if activated at the zone level. 100 maximum associations on a single +// certificate are allowed. Note: Use a null value for parameter _enabled_ to +// invalidate the association. +func (r *OriginTLSClientAuthHostnameService) Replace(ctx context.Context, zoneID string, body OriginTLSClientAuthHostnameReplaceParams, opts ...option.RequestOption) (res *[]OriginTLSClientAuthHostnameReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginTLSClientAuthHostnameGetResponseEnvelope - path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/%s", zoneID, hostname) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env OriginTLSClientAuthHostnameReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -64,41 +64,6 @@ func (r *OriginTLSClientAuthHostnameService) Get(ctx context.Context, zoneID str return } -type OriginTLSClientAuthHostnameUpdateResponse struct { - // Identifier - ID string `json:"id"` - // Identifier - CertID string `json:"cert_id"` - // The hostname certificate. - Certificate string `json:"certificate"` - // Indicates whether hostname-level authenticated origin pulls is enabled. A null - // value voids the association. - Enabled bool `json:"enabled,nullable"` - // The hostname on the origin for which the client certificate uploaded will be - // used. - Hostname string `json:"hostname"` - // The hostname certificate's private key. - PrivateKey string `json:"private_key"` - JSON originTLSClientAuthHostnameUpdateResponseJSON `json:"-"` -} - -// originTLSClientAuthHostnameUpdateResponseJSON contains the JSON metadata for the -// struct [OriginTLSClientAuthHostnameUpdateResponse] -type originTLSClientAuthHostnameUpdateResponseJSON struct { - ID apijson.Field - CertID apijson.Field - Certificate apijson.Field - Enabled apijson.Field - Hostname apijson.Field - PrivateKey apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *OriginTLSClientAuthHostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type OriginTLSClientAuthHostnameGetResponse struct { // Identifier CertID string `json:"cert_id"` @@ -184,195 +149,230 @@ const ( OriginTLSClientAuthHostnameGetResponseStatusDeletionTimedOut OriginTLSClientAuthHostnameGetResponseStatus = "deletion_timed_out" ) -type OriginTLSClientAuthHostnameUpdateParams struct { - Config param.Field[[]OriginTLSClientAuthHostnameUpdateParamsConfig] `json:"config,required"` -} - -func (r OriginTLSClientAuthHostnameUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type OriginTLSClientAuthHostnameUpdateParamsConfig struct { - // Certificate identifier tag. - CertID param.Field[string] `json:"cert_id"` +type OriginTLSClientAuthHostnameReplaceResponse struct { + // Identifier + ID string `json:"id"` + // Identifier + CertID string `json:"cert_id"` + // The hostname certificate. + Certificate string `json:"certificate"` // Indicates whether hostname-level authenticated origin pulls is enabled. A null // value voids the association. - Enabled param.Field[bool] `json:"enabled"` + Enabled bool `json:"enabled,nullable"` // The hostname on the origin for which the client certificate uploaded will be // used. - Hostname param.Field[string] `json:"hostname"` + Hostname string `json:"hostname"` + // The hostname certificate's private key. + PrivateKey string `json:"private_key"` + JSON originTLSClientAuthHostnameReplaceResponseJSON `json:"-"` } -func (r OriginTLSClientAuthHostnameUpdateParamsConfig) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// originTLSClientAuthHostnameReplaceResponseJSON contains the JSON metadata for +// the struct [OriginTLSClientAuthHostnameReplaceResponse] +type originTLSClientAuthHostnameReplaceResponseJSON struct { + ID apijson.Field + CertID apijson.Field + Certificate apijson.Field + Enabled apijson.Field + Hostname apijson.Field + PrivateKey apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *OriginTLSClientAuthHostnameReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthHostnameUpdateResponseEnvelope struct { - Errors []OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []OriginTLSClientAuthHostnameUpdateResponse `json:"result,required,nullable"` +type OriginTLSClientAuthHostnameGetResponseEnvelope struct { + Errors []OriginTLSClientAuthHostnameGetResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginTLSClientAuthHostnameGetResponseEnvelopeMessages `json:"messages,required"` + Result OriginTLSClientAuthHostnameGetResponse `json:"result,required"` // Whether the API call was successful - Success OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON originTLSClientAuthHostnameUpdateResponseEnvelopeJSON `json:"-"` + Success OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess `json:"success,required"` + JSON originTLSClientAuthHostnameGetResponseEnvelopeJSON `json:"-"` } -// originTLSClientAuthHostnameUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [OriginTLSClientAuthHostnameUpdateResponseEnvelope] -type originTLSClientAuthHostnameUpdateResponseEnvelopeJSON struct { +// originTLSClientAuthHostnameGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [OriginTLSClientAuthHostnameGetResponseEnvelope] +type originTLSClientAuthHostnameGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON `json:"-"` +type OriginTLSClientAuthHostnameGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON `json:"-"` } -// originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors] -type originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON struct { +// originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeErrors] +type originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON `json:"-"` +type OriginTLSClientAuthHostnameGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON `json:"-"` } -// originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages] -type originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON struct { +// originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeMessages] +type originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess bool +type OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess bool const ( - OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess = true + OriginTLSClientAuthHostnameGetResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess = true ) -type OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON `json:"-"` +type OriginTLSClientAuthHostnameReplaceParams struct { + Config param.Field[[]OriginTLSClientAuthHostnameReplaceParamsConfig] `json:"config,required"` } -// originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo] -type originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r OriginTLSClientAuthHostnameReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +type OriginTLSClientAuthHostnameReplaceParamsConfig struct { + // Certificate identifier tag. + CertID param.Field[string] `json:"cert_id"` + // Indicates whether hostname-level authenticated origin pulls is enabled. A null + // value voids the association. + Enabled param.Field[bool] `json:"enabled"` + // The hostname on the origin for which the client certificate uploaded will be + // used. + Hostname param.Field[string] `json:"hostname"` } -type OriginTLSClientAuthHostnameGetResponseEnvelope struct { - Errors []OriginTLSClientAuthHostnameGetResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginTLSClientAuthHostnameGetResponseEnvelopeMessages `json:"messages,required"` - Result OriginTLSClientAuthHostnameGetResponse `json:"result,required"` +func (r OriginTLSClientAuthHostnameReplaceParamsConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type OriginTLSClientAuthHostnameReplaceResponseEnvelope struct { + Errors []OriginTLSClientAuthHostnameReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginTLSClientAuthHostnameReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []OriginTLSClientAuthHostnameReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess `json:"success,required"` - JSON originTLSClientAuthHostnameGetResponseEnvelopeJSON `json:"-"` + Success OriginTLSClientAuthHostnameReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo OriginTLSClientAuthHostnameReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON originTLSClientAuthHostnameReplaceResponseEnvelopeJSON `json:"-"` } -// originTLSClientAuthHostnameGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [OriginTLSClientAuthHostnameGetResponseEnvelope] -type originTLSClientAuthHostnameGetResponseEnvelopeJSON struct { +// originTLSClientAuthHostnameReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [OriginTLSClientAuthHostnameReplaceResponseEnvelope] +type originTLSClientAuthHostnameReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthHostnameGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON `json:"-"` +type OriginTLSClientAuthHostnameReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthHostnameReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeErrors] -type originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON struct { +// originTLSClientAuthHostnameReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [OriginTLSClientAuthHostnameReplaceResponseEnvelopeErrors] +type originTLSClientAuthHostnameReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthHostnameGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON `json:"-"` +type OriginTLSClientAuthHostnameReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthHostnameReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeMessages] -type originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON struct { +// originTLSClientAuthHostnameReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [OriginTLSClientAuthHostnameReplaceResponseEnvelopeMessages] +type originTLSClientAuthHostnameReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthHostnameReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess bool +type OriginTLSClientAuthHostnameReplaceResponseEnvelopeSuccess bool const ( - OriginTLSClientAuthHostnameGetResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess = true + OriginTLSClientAuthHostnameReplaceResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameReplaceResponseEnvelopeSuccess = true ) + +type OriginTLSClientAuthHostnameReplaceResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON originTLSClientAuthHostnameReplaceResponseEnvelopeResultInfoJSON `json:"-"` +} + +// originTLSClientAuthHostnameReplaceResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [OriginTLSClientAuthHostnameReplaceResponseEnvelopeResultInfo] +type originTLSClientAuthHostnameReplaceResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *OriginTLSClientAuthHostnameReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/origintlsclientauthhostname_test.go b/origintlsclientauthhostname_test.go index 4963f7ded5c..04f4216b0d7 100644 --- a/origintlsclientauthhostname_test.go +++ b/origintlsclientauthhostname_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestOriginTLSClientAuthHostnameUpdate(t *testing.T) { +func TestOriginTLSClientAuthHostnameGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,24 +29,10 @@ func TestOriginTLSClientAuthHostnameUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginTLSClientAuth.Hostnames.Update( + _, err := client.OriginTLSClientAuth.Hostnames.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.OriginTLSClientAuthHostnameUpdateParams{ - Config: cloudflare.F([]cloudflare.OriginTLSClientAuthHostnameUpdateParamsConfig{{ - CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), - Enabled: cloudflare.F(true), - Hostname: cloudflare.F("app.example.com"), - }, { - CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), - Enabled: cloudflare.F(true), - Hostname: cloudflare.F("app.example.com"), - }, { - CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), - Enabled: cloudflare.F(true), - Hostname: cloudflare.F("app.example.com"), - }}), - }, + "app.example.com", ) if err != nil { var apierr *cloudflare.Error @@ -57,7 +43,7 @@ func TestOriginTLSClientAuthHostnameUpdate(t *testing.T) { } } -func TestOriginTLSClientAuthHostnameGet(t *testing.T) { +func TestOriginTLSClientAuthHostnameReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -73,10 +59,24 @@ func TestOriginTLSClientAuthHostnameGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginTLSClientAuth.Hostnames.Get( + _, err := client.OriginTLSClientAuth.Hostnames.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "app.example.com", + cloudflare.OriginTLSClientAuthHostnameReplaceParams{ + Config: cloudflare.F([]cloudflare.OriginTLSClientAuthHostnameReplaceParamsConfig{{ + CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), + Enabled: cloudflare.F(true), + Hostname: cloudflare.F("app.example.com"), + }, { + CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), + Enabled: cloudflare.F(true), + Hostname: cloudflare.F("app.example.com"), + }, { + CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"), + Enabled: cloudflare.F(true), + Hostname: cloudflare.F("app.example.com"), + }}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/origintlsclientauthsetting.go b/origintlsclientauthsetting.go index ac03234bcad..8c838c6f7ec 100644 --- a/origintlsclientauthsetting.go +++ b/origintlsclientauthsetting.go @@ -33,9 +33,9 @@ func NewOriginTLSClientAuthSettingService(opts ...option.RequestOption) (r *Orig // Get whether zone-level authenticated origin pulls is enabled or not. It is false // by default. -func (r *OriginTLSClientAuthSettingService) ZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZone(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse, err error) { +func (r *OriginTLSClientAuthSettingService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelope + var env OriginTLSClientAuthSettingGetResponseEnvelope path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -48,9 +48,9 @@ func (r *OriginTLSClientAuthSettingService) ZoneLevelAuthenticatedOriginPullsGet // Enable or disable zone-level authenticated origin pulls. 'enabled' should be set // true either before/after the certificate is uploaded to see the certificate in // use. -func (r *OriginTLSClientAuthSettingService) ZoneLevelAuthenticatedOriginPullsSetEnablementForZone(ctx context.Context, zoneID string, body OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneParams, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse, err error) { +func (r *OriginTLSClientAuthSettingService) Replace(ctx context.Context, zoneID string, body OriginTLSClientAuthSettingReplaceParams, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelope + var env OriginTLSClientAuthSettingReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -60,57 +60,54 @@ func (r *OriginTLSClientAuthSettingService) ZoneLevelAuthenticatedOriginPullsSet return } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse struct { +type OriginTLSClientAuthSettingGetResponse struct { // Indicates whether zone-level authenticated origin pulls is enabled. - Enabled bool `json:"enabled"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON originTLSClientAuthSettingGetResponseJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseJSON struct { +// originTLSClientAuthSettingGetResponseJSON contains the JSON metadata for the +// struct [OriginTLSClientAuthSettingGetResponse] +type originTLSClientAuthSettingGetResponseJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse struct { +type OriginTLSClientAuthSettingReplaceResponse struct { // Indicates whether zone-level authenticated origin pulls is enabled. - Enabled bool `json:"enabled"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseJSON `json:"-"` + Enabled bool `json:"enabled"` + JSON originTLSClientAuthSettingReplaceResponseJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseJSON struct { +// originTLSClientAuthSettingReplaceResponseJSON contains the JSON metadata for the +// struct [OriginTLSClientAuthSettingReplaceResponse] +type originTLSClientAuthSettingReplaceResponseJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelope struct { - Errors []OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessages `json:"messages,required"` - Result OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponse `json:"result,required"` +type OriginTLSClientAuthSettingGetResponseEnvelope struct { + Errors []OriginTLSClientAuthSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginTLSClientAuthSettingGetResponseEnvelopeMessages `json:"messages,required"` + Result OriginTLSClientAuthSettingGetResponse `json:"result,required"` // Whether the API call was successful - Success OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeSuccess `json:"success,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeJSON `json:"-"` + Success OriginTLSClientAuthSettingGetResponseEnvelopeSuccess `json:"success,required"` + JSON originTLSClientAuthSettingGetResponseEnvelopeJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelope] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeJSON struct { +// originTLSClientAuthSettingGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [OriginTLSClientAuthSettingGetResponseEnvelope] +type originTLSClientAuthSettingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -119,79 +116,76 @@ type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSet ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrorsJSON `json:"-"` +type OriginTLSClientAuthSettingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrors] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrorsJSON struct { +// originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [OriginTLSClientAuthSettingGetResponseEnvelopeErrors] +type originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessagesJSON `json:"-"` +type OriginTLSClientAuthSettingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessages] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessagesJSON struct { +// originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [OriginTLSClientAuthSettingGetResponseEnvelopeMessages] +type originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeSuccess bool +type OriginTLSClientAuthSettingGetResponseEnvelopeSuccess bool const ( - OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZoneResponseEnvelopeSuccess = true + OriginTLSClientAuthSettingGetResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingGetResponseEnvelopeSuccess = true ) -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneParams struct { +type OriginTLSClientAuthSettingReplaceParams struct { // Indicates whether zone-level authenticated origin pulls is enabled. Enabled param.Field[bool] `json:"enabled,required"` } -func (r OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneParams) MarshalJSON() (data []byte, err error) { +func (r OriginTLSClientAuthSettingReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelope struct { - Errors []OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrors `json:"errors,required"` - Messages []OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessages `json:"messages,required"` - Result OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponse `json:"result,required"` +type OriginTLSClientAuthSettingReplaceResponseEnvelope struct { + Errors []OriginTLSClientAuthSettingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []OriginTLSClientAuthSettingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result OriginTLSClientAuthSettingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeSuccess `json:"success,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeJSON `json:"-"` + Success OriginTLSClientAuthSettingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON originTLSClientAuthSettingReplaceResponseEnvelopeJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelope] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeJSON struct { +// originTLSClientAuthSettingReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [OriginTLSClientAuthSettingReplaceResponseEnvelope] +type originTLSClientAuthSettingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -200,53 +194,53 @@ type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementFor ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrorsJSON `json:"-"` +type OriginTLSClientAuthSettingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthSettingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrors] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrorsJSON struct { +// originTLSClientAuthSettingReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [OriginTLSClientAuthSettingReplaceResponseEnvelopeErrors] +type originTLSClientAuthSettingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessagesJSON `json:"-"` +type OriginTLSClientAuthSettingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON originTLSClientAuthSettingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessages] -type originTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessagesJSON struct { +// originTLSClientAuthSettingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [OriginTLSClientAuthSettingReplaceResponseEnvelopeMessages] +type originTLSClientAuthSettingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *OriginTLSClientAuthSettingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeSuccess bool +type OriginTLSClientAuthSettingReplaceResponseEnvelopeSuccess bool const ( - OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneResponseEnvelopeSuccess = true + OriginTLSClientAuthSettingReplaceResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingReplaceResponseEnvelopeSuccess = true ) diff --git a/origintlsclientauthsetting_test.go b/origintlsclientauthsetting_test.go index 9e48208b2fc..186af3c722e 100644 --- a/origintlsclientauthsetting_test.go +++ b/origintlsclientauthsetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestOriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZone(t *testing.T) { +func TestOriginTLSClientAuthSettingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestOriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablemen option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginTLSClientAuth.Settings.ZoneLevelAuthenticatedOriginPullsGetEnablementSettingForZone(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.OriginTLSClientAuth.Settings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestOriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsGetEnablemen } } -func TestOriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZone(t *testing.T) { +func TestOriginTLSClientAuthSettingReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestOriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablemen option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.OriginTLSClientAuth.Settings.ZoneLevelAuthenticatedOriginPullsSetEnablementForZone( + _, err := client.OriginTLSClientAuth.Settings.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.OriginTLSClientAuthSettingZoneLevelAuthenticatedOriginPullsSetEnablementForZoneParams{ + cloudflare.OriginTLSClientAuthSettingReplaceParams{ Enabled: cloudflare.F(true), }, ) diff --git a/pageprojectdeployment.go b/pageprojectdeployment.go index e89895c7e7c..75d5072b558 100644 --- a/pageprojectdeployment.go +++ b/pageprojectdeployment.go @@ -20,10 +20,8 @@ import ( // this service directly, and instead use the [NewPageProjectDeploymentService] // method instead. type PageProjectDeploymentService struct { - Options []option.RequestOption - Histories *PageProjectDeploymentHistoryService - Retries *PageProjectDeploymentRetryService - Rollbacks *PageProjectDeploymentRollbackService + Options []option.RequestOption + History *PageProjectDeploymentHistoryService } // NewPageProjectDeploymentService generates a new service that applies the given @@ -32,9 +30,7 @@ type PageProjectDeploymentService struct { func NewPageProjectDeploymentService(opts ...option.RequestOption) (r *PageProjectDeploymentService) { r = &PageProjectDeploymentService{} r.Options = opts - r.Histories = NewPageProjectDeploymentHistoryService(opts...) - r.Retries = NewPageProjectDeploymentRetryService(opts...) - r.Rollbacks = NewPageProjectDeploymentRollbackService(opts...) + r.History = NewPageProjectDeploymentHistoryService(opts...) return } @@ -86,6 +82,33 @@ func (r *PageProjectDeploymentService) Get(ctx context.Context, accountID string return } +// Retry a previous deployment. +func (r *PageProjectDeploymentService) Retry(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentRetryResponse, err error) { + opts = append(r.Options[:], opts...) + var env PageProjectDeploymentRetryResponseEnvelope + path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", accountID, projectName, deploymentID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Rollback the production deployment to a previous deployment. You can only +// rollback to succesful builds on production. +func (r *PageProjectDeploymentService) Rollback(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentRollbackResponse, err error) { + opts = append(r.Options[:], opts...) + var env PageProjectDeploymentRollbackResponseEnvelope + path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", accountID, projectName, deploymentID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type PageProjectDeploymentNewResponse struct { // Id of the deployment. ID string `json:"id"` @@ -496,6 +519,278 @@ func (r *PageProjectDeploymentGetResponseStage) UnmarshalJSON(data []byte) (err return apijson.UnmarshalRoot(data, r) } +type PageProjectDeploymentRetryResponse struct { + // Id of the deployment. + ID string `json:"id"` + // A list of alias URLs pointing to this deployment. + Aliases []interface{} `json:"aliases,nullable"` + BuildConfig interface{} `json:"build_config"` + // When the deployment was created. + CreatedOn time.Time `json:"created_on" format:"date-time"` + // Info about what caused the deployment. + DeploymentTrigger PageProjectDeploymentRetryResponseDeploymentTrigger `json:"deployment_trigger"` + // A dict of env variables to build this deploy. + EnvVars interface{} `json:"env_vars"` + // Type of deploy. + Environment string `json:"environment"` + // If the deployment has been skipped. + IsSkipped bool `json:"is_skipped"` + LatestStage interface{} `json:"latest_stage"` + // When the deployment was last modified. + ModifiedOn time.Time `json:"modified_on" format:"date-time"` + // Id of the project. + ProjectID string `json:"project_id"` + // Name of the project. + ProjectName string `json:"project_name"` + // Short Id (8 character) of the deployment. + ShortID string `json:"short_id"` + Source interface{} `json:"source"` + // List of past stages. + Stages []PageProjectDeploymentRetryResponseStage `json:"stages"` + // The live URL to view this deployment. + URL string `json:"url"` + JSON pageProjectDeploymentRetryResponseJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseJSON contains the JSON metadata for the struct +// [PageProjectDeploymentRetryResponse] +type pageProjectDeploymentRetryResponseJSON struct { + ID apijson.Field + Aliases apijson.Field + BuildConfig apijson.Field + CreatedOn apijson.Field + DeploymentTrigger apijson.Field + EnvVars apijson.Field + Environment apijson.Field + IsSkipped apijson.Field + LatestStage apijson.Field + ModifiedOn apijson.Field + ProjectID apijson.Field + ProjectName apijson.Field + ShortID apijson.Field + Source apijson.Field + Stages apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Info about what caused the deployment. +type PageProjectDeploymentRetryResponseDeploymentTrigger struct { + // Additional info about the trigger. + Metadata PageProjectDeploymentRetryResponseDeploymentTriggerMetadata `json:"metadata"` + // What caused the deployment. + Type string `json:"type"` + JSON pageProjectDeploymentRetryResponseDeploymentTriggerJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseDeploymentTriggerJSON contains the JSON +// metadata for the struct [PageProjectDeploymentRetryResponseDeploymentTrigger] +type pageProjectDeploymentRetryResponseDeploymentTriggerJSON struct { + Metadata apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Additional info about the trigger. +type PageProjectDeploymentRetryResponseDeploymentTriggerMetadata struct { + // Where the trigger happened. + Branch string `json:"branch"` + // Hash of the deployment trigger commit. + CommitHash string `json:"commit_hash"` + // Message of the deployment trigger commit. + CommitMessage string `json:"commit_message"` + JSON pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON contains the +// JSON metadata for the struct +// [PageProjectDeploymentRetryResponseDeploymentTriggerMetadata] +type pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON struct { + Branch apijson.Field + CommitHash apijson.Field + CommitMessage apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The status of the deployment. +type PageProjectDeploymentRetryResponseStage struct { + // When the stage ended. + EndedOn time.Time `json:"ended_on,nullable" format:"date-time"` + // The current build stage. + Name string `json:"name"` + // When the stage started. + StartedOn time.Time `json:"started_on,nullable" format:"date-time"` + // State of the current stage. + Status string `json:"status"` + JSON pageProjectDeploymentRetryResponseStageJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseStageJSON contains the JSON metadata for the +// struct [PageProjectDeploymentRetryResponseStage] +type pageProjectDeploymentRetryResponseStageJSON struct { + EndedOn apijson.Field + Name apijson.Field + StartedOn apijson.Field + Status apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseStage) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDeploymentRollbackResponse struct { + // Id of the deployment. + ID string `json:"id"` + // A list of alias URLs pointing to this deployment. + Aliases []interface{} `json:"aliases,nullable"` + BuildConfig interface{} `json:"build_config"` + // When the deployment was created. + CreatedOn time.Time `json:"created_on" format:"date-time"` + // Info about what caused the deployment. + DeploymentTrigger PageProjectDeploymentRollbackResponseDeploymentTrigger `json:"deployment_trigger"` + // A dict of env variables to build this deploy. + EnvVars interface{} `json:"env_vars"` + // Type of deploy. + Environment string `json:"environment"` + // If the deployment has been skipped. + IsSkipped bool `json:"is_skipped"` + LatestStage interface{} `json:"latest_stage"` + // When the deployment was last modified. + ModifiedOn time.Time `json:"modified_on" format:"date-time"` + // Id of the project. + ProjectID string `json:"project_id"` + // Name of the project. + ProjectName string `json:"project_name"` + // Short Id (8 character) of the deployment. + ShortID string `json:"short_id"` + Source interface{} `json:"source"` + // List of past stages. + Stages []PageProjectDeploymentRollbackResponseStage `json:"stages"` + // The live URL to view this deployment. + URL string `json:"url"` + JSON pageProjectDeploymentRollbackResponseJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseJSON contains the JSON metadata for the +// struct [PageProjectDeploymentRollbackResponse] +type pageProjectDeploymentRollbackResponseJSON struct { + ID apijson.Field + Aliases apijson.Field + BuildConfig apijson.Field + CreatedOn apijson.Field + DeploymentTrigger apijson.Field + EnvVars apijson.Field + Environment apijson.Field + IsSkipped apijson.Field + LatestStage apijson.Field + ModifiedOn apijson.Field + ProjectID apijson.Field + ProjectName apijson.Field + ShortID apijson.Field + Source apijson.Field + Stages apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Info about what caused the deployment. +type PageProjectDeploymentRollbackResponseDeploymentTrigger struct { + // Additional info about the trigger. + Metadata PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata `json:"metadata"` + // What caused the deployment. + Type string `json:"type"` + JSON pageProjectDeploymentRollbackResponseDeploymentTriggerJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseDeploymentTriggerJSON contains the JSON +// metadata for the struct [PageProjectDeploymentRollbackResponseDeploymentTrigger] +type pageProjectDeploymentRollbackResponseDeploymentTriggerJSON struct { + Metadata apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Additional info about the trigger. +type PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata struct { + // Where the trigger happened. + Branch string `json:"branch"` + // Hash of the deployment trigger commit. + CommitHash string `json:"commit_hash"` + // Message of the deployment trigger commit. + CommitMessage string `json:"commit_message"` + JSON pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON contains the +// JSON metadata for the struct +// [PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata] +type pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON struct { + Branch apijson.Field + CommitHash apijson.Field + CommitMessage apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The status of the deployment. +type PageProjectDeploymentRollbackResponseStage struct { + // When the stage ended. + EndedOn time.Time `json:"ended_on,nullable" format:"date-time"` + // The current build stage. + Name string `json:"name"` + // When the stage started. + StartedOn time.Time `json:"started_on,nullable" format:"date-time"` + // State of the current stage. + Status string `json:"status"` + JSON pageProjectDeploymentRollbackResponseStageJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseStageJSON contains the JSON metadata for +// the struct [PageProjectDeploymentRollbackResponseStage] +type pageProjectDeploymentRollbackResponseStageJSON struct { + EndedOn apijson.Field + Name apijson.Field + StartedOn apijson.Field + Status apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseStage) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type PageProjectDeploymentNewParams struct { // The branch to build the new deployment from. The `HEAD` of the branch will be // used. If omitted, the production branch will be used by default. @@ -737,3 +1032,141 @@ type PageProjectDeploymentGetResponseEnvelopeSuccess bool const ( PageProjectDeploymentGetResponseEnvelopeSuccessTrue PageProjectDeploymentGetResponseEnvelopeSuccess = true ) + +type PageProjectDeploymentRetryResponseEnvelope struct { + Errors []PageProjectDeploymentRetryResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDeploymentRetryResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDeploymentRetryResponse `json:"result,required"` + // Whether the API call was successful + Success PageProjectDeploymentRetryResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDeploymentRetryResponseEnvelopeJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseEnvelopeJSON contains the JSON metadata for +// the struct [PageProjectDeploymentRetryResponseEnvelope] +type pageProjectDeploymentRetryResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDeploymentRetryResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentRetryResponseEnvelopeErrorsJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [PageProjectDeploymentRetryResponseEnvelopeErrors] +type pageProjectDeploymentRetryResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDeploymentRetryResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentRetryResponseEnvelopeMessagesJSON `json:"-"` +} + +// pageProjectDeploymentRetryResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [PageProjectDeploymentRetryResponseEnvelopeMessages] +type pageProjectDeploymentRetryResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRetryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type PageProjectDeploymentRetryResponseEnvelopeSuccess bool + +const ( + PageProjectDeploymentRetryResponseEnvelopeSuccessTrue PageProjectDeploymentRetryResponseEnvelopeSuccess = true +) + +type PageProjectDeploymentRollbackResponseEnvelope struct { + Errors []PageProjectDeploymentRollbackResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDeploymentRollbackResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDeploymentRollbackResponse `json:"result,required"` + // Whether the API call was successful + Success PageProjectDeploymentRollbackResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDeploymentRollbackResponseEnvelopeJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseEnvelopeJSON contains the JSON metadata for +// the struct [PageProjectDeploymentRollbackResponseEnvelope] +type pageProjectDeploymentRollbackResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDeploymentRollbackResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [PageProjectDeploymentRollbackResponseEnvelopeErrors] +type pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDeploymentRollbackResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON `json:"-"` +} + +// pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [PageProjectDeploymentRollbackResponseEnvelopeMessages] +type pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDeploymentRollbackResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type PageProjectDeploymentRollbackResponseEnvelopeSuccess bool + +const ( + PageProjectDeploymentRollbackResponseEnvelopeSuccessTrue PageProjectDeploymentRollbackResponseEnvelopeSuccess = true +) diff --git a/pageprojectdeployment_test.go b/pageprojectdeployment_test.go index f09666b65f4..36de4ddc474 100644 --- a/pageprojectdeployment_test.go +++ b/pageprojectdeployment_test.go @@ -137,3 +137,65 @@ func TestPageProjectDeploymentGet(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestPageProjectDeploymentRetry(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Pages.Projects.Deployments.Retry( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "this-is-my-project-01", + "023e105f4ecef8ad9ca31a8372d0c353", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestPageProjectDeploymentRollback(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Pages.Projects.Deployments.Rollback( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "this-is-my-project-01", + "023e105f4ecef8ad9ca31a8372d0c353", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/pageprojectdeploymenthistorylog.go b/pageprojectdeploymenthistorylog.go index 7e230194a3d..64a2b45208d 100644 --- a/pageprojectdeploymenthistorylog.go +++ b/pageprojectdeploymenthistorylog.go @@ -34,9 +34,9 @@ func NewPageProjectDeploymentHistoryLogService(opts ...option.RequestOption) (r } // Fetch deployment logs for a project. -func (r *PageProjectDeploymentHistoryLogService) PagesDeploymentGetDeploymentLogs(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse, err error) { +func (r *PageProjectDeploymentHistoryLogService) List(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentHistoryLogListResponse, err error) { opts = append(r.Options[:], opts...) - var env PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelope + var env PageProjectDeploymentHistoryLogListResponseEnvelope path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/history/logs", accountID, projectName, deploymentID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,17 +46,15 @@ func (r *PageProjectDeploymentHistoryLogService) PagesDeploymentGetDeploymentLog return } -// Union satisfied by -// [PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseUnknown], -// [PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseArray] -// or [shared.UnionString]. -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse interface { - ImplementsPageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse() +// Union satisfied by [PageProjectDeploymentHistoryLogListResponseUnknown], +// [PageProjectDeploymentHistoryLogListResponseArray] or [shared.UnionString]. +type PageProjectDeploymentHistoryLogListResponse interface { + ImplementsPageProjectDeploymentHistoryLogListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse)(nil)).Elem(), + reflect.TypeOf((*PageProjectDeploymentHistoryLogListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -65,24 +63,23 @@ func init() { ) } -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseArray []interface{} +type PageProjectDeploymentHistoryLogListResponseArray []interface{} -func (r PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseArray) ImplementsPageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse() { +func (r PageProjectDeploymentHistoryLogListResponseArray) ImplementsPageProjectDeploymentHistoryLogListResponse() { } -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelope struct { - Errors []PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponse `json:"result,required"` +type PageProjectDeploymentHistoryLogListResponseEnvelope struct { + Errors []PageProjectDeploymentHistoryLogListResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDeploymentHistoryLogListResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDeploymentHistoryLogListResponse `json:"result,required"` // Whether the API call was successful - Success PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeJSON `json:"-"` + Success PageProjectDeploymentHistoryLogListResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDeploymentHistoryLogListResponseEnvelopeJSON `json:"-"` } -// pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelope] -type pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeJSON struct { +// pageProjectDeploymentHistoryLogListResponseEnvelopeJSON contains the JSON +// metadata for the struct [PageProjectDeploymentHistoryLogListResponseEnvelope] +type pageProjectDeploymentHistoryLogListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -91,53 +88,53 @@ type pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnve ExtraFields map[string]apijson.Field } -func (r *PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDeploymentHistoryLogListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrorsJSON `json:"-"` +type PageProjectDeploymentHistoryLogListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentHistoryLogListResponseEnvelopeErrorsJSON `json:"-"` } -// pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrors] -type pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrorsJSON struct { +// pageProjectDeploymentHistoryLogListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [PageProjectDeploymentHistoryLogListResponseEnvelopeErrors] +type pageProjectDeploymentHistoryLogListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDeploymentHistoryLogListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessagesJSON `json:"-"` +type PageProjectDeploymentHistoryLogListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDeploymentHistoryLogListResponseEnvelopeMessagesJSON `json:"-"` } -// pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessages] -type pageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessagesJSON struct { +// pageProjectDeploymentHistoryLogListResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [PageProjectDeploymentHistoryLogListResponseEnvelopeMessages] +type pageProjectDeploymentHistoryLogListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDeploymentHistoryLogListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeSuccess bool +type PageProjectDeploymentHistoryLogListResponseEnvelopeSuccess bool const ( - PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeSuccessTrue PageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogsResponseEnvelopeSuccess = true + PageProjectDeploymentHistoryLogListResponseEnvelopeSuccessTrue PageProjectDeploymentHistoryLogListResponseEnvelopeSuccess = true ) diff --git a/pageprojectdeploymenthistorylog_test.go b/pageprojectdeploymenthistorylog_test.go index e12d0c0e833..aeb73644591 100644 --- a/pageprojectdeploymenthistorylog_test.go +++ b/pageprojectdeploymenthistorylog_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogs(t *testing.T) { +func TestPageProjectDeploymentHistoryLogList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestPageProjectDeploymentHistoryLogPagesDeploymentGetDeploymentLogs(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Deployments.Histories.Logs.PagesDeploymentGetDeploymentLogs( + _, err := client.Pages.Projects.Deployments.History.Logs.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", diff --git a/pageprojectdeploymentretry.go b/pageprojectdeploymentretry.go deleted file mode 100644 index 0da42feffc6..00000000000 --- a/pageprojectdeploymentretry.go +++ /dev/null @@ -1,256 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// PageProjectDeploymentRetryService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewPageProjectDeploymentRetryService] method instead. -type PageProjectDeploymentRetryService struct { - Options []option.RequestOption -} - -// NewPageProjectDeploymentRetryService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewPageProjectDeploymentRetryService(opts ...option.RequestOption) (r *PageProjectDeploymentRetryService) { - r = &PageProjectDeploymentRetryService{} - r.Options = opts - return -} - -// Retry a previous deployment. -func (r *PageProjectDeploymentRetryService) PagesDeploymentRetryDeployment(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse, err error) { - opts = append(r.Options[:], opts...) - var env PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", accountID, projectName, deploymentID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse struct { - // Id of the deployment. - ID string `json:"id"` - // A list of alias URLs pointing to this deployment. - Aliases []interface{} `json:"aliases,nullable"` - BuildConfig interface{} `json:"build_config"` - // When the deployment was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // Info about what caused the deployment. - DeploymentTrigger PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTrigger `json:"deployment_trigger"` - // A dict of env variables to build this deploy. - EnvVars interface{} `json:"env_vars"` - // Type of deploy. - Environment string `json:"environment"` - // If the deployment has been skipped. - IsSkipped bool `json:"is_skipped"` - LatestStage interface{} `json:"latest_stage"` - // When the deployment was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // Id of the project. - ProjectID string `json:"project_id"` - // Name of the project. - ProjectName string `json:"project_name"` - // Short Id (8 character) of the deployment. - ShortID string `json:"short_id"` - Source interface{} `json:"source"` - // List of past stages. - Stages []PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStage `json:"stages"` - // The live URL to view this deployment. - URL string `json:"url"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseJSON contains -// the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseJSON struct { - ID apijson.Field - Aliases apijson.Field - BuildConfig apijson.Field - CreatedOn apijson.Field - DeploymentTrigger apijson.Field - EnvVars apijson.Field - Environment apijson.Field - IsSkipped apijson.Field - LatestStage apijson.Field - ModifiedOn apijson.Field - ProjectID apijson.Field - ProjectName apijson.Field - ShortID apijson.Field - Source apijson.Field - Stages apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Info about what caused the deployment. -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTrigger struct { - // Additional info about the trigger. - Metadata PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadata `json:"metadata"` - // What caused the deployment. - Type string `json:"type"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTrigger] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerJSON struct { - Metadata apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Additional info about the trigger. -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadata struct { - // Where the trigger happened. - Branch string `json:"branch"` - // Hash of the deployment trigger commit. - CommitHash string `json:"commit_hash"` - // Message of the deployment trigger commit. - CommitMessage string `json:"commit_message"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadataJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadataJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadata] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadataJSON struct { - Branch apijson.Field - CommitHash apijson.Field - CommitMessage apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The status of the deployment. -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStage struct { - // When the stage ended. - EndedOn time.Time `json:"ended_on,nullable" format:"date-time"` - // The current build stage. - Name string `json:"name"` - // When the stage started. - StartedOn time.Time `json:"started_on,nullable" format:"date-time"` - // State of the current stage. - Status string `json:"status"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStageJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStageJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStage] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStageJSON struct { - EndedOn apijson.Field - Name apijson.Field - StartedOn apijson.Field - Status apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseStage) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelope struct { - Errors []PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponse `json:"result,required"` - // Whether the API call was successful - Success PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelope] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrorsJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrors] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessagesJSON `json:"-"` -} - -// pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessages] -type pageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeSuccess bool - -const ( - PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeSuccessTrue PageProjectDeploymentRetryPagesDeploymentRetryDeploymentResponseEnvelopeSuccess = true -) diff --git a/pageprojectdeploymentretry_test.go b/pageprojectdeploymentretry_test.go deleted file mode 100644 index d7533473258..00000000000 --- a/pageprojectdeploymentretry_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestPageProjectDeploymentRetryPagesDeploymentRetryDeployment(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Pages.Projects.Deployments.Retries.PagesDeploymentRetryDeployment( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "this-is-my-project-01", - "023e105f4ecef8ad9ca31a8372d0c353", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/pageprojectdeploymentrollback.go b/pageprojectdeploymentrollback.go deleted file mode 100644 index f1a99b3a926..00000000000 --- a/pageprojectdeploymentrollback.go +++ /dev/null @@ -1,257 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// PageProjectDeploymentRollbackService contains methods and other services that -// help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewPageProjectDeploymentRollbackService] method instead. -type PageProjectDeploymentRollbackService struct { - Options []option.RequestOption -} - -// NewPageProjectDeploymentRollbackService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewPageProjectDeploymentRollbackService(opts ...option.RequestOption) (r *PageProjectDeploymentRollbackService) { - r = &PageProjectDeploymentRollbackService{} - r.Options = opts - return -} - -// Rollback the production deployment to a previous deployment. You can only -// rollback to succesful builds on production. -func (r *PageProjectDeploymentRollbackService) PagesDeploymentRollbackDeployment(ctx context.Context, accountID string, projectName string, deploymentID string, opts ...option.RequestOption) (res *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse, err error) { - opts = append(r.Options[:], opts...) - var env PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", accountID, projectName, deploymentID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse struct { - // Id of the deployment. - ID string `json:"id"` - // A list of alias URLs pointing to this deployment. - Aliases []interface{} `json:"aliases,nullable"` - BuildConfig interface{} `json:"build_config"` - // When the deployment was created. - CreatedOn time.Time `json:"created_on" format:"date-time"` - // Info about what caused the deployment. - DeploymentTrigger PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTrigger `json:"deployment_trigger"` - // A dict of env variables to build this deploy. - EnvVars interface{} `json:"env_vars"` - // Type of deploy. - Environment string `json:"environment"` - // If the deployment has been skipped. - IsSkipped bool `json:"is_skipped"` - LatestStage interface{} `json:"latest_stage"` - // When the deployment was last modified. - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // Id of the project. - ProjectID string `json:"project_id"` - // Name of the project. - ProjectName string `json:"project_name"` - // Short Id (8 character) of the deployment. - ShortID string `json:"short_id"` - Source interface{} `json:"source"` - // List of past stages. - Stages []PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStage `json:"stages"` - // The live URL to view this deployment. - URL string `json:"url"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseJSON struct { - ID apijson.Field - Aliases apijson.Field - BuildConfig apijson.Field - CreatedOn apijson.Field - DeploymentTrigger apijson.Field - EnvVars apijson.Field - Environment apijson.Field - IsSkipped apijson.Field - LatestStage apijson.Field - ModifiedOn apijson.Field - ProjectID apijson.Field - ProjectName apijson.Field - ShortID apijson.Field - Source apijson.Field - Stages apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Info about what caused the deployment. -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTrigger struct { - // Additional info about the trigger. - Metadata PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadata `json:"metadata"` - // What caused the deployment. - Type string `json:"type"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTrigger] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerJSON struct { - Metadata apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Additional info about the trigger. -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadata struct { - // Where the trigger happened. - Branch string `json:"branch"` - // Hash of the deployment trigger commit. - CommitHash string `json:"commit_hash"` - // Message of the deployment trigger commit. - CommitMessage string `json:"commit_message"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadataJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadataJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadata] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadataJSON struct { - Branch apijson.Field - CommitHash apijson.Field - CommitMessage apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The status of the deployment. -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStage struct { - // When the stage ended. - EndedOn time.Time `json:"ended_on,nullable" format:"date-time"` - // The current build stage. - Name string `json:"name"` - // When the stage started. - StartedOn time.Time `json:"started_on,nullable" format:"date-time"` - // State of the current stage. - Status string `json:"status"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStageJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStageJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStage] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStageJSON struct { - EndedOn apijson.Field - Name apijson.Field - StartedOn apijson.Field - Status apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseStage) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelope struct { - Errors []PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponse `json:"result,required"` - // Whether the API call was successful - Success PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelope] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrorsJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrors] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessagesJSON `json:"-"` -} - -// pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessages] -type pageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeSuccess bool - -const ( - PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeSuccessTrue PageProjectDeploymentRollbackPagesDeploymentRollbackDeploymentResponseEnvelopeSuccess = true -) diff --git a/pageprojectdeploymentrollback_test.go b/pageprojectdeploymentrollback_test.go deleted file mode 100644 index 9a2b2c929a6..00000000000 --- a/pageprojectdeploymentrollback_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestPageProjectDeploymentRollbackPagesDeploymentRollbackDeployment(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Pages.Projects.Deployments.Rollbacks.PagesDeploymentRollbackDeployment( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "this-is-my-project-01", - "023e105f4ecef8ad9ca31a8372d0c353", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/pageprojectdomain.go b/pageprojectdomain.go index 00002439ffb..0098b8dc7e4 100644 --- a/pageprojectdomain.go +++ b/pageprojectdomain.go @@ -34,6 +34,19 @@ func NewPageProjectDomainService(opts ...option.RequestOption) (r *PageProjectDo return } +// Add a new domain for the Pages project. +func (r *PageProjectDomainService) New(ctx context.Context, accountID string, projectName string, body PageProjectDomainNewParams, opts ...option.RequestOption) (res *PageProjectDomainNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env PageProjectDomainNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", accountID, projectName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Retry the validation status of a single domain. func (r *PageProjectDomainService) Update(ctx context.Context, accountID string, projectName string, domainName string, opts ...option.RequestOption) (res *PageProjectDomainUpdateResponse, err error) { opts = append(r.Options[:], opts...) @@ -47,6 +60,19 @@ func (r *PageProjectDomainService) Update(ctx context.Context, accountID string, return } +// Fetch a list of all domains associated with a Pages project. +func (r *PageProjectDomainService) List(ctx context.Context, accountID string, projectName string, opts ...option.RequestOption) (res *[]PageProjectDomainListResponse, err error) { + opts = append(r.Options[:], opts...) + var env PageProjectDomainListResponseEnvelope + path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", accountID, projectName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Delete a Pages project's domain. func (r *PageProjectDomainService) Delete(ctx context.Context, accountID string, projectName string, domainName string, opts ...option.RequestOption) (res *PageProjectDomainDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -68,32 +94,27 @@ func (r *PageProjectDomainService) Get(ctx context.Context, accountID string, pr return } -// Add a new domain for the Pages project. -func (r *PageProjectDomainService) PagesDomainsAddDomain(ctx context.Context, accountID string, projectName string, body PageProjectDomainPagesDomainsAddDomainParams, opts ...option.RequestOption) (res *PageProjectDomainPagesDomainsAddDomainResponse, err error) { - opts = append(r.Options[:], opts...) - var env PageProjectDomainPagesDomainsAddDomainResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", accountID, projectName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +// Union satisfied by [PageProjectDomainNewResponseUnknown], +// [PageProjectDomainNewResponseArray] or [shared.UnionString]. +type PageProjectDomainNewResponse interface { + ImplementsPageProjectDomainNewResponse() } -// Fetch a list of all domains associated with a Pages project. -func (r *PageProjectDomainService) PagesDomainsGetDomains(ctx context.Context, accountID string, projectName string, opts ...option.RequestOption) (res *[]PageProjectDomainPagesDomainsGetDomainsResponse, err error) { - opts = append(r.Options[:], opts...) - var env PageProjectDomainPagesDomainsGetDomainsResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", accountID, projectName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*PageProjectDomainNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } +type PageProjectDomainNewResponseArray []interface{} + +func (r PageProjectDomainNewResponseArray) ImplementsPageProjectDomainNewResponse() {} + // Union satisfied by [PageProjectDomainUpdateResponseUnknown], // [PageProjectDomainUpdateResponseArray] or [shared.UnionString]. type PageProjectDomainUpdateResponse interface { @@ -115,6 +136,8 @@ type PageProjectDomainUpdateResponseArray []interface{} func (r PageProjectDomainUpdateResponseArray) ImplementsPageProjectDomainUpdateResponse() {} +type PageProjectDomainListResponse = interface{} + type PageProjectDomainDeleteResponse = interface{} // Union satisfied by [PageProjectDomainGetResponseUnknown], @@ -138,42 +161,26 @@ type PageProjectDomainGetResponseArray []interface{} func (r PageProjectDomainGetResponseArray) ImplementsPageProjectDomainGetResponse() {} -// Union satisfied by [PageProjectDomainPagesDomainsAddDomainResponseUnknown], -// [PageProjectDomainPagesDomainsAddDomainResponseArray] or [shared.UnionString]. -type PageProjectDomainPagesDomainsAddDomainResponse interface { - ImplementsPageProjectDomainPagesDomainsAddDomainResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*PageProjectDomainPagesDomainsAddDomainResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +type PageProjectDomainNewParams struct { + Body param.Field[interface{}] `json:"body,required"` } -type PageProjectDomainPagesDomainsAddDomainResponseArray []interface{} - -func (r PageProjectDomainPagesDomainsAddDomainResponseArray) ImplementsPageProjectDomainPagesDomainsAddDomainResponse() { +func (r PageProjectDomainNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } -type PageProjectDomainPagesDomainsGetDomainsResponse = interface{} - -type PageProjectDomainUpdateResponseEnvelope struct { - Errors []PageProjectDomainUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDomainUpdateResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDomainUpdateResponse `json:"result,required,nullable"` +type PageProjectDomainNewResponseEnvelope struct { + Errors []PageProjectDomainNewResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDomainNewResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDomainNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PageProjectDomainUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDomainUpdateResponseEnvelopeJSON `json:"-"` + Success PageProjectDomainNewResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDomainNewResponseEnvelopeJSON `json:"-"` } -// pageProjectDomainUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [PageProjectDomainUpdateResponseEnvelope] -type pageProjectDomainUpdateResponseEnvelopeJSON struct { +// pageProjectDomainNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageProjectDomainNewResponseEnvelope] +type pageProjectDomainNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -182,67 +189,67 @@ type pageProjectDomainUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainUpdateResponseEnvelopeErrorsJSON `json:"-"` +type PageProjectDomainNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainNewResponseEnvelopeErrorsJSON `json:"-"` } -// pageProjectDomainUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [PageProjectDomainUpdateResponseEnvelopeErrors] -type pageProjectDomainUpdateResponseEnvelopeErrorsJSON struct { +// pageProjectDomainNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PageProjectDomainNewResponseEnvelopeErrors] +type pageProjectDomainNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainUpdateResponseEnvelopeMessagesJSON `json:"-"` +type PageProjectDomainNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainNewResponseEnvelopeMessagesJSON `json:"-"` } -// pageProjectDomainUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [PageProjectDomainUpdateResponseEnvelopeMessages] -type pageProjectDomainUpdateResponseEnvelopeMessagesJSON struct { +// pageProjectDomainNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PageProjectDomainNewResponseEnvelopeMessages] +type pageProjectDomainNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageProjectDomainUpdateResponseEnvelopeSuccess bool +type PageProjectDomainNewResponseEnvelopeSuccess bool const ( - PageProjectDomainUpdateResponseEnvelopeSuccessTrue PageProjectDomainUpdateResponseEnvelopeSuccess = true + PageProjectDomainNewResponseEnvelopeSuccessTrue PageProjectDomainNewResponseEnvelopeSuccess = true ) -type PageProjectDomainGetResponseEnvelope struct { - Errors []PageProjectDomainGetResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDomainGetResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDomainGetResponse `json:"result,required,nullable"` +type PageProjectDomainUpdateResponseEnvelope struct { + Errors []PageProjectDomainUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDomainUpdateResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDomainUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PageProjectDomainGetResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDomainGetResponseEnvelopeJSON `json:"-"` + Success PageProjectDomainUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDomainUpdateResponseEnvelopeJSON `json:"-"` } -// pageProjectDomainGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [PageProjectDomainGetResponseEnvelope] -type pageProjectDomainGetResponseEnvelopeJSON struct { +// pageProjectDomainUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageProjectDomainUpdateResponseEnvelope] +type pageProjectDomainUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -251,228 +258,214 @@ type pageProjectDomainGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainGetResponseEnvelopeErrorsJSON `json:"-"` +type PageProjectDomainUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// pageProjectDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [PageProjectDomainGetResponseEnvelopeErrors] -type pageProjectDomainGetResponseEnvelopeErrorsJSON struct { +// pageProjectDomainUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PageProjectDomainUpdateResponseEnvelopeErrors] +type pageProjectDomainUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainGetResponseEnvelopeMessagesJSON `json:"-"` +type PageProjectDomainUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// pageProjectDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [PageProjectDomainGetResponseEnvelopeMessages] -type pageProjectDomainGetResponseEnvelopeMessagesJSON struct { +// pageProjectDomainUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [PageProjectDomainUpdateResponseEnvelopeMessages] +type pageProjectDomainUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageProjectDomainGetResponseEnvelopeSuccess bool +type PageProjectDomainUpdateResponseEnvelopeSuccess bool const ( - PageProjectDomainGetResponseEnvelopeSuccessTrue PageProjectDomainGetResponseEnvelopeSuccess = true + PageProjectDomainUpdateResponseEnvelopeSuccessTrue PageProjectDomainUpdateResponseEnvelopeSuccess = true ) -type PageProjectDomainPagesDomainsAddDomainParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r PageProjectDomainPagesDomainsAddDomainParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type PageProjectDomainPagesDomainsAddDomainResponseEnvelope struct { - Errors []PageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessages `json:"messages,required"` - Result PageProjectDomainPagesDomainsAddDomainResponse `json:"result,required,nullable"` +type PageProjectDomainListResponseEnvelope struct { + Errors []PageProjectDomainListResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDomainListResponseEnvelopeMessages `json:"messages,required"` + Result []PageProjectDomainListResponse `json:"result,required"` // Whether the API call was successful - Success PageProjectDomainPagesDomainsAddDomainResponseEnvelopeSuccess `json:"success,required"` - JSON pageProjectDomainPagesDomainsAddDomainResponseEnvelopeJSON `json:"-"` + Success PageProjectDomainListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo PageProjectDomainListResponseEnvelopeResultInfo `json:"result_info"` + JSON pageProjectDomainListResponseEnvelopeJSON `json:"-"` } -// pageProjectDomainPagesDomainsAddDomainResponseEnvelopeJSON contains the JSON -// metadata for the struct [PageProjectDomainPagesDomainsAddDomainResponseEnvelope] -type pageProjectDomainPagesDomainsAddDomainResponseEnvelopeJSON struct { +// pageProjectDomainListResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageProjectDomainListResponseEnvelope] +type pageProjectDomainListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsAddDomainResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrorsJSON `json:"-"` +type PageProjectDomainListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainListResponseEnvelopeErrorsJSON `json:"-"` } -// pageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [PageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrors] -type pageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrorsJSON struct { +// pageProjectDomainListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PageProjectDomainListResponseEnvelopeErrors] +type pageProjectDomainListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsAddDomainResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessagesJSON `json:"-"` +type PageProjectDomainListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainListResponseEnvelopeMessagesJSON `json:"-"` } -// pageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [PageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessages] -type pageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessagesJSON struct { +// pageProjectDomainListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PageProjectDomainListResponseEnvelopeMessages] +type pageProjectDomainListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsAddDomainResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageProjectDomainPagesDomainsAddDomainResponseEnvelopeSuccess bool +type PageProjectDomainListResponseEnvelopeSuccess bool const ( - PageProjectDomainPagesDomainsAddDomainResponseEnvelopeSuccessTrue PageProjectDomainPagesDomainsAddDomainResponseEnvelopeSuccess = true + PageProjectDomainListResponseEnvelopeSuccessTrue PageProjectDomainListResponseEnvelopeSuccess = true ) -type PageProjectDomainPagesDomainsGetDomainsResponseEnvelope struct { - Errors []PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessages `json:"messages,required"` - Result []PageProjectDomainPagesDomainsGetDomainsResponse `json:"result,required"` +type PageProjectDomainListResponseEnvelopeResultInfo struct { + Count interface{} `json:"count"` + Page interface{} `json:"page"` + PerPage interface{} `json:"per_page"` + TotalCount interface{} `json:"total_count"` + JSON pageProjectDomainListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// pageProjectDomainListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [PageProjectDomainListResponseEnvelopeResultInfo] +type pageProjectDomainListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageProjectDomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageProjectDomainGetResponseEnvelope struct { + Errors []PageProjectDomainGetResponseEnvelopeErrors `json:"errors,required"` + Messages []PageProjectDomainGetResponseEnvelopeMessages `json:"messages,required"` + Result PageProjectDomainGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfo `json:"result_info"` - JSON pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeJSON `json:"-"` + Success PageProjectDomainGetResponseEnvelopeSuccess `json:"success,required"` + JSON pageProjectDomainGetResponseEnvelopeJSON `json:"-"` } -// pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [PageProjectDomainPagesDomainsGetDomainsResponseEnvelope] -type pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeJSON struct { +// pageProjectDomainGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageProjectDomainGetResponseEnvelope] +type pageProjectDomainGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsGetDomainsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrorsJSON `json:"-"` +type PageProjectDomainGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainGetResponseEnvelopeErrorsJSON `json:"-"` } -// pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrors] -type pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrorsJSON struct { +// pageProjectDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PageProjectDomainGetResponseEnvelopeErrors] +type pageProjectDomainGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessagesJSON `json:"-"` +type PageProjectDomainGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageProjectDomainGetResponseEnvelopeMessagesJSON `json:"-"` } -// pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessages] -type pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessagesJSON struct { +// pageProjectDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PageProjectDomainGetResponseEnvelopeMessages] +type pageProjectDomainGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageProjectDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeSuccess bool +type PageProjectDomainGetResponseEnvelopeSuccess bool const ( - PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeSuccessTrue PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeSuccess = true + PageProjectDomainGetResponseEnvelopeSuccessTrue PageProjectDomainGetResponseEnvelopeSuccess = true ) - -type PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfo struct { - Count interface{} `json:"count"` - Page interface{} `json:"page"` - PerPage interface{} `json:"per_page"` - TotalCount interface{} `json:"total_count"` - JSON pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfo] -type pageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageProjectDomainPagesDomainsGetDomainsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/pageprojectdomain_test.go b/pageprojectdomain_test.go index b4b94ddcfb1..7d6731677f6 100644 --- a/pageprojectdomain_test.go +++ b/pageprojectdomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPageProjectDomainUpdate(t *testing.T) { +func TestPageProjectDomainNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,15 @@ func TestPageProjectDomainUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Domains.Update( + _, err := client.Pages.Projects.Domains.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", - "string", + cloudflare.PageProjectDomainNewParams{ + Body: cloudflare.F[any](map[string]interface{}{ + "name": "example.com", + }), + }, ) if err != nil { var apierr *cloudflare.Error @@ -44,7 +48,7 @@ func TestPageProjectDomainUpdate(t *testing.T) { } } -func TestPageProjectDomainDelete(t *testing.T) { +func TestPageProjectDomainUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,7 +64,7 @@ func TestPageProjectDomainDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Domains.Delete( + _, err := client.Pages.Projects.Domains.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", @@ -75,7 +79,7 @@ func TestPageProjectDomainDelete(t *testing.T) { } } -func TestPageProjectDomainGet(t *testing.T) { +func TestPageProjectDomainList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -91,11 +95,10 @@ func TestPageProjectDomainGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Domains.Get( + _, err := client.Pages.Projects.Domains.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", - "string", ) if err != nil { var apierr *cloudflare.Error @@ -106,7 +109,7 @@ func TestPageProjectDomainGet(t *testing.T) { } } -func TestPageProjectDomainPagesDomainsAddDomain(t *testing.T) { +func TestPageProjectDomainDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,15 +125,11 @@ func TestPageProjectDomainPagesDomainsAddDomain(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Domains.PagesDomainsAddDomain( + _, err := client.Pages.Projects.Domains.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", - cloudflare.PageProjectDomainPagesDomainsAddDomainParams{ - Body: cloudflare.F[any](map[string]interface{}{ - "name": "example.com", - }), - }, + "string", ) if err != nil { var apierr *cloudflare.Error @@ -141,7 +140,7 @@ func TestPageProjectDomainPagesDomainsAddDomain(t *testing.T) { } } -func TestPageProjectDomainPagesDomainsGetDomains(t *testing.T) { +func TestPageProjectDomainGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -157,10 +156,11 @@ func TestPageProjectDomainPagesDomainsGetDomains(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pages.Projects.Domains.PagesDomainsGetDomains( + _, err := client.Pages.Projects.Domains.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is-my-project-01", + "string", ) if err != nil { var apierr *cloudflare.Error diff --git a/pagerule.go b/pagerule.go index 97e6d15bf86..9eab9a8c9c3 100644 --- a/pagerule.go +++ b/pagerule.go @@ -51,20 +51,6 @@ func (r *PageruleService) New(ctx context.Context, zoneID string, body PageruleN return } -// Replaces the configuration of an existing Page Rule. The configuration of the -// updated Page Rule will exactly match the data passed in the API request. -func (r *PageruleService) Update(ctx context.Context, zoneID string, pageruleID string, body PageruleUpdateParams, opts ...option.RequestOption) (res *PageruleUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env PageruleUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/pagerules/%s", zoneID, pageruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetches Page Rules in a zone. func (r *PageruleService) List(ctx context.Context, zoneID string, query PageruleListParams, opts ...option.RequestOption) (res *[]PageruleListResponse, err error) { opts = append(r.Options[:], opts...) @@ -104,6 +90,20 @@ func (r *PageruleService) Get(ctx context.Context, zoneID string, pageruleID str return } +// Replaces the configuration of an existing Page Rule. The configuration of the +// updated Page Rule will exactly match the data passed in the API request. +func (r *PageruleService) Replace(ctx context.Context, zoneID string, pageruleID string, body PageruleReplaceParams, opts ...option.RequestOption) (res *PageruleReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env PageruleReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/pagerules/%s", zoneID, pageruleID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Union satisfied by [PageruleNewResponseUnknown] or [shared.UnionString]. type PageruleNewResponse interface { ImplementsPageruleNewResponse() @@ -120,22 +120,6 @@ func init() { ) } -// Union satisfied by [PageruleUpdateResponseUnknown] or [shared.UnionString]. -type PageruleUpdateResponse interface { - ImplementsPageruleUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*PageruleUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - type PageruleListResponse struct { // Identifier ID string `json:"id,required"` @@ -342,6 +326,22 @@ func init() { ) } +// Union satisfied by [PageruleReplaceResponseUnknown] or [shared.UnionString]. +type PageruleReplaceResponse interface { + ImplementsPageruleReplaceResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*PageruleReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + type PageruleNewParams struct { // The set of actions to perform if the targets of this rule match the request. // Actions can redirect to another URL or override settings, but not both. @@ -519,183 +519,6 @@ const ( PageruleNewResponseEnvelopeSuccessTrue PageruleNewResponseEnvelopeSuccess = true ) -type PageruleUpdateParams struct { - // The set of actions to perform if the targets of this rule match the request. - // Actions can redirect to another URL or override settings, but not both. - Actions param.Field[[]PageruleUpdateParamsAction] `json:"actions,required"` - // The rule targets to evaluate on each request. - Targets param.Field[[]PageruleUpdateParamsTarget] `json:"targets,required"` - // The priority of the rule, used to define which Page Rule is processed over - // another. A higher number indicates a higher priority. For example, if you have a - // catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - // take precedence (rule B: `/images/special/*`), specify a higher priority for - // rule B so it overrides rule A. - Priority param.Field[int64] `json:"priority"` - // The status of the Page Rule. - Status param.Field[PageruleUpdateParamsStatus] `json:"status"` -} - -func (r PageruleUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type PageruleUpdateParamsAction struct { - // The type of route. - Name param.Field[PageruleUpdateParamsActionsName] `json:"name"` - Value param.Field[PageruleUpdateParamsActionsValue] `json:"value"` -} - -func (r PageruleUpdateParamsAction) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The type of route. -type PageruleUpdateParamsActionsName string - -const ( - PageruleUpdateParamsActionsNameForwardURL PageruleUpdateParamsActionsName = "forward_url" -) - -type PageruleUpdateParamsActionsValue struct { - // The response type for the URL redirect. - Type param.Field[PageruleUpdateParamsActionsValueType] `json:"type"` - // The URL to redirect the request to. Notes: ${num} refers to the position of '\*' - // in the constraint value. - URL param.Field[string] `json:"url"` -} - -func (r PageruleUpdateParamsActionsValue) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The response type for the URL redirect. -type PageruleUpdateParamsActionsValueType string - -const ( - PageruleUpdateParamsActionsValueTypeTemporary PageruleUpdateParamsActionsValueType = "temporary" - PageruleUpdateParamsActionsValueTypePermanent PageruleUpdateParamsActionsValueType = "permanent" -) - -// A request condition target. -type PageruleUpdateParamsTarget struct { - // String constraint. - Constraint param.Field[PageruleUpdateParamsTargetsConstraint] `json:"constraint,required"` - // A target based on the URL of the request. - Target param.Field[PageruleUpdateParamsTargetsTarget] `json:"target,required"` -} - -func (r PageruleUpdateParamsTarget) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// String constraint. -type PageruleUpdateParamsTargetsConstraint struct { - // The matches operator can use asterisks and pipes as wildcard and 'or' operators. - Operator param.Field[PageruleUpdateParamsTargetsConstraintOperator] `json:"operator,required"` - // The URL pattern to match against the current request. The pattern may contain up - // to four asterisks ('\*') as placeholders. - Value param.Field[string] `json:"value,required"` -} - -func (r PageruleUpdateParamsTargetsConstraint) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The matches operator can use asterisks and pipes as wildcard and 'or' operators. -type PageruleUpdateParamsTargetsConstraintOperator string - -const ( - PageruleUpdateParamsTargetsConstraintOperatorMatches PageruleUpdateParamsTargetsConstraintOperator = "matches" - PageruleUpdateParamsTargetsConstraintOperatorContains PageruleUpdateParamsTargetsConstraintOperator = "contains" - PageruleUpdateParamsTargetsConstraintOperatorEquals PageruleUpdateParamsTargetsConstraintOperator = "equals" - PageruleUpdateParamsTargetsConstraintOperatorNotEqual PageruleUpdateParamsTargetsConstraintOperator = "not_equal" - PageruleUpdateParamsTargetsConstraintOperatorNotContain PageruleUpdateParamsTargetsConstraintOperator = "not_contain" -) - -// A target based on the URL of the request. -type PageruleUpdateParamsTargetsTarget string - -const ( - PageruleUpdateParamsTargetsTargetURL PageruleUpdateParamsTargetsTarget = "url" -) - -// The status of the Page Rule. -type PageruleUpdateParamsStatus string - -const ( - PageruleUpdateParamsStatusActive PageruleUpdateParamsStatus = "active" - PageruleUpdateParamsStatusDisabled PageruleUpdateParamsStatus = "disabled" -) - -type PageruleUpdateResponseEnvelope struct { - Errors []PageruleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []PageruleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result PageruleUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success PageruleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON pageruleUpdateResponseEnvelopeJSON `json:"-"` -} - -// pageruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [PageruleUpdateResponseEnvelope] -type pageruleUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageruleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageruleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageruleUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// pageruleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [PageruleUpdateResponseEnvelopeErrors] -type pageruleUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageruleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageruleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageruleUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// pageruleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [PageruleUpdateResponseEnvelopeMessages] -type pageruleUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageruleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PageruleUpdateResponseEnvelopeSuccess bool - -const ( - PageruleUpdateResponseEnvelopeSuccessTrue PageruleUpdateResponseEnvelopeSuccess = true -) - type PageruleListParams struct { // The direction used to sort returned Page Rules. Direction param.Field[PageruleListParamsDirection] `query:"direction"` @@ -955,3 +778,180 @@ type PageruleGetResponseEnvelopeSuccess bool const ( PageruleGetResponseEnvelopeSuccessTrue PageruleGetResponseEnvelopeSuccess = true ) + +type PageruleReplaceParams struct { + // The set of actions to perform if the targets of this rule match the request. + // Actions can redirect to another URL or override settings, but not both. + Actions param.Field[[]PageruleReplaceParamsAction] `json:"actions,required"` + // The rule targets to evaluate on each request. + Targets param.Field[[]PageruleReplaceParamsTarget] `json:"targets,required"` + // The priority of the rule, used to define which Page Rule is processed over + // another. A higher number indicates a higher priority. For example, if you have a + // catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to + // take precedence (rule B: `/images/special/*`), specify a higher priority for + // rule B so it overrides rule A. + Priority param.Field[int64] `json:"priority"` + // The status of the Page Rule. + Status param.Field[PageruleReplaceParamsStatus] `json:"status"` +} + +func (r PageruleReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type PageruleReplaceParamsAction struct { + // The type of route. + Name param.Field[PageruleReplaceParamsActionsName] `json:"name"` + Value param.Field[PageruleReplaceParamsActionsValue] `json:"value"` +} + +func (r PageruleReplaceParamsAction) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The type of route. +type PageruleReplaceParamsActionsName string + +const ( + PageruleReplaceParamsActionsNameForwardURL PageruleReplaceParamsActionsName = "forward_url" +) + +type PageruleReplaceParamsActionsValue struct { + // The response type for the URL redirect. + Type param.Field[PageruleReplaceParamsActionsValueType] `json:"type"` + // The URL to redirect the request to. Notes: ${num} refers to the position of '\*' + // in the constraint value. + URL param.Field[string] `json:"url"` +} + +func (r PageruleReplaceParamsActionsValue) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The response type for the URL redirect. +type PageruleReplaceParamsActionsValueType string + +const ( + PageruleReplaceParamsActionsValueTypeTemporary PageruleReplaceParamsActionsValueType = "temporary" + PageruleReplaceParamsActionsValueTypePermanent PageruleReplaceParamsActionsValueType = "permanent" +) + +// A request condition target. +type PageruleReplaceParamsTarget struct { + // String constraint. + Constraint param.Field[PageruleReplaceParamsTargetsConstraint] `json:"constraint,required"` + // A target based on the URL of the request. + Target param.Field[PageruleReplaceParamsTargetsTarget] `json:"target,required"` +} + +func (r PageruleReplaceParamsTarget) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// String constraint. +type PageruleReplaceParamsTargetsConstraint struct { + // The matches operator can use asterisks and pipes as wildcard and 'or' operators. + Operator param.Field[PageruleReplaceParamsTargetsConstraintOperator] `json:"operator,required"` + // The URL pattern to match against the current request. The pattern may contain up + // to four asterisks ('\*') as placeholders. + Value param.Field[string] `json:"value,required"` +} + +func (r PageruleReplaceParamsTargetsConstraint) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The matches operator can use asterisks and pipes as wildcard and 'or' operators. +type PageruleReplaceParamsTargetsConstraintOperator string + +const ( + PageruleReplaceParamsTargetsConstraintOperatorMatches PageruleReplaceParamsTargetsConstraintOperator = "matches" + PageruleReplaceParamsTargetsConstraintOperatorContains PageruleReplaceParamsTargetsConstraintOperator = "contains" + PageruleReplaceParamsTargetsConstraintOperatorEquals PageruleReplaceParamsTargetsConstraintOperator = "equals" + PageruleReplaceParamsTargetsConstraintOperatorNotEqual PageruleReplaceParamsTargetsConstraintOperator = "not_equal" + PageruleReplaceParamsTargetsConstraintOperatorNotContain PageruleReplaceParamsTargetsConstraintOperator = "not_contain" +) + +// A target based on the URL of the request. +type PageruleReplaceParamsTargetsTarget string + +const ( + PageruleReplaceParamsTargetsTargetURL PageruleReplaceParamsTargetsTarget = "url" +) + +// The status of the Page Rule. +type PageruleReplaceParamsStatus string + +const ( + PageruleReplaceParamsStatusActive PageruleReplaceParamsStatus = "active" + PageruleReplaceParamsStatusDisabled PageruleReplaceParamsStatus = "disabled" +) + +type PageruleReplaceResponseEnvelope struct { + Errors []PageruleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []PageruleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result PageruleReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success PageruleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON pageruleReplaceResponseEnvelopeJSON `json:"-"` +} + +// pageruleReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [PageruleReplaceResponseEnvelope] +type pageruleReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageruleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageruleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageruleReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// pageruleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [PageruleReplaceResponseEnvelopeErrors] +type pageruleReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageruleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PageruleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageruleReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// pageruleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [PageruleReplaceResponseEnvelopeMessages] +type pageruleReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageruleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type PageruleReplaceResponseEnvelopeSuccess bool + +const ( + PageruleReplaceResponseEnvelopeSuccessTrue PageruleReplaceResponseEnvelopeSuccess = true +) diff --git a/pagerule_test.go b/pagerule_test.go index 9cf0b29c90f..3a67d573f7e 100644 --- a/pagerule_test.go +++ b/pagerule_test.go @@ -60,7 +60,7 @@ func TestPageruleNewWithOptionalParams(t *testing.T) { } } -func TestPageruleUpdateWithOptionalParams(t *testing.T) { +func TestPageruleListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -76,27 +76,14 @@ func TestPageruleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pagerules.Update( + _, err := client.Pagerules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PageruleUpdateParams{ - Actions: cloudflare.F([]cloudflare.PageruleUpdateParamsAction{{ - Name: cloudflare.F(cloudflare.PageruleUpdateParamsActionsNameForwardURL), - Value: cloudflare.F(cloudflare.PageruleUpdateParamsActionsValue{ - Type: cloudflare.F(cloudflare.PageruleUpdateParamsActionsValueTypeTemporary), - URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"), - }), - }}), - Targets: cloudflare.F([]cloudflare.PageruleUpdateParamsTarget{{ - Constraint: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsConstraint{ - Operator: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsConstraintOperatorMatches), - Value: cloudflare.F("*example.com/images/*"), - }), - Target: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsTargetURL), - }}), - Priority: cloudflare.F(int64(0)), - Status: cloudflare.F(cloudflare.PageruleUpdateParamsStatusActive), + cloudflare.PageruleListParams{ + Direction: cloudflare.F(cloudflare.PageruleListParamsDirectionDesc), + Match: cloudflare.F(cloudflare.PageruleListParamsMatchAny), + Order: cloudflare.F(cloudflare.PageruleListParamsOrderStatus), + Status: cloudflare.F(cloudflare.PageruleListParamsStatusActive), }, ) if err != nil { @@ -108,7 +95,7 @@ func TestPageruleUpdateWithOptionalParams(t *testing.T) { } } -func TestPageruleListWithOptionalParams(t *testing.T) { +func TestPageruleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,15 +111,10 @@ func TestPageruleListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pagerules.List( + _, err := client.Pagerules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PageruleListParams{ - Direction: cloudflare.F(cloudflare.PageruleListParamsDirectionDesc), - Match: cloudflare.F(cloudflare.PageruleListParamsMatchAny), - Order: cloudflare.F(cloudflare.PageruleListParamsOrderStatus), - Status: cloudflare.F(cloudflare.PageruleListParamsStatusActive), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -143,7 +125,7 @@ func TestPageruleListWithOptionalParams(t *testing.T) { } } -func TestPageruleDelete(t *testing.T) { +func TestPageruleGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -159,7 +141,7 @@ func TestPageruleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pagerules.Delete( + _, err := client.Pagerules.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -173,7 +155,7 @@ func TestPageruleDelete(t *testing.T) { } } -func TestPageruleGet(t *testing.T) { +func TestPageruleReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -189,10 +171,28 @@ func TestPageruleGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pagerules.Get( + _, err := client.Pagerules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.PageruleReplaceParams{ + Actions: cloudflare.F([]cloudflare.PageruleReplaceParamsAction{{ + Name: cloudflare.F(cloudflare.PageruleReplaceParamsActionsNameForwardURL), + Value: cloudflare.F(cloudflare.PageruleReplaceParamsActionsValue{ + Type: cloudflare.F(cloudflare.PageruleReplaceParamsActionsValueTypeTemporary), + URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"), + }), + }}), + Targets: cloudflare.F([]cloudflare.PageruleReplaceParamsTarget{{ + Constraint: cloudflare.F(cloudflare.PageruleReplaceParamsTargetsConstraint{ + Operator: cloudflare.F(cloudflare.PageruleReplaceParamsTargetsConstraintOperatorMatches), + Value: cloudflare.F("*example.com/images/*"), + }), + Target: cloudflare.F(cloudflare.PageruleReplaceParamsTargetsTargetURL), + }}), + Priority: cloudflare.F(int64(0)), + Status: cloudflare.F(cloudflare.PageruleReplaceParamsStatusActive), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/pagerulesetting.go b/pagerulesetting.go index fec14276b6a..a6d060e9159 100644 --- a/pagerulesetting.go +++ b/pagerulesetting.go @@ -32,9 +32,9 @@ func NewPageruleSettingService(opts ...option.RequestOption) (r *PageruleSetting // Returns a list of settings (and their details) that Page Rules can apply to // matching requests. -func (r *PageruleSettingService) AvailablePageRulesSettingsListAvailablePageRulesSettings(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponse, err error) { +func (r *PageruleSettingService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]PageruleSettingListResponse, err error) { opts = append(r.Options[:], opts...) - var env PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelope + var env PageruleSettingListResponseEnvelope path := fmt.Sprintf("zones/%s/pagerules/settings", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -44,22 +44,21 @@ func (r *PageruleSettingService) AvailablePageRulesSettingsListAvailablePageRule return } -type PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponse = interface{} +type PageruleSettingListResponse = interface{} -type PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelope struct { - Errors []PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessages `json:"messages,required"` +type PageruleSettingListResponseEnvelope struct { + Errors []PageruleSettingListResponseEnvelopeErrors `json:"errors,required"` + Messages []PageruleSettingListResponseEnvelopeMessages `json:"messages,required"` // Settings available for the zone. - Result []PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponse `json:"result,required"` + Result []PageruleSettingListResponse `json:"result,required"` // Whether the API call was successful - Success PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeJSON `json:"-"` + Success PageruleSettingListResponseEnvelopeSuccess `json:"success,required"` + JSON pageruleSettingListResponseEnvelopeJSON `json:"-"` } -// pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelope] -type pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeJSON struct { +// pageruleSettingListResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageruleSettingListResponseEnvelope] +type pageruleSettingListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -68,53 +67,51 @@ type pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResp ExtraFields map[string]apijson.Field } -func (r *PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageruleSettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrorsJSON `json:"-"` +type PageruleSettingListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageruleSettingListResponseEnvelopeErrorsJSON `json:"-"` } -// pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrors] -type pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrorsJSON struct { +// pageruleSettingListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [PageruleSettingListResponseEnvelopeErrors] +type pageruleSettingListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageruleSettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessagesJSON `json:"-"` +type PageruleSettingListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageruleSettingListResponseEnvelopeMessagesJSON `json:"-"` } -// pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessages] -type pageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessagesJSON struct { +// pageruleSettingListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PageruleSettingListResponseEnvelopeMessages] +type pageruleSettingListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageruleSettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeSuccess bool +type PageruleSettingListResponseEnvelopeSuccess bool const ( - PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeSuccessTrue PageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettingsResponseEnvelopeSuccess = true + PageruleSettingListResponseEnvelopeSuccessTrue PageruleSettingListResponseEnvelopeSuccess = true ) diff --git a/pagerulesetting_test.go b/pagerulesetting_test.go index 9f32a6439a2..f64ccab2075 100644 --- a/pagerulesetting_test.go +++ b/pagerulesetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettings(t *testing.T) { +func TestPageruleSettingList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestPageruleSettingAvailablePageRulesSettingsListAvailablePageRulesSettings option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pagerules.Settings.AvailablePageRulesSettingsListAvailablePageRulesSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Pagerules.Settings.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/pageshield.go b/pageshield.go index 8f3e4962a4a..43493bf3318 100644 --- a/pageshield.go +++ b/pageshield.go @@ -19,6 +19,7 @@ import ( // service directly, and instead use the [NewPageShieldService] method instead. type PageShieldService struct { Options []option.RequestOption + Policies *PageShieldPolicyService Connections *PageShieldConnectionService Scripts *PageShieldScriptService } @@ -29,6 +30,7 @@ type PageShieldService struct { func NewPageShieldService(opts ...option.RequestOption) (r *PageShieldService) { r = &PageShieldService{} r.Options = opts + r.Policies = NewPageShieldPolicyService(opts...) r.Connections = NewPageShieldConnectionService(opts...) r.Scripts = NewPageShieldScriptService(opts...) return @@ -48,9 +50,9 @@ func (r *PageShieldService) List(ctx context.Context, zoneID string, opts ...opt } // Updates Page Shield settings. -func (r *PageShieldService) PageShieldUpdatePageShieldSettings(ctx context.Context, zoneID string, body PageShieldPageShieldUpdatePageShieldSettingsParams, opts ...option.RequestOption) (res *PageShieldPageShieldUpdatePageShieldSettingsResponse, err error) { +func (r *PageShieldService) Replace(ctx context.Context, zoneID string, body PageShieldReplaceParams, opts ...option.RequestOption) (res *PageShieldReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelope + var env PageShieldReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/page_shield", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -88,7 +90,7 @@ func (r *PageShieldListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldPageShieldUpdatePageShieldSettingsResponse struct { +type PageShieldReplaceResponse struct { // When true, indicates that Page Shield is enabled. Enabled bool `json:"enabled"` // The timestamp of when Page Shield was last updated. @@ -97,13 +99,13 @@ type PageShieldPageShieldUpdatePageShieldSettingsResponse struct { // https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report UseCloudflareReportingEndpoint bool `json:"use_cloudflare_reporting_endpoint"` // When true, the paths associated with connections URLs will also be analyzed. - UseConnectionURLPath bool `json:"use_connection_url_path"` - JSON pageShieldPageShieldUpdatePageShieldSettingsResponseJSON `json:"-"` + UseConnectionURLPath bool `json:"use_connection_url_path"` + JSON pageShieldReplaceResponseJSON `json:"-"` } -// pageShieldPageShieldUpdatePageShieldSettingsResponseJSON contains the JSON -// metadata for the struct [PageShieldPageShieldUpdatePageShieldSettingsResponse] -type pageShieldPageShieldUpdatePageShieldSettingsResponseJSON struct { +// pageShieldReplaceResponseJSON contains the JSON metadata for the struct +// [PageShieldReplaceResponse] +type pageShieldReplaceResponseJSON struct { Enabled apijson.Field UpdatedAt apijson.Field UseCloudflareReportingEndpoint apijson.Field @@ -112,7 +114,7 @@ type pageShieldPageShieldUpdatePageShieldSettingsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *PageShieldPageShieldUpdatePageShieldSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -185,7 +187,7 @@ const ( PageShieldListResponseEnvelopeSuccessTrue PageShieldListResponseEnvelopeSuccess = true ) -type PageShieldPageShieldUpdatePageShieldSettingsParams struct { +type PageShieldReplaceParams struct { // When true, indicates that Page Shield is enabled. Enabled param.Field[bool] `json:"enabled"` // When true, CSP reports will be sent to @@ -195,23 +197,22 @@ type PageShieldPageShieldUpdatePageShieldSettingsParams struct { UseConnectionURLPath param.Field[bool] `json:"use_connection_url_path"` } -func (r PageShieldPageShieldUpdatePageShieldSettingsParams) MarshalJSON() (data []byte, err error) { +func (r PageShieldReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelope struct { - Errors []PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessages `json:"messages,required"` - Result PageShieldPageShieldUpdatePageShieldSettingsResponse `json:"result,required"` +type PageShieldReplaceResponseEnvelope struct { + Errors []PageShieldReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []PageShieldReplaceResponseEnvelopeMessages `json:"messages,required"` + Result PageShieldReplaceResponse `json:"result,required"` // Whether the API call was successful - Success PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeJSON `json:"-"` + Success PageShieldReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON pageShieldReplaceResponseEnvelopeJSON `json:"-"` } -// pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelope] -type pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeJSON struct { +// pageShieldReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [PageShieldReplaceResponseEnvelope] +type pageShieldReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -220,53 +221,51 @@ type pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrorsJSON `json:"-"` +type PageShieldReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrors] -type pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrorsJSON struct { +// pageShieldReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [PageShieldReplaceResponseEnvelopeErrors] +type pageShieldReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessagesJSON `json:"-"` +type PageShieldReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessages] -type pageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessagesJSON struct { +// pageShieldReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [PageShieldReplaceResponseEnvelopeMessages] +type pageShieldReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeSuccess bool +type PageShieldReplaceResponseEnvelopeSuccess bool const ( - PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeSuccessTrue PageShieldPageShieldUpdatePageShieldSettingsResponseEnvelopeSuccess = true + PageShieldReplaceResponseEnvelopeSuccessTrue PageShieldReplaceResponseEnvelopeSuccess = true ) diff --git a/pageshield_test.go b/pageshield_test.go index b144a273eb1..3bcf9bc2f38 100644 --- a/pageshield_test.go +++ b/pageshield_test.go @@ -29,7 +29,7 @@ func TestPageShieldList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.PageShield.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestPageShieldList(t *testing.T) { } } -func TestPageShieldPageShieldUpdatePageShieldSettingsWithOptionalParams(t *testing.T) { +func TestPageShieldReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestPageShieldPageShieldUpdatePageShieldSettingsWithOptionalParams(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.PageShieldUpdatePageShieldSettings( + _, err := client.PageShield.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PageShieldPageShieldUpdatePageShieldSettingsParams{ + cloudflare.PageShieldReplaceParams{ Enabled: cloudflare.F(true), UseCloudflareReportingEndpoint: cloudflare.F(true), UseConnectionURLPath: cloudflare.F(true), diff --git a/pageshieldconnection.go b/pageshieldconnection.go index 28e6bbc0fc7..9ba30c00797 100644 --- a/pageshieldconnection.go +++ b/pageshieldconnection.go @@ -33,18 +33,10 @@ func NewPageShieldConnectionService(opts ...option.RequestOption) (r *PageShield return } -// Fetches a connection detected by Page Shield by connection ID. -func (r *PageShieldConnectionService) Get(ctx context.Context, zoneID string, connectionID string, opts ...option.RequestOption) (res *PageShieldConnectionGetResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/page_shield/connections/%s", zoneID, connectionID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) - return -} - // Lists all connections detected by Page Shield. -func (r *PageShieldConnectionService) PageShieldListPageShieldConnections(ctx context.Context, zoneID string, query PageShieldConnectionPageShieldListPageShieldConnectionsParams, opts ...option.RequestOption) (res *[]PageShieldConnectionPageShieldListPageShieldConnectionsResponse, err error) { +func (r *PageShieldConnectionService) List(ctx context.Context, zoneID string, query PageShieldConnectionListParams, opts ...option.RequestOption) (res *[]PageShieldConnectionListResponse, err error) { opts = append(r.Options[:], opts...) - var env PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelope + var env PageShieldConnectionListResponseEnvelope path := fmt.Sprintf("zones/%s/page_shield/connections", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -54,23 +46,31 @@ func (r *PageShieldConnectionService) PageShieldListPageShieldConnections(ctx co return } -type PageShieldConnectionGetResponse struct { - ID interface{} `json:"id"` - AddedAt interface{} `json:"added_at"` - DomainReportedMalicious interface{} `json:"domain_reported_malicious"` - FirstPageURL interface{} `json:"first_page_url"` - FirstSeenAt interface{} `json:"first_seen_at"` - Host interface{} `json:"host"` - LastSeenAt interface{} `json:"last_seen_at"` - PageURLs interface{} `json:"page_urls"` - URL interface{} `json:"url"` - URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` - JSON pageShieldConnectionGetResponseJSON `json:"-"` +// Fetches a connection detected by Page Shield by connection ID. +func (r *PageShieldConnectionService) Get(ctx context.Context, zoneID string, connectionID string, opts ...option.RequestOption) (res *PageShieldConnectionGetResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("zones/%s/page_shield/connections/%s", zoneID, connectionID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) + return } -// pageShieldConnectionGetResponseJSON contains the JSON metadata for the struct -// [PageShieldConnectionGetResponse] -type pageShieldConnectionGetResponseJSON struct { +type PageShieldConnectionListResponse struct { + ID interface{} `json:"id"` + AddedAt interface{} `json:"added_at"` + DomainReportedMalicious interface{} `json:"domain_reported_malicious"` + FirstPageURL interface{} `json:"first_page_url"` + FirstSeenAt interface{} `json:"first_seen_at"` + Host interface{} `json:"host"` + LastSeenAt interface{} `json:"last_seen_at"` + PageURLs interface{} `json:"page_urls"` + URL interface{} `json:"url"` + URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` + JSON pageShieldConnectionListResponseJSON `json:"-"` +} + +// pageShieldConnectionListResponseJSON contains the JSON metadata for the struct +// [PageShieldConnectionListResponse] +type pageShieldConnectionListResponseJSON struct { ID apijson.Field AddedAt apijson.Field DomainReportedMalicious apijson.Field @@ -85,28 +85,27 @@ type pageShieldConnectionGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldConnectionPageShieldListPageShieldConnectionsResponse struct { - ID interface{} `json:"id"` - AddedAt interface{} `json:"added_at"` - DomainReportedMalicious interface{} `json:"domain_reported_malicious"` - FirstPageURL interface{} `json:"first_page_url"` - FirstSeenAt interface{} `json:"first_seen_at"` - Host interface{} `json:"host"` - LastSeenAt interface{} `json:"last_seen_at"` - PageURLs interface{} `json:"page_urls"` - URL interface{} `json:"url"` - URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` - JSON pageShieldConnectionPageShieldListPageShieldConnectionsResponseJSON `json:"-"` +type PageShieldConnectionGetResponse struct { + ID interface{} `json:"id"` + AddedAt interface{} `json:"added_at"` + DomainReportedMalicious interface{} `json:"domain_reported_malicious"` + FirstPageURL interface{} `json:"first_page_url"` + FirstSeenAt interface{} `json:"first_seen_at"` + Host interface{} `json:"host"` + LastSeenAt interface{} `json:"last_seen_at"` + PageURLs interface{} `json:"page_urls"` + URL interface{} `json:"url"` + URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` + JSON pageShieldConnectionGetResponseJSON `json:"-"` } -// pageShieldConnectionPageShieldListPageShieldConnectionsResponseJSON contains the -// JSON metadata for the struct -// [PageShieldConnectionPageShieldListPageShieldConnectionsResponse] -type pageShieldConnectionPageShieldListPageShieldConnectionsResponseJSON struct { +// pageShieldConnectionGetResponseJSON contains the JSON metadata for the struct +// [PageShieldConnectionGetResponse] +type pageShieldConnectionGetResponseJSON struct { ID apijson.Field AddedAt apijson.Field DomainReportedMalicious apijson.Field @@ -121,13 +120,13 @@ type pageShieldConnectionPageShieldListPageShieldConnectionsResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionPageShieldListPageShieldConnectionsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldConnectionPageShieldListPageShieldConnectionsParams struct { +type PageShieldConnectionListParams struct { // The direction used to sort returned connections. - Direction param.Field[PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirection] `query:"direction"` + Direction param.Field[PageShieldConnectionListParamsDirection] `query:"direction"` // When true, excludes connections seen in a `/cdn-cgi` path from the returned // connections. The default value is true. ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"` @@ -136,7 +135,7 @@ type PageShieldConnectionPageShieldListPageShieldConnectionsParams struct { ExcludeURLs param.Field[string] `query:"exclude_urls"` // Export the list of connections as a file. Cannot be used with per_page or page // options. - Export param.Field[PageShieldConnectionPageShieldListPageShieldConnectionsParamsExport] `query:"export"` + Export param.Field[PageShieldConnectionListParamsExport] `query:"export"` // Includes connections that match one or more URL-encoded hostnames separated by // commas. // @@ -145,7 +144,7 @@ type PageShieldConnectionPageShieldListPageShieldConnectionsParams struct { // by exact match Hosts param.Field[string] `query:"hosts"` // The field used to sort returned connections. - OrderBy param.Field[PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderBy] `query:"order_by"` + OrderBy param.Field[PageShieldConnectionListParamsOrderBy] `query:"order_by"` // The current page number of the paginated results. // // We additionally support a special value "all". When "all" is used, the API will @@ -174,10 +173,9 @@ type PageShieldConnectionPageShieldListPageShieldConnectionsParams struct { URLs param.Field[string] `query:"urls"` } -// URLQuery serializes -// [PageShieldConnectionPageShieldListPageShieldConnectionsParams]'s query -// parameters as `url.Values`. -func (r PageShieldConnectionPageShieldListPageShieldConnectionsParams) URLQuery() (v url.Values) { +// URLQuery serializes [PageShieldConnectionListParams]'s query parameters as +// `url.Values`. +func (r PageShieldConnectionListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -185,43 +183,42 @@ func (r PageShieldConnectionPageShieldListPageShieldConnectionsParams) URLQuery( } // The direction used to sort returned connections. -type PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirection string +type PageShieldConnectionListParamsDirection string const ( - PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirectionAsc PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirection = "asc" - PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirectionDesc PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirection = "desc" + PageShieldConnectionListParamsDirectionAsc PageShieldConnectionListParamsDirection = "asc" + PageShieldConnectionListParamsDirectionDesc PageShieldConnectionListParamsDirection = "desc" ) // Export the list of connections as a file. Cannot be used with per_page or page // options. -type PageShieldConnectionPageShieldListPageShieldConnectionsParamsExport string +type PageShieldConnectionListParamsExport string const ( - PageShieldConnectionPageShieldListPageShieldConnectionsParamsExportCsv PageShieldConnectionPageShieldListPageShieldConnectionsParamsExport = "csv" + PageShieldConnectionListParamsExportCsv PageShieldConnectionListParamsExport = "csv" ) // The field used to sort returned connections. -type PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderBy string +type PageShieldConnectionListParamsOrderBy string const ( - PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderByFirstSeenAt PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderBy = "first_seen_at" - PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderByLastSeenAt PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderBy = "last_seen_at" + PageShieldConnectionListParamsOrderByFirstSeenAt PageShieldConnectionListParamsOrderBy = "first_seen_at" + PageShieldConnectionListParamsOrderByLastSeenAt PageShieldConnectionListParamsOrderBy = "last_seen_at" ) -type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelope struct { - Errors []PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessages `json:"messages,required"` - Result []PageShieldConnectionPageShieldListPageShieldConnectionsResponse `json:"result,required,nullable"` +type PageShieldConnectionListResponseEnvelope struct { + Errors []PageShieldConnectionListResponseEnvelopeErrors `json:"errors,required"` + Messages []PageShieldConnectionListResponseEnvelopeMessages `json:"messages,required"` + Result []PageShieldConnectionListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfo `json:"result_info"` - JSON pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeJSON `json:"-"` + Success PageShieldConnectionListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo PageShieldConnectionListResponseEnvelopeResultInfo `json:"result_info"` + JSON pageShieldConnectionListResponseEnvelopeJSON `json:"-"` } -// pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelope] -type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeJSON struct { +// pageShieldConnectionListResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageShieldConnectionListResponseEnvelope] +type pageShieldConnectionListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -231,58 +228,56 @@ type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrorsJSON `json:"-"` +type PageShieldConnectionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldConnectionListResponseEnvelopeErrorsJSON `json:"-"` } -// pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrors] -type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrorsJSON struct { +// pageShieldConnectionListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [PageShieldConnectionListResponseEnvelopeErrors] +type pageShieldConnectionListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessagesJSON `json:"-"` +type PageShieldConnectionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldConnectionListResponseEnvelopeMessagesJSON `json:"-"` } -// pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessages] -type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessagesJSON struct { +// pageShieldConnectionListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [PageShieldConnectionListResponseEnvelopeMessages] +type pageShieldConnectionListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeSuccess bool +type PageShieldConnectionListResponseEnvelopeSuccess bool const ( - PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeSuccessTrue PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeSuccess = true + PageShieldConnectionListResponseEnvelopeSuccessTrue PageShieldConnectionListResponseEnvelopeSuccess = true ) -type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfo struct { +type PageShieldConnectionListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -290,14 +285,13 @@ type PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResu // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON pageShieldConnectionListResponseEnvelopeResultInfoJSON `json:"-"` } -// pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfo] -type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfoJSON struct { +// pageShieldConnectionListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [PageShieldConnectionListResponseEnvelopeResultInfo] +type pageShieldConnectionListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -306,6 +300,6 @@ type pageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResu ExtraFields map[string]apijson.Field } -func (r *PageShieldConnectionPageShieldListPageShieldConnectionsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldConnectionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/pageshieldconnection_test.go b/pageshieldconnection_test.go index 0cdc2a1d992..b7570a0b3fc 100644 --- a/pageshieldconnection_test.go +++ b/pageshieldconnection_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPageShieldConnectionGet(t *testing.T) { +func TestPageShieldConnectionListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,23 @@ func TestPageShieldConnectionGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.Connections.Get( + _, err := client.PageShield.Connections.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "c9ef84a6bf5e47138c75d95e2f933e8f", + cloudflare.PageShieldConnectionListParams{ + Direction: cloudflare.F(cloudflare.PageShieldConnectionListParamsDirectionAsc), + ExcludeCdnCgi: cloudflare.F(true), + ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"), + Export: cloudflare.F(cloudflare.PageShieldConnectionListParamsExportCsv), + Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"), + OrderBy: cloudflare.F(cloudflare.PageShieldConnectionListParamsOrderByFirstSeenAt), + Page: cloudflare.F("string"), + PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"), + PerPage: cloudflare.F(100.000000), + PrioritizeMalicious: cloudflare.F(true), + Status: cloudflare.F("active,inactive"), + URLs: cloudflare.F("blog.cloudflare.com,www.example"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +56,7 @@ func TestPageShieldConnectionGet(t *testing.T) { } } -func TestPageShieldConnectionPageShieldListPageShieldConnectionsWithOptionalParams(t *testing.T) { +func TestPageShieldConnectionGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,23 +72,10 @@ func TestPageShieldConnectionPageShieldListPageShieldConnectionsWithOptionalPara option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.Connections.PageShieldListPageShieldConnections( + _, err := client.PageShield.Connections.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsParams{ - Direction: cloudflare.F(cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsParamsDirectionAsc), - ExcludeCdnCgi: cloudflare.F(true), - ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"), - Export: cloudflare.F(cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsParamsExportCsv), - Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"), - OrderBy: cloudflare.F(cloudflare.PageShieldConnectionPageShieldListPageShieldConnectionsParamsOrderByFirstSeenAt), - Page: cloudflare.F("string"), - PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"), - PerPage: cloudflare.F(100.000000), - PrioritizeMalicious: cloudflare.F(true), - Status: cloudflare.F("active,inactive"), - URLs: cloudflare.F("blog.cloudflare.com,www.example"), - }, + "c9ef84a6bf5e47138c75d95e2f933e8f", ) if err != nil { var apierr *cloudflare.Error diff --git a/pageshieldpolicy.go b/pageshieldpolicy.go index ad25adbe080..1efb4130055 100644 --- a/pageshieldpolicy.go +++ b/pageshieldpolicy.go @@ -39,14 +39,6 @@ func (r *PageShieldPolicyService) New(ctx context.Context, zoneID string, body P return } -// Update a Page Shield policy by ID. -func (r *PageShieldPolicyService) Update(ctx context.Context, zoneID string, policyID string, body PageShieldPolicyUpdateParams, opts ...option.RequestOption) (res *PageShieldPolicyUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/page_shield/policies/%s", zoneID, policyID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) - return -} - // Lists all Page Shield policies. func (r *PageShieldPolicyService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]PageShieldPolicyListResponse, err error) { opts = append(r.Options[:], opts...) @@ -77,6 +69,14 @@ func (r *PageShieldPolicyService) Get(ctx context.Context, zoneID string, policy return } +// Update a Page Shield policy by ID. +func (r *PageShieldPolicyService) Replace(ctx context.Context, zoneID string, policyID string, body PageShieldPolicyReplaceParams, opts ...option.RequestOption) (res *PageShieldPolicyReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("zones/%s/page_shield/policies/%s", zoneID, policyID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) + return +} + type PageShieldPolicyNewResponse struct { // The ID of the policy ID string `json:"id"` @@ -119,48 +119,6 @@ const ( PageShieldPolicyNewResponseActionLog PageShieldPolicyNewResponseAction = "log" ) -type PageShieldPolicyUpdateResponse struct { - // The ID of the policy - ID string `json:"id"` - // The action to take if the expression matches - Action PageShieldPolicyUpdateResponseAction `json:"action"` - // A description for the policy - Description string `json:"description"` - // Whether the policy is enabled - Enabled bool `json:"enabled"` - // The expression which must match for the policy to be applied, using the - // Cloudflare Firewall rule expression syntax - Expression string `json:"expression"` - // The policy which will be applied - Value string `json:"value"` - JSON pageShieldPolicyUpdateResponseJSON `json:"-"` -} - -// pageShieldPolicyUpdateResponseJSON contains the JSON metadata for the struct -// [PageShieldPolicyUpdateResponse] -type pageShieldPolicyUpdateResponseJSON struct { - ID apijson.Field - Action apijson.Field - Description apijson.Field - Enabled apijson.Field - Expression apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageShieldPolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The action to take if the expression matches -type PageShieldPolicyUpdateResponseAction string - -const ( - PageShieldPolicyUpdateResponseActionAllow PageShieldPolicyUpdateResponseAction = "allow" - PageShieldPolicyUpdateResponseActionLog PageShieldPolicyUpdateResponseAction = "log" -) - type PageShieldPolicyListResponse struct { // The ID of the policy ID string `json:"id"` @@ -245,35 +203,51 @@ const ( PageShieldPolicyGetResponseActionLog PageShieldPolicyGetResponseAction = "log" ) -type PageShieldPolicyNewParams struct { +type PageShieldPolicyReplaceResponse struct { + // The ID of the policy + ID string `json:"id"` // The action to take if the expression matches - Action param.Field[PageShieldPolicyNewParamsAction] `json:"action"` + Action PageShieldPolicyReplaceResponseAction `json:"action"` // A description for the policy - Description param.Field[string] `json:"description"` + Description string `json:"description"` // Whether the policy is enabled - Enabled param.Field[bool] `json:"enabled"` + Enabled bool `json:"enabled"` // The expression which must match for the policy to be applied, using the // Cloudflare Firewall rule expression syntax - Expression param.Field[string] `json:"expression"` + Expression string `json:"expression"` // The policy which will be applied - Value param.Field[string] `json:"value"` + Value string `json:"value"` + JSON pageShieldPolicyReplaceResponseJSON `json:"-"` } -func (r PageShieldPolicyNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// pageShieldPolicyReplaceResponseJSON contains the JSON metadata for the struct +// [PageShieldPolicyReplaceResponse] +type pageShieldPolicyReplaceResponseJSON struct { + ID apijson.Field + Action apijson.Field + Description apijson.Field + Enabled apijson.Field + Expression apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageShieldPolicyReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } // The action to take if the expression matches -type PageShieldPolicyNewParamsAction string +type PageShieldPolicyReplaceResponseAction string const ( - PageShieldPolicyNewParamsActionAllow PageShieldPolicyNewParamsAction = "allow" - PageShieldPolicyNewParamsActionLog PageShieldPolicyNewParamsAction = "log" + PageShieldPolicyReplaceResponseActionAllow PageShieldPolicyReplaceResponseAction = "allow" + PageShieldPolicyReplaceResponseActionLog PageShieldPolicyReplaceResponseAction = "log" ) -type PageShieldPolicyUpdateParams struct { +type PageShieldPolicyNewParams struct { // The action to take if the expression matches - Action param.Field[PageShieldPolicyUpdateParamsAction] `json:"action"` + Action param.Field[PageShieldPolicyNewParamsAction] `json:"action"` // A description for the policy Description param.Field[string] `json:"description"` // Whether the policy is enabled @@ -285,16 +259,16 @@ type PageShieldPolicyUpdateParams struct { Value param.Field[string] `json:"value"` } -func (r PageShieldPolicyUpdateParams) MarshalJSON() (data []byte, err error) { +func (r PageShieldPolicyNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to take if the expression matches -type PageShieldPolicyUpdateParamsAction string +type PageShieldPolicyNewParamsAction string const ( - PageShieldPolicyUpdateParamsActionAllow PageShieldPolicyUpdateParamsAction = "allow" - PageShieldPolicyUpdateParamsActionLog PageShieldPolicyUpdateParamsAction = "log" + PageShieldPolicyNewParamsActionAllow PageShieldPolicyNewParamsAction = "allow" + PageShieldPolicyNewParamsActionLog PageShieldPolicyNewParamsAction = "log" ) type PageShieldPolicyListResponseEnvelope struct { @@ -394,3 +368,29 @@ type pageShieldPolicyListResponseEnvelopeResultInfoJSON struct { func (r *PageShieldPolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type PageShieldPolicyReplaceParams struct { + // The action to take if the expression matches + Action param.Field[PageShieldPolicyReplaceParamsAction] `json:"action"` + // A description for the policy + Description param.Field[string] `json:"description"` + // Whether the policy is enabled + Enabled param.Field[bool] `json:"enabled"` + // The expression which must match for the policy to be applied, using the + // Cloudflare Firewall rule expression syntax + Expression param.Field[string] `json:"expression"` + // The policy which will be applied + Value param.Field[string] `json:"value"` +} + +func (r PageShieldPolicyReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The action to take if the expression matches +type PageShieldPolicyReplaceParamsAction string + +const ( + PageShieldPolicyReplaceParamsActionAllow PageShieldPolicyReplaceParamsAction = "allow" + PageShieldPolicyReplaceParamsActionLog PageShieldPolicyReplaceParamsAction = "log" +) diff --git a/pageshieldpolicy_test.go b/pageshieldpolicy_test.go index 27007ff0cbf..6a082d09989 100644 --- a/pageshieldpolicy_test.go +++ b/pageshieldpolicy_test.go @@ -49,7 +49,7 @@ func TestPageShieldPolicyNewWithOptionalParams(t *testing.T) { } } -func TestPageShieldPolicyUpdateWithOptionalParams(t *testing.T) { +func TestPageShieldPolicyList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -65,18 +65,7 @@ func TestPageShieldPolicyUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShield.Policies.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "c9ef84a6bf5e47138c75d95e2f933e8f", - cloudflare.PageShieldPolicyUpdateParams{ - Action: cloudflare.F(cloudflare.PageShieldPolicyUpdateParamsActionAllow), - Description: cloudflare.F("Checkout page CSP policy"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"), - Value: cloudflare.F("script-src 'none';"), - }, - ) + _, err := client.PageShield.Policies.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -86,7 +75,7 @@ func TestPageShieldPolicyUpdateWithOptionalParams(t *testing.T) { } } -func TestPageShieldPolicyList(t *testing.T) { +func TestPageShieldPolicyDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -102,7 +91,11 @@ func TestPageShieldPolicyList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShield.Policies.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + err := client.PageShield.Policies.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "c9ef84a6bf5e47138c75d95e2f933e8f", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -112,7 +105,7 @@ func TestPageShieldPolicyList(t *testing.T) { } } -func TestPageShieldPolicyDelete(t *testing.T) { +func TestPageShieldPolicyGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -128,7 +121,7 @@ func TestPageShieldPolicyDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.PageShield.Policies.Delete( + _, err := client.PageShield.Policies.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "c9ef84a6bf5e47138c75d95e2f933e8f", @@ -142,7 +135,7 @@ func TestPageShieldPolicyDelete(t *testing.T) { } } -func TestPageShieldPolicyGet(t *testing.T) { +func TestPageShieldPolicyReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -158,10 +151,17 @@ func TestPageShieldPolicyGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShield.Policies.Get( + _, err := client.PageShield.Policies.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "c9ef84a6bf5e47138c75d95e2f933e8f", + cloudflare.PageShieldPolicyReplaceParams{ + Action: cloudflare.F(cloudflare.PageShieldPolicyReplaceParamsActionAllow), + Description: cloudflare.F("Checkout page CSP policy"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"), + Value: cloudflare.F("script-src 'none';"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/pageshieldscript.go b/pageshieldscript.go index c0e1ffc5910..cadb8d8b6f9 100644 --- a/pageshieldscript.go +++ b/pageshieldscript.go @@ -33,18 +33,10 @@ func NewPageShieldScriptService(opts ...option.RequestOption) (r *PageShieldScri return } -// Fetches a script detected by Page Shield by script ID. -func (r *PageShieldScriptService) Get(ctx context.Context, zoneID string, scriptID string, opts ...option.RequestOption) (res *PageShieldScriptGetResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/page_shield/scripts/%s", zoneID, scriptID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) - return -} - // Lists all scripts detected by Page Shield. -func (r *PageShieldScriptService) PageShieldListPageShieldScripts(ctx context.Context, zoneID string, query PageShieldScriptPageShieldListPageShieldScriptsParams, opts ...option.RequestOption) (res *[]PageShieldScriptPageShieldListPageShieldScriptsResponse, err error) { +func (r *PageShieldScriptService) List(ctx context.Context, zoneID string, query PageShieldScriptListParams, opts ...option.RequestOption) (res *[]PageShieldScriptListResponse, err error) { opts = append(r.Options[:], opts...) - var env PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelope + var env PageShieldScriptListResponseEnvelope path := fmt.Sprintf("zones/%s/page_shield/scripts", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -54,6 +46,55 @@ func (r *PageShieldScriptService) PageShieldListPageShieldScripts(ctx context.Co return } +// Fetches a script detected by Page Shield by script ID. +func (r *PageShieldScriptService) Get(ctx context.Context, zoneID string, scriptID string, opts ...option.RequestOption) (res *PageShieldScriptGetResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("zones/%s/page_shield/scripts/%s", zoneID, scriptID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) + return +} + +type PageShieldScriptListResponse struct { + ID interface{} `json:"id"` + AddedAt interface{} `json:"added_at"` + DomainReportedMalicious interface{} `json:"domain_reported_malicious"` + FetchedAt interface{} `json:"fetched_at"` + FirstPageURL interface{} `json:"first_page_url"` + FirstSeenAt interface{} `json:"first_seen_at"` + Hash interface{} `json:"hash"` + Host interface{} `json:"host"` + JsIntegrityScore interface{} `json:"js_integrity_score"` + LastSeenAt interface{} `json:"last_seen_at"` + PageURLs interface{} `json:"page_urls"` + URL interface{} `json:"url"` + URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` + JSON pageShieldScriptListResponseJSON `json:"-"` +} + +// pageShieldScriptListResponseJSON contains the JSON metadata for the struct +// [PageShieldScriptListResponse] +type pageShieldScriptListResponseJSON struct { + ID apijson.Field + AddedAt apijson.Field + DomainReportedMalicious apijson.Field + FetchedAt apijson.Field + FirstPageURL apijson.Field + FirstSeenAt apijson.Field + Hash apijson.Field + Host apijson.Field + JsIntegrityScore apijson.Field + LastSeenAt apijson.Field + PageURLs apijson.Field + URL apijson.Field + URLContainsCdnCgiPath apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PageShieldScriptListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type PageShieldScriptGetResponse struct { ID interface{} `json:"id"` AddedAt interface{} `json:"added_at"` @@ -122,51 +163,9 @@ func (r *PageShieldScriptGetResponseVersion) UnmarshalJSON(data []byte) (err err return apijson.UnmarshalRoot(data, r) } -type PageShieldScriptPageShieldListPageShieldScriptsResponse struct { - ID interface{} `json:"id"` - AddedAt interface{} `json:"added_at"` - DomainReportedMalicious interface{} `json:"domain_reported_malicious"` - FetchedAt interface{} `json:"fetched_at"` - FirstPageURL interface{} `json:"first_page_url"` - FirstSeenAt interface{} `json:"first_seen_at"` - Hash interface{} `json:"hash"` - Host interface{} `json:"host"` - JsIntegrityScore interface{} `json:"js_integrity_score"` - LastSeenAt interface{} `json:"last_seen_at"` - PageURLs interface{} `json:"page_urls"` - URL interface{} `json:"url"` - URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"` - JSON pageShieldScriptPageShieldListPageShieldScriptsResponseJSON `json:"-"` -} - -// pageShieldScriptPageShieldListPageShieldScriptsResponseJSON contains the JSON -// metadata for the struct -// [PageShieldScriptPageShieldListPageShieldScriptsResponse] -type pageShieldScriptPageShieldListPageShieldScriptsResponseJSON struct { - ID apijson.Field - AddedAt apijson.Field - DomainReportedMalicious apijson.Field - FetchedAt apijson.Field - FirstPageURL apijson.Field - FirstSeenAt apijson.Field - Hash apijson.Field - Host apijson.Field - JsIntegrityScore apijson.Field - LastSeenAt apijson.Field - PageURLs apijson.Field - URL apijson.Field - URLContainsCdnCgiPath apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PageShieldScriptPageShieldListPageShieldScriptsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PageShieldScriptPageShieldListPageShieldScriptsParams struct { +type PageShieldScriptListParams struct { // The direction used to sort returned scripts. - Direction param.Field[PageShieldScriptPageShieldListPageShieldScriptsParamsDirection] `query:"direction"` + Direction param.Field[PageShieldScriptListParamsDirection] `query:"direction"` // When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts. // The default value is true. ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"` @@ -180,7 +179,7 @@ type PageShieldScriptPageShieldListPageShieldScriptsParams struct { ExcludeURLs param.Field[string] `query:"exclude_urls"` // Export the list of scripts as a file. Cannot be used with per_page or page // options. - Export param.Field[PageShieldScriptPageShieldListPageShieldScriptsParamsExport] `query:"export"` + Export param.Field[PageShieldScriptListParamsExport] `query:"export"` // Includes scripts that match one or more URL-encoded hostnames separated by // commas. // @@ -189,7 +188,7 @@ type PageShieldScriptPageShieldListPageShieldScriptsParams struct { // by exact match Hosts param.Field[string] `query:"hosts"` // The field used to sort returned scripts. - OrderBy param.Field[PageShieldScriptPageShieldListPageShieldScriptsParamsOrderBy] `query:"order_by"` + OrderBy param.Field[PageShieldScriptListParamsOrderBy] `query:"order_by"` // The current page number of the paginated results. // // We additionally support a special value "all". When "all" is used, the API will @@ -218,9 +217,9 @@ type PageShieldScriptPageShieldListPageShieldScriptsParams struct { URLs param.Field[string] `query:"urls"` } -// URLQuery serializes [PageShieldScriptPageShieldListPageShieldScriptsParams]'s -// query parameters as `url.Values`. -func (r PageShieldScriptPageShieldListPageShieldScriptsParams) URLQuery() (v url.Values) { +// URLQuery serializes [PageShieldScriptListParams]'s query parameters as +// `url.Values`. +func (r PageShieldScriptListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -228,43 +227,42 @@ func (r PageShieldScriptPageShieldListPageShieldScriptsParams) URLQuery() (v url } // The direction used to sort returned scripts. -type PageShieldScriptPageShieldListPageShieldScriptsParamsDirection string +type PageShieldScriptListParamsDirection string const ( - PageShieldScriptPageShieldListPageShieldScriptsParamsDirectionAsc PageShieldScriptPageShieldListPageShieldScriptsParamsDirection = "asc" - PageShieldScriptPageShieldListPageShieldScriptsParamsDirectionDesc PageShieldScriptPageShieldListPageShieldScriptsParamsDirection = "desc" + PageShieldScriptListParamsDirectionAsc PageShieldScriptListParamsDirection = "asc" + PageShieldScriptListParamsDirectionDesc PageShieldScriptListParamsDirection = "desc" ) // Export the list of scripts as a file. Cannot be used with per_page or page // options. -type PageShieldScriptPageShieldListPageShieldScriptsParamsExport string +type PageShieldScriptListParamsExport string const ( - PageShieldScriptPageShieldListPageShieldScriptsParamsExportCsv PageShieldScriptPageShieldListPageShieldScriptsParamsExport = "csv" + PageShieldScriptListParamsExportCsv PageShieldScriptListParamsExport = "csv" ) // The field used to sort returned scripts. -type PageShieldScriptPageShieldListPageShieldScriptsParamsOrderBy string +type PageShieldScriptListParamsOrderBy string const ( - PageShieldScriptPageShieldListPageShieldScriptsParamsOrderByFirstSeenAt PageShieldScriptPageShieldListPageShieldScriptsParamsOrderBy = "first_seen_at" - PageShieldScriptPageShieldListPageShieldScriptsParamsOrderByLastSeenAt PageShieldScriptPageShieldListPageShieldScriptsParamsOrderBy = "last_seen_at" + PageShieldScriptListParamsOrderByFirstSeenAt PageShieldScriptListParamsOrderBy = "first_seen_at" + PageShieldScriptListParamsOrderByLastSeenAt PageShieldScriptListParamsOrderBy = "last_seen_at" ) -type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelope struct { - Errors []PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrors `json:"errors,required"` - Messages []PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessages `json:"messages,required"` - Result []PageShieldScriptPageShieldListPageShieldScriptsResponse `json:"result,required,nullable"` +type PageShieldScriptListResponseEnvelope struct { + Errors []PageShieldScriptListResponseEnvelopeErrors `json:"errors,required"` + Messages []PageShieldScriptListResponseEnvelopeMessages `json:"messages,required"` + Result []PageShieldScriptListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfo `json:"result_info"` - JSON pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeJSON `json:"-"` + Success PageShieldScriptListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo PageShieldScriptListResponseEnvelopeResultInfo `json:"result_info"` + JSON pageShieldScriptListResponseEnvelopeJSON `json:"-"` } -// pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelope] -type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeJSON struct { +// pageShieldScriptListResponseEnvelopeJSON contains the JSON metadata for the +// struct [PageShieldScriptListResponseEnvelope] +type pageShieldScriptListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -274,58 +272,56 @@ type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrorsJSON `json:"-"` +type PageShieldScriptListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldScriptListResponseEnvelopeErrorsJSON `json:"-"` } -// pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrors] -type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrorsJSON struct { +// pageShieldScriptListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PageShieldScriptListResponseEnvelopeErrors] +type pageShieldScriptListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessagesJSON `json:"-"` +type PageShieldScriptListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pageShieldScriptListResponseEnvelopeMessagesJSON `json:"-"` } -// pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessages] -type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessagesJSON struct { +// pageShieldScriptListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PageShieldScriptListResponseEnvelopeMessages] +type pageShieldScriptListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeSuccess bool +type PageShieldScriptListResponseEnvelopeSuccess bool const ( - PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeSuccessTrue PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeSuccess = true + PageShieldScriptListResponseEnvelopeSuccessTrue PageShieldScriptListResponseEnvelopeSuccess = true ) -type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfo struct { +type PageShieldScriptListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -333,14 +329,13 @@ type PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfo s // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON pageShieldScriptListResponseEnvelopeResultInfoJSON `json:"-"` } -// pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfo] -type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfoJSON struct { +// pageShieldScriptListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [PageShieldScriptListResponseEnvelopeResultInfo] +type pageShieldScriptListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -349,6 +344,6 @@ type pageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfoJS ExtraFields map[string]apijson.Field } -func (r *PageShieldScriptPageShieldListPageShieldScriptsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *PageShieldScriptListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/pageshieldscript_test.go b/pageshieldscript_test.go index cd1c4da7f52..1554cda73cb 100644 --- a/pageshieldscript_test.go +++ b/pageshieldscript_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPageShieldScriptGet(t *testing.T) { +func TestPageShieldScriptListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,24 @@ func TestPageShieldScriptGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.Scripts.Get( + _, err := client.PageShield.Scripts.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "c9ef84a6bf5e47138c75d95e2f933e8f", + cloudflare.PageShieldScriptListParams{ + Direction: cloudflare.F(cloudflare.PageShieldScriptListParamsDirectionAsc), + ExcludeCdnCgi: cloudflare.F(true), + ExcludeDuplicates: cloudflare.F(true), + ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"), + Export: cloudflare.F(cloudflare.PageShieldScriptListParamsExportCsv), + Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"), + OrderBy: cloudflare.F(cloudflare.PageShieldScriptListParamsOrderByFirstSeenAt), + Page: cloudflare.F("string"), + PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"), + PerPage: cloudflare.F(100.000000), + PrioritizeMalicious: cloudflare.F(true), + Status: cloudflare.F("active,inactive"), + URLs: cloudflare.F("blog.cloudflare.com,www.example"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +57,7 @@ func TestPageShieldScriptGet(t *testing.T) { } } -func TestPageShieldScriptPageShieldListPageShieldScriptsWithOptionalParams(t *testing.T) { +func TestPageShieldScriptGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,24 +73,10 @@ func TestPageShieldScriptPageShieldListPageShieldScriptsWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.PageShields.Scripts.PageShieldListPageShieldScripts( + _, err := client.PageShield.Scripts.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PageShieldScriptPageShieldListPageShieldScriptsParams{ - Direction: cloudflare.F(cloudflare.PageShieldScriptPageShieldListPageShieldScriptsParamsDirectionAsc), - ExcludeCdnCgi: cloudflare.F(true), - ExcludeDuplicates: cloudflare.F(true), - ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"), - Export: cloudflare.F(cloudflare.PageShieldScriptPageShieldListPageShieldScriptsParamsExportCsv), - Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"), - OrderBy: cloudflare.F(cloudflare.PageShieldScriptPageShieldListPageShieldScriptsParamsOrderByFirstSeenAt), - Page: cloudflare.F("string"), - PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"), - PerPage: cloudflare.F(100.000000), - PrioritizeMalicious: cloudflare.F(true), - Status: cloudflare.F("active,inactive"), - URLs: cloudflare.F("blog.cloudflare.com,www.example"), - }, + "c9ef84a6bf5e47138c75d95e2f933e8f", ) if err != nil { var apierr *cloudflare.Error diff --git a/pcap.go b/pcap.go index bb563cb798d..196489599a2 100644 --- a/pcap.go +++ b/pcap.go @@ -35,12 +35,12 @@ func NewPcapService(opts ...option.RequestOption) (r *PcapService) { return } -// Get information for a PCAP request by id. -func (r *PcapService) Get(ctx context.Context, accountIdentifier string, identifier string, opts ...option.RequestOption) (res *PcapGetResponse, err error) { +// Create new PCAP request for account. +func (r *PcapService) New(ctx context.Context, accountIdentifier string, body PcapNewParams, opts ...option.RequestOption) (res *PcapNewResponse, err error) { opts = append(r.Options[:], opts...) - var env PcapGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/pcaps/%s", accountIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env PcapNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/pcaps", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -48,12 +48,12 @@ func (r *PcapService) Get(ctx context.Context, accountIdentifier string, identif return } -// Create new PCAP request for account. -func (r *PcapService) MagicPcapCollectionNewPcapRequest(ctx context.Context, accountIdentifier string, body PcapMagicPcapCollectionNewPcapRequestParams, opts ...option.RequestOption) (res *PcapMagicPcapCollectionNewPcapRequestResponse, err error) { +// Lists all packet capture requests for an account. +func (r *PcapService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]PcapListResponse, err error) { opts = append(r.Options[:], opts...) - var env PcapMagicPcapCollectionNewPcapRequestResponseEnvelope + var env PcapListResponseEnvelope path := fmt.Sprintf("accounts/%s/pcaps", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -61,11 +61,11 @@ func (r *PcapService) MagicPcapCollectionNewPcapRequest(ctx context.Context, acc return } -// Lists all packet capture requests for an account. -func (r *PcapService) MagicPcapCollectionListPacketCaptureRequests(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]PcapMagicPcapCollectionListPacketCaptureRequestsResponse, err error) { +// Get information for a PCAP request by id. +func (r *PcapService) Get(ctx context.Context, accountIdentifier string, identifier string, opts ...option.RequestOption) (res *PcapGetResponse, err error) { opts = append(r.Options[:], opts...) - var env PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelope - path := fmt.Sprintf("accounts/%s/pcaps", accountIdentifier) + var env PcapGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/pcaps/%s", accountIdentifier, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -74,38 +74,38 @@ func (r *PcapService) MagicPcapCollectionListPacketCaptureRequests(ctx context.C return } -// Union satisfied by [PcapGetResponse0F6lSEpTPcapsResponseSimple] or -// [PcapGetResponse0F6lSEpTPcapsResponseFull]. -type PcapGetResponse interface { - implementsPcapGetResponse() +// Union satisfied by [PcapNewResponseXlQyLgQwPcapsResponseSimple] or +// [PcapNewResponseXlQyLgQwPcapsResponseFull]. +type PcapNewResponse interface { + implementsPcapNewResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*PcapGetResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*PcapNewResponse)(nil)).Elem(), "") } -type PcapGetResponse0F6lSEpTPcapsResponseSimple struct { +type PcapNewResponseXlQyLgQwPcapsResponseSimple struct { // The ID for the packet capture. ID string `json:"id"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1 `json:"filter_v1"` + FilterV1 PcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus `json:"status"` + Status PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapGetResponse0F6lSEpTPcapsResponseSimpleSystem `json:"system"` + System PcapNewResponseXlQyLgQwPcapsResponseSimpleSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapGetResponse0F6lSEpTPcapsResponseSimpleType `json:"type"` - JSON pcapGetResponse0F6lSEpTPcapsResponseSimpleJSON `json:"-"` + Type PcapNewResponseXlQyLgQwPcapsResponseSimpleType `json:"type"` + JSON pcapNewResponseXlQyLgQwPcapsResponseSimpleJSON `json:"-"` } -// pcapGetResponse0F6lSEpTPcapsResponseSimpleJSON contains the JSON metadata for -// the struct [PcapGetResponse0F6lSEpTPcapsResponseSimple] -type pcapGetResponse0F6lSEpTPcapsResponseSimpleJSON struct { +// pcapNewResponseXlQyLgQwPcapsResponseSimpleJSON contains the JSON metadata for +// the struct [PcapNewResponseXlQyLgQwPcapsResponseSimple] +type pcapNewResponseXlQyLgQwPcapsResponseSimpleJSON struct { ID apijson.Field FilterV1 apijson.Field Status apijson.Field @@ -117,14 +117,14 @@ type pcapGetResponse0F6lSEpTPcapsResponseSimpleJSON struct { ExtraFields map[string]apijson.Field } -func (r *PcapGetResponse0F6lSEpTPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseXlQyLgQwPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapGetResponse0F6lSEpTPcapsResponseSimple) implementsPcapGetResponse() {} +func (r PcapNewResponseXlQyLgQwPcapsResponseSimple) implementsPcapNewResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1 struct { +type PcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -135,12 +135,12 @@ type PcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1 struct { SourceAddress string `json:"source_address"` // The source port of the packet. SourcePort float64 `json:"source_port"` - JSON pcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON `json:"-"` + JSON pcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON `json:"-"` } -// pcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON contains the JSON -// metadata for the struct [PcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1] -type pcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON struct { +// pcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON contains the JSON +// metadata for the struct [PcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1] +type pcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -150,41 +150,41 @@ type pcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON struct { ExtraFields map[string]apijson.Field } -func (r *PcapGetResponse0F6lSEpTPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseXlQyLgQwPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus string +type PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus string const ( - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusUnknown PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "unknown" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusSuccess PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "success" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusPending PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "pending" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusRunning PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "running" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusConversionPending PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_pending" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusConversionRunning PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_running" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusComplete PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "complete" - PcapGetResponse0F6lSEpTPcapsResponseSimpleStatusFailed PcapGetResponse0F6lSEpTPcapsResponseSimpleStatus = "failed" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusUnknown PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "unknown" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusSuccess PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "success" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusPending PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "pending" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusRunning PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "running" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusConversionPending PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_pending" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusConversionRunning PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_running" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusComplete PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "complete" + PcapNewResponseXlQyLgQwPcapsResponseSimpleStatusFailed PcapNewResponseXlQyLgQwPcapsResponseSimpleStatus = "failed" ) // The system used to collect packet captures. -type PcapGetResponse0F6lSEpTPcapsResponseSimpleSystem string +type PcapNewResponseXlQyLgQwPcapsResponseSimpleSystem string const ( - PcapGetResponse0F6lSEpTPcapsResponseSimpleSystemMagicTransit PcapGetResponse0F6lSEpTPcapsResponseSimpleSystem = "magic-transit" + PcapNewResponseXlQyLgQwPcapsResponseSimpleSystemMagicTransit PcapNewResponseXlQyLgQwPcapsResponseSimpleSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapGetResponse0F6lSEpTPcapsResponseSimpleType string +type PcapNewResponseXlQyLgQwPcapsResponseSimpleType string const ( - PcapGetResponse0F6lSEpTPcapsResponseSimpleTypeSimple PcapGetResponse0F6lSEpTPcapsResponseSimpleType = "simple" - PcapGetResponse0F6lSEpTPcapsResponseSimpleTypeFull PcapGetResponse0F6lSEpTPcapsResponseSimpleType = "full" + PcapNewResponseXlQyLgQwPcapsResponseSimpleTypeSimple PcapNewResponseXlQyLgQwPcapsResponseSimpleType = "simple" + PcapNewResponseXlQyLgQwPcapsResponseSimpleTypeFull PcapNewResponseXlQyLgQwPcapsResponseSimpleType = "full" ) -type PcapGetResponse0F6lSEpTPcapsResponseFull struct { +type PcapNewResponseXlQyLgQwPcapsResponseFull struct { // The ID for the packet capture. ID string `json:"id"` // The maximum number of bytes to capture. This field only applies to `full` packet @@ -200,24 +200,24 @@ type PcapGetResponse0F6lSEpTPcapsResponseFull struct { // applies to `full` packet captures. ErrorMessage string `json:"error_message"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapGetResponse0F6lSEpTPcapsResponseFullFilterV1 `json:"filter_v1"` + FilterV1 PcapNewResponseXlQyLgQwPcapsResponseFullFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapGetResponse0F6lSEpTPcapsResponseFullStatus `json:"status"` + Status PcapNewResponseXlQyLgQwPcapsResponseFullStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapGetResponse0F6lSEpTPcapsResponseFullSystem `json:"system"` + System PcapNewResponseXlQyLgQwPcapsResponseFullSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapGetResponse0F6lSEpTPcapsResponseFullType `json:"type"` - JSON pcapGetResponse0F6lSEpTPcapsResponseFullJSON `json:"-"` + Type PcapNewResponseXlQyLgQwPcapsResponseFullType `json:"type"` + JSON pcapNewResponseXlQyLgQwPcapsResponseFullJSON `json:"-"` } -// pcapGetResponse0F6lSEpTPcapsResponseFullJSON contains the JSON metadata for the -// struct [PcapGetResponse0F6lSEpTPcapsResponseFull] -type pcapGetResponse0F6lSEpTPcapsResponseFullJSON struct { +// pcapNewResponseXlQyLgQwPcapsResponseFullJSON contains the JSON metadata for the +// struct [PcapNewResponseXlQyLgQwPcapsResponseFull] +type pcapNewResponseXlQyLgQwPcapsResponseFullJSON struct { ID apijson.Field ByteLimit apijson.Field ColoName apijson.Field @@ -233,14 +233,14 @@ type pcapGetResponse0F6lSEpTPcapsResponseFullJSON struct { ExtraFields map[string]apijson.Field } -func (r *PcapGetResponse0F6lSEpTPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseXlQyLgQwPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapGetResponse0F6lSEpTPcapsResponseFull) implementsPcapGetResponse() {} +func (r PcapNewResponseXlQyLgQwPcapsResponseFull) implementsPcapNewResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapGetResponse0F6lSEpTPcapsResponseFullFilterV1 struct { +type PcapNewResponseXlQyLgQwPcapsResponseFullFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -251,12 +251,12 @@ type PcapGetResponse0F6lSEpTPcapsResponseFullFilterV1 struct { SourceAddress string `json:"source_address"` // The source port of the packet. SourcePort float64 `json:"source_port"` - JSON pcapGetResponse0F6lSEpTPcapsResponseFullFilterV1JSON `json:"-"` + JSON pcapNewResponseXlQyLgQwPcapsResponseFullFilterV1JSON `json:"-"` } -// pcapGetResponse0F6lSEpTPcapsResponseFullFilterV1JSON contains the JSON metadata -// for the struct [PcapGetResponse0F6lSEpTPcapsResponseFullFilterV1] -type pcapGetResponse0F6lSEpTPcapsResponseFullFilterV1JSON struct { +// pcapNewResponseXlQyLgQwPcapsResponseFullFilterV1JSON contains the JSON metadata +// for the struct [PcapNewResponseXlQyLgQwPcapsResponseFullFilterV1] +type pcapNewResponseXlQyLgQwPcapsResponseFullFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -266,74 +266,72 @@ type pcapGetResponse0F6lSEpTPcapsResponseFullFilterV1JSON struct { ExtraFields map[string]apijson.Field } -func (r *PcapGetResponse0F6lSEpTPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseXlQyLgQwPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapGetResponse0F6lSEpTPcapsResponseFullStatus string +type PcapNewResponseXlQyLgQwPcapsResponseFullStatus string const ( - PcapGetResponse0F6lSEpTPcapsResponseFullStatusUnknown PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "unknown" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusSuccess PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "success" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusPending PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "pending" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusRunning PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "running" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusConversionPending PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "conversion_pending" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusConversionRunning PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "conversion_running" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusComplete PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "complete" - PcapGetResponse0F6lSEpTPcapsResponseFullStatusFailed PcapGetResponse0F6lSEpTPcapsResponseFullStatus = "failed" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusUnknown PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "unknown" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusSuccess PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "success" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusPending PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "pending" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusRunning PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "running" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusConversionPending PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "conversion_pending" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusConversionRunning PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "conversion_running" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusComplete PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "complete" + PcapNewResponseXlQyLgQwPcapsResponseFullStatusFailed PcapNewResponseXlQyLgQwPcapsResponseFullStatus = "failed" ) // The system used to collect packet captures. -type PcapGetResponse0F6lSEpTPcapsResponseFullSystem string +type PcapNewResponseXlQyLgQwPcapsResponseFullSystem string const ( - PcapGetResponse0F6lSEpTPcapsResponseFullSystemMagicTransit PcapGetResponse0F6lSEpTPcapsResponseFullSystem = "magic-transit" + PcapNewResponseXlQyLgQwPcapsResponseFullSystemMagicTransit PcapNewResponseXlQyLgQwPcapsResponseFullSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapGetResponse0F6lSEpTPcapsResponseFullType string +type PcapNewResponseXlQyLgQwPcapsResponseFullType string const ( - PcapGetResponse0F6lSEpTPcapsResponseFullTypeSimple PcapGetResponse0F6lSEpTPcapsResponseFullType = "simple" - PcapGetResponse0F6lSEpTPcapsResponseFullTypeFull PcapGetResponse0F6lSEpTPcapsResponseFullType = "full" + PcapNewResponseXlQyLgQwPcapsResponseFullTypeSimple PcapNewResponseXlQyLgQwPcapsResponseFullType = "simple" + PcapNewResponseXlQyLgQwPcapsResponseFullTypeFull PcapNewResponseXlQyLgQwPcapsResponseFullType = "full" ) -// Union satisfied by -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimple] or -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull]. -type PcapMagicPcapCollectionNewPcapRequestResponse interface { - implementsPcapMagicPcapCollectionNewPcapRequestResponse() +// Union satisfied by [PcapListResponseXlQyLgQwPcapsResponseSimple] or +// [PcapListResponseXlQyLgQwPcapsResponseFull]. +type PcapListResponse interface { + implementsPcapListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*PcapMagicPcapCollectionNewPcapRequestResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*PcapListResponse)(nil)).Elem(), "") } -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimple struct { +type PcapListResponseXlQyLgQwPcapsResponseSimple struct { // The ID for the packet capture. ID string `json:"id"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1 `json:"filter_v1"` + FilterV1 PcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus `json:"status"` + Status PcapListResponseXlQyLgQwPcapsResponseSimpleStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleSystem `json:"system"` + System PcapListResponseXlQyLgQwPcapsResponseSimpleSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleType `json:"type"` - JSON pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleJSON `json:"-"` + Type PcapListResponseXlQyLgQwPcapsResponseSimpleType `json:"type"` + JSON pcapListResponseXlQyLgQwPcapsResponseSimpleJSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimple] -type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleJSON struct { +// pcapListResponseXlQyLgQwPcapsResponseSimpleJSON contains the JSON metadata for +// the struct [PcapListResponseXlQyLgQwPcapsResponseSimple] +type pcapListResponseXlQyLgQwPcapsResponseSimpleJSON struct { ID apijson.Field FilterV1 apijson.Field Status apijson.Field @@ -345,15 +343,14 @@ type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleJSO ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseXlQyLgQwPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimple) implementsPcapMagicPcapCollectionNewPcapRequestResponse() { -} +func (r PcapListResponseXlQyLgQwPcapsResponseSimple) implementsPcapListResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1 struct { +type PcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -363,14 +360,13 @@ type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFil // The source IP address of the packet. SourceAddress string `json:"source_address"` // The source port of the packet. - SourcePort float64 `json:"source_port"` - JSON pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON `json:"-"` + SourcePort float64 `json:"source_port"` + JSON pcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1] -type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON struct { +// pcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON contains the JSON +// metadata for the struct [PcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1] +type pcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -380,41 +376,41 @@ type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFil ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseXlQyLgQwPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus string +type PcapListResponseXlQyLgQwPcapsResponseSimpleStatus string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusUnknown PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "unknown" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusSuccess PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "success" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusPending PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "pending" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusRunning PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "running" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusConversionPending PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_pending" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusConversionRunning PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_running" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusComplete PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "complete" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatusFailed PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleStatus = "failed" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusUnknown PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "unknown" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusSuccess PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "success" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusPending PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "pending" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusRunning PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "running" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusConversionPending PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_pending" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusConversionRunning PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_running" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusComplete PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "complete" + PcapListResponseXlQyLgQwPcapsResponseSimpleStatusFailed PcapListResponseXlQyLgQwPcapsResponseSimpleStatus = "failed" ) // The system used to collect packet captures. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleSystem string +type PcapListResponseXlQyLgQwPcapsResponseSimpleSystem string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleSystemMagicTransit PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleSystem = "magic-transit" + PcapListResponseXlQyLgQwPcapsResponseSimpleSystemMagicTransit PcapListResponseXlQyLgQwPcapsResponseSimpleSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleType string +type PcapListResponseXlQyLgQwPcapsResponseSimpleType string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleTypeSimple PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleType = "simple" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleTypeFull PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseSimpleType = "full" + PcapListResponseXlQyLgQwPcapsResponseSimpleTypeSimple PcapListResponseXlQyLgQwPcapsResponseSimpleType = "simple" + PcapListResponseXlQyLgQwPcapsResponseSimpleTypeFull PcapListResponseXlQyLgQwPcapsResponseSimpleType = "full" ) -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull struct { +type PcapListResponseXlQyLgQwPcapsResponseFull struct { // The ID for the packet capture. ID string `json:"id"` // The maximum number of bytes to capture. This field only applies to `full` packet @@ -430,25 +426,24 @@ type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull stru // applies to `full` packet captures. ErrorMessage string `json:"error_message"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1 `json:"filter_v1"` + FilterV1 PcapListResponseXlQyLgQwPcapsResponseFullFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus `json:"status"` + Status PcapListResponseXlQyLgQwPcapsResponseFullStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullSystem `json:"system"` + System PcapListResponseXlQyLgQwPcapsResponseFullSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullType `json:"type"` - JSON pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullJSON `json:"-"` + Type PcapListResponseXlQyLgQwPcapsResponseFullType `json:"type"` + JSON pcapListResponseXlQyLgQwPcapsResponseFullJSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull] -type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullJSON struct { +// pcapListResponseXlQyLgQwPcapsResponseFullJSON contains the JSON metadata for the +// struct [PcapListResponseXlQyLgQwPcapsResponseFull] +type pcapListResponseXlQyLgQwPcapsResponseFullJSON struct { ID apijson.Field ByteLimit apijson.Field ColoName apijson.Field @@ -464,15 +459,14 @@ type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullJSON ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseXlQyLgQwPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFull) implementsPcapMagicPcapCollectionNewPcapRequestResponse() { -} +func (r PcapListResponseXlQyLgQwPcapsResponseFull) implementsPcapListResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1 struct { +type PcapListResponseXlQyLgQwPcapsResponseFullFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -482,14 +476,13 @@ type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilte // The source IP address of the packet. SourceAddress string `json:"source_address"` // The source port of the packet. - SourcePort float64 `json:"source_port"` - JSON pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1JSON `json:"-"` + SourcePort float64 `json:"source_port"` + JSON pcapListResponseXlQyLgQwPcapsResponseFullFilterV1JSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1JSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1] -type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1JSON struct { +// pcapListResponseXlQyLgQwPcapsResponseFullFilterV1JSON contains the JSON metadata +// for the struct [PcapListResponseXlQyLgQwPcapsResponseFullFilterV1] +type pcapListResponseXlQyLgQwPcapsResponseFullFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -499,75 +492,72 @@ type pcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilte ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseXlQyLgQwPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus string +type PcapListResponseXlQyLgQwPcapsResponseFullStatus string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusUnknown PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "unknown" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusSuccess PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "success" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusPending PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "pending" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusRunning PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "running" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusConversionPending PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "conversion_pending" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusConversionRunning PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "conversion_running" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusComplete PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "complete" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatusFailed PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullStatus = "failed" + PcapListResponseXlQyLgQwPcapsResponseFullStatusUnknown PcapListResponseXlQyLgQwPcapsResponseFullStatus = "unknown" + PcapListResponseXlQyLgQwPcapsResponseFullStatusSuccess PcapListResponseXlQyLgQwPcapsResponseFullStatus = "success" + PcapListResponseXlQyLgQwPcapsResponseFullStatusPending PcapListResponseXlQyLgQwPcapsResponseFullStatus = "pending" + PcapListResponseXlQyLgQwPcapsResponseFullStatusRunning PcapListResponseXlQyLgQwPcapsResponseFullStatus = "running" + PcapListResponseXlQyLgQwPcapsResponseFullStatusConversionPending PcapListResponseXlQyLgQwPcapsResponseFullStatus = "conversion_pending" + PcapListResponseXlQyLgQwPcapsResponseFullStatusConversionRunning PcapListResponseXlQyLgQwPcapsResponseFullStatus = "conversion_running" + PcapListResponseXlQyLgQwPcapsResponseFullStatusComplete PcapListResponseXlQyLgQwPcapsResponseFullStatus = "complete" + PcapListResponseXlQyLgQwPcapsResponseFullStatusFailed PcapListResponseXlQyLgQwPcapsResponseFullStatus = "failed" ) // The system used to collect packet captures. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullSystem string +type PcapListResponseXlQyLgQwPcapsResponseFullSystem string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullSystemMagicTransit PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullSystem = "magic-transit" + PcapListResponseXlQyLgQwPcapsResponseFullSystemMagicTransit PcapListResponseXlQyLgQwPcapsResponseFullSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullType string +type PcapListResponseXlQyLgQwPcapsResponseFullType string const ( - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullTypeSimple PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullType = "simple" - PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullTypeFull PcapMagicPcapCollectionNewPcapRequestResponse0F6lSEpTPcapsResponseFullType = "full" + PcapListResponseXlQyLgQwPcapsResponseFullTypeSimple PcapListResponseXlQyLgQwPcapsResponseFullType = "simple" + PcapListResponseXlQyLgQwPcapsResponseFullTypeFull PcapListResponseXlQyLgQwPcapsResponseFullType = "full" ) -// Union satisfied by -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimple] -// or -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFull]. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse interface { - implementsPcapMagicPcapCollectionListPacketCaptureRequestsResponse() +// Union satisfied by [PcapGetResponseXlQyLgQwPcapsResponseSimple] or +// [PcapGetResponseXlQyLgQwPcapsResponseFull]. +type PcapGetResponse interface { + implementsPcapGetResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*PcapMagicPcapCollectionListPacketCaptureRequestsResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*PcapGetResponse)(nil)).Elem(), "") } -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimple struct { +type PcapGetResponseXlQyLgQwPcapsResponseSimple struct { // The ID for the packet capture. ID string `json:"id"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1 `json:"filter_v1"` + FilterV1 PcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus `json:"status"` + Status PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleSystem `json:"system"` + System PcapGetResponseXlQyLgQwPcapsResponseSimpleSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleType `json:"type"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleJSON `json:"-"` + Type PcapGetResponseXlQyLgQwPcapsResponseSimpleType `json:"type"` + JSON pcapGetResponseXlQyLgQwPcapsResponseSimpleJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimple] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleJSON struct { +// pcapGetResponseXlQyLgQwPcapsResponseSimpleJSON contains the JSON metadata for +// the struct [PcapGetResponseXlQyLgQwPcapsResponseSimple] +type pcapGetResponseXlQyLgQwPcapsResponseSimpleJSON struct { ID apijson.Field FilterV1 apijson.Field Status apijson.Field @@ -579,15 +569,14 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { +func (r *PcapGetResponseXlQyLgQwPcapsResponseSimple) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimple) implementsPcapMagicPcapCollectionListPacketCaptureRequestsResponse() { -} +func (r PcapGetResponseXlQyLgQwPcapsResponseSimple) implementsPcapGetResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1 struct { +type PcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -597,14 +586,13 @@ type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon // The source IP address of the packet. SourceAddress string `json:"source_address"` // The source port of the packet. - SourcePort float64 `json:"source_port"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON `json:"-"` + SourcePort float64 `json:"source_port"` + JSON pcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1JSON struct { +// pcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON contains the JSON +// metadata for the struct [PcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1] +type pcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -614,41 +602,41 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapGetResponseXlQyLgQwPcapsResponseSimpleFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus string +type PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus string const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusUnknown PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "unknown" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusSuccess PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "success" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusPending PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "pending" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusRunning PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "running" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusConversionPending PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_pending" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusConversionRunning PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "conversion_running" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusComplete PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "complete" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatusFailed PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleStatus = "failed" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusUnknown PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "unknown" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusSuccess PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "success" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusPending PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "pending" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusRunning PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "running" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusConversionPending PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_pending" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusConversionRunning PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "conversion_running" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusComplete PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "complete" + PcapGetResponseXlQyLgQwPcapsResponseSimpleStatusFailed PcapGetResponseXlQyLgQwPcapsResponseSimpleStatus = "failed" ) // The system used to collect packet captures. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleSystem string +type PcapGetResponseXlQyLgQwPcapsResponseSimpleSystem string const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleSystemMagicTransit PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleSystem = "magic-transit" + PcapGetResponseXlQyLgQwPcapsResponseSimpleSystemMagicTransit PcapGetResponseXlQyLgQwPcapsResponseSimpleSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleType string +type PcapGetResponseXlQyLgQwPcapsResponseSimpleType string const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleTypeSimple PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleType = "simple" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleTypeFull PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseSimpleType = "full" + PcapGetResponseXlQyLgQwPcapsResponseSimpleTypeSimple PcapGetResponseXlQyLgQwPcapsResponseSimpleType = "simple" + PcapGetResponseXlQyLgQwPcapsResponseSimpleTypeFull PcapGetResponseXlQyLgQwPcapsResponseSimpleType = "full" ) -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFull struct { +type PcapGetResponseXlQyLgQwPcapsResponseFull struct { // The ID for the packet capture. ID string `json:"id"` // The maximum number of bytes to capture. This field only applies to `full` packet @@ -664,25 +652,24 @@ type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon // applies to `full` packet captures. ErrorMessage string `json:"error_message"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1 `json:"filter_v1"` + FilterV1 PcapGetResponseXlQyLgQwPcapsResponseFullFilterV1 `json:"filter_v1"` // The status of the packet capture request. - Status PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus `json:"status"` + Status PcapGetResponseXlQyLgQwPcapsResponseFullStatus `json:"status"` // The RFC 3339 timestamp when the packet capture was created. Submitted string `json:"submitted"` // The system used to collect packet captures. - System PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullSystem `json:"system"` + System PcapGetResponseXlQyLgQwPcapsResponseFullSystem `json:"system"` // The packet capture duration in seconds. TimeLimit float64 `json:"time_limit"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullType `json:"type"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullJSON `json:"-"` + Type PcapGetResponseXlQyLgQwPcapsResponseFullType `json:"type"` + JSON pcapGetResponseXlQyLgQwPcapsResponseFullJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFull] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullJSON struct { +// pcapGetResponseXlQyLgQwPcapsResponseFullJSON contains the JSON metadata for the +// struct [PcapGetResponseXlQyLgQwPcapsResponseFull] +type pcapGetResponseXlQyLgQwPcapsResponseFullJSON struct { ID apijson.Field ByteLimit apijson.Field ColoName apijson.Field @@ -698,15 +685,14 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { +func (r *PcapGetResponseXlQyLgQwPcapsResponseFull) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFull) implementsPcapMagicPcapCollectionListPacketCaptureRequestsResponse() { -} +func (r PcapGetResponseXlQyLgQwPcapsResponseFull) implementsPcapGetResponse() {} // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1 struct { +type PcapGetResponseXlQyLgQwPcapsResponseFullFilterV1 struct { // The destination IP address of the packet. DestinationAddress string `json:"destination_address"` // The destination port of the packet. @@ -716,14 +702,13 @@ type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon // The source IP address of the packet. SourceAddress string `json:"source_address"` // The source port of the packet. - SourcePort float64 `json:"source_port"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1JSON `json:"-"` + SourcePort float64 `json:"source_port"` + JSON pcapGetResponseXlQyLgQwPcapsResponseFullFilterV1JSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1JSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1JSON struct { +// pcapGetResponseXlQyLgQwPcapsResponseFullFilterV1JSON contains the JSON metadata +// for the struct [PcapGetResponseXlQyLgQwPcapsResponseFullFilterV1] +type pcapGetResponseXlQyLgQwPcapsResponseFullFilterV1JSON struct { DestinationAddress apijson.Field DestinationPort apijson.Field Protocol apijson.Field @@ -733,156 +718,87 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsRespon ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { +func (r *PcapGetResponseXlQyLgQwPcapsResponseFullFilterV1) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the packet capture request. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus string +type PcapGetResponseXlQyLgQwPcapsResponseFullStatus string const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusUnknown PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "unknown" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusSuccess PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "success" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusPending PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "pending" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusRunning PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "running" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusConversionPending PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "conversion_pending" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusConversionRunning PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "conversion_running" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusComplete PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "complete" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatusFailed PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullStatus = "failed" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusUnknown PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "unknown" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusSuccess PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "success" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusPending PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "pending" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusRunning PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "running" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusConversionPending PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "conversion_pending" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusConversionRunning PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "conversion_running" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusComplete PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "complete" + PcapGetResponseXlQyLgQwPcapsResponseFullStatusFailed PcapGetResponseXlQyLgQwPcapsResponseFullStatus = "failed" ) // The system used to collect packet captures. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullSystem string +type PcapGetResponseXlQyLgQwPcapsResponseFullSystem string const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullSystemMagicTransit PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullSystem = "magic-transit" + PcapGetResponseXlQyLgQwPcapsResponseFullSystemMagicTransit PcapGetResponseXlQyLgQwPcapsResponseFullSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullType string - -const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullTypeSimple PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullType = "simple" - PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullTypeFull PcapMagicPcapCollectionListPacketCaptureRequestsResponse0F6lSEpTPcapsResponseFullType = "full" -) - -type PcapGetResponseEnvelope struct { - Errors []PcapGetResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapGetResponseEnvelopeMessages `json:"messages,required"` - Result PcapGetResponse `json:"result,required"` - // Whether the API call was successful - Success PcapGetResponseEnvelopeSuccess `json:"success,required"` - JSON pcapGetResponseEnvelopeJSON `json:"-"` -} - -// pcapGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [PcapGetResponseEnvelope] -type pcapGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PcapGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// pcapGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [PcapGetResponseEnvelopeErrors] -type pcapGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PcapGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// pcapGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [PcapGetResponseEnvelopeMessages] -type pcapGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PcapGetResponseEnvelopeSuccess bool +type PcapGetResponseXlQyLgQwPcapsResponseFullType string const ( - PcapGetResponseEnvelopeSuccessTrue PcapGetResponseEnvelopeSuccess = true + PcapGetResponseXlQyLgQwPcapsResponseFullTypeSimple PcapGetResponseXlQyLgQwPcapsResponseFullType = "simple" + PcapGetResponseXlQyLgQwPcapsResponseFullTypeFull PcapGetResponseXlQyLgQwPcapsResponseFullType = "full" ) // This interface is a union satisfied by one of the following: -// [PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimple], -// [PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFull]. -type PcapMagicPcapCollectionNewPcapRequestParams interface { - ImplementsPcapMagicPcapCollectionNewPcapRequestParams() +// [PcapNewParamsXlQyLgQwPcapsRequestSimple], +// [PcapNewParamsXlQyLgQwPcapsRequestFull]. +type PcapNewParams interface { + ImplementsPcapNewParams() } -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimple struct { +type PcapNewParamsXlQyLgQwPcapsRequestSimple struct { // The limit of packets contained in a packet capture. PacketLimit param.Field[float64] `json:"packet_limit,required"` // The system used to collect packet captures. - System param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleSystem] `json:"system,required"` + System param.Field[PcapNewParamsXlQyLgQwPcapsRequestSimpleSystem] `json:"system,required"` // The packet capture duration in seconds. TimeLimit param.Field[float64] `json:"time_limit,required"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleType] `json:"type,required"` + Type param.Field[PcapNewParamsXlQyLgQwPcapsRequestSimpleType] `json:"type,required"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleFilterV1] `json:"filter_v1"` + FilterV1 param.Field[PcapNewParamsXlQyLgQwPcapsRequestSimpleFilterV1] `json:"filter_v1"` } -func (r PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimple) MarshalJSON() (data []byte, err error) { +func (r PcapNewParamsXlQyLgQwPcapsRequestSimple) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimple) ImplementsPcapMagicPcapCollectionNewPcapRequestParams() { +func (PcapNewParamsXlQyLgQwPcapsRequestSimple) ImplementsPcapNewParams() { } // The system used to collect packet captures. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleSystem string +type PcapNewParamsXlQyLgQwPcapsRequestSimpleSystem string const ( - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleSystemMagicTransit PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleSystem = "magic-transit" + PcapNewParamsXlQyLgQwPcapsRequestSimpleSystemMagicTransit PcapNewParamsXlQyLgQwPcapsRequestSimpleSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleType string +type PcapNewParamsXlQyLgQwPcapsRequestSimpleType string const ( - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleTypeSimple PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleType = "simple" - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleTypeFull PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleType = "full" + PcapNewParamsXlQyLgQwPcapsRequestSimpleTypeSimple PcapNewParamsXlQyLgQwPcapsRequestSimpleType = "simple" + PcapNewParamsXlQyLgQwPcapsRequestSimpleTypeFull PcapNewParamsXlQyLgQwPcapsRequestSimpleType = "full" ) // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleFilterV1 struct { +type PcapNewParamsXlQyLgQwPcapsRequestSimpleFilterV1 struct { // The destination IP address of the packet. DestinationAddress param.Field[string] `json:"destination_address"` // The destination port of the packet. @@ -895,11 +811,11 @@ type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleFilter SourcePort param.Field[float64] `json:"source_port"` } -func (r PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleFilterV1) MarshalJSON() (data []byte, err error) { +func (r PcapNewParamsXlQyLgQwPcapsRequestSimpleFilterV1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFull struct { +type PcapNewParamsXlQyLgQwPcapsRequestFull struct { // The name of the data center used for the packet capture. This can be a specific // colo (ord02) or a multi-colo name (ORD). This field only applies to `full` // packet captures. @@ -907,47 +823,47 @@ type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFull struct // The full URI for the bucket. This field only applies to `full` packet captures. DestinationConf param.Field[string] `json:"destination_conf,required"` // The system used to collect packet captures. - System param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullSystem] `json:"system,required"` + System param.Field[PcapNewParamsXlQyLgQwPcapsRequestFullSystem] `json:"system,required"` // The packet capture duration in seconds. TimeLimit param.Field[float64] `json:"time_limit,required"` // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. - Type param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullType] `json:"type,required"` + Type param.Field[PcapNewParamsXlQyLgQwPcapsRequestFullType] `json:"type,required"` // The maximum number of bytes to capture. This field only applies to `full` packet // captures. ByteLimit param.Field[float64] `json:"byte_limit"` // The packet capture filter. When this field is empty, all packets are captured. - FilterV1 param.Field[PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullFilterV1] `json:"filter_v1"` + FilterV1 param.Field[PcapNewParamsXlQyLgQwPcapsRequestFullFilterV1] `json:"filter_v1"` // The limit of packets contained in a packet capture. PacketLimit param.Field[float64] `json:"packet_limit"` } -func (r PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFull) MarshalJSON() (data []byte, err error) { +func (r PcapNewParamsXlQyLgQwPcapsRequestFull) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFull) ImplementsPcapMagicPcapCollectionNewPcapRequestParams() { +func (PcapNewParamsXlQyLgQwPcapsRequestFull) ImplementsPcapNewParams() { } // The system used to collect packet captures. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullSystem string +type PcapNewParamsXlQyLgQwPcapsRequestFullSystem string const ( - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullSystemMagicTransit PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullSystem = "magic-transit" + PcapNewParamsXlQyLgQwPcapsRequestFullSystemMagicTransit PcapNewParamsXlQyLgQwPcapsRequestFullSystem = "magic-transit" ) // The type of packet capture. `Simple` captures sampled packets, and `full` // captures entire payloads and non-sampled packets. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullType string +type PcapNewParamsXlQyLgQwPcapsRequestFullType string const ( - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullTypeSimple PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullType = "simple" - PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullTypeFull PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullType = "full" + PcapNewParamsXlQyLgQwPcapsRequestFullTypeSimple PcapNewParamsXlQyLgQwPcapsRequestFullType = "simple" + PcapNewParamsXlQyLgQwPcapsRequestFullTypeFull PcapNewParamsXlQyLgQwPcapsRequestFullType = "full" ) // The packet capture filter. When this field is empty, all packets are captured. -type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullFilterV1 struct { +type PcapNewParamsXlQyLgQwPcapsRequestFullFilterV1 struct { // The destination IP address of the packet. DestinationAddress param.Field[string] `json:"destination_address"` // The destination port of the packet. @@ -960,22 +876,22 @@ type PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullFilterV1 SourcePort param.Field[float64] `json:"source_port"` } -func (r PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestFullFilterV1) MarshalJSON() (data []byte, err error) { +func (r PcapNewParamsXlQyLgQwPcapsRequestFullFilterV1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type PcapMagicPcapCollectionNewPcapRequestResponseEnvelope struct { - Errors []PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessages `json:"messages,required"` - Result PcapMagicPcapCollectionNewPcapRequestResponse `json:"result,required"` +type PcapNewResponseEnvelope struct { + Errors []PcapNewResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapNewResponseEnvelopeMessages `json:"messages,required"` + Result PcapNewResponse `json:"result,required"` // Whether the API call was successful - Success PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeSuccess `json:"success,required"` - JSON pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeJSON `json:"-"` + Success PcapNewResponseEnvelopeSuccess `json:"success,required"` + JSON pcapNewResponseEnvelopeJSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeJSON contains the JSON -// metadata for the struct [PcapMagicPcapCollectionNewPcapRequestResponseEnvelope] -type pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeJSON struct { +// pcapNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [PcapNewResponseEnvelope] +type pcapNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -984,71 +900,68 @@ type pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrorsJSON `json:"-"` +type PcapNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapNewResponseEnvelopeErrorsJSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrors] -type pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrorsJSON struct { +// pcapNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [PcapNewResponseEnvelopeErrors] +type pcapNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessagesJSON `json:"-"` +type PcapNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapNewResponseEnvelopeMessagesJSON `json:"-"` } -// pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessages] -type pcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessagesJSON struct { +// pcapNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [PcapNewResponseEnvelopeMessages] +type pcapNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PcapNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeSuccess bool +type PcapNewResponseEnvelopeSuccess bool const ( - PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeSuccessTrue PcapMagicPcapCollectionNewPcapRequestResponseEnvelopeSuccess = true + PcapNewResponseEnvelopeSuccessTrue PcapNewResponseEnvelopeSuccess = true ) -type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelope struct { - Errors []PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessages `json:"messages,required"` - Result []PcapMagicPcapCollectionListPacketCaptureRequestsResponse `json:"result,required,nullable"` +type PcapListResponseEnvelope struct { + Errors []PcapListResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapListResponseEnvelopeMessages `json:"messages,required"` + Result []PcapListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfo `json:"result_info"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeJSON `json:"-"` + Success PcapListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo PcapListResponseEnvelopeResultInfo `json:"result_info"` + JSON pcapListResponseEnvelopeJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelope] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeJSON struct { +// pcapListResponseEnvelopeJSON contains the JSON metadata for the struct +// [PcapListResponseEnvelope] +type pcapListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1058,58 +971,56 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrorsJSON `json:"-"` +type PcapListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapListResponseEnvelopeErrorsJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrors] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrorsJSON struct { +// pcapListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [PcapListResponseEnvelopeErrors] +type pcapListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessagesJSON `json:"-"` +type PcapListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapListResponseEnvelopeMessagesJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessages] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessagesJSON struct { +// pcapListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [PcapListResponseEnvelopeMessages] +type pcapListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeSuccess bool +type PcapListResponseEnvelopeSuccess bool const ( - PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeSuccessTrue PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeSuccess = true + PcapListResponseEnvelopeSuccessTrue PcapListResponseEnvelopeSuccess = true ) -type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfo struct { +type PcapListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -1117,14 +1028,13 @@ type PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfo // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON pcapListResponseEnvelopeResultInfoJSON `json:"-"` } -// pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfo] -type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfoJSON struct { +// pcapListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct +// [PcapListResponseEnvelopeResultInfo] +type pcapListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -1133,6 +1043,75 @@ type pcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfoJ ExtraFields map[string]apijson.Field } -func (r *PcapMagicPcapCollectionListPacketCaptureRequestsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *PcapListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PcapGetResponseEnvelope struct { + Errors []PcapGetResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapGetResponseEnvelopeMessages `json:"messages,required"` + Result PcapGetResponse `json:"result,required"` + // Whether the API call was successful + Success PcapGetResponseEnvelopeSuccess `json:"success,required"` + JSON pcapGetResponseEnvelopeJSON `json:"-"` +} + +// pcapGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [PcapGetResponseEnvelope] +type pcapGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PcapGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// pcapGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [PcapGetResponseEnvelopeErrors] +type pcapGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type PcapGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// pcapGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [PcapGetResponseEnvelopeMessages] +type pcapGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type PcapGetResponseEnvelopeSuccess bool + +const ( + PcapGetResponseEnvelopeSuccessTrue PcapGetResponseEnvelopeSuccess = true +) diff --git a/pcap_test.go b/pcap_test.go index cc4c6482971..fe467ae2526 100644 --- a/pcap_test.go +++ b/pcap_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPcapGet(t *testing.T) { +func TestPcapNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,22 @@ func TestPcapGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pcaps.Get( + _, err := client.Pcaps.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.PcapNewParamsXlQyLgQwPcapsRequestSimple{ + PacketLimit: cloudflare.F(10000.000000), + System: cloudflare.F(cloudflare.PcapNewParamsXlQyLgQwPcapsRequestSimpleSystemMagicTransit), + TimeLimit: cloudflare.F(300.000000), + Type: cloudflare.F(cloudflare.PcapNewParamsXlQyLgQwPcapsRequestSimpleTypeSimple), + FilterV1: cloudflare.F(cloudflare.PcapNewParamsXlQyLgQwPcapsRequestSimpleFilterV1{ + DestinationAddress: cloudflare.F("1.2.3.4"), + DestinationPort: cloudflare.F(80.000000), + Protocol: cloudflare.F(6.000000), + SourceAddress: cloudflare.F("1.2.3.4"), + SourcePort: cloudflare.F(123.000000), + }), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +55,7 @@ func TestPcapGet(t *testing.T) { } } -func TestPcapMagicPcapCollectionNewPcapRequestWithOptionalParams(t *testing.T) { +func TestPcapList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,23 +71,7 @@ func TestPcapMagicPcapCollectionNewPcapRequestWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pcaps.MagicPcapCollectionNewPcapRequest( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimple{ - PacketLimit: cloudflare.F(10000.000000), - System: cloudflare.F(cloudflare.PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleSystemMagicTransit), - TimeLimit: cloudflare.F(300.000000), - Type: cloudflare.F(cloudflare.PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleTypeSimple), - FilterV1: cloudflare.F(cloudflare.PcapMagicPcapCollectionNewPcapRequestParams0F6lSEpTPcapsRequestSimpleFilterV1{ - DestinationAddress: cloudflare.F("1.2.3.4"), - DestinationPort: cloudflare.F(80.000000), - Protocol: cloudflare.F(6.000000), - SourceAddress: cloudflare.F("1.2.3.4"), - SourcePort: cloudflare.F(123.000000), - }), - }, - ) + _, err := client.Pcaps.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -85,7 +81,7 @@ func TestPcapMagicPcapCollectionNewPcapRequestWithOptionalParams(t *testing.T) { } } -func TestPcapMagicPcapCollectionListPacketCaptureRequests(t *testing.T) { +func TestPcapGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -101,7 +97,11 @@ func TestPcapMagicPcapCollectionListPacketCaptureRequests(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pcaps.MagicPcapCollectionListPacketCaptureRequests(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Pcaps.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/pcapdownload.go b/pcapdownload.go index 3bc2b57b61e..ac853fc03f1 100644 --- a/pcapdownload.go +++ b/pcapdownload.go @@ -30,7 +30,7 @@ func NewPcapDownloadService(opts ...option.RequestOption) (r *PcapDownloadServic } // Download PCAP information into a file. Response is a binary PCAP file. -func (r *PcapDownloadService) List(ctx context.Context, accountIdentifier string, identifier string, opts ...option.RequestOption) (res *http.Response, err error) { +func (r *PcapDownloadService) Get(ctx context.Context, accountIdentifier string, identifier string, opts ...option.RequestOption) (res *http.Response, err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "application/vnd.tcpdump.pcap")}, opts...) path := fmt.Sprintf("accounts/%s/pcaps/%s/download", accountIdentifier, identifier) diff --git a/pcapdownload_test.go b/pcapdownload_test.go index 5575a9e01be..9a0c57bfe91 100644 --- a/pcapdownload_test.go +++ b/pcapdownload_test.go @@ -15,7 +15,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPcapDownloadList(t *testing.T) { +func TestPcapDownloadGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) @@ -30,7 +30,7 @@ func TestPcapDownloadList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - resp, err := client.Pcaps.Downloads.List( + resp, err := client.Pcaps.Downloads.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/pcapownership.go b/pcapownership.go index 84a007c2712..b9759c2ba98 100644 --- a/pcapownership.go +++ b/pcapownership.go @@ -19,8 +19,7 @@ import ( // this service directly, and instead use the [NewPcapOwnershipService] method // instead. type PcapOwnershipService struct { - Options []option.RequestOption - Validates *PcapOwnershipValidateService + Options []option.RequestOption } // NewPcapOwnershipService generates a new service that applies the given options @@ -29,7 +28,19 @@ type PcapOwnershipService struct { func NewPcapOwnershipService(opts ...option.RequestOption) (r *PcapOwnershipService) { r = &PcapOwnershipService{} r.Options = opts - r.Validates = NewPcapOwnershipValidateService(opts...) + return +} + +// Adds an AWS or GCP bucket to use with full packet captures. +func (r *PcapOwnershipService) New(ctx context.Context, accountIdentifier string, body PcapOwnershipNewParams, opts ...option.RequestOption) (res *PcapOwnershipNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env PcapOwnershipNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/pcaps/ownership", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result return } @@ -42,12 +53,12 @@ func (r *PcapOwnershipService) Delete(ctx context.Context, accountIdentifier str return } -// Adds an AWS or GCP bucket to use with full packet captures. -func (r *PcapOwnershipService) MagicPcapCollectionAddBucketsForFullPacketCaptures(ctx context.Context, accountIdentifier string, body PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesParams, opts ...option.RequestOption) (res *PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse, err error) { +// List all buckets configured for use with PCAPs API. +func (r *PcapOwnershipService) Get(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]PcapOwnershipGetResponse, err error) { opts = append(r.Options[:], opts...) - var env PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelope + var env PcapOwnershipGetResponseEnvelope path := fmt.Sprintf("accounts/%s/pcaps/ownership", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -55,12 +66,12 @@ func (r *PcapOwnershipService) MagicPcapCollectionAddBucketsForFullPacketCapture return } -// List all buckets configured for use with PCAPs API. -func (r *PcapOwnershipService) MagicPcapCollectionListPcaPsBucketOwnership(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse, err error) { +// Validates buckets added to the packet captures API. +func (r *PcapOwnershipService) Validate(ctx context.Context, accountIdentifier string, body PcapOwnershipValidateParams, opts ...option.RequestOption) (res *PcapOwnershipValidateResponse, err error) { opts = append(r.Options[:], opts...) - var env PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelope - path := fmt.Sprintf("accounts/%s/pcaps/ownership", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env PcapOwnershipValidateResponseEnvelope + path := fmt.Sprintf("accounts/%s/pcaps/ownership/validate", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -68,7 +79,49 @@ func (r *PcapOwnershipService) MagicPcapCollectionListPcaPsBucketOwnership(ctx c return } -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse struct { +type PcapOwnershipNewResponse struct { + // The bucket ID associated with the packet captures API. + ID string `json:"id,required"` + // The full URI for the bucket. This field only applies to `full` packet captures. + DestinationConf string `json:"destination_conf,required"` + // The ownership challenge filename stored in the bucket. + Filename string `json:"filename,required"` + // The status of the ownership challenge. Can be pending, success or failed. + Status PcapOwnershipNewResponseStatus `json:"status,required"` + // The RFC 3339 timestamp when the bucket was added to packet captures API. + Submitted string `json:"submitted,required"` + // The RFC 3339 timestamp when the bucket was validated. + Validated string `json:"validated"` + JSON pcapOwnershipNewResponseJSON `json:"-"` +} + +// pcapOwnershipNewResponseJSON contains the JSON metadata for the struct +// [PcapOwnershipNewResponse] +type pcapOwnershipNewResponseJSON struct { + ID apijson.Field + DestinationConf apijson.Field + Filename apijson.Field + Status apijson.Field + Submitted apijson.Field + Validated apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapOwnershipNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The status of the ownership challenge. Can be pending, success or failed. +type PcapOwnershipNewResponseStatus string + +const ( + PcapOwnershipNewResponseStatusPending PcapOwnershipNewResponseStatus = "pending" + PcapOwnershipNewResponseStatusSuccess PcapOwnershipNewResponseStatus = "success" + PcapOwnershipNewResponseStatusFailed PcapOwnershipNewResponseStatus = "failed" +) + +type PcapOwnershipGetResponse struct { // The bucket ID associated with the packet captures API. ID string `json:"id,required"` // The full URI for the bucket. This field only applies to `full` packet captures. @@ -76,18 +129,17 @@ type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse str // The ownership challenge filename stored in the bucket. Filename string `json:"filename,required"` // The status of the ownership challenge. Can be pending, success or failed. - Status PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatus `json:"status,required"` + Status PcapOwnershipGetResponseStatus `json:"status,required"` // The RFC 3339 timestamp when the bucket was added to packet captures API. Submitted string `json:"submitted,required"` // The RFC 3339 timestamp when the bucket was validated. - Validated string `json:"validated"` - JSON pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseJSON `json:"-"` + Validated string `json:"validated"` + JSON pcapOwnershipGetResponseJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse] -type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseJSON struct { +// pcapOwnershipGetResponseJSON contains the JSON metadata for the struct +// [PcapOwnershipGetResponse] +type pcapOwnershipGetResponseJSON struct { ID apijson.Field DestinationConf apijson.Field Filename apijson.Field @@ -98,20 +150,20 @@ type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseJSON ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the ownership challenge. Can be pending, success or failed. -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatus string +type PcapOwnershipGetResponseStatus string const ( - PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatusPending PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatus = "pending" - PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatusSuccess PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatus = "success" - PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatusFailed PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseStatus = "failed" + PcapOwnershipGetResponseStatusPending PcapOwnershipGetResponseStatus = "pending" + PcapOwnershipGetResponseStatusSuccess PcapOwnershipGetResponseStatus = "success" + PcapOwnershipGetResponseStatusFailed PcapOwnershipGetResponseStatus = "failed" ) -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse struct { +type PcapOwnershipValidateResponse struct { // The bucket ID associated with the packet captures API. ID string `json:"id,required"` // The full URI for the bucket. This field only applies to `full` packet captures. @@ -119,18 +171,17 @@ type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse struct { // The ownership challenge filename stored in the bucket. Filename string `json:"filename,required"` // The status of the ownership challenge. Can be pending, success or failed. - Status PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatus `json:"status,required"` + Status PcapOwnershipValidateResponseStatus `json:"status,required"` // The RFC 3339 timestamp when the bucket was added to packet captures API. Submitted string `json:"submitted,required"` // The RFC 3339 timestamp when the bucket was validated. - Validated string `json:"validated"` - JSON pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseJSON `json:"-"` + Validated string `json:"validated"` + JSON pcapOwnershipValidateResponseJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseJSON contains -// the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse] -type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseJSON struct { +// pcapOwnershipValidateResponseJSON contains the JSON metadata for the struct +// [PcapOwnershipValidateResponse] +type pcapOwnershipValidateResponseJSON struct { ID apijson.Field DestinationConf apijson.Field Filename apijson.Field @@ -141,41 +192,40 @@ type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The status of the ownership challenge. Can be pending, success or failed. -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatus string +type PcapOwnershipValidateResponseStatus string const ( - PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatusPending PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatus = "pending" - PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatusSuccess PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatus = "success" - PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatusFailed PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseStatus = "failed" + PcapOwnershipValidateResponseStatusPending PcapOwnershipValidateResponseStatus = "pending" + PcapOwnershipValidateResponseStatusSuccess PcapOwnershipValidateResponseStatus = "success" + PcapOwnershipValidateResponseStatusFailed PcapOwnershipValidateResponseStatus = "failed" ) -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesParams struct { +type PcapOwnershipNewParams struct { // The full URI for the bucket. This field only applies to `full` packet captures. DestinationConf param.Field[string] `json:"destination_conf,required"` } -func (r PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesParams) MarshalJSON() (data []byte, err error) { +func (r PcapOwnershipNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelope struct { - Errors []PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessages `json:"messages,required"` - Result PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponse `json:"result,required"` +type PcapOwnershipNewResponseEnvelope struct { + Errors []PcapOwnershipNewResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapOwnershipNewResponseEnvelopeMessages `json:"messages,required"` + Result PcapOwnershipNewResponse `json:"result,required"` // Whether the API call was successful - Success PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeSuccess `json:"success,required"` - JSON pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeJSON `json:"-"` + Success PcapOwnershipNewResponseEnvelopeSuccess `json:"success,required"` + JSON pcapOwnershipNewResponseEnvelopeJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelope] -type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeJSON struct { +// pcapOwnershipNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [PcapOwnershipNewResponseEnvelope] +type pcapOwnershipNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -184,71 +234,68 @@ type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnve ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON `json:"-"` +type PcapOwnershipNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipNewResponseEnvelopeErrorsJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrors] -type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON struct { +// pcapOwnershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [PcapOwnershipNewResponseEnvelopeErrors] +type pcapOwnershipNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON `json:"-"` +type PcapOwnershipNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipNewResponseEnvelopeMessagesJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessages] -type pcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON struct { +// pcapOwnershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [PcapOwnershipNewResponseEnvelopeMessages] +type pcapOwnershipNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeSuccess bool +type PcapOwnershipNewResponseEnvelopeSuccess bool const ( - PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeSuccessTrue PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesResponseEnvelopeSuccess = true + PcapOwnershipNewResponseEnvelopeSuccessTrue PcapOwnershipNewResponseEnvelopeSuccess = true ) -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelope struct { - Errors []PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessages `json:"messages,required"` - Result []PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponse `json:"result,required,nullable"` +type PcapOwnershipGetResponseEnvelope struct { + Errors []PcapOwnershipGetResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapOwnershipGetResponseEnvelopeMessages `json:"messages,required"` + Result []PcapOwnershipGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeSuccess `json:"success,required"` - ResultInfo PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfo `json:"result_info"` - JSON pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeJSON `json:"-"` + Success PcapOwnershipGetResponseEnvelopeSuccess `json:"success,required"` + ResultInfo PcapOwnershipGetResponseEnvelopeResultInfo `json:"result_info"` + JSON pcapOwnershipGetResponseEnvelopeJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelope] -type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeJSON struct { +// pcapOwnershipGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [PcapOwnershipGetResponseEnvelope] +type pcapOwnershipGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -258,58 +305,56 @@ type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeJSO ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrorsJSON `json:"-"` +type PcapOwnershipGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipGetResponseEnvelopeErrorsJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrors] -type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrorsJSON struct { +// pcapOwnershipGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [PcapOwnershipGetResponseEnvelopeErrors] +type pcapOwnershipGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessagesJSON `json:"-"` +type PcapOwnershipGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipGetResponseEnvelopeMessagesJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessages] -type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessagesJSON struct { +// pcapOwnershipGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [PcapOwnershipGetResponseEnvelopeMessages] +type pcapOwnershipGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeSuccess bool +type PcapOwnershipGetResponseEnvelopeSuccess bool const ( - PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeSuccessTrue PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeSuccess = true + PcapOwnershipGetResponseEnvelopeSuccessTrue PcapOwnershipGetResponseEnvelopeSuccess = true ) -type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfo struct { +type PcapOwnershipGetResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -317,14 +362,13 @@ type PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeRes // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON pcapOwnershipGetResponseEnvelopeResultInfoJSON `json:"-"` } -// pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfo] -type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfoJSON struct { +// pcapOwnershipGetResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [PcapOwnershipGetResponseEnvelopeResultInfo] +type pcapOwnershipGetResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -333,6 +377,86 @@ type pcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeRes ExtraFields map[string]apijson.Field } -func (r *PcapOwnershipMagicPcapCollectionListPcaPsBucketOwnershipResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *PcapOwnershipGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type PcapOwnershipValidateParams struct { + // The full URI for the bucket. This field only applies to `full` packet captures. + DestinationConf param.Field[string] `json:"destination_conf,required"` + // The ownership challenge filename stored in the bucket. + OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"` +} + +func (r PcapOwnershipValidateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type PcapOwnershipValidateResponseEnvelope struct { + Errors []PcapOwnershipValidateResponseEnvelopeErrors `json:"errors,required"` + Messages []PcapOwnershipValidateResponseEnvelopeMessages `json:"messages,required"` + Result PcapOwnershipValidateResponse `json:"result,required"` + // Whether the API call was successful + Success PcapOwnershipValidateResponseEnvelopeSuccess `json:"success,required"` + JSON pcapOwnershipValidateResponseEnvelopeJSON `json:"-"` +} + +// pcapOwnershipValidateResponseEnvelopeJSON contains the JSON metadata for the +// struct [PcapOwnershipValidateResponseEnvelope] +type pcapOwnershipValidateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapOwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PcapOwnershipValidateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipValidateResponseEnvelopeErrorsJSON `json:"-"` +} + +// pcapOwnershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [PcapOwnershipValidateResponseEnvelopeErrors] +type pcapOwnershipValidateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapOwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type PcapOwnershipValidateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON pcapOwnershipValidateResponseEnvelopeMessagesJSON `json:"-"` +} + +// pcapOwnershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [PcapOwnershipValidateResponseEnvelopeMessages] +type pcapOwnershipValidateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *PcapOwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type PcapOwnershipValidateResponseEnvelopeSuccess bool + +const ( + PcapOwnershipValidateResponseEnvelopeSuccessTrue PcapOwnershipValidateResponseEnvelopeSuccess = true +) diff --git a/pcapownership_test.go b/pcapownership_test.go index 45784ff7206..c40fa7844d3 100644 --- a/pcapownership_test.go +++ b/pcapownership_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestPcapOwnershipDelete(t *testing.T) { +func TestPcapOwnershipNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,12 @@ func TestPcapOwnershipDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Pcaps.Ownerships.Delete( + _, err := client.Pcaps.Ownerships.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.PcapOwnershipNewParams{ + DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +45,7 @@ func TestPcapOwnershipDelete(t *testing.T) { } } -func TestPcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCaptures(t *testing.T) { +func TestPcapOwnershipDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,13 +61,37 @@ func TestPcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCaptures(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pcaps.Ownerships.MagicPcapCollectionAddBucketsForFullPacketCaptures( + err := client.Pcaps.Ownerships.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCapturesParams{ - DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestPcapOwnershipGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), ) + _, err := client.Pcaps.Ownerships.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -75,7 +101,7 @@ func TestPcapOwnershipMagicPcapCollectionAddBucketsForFullPacketCaptures(t *test } } -func TestPcapOwnershipMagicPcapCollectionListPcaPsBucketOwnership(t *testing.T) { +func TestPcapOwnershipValidate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -91,7 +117,14 @@ func TestPcapOwnershipMagicPcapCollectionListPcaPsBucketOwnership(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Pcaps.Ownerships.MagicPcapCollectionListPcaPsBucketOwnership(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Pcaps.Ownerships.Validate( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.PcapOwnershipValidateParams{ + DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"), + OwnershipChallenge: cloudflare.F("ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/pcapownershipvalidate.go b/pcapownershipvalidate.go deleted file mode 100644 index bad745ba13e..00000000000 --- a/pcapownershipvalidate.go +++ /dev/null @@ -1,171 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// PcapOwnershipValidateService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewPcapOwnershipValidateService] -// method instead. -type PcapOwnershipValidateService struct { - Options []option.RequestOption -} - -// NewPcapOwnershipValidateService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewPcapOwnershipValidateService(opts ...option.RequestOption) (r *PcapOwnershipValidateService) { - r = &PcapOwnershipValidateService{} - r.Options = opts - return -} - -// Validates buckets added to the packet captures API. -func (r *PcapOwnershipValidateService) MagicPcapCollectionValidateBucketsForFullPacketCaptures(ctx context.Context, accountIdentifier string, body PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesParams, opts ...option.RequestOption) (res *PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse, err error) { - opts = append(r.Options[:], opts...) - var env PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelope - path := fmt.Sprintf("accounts/%s/pcaps/ownership/validate", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse struct { - // The bucket ID associated with the packet captures API. - ID string `json:"id,required"` - // The full URI for the bucket. This field only applies to `full` packet captures. - DestinationConf string `json:"destination_conf,required"` - // The ownership challenge filename stored in the bucket. - Filename string `json:"filename,required"` - // The status of the ownership challenge. Can be pending, success or failed. - Status PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatus `json:"status,required"` - // The RFC 3339 timestamp when the bucket was added to packet captures API. - Submitted string `json:"submitted,required"` - // The RFC 3339 timestamp when the bucket was validated. - Validated string `json:"validated"` - JSON pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseJSON `json:"-"` -} - -// pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseJSON -// contains the JSON metadata for the struct -// [PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse] -type pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseJSON struct { - ID apijson.Field - DestinationConf apijson.Field - Filename apijson.Field - Status apijson.Field - Submitted apijson.Field - Validated apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The status of the ownership challenge. Can be pending, success or failed. -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatus string - -const ( - PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatusPending PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatus = "pending" - PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatusSuccess PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatus = "success" - PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatusFailed PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseStatus = "failed" -) - -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesParams struct { - // The full URI for the bucket. This field only applies to `full` packet captures. - DestinationConf param.Field[string] `json:"destination_conf,required"` - // The ownership challenge filename stored in the bucket. - OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"` -} - -func (r PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelope struct { - Errors []PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrors `json:"errors,required"` - Messages []PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessages `json:"messages,required"` - Result PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponse `json:"result,required"` - // Whether the API call was successful - Success PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeSuccess `json:"success,required"` - JSON pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeJSON `json:"-"` -} - -// pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelope] -type pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON `json:"-"` -} - -// pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrors] -type pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON `json:"-"` -} - -// pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessages] -type pcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeSuccess bool - -const ( - PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeSuccessTrue PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesResponseEnvelopeSuccess = true -) diff --git a/pcapownershipvalidate_test.go b/pcapownershipvalidate_test.go deleted file mode 100644 index 4616e9c23cf..00000000000 --- a/pcapownershipvalidate_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestPcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCaptures(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Pcaps.Ownerships.Validates.MagicPcapCollectionValidateBucketsForFullPacketCaptures( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.PcapOwnershipValidateMagicPcapCollectionValidateBucketsForFullPacketCapturesParams{ - DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"), - OwnershipChallenge: cloudflare.F("ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/purgecach.go b/purgecach.go deleted file mode 100644 index 83f5ba944cb..00000000000 --- a/purgecach.go +++ /dev/null @@ -1,222 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// PurgeCachService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewPurgeCachService] method instead. -type PurgeCachService struct { - Options []option.RequestOption -} - -// NewPurgeCachService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewPurgeCachService(opts ...option.RequestOption) (r *PurgeCachService) { - r = &PurgeCachService{} - r.Options = opts - return -} - -// ### Purge All Cached Content -// -// Removes ALL files from Cloudflare's cache. All tiers can purge everything. -// -// ### Purge Cached Content by URL -// -// Granularly removes one or more files from Cloudflare's cache by specifying URLs. -// All tiers can purge by URL. -// -// To purge files with custom cache keys, include the headers used to compute the -// cache key as in the example. If you have a device type or geo in your cache key, -// you will need to include the CF-Device-Type or CF-IPCountry headers. If you have -// lang in your cache key, you will need to include the Accept-Language header. -// -// **NB:** When including the Origin header, be sure to include the **scheme** and -// **hostname**. The port number can be omitted if it is the default port (80 for -// http, 443 for https), but must be included otherwise. -// -// ### Purge Cached Content by Tag, Host or Prefix -// -// Granularly removes one or more files from Cloudflare's cache either by -// specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise -// customers are permitted to purge by Tag, Host or Prefix. -// -// **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 -// purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or -// prefixes in one API call. This rate limit can be raised for customers who need -// to purge at higher volume. -func (r *PurgeCachService) ZonePurge(ctx context.Context, identifier string, body PurgeCachZonePurgeParams, opts ...option.RequestOption) (res *PurgeCachZonePurgeResponse, err error) { - opts = append(r.Options[:], opts...) - var env PurgeCachZonePurgeResponseEnvelope - path := fmt.Sprintf("zones/%s/purge_cache", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type PurgeCachZonePurgeResponse struct { - // Identifier - ID string `json:"id,required"` - JSON purgeCachZonePurgeResponseJSON `json:"-"` -} - -// purgeCachZonePurgeResponseJSON contains the JSON metadata for the struct -// [PurgeCachZonePurgeResponse] -type purgeCachZonePurgeResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PurgeCachZonePurgeResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// This interface is a union satisfied by one of the following: -// [PurgeCachZonePurgeParamsABb3jQf9Flex], -// [PurgeCachZonePurgeParamsABb3jQf9Everything], -// [PurgeCachZonePurgeParamsABb3jQf9Files]. -type PurgeCachZonePurgeParams interface { - ImplementsPurgeCachZonePurgeParams() -} - -type PurgeCachZonePurgeParamsABb3jQf9Flex struct { - Hosts param.Field[[]string] `json:"hosts"` - Prefixes param.Field[[]string] `json:"prefixes"` - Tags param.Field[[]string] `json:"tags"` -} - -func (r PurgeCachZonePurgeParamsABb3jQf9Flex) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (PurgeCachZonePurgeParamsABb3jQf9Flex) ImplementsPurgeCachZonePurgeParams() { - -} - -type PurgeCachZonePurgeParamsABb3jQf9Everything struct { - PurgeEverything param.Field[bool] `json:"purge_everything"` -} - -func (r PurgeCachZonePurgeParamsABb3jQf9Everything) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (PurgeCachZonePurgeParamsABb3jQf9Everything) ImplementsPurgeCachZonePurgeParams() { - -} - -type PurgeCachZonePurgeParamsABb3jQf9Files struct { - Files param.Field[[]PurgeCachZonePurgeParamsABb3jQf9FilesFile] `json:"files"` -} - -func (r PurgeCachZonePurgeParamsABb3jQf9Files) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (PurgeCachZonePurgeParamsABb3jQf9Files) ImplementsPurgeCachZonePurgeParams() { - -} - -// Satisfied by [shared.UnionString], -// [PurgeCachZonePurgeParamsABb3jQf9FilesFilesABb3jQf9URLAndHeaders]. -type PurgeCachZonePurgeParamsABb3jQf9FilesFile interface { - ImplementsPurgeCachZonePurgeParamsABb3jQf9FilesFile() -} - -type PurgeCachZonePurgeParamsABb3jQf9FilesFilesABb3jQf9URLAndHeaders struct { - Headers param.Field[interface{}] `json:"headers"` - URL param.Field[string] `json:"url"` -} - -func (r PurgeCachZonePurgeParamsABb3jQf9FilesFilesABb3jQf9URLAndHeaders) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r PurgeCachZonePurgeParamsABb3jQf9FilesFilesABb3jQf9URLAndHeaders) ImplementsPurgeCachZonePurgeParamsABb3jQf9FilesFile() { -} - -type PurgeCachZonePurgeResponseEnvelope struct { - Errors []PurgeCachZonePurgeResponseEnvelopeErrors `json:"errors,required"` - Messages []PurgeCachZonePurgeResponseEnvelopeMessages `json:"messages,required"` - Result PurgeCachZonePurgeResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success PurgeCachZonePurgeResponseEnvelopeSuccess `json:"success,required"` - JSON purgeCachZonePurgeResponseEnvelopeJSON `json:"-"` -} - -// purgeCachZonePurgeResponseEnvelopeJSON contains the JSON metadata for the struct -// [PurgeCachZonePurgeResponseEnvelope] -type purgeCachZonePurgeResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PurgeCachZonePurgeResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PurgeCachZonePurgeResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON purgeCachZonePurgeResponseEnvelopeErrorsJSON `json:"-"` -} - -// purgeCachZonePurgeResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [PurgeCachZonePurgeResponseEnvelopeErrors] -type purgeCachZonePurgeResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PurgeCachZonePurgeResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type PurgeCachZonePurgeResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON purgeCachZonePurgeResponseEnvelopeMessagesJSON `json:"-"` -} - -// purgeCachZonePurgeResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [PurgeCachZonePurgeResponseEnvelopeMessages] -type purgeCachZonePurgeResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *PurgeCachZonePurgeResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type PurgeCachZonePurgeResponseEnvelopeSuccess bool - -const ( - PurgeCachZonePurgeResponseEnvelopeSuccessTrue PurgeCachZonePurgeResponseEnvelopeSuccess = true -) diff --git a/purgecach_test.go b/purgecach_test.go deleted file mode 100644 index d2a199fa60e..00000000000 --- a/purgecach_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestPurgeCachZonePurgeWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.PurgeCaches.ZonePurge( - context.TODO(), - "string", - cloudflare.PurgeCachZonePurgeParamsABb3jQf9Flex{ - Hosts: cloudflare.F([]string{"www.example.com", "images.example.com"}), - Prefixes: cloudflare.F([]string{"www.example.com/foo", "images.example.com/bar/baz"}), - Tags: cloudflare.F([]string{"some-tag", "another-tag"}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radarbgphijack.go b/radarbgphijack.go index 031d7f083a3..c2bc8d7a987 100644 --- a/radarbgphijack.go +++ b/radarbgphijack.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -34,28 +35,59 @@ func NewRadarBGPHijackService(opts ...option.RequestOption) (r *RadarBGPHijackSe } // Get the BGP hijack events. (Beta) -func (r *RadarBGPHijackService) Events(ctx context.Context, query RadarBGPHijackEventsParams, opts ...option.RequestOption) (res *RadarBGPHijackEventsResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarBGPHijackEventsResponseEnvelope +func (r *RadarBGPHijackService) List(ctx context.Context, query RadarBGPHijackListParams, opts ...option.RequestOption) (res *shared.V4PagePagination[RadarBGPHijackListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := "radar/bgp/hijacks/events" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Get the BGP hijack events. (Beta) +func (r *RadarBGPHijackService) ListAutoPaging(ctx context.Context, query RadarBGPHijackListParams, opts ...option.RequestOption) *shared.V4PagePaginationAutoPager[RadarBGPHijackListResponse] { + return shared.NewV4PagePaginationAutoPager(r.List(ctx, query, opts...)) +} + +type RadarBGPHijackListResponse struct { + Result RadarBGPHijackListResponseResult `json:"result,required"` + ResultInfo RadarBGPHijackListResponseResultInfo `json:"result_info,required"` + Success bool `json:"success,required"` + JSON radarBGPHijackListResponseJSON `json:"-"` +} + +// radarBGPHijackListResponseJSON contains the JSON metadata for the struct +// [RadarBGPHijackListResponse] +type radarBGPHijackListResponseJSON struct { + Result apijson.Field + ResultInfo apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPHijackListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type RadarBGPHijackEventsResponse struct { - AsnInfo []RadarBGPHijackEventsResponseAsnInfo `json:"asn_info,required"` - Events []RadarBGPHijackEventsResponseEvent `json:"events,required"` - TotalMonitors int64 `json:"total_monitors,required"` - JSON radarBGPHijackEventsResponseJSON `json:"-"` +type RadarBGPHijackListResponseResult struct { + AsnInfo []RadarBGPHijackListResponseResultAsnInfo `json:"asn_info,required"` + Events []RadarBGPHijackListResponseResultEvent `json:"events,required"` + TotalMonitors int64 `json:"total_monitors,required"` + JSON radarBGPHijackListResponseResultJSON `json:"-"` } -// radarBGPHijackEventsResponseJSON contains the JSON metadata for the struct -// [RadarBGPHijackEventsResponse] -type radarBGPHijackEventsResponseJSON struct { +// radarBGPHijackListResponseResultJSON contains the JSON metadata for the struct +// [RadarBGPHijackListResponseResult] +type radarBGPHijackListResponseResultJSON struct { AsnInfo apijson.Field Events apijson.Field TotalMonitors apijson.Field @@ -63,20 +95,20 @@ type radarBGPHijackEventsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarBGPHijackEventsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarBGPHijackListResponseResult) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarBGPHijackEventsResponseAsnInfo struct { - Asn int64 `json:"asn,required"` - CountryCode string `json:"country_code,required"` - OrgName string `json:"org_name,required"` - JSON radarBGPHijackEventsResponseAsnInfoJSON `json:"-"` +type RadarBGPHijackListResponseResultAsnInfo struct { + Asn int64 `json:"asn,required"` + CountryCode string `json:"country_code,required"` + OrgName string `json:"org_name,required"` + JSON radarBGPHijackListResponseResultAsnInfoJSON `json:"-"` } -// radarBGPHijackEventsResponseAsnInfoJSON contains the JSON metadata for the -// struct [RadarBGPHijackEventsResponseAsnInfo] -type radarBGPHijackEventsResponseAsnInfoJSON struct { +// radarBGPHijackListResponseResultAsnInfoJSON contains the JSON metadata for the +// struct [RadarBGPHijackListResponseResultAsnInfo] +type radarBGPHijackListResponseResultAsnInfoJSON struct { Asn apijson.Field CountryCode apijson.Field OrgName apijson.Field @@ -84,35 +116,35 @@ type radarBGPHijackEventsResponseAsnInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarBGPHijackEventsResponseAsnInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RadarBGPHijackListResponseResultAsnInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarBGPHijackEventsResponseEvent struct { - ID int64 `json:"id,required"` - ConfidenceScore int64 `json:"confidence_score,required"` - Duration int64 `json:"duration,required"` - EventType int64 `json:"event_type,required"` - HijackMsgsCount int64 `json:"hijack_msgs_count,required"` - HijackerAsn int64 `json:"hijacker_asn,required"` - HijackerCountry string `json:"hijacker_country,required"` - IsStale bool `json:"is_stale,required"` - MaxHijackTs string `json:"max_hijack_ts,required"` - MaxMsgTs string `json:"max_msg_ts,required"` - MinHijackTs string `json:"min_hijack_ts,required"` - OnGoingCount int64 `json:"on_going_count,required"` - PeerAsns []int64 `json:"peer_asns,required"` - PeerIPCount int64 `json:"peer_ip_count,required"` - Prefixes []string `json:"prefixes,required"` - Tags []RadarBGPHijackEventsResponseEventsTag `json:"tags,required"` - VictimAsns []int64 `json:"victim_asns,required"` - VictimCountries []string `json:"victim_countries,required"` - JSON radarBGPHijackEventsResponseEventJSON `json:"-"` +type RadarBGPHijackListResponseResultEvent struct { + ID int64 `json:"id,required"` + ConfidenceScore int64 `json:"confidence_score,required"` + Duration int64 `json:"duration,required"` + EventType int64 `json:"event_type,required"` + HijackMsgsCount int64 `json:"hijack_msgs_count,required"` + HijackerAsn int64 `json:"hijacker_asn,required"` + HijackerCountry string `json:"hijacker_country,required"` + IsStale bool `json:"is_stale,required"` + MaxHijackTs string `json:"max_hijack_ts,required"` + MaxMsgTs string `json:"max_msg_ts,required"` + MinHijackTs string `json:"min_hijack_ts,required"` + OnGoingCount int64 `json:"on_going_count,required"` + PeerAsns []int64 `json:"peer_asns,required"` + PeerIPCount int64 `json:"peer_ip_count,required"` + Prefixes []string `json:"prefixes,required"` + Tags []RadarBGPHijackListResponseResultEventsTag `json:"tags,required"` + VictimAsns []int64 `json:"victim_asns,required"` + VictimCountries []string `json:"victim_countries,required"` + JSON radarBGPHijackListResponseResultEventJSON `json:"-"` } -// radarBGPHijackEventsResponseEventJSON contains the JSON metadata for the struct -// [RadarBGPHijackEventsResponseEvent] -type radarBGPHijackEventsResponseEventJSON struct { +// radarBGPHijackListResponseResultEventJSON contains the JSON metadata for the +// struct [RadarBGPHijackListResponseResultEvent] +type radarBGPHijackListResponseResultEventJSON struct { ID apijson.Field ConfidenceScore apijson.Field Duration apijson.Field @@ -135,41 +167,64 @@ type radarBGPHijackEventsResponseEventJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarBGPHijackEventsResponseEvent) UnmarshalJSON(data []byte) (err error) { +func (r *RadarBGPHijackListResponseResultEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarBGPHijackEventsResponseEventsTag struct { - Name string `json:"name,required"` - Score int64 `json:"score,required"` - JSON radarBGPHijackEventsResponseEventsTagJSON `json:"-"` +type RadarBGPHijackListResponseResultEventsTag struct { + Name string `json:"name,required"` + Score int64 `json:"score,required"` + JSON radarBGPHijackListResponseResultEventsTagJSON `json:"-"` } -// radarBGPHijackEventsResponseEventsTagJSON contains the JSON metadata for the -// struct [RadarBGPHijackEventsResponseEventsTag] -type radarBGPHijackEventsResponseEventsTagJSON struct { +// radarBGPHijackListResponseResultEventsTagJSON contains the JSON metadata for the +// struct [RadarBGPHijackListResponseResultEventsTag] +type radarBGPHijackListResponseResultEventsTagJSON struct { Name apijson.Field Score apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarBGPHijackEventsResponseEventsTag) UnmarshalJSON(data []byte) (err error) { +func (r *RadarBGPHijackListResponseResultEventsTag) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPHijackListResponseResultInfo struct { + Count int64 `json:"count,required"` + Page int64 `json:"page,required"` + PerPage int64 `json:"per_page,required"` + TotalCount int64 `json:"total_count,required"` + JSON radarBGPHijackListResponseResultInfoJSON `json:"-"` +} + +// radarBGPHijackListResponseResultInfoJSON contains the JSON metadata for the +// struct [RadarBGPHijackListResponseResultInfo] +type radarBGPHijackListResponseResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPHijackListResponseResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarBGPHijackEventsParams struct { +type RadarBGPHijackListParams struct { // End of the date range (inclusive). DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"` // Shorthand date ranges for the last X days - use when you don't need specific // start and end dates. - DateRange param.Field[RadarBGPHijackEventsParamsDateRange] `query:"dateRange"` + DateRange param.Field[RadarBGPHijackListParamsDateRange] `query:"dateRange"` // Start of the date range (inclusive). DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"` // The unique identifier of a event EventID param.Field[int64] `query:"eventId"` // Format results are returned in. - Format param.Field[RadarBGPHijackEventsParamsFormat] `query:"format"` + Format param.Field[RadarBGPHijackListParamsFormat] `query:"format"` // The potential hijacker AS of a BGP hijack event HijackerAsn param.Field[int64] `query:"hijackerAsn"` // The potential hijacker or victim AS of a BGP hijack event @@ -187,16 +242,16 @@ type RadarBGPHijackEventsParams struct { // The prefix hijacked during a BGP hijack event Prefix param.Field[string] `query:"prefix"` // Sort events by field - SortBy param.Field[RadarBGPHijackEventsParamsSortBy] `query:"sortBy"` + SortBy param.Field[RadarBGPHijackListParamsSortBy] `query:"sortBy"` // Sort order - SortOrder param.Field[RadarBGPHijackEventsParamsSortOrder] `query:"sortOrder"` + SortOrder param.Field[RadarBGPHijackListParamsSortOrder] `query:"sortOrder"` // The potential victim AS of a BGP hijack event VictimAsn param.Field[int64] `query:"victimAsn"` } -// URLQuery serializes [RadarBGPHijackEventsParams]'s query parameters as +// URLQuery serializes [RadarBGPHijackListParams]'s query parameters as // `url.Values`. -func (r RadarBGPHijackEventsParams) URLQuery() (v url.Values) { +func (r RadarBGPHijackListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -205,91 +260,47 @@ func (r RadarBGPHijackEventsParams) URLQuery() (v url.Values) { // Shorthand date ranges for the last X days - use when you don't need specific // start and end dates. -type RadarBGPHijackEventsParamsDateRange string +type RadarBGPHijackListParamsDateRange string const ( - RadarBGPHijackEventsParamsDateRange1d RadarBGPHijackEventsParamsDateRange = "1d" - RadarBGPHijackEventsParamsDateRange2d RadarBGPHijackEventsParamsDateRange = "2d" - RadarBGPHijackEventsParamsDateRange7d RadarBGPHijackEventsParamsDateRange = "7d" - RadarBGPHijackEventsParamsDateRange14d RadarBGPHijackEventsParamsDateRange = "14d" - RadarBGPHijackEventsParamsDateRange28d RadarBGPHijackEventsParamsDateRange = "28d" - RadarBGPHijackEventsParamsDateRange12w RadarBGPHijackEventsParamsDateRange = "12w" - RadarBGPHijackEventsParamsDateRange24w RadarBGPHijackEventsParamsDateRange = "24w" - RadarBGPHijackEventsParamsDateRange52w RadarBGPHijackEventsParamsDateRange = "52w" - RadarBGPHijackEventsParamsDateRange1dControl RadarBGPHijackEventsParamsDateRange = "1dControl" - RadarBGPHijackEventsParamsDateRange2dControl RadarBGPHijackEventsParamsDateRange = "2dControl" - RadarBGPHijackEventsParamsDateRange7dControl RadarBGPHijackEventsParamsDateRange = "7dControl" - RadarBGPHijackEventsParamsDateRange14dControl RadarBGPHijackEventsParamsDateRange = "14dControl" - RadarBGPHijackEventsParamsDateRange28dControl RadarBGPHijackEventsParamsDateRange = "28dControl" - RadarBGPHijackEventsParamsDateRange12wControl RadarBGPHijackEventsParamsDateRange = "12wControl" - RadarBGPHijackEventsParamsDateRange24wControl RadarBGPHijackEventsParamsDateRange = "24wControl" + RadarBGPHijackListParamsDateRange1d RadarBGPHijackListParamsDateRange = "1d" + RadarBGPHijackListParamsDateRange2d RadarBGPHijackListParamsDateRange = "2d" + RadarBGPHijackListParamsDateRange7d RadarBGPHijackListParamsDateRange = "7d" + RadarBGPHijackListParamsDateRange14d RadarBGPHijackListParamsDateRange = "14d" + RadarBGPHijackListParamsDateRange28d RadarBGPHijackListParamsDateRange = "28d" + RadarBGPHijackListParamsDateRange12w RadarBGPHijackListParamsDateRange = "12w" + RadarBGPHijackListParamsDateRange24w RadarBGPHijackListParamsDateRange = "24w" + RadarBGPHijackListParamsDateRange52w RadarBGPHijackListParamsDateRange = "52w" + RadarBGPHijackListParamsDateRange1dControl RadarBGPHijackListParamsDateRange = "1dControl" + RadarBGPHijackListParamsDateRange2dControl RadarBGPHijackListParamsDateRange = "2dControl" + RadarBGPHijackListParamsDateRange7dControl RadarBGPHijackListParamsDateRange = "7dControl" + RadarBGPHijackListParamsDateRange14dControl RadarBGPHijackListParamsDateRange = "14dControl" + RadarBGPHijackListParamsDateRange28dControl RadarBGPHijackListParamsDateRange = "28dControl" + RadarBGPHijackListParamsDateRange12wControl RadarBGPHijackListParamsDateRange = "12wControl" + RadarBGPHijackListParamsDateRange24wControl RadarBGPHijackListParamsDateRange = "24wControl" ) // Format results are returned in. -type RadarBGPHijackEventsParamsFormat string +type RadarBGPHijackListParamsFormat string const ( - RadarBGPHijackEventsParamsFormatJson RadarBGPHijackEventsParamsFormat = "JSON" - RadarBGPHijackEventsParamsFormatCsv RadarBGPHijackEventsParamsFormat = "CSV" + RadarBGPHijackListParamsFormatJson RadarBGPHijackListParamsFormat = "JSON" + RadarBGPHijackListParamsFormatCsv RadarBGPHijackListParamsFormat = "CSV" ) // Sort events by field -type RadarBGPHijackEventsParamsSortBy string +type RadarBGPHijackListParamsSortBy string const ( - RadarBGPHijackEventsParamsSortByID RadarBGPHijackEventsParamsSortBy = "ID" - RadarBGPHijackEventsParamsSortByTime RadarBGPHijackEventsParamsSortBy = "TIME" - RadarBGPHijackEventsParamsSortByConfidence RadarBGPHijackEventsParamsSortBy = "CONFIDENCE" + RadarBGPHijackListParamsSortByID RadarBGPHijackListParamsSortBy = "ID" + RadarBGPHijackListParamsSortByTime RadarBGPHijackListParamsSortBy = "TIME" + RadarBGPHijackListParamsSortByConfidence RadarBGPHijackListParamsSortBy = "CONFIDENCE" ) // Sort order -type RadarBGPHijackEventsParamsSortOrder string +type RadarBGPHijackListParamsSortOrder string const ( - RadarBGPHijackEventsParamsSortOrderAsc RadarBGPHijackEventsParamsSortOrder = "ASC" - RadarBGPHijackEventsParamsSortOrderDesc RadarBGPHijackEventsParamsSortOrder = "DESC" + RadarBGPHijackListParamsSortOrderAsc RadarBGPHijackListParamsSortOrder = "ASC" + RadarBGPHijackListParamsSortOrderDesc RadarBGPHijackListParamsSortOrder = "DESC" ) - -type RadarBGPHijackEventsResponseEnvelope struct { - Result RadarBGPHijackEventsResponse `json:"result,required"` - ResultInfo RadarBGPHijackEventsResponseEnvelopeResultInfo `json:"result_info,required"` - Success bool `json:"success,required"` - JSON radarBGPHijackEventsResponseEnvelopeJSON `json:"-"` -} - -// radarBGPHijackEventsResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarBGPHijackEventsResponseEnvelope] -type radarBGPHijackEventsResponseEnvelopeJSON struct { - Result apijson.Field - ResultInfo apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPHijackEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPHijackEventsResponseEnvelopeResultInfo struct { - Count int64 `json:"count,required"` - Page int64 `json:"page,required"` - PerPage int64 `json:"per_page,required"` - TotalCount int64 `json:"total_count,required"` - JSON radarBGPHijackEventsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// radarBGPHijackEventsResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [RadarBGPHijackEventsResponseEnvelopeResultInfo] -type radarBGPHijackEventsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPHijackEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radarbgphijack_test.go b/radarbgphijack_test.go index 66bc953a425..cb42f7be5f1 100644 --- a/radarbgphijack_test.go +++ b/radarbgphijack_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarBGPHijackEventsWithOptionalParams(t *testing.T) { +func TestRadarBGPHijackListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,12 +30,12 @@ func TestRadarBGPHijackEventsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.BGP.Hijacks.Events(context.TODO(), cloudflare.RadarBGPHijackEventsParams{ + _, err := client.Radar.BGP.Hijacks.List(context.TODO(), cloudflare.RadarBGPHijackListParams{ DateEnd: cloudflare.F(time.Now()), - DateRange: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsDateRange7d), + DateRange: cloudflare.F(cloudflare.RadarBGPHijackListParamsDateRange7d), DateStart: cloudflare.F(time.Now()), EventID: cloudflare.F(int64(0)), - Format: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarBGPHijackListParamsFormatJson), HijackerAsn: cloudflare.F(int64(0)), InvolvedAsn: cloudflare.F(int64(0)), InvolvedCountry: cloudflare.F("string"), @@ -44,8 +44,8 @@ func TestRadarBGPHijackEventsWithOptionalParams(t *testing.T) { Page: cloudflare.F(int64(0)), PerPage: cloudflare.F(int64(0)), Prefix: cloudflare.F("string"), - SortBy: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsSortByTime), - SortOrder: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsSortOrderDesc), + SortBy: cloudflare.F(cloudflare.RadarBGPHijackListParamsSortByTime), + SortOrder: cloudflare.F(cloudflare.RadarBGPHijackListParamsSortOrderDesc), VictimAsn: cloudflare.F(int64(0)), }) if err != nil { diff --git a/radarbgproute.go b/radarbgproute.go index 8f1b686903b..3552400a199 100644 --- a/radarbgproute.go +++ b/radarbgproute.go @@ -3,14 +3,6 @@ package cloudflare import ( - "context" - "net/http" - "net/url" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -21,6 +13,9 @@ import ( // instead. type RadarBGPRouteService struct { Options []option.RequestOption + Moas *RadarBGPRouteMoaService + Pfx2as *RadarBGPRoutePfx2aService + Stats *RadarBGPRouteStatService } // NewRadarBGPRouteService generates a new service that applies the given options @@ -29,426 +24,8 @@ type RadarBGPRouteService struct { func NewRadarBGPRouteService(opts ...option.RequestOption) (r *RadarBGPRouteService) { r = &RadarBGPRouteService{} r.Options = opts + r.Moas = NewRadarBGPRouteMoaService(opts...) + r.Pfx2as = NewRadarBGPRoutePfx2aService(opts...) + r.Stats = NewRadarBGPRouteStatService(opts...) return } - -// List all Multi-origin AS (MOAS) prefixes on the global routing tables. -func (r *RadarBGPRouteService) Moas(ctx context.Context, query RadarBGPRouteMoasParams, opts ...option.RequestOption) (res *RadarBGPRouteMoasResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarBGPRouteMoasResponseEnvelope - path := "radar/bgp/routes/moas" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lookup prefix-to-origin mapping on global routing tables. -func (r *RadarBGPRouteService) Pfx2as(ctx context.Context, query RadarBGPRoutePfx2asParams, opts ...option.RequestOption) (res *RadarBGPRoutePfx2asResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarBGPRoutePfx2asResponseEnvelope - path := "radar/bgp/routes/pfx2as" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get the BGP routing table stats (Beta). -func (r *RadarBGPRouteService) Stats(ctx context.Context, query RadarBGPRouteStatsParams, opts ...option.RequestOption) (res *RadarBGPRouteStatsResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarBGPRouteStatsResponseEnvelope - path := "radar/bgp/routes/stats" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarBGPRouteMoasResponse struct { - Meta RadarBGPRouteMoasResponseMeta `json:"meta,required"` - Moas []RadarBGPRouteMoasResponseMoa `json:"moas,required"` - JSON radarBGPRouteMoasResponseJSON `json:"-"` -} - -// radarBGPRouteMoasResponseJSON contains the JSON metadata for the struct -// [RadarBGPRouteMoasResponse] -type radarBGPRouteMoasResponseJSON struct { - Meta apijson.Field - Moas apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteMoasResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteMoasResponseMeta struct { - DataTime string `json:"data_time,required"` - QueryTime string `json:"query_time,required"` - TotalPeers int64 `json:"total_peers,required"` - JSON radarBGPRouteMoasResponseMetaJSON `json:"-"` -} - -// radarBGPRouteMoasResponseMetaJSON contains the JSON metadata for the struct -// [RadarBGPRouteMoasResponseMeta] -type radarBGPRouteMoasResponseMetaJSON struct { - DataTime apijson.Field - QueryTime apijson.Field - TotalPeers apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteMoasResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteMoasResponseMoa struct { - Origins []RadarBGPRouteMoasResponseMoasOrigin `json:"origins,required"` - Prefix string `json:"prefix,required"` - JSON radarBGPRouteMoasResponseMoaJSON `json:"-"` -} - -// radarBGPRouteMoasResponseMoaJSON contains the JSON metadata for the struct -// [RadarBGPRouteMoasResponseMoa] -type radarBGPRouteMoasResponseMoaJSON struct { - Origins apijson.Field - Prefix apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteMoasResponseMoa) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteMoasResponseMoasOrigin struct { - Origin int64 `json:"origin,required"` - PeerCount int64 `json:"peer_count,required"` - RpkiValidation string `json:"rpki_validation,required"` - JSON radarBGPRouteMoasResponseMoasOriginJSON `json:"-"` -} - -// radarBGPRouteMoasResponseMoasOriginJSON contains the JSON metadata for the -// struct [RadarBGPRouteMoasResponseMoasOrigin] -type radarBGPRouteMoasResponseMoasOriginJSON struct { - Origin apijson.Field - PeerCount apijson.Field - RpkiValidation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteMoasResponseMoasOrigin) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRoutePfx2asResponse struct { - Meta RadarBGPRoutePfx2asResponseMeta `json:"meta,required"` - PrefixOrigins []RadarBGPRoutePfx2asResponsePrefixOrigin `json:"prefix_origins,required"` - JSON radarBGPRoutePfx2asResponseJSON `json:"-"` -} - -// radarBGPRoutePfx2asResponseJSON contains the JSON metadata for the struct -// [RadarBGPRoutePfx2asResponse] -type radarBGPRoutePfx2asResponseJSON struct { - Meta apijson.Field - PrefixOrigins apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRoutePfx2asResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRoutePfx2asResponseMeta struct { - DataTime string `json:"data_time,required"` - QueryTime string `json:"query_time,required"` - TotalPeers int64 `json:"total_peers,required"` - JSON radarBGPRoutePfx2asResponseMetaJSON `json:"-"` -} - -// radarBGPRoutePfx2asResponseMetaJSON contains the JSON metadata for the struct -// [RadarBGPRoutePfx2asResponseMeta] -type radarBGPRoutePfx2asResponseMetaJSON struct { - DataTime apijson.Field - QueryTime apijson.Field - TotalPeers apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRoutePfx2asResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRoutePfx2asResponsePrefixOrigin struct { - Origin int64 `json:"origin,required"` - PeerCount int64 `json:"peer_count,required"` - Prefix string `json:"prefix,required"` - RpkiValidation string `json:"rpki_validation,required"` - JSON radarBGPRoutePfx2asResponsePrefixOriginJSON `json:"-"` -} - -// radarBGPRoutePfx2asResponsePrefixOriginJSON contains the JSON metadata for the -// struct [RadarBGPRoutePfx2asResponsePrefixOrigin] -type radarBGPRoutePfx2asResponsePrefixOriginJSON struct { - Origin apijson.Field - PeerCount apijson.Field - Prefix apijson.Field - RpkiValidation apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRoutePfx2asResponsePrefixOrigin) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteStatsResponse struct { - Meta RadarBGPRouteStatsResponseMeta `json:"meta,required"` - Stats RadarBGPRouteStatsResponseStats `json:"stats,required"` - JSON radarBGPRouteStatsResponseJSON `json:"-"` -} - -// radarBGPRouteStatsResponseJSON contains the JSON metadata for the struct -// [RadarBGPRouteStatsResponse] -type radarBGPRouteStatsResponseJSON struct { - Meta apijson.Field - Stats apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteStatsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteStatsResponseMeta struct { - DataTime string `json:"data_time,required"` - QueryTime string `json:"query_time,required"` - TotalPeers int64 `json:"total_peers,required"` - JSON radarBGPRouteStatsResponseMetaJSON `json:"-"` -} - -// radarBGPRouteStatsResponseMetaJSON contains the JSON metadata for the struct -// [RadarBGPRouteStatsResponseMeta] -type radarBGPRouteStatsResponseMetaJSON struct { - DataTime apijson.Field - QueryTime apijson.Field - TotalPeers apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteStatsResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteStatsResponseStats struct { - DistinctOrigins int64 `json:"distinct_origins,required"` - DistinctOriginsIPV4 int64 `json:"distinct_origins_ipv4,required"` - DistinctOriginsIPV6 int64 `json:"distinct_origins_ipv6,required"` - DistinctPrefixes int64 `json:"distinct_prefixes,required"` - DistinctPrefixesIPV4 int64 `json:"distinct_prefixes_ipv4,required"` - DistinctPrefixesIPV6 int64 `json:"distinct_prefixes_ipv6,required"` - RoutesInvalid int64 `json:"routes_invalid,required"` - RoutesInvalidIPV4 int64 `json:"routes_invalid_ipv4,required"` - RoutesInvalidIPV6 int64 `json:"routes_invalid_ipv6,required"` - RoutesTotal int64 `json:"routes_total,required"` - RoutesTotalIPV4 int64 `json:"routes_total_ipv4,required"` - RoutesTotalIPV6 int64 `json:"routes_total_ipv6,required"` - RoutesUnknown int64 `json:"routes_unknown,required"` - RoutesUnknownIPV4 int64 `json:"routes_unknown_ipv4,required"` - RoutesUnknownIPV6 int64 `json:"routes_unknown_ipv6,required"` - RoutesValid int64 `json:"routes_valid,required"` - RoutesValidIPV4 int64 `json:"routes_valid_ipv4,required"` - RoutesValidIPV6 int64 `json:"routes_valid_ipv6,required"` - JSON radarBGPRouteStatsResponseStatsJSON `json:"-"` -} - -// radarBGPRouteStatsResponseStatsJSON contains the JSON metadata for the struct -// [RadarBGPRouteStatsResponseStats] -type radarBGPRouteStatsResponseStatsJSON struct { - DistinctOrigins apijson.Field - DistinctOriginsIPV4 apijson.Field - DistinctOriginsIPV6 apijson.Field - DistinctPrefixes apijson.Field - DistinctPrefixesIPV4 apijson.Field - DistinctPrefixesIPV6 apijson.Field - RoutesInvalid apijson.Field - RoutesInvalidIPV4 apijson.Field - RoutesInvalidIPV6 apijson.Field - RoutesTotal apijson.Field - RoutesTotalIPV4 apijson.Field - RoutesTotalIPV6 apijson.Field - RoutesUnknown apijson.Field - RoutesUnknownIPV4 apijson.Field - RoutesUnknownIPV6 apijson.Field - RoutesValid apijson.Field - RoutesValidIPV4 apijson.Field - RoutesValidIPV6 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteStatsResponseStats) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteMoasParams struct { - // Format results are returned in. - Format param.Field[RadarBGPRouteMoasParamsFormat] `query:"format"` - // Lookup only RPKI invalid MOASes - InvalidOnly param.Field[bool] `query:"invalid_only"` - // Lookup MOASes originated by the given ASN - Origin param.Field[int64] `query:"origin"` - // Lookup MOASes by prefix - Prefix param.Field[string] `query:"prefix"` -} - -// URLQuery serializes [RadarBGPRouteMoasParams]'s query parameters as -// `url.Values`. -func (r RadarBGPRouteMoasParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Format results are returned in. -type RadarBGPRouteMoasParamsFormat string - -const ( - RadarBGPRouteMoasParamsFormatJson RadarBGPRouteMoasParamsFormat = "JSON" - RadarBGPRouteMoasParamsFormatCsv RadarBGPRouteMoasParamsFormat = "CSV" -) - -type RadarBGPRouteMoasResponseEnvelope struct { - Result RadarBGPRouteMoasResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarBGPRouteMoasResponseEnvelopeJSON `json:"-"` -} - -// radarBGPRouteMoasResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarBGPRouteMoasResponseEnvelope] -type radarBGPRouteMoasResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteMoasResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRoutePfx2asParams struct { - // Format results are returned in. - Format param.Field[RadarBGPRoutePfx2asParamsFormat] `query:"format"` - // Lookup prefixes originated by the given ASN - Origin param.Field[int64] `query:"origin"` - // Lookup origins of the given prefix - Prefix param.Field[string] `query:"prefix"` - // Return only results with matching rpki status: valid, invalid or unknown - RpkiStatus param.Field[RadarBGPRoutePfx2asParamsRpkiStatus] `query:"rpkiStatus"` -} - -// URLQuery serializes [RadarBGPRoutePfx2asParams]'s query parameters as -// `url.Values`. -func (r RadarBGPRoutePfx2asParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Format results are returned in. -type RadarBGPRoutePfx2asParamsFormat string - -const ( - RadarBGPRoutePfx2asParamsFormatJson RadarBGPRoutePfx2asParamsFormat = "JSON" - RadarBGPRoutePfx2asParamsFormatCsv RadarBGPRoutePfx2asParamsFormat = "CSV" -) - -// Return only results with matching rpki status: valid, invalid or unknown -type RadarBGPRoutePfx2asParamsRpkiStatus string - -const ( - RadarBGPRoutePfx2asParamsRpkiStatusValid RadarBGPRoutePfx2asParamsRpkiStatus = "VALID" - RadarBGPRoutePfx2asParamsRpkiStatusInvalid RadarBGPRoutePfx2asParamsRpkiStatus = "INVALID" - RadarBGPRoutePfx2asParamsRpkiStatusUnknown RadarBGPRoutePfx2asParamsRpkiStatus = "UNKNOWN" -) - -type RadarBGPRoutePfx2asResponseEnvelope struct { - Result RadarBGPRoutePfx2asResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarBGPRoutePfx2asResponseEnvelopeJSON `json:"-"` -} - -// radarBGPRoutePfx2asResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarBGPRoutePfx2asResponseEnvelope] -type radarBGPRoutePfx2asResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRoutePfx2asResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPRouteStatsParams struct { - // Single ASN as integer. - Asn param.Field[int64] `query:"asn"` - // Format results are returned in. - Format param.Field[RadarBGPRouteStatsParamsFormat] `query:"format"` - // Location Alpha2 code. - Location param.Field[string] `query:"location"` -} - -// URLQuery serializes [RadarBGPRouteStatsParams]'s query parameters as -// `url.Values`. -func (r RadarBGPRouteStatsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Format results are returned in. -type RadarBGPRouteStatsParamsFormat string - -const ( - RadarBGPRouteStatsParamsFormatJson RadarBGPRouteStatsParamsFormat = "JSON" - RadarBGPRouteStatsParamsFormatCsv RadarBGPRouteStatsParamsFormat = "CSV" -) - -type RadarBGPRouteStatsResponseEnvelope struct { - Result RadarBGPRouteStatsResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarBGPRouteStatsResponseEnvelopeJSON `json:"-"` -} - -// radarBGPRouteStatsResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarBGPRouteStatsResponseEnvelope] -type radarBGPRouteStatsResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPRouteStatsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radarbgproute_test.go b/radarbgproute_test.go deleted file mode 100644 index e1274706a01..00000000000 --- a/radarbgproute_test.go +++ /dev/null @@ -1,106 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarBGPRouteMoasWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.BGP.Routes.Moas(context.TODO(), cloudflare.RadarBGPRouteMoasParams{ - Format: cloudflare.F(cloudflare.RadarBGPRouteMoasParamsFormatJson), - InvalidOnly: cloudflare.F(true), - Origin: cloudflare.F(int64(0)), - Prefix: cloudflare.F("string"), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarBGPRoutePfx2asWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.BGP.Routes.Pfx2as(context.TODO(), cloudflare.RadarBGPRoutePfx2asParams{ - Format: cloudflare.F(cloudflare.RadarBGPRoutePfx2asParamsFormatJson), - Origin: cloudflare.F(int64(0)), - Prefix: cloudflare.F("1.1.1.0/24"), - RpkiStatus: cloudflare.F(cloudflare.RadarBGPRoutePfx2asParamsRpkiStatusInvalid), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarBGPRouteStatsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.BGP.Routes.Stats(context.TODO(), cloudflare.RadarBGPRouteStatsParams{ - Asn: cloudflare.F(int64(0)), - Format: cloudflare.F(cloudflare.RadarBGPRouteStatsParamsFormatJson), - Location: cloudflare.F("US"), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radarbgproutemoa.go b/radarbgproutemoa.go new file mode 100644 index 00000000000..33a7bccffbd --- /dev/null +++ b/radarbgproutemoa.go @@ -0,0 +1,173 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "net/http" + "net/url" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// RadarBGPRouteMoaService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewRadarBGPRouteMoaService] method +// instead. +type RadarBGPRouteMoaService struct { + Options []option.RequestOption +} + +// NewRadarBGPRouteMoaService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewRadarBGPRouteMoaService(opts ...option.RequestOption) (r *RadarBGPRouteMoaService) { + r = &RadarBGPRouteMoaService{} + r.Options = opts + return +} + +// List all Multi-origin AS (MOAS) prefixes on the global routing tables. +func (r *RadarBGPRouteMoaService) List(ctx context.Context, query RadarBGPRouteMoaListParams, opts ...option.RequestOption) (res *RadarBGPRouteMoaListResponse, err error) { + opts = append(r.Options[:], opts...) + var env RadarBGPRouteMoaListResponseEnvelope + path := "radar/bgp/routes/moas" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type RadarBGPRouteMoaListResponse struct { + Meta RadarBGPRouteMoaListResponseMeta `json:"meta,required"` + Moas []RadarBGPRouteMoaListResponseMoa `json:"moas,required"` + JSON radarBGPRouteMoaListResponseJSON `json:"-"` +} + +// radarBGPRouteMoaListResponseJSON contains the JSON metadata for the struct +// [RadarBGPRouteMoaListResponse] +type radarBGPRouteMoaListResponseJSON struct { + Meta apijson.Field + Moas apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteMoaListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteMoaListResponseMeta struct { + DataTime string `json:"data_time,required"` + QueryTime string `json:"query_time,required"` + TotalPeers int64 `json:"total_peers,required"` + JSON radarBGPRouteMoaListResponseMetaJSON `json:"-"` +} + +// radarBGPRouteMoaListResponseMetaJSON contains the JSON metadata for the struct +// [RadarBGPRouteMoaListResponseMeta] +type radarBGPRouteMoaListResponseMetaJSON struct { + DataTime apijson.Field + QueryTime apijson.Field + TotalPeers apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteMoaListResponseMeta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteMoaListResponseMoa struct { + Origins []RadarBGPRouteMoaListResponseMoasOrigin `json:"origins,required"` + Prefix string `json:"prefix,required"` + JSON radarBGPRouteMoaListResponseMoaJSON `json:"-"` +} + +// radarBGPRouteMoaListResponseMoaJSON contains the JSON metadata for the struct +// [RadarBGPRouteMoaListResponseMoa] +type radarBGPRouteMoaListResponseMoaJSON struct { + Origins apijson.Field + Prefix apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteMoaListResponseMoa) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteMoaListResponseMoasOrigin struct { + Origin int64 `json:"origin,required"` + PeerCount int64 `json:"peer_count,required"` + RpkiValidation string `json:"rpki_validation,required"` + JSON radarBGPRouteMoaListResponseMoasOriginJSON `json:"-"` +} + +// radarBGPRouteMoaListResponseMoasOriginJSON contains the JSON metadata for the +// struct [RadarBGPRouteMoaListResponseMoasOrigin] +type radarBGPRouteMoaListResponseMoasOriginJSON struct { + Origin apijson.Field + PeerCount apijson.Field + RpkiValidation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteMoaListResponseMoasOrigin) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteMoaListParams struct { + // Format results are returned in. + Format param.Field[RadarBGPRouteMoaListParamsFormat] `query:"format"` + // Lookup only RPKI invalid MOASes + InvalidOnly param.Field[bool] `query:"invalid_only"` + // Lookup MOASes originated by the given ASN + Origin param.Field[int64] `query:"origin"` + // Lookup MOASes by prefix + Prefix param.Field[string] `query:"prefix"` +} + +// URLQuery serializes [RadarBGPRouteMoaListParams]'s query parameters as +// `url.Values`. +func (r RadarBGPRouteMoaListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Format results are returned in. +type RadarBGPRouteMoaListParamsFormat string + +const ( + RadarBGPRouteMoaListParamsFormatJson RadarBGPRouteMoaListParamsFormat = "JSON" + RadarBGPRouteMoaListParamsFormatCsv RadarBGPRouteMoaListParamsFormat = "CSV" +) + +type RadarBGPRouteMoaListResponseEnvelope struct { + Result RadarBGPRouteMoaListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarBGPRouteMoaListResponseEnvelopeJSON `json:"-"` +} + +// radarBGPRouteMoaListResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarBGPRouteMoaListResponseEnvelope] +type radarBGPRouteMoaListResponseEnvelopeJSON struct { + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteMoaListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/accessappuserpolicycheck_test.go b/radarbgproutemoa_test.go similarity index 73% rename from accessappuserpolicycheck_test.go rename to radarbgproutemoa_test.go index 84b2bad235a..4aa89597693 100644 --- a/accessappuserpolicycheck_test.go +++ b/radarbgproutemoa_test.go @@ -9,12 +9,11 @@ import ( "testing" "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/shared" "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessAppUserPolicyCheckAccessApplicationsTestAccessPolicies(t *testing.T) { +func TestRadarBGPRouteMoaListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,12 +29,12 @@ func TestAccessAppUserPolicyCheckAccessApplicationsTestAccessPolicies(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Apps.UserPolicyChecks.AccessApplicationsTestAccessPolicies( - context.TODO(), - "string", - "023e105f4ecef8ad9ca31a8372d0c353", - shared.UnionString("023e105f4ecef8ad9ca31a8372d0c353"), - ) + _, err := client.Radar.BGP.Routes.Moas.List(context.TODO(), cloudflare.RadarBGPRouteMoaListParams{ + Format: cloudflare.F(cloudflare.RadarBGPRouteMoaListParamsFormatJson), + InvalidOnly: cloudflare.F(true), + Origin: cloudflare.F(int64(0)), + Prefix: cloudflare.F("string"), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/radarbgproutepfx2a.go b/radarbgproutepfx2a.go new file mode 100644 index 00000000000..108bdd1be09 --- /dev/null +++ b/radarbgproutepfx2a.go @@ -0,0 +1,165 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "net/http" + "net/url" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// RadarBGPRoutePfx2aService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewRadarBGPRoutePfx2aService] method +// instead. +type RadarBGPRoutePfx2aService struct { + Options []option.RequestOption +} + +// NewRadarBGPRoutePfx2aService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewRadarBGPRoutePfx2aService(opts ...option.RequestOption) (r *RadarBGPRoutePfx2aService) { + r = &RadarBGPRoutePfx2aService{} + r.Options = opts + return +} + +// Lookup prefix-to-origin mapping on global routing tables. +func (r *RadarBGPRoutePfx2aService) List(ctx context.Context, query RadarBGPRoutePfx2aListParams, opts ...option.RequestOption) (res *RadarBGPRoutePfx2aListResponse, err error) { + opts = append(r.Options[:], opts...) + var env RadarBGPRoutePfx2aListResponseEnvelope + path := "radar/bgp/routes/pfx2as" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type RadarBGPRoutePfx2aListResponse struct { + Meta RadarBGPRoutePfx2aListResponseMeta `json:"meta,required"` + PrefixOrigins []RadarBGPRoutePfx2aListResponsePrefixOrigin `json:"prefix_origins,required"` + JSON radarBGPRoutePfx2aListResponseJSON `json:"-"` +} + +// radarBGPRoutePfx2aListResponseJSON contains the JSON metadata for the struct +// [RadarBGPRoutePfx2aListResponse] +type radarBGPRoutePfx2aListResponseJSON struct { + Meta apijson.Field + PrefixOrigins apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRoutePfx2aListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRoutePfx2aListResponseMeta struct { + DataTime string `json:"data_time,required"` + QueryTime string `json:"query_time,required"` + TotalPeers int64 `json:"total_peers,required"` + JSON radarBGPRoutePfx2aListResponseMetaJSON `json:"-"` +} + +// radarBGPRoutePfx2aListResponseMetaJSON contains the JSON metadata for the struct +// [RadarBGPRoutePfx2aListResponseMeta] +type radarBGPRoutePfx2aListResponseMetaJSON struct { + DataTime apijson.Field + QueryTime apijson.Field + TotalPeers apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRoutePfx2aListResponseMeta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRoutePfx2aListResponsePrefixOrigin struct { + Origin int64 `json:"origin,required"` + PeerCount int64 `json:"peer_count,required"` + Prefix string `json:"prefix,required"` + RpkiValidation string `json:"rpki_validation,required"` + JSON radarBGPRoutePfx2aListResponsePrefixOriginJSON `json:"-"` +} + +// radarBGPRoutePfx2aListResponsePrefixOriginJSON contains the JSON metadata for +// the struct [RadarBGPRoutePfx2aListResponsePrefixOrigin] +type radarBGPRoutePfx2aListResponsePrefixOriginJSON struct { + Origin apijson.Field + PeerCount apijson.Field + Prefix apijson.Field + RpkiValidation apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRoutePfx2aListResponsePrefixOrigin) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRoutePfx2aListParams struct { + // Format results are returned in. + Format param.Field[RadarBGPRoutePfx2aListParamsFormat] `query:"format"` + // Lookup prefixes originated by the given ASN + Origin param.Field[int64] `query:"origin"` + // Lookup origins of the given prefix + Prefix param.Field[string] `query:"prefix"` + // Return only results with matching rpki status: valid, invalid or unknown + RpkiStatus param.Field[RadarBGPRoutePfx2aListParamsRpkiStatus] `query:"rpkiStatus"` +} + +// URLQuery serializes [RadarBGPRoutePfx2aListParams]'s query parameters as +// `url.Values`. +func (r RadarBGPRoutePfx2aListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Format results are returned in. +type RadarBGPRoutePfx2aListParamsFormat string + +const ( + RadarBGPRoutePfx2aListParamsFormatJson RadarBGPRoutePfx2aListParamsFormat = "JSON" + RadarBGPRoutePfx2aListParamsFormatCsv RadarBGPRoutePfx2aListParamsFormat = "CSV" +) + +// Return only results with matching rpki status: valid, invalid or unknown +type RadarBGPRoutePfx2aListParamsRpkiStatus string + +const ( + RadarBGPRoutePfx2aListParamsRpkiStatusValid RadarBGPRoutePfx2aListParamsRpkiStatus = "VALID" + RadarBGPRoutePfx2aListParamsRpkiStatusInvalid RadarBGPRoutePfx2aListParamsRpkiStatus = "INVALID" + RadarBGPRoutePfx2aListParamsRpkiStatusUnknown RadarBGPRoutePfx2aListParamsRpkiStatus = "UNKNOWN" +) + +type RadarBGPRoutePfx2aListResponseEnvelope struct { + Result RadarBGPRoutePfx2aListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarBGPRoutePfx2aListResponseEnvelopeJSON `json:"-"` +} + +// radarBGPRoutePfx2aListResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarBGPRoutePfx2aListResponseEnvelope] +type radarBGPRoutePfx2aListResponseEnvelopeJSON struct { + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRoutePfx2aListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/accessservicetokenrefresh_test.go b/radarbgproutepfx2a_test.go similarity index 70% rename from accessservicetokenrefresh_test.go rename to radarbgproutepfx2a_test.go index 1c30d2bd0e6..2520274545e 100644 --- a/accessservicetokenrefresh_test.go +++ b/radarbgproutepfx2a_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessServiceTokenRefreshAccessServiceTokensRefreshAServiceToken(t *testing.T) { +func TestRadarBGPRoutePfx2aListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,12 @@ func TestAccessServiceTokenRefreshAccessServiceTokensRefreshAServiceToken(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.ServiceTokens.Refreshes.AccessServiceTokensRefreshAServiceToken( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Radar.BGP.Routes.Pfx2as.List(context.TODO(), cloudflare.RadarBGPRoutePfx2aListParams{ + Format: cloudflare.F(cloudflare.RadarBGPRoutePfx2aListParamsFormatJson), + Origin: cloudflare.F(int64(0)), + Prefix: cloudflare.F("1.1.1.0/24"), + RpkiStatus: cloudflare.F(cloudflare.RadarBGPRoutePfx2aListParamsRpkiStatusInvalid), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/radarbgproutestat.go b/radarbgproutestat.go new file mode 100644 index 00000000000..002a70f9a94 --- /dev/null +++ b/radarbgproutestat.go @@ -0,0 +1,182 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "net/http" + "net/url" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// RadarBGPRouteStatService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewRadarBGPRouteStatService] method +// instead. +type RadarBGPRouteStatService struct { + Options []option.RequestOption +} + +// NewRadarBGPRouteStatService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewRadarBGPRouteStatService(opts ...option.RequestOption) (r *RadarBGPRouteStatService) { + r = &RadarBGPRouteStatService{} + r.Options = opts + return +} + +// Get the BGP routing table stats (Beta). +func (r *RadarBGPRouteStatService) List(ctx context.Context, query RadarBGPRouteStatListParams, opts ...option.RequestOption) (res *RadarBGPRouteStatListResponse, err error) { + opts = append(r.Options[:], opts...) + var env RadarBGPRouteStatListResponseEnvelope + path := "radar/bgp/routes/stats" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type RadarBGPRouteStatListResponse struct { + Meta RadarBGPRouteStatListResponseMeta `json:"meta,required"` + Stats RadarBGPRouteStatListResponseStats `json:"stats,required"` + JSON radarBGPRouteStatListResponseJSON `json:"-"` +} + +// radarBGPRouteStatListResponseJSON contains the JSON metadata for the struct +// [RadarBGPRouteStatListResponse] +type radarBGPRouteStatListResponseJSON struct { + Meta apijson.Field + Stats apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteStatListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteStatListResponseMeta struct { + DataTime string `json:"data_time,required"` + QueryTime string `json:"query_time,required"` + TotalPeers int64 `json:"total_peers,required"` + JSON radarBGPRouteStatListResponseMetaJSON `json:"-"` +} + +// radarBGPRouteStatListResponseMetaJSON contains the JSON metadata for the struct +// [RadarBGPRouteStatListResponseMeta] +type radarBGPRouteStatListResponseMetaJSON struct { + DataTime apijson.Field + QueryTime apijson.Field + TotalPeers apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteStatListResponseMeta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteStatListResponseStats struct { + DistinctOrigins int64 `json:"distinct_origins,required"` + DistinctOriginsIPV4 int64 `json:"distinct_origins_ipv4,required"` + DistinctOriginsIPV6 int64 `json:"distinct_origins_ipv6,required"` + DistinctPrefixes int64 `json:"distinct_prefixes,required"` + DistinctPrefixesIPV4 int64 `json:"distinct_prefixes_ipv4,required"` + DistinctPrefixesIPV6 int64 `json:"distinct_prefixes_ipv6,required"` + RoutesInvalid int64 `json:"routes_invalid,required"` + RoutesInvalidIPV4 int64 `json:"routes_invalid_ipv4,required"` + RoutesInvalidIPV6 int64 `json:"routes_invalid_ipv6,required"` + RoutesTotal int64 `json:"routes_total,required"` + RoutesTotalIPV4 int64 `json:"routes_total_ipv4,required"` + RoutesTotalIPV6 int64 `json:"routes_total_ipv6,required"` + RoutesUnknown int64 `json:"routes_unknown,required"` + RoutesUnknownIPV4 int64 `json:"routes_unknown_ipv4,required"` + RoutesUnknownIPV6 int64 `json:"routes_unknown_ipv6,required"` + RoutesValid int64 `json:"routes_valid,required"` + RoutesValidIPV4 int64 `json:"routes_valid_ipv4,required"` + RoutesValidIPV6 int64 `json:"routes_valid_ipv6,required"` + JSON radarBGPRouteStatListResponseStatsJSON `json:"-"` +} + +// radarBGPRouteStatListResponseStatsJSON contains the JSON metadata for the struct +// [RadarBGPRouteStatListResponseStats] +type radarBGPRouteStatListResponseStatsJSON struct { + DistinctOrigins apijson.Field + DistinctOriginsIPV4 apijson.Field + DistinctOriginsIPV6 apijson.Field + DistinctPrefixes apijson.Field + DistinctPrefixesIPV4 apijson.Field + DistinctPrefixesIPV6 apijson.Field + RoutesInvalid apijson.Field + RoutesInvalidIPV4 apijson.Field + RoutesInvalidIPV6 apijson.Field + RoutesTotal apijson.Field + RoutesTotalIPV4 apijson.Field + RoutesTotalIPV6 apijson.Field + RoutesUnknown apijson.Field + RoutesUnknownIPV4 apijson.Field + RoutesUnknownIPV6 apijson.Field + RoutesValid apijson.Field + RoutesValidIPV4 apijson.Field + RoutesValidIPV6 apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteStatListResponseStats) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPRouteStatListParams struct { + // Single ASN as integer. + Asn param.Field[int64] `query:"asn"` + // Format results are returned in. + Format param.Field[RadarBGPRouteStatListParamsFormat] `query:"format"` + // Location Alpha2 code. + Location param.Field[string] `query:"location"` +} + +// URLQuery serializes [RadarBGPRouteStatListParams]'s query parameters as +// `url.Values`. +func (r RadarBGPRouteStatListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Format results are returned in. +type RadarBGPRouteStatListParamsFormat string + +const ( + RadarBGPRouteStatListParamsFormatJson RadarBGPRouteStatListParamsFormat = "JSON" + RadarBGPRouteStatListParamsFormatCsv RadarBGPRouteStatListParamsFormat = "CSV" +) + +type RadarBGPRouteStatListResponseEnvelope struct { + Result RadarBGPRouteStatListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarBGPRouteStatListResponseEnvelopeJSON `json:"-"` +} + +// radarBGPRouteStatListResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarBGPRouteStatListResponseEnvelope] +type radarBGPRouteStatListResponseEnvelopeJSON struct { + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPRouteStatListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/accesskeyrotate_test.go b/radarbgproutestat_test.go similarity index 75% rename from accesskeyrotate_test.go rename to radarbgproutestat_test.go index 88002ab5bfb..2ff0b139b4f 100644 --- a/accesskeyrotate_test.go +++ b/radarbgproutestat_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessKeyRotateAccessKeyConfigurationRotateAccessKeys(t *testing.T) { +func TestRadarBGPRouteStatListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,11 @@ func TestAccessKeyRotateAccessKeyConfigurationRotateAccessKeys(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.Keys.Rotates.AccessKeyConfigurationRotateAccessKeys(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Radar.BGP.Routes.Stats.List(context.TODO(), cloudflare.RadarBGPRouteStatListParams{ + Asn: cloudflare.F(int64(0)), + Format: cloudflare.F(cloudflare.RadarBGPRouteStatListParamsFormatJson), + Location: cloudflare.F("US"), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/radarbgptopase.go b/radarbgptopase.go index febc3707478..be7adee7166 100644 --- a/radarbgptopase.go +++ b/radarbgptopase.go @@ -21,7 +21,8 @@ import ( // this service directly, and instead use the [NewRadarBGPTopAseService] method // instead. type RadarBGPTopAseService struct { - Options []option.RequestOption + Options []option.RequestOption + Prefixes *RadarBGPTopAsePrefixService } // NewRadarBGPTopAseService generates a new service that applies the given options @@ -30,6 +31,7 @@ type RadarBGPTopAseService struct { func NewRadarBGPTopAseService(opts ...option.RequestOption) (r *RadarBGPTopAseService) { r = &RadarBGPTopAseService{} r.Options = opts + r.Prefixes = NewRadarBGPTopAsePrefixService(opts...) return } @@ -47,21 +49,6 @@ func (r *RadarBGPTopAseService) List(ctx context.Context, query RadarBGPTopAseLi return } -// Get the full list of autonomous systems on the global routing table ordered by -// announced prefixes count. The data comes from public BGP MRT data archives and -// updates every 2 hours. -func (r *RadarBGPTopAseService) Prefixes(ctx context.Context, query RadarBGPTopAsePrefixesParams, opts ...option.RequestOption) (res *RadarBGPTopAsePrefixesResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarBGPTopAsePrefixesResponseEnvelope - path := "radar/bgp/top/ases/prefixes" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - type RadarBGPTopAseListResponse struct { Meta RadarBGPTopAseListResponseMeta `json:"meta,required"` Top0 []RadarBGPTopAseListResponseTop0 `json:"top_0,required"` @@ -142,69 +129,6 @@ func (r *RadarBGPTopAseListResponseTop0) UnmarshalJSON(data []byte) (err error) return apijson.UnmarshalRoot(data, r) } -type RadarBGPTopAsePrefixesResponse struct { - Asns []RadarBGPTopAsePrefixesResponseAsn `json:"asns,required"` - Meta RadarBGPTopAsePrefixesResponseMeta `json:"meta,required"` - JSON radarBGPTopAsePrefixesResponseJSON `json:"-"` -} - -// radarBGPTopAsePrefixesResponseJSON contains the JSON metadata for the struct -// [RadarBGPTopAsePrefixesResponse] -type radarBGPTopAsePrefixesResponseJSON struct { - Asns apijson.Field - Meta apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPTopAsePrefixesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPTopAsePrefixesResponseAsn struct { - Asn int64 `json:"asn,required"` - Country string `json:"country,required"` - Name string `json:"name,required"` - PfxsCount int64 `json:"pfxs_count,required"` - JSON radarBGPTopAsePrefixesResponseAsnJSON `json:"-"` -} - -// radarBGPTopAsePrefixesResponseAsnJSON contains the JSON metadata for the struct -// [RadarBGPTopAsePrefixesResponseAsn] -type radarBGPTopAsePrefixesResponseAsnJSON struct { - Asn apijson.Field - Country apijson.Field - Name apijson.Field - PfxsCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPTopAsePrefixesResponseAsn) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarBGPTopAsePrefixesResponseMeta struct { - DataTime string `json:"data_time,required"` - QueryTime string `json:"query_time,required"` - TotalPeers int64 `json:"total_peers,required"` - JSON radarBGPTopAsePrefixesResponseMetaJSON `json:"-"` -} - -// radarBGPTopAsePrefixesResponseMetaJSON contains the JSON metadata for the struct -// [RadarBGPTopAsePrefixesResponseMeta] -type radarBGPTopAsePrefixesResponseMetaJSON struct { - DataTime apijson.Field - QueryTime apijson.Field - TotalPeers apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPTopAsePrefixesResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type RadarBGPTopAseListParams struct { // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from @@ -292,48 +216,3 @@ type radarBGPTopAseListResponseEnvelopeJSON struct { func (r *RadarBGPTopAseListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } - -type RadarBGPTopAsePrefixesParams struct { - // Alpha-2 country code. - Country param.Field[string] `query:"country"` - // Format results are returned in. - Format param.Field[RadarBGPTopAsePrefixesParamsFormat] `query:"format"` - // Maximum number of ASes to return - Limit param.Field[int64] `query:"limit"` -} - -// URLQuery serializes [RadarBGPTopAsePrefixesParams]'s query parameters as -// `url.Values`. -func (r RadarBGPTopAsePrefixesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Format results are returned in. -type RadarBGPTopAsePrefixesParamsFormat string - -const ( - RadarBGPTopAsePrefixesParamsFormatJson RadarBGPTopAsePrefixesParamsFormat = "JSON" - RadarBGPTopAsePrefixesParamsFormatCsv RadarBGPTopAsePrefixesParamsFormat = "CSV" -) - -type RadarBGPTopAsePrefixesResponseEnvelope struct { - Result RadarBGPTopAsePrefixesResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarBGPTopAsePrefixesResponseEnvelopeJSON `json:"-"` -} - -// radarBGPTopAsePrefixesResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarBGPTopAsePrefixesResponseEnvelope] -type radarBGPTopAsePrefixesResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarBGPTopAsePrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radarbgptopase_test.go b/radarbgptopase_test.go index cf2851aa697..28df594237b 100644 --- a/radarbgptopase_test.go +++ b/radarbgptopase_test.go @@ -49,33 +49,3 @@ func TestRadarBGPTopAseListWithOptionalParams(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestRadarBGPTopAsePrefixesWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.BGP.Tops.Ases.Prefixes(context.TODO(), cloudflare.RadarBGPTopAsePrefixesParams{ - Country: cloudflare.F("NZ"), - Format: cloudflare.F(cloudflare.RadarBGPTopAsePrefixesParamsFormatJson), - Limit: cloudflare.F(int64(10)), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radarbgptopaseprefix.go b/radarbgptopaseprefix.go new file mode 100644 index 00000000000..aa60ed00d0a --- /dev/null +++ b/radarbgptopaseprefix.go @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "net/http" + "net/url" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// RadarBGPTopAsePrefixService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewRadarBGPTopAsePrefixService] +// method instead. +type RadarBGPTopAsePrefixService struct { + Options []option.RequestOption +} + +// NewRadarBGPTopAsePrefixService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewRadarBGPTopAsePrefixService(opts ...option.RequestOption) (r *RadarBGPTopAsePrefixService) { + r = &RadarBGPTopAsePrefixService{} + r.Options = opts + return +} + +// Get the full list of autonomous systems on the global routing table ordered by +// announced prefixes count. The data comes from public BGP MRT data archives and +// updates every 2 hours. +func (r *RadarBGPTopAsePrefixService) List(ctx context.Context, query RadarBGPTopAsePrefixListParams, opts ...option.RequestOption) (res *RadarBGPTopAsePrefixListResponse, err error) { + opts = append(r.Options[:], opts...) + var env RadarBGPTopAsePrefixListResponseEnvelope + path := "radar/bgp/top/ases/prefixes" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type RadarBGPTopAsePrefixListResponse struct { + Asns []RadarBGPTopAsePrefixListResponseAsn `json:"asns,required"` + Meta RadarBGPTopAsePrefixListResponseMeta `json:"meta,required"` + JSON radarBGPTopAsePrefixListResponseJSON `json:"-"` +} + +// radarBGPTopAsePrefixListResponseJSON contains the JSON metadata for the struct +// [RadarBGPTopAsePrefixListResponse] +type radarBGPTopAsePrefixListResponseJSON struct { + Asns apijson.Field + Meta apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPTopAsePrefixListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPTopAsePrefixListResponseAsn struct { + Asn int64 `json:"asn,required"` + Country string `json:"country,required"` + Name string `json:"name,required"` + PfxsCount int64 `json:"pfxs_count,required"` + JSON radarBGPTopAsePrefixListResponseAsnJSON `json:"-"` +} + +// radarBGPTopAsePrefixListResponseAsnJSON contains the JSON metadata for the +// struct [RadarBGPTopAsePrefixListResponseAsn] +type radarBGPTopAsePrefixListResponseAsnJSON struct { + Asn apijson.Field + Country apijson.Field + Name apijson.Field + PfxsCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPTopAsePrefixListResponseAsn) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPTopAsePrefixListResponseMeta struct { + DataTime string `json:"data_time,required"` + QueryTime string `json:"query_time,required"` + TotalPeers int64 `json:"total_peers,required"` + JSON radarBGPTopAsePrefixListResponseMetaJSON `json:"-"` +} + +// radarBGPTopAsePrefixListResponseMetaJSON contains the JSON metadata for the +// struct [RadarBGPTopAsePrefixListResponseMeta] +type radarBGPTopAsePrefixListResponseMetaJSON struct { + DataTime apijson.Field + QueryTime apijson.Field + TotalPeers apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPTopAsePrefixListResponseMeta) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RadarBGPTopAsePrefixListParams struct { + // Alpha-2 country code. + Country param.Field[string] `query:"country"` + // Format results are returned in. + Format param.Field[RadarBGPTopAsePrefixListParamsFormat] `query:"format"` + // Maximum number of ASes to return + Limit param.Field[int64] `query:"limit"` +} + +// URLQuery serializes [RadarBGPTopAsePrefixListParams]'s query parameters as +// `url.Values`. +func (r RadarBGPTopAsePrefixListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Format results are returned in. +type RadarBGPTopAsePrefixListParamsFormat string + +const ( + RadarBGPTopAsePrefixListParamsFormatJson RadarBGPTopAsePrefixListParamsFormat = "JSON" + RadarBGPTopAsePrefixListParamsFormatCsv RadarBGPTopAsePrefixListParamsFormat = "CSV" +) + +type RadarBGPTopAsePrefixListResponseEnvelope struct { + Result RadarBGPTopAsePrefixListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarBGPTopAsePrefixListResponseEnvelopeJSON `json:"-"` +} + +// radarBGPTopAsePrefixListResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarBGPTopAsePrefixListResponseEnvelope] +type radarBGPTopAsePrefixListResponseEnvelopeJSON struct { + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RadarBGPTopAsePrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/accessservicetokenrotate_test.go b/radarbgptopaseprefix_test.go similarity index 74% rename from accessservicetokenrotate_test.go rename to radarbgptopaseprefix_test.go index e2ad6f87671..84d7a66c1fc 100644 --- a/accessservicetokenrotate_test.go +++ b/radarbgptopaseprefix_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestAccessServiceTokenRotateAccessServiceTokensRotateAServiceToken(t *testing.T) { +func TestRadarBGPTopAsePrefixListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestAccessServiceTokenRotateAccessServiceTokensRotateAServiceToken(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Access.ServiceTokens.Rotates.AccessServiceTokensRotateAServiceToken( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - ) + _, err := client.Radar.BGP.Tops.Ases.Prefixes.List(context.TODO(), cloudflare.RadarBGPTopAsePrefixListParams{ + Country: cloudflare.F("NZ"), + Format: cloudflare.F(cloudflare.RadarBGPTopAsePrefixListParamsFormatJson), + Limit: cloudflare.F(int64(10)), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/radarconnectiontampering.go b/radarconnectiontampering.go index 7d0c6ac0389..3ecd9130768 100644 --- a/radarconnectiontampering.go +++ b/radarconnectiontampering.go @@ -36,9 +36,9 @@ func NewRadarConnectionTamperingService(opts ...option.RequestOption) (r *RadarC } // Distribution of connection tampering types over a given time period. -func (r *RadarConnectionTamperingService) Summary(ctx context.Context, query RadarConnectionTamperingSummaryParams, opts ...option.RequestOption) (res *RadarConnectionTamperingSummaryResponse, err error) { +func (r *RadarConnectionTamperingService) List(ctx context.Context, query RadarConnectionTamperingListParams, opts ...option.RequestOption) (res *RadarConnectionTamperingListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarConnectionTamperingSummaryResponseEnvelope + var env RadarConnectionTamperingListResponseEnvelope path := "radar/connection_tampering/summary" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -48,100 +48,99 @@ func (r *RadarConnectionTamperingService) Summary(ctx context.Context, query Rad return } -type RadarConnectionTamperingSummaryResponse struct { - Meta RadarConnectionTamperingSummaryResponseMeta `json:"meta,required"` - Summary0 RadarConnectionTamperingSummaryResponseSummary0 `json:"summary_0,required"` - JSON radarConnectionTamperingSummaryResponseJSON `json:"-"` +type RadarConnectionTamperingListResponse struct { + Meta RadarConnectionTamperingListResponseMeta `json:"meta,required"` + Summary0 RadarConnectionTamperingListResponseSummary0 `json:"summary_0,required"` + JSON radarConnectionTamperingListResponseJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseJSON contains the JSON metadata for the -// struct [RadarConnectionTamperingSummaryResponse] -type radarConnectionTamperingSummaryResponseJSON struct { +// radarConnectionTamperingListResponseJSON contains the JSON metadata for the +// struct [RadarConnectionTamperingListResponse] +type radarConnectionTamperingListResponseJSON struct { Meta apijson.Field Summary0 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryResponseMeta struct { - DateRange []RadarConnectionTamperingSummaryResponseMetaDateRange `json:"dateRange,required"` - ConfidenceInfo RadarConnectionTamperingSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarConnectionTamperingSummaryResponseMetaJSON `json:"-"` +type RadarConnectionTamperingListResponseMeta struct { + DateRange []RadarConnectionTamperingListResponseMetaDateRange `json:"dateRange,required"` + ConfidenceInfo RadarConnectionTamperingListResponseMetaConfidenceInfo `json:"confidenceInfo"` + JSON radarConnectionTamperingListResponseMetaJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseMetaJSON contains the JSON metadata for -// the struct [RadarConnectionTamperingSummaryResponseMeta] -type radarConnectionTamperingSummaryResponseMetaJSON struct { +// radarConnectionTamperingListResponseMetaJSON contains the JSON metadata for the +// struct [RadarConnectionTamperingListResponseMeta] +type radarConnectionTamperingListResponseMetaJSON struct { DateRange apijson.Field ConfidenceInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryResponseMetaDateRange struct { +type RadarConnectionTamperingListResponseMetaDateRange struct { // Adjusted end of date range. EndTime time.Time `json:"endTime,required" format:"date-time"` // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarConnectionTamperingSummaryResponseMetaDateRangeJSON `json:"-"` + StartTime time.Time `json:"startTime,required" format:"date-time"` + JSON radarConnectionTamperingListResponseMetaDateRangeJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarConnectionTamperingSummaryResponseMetaDateRange] -type radarConnectionTamperingSummaryResponseMetaDateRangeJSON struct { +// radarConnectionTamperingListResponseMetaDateRangeJSON contains the JSON metadata +// for the struct [RadarConnectionTamperingListResponseMetaDateRange] +type radarConnectionTamperingListResponseMetaDateRangeJSON struct { EndTime apijson.Field StartTime apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryResponseMetaConfidenceInfo struct { - Annotations []RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON `json:"-"` +type RadarConnectionTamperingListResponseMetaConfidenceInfo struct { + Annotations []RadarConnectionTamperingListResponseMetaConfidenceInfoAnnotation `json:"annotations"` + Level int64 `json:"level"` + JSON radarConnectionTamperingListResponseMetaConfidenceInfoJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarConnectionTamperingSummaryResponseMetaConfidenceInfo] -type radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON struct { +// radarConnectionTamperingListResponseMetaConfidenceInfoJSON contains the JSON +// metadata for the struct [RadarConnectionTamperingListResponseMetaConfidenceInfo] +type radarConnectionTamperingListResponseMetaConfidenceInfoJSON struct { Annotations apijson.Field Level apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"` +type RadarConnectionTamperingListResponseMetaConfidenceInfoAnnotation struct { + DataSource string `json:"dataSource,required"` + Description string `json:"description,required"` + EventType string `json:"eventType,required"` + IsInstantaneous interface{} `json:"isInstantaneous,required"` + EndTime time.Time `json:"endTime" format:"date-time"` + LinkedURL string `json:"linkedUrl"` + StartTime time.Time `json:"startTime" format:"date-time"` + JSON radarConnectionTamperingListResponseMetaConfidenceInfoAnnotationJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON contains +// radarConnectionTamperingListResponseMetaConfidenceInfoAnnotationJSON contains // the JSON metadata for the struct -// [RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation] -type radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON struct { +// [RadarConnectionTamperingListResponseMetaConfidenceInfoAnnotation] +type radarConnectionTamperingListResponseMetaConfidenceInfoAnnotationJSON struct { DataSource apijson.Field Description apijson.Field EventType apijson.Field @@ -153,11 +152,11 @@ type radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON str ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryResponseSummary0 struct { +type RadarConnectionTamperingListResponseSummary0 struct { // Connections matching signatures for tampering later in the connection, after the // transfer of multiple data packets. LaterInFlow string `json:"later_in_flow,required"` @@ -172,13 +171,13 @@ type RadarConnectionTamperingSummaryResponseSummary0 struct { PostPsh string `json:"post_psh,required"` // Connections matching signatures for tampering after the receipt of only a single // SYN packet, and before the handshake completes. - PostSyn string `json:"post_syn,required"` - JSON radarConnectionTamperingSummaryResponseSummary0JSON `json:"-"` + PostSyn string `json:"post_syn,required"` + JSON radarConnectionTamperingListResponseSummary0JSON `json:"-"` } -// radarConnectionTamperingSummaryResponseSummary0JSON contains the JSON metadata -// for the struct [RadarConnectionTamperingSummaryResponseSummary0] -type radarConnectionTamperingSummaryResponseSummary0JSON struct { +// radarConnectionTamperingListResponseSummary0JSON contains the JSON metadata for +// the struct [RadarConnectionTamperingListResponseSummary0] +type radarConnectionTamperingListResponseSummary0JSON struct { LaterInFlow apijson.Field NoMatch apijson.Field PostAck apijson.Field @@ -188,11 +187,11 @@ type radarConnectionTamperingSummaryResponseSummary0JSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseSummary0) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarConnectionTamperingSummaryParams struct { +type RadarConnectionTamperingListParams struct { // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. @@ -202,11 +201,11 @@ type RadarConnectionTamperingSummaryParams struct { // For example, use `7d` and `7dControl` to compare this week with the previous // week. Use this parameter or set specific start and end dates (`dateStart` and // `dateEnd` parameters). - DateRange param.Field[[]RadarConnectionTamperingSummaryParamsDateRange] `query:"dateRange"` + DateRange param.Field[[]RadarConnectionTamperingListParamsDateRange] `query:"dateRange"` // Array of datetimes to filter the start of a series. DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` // Format results are returned in. - Format param.Field[RadarConnectionTamperingSummaryParamsFormat] `query:"format"` + Format param.Field[RadarConnectionTamperingListParamsFormat] `query:"format"` // Array of comma separated list of locations (alpha-2 country codes). Start with // `-` to exclude from results. For example, `-US,PT` excludes results from the US, // but includes results from PT. @@ -215,58 +214,58 @@ type RadarConnectionTamperingSummaryParams struct { Name param.Field[[]string] `query:"name"` } -// URLQuery serializes [RadarConnectionTamperingSummaryParams]'s query parameters -// as `url.Values`. -func (r RadarConnectionTamperingSummaryParams) URLQuery() (v url.Values) { +// URLQuery serializes [RadarConnectionTamperingListParams]'s query parameters as +// `url.Values`. +func (r RadarConnectionTamperingListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type RadarConnectionTamperingSummaryParamsDateRange string +type RadarConnectionTamperingListParamsDateRange string const ( - RadarConnectionTamperingSummaryParamsDateRange1d RadarConnectionTamperingSummaryParamsDateRange = "1d" - RadarConnectionTamperingSummaryParamsDateRange2d RadarConnectionTamperingSummaryParamsDateRange = "2d" - RadarConnectionTamperingSummaryParamsDateRange7d RadarConnectionTamperingSummaryParamsDateRange = "7d" - RadarConnectionTamperingSummaryParamsDateRange14d RadarConnectionTamperingSummaryParamsDateRange = "14d" - RadarConnectionTamperingSummaryParamsDateRange28d RadarConnectionTamperingSummaryParamsDateRange = "28d" - RadarConnectionTamperingSummaryParamsDateRange12w RadarConnectionTamperingSummaryParamsDateRange = "12w" - RadarConnectionTamperingSummaryParamsDateRange24w RadarConnectionTamperingSummaryParamsDateRange = "24w" - RadarConnectionTamperingSummaryParamsDateRange52w RadarConnectionTamperingSummaryParamsDateRange = "52w" - RadarConnectionTamperingSummaryParamsDateRange1dControl RadarConnectionTamperingSummaryParamsDateRange = "1dControl" - RadarConnectionTamperingSummaryParamsDateRange2dControl RadarConnectionTamperingSummaryParamsDateRange = "2dControl" - RadarConnectionTamperingSummaryParamsDateRange7dControl RadarConnectionTamperingSummaryParamsDateRange = "7dControl" - RadarConnectionTamperingSummaryParamsDateRange14dControl RadarConnectionTamperingSummaryParamsDateRange = "14dControl" - RadarConnectionTamperingSummaryParamsDateRange28dControl RadarConnectionTamperingSummaryParamsDateRange = "28dControl" - RadarConnectionTamperingSummaryParamsDateRange12wControl RadarConnectionTamperingSummaryParamsDateRange = "12wControl" - RadarConnectionTamperingSummaryParamsDateRange24wControl RadarConnectionTamperingSummaryParamsDateRange = "24wControl" + RadarConnectionTamperingListParamsDateRange1d RadarConnectionTamperingListParamsDateRange = "1d" + RadarConnectionTamperingListParamsDateRange2d RadarConnectionTamperingListParamsDateRange = "2d" + RadarConnectionTamperingListParamsDateRange7d RadarConnectionTamperingListParamsDateRange = "7d" + RadarConnectionTamperingListParamsDateRange14d RadarConnectionTamperingListParamsDateRange = "14d" + RadarConnectionTamperingListParamsDateRange28d RadarConnectionTamperingListParamsDateRange = "28d" + RadarConnectionTamperingListParamsDateRange12w RadarConnectionTamperingListParamsDateRange = "12w" + RadarConnectionTamperingListParamsDateRange24w RadarConnectionTamperingListParamsDateRange = "24w" + RadarConnectionTamperingListParamsDateRange52w RadarConnectionTamperingListParamsDateRange = "52w" + RadarConnectionTamperingListParamsDateRange1dControl RadarConnectionTamperingListParamsDateRange = "1dControl" + RadarConnectionTamperingListParamsDateRange2dControl RadarConnectionTamperingListParamsDateRange = "2dControl" + RadarConnectionTamperingListParamsDateRange7dControl RadarConnectionTamperingListParamsDateRange = "7dControl" + RadarConnectionTamperingListParamsDateRange14dControl RadarConnectionTamperingListParamsDateRange = "14dControl" + RadarConnectionTamperingListParamsDateRange28dControl RadarConnectionTamperingListParamsDateRange = "28dControl" + RadarConnectionTamperingListParamsDateRange12wControl RadarConnectionTamperingListParamsDateRange = "12wControl" + RadarConnectionTamperingListParamsDateRange24wControl RadarConnectionTamperingListParamsDateRange = "24wControl" ) // Format results are returned in. -type RadarConnectionTamperingSummaryParamsFormat string +type RadarConnectionTamperingListParamsFormat string const ( - RadarConnectionTamperingSummaryParamsFormatJson RadarConnectionTamperingSummaryParamsFormat = "JSON" - RadarConnectionTamperingSummaryParamsFormatCsv RadarConnectionTamperingSummaryParamsFormat = "CSV" + RadarConnectionTamperingListParamsFormatJson RadarConnectionTamperingListParamsFormat = "JSON" + RadarConnectionTamperingListParamsFormatCsv RadarConnectionTamperingListParamsFormat = "CSV" ) -type RadarConnectionTamperingSummaryResponseEnvelope struct { - Result RadarConnectionTamperingSummaryResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarConnectionTamperingSummaryResponseEnvelopeJSON `json:"-"` +type RadarConnectionTamperingListResponseEnvelope struct { + Result RadarConnectionTamperingListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarConnectionTamperingListResponseEnvelopeJSON `json:"-"` } -// radarConnectionTamperingSummaryResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarConnectionTamperingSummaryResponseEnvelope] -type radarConnectionTamperingSummaryResponseEnvelopeJSON struct { +// radarConnectionTamperingListResponseEnvelopeJSON contains the JSON metadata for +// the struct [RadarConnectionTamperingListResponseEnvelope] +type radarConnectionTamperingListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarConnectionTamperingSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarConnectionTamperingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radarconnectiontampering_test.go b/radarconnectiontampering_test.go index 9e7533f8709..a4a4013ac4e 100644 --- a/radarconnectiontampering_test.go +++ b/radarconnectiontampering_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarConnectionTamperingSummaryWithOptionalParams(t *testing.T) { +func TestRadarConnectionTamperingListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,12 +30,12 @@ func TestRadarConnectionTamperingSummaryWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.ConnectionTampering.Summary(context.TODO(), cloudflare.RadarConnectionTamperingSummaryParams{ + _, err := client.Radar.ConnectionTampering.List(context.TODO(), cloudflare.RadarConnectionTamperingListParams{ Asn: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarConnectionTamperingSummaryParamsDateRange{cloudflare.RadarConnectionTamperingSummaryParamsDateRange1d, cloudflare.RadarConnectionTamperingSummaryParamsDateRange2d, cloudflare.RadarConnectionTamperingSummaryParamsDateRange7d}), + DateRange: cloudflare.F([]cloudflare.RadarConnectionTamperingListParamsDateRange{cloudflare.RadarConnectionTamperingListParamsDateRange1d, cloudflare.RadarConnectionTamperingListParamsDateRange2d, cloudflare.RadarConnectionTamperingListParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarConnectionTamperingSummaryParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarConnectionTamperingListParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), }) diff --git a/radardatasetdownload.go b/radardatasetdownload.go index d24c87b78fb..da69a690e1b 100644 --- a/radardatasetdownload.go +++ b/radardatasetdownload.go @@ -33,9 +33,9 @@ func NewRadarDatasetDownloadService(opts ...option.RequestOption) (r *RadarDatas } // Get a url to download a single dataset. -func (r *RadarDatasetDownloadService) RadarPostDatasetDownload(ctx context.Context, params RadarDatasetDownloadRadarPostDatasetDownloadParams, opts ...option.RequestOption) (res *RadarDatasetDownloadRadarPostDatasetDownloadResponse, err error) { +func (r *RadarDatasetDownloadService) New(ctx context.Context, params RadarDatasetDownloadNewParams, opts ...option.RequestOption) (res *RadarDatasetDownloadNewResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarDatasetDownloadRadarPostDatasetDownloadResponseEnvelope + var env RadarDatasetDownloadNewResponseEnvelope path := "radar/datasets/download" err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { @@ -45,54 +45,53 @@ func (r *RadarDatasetDownloadService) RadarPostDatasetDownload(ctx context.Conte return } -type RadarDatasetDownloadRadarPostDatasetDownloadResponse struct { - Dataset RadarDatasetDownloadRadarPostDatasetDownloadResponseDataset `json:"dataset,required"` - JSON radarDatasetDownloadRadarPostDatasetDownloadResponseJSON `json:"-"` +type RadarDatasetDownloadNewResponse struct { + Dataset RadarDatasetDownloadNewResponseDataset `json:"dataset,required"` + JSON radarDatasetDownloadNewResponseJSON `json:"-"` } -// radarDatasetDownloadRadarPostDatasetDownloadResponseJSON contains the JSON -// metadata for the struct [RadarDatasetDownloadRadarPostDatasetDownloadResponse] -type radarDatasetDownloadRadarPostDatasetDownloadResponseJSON struct { +// radarDatasetDownloadNewResponseJSON contains the JSON metadata for the struct +// [RadarDatasetDownloadNewResponse] +type radarDatasetDownloadNewResponseJSON struct { Dataset apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarDatasetDownloadRadarPostDatasetDownloadResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarDatasetDownloadNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarDatasetDownloadRadarPostDatasetDownloadResponseDataset struct { - URL string `json:"url,required"` - JSON radarDatasetDownloadRadarPostDatasetDownloadResponseDatasetJSON `json:"-"` +type RadarDatasetDownloadNewResponseDataset struct { + URL string `json:"url,required"` + JSON radarDatasetDownloadNewResponseDatasetJSON `json:"-"` } -// radarDatasetDownloadRadarPostDatasetDownloadResponseDatasetJSON contains the -// JSON metadata for the struct -// [RadarDatasetDownloadRadarPostDatasetDownloadResponseDataset] -type radarDatasetDownloadRadarPostDatasetDownloadResponseDatasetJSON struct { +// radarDatasetDownloadNewResponseDatasetJSON contains the JSON metadata for the +// struct [RadarDatasetDownloadNewResponseDataset] +type radarDatasetDownloadNewResponseDatasetJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarDatasetDownloadRadarPostDatasetDownloadResponseDataset) UnmarshalJSON(data []byte) (err error) { +func (r *RadarDatasetDownloadNewResponseDataset) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarDatasetDownloadRadarPostDatasetDownloadParams struct { +type RadarDatasetDownloadNewParams struct { DatasetID param.Field[int64] `json:"datasetId,required"` // Format results are returned in. - Format param.Field[RadarDatasetDownloadRadarPostDatasetDownloadParamsFormat] `query:"format"` + Format param.Field[RadarDatasetDownloadNewParamsFormat] `query:"format"` } -func (r RadarDatasetDownloadRadarPostDatasetDownloadParams) MarshalJSON() (data []byte, err error) { +func (r RadarDatasetDownloadNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// URLQuery serializes [RadarDatasetDownloadRadarPostDatasetDownloadParams]'s query -// parameters as `url.Values`. -func (r RadarDatasetDownloadRadarPostDatasetDownloadParams) URLQuery() (v url.Values) { +// URLQuery serializes [RadarDatasetDownloadNewParams]'s query parameters as +// `url.Values`. +func (r RadarDatasetDownloadNewParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -100,29 +99,28 @@ func (r RadarDatasetDownloadRadarPostDatasetDownloadParams) URLQuery() (v url.Va } // Format results are returned in. -type RadarDatasetDownloadRadarPostDatasetDownloadParamsFormat string +type RadarDatasetDownloadNewParamsFormat string const ( - RadarDatasetDownloadRadarPostDatasetDownloadParamsFormatJson RadarDatasetDownloadRadarPostDatasetDownloadParamsFormat = "JSON" - RadarDatasetDownloadRadarPostDatasetDownloadParamsFormatCsv RadarDatasetDownloadRadarPostDatasetDownloadParamsFormat = "CSV" + RadarDatasetDownloadNewParamsFormatJson RadarDatasetDownloadNewParamsFormat = "JSON" + RadarDatasetDownloadNewParamsFormatCsv RadarDatasetDownloadNewParamsFormat = "CSV" ) -type RadarDatasetDownloadRadarPostDatasetDownloadResponseEnvelope struct { - Result RadarDatasetDownloadRadarPostDatasetDownloadResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarDatasetDownloadRadarPostDatasetDownloadResponseEnvelopeJSON `json:"-"` +type RadarDatasetDownloadNewResponseEnvelope struct { + Result RadarDatasetDownloadNewResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarDatasetDownloadNewResponseEnvelopeJSON `json:"-"` } -// radarDatasetDownloadRadarPostDatasetDownloadResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [RadarDatasetDownloadRadarPostDatasetDownloadResponseEnvelope] -type radarDatasetDownloadRadarPostDatasetDownloadResponseEnvelopeJSON struct { +// radarDatasetDownloadNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarDatasetDownloadNewResponseEnvelope] +type radarDatasetDownloadNewResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarDatasetDownloadRadarPostDatasetDownloadResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarDatasetDownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radardatasetdownload_test.go b/radardatasetdownload_test.go index 9870fbb43be..7c12934615c 100644 --- a/radardatasetdownload_test.go +++ b/radardatasetdownload_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarDatasetDownloadRadarPostDatasetDownloadWithOptionalParams(t *testing.T) { +func TestRadarDatasetDownloadNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,9 +29,9 @@ func TestRadarDatasetDownloadRadarPostDatasetDownloadWithOptionalParams(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Datasets.Downloads.RadarPostDatasetDownload(context.TODO(), cloudflare.RadarDatasetDownloadRadarPostDatasetDownloadParams{ + _, err := client.Radar.Datasets.Downloads.New(context.TODO(), cloudflare.RadarDatasetDownloadNewParams{ DatasetID: cloudflare.F(int64(3)), - Format: cloudflare.F(cloudflare.RadarDatasetDownloadRadarPostDatasetDownloadParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarDatasetDownloadNewParamsFormatJson), }) if err != nil { var apierr *cloudflare.Error diff --git a/radaremailsecuritysummaryspam.go b/radaremailsecuritysummaryspam.go index 1fdaa34309c..742fd18e5d3 100644 --- a/radaremailsecuritysummaryspam.go +++ b/radaremailsecuritysummaryspam.go @@ -34,9 +34,9 @@ func NewRadarEmailSecuritySummarySpamService(opts ...option.RequestOption) (r *R } // Proportion of emails categorized as either spam or legitimate (non-spam). -func (r *RadarEmailSecuritySummarySpamService) Get(ctx context.Context, query RadarEmailSecuritySummarySpamGetParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummarySpamGetResponse, err error) { +func (r *RadarEmailSecuritySummarySpamService) List(ctx context.Context, query RadarEmailSecuritySummarySpamListParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummarySpamListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarEmailSecuritySummarySpamGetResponseEnvelope + var env RadarEmailSecuritySummarySpamListResponseEnvelope path := "radar/email/security/summary/spam" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,36 +46,36 @@ func (r *RadarEmailSecuritySummarySpamService) Get(ctx context.Context, query Ra return } -type RadarEmailSecuritySummarySpamGetResponse struct { - Meta RadarEmailSecuritySummarySpamGetResponseMeta `json:"meta,required"` - Summary0 RadarEmailSecuritySummarySpamGetResponseSummary0 `json:"summary_0,required"` - JSON radarEmailSecuritySummarySpamGetResponseJSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponse struct { + Meta RadarEmailSecuritySummarySpamListResponseMeta `json:"meta,required"` + Summary0 RadarEmailSecuritySummarySpamListResponseSummary0 `json:"summary_0,required"` + JSON radarEmailSecuritySummarySpamListResponseJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecuritySummarySpamGetResponse] -type radarEmailSecuritySummarySpamGetResponseJSON struct { +// radarEmailSecuritySummarySpamListResponseJSON contains the JSON metadata for the +// struct [RadarEmailSecuritySummarySpamListResponse] +type radarEmailSecuritySummarySpamListResponseJSON struct { Meta apijson.Field Summary0 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetResponseMeta struct { - DateRange []RadarEmailSecuritySummarySpamGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - Normalization string `json:"normalization,required"` - ConfidenceInfo RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecuritySummarySpamGetResponseMetaJSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponseMeta struct { + DateRange []RadarEmailSecuritySummarySpamListResponseMetaDateRange `json:"dateRange,required"` + LastUpdated string `json:"lastUpdated,required"` + Normalization string `json:"normalization,required"` + ConfidenceInfo RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfo `json:"confidenceInfo"` + JSON radarEmailSecuritySummarySpamListResponseMetaJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecuritySummarySpamGetResponseMeta] -type radarEmailSecuritySummarySpamGetResponseMetaJSON struct { +// radarEmailSecuritySummarySpamListResponseMetaJSON contains the JSON metadata for +// the struct [RadarEmailSecuritySummarySpamListResponseMeta] +type radarEmailSecuritySummarySpamListResponseMetaJSON struct { DateRange apijson.Field LastUpdated apijson.Field Normalization apijson.Field @@ -84,66 +84,66 @@ type radarEmailSecuritySummarySpamGetResponseMetaJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseMeta) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetResponseMetaDateRange struct { +type RadarEmailSecuritySummarySpamListResponseMetaDateRange struct { // Adjusted end of date range. EndTime time.Time `json:"endTime,required" format:"date-time"` // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecuritySummarySpamGetResponseMetaDateRangeJSON `json:"-"` + StartTime time.Time `json:"startTime,required" format:"date-time"` + JSON radarEmailSecuritySummarySpamListResponseMetaDateRangeJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecuritySummarySpamGetResponseMetaDateRange] -type radarEmailSecuritySummarySpamGetResponseMetaDateRangeJSON struct { +// radarEmailSecuritySummarySpamListResponseMetaDateRangeJSON contains the JSON +// metadata for the struct [RadarEmailSecuritySummarySpamListResponseMetaDateRange] +type radarEmailSecuritySummarySpamListResponseMetaDateRangeJSON struct { EndTime apijson.Field StartTime apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoJSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfo struct { + Annotations []RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotation `json:"annotations"` + Level int64 `json:"level"` + JSON radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfo] -type radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoJSON struct { +// radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoJSON contains the +// JSON metadata for the struct +// [RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfo] +type radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoJSON struct { Annotations apijson.Field Level apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotation struct { + DataSource string `json:"dataSource,required"` + Description string `json:"description,required"` + EventType string `json:"eventType,required"` + IsInstantaneous interface{} `json:"isInstantaneous,required"` + EndTime time.Time `json:"endTime" format:"date-time"` + LinkedURL string `json:"linkedUrl"` + StartTime time.Time `json:"startTime" format:"date-time"` + JSON radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotationJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotationJSON +// radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotationJSON // contains the JSON metadata for the struct -// [RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotationJSON struct { +// [RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotation] +type radarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotationJSON struct { DataSource apijson.Field Description apijson.Field EventType apijson.Field @@ -155,32 +155,32 @@ type radarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotationJSON st ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetResponseSummary0 struct { - NotSpam string `json:"NOT_SPAM,required"` - Spam string `json:"SPAM,required"` - JSON radarEmailSecuritySummarySpamGetResponseSummary0JSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponseSummary0 struct { + NotSpam string `json:"NOT_SPAM,required"` + Spam string `json:"SPAM,required"` + JSON radarEmailSecuritySummarySpamListResponseSummary0JSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseSummary0JSON contains the JSON metadata -// for the struct [RadarEmailSecuritySummarySpamGetResponseSummary0] -type radarEmailSecuritySummarySpamGetResponseSummary0JSON struct { +// radarEmailSecuritySummarySpamListResponseSummary0JSON contains the JSON metadata +// for the struct [RadarEmailSecuritySummarySpamListResponseSummary0] +type radarEmailSecuritySummarySpamListResponseSummary0JSON struct { NotSpam apijson.Field Spam apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseSummary0) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseSummary0) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEmailSecuritySummarySpamGetParams struct { +type RadarEmailSecuritySummarySpamListParams struct { // Filter for arc (Authenticated Received Chain). - Arc param.Field[[]RadarEmailSecuritySummarySpamGetParamsArc] `query:"arc"` + Arc param.Field[[]RadarEmailSecuritySummarySpamListParamsArc] `query:"arc"` // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. @@ -190,15 +190,15 @@ type RadarEmailSecuritySummarySpamGetParams struct { // For example, use `7d` and `7dControl` to compare this week with the previous // week. Use this parameter or set specific start and end dates (`dateStart` and // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecuritySummarySpamGetParamsDateRange] `query:"dateRange"` + DateRange param.Field[[]RadarEmailSecuritySummarySpamListParamsDateRange] `query:"dateRange"` // Array of datetimes to filter the start of a series. DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` // Filter for dkim. - DKIM param.Field[[]RadarEmailSecuritySummarySpamGetParamsDKIM] `query:"dkim"` + DKIM param.Field[[]RadarEmailSecuritySummarySpamListParamsDKIM] `query:"dkim"` // Filter for dmarc. - Dmarc param.Field[[]RadarEmailSecuritySummarySpamGetParamsDmarc] `query:"dmarc"` + Dmarc param.Field[[]RadarEmailSecuritySummarySpamListParamsDmarc] `query:"dmarc"` // Format results are returned in. - Format param.Field[RadarEmailSecuritySummarySpamGetParamsFormat] `query:"format"` + Format param.Field[RadarEmailSecuritySummarySpamListParamsFormat] `query:"format"` // Array of comma separated list of locations (alpha-2 country codes). Start with // `-` to exclude from results. For example, `-US,PT` excludes results from the US, // but includes results from PT. @@ -206,93 +206,93 @@ type RadarEmailSecuritySummarySpamGetParams struct { // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. - SPF param.Field[[]RadarEmailSecuritySummarySpamGetParamsSPF] `query:"spf"` + SPF param.Field[[]RadarEmailSecuritySummarySpamListParamsSPF] `query:"spf"` } -// URLQuery serializes [RadarEmailSecuritySummarySpamGetParams]'s query parameters +// URLQuery serializes [RadarEmailSecuritySummarySpamListParams]'s query parameters // as `url.Values`. -func (r RadarEmailSecuritySummarySpamGetParams) URLQuery() (v url.Values) { +func (r RadarEmailSecuritySummarySpamListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type RadarEmailSecuritySummarySpamGetParamsArc string +type RadarEmailSecuritySummarySpamListParamsArc string const ( - RadarEmailSecuritySummarySpamGetParamsArcPass RadarEmailSecuritySummarySpamGetParamsArc = "PASS" - RadarEmailSecuritySummarySpamGetParamsArcNone RadarEmailSecuritySummarySpamGetParamsArc = "NONE" - RadarEmailSecuritySummarySpamGetParamsArcFail RadarEmailSecuritySummarySpamGetParamsArc = "FAIL" + RadarEmailSecuritySummarySpamListParamsArcPass RadarEmailSecuritySummarySpamListParamsArc = "PASS" + RadarEmailSecuritySummarySpamListParamsArcNone RadarEmailSecuritySummarySpamListParamsArc = "NONE" + RadarEmailSecuritySummarySpamListParamsArcFail RadarEmailSecuritySummarySpamListParamsArc = "FAIL" ) -type RadarEmailSecuritySummarySpamGetParamsDateRange string +type RadarEmailSecuritySummarySpamListParamsDateRange string const ( - RadarEmailSecuritySummarySpamGetParamsDateRange1d RadarEmailSecuritySummarySpamGetParamsDateRange = "1d" - RadarEmailSecuritySummarySpamGetParamsDateRange2d RadarEmailSecuritySummarySpamGetParamsDateRange = "2d" - RadarEmailSecuritySummarySpamGetParamsDateRange7d RadarEmailSecuritySummarySpamGetParamsDateRange = "7d" - RadarEmailSecuritySummarySpamGetParamsDateRange14d RadarEmailSecuritySummarySpamGetParamsDateRange = "14d" - RadarEmailSecuritySummarySpamGetParamsDateRange28d RadarEmailSecuritySummarySpamGetParamsDateRange = "28d" - RadarEmailSecuritySummarySpamGetParamsDateRange12w RadarEmailSecuritySummarySpamGetParamsDateRange = "12w" - RadarEmailSecuritySummarySpamGetParamsDateRange24w RadarEmailSecuritySummarySpamGetParamsDateRange = "24w" - RadarEmailSecuritySummarySpamGetParamsDateRange52w RadarEmailSecuritySummarySpamGetParamsDateRange = "52w" - RadarEmailSecuritySummarySpamGetParamsDateRange1dControl RadarEmailSecuritySummarySpamGetParamsDateRange = "1dControl" - RadarEmailSecuritySummarySpamGetParamsDateRange2dControl RadarEmailSecuritySummarySpamGetParamsDateRange = "2dControl" - RadarEmailSecuritySummarySpamGetParamsDateRange7dControl RadarEmailSecuritySummarySpamGetParamsDateRange = "7dControl" - RadarEmailSecuritySummarySpamGetParamsDateRange14dControl RadarEmailSecuritySummarySpamGetParamsDateRange = "14dControl" - RadarEmailSecuritySummarySpamGetParamsDateRange28dControl RadarEmailSecuritySummarySpamGetParamsDateRange = "28dControl" - RadarEmailSecuritySummarySpamGetParamsDateRange12wControl RadarEmailSecuritySummarySpamGetParamsDateRange = "12wControl" - RadarEmailSecuritySummarySpamGetParamsDateRange24wControl RadarEmailSecuritySummarySpamGetParamsDateRange = "24wControl" + RadarEmailSecuritySummarySpamListParamsDateRange1d RadarEmailSecuritySummarySpamListParamsDateRange = "1d" + RadarEmailSecuritySummarySpamListParamsDateRange2d RadarEmailSecuritySummarySpamListParamsDateRange = "2d" + RadarEmailSecuritySummarySpamListParamsDateRange7d RadarEmailSecuritySummarySpamListParamsDateRange = "7d" + RadarEmailSecuritySummarySpamListParamsDateRange14d RadarEmailSecuritySummarySpamListParamsDateRange = "14d" + RadarEmailSecuritySummarySpamListParamsDateRange28d RadarEmailSecuritySummarySpamListParamsDateRange = "28d" + RadarEmailSecuritySummarySpamListParamsDateRange12w RadarEmailSecuritySummarySpamListParamsDateRange = "12w" + RadarEmailSecuritySummarySpamListParamsDateRange24w RadarEmailSecuritySummarySpamListParamsDateRange = "24w" + RadarEmailSecuritySummarySpamListParamsDateRange52w RadarEmailSecuritySummarySpamListParamsDateRange = "52w" + RadarEmailSecuritySummarySpamListParamsDateRange1dControl RadarEmailSecuritySummarySpamListParamsDateRange = "1dControl" + RadarEmailSecuritySummarySpamListParamsDateRange2dControl RadarEmailSecuritySummarySpamListParamsDateRange = "2dControl" + RadarEmailSecuritySummarySpamListParamsDateRange7dControl RadarEmailSecuritySummarySpamListParamsDateRange = "7dControl" + RadarEmailSecuritySummarySpamListParamsDateRange14dControl RadarEmailSecuritySummarySpamListParamsDateRange = "14dControl" + RadarEmailSecuritySummarySpamListParamsDateRange28dControl RadarEmailSecuritySummarySpamListParamsDateRange = "28dControl" + RadarEmailSecuritySummarySpamListParamsDateRange12wControl RadarEmailSecuritySummarySpamListParamsDateRange = "12wControl" + RadarEmailSecuritySummarySpamListParamsDateRange24wControl RadarEmailSecuritySummarySpamListParamsDateRange = "24wControl" ) -type RadarEmailSecuritySummarySpamGetParamsDKIM string +type RadarEmailSecuritySummarySpamListParamsDKIM string const ( - RadarEmailSecuritySummarySpamGetParamsDKIMPass RadarEmailSecuritySummarySpamGetParamsDKIM = "PASS" - RadarEmailSecuritySummarySpamGetParamsDKIMNone RadarEmailSecuritySummarySpamGetParamsDKIM = "NONE" - RadarEmailSecuritySummarySpamGetParamsDKIMFail RadarEmailSecuritySummarySpamGetParamsDKIM = "FAIL" + RadarEmailSecuritySummarySpamListParamsDKIMPass RadarEmailSecuritySummarySpamListParamsDKIM = "PASS" + RadarEmailSecuritySummarySpamListParamsDKIMNone RadarEmailSecuritySummarySpamListParamsDKIM = "NONE" + RadarEmailSecuritySummarySpamListParamsDKIMFail RadarEmailSecuritySummarySpamListParamsDKIM = "FAIL" ) -type RadarEmailSecuritySummarySpamGetParamsDmarc string +type RadarEmailSecuritySummarySpamListParamsDmarc string const ( - RadarEmailSecuritySummarySpamGetParamsDmarcPass RadarEmailSecuritySummarySpamGetParamsDmarc = "PASS" - RadarEmailSecuritySummarySpamGetParamsDmarcNone RadarEmailSecuritySummarySpamGetParamsDmarc = "NONE" - RadarEmailSecuritySummarySpamGetParamsDmarcFail RadarEmailSecuritySummarySpamGetParamsDmarc = "FAIL" + RadarEmailSecuritySummarySpamListParamsDmarcPass RadarEmailSecuritySummarySpamListParamsDmarc = "PASS" + RadarEmailSecuritySummarySpamListParamsDmarcNone RadarEmailSecuritySummarySpamListParamsDmarc = "NONE" + RadarEmailSecuritySummarySpamListParamsDmarcFail RadarEmailSecuritySummarySpamListParamsDmarc = "FAIL" ) // Format results are returned in. -type RadarEmailSecuritySummarySpamGetParamsFormat string +type RadarEmailSecuritySummarySpamListParamsFormat string const ( - RadarEmailSecuritySummarySpamGetParamsFormatJson RadarEmailSecuritySummarySpamGetParamsFormat = "JSON" - RadarEmailSecuritySummarySpamGetParamsFormatCsv RadarEmailSecuritySummarySpamGetParamsFormat = "CSV" + RadarEmailSecuritySummarySpamListParamsFormatJson RadarEmailSecuritySummarySpamListParamsFormat = "JSON" + RadarEmailSecuritySummarySpamListParamsFormatCsv RadarEmailSecuritySummarySpamListParamsFormat = "CSV" ) -type RadarEmailSecuritySummarySpamGetParamsSPF string +type RadarEmailSecuritySummarySpamListParamsSPF string const ( - RadarEmailSecuritySummarySpamGetParamsSPFPass RadarEmailSecuritySummarySpamGetParamsSPF = "PASS" - RadarEmailSecuritySummarySpamGetParamsSPFNone RadarEmailSecuritySummarySpamGetParamsSPF = "NONE" - RadarEmailSecuritySummarySpamGetParamsSPFFail RadarEmailSecuritySummarySpamGetParamsSPF = "FAIL" + RadarEmailSecuritySummarySpamListParamsSPFPass RadarEmailSecuritySummarySpamListParamsSPF = "PASS" + RadarEmailSecuritySummarySpamListParamsSPFNone RadarEmailSecuritySummarySpamListParamsSPF = "NONE" + RadarEmailSecuritySummarySpamListParamsSPFFail RadarEmailSecuritySummarySpamListParamsSPF = "FAIL" ) -type RadarEmailSecuritySummarySpamGetResponseEnvelope struct { - Result RadarEmailSecuritySummarySpamGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecuritySummarySpamGetResponseEnvelopeJSON `json:"-"` +type RadarEmailSecuritySummarySpamListResponseEnvelope struct { + Result RadarEmailSecuritySummarySpamListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarEmailSecuritySummarySpamListResponseEnvelopeJSON `json:"-"` } -// radarEmailSecuritySummarySpamGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecuritySummarySpamGetResponseEnvelope] -type radarEmailSecuritySummarySpamGetResponseEnvelopeJSON struct { +// radarEmailSecuritySummarySpamListResponseEnvelopeJSON contains the JSON metadata +// for the struct [RadarEmailSecuritySummarySpamListResponseEnvelope] +type radarEmailSecuritySummarySpamListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEmailSecuritySummarySpamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEmailSecuritySummarySpamListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radaremailsecuritysummaryspam_test.go b/radaremailsecuritysummaryspam_test.go index 8587e1af941..7c335739804 100644 --- a/radaremailsecuritysummaryspam_test.go +++ b/radaremailsecuritysummaryspam_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarEmailSecuritySummarySpamGetWithOptionalParams(t *testing.T) { +func TestRadarEmailSecuritySummarySpamListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,18 +30,18 @@ func TestRadarEmailSecuritySummarySpamGetWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Email.Security.Summaries.Spams.Get(context.TODO(), cloudflare.RadarEmailSecuritySummarySpamGetParams{ - Arc: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamGetParamsArc{cloudflare.RadarEmailSecuritySummarySpamGetParamsArcPass, cloudflare.RadarEmailSecuritySummarySpamGetParamsArcNone, cloudflare.RadarEmailSecuritySummarySpamGetParamsArcFail}), + _, err := client.Radar.Email.Security.Summaries.Spams.List(context.TODO(), cloudflare.RadarEmailSecuritySummarySpamListParams{ + Arc: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamListParamsArc{cloudflare.RadarEmailSecuritySummarySpamListParamsArcPass, cloudflare.RadarEmailSecuritySummarySpamListParamsArcNone, cloudflare.RadarEmailSecuritySummarySpamListParamsArcFail}), Asn: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamGetParamsDateRange{cloudflare.RadarEmailSecuritySummarySpamGetParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySpamGetParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySpamGetParamsDateRange7d}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamListParamsDateRange{cloudflare.RadarEmailSecuritySummarySpamListParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySpamListParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySpamListParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamGetParamsDKIM{cloudflare.RadarEmailSecuritySummarySpamGetParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySpamGetParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySpamGetParamsDKIMFail}), - Dmarc: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamGetParamsDmarc{cloudflare.RadarEmailSecuritySummarySpamGetParamsDmarcPass, cloudflare.RadarEmailSecuritySummarySpamGetParamsDmarcNone, cloudflare.RadarEmailSecuritySummarySpamGetParamsDmarcFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySpamGetParamsFormatJson), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamListParamsDKIM{cloudflare.RadarEmailSecuritySummarySpamListParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySpamListParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySpamListParamsDKIMFail}), + Dmarc: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamListParamsDmarc{cloudflare.RadarEmailSecuritySummarySpamListParamsDmarcPass, cloudflare.RadarEmailSecuritySummarySpamListParamsDmarcNone, cloudflare.RadarEmailSecuritySummarySpamListParamsDmarcFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySpamListParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamGetParamsSPF{cloudflare.RadarEmailSecuritySummarySpamGetParamsSPFPass, cloudflare.RadarEmailSecuritySummarySpamGetParamsSPFNone, cloudflare.RadarEmailSecuritySummarySpamGetParamsSPFFail}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamListParamsSPF{cloudflare.RadarEmailSecuritySummarySpamListParamsSPFPass, cloudflare.RadarEmailSecuritySummarySpamListParamsSPFNone, cloudflare.RadarEmailSecuritySummarySpamListParamsSPFFail}), }) if err != nil { var apierr *cloudflare.Error diff --git a/radarentity.go b/radarentity.go index 0930e661933..ace3bcb0159 100644 --- a/radarentity.go +++ b/radarentity.go @@ -35,9 +35,9 @@ func NewRadarEntityService(opts ...option.RequestOption) (r *RadarEntityService) } // Get IP address information. -func (r *RadarEntityService) IPs(ctx context.Context, query RadarEntityIPsParams, opts ...option.RequestOption) (res *RadarEntityIPsResponse, err error) { +func (r *RadarEntityService) List(ctx context.Context, query RadarEntityListParams, opts ...option.RequestOption) (res *RadarEntityListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarEntityIPsResponseEnvelope + var env RadarEntityListResponseEnvelope path := "radar/entities/ip" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -47,38 +47,38 @@ func (r *RadarEntityService) IPs(ctx context.Context, query RadarEntityIPsParams return } -type RadarEntityIPsResponse struct { - IP RadarEntityIPsResponseIP `json:"ip,required"` - JSON radarEntityIPsResponseJSON `json:"-"` +type RadarEntityListResponse struct { + IP RadarEntityListResponseIP `json:"ip,required"` + JSON radarEntityListResponseJSON `json:"-"` } -// radarEntityIPsResponseJSON contains the JSON metadata for the struct -// [RadarEntityIPsResponse] -type radarEntityIPsResponseJSON struct { +// radarEntityListResponseJSON contains the JSON metadata for the struct +// [RadarEntityListResponse] +type radarEntityListResponseJSON struct { IP apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEntityIPsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEntityListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEntityIPsResponseIP struct { - Asn string `json:"asn,required"` - AsnLocation string `json:"asnLocation,required"` - AsnName string `json:"asnName,required"` - AsnOrgName string `json:"asnOrgName,required"` - IP string `json:"ip,required"` - IPVersion string `json:"ipVersion,required"` - Location string `json:"location,required"` - LocationName string `json:"locationName,required"` - JSON radarEntityIPsResponseIPJSON `json:"-"` +type RadarEntityListResponseIP struct { + Asn string `json:"asn,required"` + AsnLocation string `json:"asnLocation,required"` + AsnName string `json:"asnName,required"` + AsnOrgName string `json:"asnOrgName,required"` + IP string `json:"ip,required"` + IPVersion string `json:"ipVersion,required"` + Location string `json:"location,required"` + LocationName string `json:"locationName,required"` + JSON radarEntityListResponseIPJSON `json:"-"` } -// radarEntityIPsResponseIPJSON contains the JSON metadata for the struct -// [RadarEntityIPsResponseIP] -type radarEntityIPsResponseIPJSON struct { +// radarEntityListResponseIPJSON contains the JSON metadata for the struct +// [RadarEntityListResponseIP] +type radarEntityListResponseIPJSON struct { Asn apijson.Field AsnLocation apijson.Field AsnName apijson.Field @@ -91,19 +91,19 @@ type radarEntityIPsResponseIPJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarEntityIPsResponseIP) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEntityListResponseIP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarEntityIPsParams struct { +type RadarEntityListParams struct { // IP address. IP param.Field[string] `query:"ip,required"` // Format results are returned in. - Format param.Field[RadarEntityIPsParamsFormat] `query:"format"` + Format param.Field[RadarEntityListParamsFormat] `query:"format"` } -// URLQuery serializes [RadarEntityIPsParams]'s query parameters as `url.Values`. -func (r RadarEntityIPsParams) URLQuery() (v url.Values) { +// URLQuery serializes [RadarEntityListParams]'s query parameters as `url.Values`. +func (r RadarEntityListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -111,28 +111,28 @@ func (r RadarEntityIPsParams) URLQuery() (v url.Values) { } // Format results are returned in. -type RadarEntityIPsParamsFormat string +type RadarEntityListParamsFormat string const ( - RadarEntityIPsParamsFormatJson RadarEntityIPsParamsFormat = "JSON" - RadarEntityIPsParamsFormatCsv RadarEntityIPsParamsFormat = "CSV" + RadarEntityListParamsFormatJson RadarEntityListParamsFormat = "JSON" + RadarEntityListParamsFormatCsv RadarEntityListParamsFormat = "CSV" ) -type RadarEntityIPsResponseEnvelope struct { - Result RadarEntityIPsResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEntityIPsResponseEnvelopeJSON `json:"-"` +type RadarEntityListResponseEnvelope struct { + Result RadarEntityListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarEntityListResponseEnvelopeJSON `json:"-"` } -// radarEntityIPsResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarEntityIPsResponseEnvelope] -type radarEntityIPsResponseEnvelopeJSON struct { +// radarEntityListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RadarEntityListResponseEnvelope] +type radarEntityListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarEntityIPsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarEntityListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radarentity_test.go b/radarentity_test.go index 1022c37ed33..fb86007da92 100644 --- a/radarentity_test.go +++ b/radarentity_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarEntityIPsWithOptionalParams(t *testing.T) { +func TestRadarEntityListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,9 +29,9 @@ func TestRadarEntityIPsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Entities.IPs(context.TODO(), cloudflare.RadarEntityIPsParams{ + _, err := client.Radar.Entities.List(context.TODO(), cloudflare.RadarEntityListParams{ IP: cloudflare.F("8.8.8.8"), - Format: cloudflare.F(cloudflare.RadarEntityIPsParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarEntityListParamsFormatJson), }) if err != nil { var apierr *cloudflare.Error diff --git a/radarhttp.go b/radarhttp.go index 5275f05a90f..bd4663e52e8 100644 --- a/radarhttp.go +++ b/radarhttp.go @@ -3,15 +3,6 @@ package cloudflare import ( - "context" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,1722 +24,3 @@ func NewRadarHTTPService(opts ...option.RequestOption) (r *RadarHTTPService) { r.TLSVersion = NewRadarHTTPTLSVersionService(opts...) return } - -// Get a time series of the percentage distribution of traffic classified as -// automated or human. Visit -// https://developers.cloudflare.com/radar/concepts/bot-classes/ for more -// information. -func (r *RadarHTTPService) BotClasses(ctx context.Context, query RadarHTTPBotClassesParams, opts ...option.RequestOption) (res *RadarHTTPBotClassesResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHTTPBotClassesResponseEnvelope - path := "radar/http/timeseries_groups/bot_class" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic of the top user -// agents aggregated in families. -func (r *RadarHTTPService) BrowserFamilies(ctx context.Context, query RadarHTTPBrowserFamiliesParams, opts ...option.RequestOption) (res *RadarHTTPBrowserFamiliesResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHTTPBrowserFamiliesResponseEnvelope - path := "radar/http/timeseries_groups/browser_family" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic of the top user -// agents. -func (r *RadarHTTPService) Browsers(ctx context.Context, query RadarHTTPBrowsersParams, opts ...option.RequestOption) (res *RadarHTTPBrowsersResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHTTPBrowsersResponseEnvelope - path := "radar/http/timeseries_groups/browser" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic per device type. -func (r *RadarHTTPService) DeviceTypes(ctx context.Context, query RadarHTTPDeviceTypesParams, opts ...option.RequestOption) (res *RadarHTTPDeviceTypesResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHTTPDeviceTypesResponseEnvelope - path := "radar/http/timeseries_groups/device_type" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic per HTTP protocol. -func (r *RadarHTTPService) HTTPProtocols(ctx context.Context, query RadarHTTPHTTPProtocolsParams, opts ...option.RequestOption) (res *RadarHttphttpProtocolsResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHttphttpProtocolsResponseEnvelope - path := "radar/http/timeseries_groups/http_protocol" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic per HTTP protocol -// version. -func (r *RadarHTTPService) HTTPVersions(ctx context.Context, query RadarHTTPHTTPVersionsParams, opts ...option.RequestOption) (res *RadarHttphttpVersionsResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHttphttpVersionsResponseEnvelope - path := "radar/http/timeseries_groups/http_version" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic per IP protocol -// version. -func (r *RadarHTTPService) IPVersions(ctx context.Context, query RadarHTTPIPVersionsParams, opts ...option.RequestOption) (res *RadarHttpipVersionsResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHttpipVersionsResponseEnvelope - path := "radar/http/timeseries_groups/ip_version" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Get a time series of the percentage distribution of traffic of the top operating -// systems. -func (r *RadarHTTPService) Oss(ctx context.Context, query RadarHTTPOssParams, opts ...option.RequestOption) (res *RadarHTTPOssResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarHTTPOssResponseEnvelope - path := "radar/http/timeseries_groups/os" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarHTTPBotClassesResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHTTPBotClassesResponseSerie0 `json:"serie_0,required"` - JSON radarHTTPBotClassesResponseJSON `json:"-"` -} - -// radarHTTPBotClassesResponseJSON contains the JSON metadata for the struct -// [RadarHTTPBotClassesResponse] -type radarHTTPBotClassesResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBotClassesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBotClassesResponseSerie0 struct { - Bot []string `json:"bot,required"` - Human []string `json:"human,required"` - Timestamps []string `json:"timestamps,required"` - JSON radarHTTPBotClassesResponseSerie0JSON `json:"-"` -} - -// radarHTTPBotClassesResponseSerie0JSON contains the JSON metadata for the struct -// [RadarHTTPBotClassesResponseSerie0] -type radarHTTPBotClassesResponseSerie0JSON struct { - Bot apijson.Field - Human apijson.Field - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBotClassesResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowserFamiliesResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHTTPBrowserFamiliesResponseSerie0 `json:"serie_0,required"` - JSON radarHTTPBrowserFamiliesResponseJSON `json:"-"` -} - -// radarHTTPBrowserFamiliesResponseJSON contains the JSON metadata for the struct -// [RadarHTTPBrowserFamiliesResponse] -type radarHTTPBrowserFamiliesResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowserFamiliesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowserFamiliesResponseSerie0 struct { - Timestamps []string `json:"timestamps,required"` - ExtraFields map[string][]string `json:"-,extras"` - JSON radarHTTPBrowserFamiliesResponseSerie0JSON `json:"-"` -} - -// radarHTTPBrowserFamiliesResponseSerie0JSON contains the JSON metadata for the -// struct [RadarHTTPBrowserFamiliesResponseSerie0] -type radarHTTPBrowserFamiliesResponseSerie0JSON struct { - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowserFamiliesResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowsersResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHTTPBrowsersResponseSerie0 `json:"serie_0,required"` - JSON radarHTTPBrowsersResponseJSON `json:"-"` -} - -// radarHTTPBrowsersResponseJSON contains the JSON metadata for the struct -// [RadarHTTPBrowsersResponse] -type radarHTTPBrowsersResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowsersResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowsersResponseSerie0 struct { - Timestamps []string `json:"timestamps,required"` - ExtraFields map[string][]string `json:"-,extras"` - JSON radarHTTPBrowsersResponseSerie0JSON `json:"-"` -} - -// radarHTTPBrowsersResponseSerie0JSON contains the JSON metadata for the struct -// [RadarHTTPBrowsersResponseSerie0] -type radarHTTPBrowsersResponseSerie0JSON struct { - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowsersResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPDeviceTypesResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHTTPDeviceTypesResponseSerie0 `json:"serie_0,required"` - JSON radarHTTPDeviceTypesResponseJSON `json:"-"` -} - -// radarHTTPDeviceTypesResponseJSON contains the JSON metadata for the struct -// [RadarHTTPDeviceTypesResponse] -type radarHTTPDeviceTypesResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPDeviceTypesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPDeviceTypesResponseSerie0 struct { - Desktop []string `json:"desktop,required"` - Mobile []string `json:"mobile,required"` - Other []string `json:"other,required"` - Timestamps []string `json:"timestamps,required"` - JSON radarHTTPDeviceTypesResponseSerie0JSON `json:"-"` -} - -// radarHTTPDeviceTypesResponseSerie0JSON contains the JSON metadata for the struct -// [RadarHTTPDeviceTypesResponseSerie0] -type radarHTTPDeviceTypesResponseSerie0JSON struct { - Desktop apijson.Field - Mobile apijson.Field - Other apijson.Field - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPDeviceTypesResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttphttpProtocolsResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHttphttpProtocolsResponseSerie0 `json:"serie_0,required"` - JSON radarHttphttpProtocolsResponseJSON `json:"-"` -} - -// radarHttphttpProtocolsResponseJSON contains the JSON metadata for the struct -// [RadarHttphttpProtocolsResponse] -type radarHttphttpProtocolsResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpProtocolsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttphttpProtocolsResponseSerie0 struct { - HTTP []string `json:"http,required"` - HTTPS []string `json:"https,required"` - Timestamps []string `json:"timestamps,required"` - JSON radarHttphttpProtocolsResponseSerie0JSON `json:"-"` -} - -// radarHttphttpProtocolsResponseSerie0JSON contains the JSON metadata for the -// struct [RadarHttphttpProtocolsResponseSerie0] -type radarHttphttpProtocolsResponseSerie0JSON struct { - HTTP apijson.Field - HTTPS apijson.Field - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpProtocolsResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttphttpVersionsResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHttphttpVersionsResponseSerie0 `json:"serie_0,required"` - JSON radarHttphttpVersionsResponseJSON `json:"-"` -} - -// radarHttphttpVersionsResponseJSON contains the JSON metadata for the struct -// [RadarHttphttpVersionsResponse] -type radarHttphttpVersionsResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpVersionsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttphttpVersionsResponseSerie0 struct { - HTTP1X []string `json:"HTTP/1.x,required"` - HTTP2 []string `json:"HTTP/2,required"` - HTTP3 []string `json:"HTTP/3,required"` - Timestamps []string `json:"timestamps,required"` - JSON radarHttphttpVersionsResponseSerie0JSON `json:"-"` -} - -// radarHttphttpVersionsResponseSerie0JSON contains the JSON metadata for the -// struct [RadarHttphttpVersionsResponseSerie0] -type radarHttphttpVersionsResponseSerie0JSON struct { - HTTP1X apijson.Field - HTTP2 apijson.Field - HTTP3 apijson.Field - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpVersionsResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttpipVersionsResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHttpipVersionsResponseSerie0 `json:"serie_0,required"` - JSON radarHttpipVersionsResponseJSON `json:"-"` -} - -// radarHttpipVersionsResponseJSON contains the JSON metadata for the struct -// [RadarHttpipVersionsResponse] -type radarHttpipVersionsResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttpipVersionsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHttpipVersionsResponseSerie0 struct { - IPv4 []string `json:"IPv4,required"` - IPv6 []string `json:"IPv6,required"` - Timestamps []string `json:"timestamps,required"` - JSON radarHttpipVersionsResponseSerie0JSON `json:"-"` -} - -// radarHttpipVersionsResponseSerie0JSON contains the JSON metadata for the struct -// [RadarHttpipVersionsResponseSerie0] -type radarHttpipVersionsResponseSerie0JSON struct { - IPv4 apijson.Field - IPv6 apijson.Field - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttpipVersionsResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPOssResponse struct { - Meta interface{} `json:"meta,required"` - Serie0 RadarHTTPOssResponseSerie0 `json:"serie_0,required"` - JSON radarHTTPOssResponseJSON `json:"-"` -} - -// radarHTTPOssResponseJSON contains the JSON metadata for the struct -// [RadarHTTPOssResponse] -type radarHTTPOssResponseJSON struct { - Meta apijson.Field - Serie0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPOssResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPOssResponseSerie0 struct { - Timestamps []string `json:"timestamps,required"` - ExtraFields map[string][]string `json:"-,extras"` - JSON radarHTTPOssResponseSerie0JSON `json:"-"` -} - -// radarHTTPOssResponseSerie0JSON contains the JSON metadata for the struct -// [RadarHTTPOssResponseSerie0] -type radarHTTPOssResponseSerie0JSON struct { - Timestamps apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPOssResponseSerie0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBotClassesParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHTTPBotClassesParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHTTPBotClassesParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHTTPBotClassesParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHTTPBotClassesParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHTTPBotClassesParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHTTPBotClassesParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHTTPBotClassesParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHTTPBotClassesParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHTTPBotClassesParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPBotClassesParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPBotClassesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHTTPBotClassesParamsAggInterval string - -const ( - RadarHTTPBotClassesParamsAggInterval15m RadarHTTPBotClassesParamsAggInterval = "15m" - RadarHTTPBotClassesParamsAggInterval1h RadarHTTPBotClassesParamsAggInterval = "1h" - RadarHTTPBotClassesParamsAggInterval1d RadarHTTPBotClassesParamsAggInterval = "1d" - RadarHTTPBotClassesParamsAggInterval1w RadarHTTPBotClassesParamsAggInterval = "1w" -) - -type RadarHTTPBotClassesParamsDateRange string - -const ( - RadarHTTPBotClassesParamsDateRange1d RadarHTTPBotClassesParamsDateRange = "1d" - RadarHTTPBotClassesParamsDateRange2d RadarHTTPBotClassesParamsDateRange = "2d" - RadarHTTPBotClassesParamsDateRange7d RadarHTTPBotClassesParamsDateRange = "7d" - RadarHTTPBotClassesParamsDateRange14d RadarHTTPBotClassesParamsDateRange = "14d" - RadarHTTPBotClassesParamsDateRange28d RadarHTTPBotClassesParamsDateRange = "28d" - RadarHTTPBotClassesParamsDateRange12w RadarHTTPBotClassesParamsDateRange = "12w" - RadarHTTPBotClassesParamsDateRange24w RadarHTTPBotClassesParamsDateRange = "24w" - RadarHTTPBotClassesParamsDateRange52w RadarHTTPBotClassesParamsDateRange = "52w" - RadarHTTPBotClassesParamsDateRange1dControl RadarHTTPBotClassesParamsDateRange = "1dControl" - RadarHTTPBotClassesParamsDateRange2dControl RadarHTTPBotClassesParamsDateRange = "2dControl" - RadarHTTPBotClassesParamsDateRange7dControl RadarHTTPBotClassesParamsDateRange = "7dControl" - RadarHTTPBotClassesParamsDateRange14dControl RadarHTTPBotClassesParamsDateRange = "14dControl" - RadarHTTPBotClassesParamsDateRange28dControl RadarHTTPBotClassesParamsDateRange = "28dControl" - RadarHTTPBotClassesParamsDateRange12wControl RadarHTTPBotClassesParamsDateRange = "12wControl" - RadarHTTPBotClassesParamsDateRange24wControl RadarHTTPBotClassesParamsDateRange = "24wControl" -) - -type RadarHTTPBotClassesParamsDeviceType string - -const ( - RadarHTTPBotClassesParamsDeviceTypeDesktop RadarHTTPBotClassesParamsDeviceType = "DESKTOP" - RadarHTTPBotClassesParamsDeviceTypeMobile RadarHTTPBotClassesParamsDeviceType = "MOBILE" - RadarHTTPBotClassesParamsDeviceTypeOther RadarHTTPBotClassesParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHTTPBotClassesParamsFormat string - -const ( - RadarHTTPBotClassesParamsFormatJson RadarHTTPBotClassesParamsFormat = "JSON" - RadarHTTPBotClassesParamsFormatCsv RadarHTTPBotClassesParamsFormat = "CSV" -) - -type RadarHTTPBotClassesParamsHTTPProtocol string - -const ( - RadarHTTPBotClassesParamsHTTPProtocolHTTP RadarHTTPBotClassesParamsHTTPProtocol = "HTTP" - RadarHTTPBotClassesParamsHTTPProtocolHTTPS RadarHTTPBotClassesParamsHTTPProtocol = "HTTPS" -) - -type RadarHTTPBotClassesParamsHTTPVersion string - -const ( - RadarHTTPBotClassesParamsHTTPVersionHttPv1 RadarHTTPBotClassesParamsHTTPVersion = "HTTPv1" - RadarHTTPBotClassesParamsHTTPVersionHttPv2 RadarHTTPBotClassesParamsHTTPVersion = "HTTPv2" - RadarHTTPBotClassesParamsHTTPVersionHttPv3 RadarHTTPBotClassesParamsHTTPVersion = "HTTPv3" -) - -type RadarHTTPBotClassesParamsIPVersion string - -const ( - RadarHTTPBotClassesParamsIPVersionIPv4 RadarHTTPBotClassesParamsIPVersion = "IPv4" - RadarHTTPBotClassesParamsIPVersionIPv6 RadarHTTPBotClassesParamsIPVersion = "IPv6" -) - -type RadarHTTPBotClassesParamsO string - -const ( - RadarHTTPBotClassesParamsOWindows RadarHTTPBotClassesParamsO = "WINDOWS" - RadarHTTPBotClassesParamsOMacosx RadarHTTPBotClassesParamsO = "MACOSX" - RadarHTTPBotClassesParamsOIos RadarHTTPBotClassesParamsO = "IOS" - RadarHTTPBotClassesParamsOAndroid RadarHTTPBotClassesParamsO = "ANDROID" - RadarHTTPBotClassesParamsOChromeos RadarHTTPBotClassesParamsO = "CHROMEOS" - RadarHTTPBotClassesParamsOLinux RadarHTTPBotClassesParamsO = "LINUX" - RadarHTTPBotClassesParamsOSmartTv RadarHTTPBotClassesParamsO = "SMART_TV" -) - -type RadarHTTPBotClassesParamsTLSVersion string - -const ( - RadarHTTPBotClassesParamsTLSVersionTlSv1_0 RadarHTTPBotClassesParamsTLSVersion = "TLSv1_0" - RadarHTTPBotClassesParamsTLSVersionTlSv1_1 RadarHTTPBotClassesParamsTLSVersion = "TLSv1_1" - RadarHTTPBotClassesParamsTLSVersionTlSv1_2 RadarHTTPBotClassesParamsTLSVersion = "TLSv1_2" - RadarHTTPBotClassesParamsTLSVersionTlSv1_3 RadarHTTPBotClassesParamsTLSVersion = "TLSv1_3" - RadarHTTPBotClassesParamsTLSVersionTlSvQuic RadarHTTPBotClassesParamsTLSVersion = "TLSvQUIC" -) - -type RadarHTTPBotClassesResponseEnvelope struct { - Result RadarHTTPBotClassesResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHTTPBotClassesResponseEnvelopeJSON `json:"-"` -} - -// radarHTTPBotClassesResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHTTPBotClassesResponseEnvelope] -type radarHTTPBotClassesResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBotClassesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowserFamiliesParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHTTPBrowserFamiliesParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHTTPBrowserFamiliesParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHTTPBrowserFamiliesParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHTTPBrowserFamiliesParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHTTPBrowserFamiliesParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHTTPBrowserFamiliesParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHTTPBrowserFamiliesParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHTTPBrowserFamiliesParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHTTPBrowserFamiliesParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHTTPBrowserFamiliesParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPBrowserFamiliesParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPBrowserFamiliesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHTTPBrowserFamiliesParamsAggInterval string - -const ( - RadarHTTPBrowserFamiliesParamsAggInterval15m RadarHTTPBrowserFamiliesParamsAggInterval = "15m" - RadarHTTPBrowserFamiliesParamsAggInterval1h RadarHTTPBrowserFamiliesParamsAggInterval = "1h" - RadarHTTPBrowserFamiliesParamsAggInterval1d RadarHTTPBrowserFamiliesParamsAggInterval = "1d" - RadarHTTPBrowserFamiliesParamsAggInterval1w RadarHTTPBrowserFamiliesParamsAggInterval = "1w" -) - -type RadarHTTPBrowserFamiliesParamsBotClass string - -const ( - RadarHTTPBrowserFamiliesParamsBotClassLikelyAutomated RadarHTTPBrowserFamiliesParamsBotClass = "LIKELY_AUTOMATED" - RadarHTTPBrowserFamiliesParamsBotClassLikelyHuman RadarHTTPBrowserFamiliesParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHTTPBrowserFamiliesParamsDateRange string - -const ( - RadarHTTPBrowserFamiliesParamsDateRange1d RadarHTTPBrowserFamiliesParamsDateRange = "1d" - RadarHTTPBrowserFamiliesParamsDateRange2d RadarHTTPBrowserFamiliesParamsDateRange = "2d" - RadarHTTPBrowserFamiliesParamsDateRange7d RadarHTTPBrowserFamiliesParamsDateRange = "7d" - RadarHTTPBrowserFamiliesParamsDateRange14d RadarHTTPBrowserFamiliesParamsDateRange = "14d" - RadarHTTPBrowserFamiliesParamsDateRange28d RadarHTTPBrowserFamiliesParamsDateRange = "28d" - RadarHTTPBrowserFamiliesParamsDateRange12w RadarHTTPBrowserFamiliesParamsDateRange = "12w" - RadarHTTPBrowserFamiliesParamsDateRange24w RadarHTTPBrowserFamiliesParamsDateRange = "24w" - RadarHTTPBrowserFamiliesParamsDateRange52w RadarHTTPBrowserFamiliesParamsDateRange = "52w" - RadarHTTPBrowserFamiliesParamsDateRange1dControl RadarHTTPBrowserFamiliesParamsDateRange = "1dControl" - RadarHTTPBrowserFamiliesParamsDateRange2dControl RadarHTTPBrowserFamiliesParamsDateRange = "2dControl" - RadarHTTPBrowserFamiliesParamsDateRange7dControl RadarHTTPBrowserFamiliesParamsDateRange = "7dControl" - RadarHTTPBrowserFamiliesParamsDateRange14dControl RadarHTTPBrowserFamiliesParamsDateRange = "14dControl" - RadarHTTPBrowserFamiliesParamsDateRange28dControl RadarHTTPBrowserFamiliesParamsDateRange = "28dControl" - RadarHTTPBrowserFamiliesParamsDateRange12wControl RadarHTTPBrowserFamiliesParamsDateRange = "12wControl" - RadarHTTPBrowserFamiliesParamsDateRange24wControl RadarHTTPBrowserFamiliesParamsDateRange = "24wControl" -) - -type RadarHTTPBrowserFamiliesParamsDeviceType string - -const ( - RadarHTTPBrowserFamiliesParamsDeviceTypeDesktop RadarHTTPBrowserFamiliesParamsDeviceType = "DESKTOP" - RadarHTTPBrowserFamiliesParamsDeviceTypeMobile RadarHTTPBrowserFamiliesParamsDeviceType = "MOBILE" - RadarHTTPBrowserFamiliesParamsDeviceTypeOther RadarHTTPBrowserFamiliesParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHTTPBrowserFamiliesParamsFormat string - -const ( - RadarHTTPBrowserFamiliesParamsFormatJson RadarHTTPBrowserFamiliesParamsFormat = "JSON" - RadarHTTPBrowserFamiliesParamsFormatCsv RadarHTTPBrowserFamiliesParamsFormat = "CSV" -) - -type RadarHTTPBrowserFamiliesParamsHTTPProtocol string - -const ( - RadarHTTPBrowserFamiliesParamsHTTPProtocolHTTP RadarHTTPBrowserFamiliesParamsHTTPProtocol = "HTTP" - RadarHTTPBrowserFamiliesParamsHTTPProtocolHTTPS RadarHTTPBrowserFamiliesParamsHTTPProtocol = "HTTPS" -) - -type RadarHTTPBrowserFamiliesParamsHTTPVersion string - -const ( - RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv1 RadarHTTPBrowserFamiliesParamsHTTPVersion = "HTTPv1" - RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv2 RadarHTTPBrowserFamiliesParamsHTTPVersion = "HTTPv2" - RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv3 RadarHTTPBrowserFamiliesParamsHTTPVersion = "HTTPv3" -) - -type RadarHTTPBrowserFamiliesParamsIPVersion string - -const ( - RadarHTTPBrowserFamiliesParamsIPVersionIPv4 RadarHTTPBrowserFamiliesParamsIPVersion = "IPv4" - RadarHTTPBrowserFamiliesParamsIPVersionIPv6 RadarHTTPBrowserFamiliesParamsIPVersion = "IPv6" -) - -type RadarHTTPBrowserFamiliesParamsO string - -const ( - RadarHTTPBrowserFamiliesParamsOWindows RadarHTTPBrowserFamiliesParamsO = "WINDOWS" - RadarHTTPBrowserFamiliesParamsOMacosx RadarHTTPBrowserFamiliesParamsO = "MACOSX" - RadarHTTPBrowserFamiliesParamsOIos RadarHTTPBrowserFamiliesParamsO = "IOS" - RadarHTTPBrowserFamiliesParamsOAndroid RadarHTTPBrowserFamiliesParamsO = "ANDROID" - RadarHTTPBrowserFamiliesParamsOChromeos RadarHTTPBrowserFamiliesParamsO = "CHROMEOS" - RadarHTTPBrowserFamiliesParamsOLinux RadarHTTPBrowserFamiliesParamsO = "LINUX" - RadarHTTPBrowserFamiliesParamsOSmartTv RadarHTTPBrowserFamiliesParamsO = "SMART_TV" -) - -type RadarHTTPBrowserFamiliesParamsTLSVersion string - -const ( - RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_0 RadarHTTPBrowserFamiliesParamsTLSVersion = "TLSv1_0" - RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_1 RadarHTTPBrowserFamiliesParamsTLSVersion = "TLSv1_1" - RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_2 RadarHTTPBrowserFamiliesParamsTLSVersion = "TLSv1_2" - RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_3 RadarHTTPBrowserFamiliesParamsTLSVersion = "TLSv1_3" - RadarHTTPBrowserFamiliesParamsTLSVersionTlSvQuic RadarHTTPBrowserFamiliesParamsTLSVersion = "TLSvQUIC" -) - -type RadarHTTPBrowserFamiliesResponseEnvelope struct { - Result RadarHTTPBrowserFamiliesResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHTTPBrowserFamiliesResponseEnvelopeJSON `json:"-"` -} - -// radarHTTPBrowserFamiliesResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHTTPBrowserFamiliesResponseEnvelope] -type radarHTTPBrowserFamiliesResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowserFamiliesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPBrowsersParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHTTPBrowsersParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHTTPBrowsersParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHTTPBrowsersParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHTTPBrowsersParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHTTPBrowsersParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHTTPBrowsersParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHTTPBrowsersParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHTTPBrowsersParamsIPVersion] `query:"ipVersion"` - // Limit the number of objects (eg browsers, verticals, etc) to the top items over - // the time range. - LimitPerGroup param.Field[int64] `query:"limitPerGroup"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHTTPBrowsersParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHTTPBrowsersParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPBrowsersParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPBrowsersParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHTTPBrowsersParamsAggInterval string - -const ( - RadarHTTPBrowsersParamsAggInterval15m RadarHTTPBrowsersParamsAggInterval = "15m" - RadarHTTPBrowsersParamsAggInterval1h RadarHTTPBrowsersParamsAggInterval = "1h" - RadarHTTPBrowsersParamsAggInterval1d RadarHTTPBrowsersParamsAggInterval = "1d" - RadarHTTPBrowsersParamsAggInterval1w RadarHTTPBrowsersParamsAggInterval = "1w" -) - -type RadarHTTPBrowsersParamsBotClass string - -const ( - RadarHTTPBrowsersParamsBotClassLikelyAutomated RadarHTTPBrowsersParamsBotClass = "LIKELY_AUTOMATED" - RadarHTTPBrowsersParamsBotClassLikelyHuman RadarHTTPBrowsersParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHTTPBrowsersParamsDateRange string - -const ( - RadarHTTPBrowsersParamsDateRange1d RadarHTTPBrowsersParamsDateRange = "1d" - RadarHTTPBrowsersParamsDateRange2d RadarHTTPBrowsersParamsDateRange = "2d" - RadarHTTPBrowsersParamsDateRange7d RadarHTTPBrowsersParamsDateRange = "7d" - RadarHTTPBrowsersParamsDateRange14d RadarHTTPBrowsersParamsDateRange = "14d" - RadarHTTPBrowsersParamsDateRange28d RadarHTTPBrowsersParamsDateRange = "28d" - RadarHTTPBrowsersParamsDateRange12w RadarHTTPBrowsersParamsDateRange = "12w" - RadarHTTPBrowsersParamsDateRange24w RadarHTTPBrowsersParamsDateRange = "24w" - RadarHTTPBrowsersParamsDateRange52w RadarHTTPBrowsersParamsDateRange = "52w" - RadarHTTPBrowsersParamsDateRange1dControl RadarHTTPBrowsersParamsDateRange = "1dControl" - RadarHTTPBrowsersParamsDateRange2dControl RadarHTTPBrowsersParamsDateRange = "2dControl" - RadarHTTPBrowsersParamsDateRange7dControl RadarHTTPBrowsersParamsDateRange = "7dControl" - RadarHTTPBrowsersParamsDateRange14dControl RadarHTTPBrowsersParamsDateRange = "14dControl" - RadarHTTPBrowsersParamsDateRange28dControl RadarHTTPBrowsersParamsDateRange = "28dControl" - RadarHTTPBrowsersParamsDateRange12wControl RadarHTTPBrowsersParamsDateRange = "12wControl" - RadarHTTPBrowsersParamsDateRange24wControl RadarHTTPBrowsersParamsDateRange = "24wControl" -) - -type RadarHTTPBrowsersParamsDeviceType string - -const ( - RadarHTTPBrowsersParamsDeviceTypeDesktop RadarHTTPBrowsersParamsDeviceType = "DESKTOP" - RadarHTTPBrowsersParamsDeviceTypeMobile RadarHTTPBrowsersParamsDeviceType = "MOBILE" - RadarHTTPBrowsersParamsDeviceTypeOther RadarHTTPBrowsersParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHTTPBrowsersParamsFormat string - -const ( - RadarHTTPBrowsersParamsFormatJson RadarHTTPBrowsersParamsFormat = "JSON" - RadarHTTPBrowsersParamsFormatCsv RadarHTTPBrowsersParamsFormat = "CSV" -) - -type RadarHTTPBrowsersParamsHTTPProtocol string - -const ( - RadarHTTPBrowsersParamsHTTPProtocolHTTP RadarHTTPBrowsersParamsHTTPProtocol = "HTTP" - RadarHTTPBrowsersParamsHTTPProtocolHTTPS RadarHTTPBrowsersParamsHTTPProtocol = "HTTPS" -) - -type RadarHTTPBrowsersParamsHTTPVersion string - -const ( - RadarHTTPBrowsersParamsHTTPVersionHttPv1 RadarHTTPBrowsersParamsHTTPVersion = "HTTPv1" - RadarHTTPBrowsersParamsHTTPVersionHttPv2 RadarHTTPBrowsersParamsHTTPVersion = "HTTPv2" - RadarHTTPBrowsersParamsHTTPVersionHttPv3 RadarHTTPBrowsersParamsHTTPVersion = "HTTPv3" -) - -type RadarHTTPBrowsersParamsIPVersion string - -const ( - RadarHTTPBrowsersParamsIPVersionIPv4 RadarHTTPBrowsersParamsIPVersion = "IPv4" - RadarHTTPBrowsersParamsIPVersionIPv6 RadarHTTPBrowsersParamsIPVersion = "IPv6" -) - -type RadarHTTPBrowsersParamsO string - -const ( - RadarHTTPBrowsersParamsOWindows RadarHTTPBrowsersParamsO = "WINDOWS" - RadarHTTPBrowsersParamsOMacosx RadarHTTPBrowsersParamsO = "MACOSX" - RadarHTTPBrowsersParamsOIos RadarHTTPBrowsersParamsO = "IOS" - RadarHTTPBrowsersParamsOAndroid RadarHTTPBrowsersParamsO = "ANDROID" - RadarHTTPBrowsersParamsOChromeos RadarHTTPBrowsersParamsO = "CHROMEOS" - RadarHTTPBrowsersParamsOLinux RadarHTTPBrowsersParamsO = "LINUX" - RadarHTTPBrowsersParamsOSmartTv RadarHTTPBrowsersParamsO = "SMART_TV" -) - -type RadarHTTPBrowsersParamsTLSVersion string - -const ( - RadarHTTPBrowsersParamsTLSVersionTlSv1_0 RadarHTTPBrowsersParamsTLSVersion = "TLSv1_0" - RadarHTTPBrowsersParamsTLSVersionTlSv1_1 RadarHTTPBrowsersParamsTLSVersion = "TLSv1_1" - RadarHTTPBrowsersParamsTLSVersionTlSv1_2 RadarHTTPBrowsersParamsTLSVersion = "TLSv1_2" - RadarHTTPBrowsersParamsTLSVersionTlSv1_3 RadarHTTPBrowsersParamsTLSVersion = "TLSv1_3" - RadarHTTPBrowsersParamsTLSVersionTlSvQuic RadarHTTPBrowsersParamsTLSVersion = "TLSvQUIC" -) - -type RadarHTTPBrowsersResponseEnvelope struct { - Result RadarHTTPBrowsersResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHTTPBrowsersResponseEnvelopeJSON `json:"-"` -} - -// radarHTTPBrowsersResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarHTTPBrowsersResponseEnvelope] -type radarHTTPBrowsersResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPBrowsersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPDeviceTypesParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHTTPDeviceTypesParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHTTPDeviceTypesParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHTTPDeviceTypesParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Format results are returned in. - Format param.Field[RadarHTTPDeviceTypesParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHTTPDeviceTypesParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHTTPDeviceTypesParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHTTPDeviceTypesParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHTTPDeviceTypesParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHTTPDeviceTypesParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPDeviceTypesParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPDeviceTypesParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHTTPDeviceTypesParamsAggInterval string - -const ( - RadarHTTPDeviceTypesParamsAggInterval15m RadarHTTPDeviceTypesParamsAggInterval = "15m" - RadarHTTPDeviceTypesParamsAggInterval1h RadarHTTPDeviceTypesParamsAggInterval = "1h" - RadarHTTPDeviceTypesParamsAggInterval1d RadarHTTPDeviceTypesParamsAggInterval = "1d" - RadarHTTPDeviceTypesParamsAggInterval1w RadarHTTPDeviceTypesParamsAggInterval = "1w" -) - -type RadarHTTPDeviceTypesParamsBotClass string - -const ( - RadarHTTPDeviceTypesParamsBotClassLikelyAutomated RadarHTTPDeviceTypesParamsBotClass = "LIKELY_AUTOMATED" - RadarHTTPDeviceTypesParamsBotClassLikelyHuman RadarHTTPDeviceTypesParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHTTPDeviceTypesParamsDateRange string - -const ( - RadarHTTPDeviceTypesParamsDateRange1d RadarHTTPDeviceTypesParamsDateRange = "1d" - RadarHTTPDeviceTypesParamsDateRange2d RadarHTTPDeviceTypesParamsDateRange = "2d" - RadarHTTPDeviceTypesParamsDateRange7d RadarHTTPDeviceTypesParamsDateRange = "7d" - RadarHTTPDeviceTypesParamsDateRange14d RadarHTTPDeviceTypesParamsDateRange = "14d" - RadarHTTPDeviceTypesParamsDateRange28d RadarHTTPDeviceTypesParamsDateRange = "28d" - RadarHTTPDeviceTypesParamsDateRange12w RadarHTTPDeviceTypesParamsDateRange = "12w" - RadarHTTPDeviceTypesParamsDateRange24w RadarHTTPDeviceTypesParamsDateRange = "24w" - RadarHTTPDeviceTypesParamsDateRange52w RadarHTTPDeviceTypesParamsDateRange = "52w" - RadarHTTPDeviceTypesParamsDateRange1dControl RadarHTTPDeviceTypesParamsDateRange = "1dControl" - RadarHTTPDeviceTypesParamsDateRange2dControl RadarHTTPDeviceTypesParamsDateRange = "2dControl" - RadarHTTPDeviceTypesParamsDateRange7dControl RadarHTTPDeviceTypesParamsDateRange = "7dControl" - RadarHTTPDeviceTypesParamsDateRange14dControl RadarHTTPDeviceTypesParamsDateRange = "14dControl" - RadarHTTPDeviceTypesParamsDateRange28dControl RadarHTTPDeviceTypesParamsDateRange = "28dControl" - RadarHTTPDeviceTypesParamsDateRange12wControl RadarHTTPDeviceTypesParamsDateRange = "12wControl" - RadarHTTPDeviceTypesParamsDateRange24wControl RadarHTTPDeviceTypesParamsDateRange = "24wControl" -) - -// Format results are returned in. -type RadarHTTPDeviceTypesParamsFormat string - -const ( - RadarHTTPDeviceTypesParamsFormatJson RadarHTTPDeviceTypesParamsFormat = "JSON" - RadarHTTPDeviceTypesParamsFormatCsv RadarHTTPDeviceTypesParamsFormat = "CSV" -) - -type RadarHTTPDeviceTypesParamsHTTPProtocol string - -const ( - RadarHTTPDeviceTypesParamsHTTPProtocolHTTP RadarHTTPDeviceTypesParamsHTTPProtocol = "HTTP" - RadarHTTPDeviceTypesParamsHTTPProtocolHTTPS RadarHTTPDeviceTypesParamsHTTPProtocol = "HTTPS" -) - -type RadarHTTPDeviceTypesParamsHTTPVersion string - -const ( - RadarHTTPDeviceTypesParamsHTTPVersionHttPv1 RadarHTTPDeviceTypesParamsHTTPVersion = "HTTPv1" - RadarHTTPDeviceTypesParamsHTTPVersionHttPv2 RadarHTTPDeviceTypesParamsHTTPVersion = "HTTPv2" - RadarHTTPDeviceTypesParamsHTTPVersionHttPv3 RadarHTTPDeviceTypesParamsHTTPVersion = "HTTPv3" -) - -type RadarHTTPDeviceTypesParamsIPVersion string - -const ( - RadarHTTPDeviceTypesParamsIPVersionIPv4 RadarHTTPDeviceTypesParamsIPVersion = "IPv4" - RadarHTTPDeviceTypesParamsIPVersionIPv6 RadarHTTPDeviceTypesParamsIPVersion = "IPv6" -) - -type RadarHTTPDeviceTypesParamsO string - -const ( - RadarHTTPDeviceTypesParamsOWindows RadarHTTPDeviceTypesParamsO = "WINDOWS" - RadarHTTPDeviceTypesParamsOMacosx RadarHTTPDeviceTypesParamsO = "MACOSX" - RadarHTTPDeviceTypesParamsOIos RadarHTTPDeviceTypesParamsO = "IOS" - RadarHTTPDeviceTypesParamsOAndroid RadarHTTPDeviceTypesParamsO = "ANDROID" - RadarHTTPDeviceTypesParamsOChromeos RadarHTTPDeviceTypesParamsO = "CHROMEOS" - RadarHTTPDeviceTypesParamsOLinux RadarHTTPDeviceTypesParamsO = "LINUX" - RadarHTTPDeviceTypesParamsOSmartTv RadarHTTPDeviceTypesParamsO = "SMART_TV" -) - -type RadarHTTPDeviceTypesParamsTLSVersion string - -const ( - RadarHTTPDeviceTypesParamsTLSVersionTlSv1_0 RadarHTTPDeviceTypesParamsTLSVersion = "TLSv1_0" - RadarHTTPDeviceTypesParamsTLSVersionTlSv1_1 RadarHTTPDeviceTypesParamsTLSVersion = "TLSv1_1" - RadarHTTPDeviceTypesParamsTLSVersionTlSv1_2 RadarHTTPDeviceTypesParamsTLSVersion = "TLSv1_2" - RadarHTTPDeviceTypesParamsTLSVersionTlSv1_3 RadarHTTPDeviceTypesParamsTLSVersion = "TLSv1_3" - RadarHTTPDeviceTypesParamsTLSVersionTlSvQuic RadarHTTPDeviceTypesParamsTLSVersion = "TLSvQUIC" -) - -type RadarHTTPDeviceTypesResponseEnvelope struct { - Result RadarHTTPDeviceTypesResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHTTPDeviceTypesResponseEnvelopeJSON `json:"-"` -} - -// radarHTTPDeviceTypesResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHTTPDeviceTypesResponseEnvelope] -type radarHTTPDeviceTypesResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPDeviceTypesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPHTTPProtocolsParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHttphttpProtocolsParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHttphttpProtocolsParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHttphttpProtocolsParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHttphttpProtocolsParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHttphttpProtocolsParamsFormat] `query:"format"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHttphttpProtocolsParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHttphttpProtocolsParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHttphttpProtocolsParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHttphttpProtocolsParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPHTTPProtocolsParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPHTTPProtocolsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHttphttpProtocolsParamsAggInterval string - -const ( - RadarHttphttpProtocolsParamsAggInterval15m RadarHttphttpProtocolsParamsAggInterval = "15m" - RadarHttphttpProtocolsParamsAggInterval1h RadarHttphttpProtocolsParamsAggInterval = "1h" - RadarHttphttpProtocolsParamsAggInterval1d RadarHttphttpProtocolsParamsAggInterval = "1d" - RadarHttphttpProtocolsParamsAggInterval1w RadarHttphttpProtocolsParamsAggInterval = "1w" -) - -type RadarHttphttpProtocolsParamsBotClass string - -const ( - RadarHttphttpProtocolsParamsBotClassLikelyAutomated RadarHttphttpProtocolsParamsBotClass = "LIKELY_AUTOMATED" - RadarHttphttpProtocolsParamsBotClassLikelyHuman RadarHttphttpProtocolsParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHttphttpProtocolsParamsDateRange string - -const ( - RadarHttphttpProtocolsParamsDateRange1d RadarHttphttpProtocolsParamsDateRange = "1d" - RadarHttphttpProtocolsParamsDateRange2d RadarHttphttpProtocolsParamsDateRange = "2d" - RadarHttphttpProtocolsParamsDateRange7d RadarHttphttpProtocolsParamsDateRange = "7d" - RadarHttphttpProtocolsParamsDateRange14d RadarHttphttpProtocolsParamsDateRange = "14d" - RadarHttphttpProtocolsParamsDateRange28d RadarHttphttpProtocolsParamsDateRange = "28d" - RadarHttphttpProtocolsParamsDateRange12w RadarHttphttpProtocolsParamsDateRange = "12w" - RadarHttphttpProtocolsParamsDateRange24w RadarHttphttpProtocolsParamsDateRange = "24w" - RadarHttphttpProtocolsParamsDateRange52w RadarHttphttpProtocolsParamsDateRange = "52w" - RadarHttphttpProtocolsParamsDateRange1dControl RadarHttphttpProtocolsParamsDateRange = "1dControl" - RadarHttphttpProtocolsParamsDateRange2dControl RadarHttphttpProtocolsParamsDateRange = "2dControl" - RadarHttphttpProtocolsParamsDateRange7dControl RadarHttphttpProtocolsParamsDateRange = "7dControl" - RadarHttphttpProtocolsParamsDateRange14dControl RadarHttphttpProtocolsParamsDateRange = "14dControl" - RadarHttphttpProtocolsParamsDateRange28dControl RadarHttphttpProtocolsParamsDateRange = "28dControl" - RadarHttphttpProtocolsParamsDateRange12wControl RadarHttphttpProtocolsParamsDateRange = "12wControl" - RadarHttphttpProtocolsParamsDateRange24wControl RadarHttphttpProtocolsParamsDateRange = "24wControl" -) - -type RadarHttphttpProtocolsParamsDeviceType string - -const ( - RadarHttphttpProtocolsParamsDeviceTypeDesktop RadarHttphttpProtocolsParamsDeviceType = "DESKTOP" - RadarHttphttpProtocolsParamsDeviceTypeMobile RadarHttphttpProtocolsParamsDeviceType = "MOBILE" - RadarHttphttpProtocolsParamsDeviceTypeOther RadarHttphttpProtocolsParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHttphttpProtocolsParamsFormat string - -const ( - RadarHttphttpProtocolsParamsFormatJson RadarHttphttpProtocolsParamsFormat = "JSON" - RadarHttphttpProtocolsParamsFormatCsv RadarHttphttpProtocolsParamsFormat = "CSV" -) - -type RadarHttphttpProtocolsParamsHTTPVersion string - -const ( - RadarHttphttpProtocolsParamsHTTPVersionHttPv1 RadarHttphttpProtocolsParamsHTTPVersion = "HTTPv1" - RadarHttphttpProtocolsParamsHTTPVersionHttPv2 RadarHttphttpProtocolsParamsHTTPVersion = "HTTPv2" - RadarHttphttpProtocolsParamsHTTPVersionHttPv3 RadarHttphttpProtocolsParamsHTTPVersion = "HTTPv3" -) - -type RadarHttphttpProtocolsParamsIPVersion string - -const ( - RadarHttphttpProtocolsParamsIPVersionIPv4 RadarHttphttpProtocolsParamsIPVersion = "IPv4" - RadarHttphttpProtocolsParamsIPVersionIPv6 RadarHttphttpProtocolsParamsIPVersion = "IPv6" -) - -type RadarHttphttpProtocolsParamsO string - -const ( - RadarHttphttpProtocolsParamsOWindows RadarHttphttpProtocolsParamsO = "WINDOWS" - RadarHttphttpProtocolsParamsOMacosx RadarHttphttpProtocolsParamsO = "MACOSX" - RadarHttphttpProtocolsParamsOIos RadarHttphttpProtocolsParamsO = "IOS" - RadarHttphttpProtocolsParamsOAndroid RadarHttphttpProtocolsParamsO = "ANDROID" - RadarHttphttpProtocolsParamsOChromeos RadarHttphttpProtocolsParamsO = "CHROMEOS" - RadarHttphttpProtocolsParamsOLinux RadarHttphttpProtocolsParamsO = "LINUX" - RadarHttphttpProtocolsParamsOSmartTv RadarHttphttpProtocolsParamsO = "SMART_TV" -) - -type RadarHttphttpProtocolsParamsTLSVersion string - -const ( - RadarHttphttpProtocolsParamsTLSVersionTlSv1_0 RadarHttphttpProtocolsParamsTLSVersion = "TLSv1_0" - RadarHttphttpProtocolsParamsTLSVersionTlSv1_1 RadarHttphttpProtocolsParamsTLSVersion = "TLSv1_1" - RadarHttphttpProtocolsParamsTLSVersionTlSv1_2 RadarHttphttpProtocolsParamsTLSVersion = "TLSv1_2" - RadarHttphttpProtocolsParamsTLSVersionTlSv1_3 RadarHttphttpProtocolsParamsTLSVersion = "TLSv1_3" - RadarHttphttpProtocolsParamsTLSVersionTlSvQuic RadarHttphttpProtocolsParamsTLSVersion = "TLSvQUIC" -) - -type RadarHttphttpProtocolsResponseEnvelope struct { - Result RadarHttphttpProtocolsResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHttphttpProtocolsResponseEnvelopeJSON `json:"-"` -} - -// radarHttphttpProtocolsResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHttphttpProtocolsResponseEnvelope] -type radarHttphttpProtocolsResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpProtocolsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPHTTPVersionsParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHttphttpVersionsParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHttphttpVersionsParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHttphttpVersionsParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHttphttpVersionsParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHttphttpVersionsParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHttphttpVersionsParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for ip version. - IPVersion param.Field[[]RadarHttphttpVersionsParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHttphttpVersionsParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHttphttpVersionsParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPHTTPVersionsParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPHTTPVersionsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHttphttpVersionsParamsAggInterval string - -const ( - RadarHttphttpVersionsParamsAggInterval15m RadarHttphttpVersionsParamsAggInterval = "15m" - RadarHttphttpVersionsParamsAggInterval1h RadarHttphttpVersionsParamsAggInterval = "1h" - RadarHttphttpVersionsParamsAggInterval1d RadarHttphttpVersionsParamsAggInterval = "1d" - RadarHttphttpVersionsParamsAggInterval1w RadarHttphttpVersionsParamsAggInterval = "1w" -) - -type RadarHttphttpVersionsParamsBotClass string - -const ( - RadarHttphttpVersionsParamsBotClassLikelyAutomated RadarHttphttpVersionsParamsBotClass = "LIKELY_AUTOMATED" - RadarHttphttpVersionsParamsBotClassLikelyHuman RadarHttphttpVersionsParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHttphttpVersionsParamsDateRange string - -const ( - RadarHttphttpVersionsParamsDateRange1d RadarHttphttpVersionsParamsDateRange = "1d" - RadarHttphttpVersionsParamsDateRange2d RadarHttphttpVersionsParamsDateRange = "2d" - RadarHttphttpVersionsParamsDateRange7d RadarHttphttpVersionsParamsDateRange = "7d" - RadarHttphttpVersionsParamsDateRange14d RadarHttphttpVersionsParamsDateRange = "14d" - RadarHttphttpVersionsParamsDateRange28d RadarHttphttpVersionsParamsDateRange = "28d" - RadarHttphttpVersionsParamsDateRange12w RadarHttphttpVersionsParamsDateRange = "12w" - RadarHttphttpVersionsParamsDateRange24w RadarHttphttpVersionsParamsDateRange = "24w" - RadarHttphttpVersionsParamsDateRange52w RadarHttphttpVersionsParamsDateRange = "52w" - RadarHttphttpVersionsParamsDateRange1dControl RadarHttphttpVersionsParamsDateRange = "1dControl" - RadarHttphttpVersionsParamsDateRange2dControl RadarHttphttpVersionsParamsDateRange = "2dControl" - RadarHttphttpVersionsParamsDateRange7dControl RadarHttphttpVersionsParamsDateRange = "7dControl" - RadarHttphttpVersionsParamsDateRange14dControl RadarHttphttpVersionsParamsDateRange = "14dControl" - RadarHttphttpVersionsParamsDateRange28dControl RadarHttphttpVersionsParamsDateRange = "28dControl" - RadarHttphttpVersionsParamsDateRange12wControl RadarHttphttpVersionsParamsDateRange = "12wControl" - RadarHttphttpVersionsParamsDateRange24wControl RadarHttphttpVersionsParamsDateRange = "24wControl" -) - -type RadarHttphttpVersionsParamsDeviceType string - -const ( - RadarHttphttpVersionsParamsDeviceTypeDesktop RadarHttphttpVersionsParamsDeviceType = "DESKTOP" - RadarHttphttpVersionsParamsDeviceTypeMobile RadarHttphttpVersionsParamsDeviceType = "MOBILE" - RadarHttphttpVersionsParamsDeviceTypeOther RadarHttphttpVersionsParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHttphttpVersionsParamsFormat string - -const ( - RadarHttphttpVersionsParamsFormatJson RadarHttphttpVersionsParamsFormat = "JSON" - RadarHttphttpVersionsParamsFormatCsv RadarHttphttpVersionsParamsFormat = "CSV" -) - -type RadarHttphttpVersionsParamsHTTPProtocol string - -const ( - RadarHttphttpVersionsParamsHTTPProtocolHTTP RadarHttphttpVersionsParamsHTTPProtocol = "HTTP" - RadarHttphttpVersionsParamsHTTPProtocolHTTPS RadarHttphttpVersionsParamsHTTPProtocol = "HTTPS" -) - -type RadarHttphttpVersionsParamsIPVersion string - -const ( - RadarHttphttpVersionsParamsIPVersionIPv4 RadarHttphttpVersionsParamsIPVersion = "IPv4" - RadarHttphttpVersionsParamsIPVersionIPv6 RadarHttphttpVersionsParamsIPVersion = "IPv6" -) - -type RadarHttphttpVersionsParamsO string - -const ( - RadarHttphttpVersionsParamsOWindows RadarHttphttpVersionsParamsO = "WINDOWS" - RadarHttphttpVersionsParamsOMacosx RadarHttphttpVersionsParamsO = "MACOSX" - RadarHttphttpVersionsParamsOIos RadarHttphttpVersionsParamsO = "IOS" - RadarHttphttpVersionsParamsOAndroid RadarHttphttpVersionsParamsO = "ANDROID" - RadarHttphttpVersionsParamsOChromeos RadarHttphttpVersionsParamsO = "CHROMEOS" - RadarHttphttpVersionsParamsOLinux RadarHttphttpVersionsParamsO = "LINUX" - RadarHttphttpVersionsParamsOSmartTv RadarHttphttpVersionsParamsO = "SMART_TV" -) - -type RadarHttphttpVersionsParamsTLSVersion string - -const ( - RadarHttphttpVersionsParamsTLSVersionTlSv1_0 RadarHttphttpVersionsParamsTLSVersion = "TLSv1_0" - RadarHttphttpVersionsParamsTLSVersionTlSv1_1 RadarHttphttpVersionsParamsTLSVersion = "TLSv1_1" - RadarHttphttpVersionsParamsTLSVersionTlSv1_2 RadarHttphttpVersionsParamsTLSVersion = "TLSv1_2" - RadarHttphttpVersionsParamsTLSVersionTlSv1_3 RadarHttphttpVersionsParamsTLSVersion = "TLSv1_3" - RadarHttphttpVersionsParamsTLSVersionTlSvQuic RadarHttphttpVersionsParamsTLSVersion = "TLSvQUIC" -) - -type RadarHttphttpVersionsResponseEnvelope struct { - Result RadarHttphttpVersionsResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHttphttpVersionsResponseEnvelopeJSON `json:"-"` -} - -// radarHttphttpVersionsResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHttphttpVersionsResponseEnvelope] -type radarHttphttpVersionsResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttphttpVersionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPIPVersionsParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHttpipVersionsParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHttpipVersionsParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHttpipVersionsParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHttpipVersionsParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHttpipVersionsParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHttpipVersionsParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHttpipVersionsParamsHTTPVersion] `query:"httpVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for os name. - Os param.Field[[]RadarHttpipVersionsParamsO] `query:"os"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHttpipVersionsParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPIPVersionsParams]'s query parameters as -// `url.Values`. -func (r RadarHTTPIPVersionsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHttpipVersionsParamsAggInterval string - -const ( - RadarHttpipVersionsParamsAggInterval15m RadarHttpipVersionsParamsAggInterval = "15m" - RadarHttpipVersionsParamsAggInterval1h RadarHttpipVersionsParamsAggInterval = "1h" - RadarHttpipVersionsParamsAggInterval1d RadarHttpipVersionsParamsAggInterval = "1d" - RadarHttpipVersionsParamsAggInterval1w RadarHttpipVersionsParamsAggInterval = "1w" -) - -type RadarHttpipVersionsParamsBotClass string - -const ( - RadarHttpipVersionsParamsBotClassLikelyAutomated RadarHttpipVersionsParamsBotClass = "LIKELY_AUTOMATED" - RadarHttpipVersionsParamsBotClassLikelyHuman RadarHttpipVersionsParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHttpipVersionsParamsDateRange string - -const ( - RadarHttpipVersionsParamsDateRange1d RadarHttpipVersionsParamsDateRange = "1d" - RadarHttpipVersionsParamsDateRange2d RadarHttpipVersionsParamsDateRange = "2d" - RadarHttpipVersionsParamsDateRange7d RadarHttpipVersionsParamsDateRange = "7d" - RadarHttpipVersionsParamsDateRange14d RadarHttpipVersionsParamsDateRange = "14d" - RadarHttpipVersionsParamsDateRange28d RadarHttpipVersionsParamsDateRange = "28d" - RadarHttpipVersionsParamsDateRange12w RadarHttpipVersionsParamsDateRange = "12w" - RadarHttpipVersionsParamsDateRange24w RadarHttpipVersionsParamsDateRange = "24w" - RadarHttpipVersionsParamsDateRange52w RadarHttpipVersionsParamsDateRange = "52w" - RadarHttpipVersionsParamsDateRange1dControl RadarHttpipVersionsParamsDateRange = "1dControl" - RadarHttpipVersionsParamsDateRange2dControl RadarHttpipVersionsParamsDateRange = "2dControl" - RadarHttpipVersionsParamsDateRange7dControl RadarHttpipVersionsParamsDateRange = "7dControl" - RadarHttpipVersionsParamsDateRange14dControl RadarHttpipVersionsParamsDateRange = "14dControl" - RadarHttpipVersionsParamsDateRange28dControl RadarHttpipVersionsParamsDateRange = "28dControl" - RadarHttpipVersionsParamsDateRange12wControl RadarHttpipVersionsParamsDateRange = "12wControl" - RadarHttpipVersionsParamsDateRange24wControl RadarHttpipVersionsParamsDateRange = "24wControl" -) - -type RadarHttpipVersionsParamsDeviceType string - -const ( - RadarHttpipVersionsParamsDeviceTypeDesktop RadarHttpipVersionsParamsDeviceType = "DESKTOP" - RadarHttpipVersionsParamsDeviceTypeMobile RadarHttpipVersionsParamsDeviceType = "MOBILE" - RadarHttpipVersionsParamsDeviceTypeOther RadarHttpipVersionsParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHttpipVersionsParamsFormat string - -const ( - RadarHttpipVersionsParamsFormatJson RadarHttpipVersionsParamsFormat = "JSON" - RadarHttpipVersionsParamsFormatCsv RadarHttpipVersionsParamsFormat = "CSV" -) - -type RadarHttpipVersionsParamsHTTPProtocol string - -const ( - RadarHttpipVersionsParamsHTTPProtocolHTTP RadarHttpipVersionsParamsHTTPProtocol = "HTTP" - RadarHttpipVersionsParamsHTTPProtocolHTTPS RadarHttpipVersionsParamsHTTPProtocol = "HTTPS" -) - -type RadarHttpipVersionsParamsHTTPVersion string - -const ( - RadarHttpipVersionsParamsHTTPVersionHttPv1 RadarHttpipVersionsParamsHTTPVersion = "HTTPv1" - RadarHttpipVersionsParamsHTTPVersionHttPv2 RadarHttpipVersionsParamsHTTPVersion = "HTTPv2" - RadarHttpipVersionsParamsHTTPVersionHttPv3 RadarHttpipVersionsParamsHTTPVersion = "HTTPv3" -) - -type RadarHttpipVersionsParamsO string - -const ( - RadarHttpipVersionsParamsOWindows RadarHttpipVersionsParamsO = "WINDOWS" - RadarHttpipVersionsParamsOMacosx RadarHttpipVersionsParamsO = "MACOSX" - RadarHttpipVersionsParamsOIos RadarHttpipVersionsParamsO = "IOS" - RadarHttpipVersionsParamsOAndroid RadarHttpipVersionsParamsO = "ANDROID" - RadarHttpipVersionsParamsOChromeos RadarHttpipVersionsParamsO = "CHROMEOS" - RadarHttpipVersionsParamsOLinux RadarHttpipVersionsParamsO = "LINUX" - RadarHttpipVersionsParamsOSmartTv RadarHttpipVersionsParamsO = "SMART_TV" -) - -type RadarHttpipVersionsParamsTLSVersion string - -const ( - RadarHttpipVersionsParamsTLSVersionTlSv1_0 RadarHttpipVersionsParamsTLSVersion = "TLSv1_0" - RadarHttpipVersionsParamsTLSVersionTlSv1_1 RadarHttpipVersionsParamsTLSVersion = "TLSv1_1" - RadarHttpipVersionsParamsTLSVersionTlSv1_2 RadarHttpipVersionsParamsTLSVersion = "TLSv1_2" - RadarHttpipVersionsParamsTLSVersionTlSv1_3 RadarHttpipVersionsParamsTLSVersion = "TLSv1_3" - RadarHttpipVersionsParamsTLSVersionTlSvQuic RadarHttpipVersionsParamsTLSVersion = "TLSvQUIC" -) - -type RadarHttpipVersionsResponseEnvelope struct { - Result RadarHttpipVersionsResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHttpipVersionsResponseEnvelopeJSON `json:"-"` -} - -// radarHttpipVersionsResponseEnvelopeJSON contains the JSON metadata for the -// struct [RadarHttpipVersionsResponseEnvelope] -type radarHttpipVersionsResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHttpipVersionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarHTTPOssParams struct { - // Aggregation interval results should be returned in (for example, in 15 minutes - // or 1 hour intervals). Refer to - // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - AggInterval param.Field[RadarHTTPOssParamsAggInterval] `query:"aggInterval"` - // Array of comma separated list of ASNs, start with `-` to exclude from results. - // For example, `-174, 3356` excludes results from AS174, but includes results from - // AS3356. - Asn param.Field[[]string] `query:"asn"` - // Filter for bot class. Refer to - // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - BotClass param.Field[[]RadarHTTPOssParamsBotClass] `query:"botClass"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarHTTPOssParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for device type. - DeviceType param.Field[[]RadarHTTPOssParamsDeviceType] `query:"deviceType"` - // Format results are returned in. - Format param.Field[RadarHTTPOssParamsFormat] `query:"format"` - // Filter for http protocol. - HTTPProtocol param.Field[[]RadarHTTPOssParamsHTTPProtocol] `query:"httpProtocol"` - // Filter for http version. - HTTPVersion param.Field[[]RadarHTTPOssParamsHTTPVersion] `query:"httpVersion"` - // Filter for ip version. - IPVersion param.Field[[]RadarHTTPOssParamsIPVersion] `query:"ipVersion"` - // Array of comma separated list of locations (alpha-2 country codes). Start with - // `-` to exclude from results. For example, `-US,PT` excludes results from the US, - // but includes results from PT. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for tls version. - TLSVersion param.Field[[]RadarHTTPOssParamsTLSVersion] `query:"tlsVersion"` -} - -// URLQuery serializes [RadarHTTPOssParams]'s query parameters as `url.Values`. -func (r RadarHTTPOssParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Aggregation interval results should be returned in (for example, in 15 minutes -// or 1 hour intervals). Refer to -// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). -type RadarHTTPOssParamsAggInterval string - -const ( - RadarHTTPOssParamsAggInterval15m RadarHTTPOssParamsAggInterval = "15m" - RadarHTTPOssParamsAggInterval1h RadarHTTPOssParamsAggInterval = "1h" - RadarHTTPOssParamsAggInterval1d RadarHTTPOssParamsAggInterval = "1d" - RadarHTTPOssParamsAggInterval1w RadarHTTPOssParamsAggInterval = "1w" -) - -type RadarHTTPOssParamsBotClass string - -const ( - RadarHTTPOssParamsBotClassLikelyAutomated RadarHTTPOssParamsBotClass = "LIKELY_AUTOMATED" - RadarHTTPOssParamsBotClassLikelyHuman RadarHTTPOssParamsBotClass = "LIKELY_HUMAN" -) - -type RadarHTTPOssParamsDateRange string - -const ( - RadarHTTPOssParamsDateRange1d RadarHTTPOssParamsDateRange = "1d" - RadarHTTPOssParamsDateRange2d RadarHTTPOssParamsDateRange = "2d" - RadarHTTPOssParamsDateRange7d RadarHTTPOssParamsDateRange = "7d" - RadarHTTPOssParamsDateRange14d RadarHTTPOssParamsDateRange = "14d" - RadarHTTPOssParamsDateRange28d RadarHTTPOssParamsDateRange = "28d" - RadarHTTPOssParamsDateRange12w RadarHTTPOssParamsDateRange = "12w" - RadarHTTPOssParamsDateRange24w RadarHTTPOssParamsDateRange = "24w" - RadarHTTPOssParamsDateRange52w RadarHTTPOssParamsDateRange = "52w" - RadarHTTPOssParamsDateRange1dControl RadarHTTPOssParamsDateRange = "1dControl" - RadarHTTPOssParamsDateRange2dControl RadarHTTPOssParamsDateRange = "2dControl" - RadarHTTPOssParamsDateRange7dControl RadarHTTPOssParamsDateRange = "7dControl" - RadarHTTPOssParamsDateRange14dControl RadarHTTPOssParamsDateRange = "14dControl" - RadarHTTPOssParamsDateRange28dControl RadarHTTPOssParamsDateRange = "28dControl" - RadarHTTPOssParamsDateRange12wControl RadarHTTPOssParamsDateRange = "12wControl" - RadarHTTPOssParamsDateRange24wControl RadarHTTPOssParamsDateRange = "24wControl" -) - -type RadarHTTPOssParamsDeviceType string - -const ( - RadarHTTPOssParamsDeviceTypeDesktop RadarHTTPOssParamsDeviceType = "DESKTOP" - RadarHTTPOssParamsDeviceTypeMobile RadarHTTPOssParamsDeviceType = "MOBILE" - RadarHTTPOssParamsDeviceTypeOther RadarHTTPOssParamsDeviceType = "OTHER" -) - -// Format results are returned in. -type RadarHTTPOssParamsFormat string - -const ( - RadarHTTPOssParamsFormatJson RadarHTTPOssParamsFormat = "JSON" - RadarHTTPOssParamsFormatCsv RadarHTTPOssParamsFormat = "CSV" -) - -type RadarHTTPOssParamsHTTPProtocol string - -const ( - RadarHTTPOssParamsHTTPProtocolHTTP RadarHTTPOssParamsHTTPProtocol = "HTTP" - RadarHTTPOssParamsHTTPProtocolHTTPS RadarHTTPOssParamsHTTPProtocol = "HTTPS" -) - -type RadarHTTPOssParamsHTTPVersion string - -const ( - RadarHTTPOssParamsHTTPVersionHttPv1 RadarHTTPOssParamsHTTPVersion = "HTTPv1" - RadarHTTPOssParamsHTTPVersionHttPv2 RadarHTTPOssParamsHTTPVersion = "HTTPv2" - RadarHTTPOssParamsHTTPVersionHttPv3 RadarHTTPOssParamsHTTPVersion = "HTTPv3" -) - -type RadarHTTPOssParamsIPVersion string - -const ( - RadarHTTPOssParamsIPVersionIPv4 RadarHTTPOssParamsIPVersion = "IPv4" - RadarHTTPOssParamsIPVersionIPv6 RadarHTTPOssParamsIPVersion = "IPv6" -) - -type RadarHTTPOssParamsTLSVersion string - -const ( - RadarHTTPOssParamsTLSVersionTlSv1_0 RadarHTTPOssParamsTLSVersion = "TLSv1_0" - RadarHTTPOssParamsTLSVersionTlSv1_1 RadarHTTPOssParamsTLSVersion = "TLSv1_1" - RadarHTTPOssParamsTLSVersionTlSv1_2 RadarHTTPOssParamsTLSVersion = "TLSv1_2" - RadarHTTPOssParamsTLSVersionTlSv1_3 RadarHTTPOssParamsTLSVersion = "TLSv1_3" - RadarHTTPOssParamsTLSVersionTlSvQuic RadarHTTPOssParamsTLSVersion = "TLSvQUIC" -) - -type RadarHTTPOssResponseEnvelope struct { - Result RadarHTTPOssResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarHTTPOssResponseEnvelopeJSON `json:"-"` -} - -// radarHTTPOssResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarHTTPOssResponseEnvelope] -type radarHTTPOssResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarHTTPOssResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radarhttp_test.go b/radarhttp_test.go deleted file mode 100644 index a1fcc3b89d5..00000000000 --- a/radarhttp_test.go +++ /dev/null @@ -1,346 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarHTTPBotClassesWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.BotClasses(context.TODO(), cloudflare.RadarHTTPBotClassesParams{ - AggInterval: cloudflare.F(cloudflare.RadarHTTPBotClassesParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsDateRange{cloudflare.RadarHTTPBotClassesParamsDateRange1d, cloudflare.RadarHTTPBotClassesParamsDateRange2d, cloudflare.RadarHTTPBotClassesParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsDeviceType{cloudflare.RadarHTTPBotClassesParamsDeviceTypeDesktop, cloudflare.RadarHTTPBotClassesParamsDeviceTypeMobile, cloudflare.RadarHTTPBotClassesParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHTTPBotClassesParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsHTTPProtocol{cloudflare.RadarHTTPBotClassesParamsHTTPProtocolHTTP, cloudflare.RadarHTTPBotClassesParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsHTTPVersion{cloudflare.RadarHTTPBotClassesParamsHTTPVersionHttPv1, cloudflare.RadarHTTPBotClassesParamsHTTPVersionHttPv2, cloudflare.RadarHTTPBotClassesParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsIPVersion{cloudflare.RadarHTTPBotClassesParamsIPVersionIPv4, cloudflare.RadarHTTPBotClassesParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsO{cloudflare.RadarHTTPBotClassesParamsOWindows, cloudflare.RadarHTTPBotClassesParamsOMacosx, cloudflare.RadarHTTPBotClassesParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHTTPBotClassesParamsTLSVersion{cloudflare.RadarHTTPBotClassesParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPBotClassesParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPBotClassesParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPBrowserFamiliesWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.BrowserFamilies(context.TODO(), cloudflare.RadarHTTPBrowserFamiliesParams{ - AggInterval: cloudflare.F(cloudflare.RadarHTTPBrowserFamiliesParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsBotClass{cloudflare.RadarHTTPBrowserFamiliesParamsBotClassLikelyAutomated, cloudflare.RadarHTTPBrowserFamiliesParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsDateRange{cloudflare.RadarHTTPBrowserFamiliesParamsDateRange1d, cloudflare.RadarHTTPBrowserFamiliesParamsDateRange2d, cloudflare.RadarHTTPBrowserFamiliesParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsDeviceType{cloudflare.RadarHTTPBrowserFamiliesParamsDeviceTypeDesktop, cloudflare.RadarHTTPBrowserFamiliesParamsDeviceTypeMobile, cloudflare.RadarHTTPBrowserFamiliesParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHTTPBrowserFamiliesParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsHTTPProtocol{cloudflare.RadarHTTPBrowserFamiliesParamsHTTPProtocolHTTP, cloudflare.RadarHTTPBrowserFamiliesParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsHTTPVersion{cloudflare.RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv1, cloudflare.RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv2, cloudflare.RadarHTTPBrowserFamiliesParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsIPVersion{cloudflare.RadarHTTPBrowserFamiliesParamsIPVersionIPv4, cloudflare.RadarHTTPBrowserFamiliesParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsO{cloudflare.RadarHTTPBrowserFamiliesParamsOWindows, cloudflare.RadarHTTPBrowserFamiliesParamsOMacosx, cloudflare.RadarHTTPBrowserFamiliesParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHTTPBrowserFamiliesParamsTLSVersion{cloudflare.RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPBrowserFamiliesParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPBrowsersWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.Browsers(context.TODO(), cloudflare.RadarHTTPBrowsersParams{ - AggInterval: cloudflare.F(cloudflare.RadarHTTPBrowsersParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsBotClass{cloudflare.RadarHTTPBrowsersParamsBotClassLikelyAutomated, cloudflare.RadarHTTPBrowsersParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsDateRange{cloudflare.RadarHTTPBrowsersParamsDateRange1d, cloudflare.RadarHTTPBrowsersParamsDateRange2d, cloudflare.RadarHTTPBrowsersParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsDeviceType{cloudflare.RadarHTTPBrowsersParamsDeviceTypeDesktop, cloudflare.RadarHTTPBrowsersParamsDeviceTypeMobile, cloudflare.RadarHTTPBrowsersParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHTTPBrowsersParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsHTTPProtocol{cloudflare.RadarHTTPBrowsersParamsHTTPProtocolHTTP, cloudflare.RadarHTTPBrowsersParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsHTTPVersion{cloudflare.RadarHTTPBrowsersParamsHTTPVersionHttPv1, cloudflare.RadarHTTPBrowsersParamsHTTPVersionHttPv2, cloudflare.RadarHTTPBrowsersParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsIPVersion{cloudflare.RadarHTTPBrowsersParamsIPVersionIPv4, cloudflare.RadarHTTPBrowsersParamsIPVersionIPv6}), - LimitPerGroup: cloudflare.F(int64(4)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsO{cloudflare.RadarHTTPBrowsersParamsOWindows, cloudflare.RadarHTTPBrowsersParamsOMacosx, cloudflare.RadarHTTPBrowsersParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHTTPBrowsersParamsTLSVersion{cloudflare.RadarHTTPBrowsersParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPBrowsersParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPBrowsersParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPDeviceTypesWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.DeviceTypes(context.TODO(), cloudflare.RadarHTTPDeviceTypesParams{ - AggInterval: cloudflare.F(cloudflare.RadarHTTPDeviceTypesParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsBotClass{cloudflare.RadarHTTPDeviceTypesParamsBotClassLikelyAutomated, cloudflare.RadarHTTPDeviceTypesParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsDateRange{cloudflare.RadarHTTPDeviceTypesParamsDateRange1d, cloudflare.RadarHTTPDeviceTypesParamsDateRange2d, cloudflare.RadarHTTPDeviceTypesParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarHTTPDeviceTypesParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsHTTPProtocol{cloudflare.RadarHTTPDeviceTypesParamsHTTPProtocolHTTP, cloudflare.RadarHTTPDeviceTypesParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsHTTPVersion{cloudflare.RadarHTTPDeviceTypesParamsHTTPVersionHttPv1, cloudflare.RadarHTTPDeviceTypesParamsHTTPVersionHttPv2, cloudflare.RadarHTTPDeviceTypesParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsIPVersion{cloudflare.RadarHTTPDeviceTypesParamsIPVersionIPv4, cloudflare.RadarHTTPDeviceTypesParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsO{cloudflare.RadarHTTPDeviceTypesParamsOWindows, cloudflare.RadarHTTPDeviceTypesParamsOMacosx, cloudflare.RadarHTTPDeviceTypesParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHTTPDeviceTypesParamsTLSVersion{cloudflare.RadarHTTPDeviceTypesParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPDeviceTypesParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPDeviceTypesParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPHTTPProtocolsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.HTTPProtocols(context.TODO(), cloudflare.RadarHTTPHTTPProtocolsParams{ - AggInterval: cloudflare.F(cloudflare.RadarHttphttpProtocolsParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsBotClass{cloudflare.RadarHttphttpProtocolsParamsBotClassLikelyAutomated, cloudflare.RadarHttphttpProtocolsParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsDateRange{cloudflare.RadarHttphttpProtocolsParamsDateRange1d, cloudflare.RadarHttphttpProtocolsParamsDateRange2d, cloudflare.RadarHttphttpProtocolsParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsDeviceType{cloudflare.RadarHttphttpProtocolsParamsDeviceTypeDesktop, cloudflare.RadarHttphttpProtocolsParamsDeviceTypeMobile, cloudflare.RadarHttphttpProtocolsParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHttphttpProtocolsParamsFormatJson), - HTTPVersion: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsHTTPVersion{cloudflare.RadarHttphttpProtocolsParamsHTTPVersionHttPv1, cloudflare.RadarHttphttpProtocolsParamsHTTPVersionHttPv2, cloudflare.RadarHttphttpProtocolsParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsIPVersion{cloudflare.RadarHttphttpProtocolsParamsIPVersionIPv4, cloudflare.RadarHttphttpProtocolsParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsO{cloudflare.RadarHttphttpProtocolsParamsOWindows, cloudflare.RadarHttphttpProtocolsParamsOMacosx, cloudflare.RadarHttphttpProtocolsParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHttphttpProtocolsParamsTLSVersion{cloudflare.RadarHttphttpProtocolsParamsTLSVersionTlSv1_0, cloudflare.RadarHttphttpProtocolsParamsTLSVersionTlSv1_1, cloudflare.RadarHttphttpProtocolsParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPHTTPVersionsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.HTTPVersions(context.TODO(), cloudflare.RadarHTTPHTTPVersionsParams{ - AggInterval: cloudflare.F(cloudflare.RadarHttphttpVersionsParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsBotClass{cloudflare.RadarHttphttpVersionsParamsBotClassLikelyAutomated, cloudflare.RadarHttphttpVersionsParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsDateRange{cloudflare.RadarHttphttpVersionsParamsDateRange1d, cloudflare.RadarHttphttpVersionsParamsDateRange2d, cloudflare.RadarHttphttpVersionsParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsDeviceType{cloudflare.RadarHttphttpVersionsParamsDeviceTypeDesktop, cloudflare.RadarHttphttpVersionsParamsDeviceTypeMobile, cloudflare.RadarHttphttpVersionsParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHttphttpVersionsParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsHTTPProtocol{cloudflare.RadarHttphttpVersionsParamsHTTPProtocolHTTP, cloudflare.RadarHttphttpVersionsParamsHTTPProtocolHTTPS}), - IPVersion: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsIPVersion{cloudflare.RadarHttphttpVersionsParamsIPVersionIPv4, cloudflare.RadarHttphttpVersionsParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsO{cloudflare.RadarHttphttpVersionsParamsOWindows, cloudflare.RadarHttphttpVersionsParamsOMacosx, cloudflare.RadarHttphttpVersionsParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHttphttpVersionsParamsTLSVersion{cloudflare.RadarHttphttpVersionsParamsTLSVersionTlSv1_0, cloudflare.RadarHttphttpVersionsParamsTLSVersionTlSv1_1, cloudflare.RadarHttphttpVersionsParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPIPVersionsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.IPVersions(context.TODO(), cloudflare.RadarHTTPIPVersionsParams{ - AggInterval: cloudflare.F(cloudflare.RadarHttpipVersionsParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsBotClass{cloudflare.RadarHttpipVersionsParamsBotClassLikelyAutomated, cloudflare.RadarHttpipVersionsParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsDateRange{cloudflare.RadarHttpipVersionsParamsDateRange1d, cloudflare.RadarHttpipVersionsParamsDateRange2d, cloudflare.RadarHttpipVersionsParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsDeviceType{cloudflare.RadarHttpipVersionsParamsDeviceTypeDesktop, cloudflare.RadarHttpipVersionsParamsDeviceTypeMobile, cloudflare.RadarHttpipVersionsParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHttpipVersionsParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsHTTPProtocol{cloudflare.RadarHttpipVersionsParamsHTTPProtocolHTTP, cloudflare.RadarHttpipVersionsParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsHTTPVersion{cloudflare.RadarHttpipVersionsParamsHTTPVersionHttPv1, cloudflare.RadarHttpipVersionsParamsHTTPVersionHttPv2, cloudflare.RadarHttpipVersionsParamsHTTPVersionHttPv3}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - Os: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsO{cloudflare.RadarHttpipVersionsParamsOWindows, cloudflare.RadarHttpipVersionsParamsOMacosx, cloudflare.RadarHttpipVersionsParamsOIos}), - TLSVersion: cloudflare.F([]cloudflare.RadarHttpipVersionsParamsTLSVersion{cloudflare.RadarHttpipVersionsParamsTLSVersionTlSv1_0, cloudflare.RadarHttpipVersionsParamsTLSVersionTlSv1_1, cloudflare.RadarHttpipVersionsParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestRadarHTTPOssWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Radar.HTTP.Oss(context.TODO(), cloudflare.RadarHTTPOssParams{ - AggInterval: cloudflare.F(cloudflare.RadarHTTPOssParamsAggInterval1h), - Asn: cloudflare.F([]string{"string", "string", "string"}), - BotClass: cloudflare.F([]cloudflare.RadarHTTPOssParamsBotClass{cloudflare.RadarHTTPOssParamsBotClassLikelyAutomated, cloudflare.RadarHTTPOssParamsBotClassLikelyHuman}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarHTTPOssParamsDateRange{cloudflare.RadarHTTPOssParamsDateRange1d, cloudflare.RadarHTTPOssParamsDateRange2d, cloudflare.RadarHTTPOssParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DeviceType: cloudflare.F([]cloudflare.RadarHTTPOssParamsDeviceType{cloudflare.RadarHTTPOssParamsDeviceTypeDesktop, cloudflare.RadarHTTPOssParamsDeviceTypeMobile, cloudflare.RadarHTTPOssParamsDeviceTypeOther}), - Format: cloudflare.F(cloudflare.RadarHTTPOssParamsFormatJson), - HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPOssParamsHTTPProtocol{cloudflare.RadarHTTPOssParamsHTTPProtocolHTTP, cloudflare.RadarHTTPOssParamsHTTPProtocolHTTPS}), - HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPOssParamsHTTPVersion{cloudflare.RadarHTTPOssParamsHTTPVersionHttPv1, cloudflare.RadarHTTPOssParamsHTTPVersionHttPv2, cloudflare.RadarHTTPOssParamsHTTPVersionHttPv3}), - IPVersion: cloudflare.F([]cloudflare.RadarHTTPOssParamsIPVersion{cloudflare.RadarHTTPOssParamsIPVersionIPv4, cloudflare.RadarHTTPOssParamsIPVersionIPv6}), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - TLSVersion: cloudflare.F([]cloudflare.RadarHTTPOssParamsTLSVersion{cloudflare.RadarHTTPOssParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPOssParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPOssParamsTLSVersionTlSv1_2}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radarqualityiqi.go b/radarqualityiqi.go index 7dc0c905a2b..d8444617781 100644 --- a/radarqualityiqi.go +++ b/radarqualityiqi.go @@ -37,9 +37,9 @@ func NewRadarQualityIqiService(opts ...option.RequestOption) (r *RadarQualityIqi // Get a summary (percentiles) of bandwidth, latency or DNS response time from the // Radar Internet Quality Index (IQI). -func (r *RadarQualityIqiService) Get(ctx context.Context, query RadarQualityIqiGetParams, opts ...option.RequestOption) (res *RadarQualityIqiGetResponse, err error) { +func (r *RadarQualityIqiService) List(ctx context.Context, query RadarQualityIqiListParams, opts ...option.RequestOption) (res *RadarQualityIqiListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarQualityIqiGetResponseEnvelope + var env RadarQualityIqiListResponseEnvelope path := "radar/quality/iqi/summary" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -49,36 +49,36 @@ func (r *RadarQualityIqiService) Get(ctx context.Context, query RadarQualityIqiG return } -type RadarQualityIqiGetResponse struct { - Meta RadarQualityIqiGetResponseMeta `json:"meta,required"` - Summary0 RadarQualityIqiGetResponseSummary0 `json:"summary_0,required"` - JSON radarQualityIqiGetResponseJSON `json:"-"` +type RadarQualityIqiListResponse struct { + Meta RadarQualityIqiListResponseMeta `json:"meta,required"` + Summary0 RadarQualityIqiListResponseSummary0 `json:"summary_0,required"` + JSON radarQualityIqiListResponseJSON `json:"-"` } -// radarQualityIqiGetResponseJSON contains the JSON metadata for the struct -// [RadarQualityIqiGetResponse] -type radarQualityIqiGetResponseJSON struct { +// radarQualityIqiListResponseJSON contains the JSON metadata for the struct +// [RadarQualityIqiListResponse] +type radarQualityIqiListResponseJSON struct { Meta apijson.Field Summary0 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetResponseMeta struct { - DateRange []RadarQualityIqiGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - Normalization string `json:"normalization,required"` - ConfidenceInfo RadarQualityIqiGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarQualityIqiGetResponseMetaJSON `json:"-"` +type RadarQualityIqiListResponseMeta struct { + DateRange []RadarQualityIqiListResponseMetaDateRange `json:"dateRange,required"` + LastUpdated string `json:"lastUpdated,required"` + Normalization string `json:"normalization,required"` + ConfidenceInfo RadarQualityIqiListResponseMetaConfidenceInfo `json:"confidenceInfo"` + JSON radarQualityIqiListResponseMetaJSON `json:"-"` } -// radarQualityIqiGetResponseMetaJSON contains the JSON metadata for the struct -// [RadarQualityIqiGetResponseMeta] -type radarQualityIqiGetResponseMetaJSON struct { +// radarQualityIqiListResponseMetaJSON contains the JSON metadata for the struct +// [RadarQualityIqiListResponseMeta] +type radarQualityIqiListResponseMetaJSON struct { DateRange apijson.Field LastUpdated apijson.Field Normalization apijson.Field @@ -87,64 +87,65 @@ type radarQualityIqiGetResponseMetaJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseMeta) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetResponseMetaDateRange struct { +type RadarQualityIqiListResponseMetaDateRange struct { // Adjusted end of date range. EndTime time.Time `json:"endTime,required" format:"date-time"` // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarQualityIqiGetResponseMetaDateRangeJSON `json:"-"` + StartTime time.Time `json:"startTime,required" format:"date-time"` + JSON radarQualityIqiListResponseMetaDateRangeJSON `json:"-"` } -// radarQualityIqiGetResponseMetaDateRangeJSON contains the JSON metadata for the -// struct [RadarQualityIqiGetResponseMetaDateRange] -type radarQualityIqiGetResponseMetaDateRangeJSON struct { +// radarQualityIqiListResponseMetaDateRangeJSON contains the JSON metadata for the +// struct [RadarQualityIqiListResponseMetaDateRange] +type radarQualityIqiListResponseMetaDateRangeJSON struct { EndTime apijson.Field StartTime apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetResponseMetaConfidenceInfo struct { - Annotations []RadarQualityIqiGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarQualityIqiGetResponseMetaConfidenceInfoJSON `json:"-"` +type RadarQualityIqiListResponseMetaConfidenceInfo struct { + Annotations []RadarQualityIqiListResponseMetaConfidenceInfoAnnotation `json:"annotations"` + Level int64 `json:"level"` + JSON radarQualityIqiListResponseMetaConfidenceInfoJSON `json:"-"` } -// radarQualityIqiGetResponseMetaConfidenceInfoJSON contains the JSON metadata for -// the struct [RadarQualityIqiGetResponseMetaConfidenceInfo] -type radarQualityIqiGetResponseMetaConfidenceInfoJSON struct { +// radarQualityIqiListResponseMetaConfidenceInfoJSON contains the JSON metadata for +// the struct [RadarQualityIqiListResponseMetaConfidenceInfo] +type radarQualityIqiListResponseMetaConfidenceInfoJSON struct { Annotations apijson.Field Level apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarQualityIqiGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` +type RadarQualityIqiListResponseMetaConfidenceInfoAnnotation struct { + DataSource string `json:"dataSource,required"` + Description string `json:"description,required"` + EventType string `json:"eventType,required"` + IsInstantaneous interface{} `json:"isInstantaneous,required"` + EndTime time.Time `json:"endTime" format:"date-time"` + LinkedURL string `json:"linkedUrl"` + StartTime time.Time `json:"startTime" format:"date-time"` + JSON radarQualityIqiListResponseMetaConfidenceInfoAnnotationJSON `json:"-"` } -// radarQualityIqiGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON -// metadata for the struct [RadarQualityIqiGetResponseMetaConfidenceInfoAnnotation] -type radarQualityIqiGetResponseMetaConfidenceInfoAnnotationJSON struct { +// radarQualityIqiListResponseMetaConfidenceInfoAnnotationJSON contains the JSON +// metadata for the struct +// [RadarQualityIqiListResponseMetaConfidenceInfoAnnotation] +type radarQualityIqiListResponseMetaConfidenceInfoAnnotationJSON struct { DataSource apijson.Field Description apijson.Field EventType apijson.Field @@ -156,20 +157,20 @@ type radarQualityIqiGetResponseMetaConfidenceInfoAnnotationJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetResponseSummary0 struct { - P25 string `json:"p25,required"` - P50 string `json:"p50,required"` - P75 string `json:"p75,required"` - JSON radarQualityIqiGetResponseSummary0JSON `json:"-"` +type RadarQualityIqiListResponseSummary0 struct { + P25 string `json:"p25,required"` + P50 string `json:"p50,required"` + P75 string `json:"p75,required"` + JSON radarQualityIqiListResponseSummary0JSON `json:"-"` } -// radarQualityIqiGetResponseSummary0JSON contains the JSON metadata for the struct -// [RadarQualityIqiGetResponseSummary0] -type radarQualityIqiGetResponseSummary0JSON struct { +// radarQualityIqiListResponseSummary0JSON contains the JSON metadata for the +// struct [RadarQualityIqiListResponseSummary0] +type radarQualityIqiListResponseSummary0JSON struct { P25 apijson.Field P50 apijson.Field P75 apijson.Field @@ -177,13 +178,13 @@ type radarQualityIqiGetResponseSummary0JSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseSummary0) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseSummary0) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualityIqiGetParams struct { +type RadarQualityIqiListParams struct { // Which metric to return: bandwidth, latency or DNS response time. - Metric param.Field[RadarQualityIqiGetParamsMetric] `query:"metric,required"` + Metric param.Field[RadarQualityIqiListParamsMetric] `query:"metric,required"` // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. @@ -197,11 +198,11 @@ type RadarQualityIqiGetParams struct { // For example, use `7d` and `7dControl` to compare this week with the previous // week. Use this parameter or set specific start and end dates (`dateStart` and // `dateEnd` parameters). - DateRange param.Field[[]RadarQualityIqiGetParamsDateRange] `query:"dateRange"` + DateRange param.Field[[]RadarQualityIqiListParamsDateRange] `query:"dateRange"` // Array of datetimes to filter the start of a series. DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` // Format results are returned in. - Format param.Field[RadarQualityIqiGetParamsFormat] `query:"format"` + Format param.Field[RadarQualityIqiListParamsFormat] `query:"format"` // Array of comma separated list of locations (alpha-2 country codes). Start with // `-` to exclude from results. For example, `-US,PT` excludes results from the US, // but includes results from PT. @@ -210,9 +211,9 @@ type RadarQualityIqiGetParams struct { Name param.Field[[]string] `query:"name"` } -// URLQuery serializes [RadarQualityIqiGetParams]'s query parameters as +// URLQuery serializes [RadarQualityIqiListParams]'s query parameters as // `url.Values`. -func (r RadarQualityIqiGetParams) URLQuery() (v url.Values) { +func (r RadarQualityIqiListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -220,57 +221,57 @@ func (r RadarQualityIqiGetParams) URLQuery() (v url.Values) { } // Which metric to return: bandwidth, latency or DNS response time. -type RadarQualityIqiGetParamsMetric string +type RadarQualityIqiListParamsMetric string const ( - RadarQualityIqiGetParamsMetricBandwidth RadarQualityIqiGetParamsMetric = "BANDWIDTH" - RadarQualityIqiGetParamsMetricDNS RadarQualityIqiGetParamsMetric = "DNS" - RadarQualityIqiGetParamsMetricLatency RadarQualityIqiGetParamsMetric = "LATENCY" + RadarQualityIqiListParamsMetricBandwidth RadarQualityIqiListParamsMetric = "BANDWIDTH" + RadarQualityIqiListParamsMetricDNS RadarQualityIqiListParamsMetric = "DNS" + RadarQualityIqiListParamsMetricLatency RadarQualityIqiListParamsMetric = "LATENCY" ) -type RadarQualityIqiGetParamsDateRange string +type RadarQualityIqiListParamsDateRange string const ( - RadarQualityIqiGetParamsDateRange1d RadarQualityIqiGetParamsDateRange = "1d" - RadarQualityIqiGetParamsDateRange2d RadarQualityIqiGetParamsDateRange = "2d" - RadarQualityIqiGetParamsDateRange7d RadarQualityIqiGetParamsDateRange = "7d" - RadarQualityIqiGetParamsDateRange14d RadarQualityIqiGetParamsDateRange = "14d" - RadarQualityIqiGetParamsDateRange28d RadarQualityIqiGetParamsDateRange = "28d" - RadarQualityIqiGetParamsDateRange12w RadarQualityIqiGetParamsDateRange = "12w" - RadarQualityIqiGetParamsDateRange24w RadarQualityIqiGetParamsDateRange = "24w" - RadarQualityIqiGetParamsDateRange52w RadarQualityIqiGetParamsDateRange = "52w" - RadarQualityIqiGetParamsDateRange1dControl RadarQualityIqiGetParamsDateRange = "1dControl" - RadarQualityIqiGetParamsDateRange2dControl RadarQualityIqiGetParamsDateRange = "2dControl" - RadarQualityIqiGetParamsDateRange7dControl RadarQualityIqiGetParamsDateRange = "7dControl" - RadarQualityIqiGetParamsDateRange14dControl RadarQualityIqiGetParamsDateRange = "14dControl" - RadarQualityIqiGetParamsDateRange28dControl RadarQualityIqiGetParamsDateRange = "28dControl" - RadarQualityIqiGetParamsDateRange12wControl RadarQualityIqiGetParamsDateRange = "12wControl" - RadarQualityIqiGetParamsDateRange24wControl RadarQualityIqiGetParamsDateRange = "24wControl" + RadarQualityIqiListParamsDateRange1d RadarQualityIqiListParamsDateRange = "1d" + RadarQualityIqiListParamsDateRange2d RadarQualityIqiListParamsDateRange = "2d" + RadarQualityIqiListParamsDateRange7d RadarQualityIqiListParamsDateRange = "7d" + RadarQualityIqiListParamsDateRange14d RadarQualityIqiListParamsDateRange = "14d" + RadarQualityIqiListParamsDateRange28d RadarQualityIqiListParamsDateRange = "28d" + RadarQualityIqiListParamsDateRange12w RadarQualityIqiListParamsDateRange = "12w" + RadarQualityIqiListParamsDateRange24w RadarQualityIqiListParamsDateRange = "24w" + RadarQualityIqiListParamsDateRange52w RadarQualityIqiListParamsDateRange = "52w" + RadarQualityIqiListParamsDateRange1dControl RadarQualityIqiListParamsDateRange = "1dControl" + RadarQualityIqiListParamsDateRange2dControl RadarQualityIqiListParamsDateRange = "2dControl" + RadarQualityIqiListParamsDateRange7dControl RadarQualityIqiListParamsDateRange = "7dControl" + RadarQualityIqiListParamsDateRange14dControl RadarQualityIqiListParamsDateRange = "14dControl" + RadarQualityIqiListParamsDateRange28dControl RadarQualityIqiListParamsDateRange = "28dControl" + RadarQualityIqiListParamsDateRange12wControl RadarQualityIqiListParamsDateRange = "12wControl" + RadarQualityIqiListParamsDateRange24wControl RadarQualityIqiListParamsDateRange = "24wControl" ) // Format results are returned in. -type RadarQualityIqiGetParamsFormat string +type RadarQualityIqiListParamsFormat string const ( - RadarQualityIqiGetParamsFormatJson RadarQualityIqiGetParamsFormat = "JSON" - RadarQualityIqiGetParamsFormatCsv RadarQualityIqiGetParamsFormat = "CSV" + RadarQualityIqiListParamsFormatJson RadarQualityIqiListParamsFormat = "JSON" + RadarQualityIqiListParamsFormatCsv RadarQualityIqiListParamsFormat = "CSV" ) -type RadarQualityIqiGetResponseEnvelope struct { - Result RadarQualityIqiGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarQualityIqiGetResponseEnvelopeJSON `json:"-"` +type RadarQualityIqiListResponseEnvelope struct { + Result RadarQualityIqiListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarQualityIqiListResponseEnvelopeJSON `json:"-"` } -// radarQualityIqiGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [RadarQualityIqiGetResponseEnvelope] -type radarQualityIqiGetResponseEnvelopeJSON struct { +// radarQualityIqiListResponseEnvelopeJSON contains the JSON metadata for the +// struct [RadarQualityIqiListResponseEnvelope] +type radarQualityIqiListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualityIqiGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualityIqiListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radarqualityiqi_test.go b/radarqualityiqi_test.go index 8b2730c921c..bdafdcd3f84 100644 --- a/radarqualityiqi_test.go +++ b/radarqualityiqi_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarQualityIqiGetWithOptionalParams(t *testing.T) { +func TestRadarQualityIqiListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,14 +30,14 @@ func TestRadarQualityIqiGetWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Quality.Iqi.Get(context.TODO(), cloudflare.RadarQualityIqiGetParams{ - Metric: cloudflare.F(cloudflare.RadarQualityIqiGetParamsMetricBandwidth), + _, err := client.Radar.Quality.Iqi.List(context.TODO(), cloudflare.RadarQualityIqiListParams{ + Metric: cloudflare.F(cloudflare.RadarQualityIqiListParamsMetricBandwidth), Asn: cloudflare.F([]string{"string", "string", "string"}), Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarQualityIqiGetParamsDateRange{cloudflare.RadarQualityIqiGetParamsDateRange1d, cloudflare.RadarQualityIqiGetParamsDateRange2d, cloudflare.RadarQualityIqiGetParamsDateRange7d}), + DateRange: cloudflare.F([]cloudflare.RadarQualityIqiListParamsDateRange{cloudflare.RadarQualityIqiListParamsDateRange1d, cloudflare.RadarQualityIqiListParamsDateRange2d, cloudflare.RadarQualityIqiListParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualityIqiGetParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarQualityIqiListParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), }) diff --git a/radarqualityspeedhistogram.go b/radarqualityspeedhistogram.go index b0e772acc34..4dfdfb6d464 100644 --- a/radarqualityspeedhistogram.go +++ b/radarqualityspeedhistogram.go @@ -35,9 +35,9 @@ func NewRadarQualitySpeedHistogramService(opts ...option.RequestOption) (r *Rada // Get an histogram from the previous 90 days of Cloudflare Speed Test data, split // into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets. -func (r *RadarQualitySpeedHistogramService) Get(ctx context.Context, query RadarQualitySpeedHistogramGetParams, opts ...option.RequestOption) (res *RadarQualitySpeedHistogramGetResponse, err error) { +func (r *RadarQualitySpeedHistogramService) List(ctx context.Context, query RadarQualitySpeedHistogramListParams, opts ...option.RequestOption) (res *RadarQualitySpeedHistogramListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarQualitySpeedHistogramGetResponseEnvelope + var env RadarQualitySpeedHistogramListResponseEnvelope path := "radar/quality/speed/histogram" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -47,35 +47,35 @@ func (r *RadarQualitySpeedHistogramService) Get(ctx context.Context, query Radar return } -type RadarQualitySpeedHistogramGetResponse struct { - Histogram0 RadarQualitySpeedHistogramGetResponseHistogram0 `json:"histogram_0,required"` - Meta interface{} `json:"meta,required"` - JSON radarQualitySpeedHistogramGetResponseJSON `json:"-"` +type RadarQualitySpeedHistogramListResponse struct { + Histogram0 RadarQualitySpeedHistogramListResponseHistogram0 `json:"histogram_0,required"` + Meta interface{} `json:"meta,required"` + JSON radarQualitySpeedHistogramListResponseJSON `json:"-"` } -// radarQualitySpeedHistogramGetResponseJSON contains the JSON metadata for the -// struct [RadarQualitySpeedHistogramGetResponse] -type radarQualitySpeedHistogramGetResponseJSON struct { +// radarQualitySpeedHistogramListResponseJSON contains the JSON metadata for the +// struct [RadarQualitySpeedHistogramListResponse] +type radarQualitySpeedHistogramListResponseJSON struct { Histogram0 apijson.Field Meta apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedHistogramGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedHistogramListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedHistogramGetResponseHistogram0 struct { - BandwidthDownload []string `json:"bandwidthDownload,required"` - BandwidthUpload []string `json:"bandwidthUpload,required"` - BucketMin []string `json:"bucketMin,required"` - JSON radarQualitySpeedHistogramGetResponseHistogram0JSON `json:"-"` +type RadarQualitySpeedHistogramListResponseHistogram0 struct { + BandwidthDownload []string `json:"bandwidthDownload,required"` + BandwidthUpload []string `json:"bandwidthUpload,required"` + BucketMin []string `json:"bucketMin,required"` + JSON radarQualitySpeedHistogramListResponseHistogram0JSON `json:"-"` } -// radarQualitySpeedHistogramGetResponseHistogram0JSON contains the JSON metadata -// for the struct [RadarQualitySpeedHistogramGetResponseHistogram0] -type radarQualitySpeedHistogramGetResponseHistogram0JSON struct { +// radarQualitySpeedHistogramListResponseHistogram0JSON contains the JSON metadata +// for the struct [RadarQualitySpeedHistogramListResponseHistogram0] +type radarQualitySpeedHistogramListResponseHistogram0JSON struct { BandwidthDownload apijson.Field BandwidthUpload apijson.Field BucketMin apijson.Field @@ -83,11 +83,11 @@ type radarQualitySpeedHistogramGetResponseHistogram0JSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedHistogramGetResponseHistogram0) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedHistogramListResponseHistogram0) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedHistogramGetParams struct { +type RadarQualitySpeedHistogramListParams struct { // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. @@ -97,20 +97,20 @@ type RadarQualitySpeedHistogramGetParams struct { // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. - Format param.Field[RadarQualitySpeedHistogramGetParamsFormat] `query:"format"` + Format param.Field[RadarQualitySpeedHistogramListParamsFormat] `query:"format"` // Array of comma separated list of locations (alpha-2 country codes). Start with // `-` to exclude from results. For example, `-US,PT` excludes results from the US, // but includes results from PT. Location param.Field[[]string] `query:"location"` // Metrics to be returned. - MetricGroup param.Field[RadarQualitySpeedHistogramGetParamsMetricGroup] `query:"metricGroup"` + MetricGroup param.Field[RadarQualitySpeedHistogramListParamsMetricGroup] `query:"metricGroup"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` } -// URLQuery serializes [RadarQualitySpeedHistogramGetParams]'s query parameters as +// URLQuery serializes [RadarQualitySpeedHistogramListParams]'s query parameters as // `url.Values`. -func (r RadarQualitySpeedHistogramGetParams) URLQuery() (v url.Values) { +func (r RadarQualitySpeedHistogramListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -118,37 +118,37 @@ func (r RadarQualitySpeedHistogramGetParams) URLQuery() (v url.Values) { } // Format results are returned in. -type RadarQualitySpeedHistogramGetParamsFormat string +type RadarQualitySpeedHistogramListParamsFormat string const ( - RadarQualitySpeedHistogramGetParamsFormatJson RadarQualitySpeedHistogramGetParamsFormat = "JSON" - RadarQualitySpeedHistogramGetParamsFormatCsv RadarQualitySpeedHistogramGetParamsFormat = "CSV" + RadarQualitySpeedHistogramListParamsFormatJson RadarQualitySpeedHistogramListParamsFormat = "JSON" + RadarQualitySpeedHistogramListParamsFormatCsv RadarQualitySpeedHistogramListParamsFormat = "CSV" ) // Metrics to be returned. -type RadarQualitySpeedHistogramGetParamsMetricGroup string +type RadarQualitySpeedHistogramListParamsMetricGroup string const ( - RadarQualitySpeedHistogramGetParamsMetricGroupBandwidth RadarQualitySpeedHistogramGetParamsMetricGroup = "BANDWIDTH" - RadarQualitySpeedHistogramGetParamsMetricGroupLatency RadarQualitySpeedHistogramGetParamsMetricGroup = "LATENCY" - RadarQualitySpeedHistogramGetParamsMetricGroupJitter RadarQualitySpeedHistogramGetParamsMetricGroup = "JITTER" + RadarQualitySpeedHistogramListParamsMetricGroupBandwidth RadarQualitySpeedHistogramListParamsMetricGroup = "BANDWIDTH" + RadarQualitySpeedHistogramListParamsMetricGroupLatency RadarQualitySpeedHistogramListParamsMetricGroup = "LATENCY" + RadarQualitySpeedHistogramListParamsMetricGroupJitter RadarQualitySpeedHistogramListParamsMetricGroup = "JITTER" ) -type RadarQualitySpeedHistogramGetResponseEnvelope struct { - Result RadarQualitySpeedHistogramGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarQualitySpeedHistogramGetResponseEnvelopeJSON `json:"-"` +type RadarQualitySpeedHistogramListResponseEnvelope struct { + Result RadarQualitySpeedHistogramListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarQualitySpeedHistogramListResponseEnvelopeJSON `json:"-"` } -// radarQualitySpeedHistogramGetResponseEnvelopeJSON contains the JSON metadata for -// the struct [RadarQualitySpeedHistogramGetResponseEnvelope] -type radarQualitySpeedHistogramGetResponseEnvelopeJSON struct { +// radarQualitySpeedHistogramListResponseEnvelopeJSON contains the JSON metadata +// for the struct [RadarQualitySpeedHistogramListResponseEnvelope] +type radarQualitySpeedHistogramListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedHistogramGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedHistogramListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radarqualityspeedhistogram_test.go b/radarqualityspeedhistogram_test.go index 5eae3a8041d..188a0029f71 100644 --- a/radarqualityspeedhistogram_test.go +++ b/radarqualityspeedhistogram_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarQualitySpeedHistogramGetWithOptionalParams(t *testing.T) { +func TestRadarQualitySpeedHistogramListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,13 +30,13 @@ func TestRadarQualitySpeedHistogramGetWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Quality.Speed.Histogram.Get(context.TODO(), cloudflare.RadarQualitySpeedHistogramGetParams{ + _, err := client.Radar.Quality.Speed.Histogram.List(context.TODO(), cloudflare.RadarQualitySpeedHistogramListParams{ Asn: cloudflare.F([]string{"string", "string", "string"}), BucketSize: cloudflare.F(int64(0)), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualitySpeedHistogramGetParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarQualitySpeedHistogramListParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), - MetricGroup: cloudflare.F(cloudflare.RadarQualitySpeedHistogramGetParamsMetricGroupBandwidth), + MetricGroup: cloudflare.F(cloudflare.RadarQualitySpeedHistogramListParamsMetricGroupBandwidth), Name: cloudflare.F([]string{"string", "string", "string"}), }) if err != nil { diff --git a/radarqualityspeedsummary.go b/radarqualityspeedsummary.go index ccff7021655..f34c067ff01 100644 --- a/radarqualityspeedsummary.go +++ b/radarqualityspeedsummary.go @@ -35,9 +35,9 @@ func NewRadarQualitySpeedSummaryService(opts ...option.RequestOption) (r *RadarQ // Get a summary of bandwidth, latency, jitter and packet loss, from the previous // 90 days of Cloudflare Speed Test data. -func (r *RadarQualitySpeedSummaryService) Get(ctx context.Context, query RadarQualitySpeedSummaryGetParams, opts ...option.RequestOption) (res *RadarQualitySpeedSummaryGetResponse, err error) { +func (r *RadarQualitySpeedSummaryService) List(ctx context.Context, query RadarQualitySpeedSummaryListParams, opts ...option.RequestOption) (res *RadarQualitySpeedSummaryListResponse, err error) { opts = append(r.Options[:], opts...) - var env RadarQualitySpeedSummaryGetResponseEnvelope + var env RadarQualitySpeedSummaryListResponseEnvelope path := "radar/quality/speed/summary" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -47,36 +47,36 @@ func (r *RadarQualitySpeedSummaryService) Get(ctx context.Context, query RadarQu return } -type RadarQualitySpeedSummaryGetResponse struct { - Meta RadarQualitySpeedSummaryGetResponseMeta `json:"meta,required"` - Summary0 RadarQualitySpeedSummaryGetResponseSummary0 `json:"summary_0,required"` - JSON radarQualitySpeedSummaryGetResponseJSON `json:"-"` +type RadarQualitySpeedSummaryListResponse struct { + Meta RadarQualitySpeedSummaryListResponseMeta `json:"meta,required"` + Summary0 RadarQualitySpeedSummaryListResponseSummary0 `json:"summary_0,required"` + JSON radarQualitySpeedSummaryListResponseJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseJSON contains the JSON metadata for the -// struct [RadarQualitySpeedSummaryGetResponse] -type radarQualitySpeedSummaryGetResponseJSON struct { +// radarQualitySpeedSummaryListResponseJSON contains the JSON metadata for the +// struct [RadarQualitySpeedSummaryListResponse] +type radarQualitySpeedSummaryListResponseJSON struct { Meta apijson.Field Summary0 apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetResponseMeta struct { - DateRange []RadarQualitySpeedSummaryGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - Normalization string `json:"normalization,required"` - ConfidenceInfo RadarQualitySpeedSummaryGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarQualitySpeedSummaryGetResponseMetaJSON `json:"-"` +type RadarQualitySpeedSummaryListResponseMeta struct { + DateRange []RadarQualitySpeedSummaryListResponseMetaDateRange `json:"dateRange,required"` + LastUpdated string `json:"lastUpdated,required"` + Normalization string `json:"normalization,required"` + ConfidenceInfo RadarQualitySpeedSummaryListResponseMetaConfidenceInfo `json:"confidenceInfo"` + JSON radarQualitySpeedSummaryListResponseMetaJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseMetaJSON contains the JSON metadata for the -// struct [RadarQualitySpeedSummaryGetResponseMeta] -type radarQualitySpeedSummaryGetResponseMetaJSON struct { +// radarQualitySpeedSummaryListResponseMetaJSON contains the JSON metadata for the +// struct [RadarQualitySpeedSummaryListResponseMeta] +type radarQualitySpeedSummaryListResponseMetaJSON struct { DateRange apijson.Field LastUpdated apijson.Field Normalization apijson.Field @@ -85,65 +85,65 @@ type radarQualitySpeedSummaryGetResponseMetaJSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseMeta) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseMeta) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetResponseMetaDateRange struct { +type RadarQualitySpeedSummaryListResponseMetaDateRange struct { // Adjusted end of date range. EndTime time.Time `json:"endTime,required" format:"date-time"` // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarQualitySpeedSummaryGetResponseMetaDateRangeJSON `json:"-"` + StartTime time.Time `json:"startTime,required" format:"date-time"` + JSON radarQualitySpeedSummaryListResponseMetaDateRangeJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseMetaDateRangeJSON contains the JSON metadata -// for the struct [RadarQualitySpeedSummaryGetResponseMetaDateRange] -type radarQualitySpeedSummaryGetResponseMetaDateRangeJSON struct { +// radarQualitySpeedSummaryListResponseMetaDateRangeJSON contains the JSON metadata +// for the struct [RadarQualitySpeedSummaryListResponseMetaDateRange] +type radarQualitySpeedSummaryListResponseMetaDateRangeJSON struct { EndTime apijson.Field StartTime apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetResponseMetaConfidenceInfo struct { - Annotations []RadarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarQualitySpeedSummaryGetResponseMetaConfidenceInfoJSON `json:"-"` +type RadarQualitySpeedSummaryListResponseMetaConfidenceInfo struct { + Annotations []RadarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotation `json:"annotations"` + Level int64 `json:"level"` + JSON radarQualitySpeedSummaryListResponseMetaConfidenceInfoJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct [RadarQualitySpeedSummaryGetResponseMetaConfidenceInfo] -type radarQualitySpeedSummaryGetResponseMetaConfidenceInfoJSON struct { +// radarQualitySpeedSummaryListResponseMetaConfidenceInfoJSON contains the JSON +// metadata for the struct [RadarQualitySpeedSummaryListResponseMetaConfidenceInfo] +type radarQualitySpeedSummaryListResponseMetaConfidenceInfoJSON struct { Annotations apijson.Field Level apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` +type RadarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotation struct { + DataSource string `json:"dataSource,required"` + Description string `json:"description,required"` + EventType string `json:"eventType,required"` + IsInstantaneous interface{} `json:"isInstantaneous,required"` + EndTime time.Time `json:"endTime" format:"date-time"` + LinkedURL string `json:"linkedUrl"` + StartTime time.Time `json:"startTime" format:"date-time"` + JSON radarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotationJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotationJSON contains the -// JSON metadata for the struct -// [RadarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotation] -type radarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotationJSON struct { +// radarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotationJSON contains +// the JSON metadata for the struct +// [RadarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotation] +type radarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotationJSON struct { DataSource apijson.Field Description apijson.Field EventType apijson.Field @@ -155,24 +155,24 @@ type radarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotationJSON struct ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetResponseSummary0 struct { - BandwidthDownload string `json:"bandwidthDownload,required"` - BandwidthUpload string `json:"bandwidthUpload,required"` - JitterIdle string `json:"jitterIdle,required"` - JitterLoaded string `json:"jitterLoaded,required"` - LatencyIdle string `json:"latencyIdle,required"` - LatencyLoaded string `json:"latencyLoaded,required"` - PacketLoss string `json:"packetLoss,required"` - JSON radarQualitySpeedSummaryGetResponseSummary0JSON `json:"-"` +type RadarQualitySpeedSummaryListResponseSummary0 struct { + BandwidthDownload string `json:"bandwidthDownload,required"` + BandwidthUpload string `json:"bandwidthUpload,required"` + JitterIdle string `json:"jitterIdle,required"` + JitterLoaded string `json:"jitterLoaded,required"` + LatencyIdle string `json:"latencyIdle,required"` + LatencyLoaded string `json:"latencyLoaded,required"` + PacketLoss string `json:"packetLoss,required"` + JSON radarQualitySpeedSummaryListResponseSummary0JSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseSummary0JSON contains the JSON metadata for -// the struct [RadarQualitySpeedSummaryGetResponseSummary0] -type radarQualitySpeedSummaryGetResponseSummary0JSON struct { +// radarQualitySpeedSummaryListResponseSummary0JSON contains the JSON metadata for +// the struct [RadarQualitySpeedSummaryListResponseSummary0] +type radarQualitySpeedSummaryListResponseSummary0JSON struct { BandwidthDownload apijson.Field BandwidthUpload apijson.Field JitterIdle apijson.Field @@ -184,11 +184,11 @@ type radarQualitySpeedSummaryGetResponseSummary0JSON struct { ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseSummary0) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseSummary0) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RadarQualitySpeedSummaryGetParams struct { +type RadarQualitySpeedSummaryListParams struct { // Array of comma separated list of ASNs, start with `-` to exclude from results. // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. @@ -196,7 +196,7 @@ type RadarQualitySpeedSummaryGetParams struct { // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. - Format param.Field[RadarQualitySpeedSummaryGetParamsFormat] `query:"format"` + Format param.Field[RadarQualitySpeedSummaryListParamsFormat] `query:"format"` // Array of comma separated list of locations (alpha-2 country codes). Start with // `-` to exclude from results. For example, `-US,PT` excludes results from the US, // but includes results from PT. @@ -205,9 +205,9 @@ type RadarQualitySpeedSummaryGetParams struct { Name param.Field[[]string] `query:"name"` } -// URLQuery serializes [RadarQualitySpeedSummaryGetParams]'s query parameters as +// URLQuery serializes [RadarQualitySpeedSummaryListParams]'s query parameters as // `url.Values`. -func (r RadarQualitySpeedSummaryGetParams) URLQuery() (v url.Values) { +func (r RadarQualitySpeedSummaryListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -215,28 +215,28 @@ func (r RadarQualitySpeedSummaryGetParams) URLQuery() (v url.Values) { } // Format results are returned in. -type RadarQualitySpeedSummaryGetParamsFormat string +type RadarQualitySpeedSummaryListParamsFormat string const ( - RadarQualitySpeedSummaryGetParamsFormatJson RadarQualitySpeedSummaryGetParamsFormat = "JSON" - RadarQualitySpeedSummaryGetParamsFormatCsv RadarQualitySpeedSummaryGetParamsFormat = "CSV" + RadarQualitySpeedSummaryListParamsFormatJson RadarQualitySpeedSummaryListParamsFormat = "JSON" + RadarQualitySpeedSummaryListParamsFormatCsv RadarQualitySpeedSummaryListParamsFormat = "CSV" ) -type RadarQualitySpeedSummaryGetResponseEnvelope struct { - Result RadarQualitySpeedSummaryGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarQualitySpeedSummaryGetResponseEnvelopeJSON `json:"-"` +type RadarQualitySpeedSummaryListResponseEnvelope struct { + Result RadarQualitySpeedSummaryListResponse `json:"result,required"` + Success bool `json:"success,required"` + JSON radarQualitySpeedSummaryListResponseEnvelopeJSON `json:"-"` } -// radarQualitySpeedSummaryGetResponseEnvelopeJSON contains the JSON metadata for -// the struct [RadarQualitySpeedSummaryGetResponseEnvelope] -type radarQualitySpeedSummaryGetResponseEnvelopeJSON struct { +// radarQualitySpeedSummaryListResponseEnvelopeJSON contains the JSON metadata for +// the struct [RadarQualitySpeedSummaryListResponseEnvelope] +type radarQualitySpeedSummaryListResponseEnvelopeJSON struct { Result apijson.Field Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RadarQualitySpeedSummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RadarQualitySpeedSummaryListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/radarqualityspeedsummary_test.go b/radarqualityspeedsummary_test.go index 836bb971813..5a51c392445 100644 --- a/radarqualityspeedsummary_test.go +++ b/radarqualityspeedsummary_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRadarQualitySpeedSummaryGetWithOptionalParams(t *testing.T) { +func TestRadarQualitySpeedSummaryListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,10 +30,10 @@ func TestRadarQualitySpeedSummaryGetWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Radar.Quality.Speed.Summary.Get(context.TODO(), cloudflare.RadarQualitySpeedSummaryGetParams{ + _, err := client.Radar.Quality.Speed.Summary.List(context.TODO(), cloudflare.RadarQualitySpeedSummaryListParams{ Asn: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualitySpeedSummaryGetParamsFormatJson), + Format: cloudflare.F(cloudflare.RadarQualitySpeedSummaryListParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), }) diff --git a/ratelimit.go b/ratelimit.go index 3dfd7633dfc..f13257b387f 100644 --- a/ratelimit.go +++ b/ratelimit.go @@ -35,6 +35,20 @@ func NewRateLimitService(opts ...option.RequestOption) (r *RateLimitService) { return } +// Creates a new rate limit for a zone. Refer to the object definition for a list +// of required attributes. +func (r *RateLimitService) New(ctx context.Context, zoneIdentifier string, body RateLimitNewParams, opts ...option.RequestOption) (res *RateLimitNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env RateLimitNewResponseEnvelope + path := fmt.Sprintf("zones/%s/rate_limits", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Updates an existing rate limit. func (r *RateLimitService) Update(ctx context.Context, zoneIdentifier string, id string, body RateLimitUpdateParams, opts ...option.RequestOption) (res *RateLimitUpdateResponse, err error) { opts = append(r.Options[:], opts...) @@ -71,6 +85,19 @@ func (r *RateLimitService) ListAutoPaging(ctx context.Context, zoneIdentifier st return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...)) } +// Deletes an existing rate limit. +func (r *RateLimitService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *RateLimitDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env RateLimitDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/rate_limits/%s", zoneIdentifier, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Fetches the details of a rate limit. func (r *RateLimitService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *RateLimitGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -84,6 +111,22 @@ func (r *RateLimitService) Get(ctx context.Context, zoneIdentifier string, id st return } +// Union satisfied by [RateLimitNewResponseUnknown] or [shared.UnionString]. +type RateLimitNewResponse interface { + ImplementsRateLimitNewResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*RateLimitNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + // Union satisfied by [RateLimitUpdateResponseUnknown] or [shared.UnionString]. type RateLimitUpdateResponse interface { ImplementsRateLimitUpdateResponse() @@ -365,6 +408,24 @@ func (r *RateLimitListResponseMatchResponse) UnmarshalJSON(data []byte) (err err return apijson.UnmarshalRoot(data, r) } +type RateLimitDeleteResponse struct { + // The unique identifier of the rate limit. + ID string `json:"id"` + JSON rateLimitDeleteResponseJSON `json:"-"` +} + +// rateLimitDeleteResponseJSON contains the JSON metadata for the struct +// [RateLimitDeleteResponse] +type rateLimitDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // Union satisfied by [RateLimitGetResponseUnknown] or [shared.UnionString]. type RateLimitGetResponse interface { ImplementsRateLimitGetResponse() @@ -381,6 +442,83 @@ func init() { ) } +type RateLimitNewParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RateLimitNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type RateLimitNewResponseEnvelope struct { + Errors []RateLimitNewResponseEnvelopeErrors `json:"errors,required"` + Messages []RateLimitNewResponseEnvelopeMessages `json:"messages,required"` + Result RateLimitNewResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success RateLimitNewResponseEnvelopeSuccess `json:"success,required"` + JSON rateLimitNewResponseEnvelopeJSON `json:"-"` +} + +// rateLimitNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RateLimitNewResponseEnvelope] +type rateLimitNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RateLimitNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON rateLimitNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// rateLimitNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RateLimitNewResponseEnvelopeErrors] +type rateLimitNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RateLimitNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON rateLimitNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// rateLimitNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RateLimitNewResponseEnvelopeMessages] +type rateLimitNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type RateLimitNewResponseEnvelopeSuccess bool + +const ( + RateLimitNewResponseEnvelopeSuccessTrue RateLimitNewResponseEnvelopeSuccess = true +) + type RateLimitUpdateParams struct { Body param.Field[interface{}] `json:"body,required"` } @@ -474,6 +612,75 @@ func (r RateLimitListParams) URLQuery() (v url.Values) { }) } +type RateLimitDeleteResponseEnvelope struct { + Errors []RateLimitDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []RateLimitDeleteResponseEnvelopeMessages `json:"messages,required"` + Result RateLimitDeleteResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success RateLimitDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON rateLimitDeleteResponseEnvelopeJSON `json:"-"` +} + +// rateLimitDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [RateLimitDeleteResponseEnvelope] +type rateLimitDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RateLimitDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON rateLimitDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// rateLimitDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RateLimitDeleteResponseEnvelopeErrors] +type rateLimitDeleteResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RateLimitDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON rateLimitDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// rateLimitDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RateLimitDeleteResponseEnvelopeMessages] +type rateLimitDeleteResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RateLimitDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type RateLimitDeleteResponseEnvelopeSuccess bool + +const ( + RateLimitDeleteResponseEnvelopeSuccessTrue RateLimitDeleteResponseEnvelopeSuccess = true +) + type RateLimitGetResponseEnvelope struct { Errors []RateLimitGetResponseEnvelopeErrors `json:"errors,required"` Messages []RateLimitGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/ratelimit_test.go b/ratelimit_test.go index 1ae77c5daa4..8bcbf0d1d17 100644 --- a/ratelimit_test.go +++ b/ratelimit_test.go @@ -13,6 +13,38 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) +func TestRateLimitNew(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.RateLimits.New( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.RateLimitNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestRateLimitUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -79,6 +111,36 @@ func TestRateLimitListWithOptionalParams(t *testing.T) { } } +func TestRateLimitDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.RateLimits.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "372e67954025e0ba6aaa6d586b9e0b59", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestRateLimitGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" diff --git a/registrardomain.go b/registrardomain.go index 0def85abdb1..1bedab93ff1 100644 --- a/registrardomain.go +++ b/registrardomain.go @@ -35,19 +35,6 @@ func NewRegistrarDomainService(opts ...option.RequestOption) (r *RegistrarDomain return } -// Update individual domain. -func (r *RegistrarDomainService) Update(ctx context.Context, accountID string, domainName string, body RegistrarDomainUpdateParams, opts ...option.RequestOption) (res *RegistrarDomainUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env RegistrarDomainUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/registrar/domains/%s", accountID, domainName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // List domains handled by Registrar. func (r *RegistrarDomainService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]RegistrarDomainListResponse, err error) { opts = append(r.Options[:], opts...) @@ -74,27 +61,19 @@ func (r *RegistrarDomainService) Get(ctx context.Context, accountID string, doma return } -// Union satisfied by [RegistrarDomainUpdateResponseUnknown], -// [RegistrarDomainUpdateResponseArray] or [shared.UnionString]. -type RegistrarDomainUpdateResponse interface { - ImplementsRegistrarDomainUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*RegistrarDomainUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Update individual domain. +func (r *RegistrarDomainService) Replace(ctx context.Context, accountID string, domainName string, body RegistrarDomainReplaceParams, opts ...option.RequestOption) (res *RegistrarDomainReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env RegistrarDomainReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/registrar/domains/%s", accountID, domainName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } -type RegistrarDomainUpdateResponseArray []interface{} - -func (r RegistrarDomainUpdateResponseArray) ImplementsRegistrarDomainUpdateResponse() {} - type RegistrarDomainListResponse struct { // Domain identifier. ID string `json:"id"` @@ -260,88 +239,26 @@ type RegistrarDomainGetResponseArray []interface{} func (r RegistrarDomainGetResponseArray) ImplementsRegistrarDomainGetResponse() {} -type RegistrarDomainUpdateParams struct { - // Auto-renew controls whether subscription is automatically renewed upon domain - // expiration. - AutoRenew param.Field[bool] `json:"auto_renew"` - // Shows whether a registrar lock is in place for a domain. - Locked param.Field[bool] `json:"locked"` - // Privacy option controls redacting WHOIS information. - Privacy param.Field[bool] `json:"privacy"` -} - -func (r RegistrarDomainUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type RegistrarDomainUpdateResponseEnvelope struct { - Errors []RegistrarDomainUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []RegistrarDomainUpdateResponseEnvelopeMessages `json:"messages,required"` - Result RegistrarDomainUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success RegistrarDomainUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON registrarDomainUpdateResponseEnvelopeJSON `json:"-"` -} - -// registrarDomainUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [RegistrarDomainUpdateResponseEnvelope] -type registrarDomainUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RegistrarDomainUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RegistrarDomainUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON registrarDomainUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// registrarDomainUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [RegistrarDomainUpdateResponseEnvelopeErrors] -type registrarDomainUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RegistrarDomainUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RegistrarDomainUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON registrarDomainUpdateResponseEnvelopeMessagesJSON `json:"-"` +// Union satisfied by [RegistrarDomainReplaceResponseUnknown], +// [RegistrarDomainReplaceResponseArray] or [shared.UnionString]. +type RegistrarDomainReplaceResponse interface { + ImplementsRegistrarDomainReplaceResponse() } -// registrarDomainUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [RegistrarDomainUpdateResponseEnvelopeMessages] -type registrarDomainUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RegistrarDomainUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*RegistrarDomainReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// Whether the API call was successful -type RegistrarDomainUpdateResponseEnvelopeSuccess bool +type RegistrarDomainReplaceResponseArray []interface{} -const ( - RegistrarDomainUpdateResponseEnvelopeSuccessTrue RegistrarDomainUpdateResponseEnvelopeSuccess = true -) +func (r RegistrarDomainReplaceResponseArray) ImplementsRegistrarDomainReplaceResponse() {} type RegistrarDomainListResponseEnvelope struct { Errors []RegistrarDomainListResponseEnvelopeErrors `json:"errors,required"` @@ -509,3 +426,86 @@ type RegistrarDomainGetResponseEnvelopeSuccess bool const ( RegistrarDomainGetResponseEnvelopeSuccessTrue RegistrarDomainGetResponseEnvelopeSuccess = true ) + +type RegistrarDomainReplaceParams struct { + // Auto-renew controls whether subscription is automatically renewed upon domain + // expiration. + AutoRenew param.Field[bool] `json:"auto_renew"` + // Shows whether a registrar lock is in place for a domain. + Locked param.Field[bool] `json:"locked"` + // Privacy option controls redacting WHOIS information. + Privacy param.Field[bool] `json:"privacy"` +} + +func (r RegistrarDomainReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type RegistrarDomainReplaceResponseEnvelope struct { + Errors []RegistrarDomainReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []RegistrarDomainReplaceResponseEnvelopeMessages `json:"messages,required"` + Result RegistrarDomainReplaceResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success RegistrarDomainReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON registrarDomainReplaceResponseEnvelopeJSON `json:"-"` +} + +// registrarDomainReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [RegistrarDomainReplaceResponseEnvelope] +type registrarDomainReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RegistrarDomainReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RegistrarDomainReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON registrarDomainReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// registrarDomainReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [RegistrarDomainReplaceResponseEnvelopeErrors] +type registrarDomainReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RegistrarDomainReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RegistrarDomainReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON registrarDomainReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// registrarDomainReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [RegistrarDomainReplaceResponseEnvelopeMessages] +type registrarDomainReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RegistrarDomainReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type RegistrarDomainReplaceResponseEnvelopeSuccess bool + +const ( + RegistrarDomainReplaceResponseEnvelopeSuccessTrue RegistrarDomainReplaceResponseEnvelopeSuccess = true +) diff --git a/registrardomain_test.go b/registrardomain_test.go index 20114c9219f..882876e0842 100644 --- a/registrardomain_test.go +++ b/registrardomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRegistrarDomainUpdateWithOptionalParams(t *testing.T) { +func TestRegistrarDomainList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,16 +29,7 @@ func TestRegistrarDomainUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Registrar.Domains.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "cloudflare.com", - cloudflare.RegistrarDomainUpdateParams{ - AutoRenew: cloudflare.F(true), - Locked: cloudflare.F(false), - Privacy: cloudflare.F(true), - }, - ) + _, err := client.Registrar.Domains.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -48,7 +39,7 @@ func TestRegistrarDomainUpdateWithOptionalParams(t *testing.T) { } } -func TestRegistrarDomainList(t *testing.T) { +func TestRegistrarDomainGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,7 +55,11 @@ func TestRegistrarDomainList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Registrar.Domains.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Registrar.Domains.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "cloudflare.com", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -74,7 +69,7 @@ func TestRegistrarDomainList(t *testing.T) { } } -func TestRegistrarDomainGet(t *testing.T) { +func TestRegistrarDomainReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -90,10 +85,15 @@ func TestRegistrarDomainGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Registrar.Domains.Get( + _, err := client.Registrar.Domains.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "cloudflare.com", + cloudflare.RegistrarDomainReplaceParams{ + AutoRenew: cloudflare.F(true), + Locked: cloudflare.F(false), + Privacy: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/requesttracertrace.go b/requesttracertrace.go index 5165f46f7a0..1a11c8d6717 100644 --- a/requesttracertrace.go +++ b/requesttracertrace.go @@ -3,14 +3,14 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - - "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/option" + "context" + "fmt" + "net/http" + + "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/option" ) // RequestTracerTraceService contains methods and other services that help with @@ -19,277 +19,189 @@ import ( // this service directly, and instead use the [NewRequestTracerTraceService] method // instead. type RequestTracerTraceService struct { - Options []option.RequestOption +Options []option.RequestOption } // NewRequestTracerTraceService generates a new service that applies the given // options to each request. These options are applied after the parent client's // options (if there is one), and before any request-specific options. func NewRequestTracerTraceService(opts ...option.RequestOption) (r *RequestTracerTraceService) { - r = &RequestTracerTraceService{} - r.Options = opts - return + r = &RequestTracerTraceService{} + r.Options = opts + return } // Request Trace func (r *RequestTracerTraceService) New(ctx context.Context, accountIdentifier string, body RequestTracerTraceNewParams, opts ...option.RequestOption) (res *RequestTracerTraceNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env RequestTracerTraceNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/request-tracer/trace", accountIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return + opts = append(r.Options[:], opts...) + var env RequestTracerTraceNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/request-tracer/trace", accountIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } +type 9301c7QsTrace []9301c7QsTrace + // Trace result with an origin status code type RequestTracerTraceNewResponse struct { - // HTTP Status code of zone response - StatusCode int64 `json:"status_code"` - Trace []RequestTracerTraceNewResponseTrace `json:"trace"` - JSON requestTracerTraceNewResponseJSON `json:"-"` +// HTTP Status code of zone response +StatusCode int64 `json:"status_code"` +Trace 9301c7QsTrace `json:"trace"` +JSON requestTracerTraceNewResponseJSON `json:"-"` } // requestTracerTraceNewResponseJSON contains the JSON metadata for the struct // [RequestTracerTraceNewResponse] type requestTracerTraceNewResponseJSON struct { - StatusCode apijson.Field - Trace apijson.Field - raw string - ExtraFields map[string]apijson.Field +StatusCode apijson.Field +Trace apijson.Field +raw string +ExtraFields map[string]apijson.Field } func (r *RequestTracerTraceNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// List of steps acting on request/response -type RequestTracerTraceNewResponseTrace struct { - // If step type is rule, then action performed by this rule - Action string `json:"action"` - // If step type is rule, then action parameters of this rule as JSON - ActionParameters interface{} `json:"action_parameters"` - // If step type is rule or ruleset, the description of this entity - Description string `json:"description"` - // If step type is rule, then expression used to match for this rule - Expression string `json:"expression"` - // If step type is ruleset, then kind of this ruleset - Kind string `json:"kind"` - // Whether tracing step affected tracing request/response - Matched bool `json:"matched"` - // If step type is ruleset, then name of this ruleset - Name string `json:"name"` - // Tracing step identifying name - StepName string `json:"step_name"` - Trace []RequestTracerTraceNewResponseTraceTrace `json:"trace"` - // Tracing step type - Type string `json:"type"` - JSON requestTracerTraceNewResponseTraceJSON `json:"-"` -} - -// requestTracerTraceNewResponseTraceJSON contains the JSON metadata for the struct -// [RequestTracerTraceNewResponseTrace] -type requestTracerTraceNewResponseTraceJSON struct { - Action apijson.Field - ActionParameters apijson.Field - Description apijson.Field - Expression apijson.Field - Kind apijson.Field - Matched apijson.Field - Name apijson.Field - StepName apijson.Field - Trace apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RequestTracerTraceNewResponseTrace) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// List of steps acting on request/response -type RequestTracerTraceNewResponseTraceTrace struct { - // If step type is rule, then action performed by this rule - Action string `json:"action"` - // If step type is rule, then action parameters of this rule as JSON - ActionParameters interface{} `json:"action_parameters"` - // If step type is rule or ruleset, the description of this entity - Description string `json:"description"` - // If step type is rule, then expression used to match for this rule - Expression string `json:"expression"` - // If step type is ruleset, then kind of this ruleset - Kind string `json:"kind"` - // Whether tracing step affected tracing request/response - Matched bool `json:"matched"` - // If step type is ruleset, then name of this ruleset - Name string `json:"name"` - // Tracing step identifying name - StepName string `json:"step_name"` - Trace interface{} `json:"trace"` - // Tracing step type - Type string `json:"type"` - JSON requestTracerTraceNewResponseTraceTraceJSON `json:"-"` -} - -// requestTracerTraceNewResponseTraceTraceJSON contains the JSON metadata for the -// struct [RequestTracerTraceNewResponseTraceTrace] -type requestTracerTraceNewResponseTraceTraceJSON struct { - Action apijson.Field - ActionParameters apijson.Field - Description apijson.Field - Expression apijson.Field - Kind apijson.Field - Matched apijson.Field - Name apijson.Field - StepName apijson.Field - Trace apijson.Field - Type apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RequestTracerTraceNewResponseTraceTrace) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) + return apijson.UnmarshalRoot(data, r) } type RequestTracerTraceNewParams struct { - // HTTP Method of tracing request - Method param.Field[string] `json:"method,required"` - // URL to which perform tracing request - URL param.Field[string] `json:"url,required"` - Body param.Field[RequestTracerTraceNewParamsBody] `json:"body"` - // Additional request parameters - Context param.Field[RequestTracerTraceNewParamsContext] `json:"context"` - // Cookies added to tracing request - Cookies param.Field[map[string]string] `json:"cookies"` - // Headers added to tracing request - Headers param.Field[map[string]string] `json:"headers"` - // HTTP Protocol of tracing request - Protocol param.Field[string] `json:"protocol"` - // Skip sending the request to the Origin server after all rules evaluation - SkipResponse param.Field[bool] `json:"skip_response"` +// HTTP Method of tracing request +Method param.Field[string] `json:"method,required"` +// URL to which perform tracing request +URL param.Field[string] `json:"url,required"` +Body param.Field[RequestTracerTraceNewParamsBody] `json:"body"` +// Additional request parameters +Context param.Field[RequestTracerTraceNewParamsContext] `json:"context"` +// Cookies added to tracing request +Cookies param.Field[map[string]string] `json:"cookies"` +// Headers added to tracing request +Headers param.Field[map[string]string] `json:"headers"` +// HTTP Protocol of tracing request +Protocol param.Field[string] `json:"protocol"` +// Skip sending the request to the Origin server after all rules evaluation +SkipResponse param.Field[bool] `json:"skip_response"` } func (r RequestTracerTraceNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) + return apijson.MarshalRoot(r) } type RequestTracerTraceNewParamsBody struct { - // Base64 encoded request body - Base64 param.Field[string] `json:"base64"` - // Arbitrary json as request body - Json param.Field[interface{}] `json:"json"` - // Request body as plain text - PlainText param.Field[string] `json:"plain_text"` +// Base64 encoded request body +Base64 param.Field[string] `json:"base64"` +// Arbitrary json as request body +Json param.Field[interface{}] `json:"json"` +// Request body as plain text +PlainText param.Field[string] `json:"plain_text"` } func (r RequestTracerTraceNewParamsBody) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) + return apijson.MarshalRoot(r) } // Additional request parameters type RequestTracerTraceNewParamsContext struct { - // Bot score used for evaluating tracing request processing - BotScore param.Field[int64] `json:"bot_score"` - // Geodata for tracing request - Geoloc param.Field[RequestTracerTraceNewParamsContextGeoloc] `json:"geoloc"` - // Whether to skip any challenges for tracing request (e.g.: captcha) - SkipChallenge param.Field[bool] `json:"skip_challenge"` - // Threat score used for evaluating tracing request processing - ThreatScore param.Field[int64] `json:"threat_score"` +// Bot score used for evaluating tracing request processing +BotScore param.Field[int64] `json:"bot_score"` +// Geodata for tracing request +Geoloc param.Field[RequestTracerTraceNewParamsContextGeoloc] `json:"geoloc"` +// Whether to skip any challenges for tracing request (e.g.: captcha) +SkipChallenge param.Field[bool] `json:"skip_challenge"` +// Threat score used for evaluating tracing request processing +ThreatScore param.Field[int64] `json:"threat_score"` } func (r RequestTracerTraceNewParamsContext) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) + return apijson.MarshalRoot(r) } // Geodata for tracing request type RequestTracerTraceNewParamsContextGeoloc struct { - City param.Field[string] `json:"city"` - Continent param.Field[string] `json:"continent"` - IsEuCountry param.Field[bool] `json:"is_eu_country"` - ISOCode param.Field[string] `json:"iso_code"` - Latitude param.Field[float64] `json:"latitude"` - Longitude param.Field[float64] `json:"longitude"` - PostalCode param.Field[string] `json:"postal_code"` - RegionCode param.Field[string] `json:"region_code"` - Subdivision2ISOCode param.Field[string] `json:"subdivision_2_iso_code"` - Timezone param.Field[string] `json:"timezone"` +City param.Field[string] `json:"city"` +Continent param.Field[string] `json:"continent"` +IsEuCountry param.Field[bool] `json:"is_eu_country"` +ISOCode param.Field[string] `json:"iso_code"` +Latitude param.Field[float64] `json:"latitude"` +Longitude param.Field[float64] `json:"longitude"` +PostalCode param.Field[string] `json:"postal_code"` +RegionCode param.Field[string] `json:"region_code"` +Subdivision2ISOCode param.Field[string] `json:"subdivision_2_iso_code"` +Timezone param.Field[string] `json:"timezone"` } func (r RequestTracerTraceNewParamsContextGeoloc) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) + return apijson.MarshalRoot(r) } type RequestTracerTraceNewResponseEnvelope struct { - Errors []RequestTracerTraceNewResponseEnvelopeErrors `json:"errors,required"` - Messages []RequestTracerTraceNewResponseEnvelopeMessages `json:"messages,required"` - // Trace result with an origin status code - Result RequestTracerTraceNewResponse `json:"result,required"` - // Whether the API call was successful - Success RequestTracerTraceNewResponseEnvelopeSuccess `json:"success,required"` - JSON requestTracerTraceNewResponseEnvelopeJSON `json:"-"` +Errors []RequestTracerTraceNewResponseEnvelopeErrors `json:"errors,required"` +Messages []RequestTracerTraceNewResponseEnvelopeMessages `json:"messages,required"` +// Trace result with an origin status code +Result RequestTracerTraceNewResponse `json:"result,required"` +// Whether the API call was successful +Success RequestTracerTraceNewResponseEnvelopeSuccess `json:"success,required"` +JSON requestTracerTraceNewResponseEnvelopeJSON `json:"-"` } // requestTracerTraceNewResponseEnvelopeJSON contains the JSON metadata for the // struct [RequestTracerTraceNewResponseEnvelope] type requestTracerTraceNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field +Errors apijson.Field +Messages apijson.Field +Result apijson.Field +Success apijson.Field +raw string +ExtraFields map[string]apijson.Field } func (r *RequestTracerTraceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) + return apijson.UnmarshalRoot(data, r) } type RequestTracerTraceNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON requestTracerTraceNewResponseEnvelopeErrorsJSON `json:"-"` +Code int64 `json:"code,required"` +Message string `json:"message,required"` +JSON requestTracerTraceNewResponseEnvelopeErrorsJSON `json:"-"` } // requestTracerTraceNewResponseEnvelopeErrorsJSON contains the JSON metadata for // the struct [RequestTracerTraceNewResponseEnvelopeErrors] type requestTracerTraceNewResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +Code apijson.Field +Message apijson.Field +raw string +ExtraFields map[string]apijson.Field } func (r *RequestTracerTraceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) + return apijson.UnmarshalRoot(data, r) } type RequestTracerTraceNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON requestTracerTraceNewResponseEnvelopeMessagesJSON `json:"-"` +Code int64 `json:"code,required"` +Message string `json:"message,required"` +JSON requestTracerTraceNewResponseEnvelopeMessagesJSON `json:"-"` } // requestTracerTraceNewResponseEnvelopeMessagesJSON contains the JSON metadata for // the struct [RequestTracerTraceNewResponseEnvelopeMessages] type requestTracerTraceNewResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +Code apijson.Field +Message apijson.Field +raw string +ExtraFields map[string]apijson.Field } func (r *RequestTracerTraceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) + return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful type RequestTracerTraceNewResponseEnvelopeSuccess bool const ( - RequestTracerTraceNewResponseEnvelopeSuccessTrue RequestTracerTraceNewResponseEnvelopeSuccess = true + RequestTracerTraceNewResponseEnvelopeSuccessTrue RequestTracerTraceNewResponseEnvelopeSuccess = true ) diff --git a/role.go b/role.go index c5f10ceb5d4..e2264c67ec6 100644 --- a/role.go +++ b/role.go @@ -33,9 +33,9 @@ func NewRoleService(opts ...option.RequestOption) (r *RoleService) { } // Get all available roles for an account. -func (r *RoleService) AccountRolesListRoles(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]RoleAccountRolesListRolesResponse, err error) { +func (r *RoleService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]RoleListResponse, err error) { opts = append(r.Options[:], opts...) - var env RoleAccountRolesListRolesResponseEnvelope + var env RoleListResponseEnvelope path := fmt.Sprintf("accounts/%v/roles", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -58,7 +58,7 @@ func (r *RoleService) Get(ctx context.Context, accountID interface{}, roleID int return } -type RoleAccountRolesListRolesResponse struct { +type RoleListResponse struct { // Role identifier tag. ID string `json:"id,required"` // Description of role's permissions. @@ -66,13 +66,13 @@ type RoleAccountRolesListRolesResponse struct { // Role Name. Name string `json:"name,required"` // Access permissions for this User. - Permissions []string `json:"permissions,required"` - JSON roleAccountRolesListRolesResponseJSON `json:"-"` + Permissions []string `json:"permissions,required"` + JSON roleListResponseJSON `json:"-"` } -// roleAccountRolesListRolesResponseJSON contains the JSON metadata for the struct -// [RoleAccountRolesListRolesResponse] -type roleAccountRolesListRolesResponseJSON struct { +// roleListResponseJSON contains the JSON metadata for the struct +// [RoleListResponse] +type roleListResponseJSON struct { ID apijson.Field Description apijson.Field Name apijson.Field @@ -81,7 +81,7 @@ type roleAccountRolesListRolesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RoleAccountRolesListRolesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RoleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -101,19 +101,19 @@ func init() { ) } -type RoleAccountRolesListRolesResponseEnvelope struct { - Errors []RoleAccountRolesListRolesResponseEnvelopeErrors `json:"errors,required"` - Messages []RoleAccountRolesListRolesResponseEnvelopeMessages `json:"messages,required"` - Result []RoleAccountRolesListRolesResponse `json:"result,required,nullable"` +type RoleListResponseEnvelope struct { + Errors []RoleListResponseEnvelopeErrors `json:"errors,required"` + Messages []RoleListResponseEnvelopeMessages `json:"messages,required"` + Result []RoleListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RoleAccountRolesListRolesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo RoleAccountRolesListRolesResponseEnvelopeResultInfo `json:"result_info"` - JSON roleAccountRolesListRolesResponseEnvelopeJSON `json:"-"` + Success RoleListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo RoleListResponseEnvelopeResultInfo `json:"result_info"` + JSON roleListResponseEnvelopeJSON `json:"-"` } -// roleAccountRolesListRolesResponseEnvelopeJSON contains the JSON metadata for the -// struct [RoleAccountRolesListRolesResponseEnvelope] -type roleAccountRolesListRolesResponseEnvelopeJSON struct { +// roleListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RoleListResponseEnvelope] +type roleListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -123,56 +123,56 @@ type roleAccountRolesListRolesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RoleAccountRolesListRolesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RoleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RoleAccountRolesListRolesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON roleAccountRolesListRolesResponseEnvelopeErrorsJSON `json:"-"` +type RoleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON roleListResponseEnvelopeErrorsJSON `json:"-"` } -// roleAccountRolesListRolesResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [RoleAccountRolesListRolesResponseEnvelopeErrors] -type roleAccountRolesListRolesResponseEnvelopeErrorsJSON struct { +// roleListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RoleListResponseEnvelopeErrors] +type roleListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RoleAccountRolesListRolesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RoleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RoleAccountRolesListRolesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON roleAccountRolesListRolesResponseEnvelopeMessagesJSON `json:"-"` +type RoleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON roleListResponseEnvelopeMessagesJSON `json:"-"` } -// roleAccountRolesListRolesResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [RoleAccountRolesListRolesResponseEnvelopeMessages] -type roleAccountRolesListRolesResponseEnvelopeMessagesJSON struct { +// roleListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [RoleListResponseEnvelopeMessages] +type roleListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RoleAccountRolesListRolesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RoleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RoleAccountRolesListRolesResponseEnvelopeSuccess bool +type RoleListResponseEnvelopeSuccess bool const ( - RoleAccountRolesListRolesResponseEnvelopeSuccessTrue RoleAccountRolesListRolesResponseEnvelopeSuccess = true + RoleListResponseEnvelopeSuccessTrue RoleListResponseEnvelopeSuccess = true ) -type RoleAccountRolesListRolesResponseEnvelopeResultInfo struct { +type RoleListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -180,13 +180,13 @@ type RoleAccountRolesListRolesResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON roleAccountRolesListRolesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON roleListResponseEnvelopeResultInfoJSON `json:"-"` } -// roleAccountRolesListRolesResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [RoleAccountRolesListRolesResponseEnvelopeResultInfo] -type roleAccountRolesListRolesResponseEnvelopeResultInfoJSON struct { +// roleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct +// [RoleListResponseEnvelopeResultInfo] +type roleListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -195,7 +195,7 @@ type roleAccountRolesListRolesResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *RoleAccountRolesListRolesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *RoleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/role_test.go b/role_test.go index 912d105b4b6..768bb20d1a1 100644 --- a/role_test.go +++ b/role_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRoleAccountRolesListRoles(t *testing.T) { +func TestRoleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestRoleAccountRolesListRoles(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Roles.AccountRolesListRoles(context.TODO(), map[string]interface{}{}) + _, err := client.Roles.List(context.TODO(), map[string]interface{}{}) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/rulelist.go b/rulelist.go index b79e1ace632..c7e31812281 100644 --- a/rulelist.go +++ b/rulelist.go @@ -34,12 +34,25 @@ func NewRuleListService(opts ...option.RequestOption) (r *RuleListService) { return } -// Updates the description of a list. -func (r *RuleListService) Update(ctx context.Context, accountID string, listID string, body RuleListUpdateParams, opts ...option.RequestOption) (res *[]RuleListUpdateResponse, err error) { +// Creates a new list of the specified type. +func (r *RuleListService) New(ctx context.Context, accountID string, body RuleListNewParams, opts ...option.RequestOption) (res *[]RuleListNewResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists/%s", accountID, listID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env RuleListNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/rules/lists", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Fetches all lists in the account. +func (r *RuleListService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]RuleListListResponse, err error) { + opts = append(r.Options[:], opts...) + var env RuleListListResponseEnvelope + path := fmt.Sprintf("accounts/%s/rules/lists", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,25 +86,12 @@ func (r *RuleListService) Get(ctx context.Context, accountID string, listID stri return } -// Creates a new list of the specified type. -func (r *RuleListService) ListsNewAList(ctx context.Context, accountID string, body RuleListListsNewAListParams, opts ...option.RequestOption) (res *[]RuleListListsNewAListResponse, err error) { - opts = append(r.Options[:], opts...) - var env RuleListListsNewAListResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Fetches all lists in the account. -func (r *RuleListService) ListsGetLists(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]RuleListListsGetListsResponse, err error) { +// Updates the description of a list. +func (r *RuleListService) Replace(ctx context.Context, accountID string, listID string, body RuleListReplaceParams, opts ...option.RequestOption) (res *[]RuleListReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListListsGetListsResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env RuleListReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/rules/lists/%s", accountID, listID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -99,38 +99,16 @@ func (r *RuleListService) ListsGetLists(ctx context.Context, accountID string, o return } -type RuleListUpdateResponse = interface{} - -type RuleListDeleteResponse struct { - // The unique ID of the item in the List. - ID string `json:"id"` - JSON ruleListDeleteResponseJSON `json:"-"` -} - -// ruleListDeleteResponseJSON contains the JSON metadata for the struct -// [RuleListDeleteResponse] -type ruleListDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RuleListGetResponse = interface{} - -type RuleListListsNewAListResponse = interface{} +type RuleListNewResponse = interface{} -type RuleListListsGetListsResponse struct { +type RuleListListResponse struct { // The unique ID of the list. ID string `json:"id,required"` // The RFC 3339 timestamp of when the list was created. CreatedOn string `json:"created_on,required"` // The type of the list. Each type supports specific list items (IP addresses, // ASNs, hostnames or redirects). - Kind RuleListListsGetListsResponseKind `json:"kind,required"` + Kind RuleListListResponseKind `json:"kind,required"` // The RFC 3339 timestamp of when the list was last modified. ModifiedOn string `json:"modified_on,required"` // An informative name for the list. Use this name in filter and rule expressions. @@ -140,13 +118,13 @@ type RuleListListsGetListsResponse struct { // An informative summary of the list. Description string `json:"description"` // The number of [filters](/operations/filters-list-filters) referencing the list. - NumReferencingFilters float64 `json:"num_referencing_filters"` - JSON ruleListListsGetListsResponseJSON `json:"-"` + NumReferencingFilters float64 `json:"num_referencing_filters"` + JSON ruleListListResponseJSON `json:"-"` } -// ruleListListsGetListsResponseJSON contains the JSON metadata for the struct -// [RuleListListsGetListsResponse] -type ruleListListsGetListsResponseJSON struct { +// ruleListListResponseJSON contains the JSON metadata for the struct +// [RuleListListResponse] +type ruleListListResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Kind apijson.Field @@ -159,42 +137,80 @@ type ruleListListsGetListsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListListsGetListsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of the list. Each type supports specific list items (IP addresses, // ASNs, hostnames or redirects). -type RuleListListsGetListsResponseKind string +type RuleListListResponseKind string const ( - RuleListListsGetListsResponseKindIP RuleListListsGetListsResponseKind = "ip" - RuleListListsGetListsResponseKindRedirect RuleListListsGetListsResponseKind = "redirect" - RuleListListsGetListsResponseKindHostname RuleListListsGetListsResponseKind = "hostname" - RuleListListsGetListsResponseKindAsn RuleListListsGetListsResponseKind = "asn" + RuleListListResponseKindIP RuleListListResponseKind = "ip" + RuleListListResponseKindRedirect RuleListListResponseKind = "redirect" + RuleListListResponseKindHostname RuleListListResponseKind = "hostname" + RuleListListResponseKindAsn RuleListListResponseKind = "asn" ) -type RuleListUpdateParams struct { +type RuleListDeleteResponse struct { + // The unique ID of the item in the List. + ID string `json:"id"` + JSON ruleListDeleteResponseJSON `json:"-"` +} + +// ruleListDeleteResponseJSON contains the JSON metadata for the struct +// [RuleListDeleteResponse] +type ruleListDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RuleListDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RuleListGetResponse = interface{} + +type RuleListReplaceResponse = interface{} + +type RuleListNewParams struct { + // The type of the list. Each type supports specific list items (IP addresses, + // ASNs, hostnames or redirects). + Kind param.Field[RuleListNewParamsKind] `json:"kind,required"` + // An informative name for the list. Use this name in filter and rule expressions. + Name param.Field[string] `json:"name,required"` // An informative summary of the list. Description param.Field[string] `json:"description"` } -func (r RuleListUpdateParams) MarshalJSON() (data []byte, err error) { +func (r RuleListNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RuleListUpdateResponseEnvelope struct { - Errors []RuleListUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []RuleListUpdateResponse `json:"result,required,nullable"` +// The type of the list. Each type supports specific list items (IP addresses, +// ASNs, hostnames or redirects). +type RuleListNewParamsKind string + +const ( + RuleListNewParamsKindIP RuleListNewParamsKind = "ip" + RuleListNewParamsKindRedirect RuleListNewParamsKind = "redirect" + RuleListNewParamsKindHostname RuleListNewParamsKind = "hostname" + RuleListNewParamsKindAsn RuleListNewParamsKind = "asn" +) + +type RuleListNewResponseEnvelope struct { + Errors []RuleListNewResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListNewResponseEnvelopeMessages `json:"messages,required"` + Result []RuleListNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListUpdateResponseEnvelopeJSON `json:"-"` + Success RuleListNewResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListNewResponseEnvelopeJSON `json:"-"` } -// ruleListUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [RuleListUpdateResponseEnvelope] -type ruleListUpdateResponseEnvelopeJSON struct { +// ruleListNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListNewResponseEnvelope] +type ruleListNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -203,53 +219,122 @@ type ruleListUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListUpdateResponseEnvelopeErrorsJSON `json:"-"` +type RuleListNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListNewResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RuleListUpdateResponseEnvelopeErrors] -type ruleListUpdateResponseEnvelopeErrorsJSON struct { +// ruleListNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RuleListNewResponseEnvelopeErrors] +type ruleListNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListUpdateResponseEnvelopeMessagesJSON `json:"-"` +type RuleListNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListNewResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RuleListUpdateResponseEnvelopeMessages] -type ruleListUpdateResponseEnvelopeMessagesJSON struct { +// ruleListNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListNewResponseEnvelopeMessages] +type ruleListNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListUpdateResponseEnvelopeSuccess bool +type RuleListNewResponseEnvelopeSuccess bool const ( - RuleListUpdateResponseEnvelopeSuccessTrue RuleListUpdateResponseEnvelopeSuccess = true + RuleListNewResponseEnvelopeSuccessTrue RuleListNewResponseEnvelopeSuccess = true +) + +type RuleListListResponseEnvelope struct { + Errors []RuleListListResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListListResponseEnvelopeMessages `json:"messages,required"` + Result []RuleListListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success RuleListListResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListListResponseEnvelopeJSON `json:"-"` +} + +// ruleListListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListListResponseEnvelope] +type ruleListListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RuleListListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RuleListListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListListResponseEnvelopeErrorsJSON `json:"-"` +} + +// ruleListListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RuleListListResponseEnvelopeErrors] +type ruleListListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RuleListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RuleListListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListListResponseEnvelopeMessagesJSON `json:"-"` +} + +// ruleListListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListListResponseEnvelopeMessages] +type ruleListListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RuleListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type RuleListListResponseEnvelopeSuccess bool + +const ( + RuleListListResponseEnvelopeSuccessTrue RuleListListResponseEnvelopeSuccess = true ) type RuleListDeleteResponseEnvelope struct { @@ -390,112 +475,27 @@ const ( RuleListGetResponseEnvelopeSuccessTrue RuleListGetResponseEnvelopeSuccess = true ) -type RuleListListsNewAListParams struct { - // The type of the list. Each type supports specific list items (IP addresses, - // ASNs, hostnames or redirects). - Kind param.Field[RuleListListsNewAListParamsKind] `json:"kind,required"` - // An informative name for the list. Use this name in filter and rule expressions. - Name param.Field[string] `json:"name,required"` +type RuleListReplaceParams struct { // An informative summary of the list. Description param.Field[string] `json:"description"` } -func (r RuleListListsNewAListParams) MarshalJSON() (data []byte, err error) { +func (r RuleListReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// The type of the list. Each type supports specific list items (IP addresses, -// ASNs, hostnames or redirects). -type RuleListListsNewAListParamsKind string - -const ( - RuleListListsNewAListParamsKindIP RuleListListsNewAListParamsKind = "ip" - RuleListListsNewAListParamsKindRedirect RuleListListsNewAListParamsKind = "redirect" - RuleListListsNewAListParamsKindHostname RuleListListsNewAListParamsKind = "hostname" - RuleListListsNewAListParamsKindAsn RuleListListsNewAListParamsKind = "asn" -) - -type RuleListListsNewAListResponseEnvelope struct { - Errors []RuleListListsNewAListResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListListsNewAListResponseEnvelopeMessages `json:"messages,required"` - Result []RuleListListsNewAListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success RuleListListsNewAListResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListListsNewAListResponseEnvelopeJSON `json:"-"` -} - -// ruleListListsNewAListResponseEnvelopeJSON contains the JSON metadata for the -// struct [RuleListListsNewAListResponseEnvelope] -type ruleListListsNewAListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListListsNewAListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RuleListListsNewAListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListListsNewAListResponseEnvelopeErrorsJSON `json:"-"` -} - -// ruleListListsNewAListResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [RuleListListsNewAListResponseEnvelopeErrors] -type ruleListListsNewAListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListListsNewAListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RuleListListsNewAListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListListsNewAListResponseEnvelopeMessagesJSON `json:"-"` -} - -// ruleListListsNewAListResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [RuleListListsNewAListResponseEnvelopeMessages] -type ruleListListsNewAListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListListsNewAListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type RuleListListsNewAListResponseEnvelopeSuccess bool - -const ( - RuleListListsNewAListResponseEnvelopeSuccessTrue RuleListListsNewAListResponseEnvelopeSuccess = true -) - -type RuleListListsGetListsResponseEnvelope struct { - Errors []RuleListListsGetListsResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListListsGetListsResponseEnvelopeMessages `json:"messages,required"` - Result []RuleListListsGetListsResponse `json:"result,required,nullable"` +type RuleListReplaceResponseEnvelope struct { + Errors []RuleListReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []RuleListReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListListsGetListsResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListListsGetListsResponseEnvelopeJSON `json:"-"` + Success RuleListReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListReplaceResponseEnvelopeJSON `json:"-"` } -// ruleListListsGetListsResponseEnvelopeJSON contains the JSON metadata for the -// struct [RuleListListsGetListsResponseEnvelope] -type ruleListListsGetListsResponseEnvelopeJSON struct { +// ruleListReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListReplaceResponseEnvelope] +type ruleListReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -504,51 +504,51 @@ type ruleListListsGetListsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListListsGetListsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListListsGetListsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListListsGetListsResponseEnvelopeErrorsJSON `json:"-"` +type RuleListReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListListsGetListsResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [RuleListListsGetListsResponseEnvelopeErrors] -type ruleListListsGetListsResponseEnvelopeErrorsJSON struct { +// ruleListReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListReplaceResponseEnvelopeErrors] +type ruleListReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListListsGetListsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListListsGetListsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListListsGetListsResponseEnvelopeMessagesJSON `json:"-"` +type RuleListReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListListsGetListsResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [RuleListListsGetListsResponseEnvelopeMessages] -type ruleListListsGetListsResponseEnvelopeMessagesJSON struct { +// ruleListReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListReplaceResponseEnvelopeMessages] +type ruleListReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListListsGetListsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListListsGetListsResponseEnvelopeSuccess bool +type RuleListReplaceResponseEnvelopeSuccess bool const ( - RuleListListsGetListsResponseEnvelopeSuccessTrue RuleListListsGetListsResponseEnvelopeSuccess = true + RuleListReplaceResponseEnvelopeSuccessTrue RuleListReplaceResponseEnvelopeSuccess = true ) diff --git a/rulelist_test.go b/rulelist_test.go index b6a828e251e..666021978f8 100644 --- a/rulelist_test.go +++ b/rulelist_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRuleListUpdateWithOptionalParams(t *testing.T) { +func TestRuleListNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,12 @@ func TestRuleListUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Update( + _, err := client.Rules.Lists.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "2c0fc9fa937b11eaa1b71c4d701ab86e", - cloudflare.RuleListUpdateParams{ + cloudflare.RuleListNewParams{ + Kind: cloudflare.F(cloudflare.RuleListNewParamsKindIP), + Name: cloudflare.F("list1"), Description: cloudflare.F("This is a note"), }, ) @@ -46,7 +47,7 @@ func TestRuleListUpdateWithOptionalParams(t *testing.T) { } } -func TestRuleListDelete(t *testing.T) { +func TestRuleListList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,11 +63,7 @@ func TestRuleListDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "2c0fc9fa937b11eaa1b71c4d701ab86e", - ) + _, err := client.Rules.Lists.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -76,7 +73,7 @@ func TestRuleListDelete(t *testing.T) { } } -func TestRuleListGet(t *testing.T) { +func TestRuleListDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -92,7 +89,7 @@ func TestRuleListGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Get( + _, err := client.Rules.Lists.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", @@ -106,7 +103,7 @@ func TestRuleListGet(t *testing.T) { } } -func TestRuleListListsNewAListWithOptionalParams(t *testing.T) { +func TestRuleListGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -122,14 +119,10 @@ func TestRuleListListsNewAListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.ListsNewAList( + _, err := client.Rules.Lists.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.RuleListListsNewAListParams{ - Kind: cloudflare.F(cloudflare.RuleListListsNewAListParamsKindIP), - Name: cloudflare.F("list1"), - Description: cloudflare.F("This is a note"), - }, + "2c0fc9fa937b11eaa1b71c4d701ab86e", ) if err != nil { var apierr *cloudflare.Error @@ -140,7 +133,7 @@ func TestRuleListListsNewAListWithOptionalParams(t *testing.T) { } } -func TestRuleListListsGetLists(t *testing.T) { +func TestRuleListReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -156,7 +149,14 @@ func TestRuleListListsGetLists(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.ListsGetLists(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Rules.Lists.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "2c0fc9fa937b11eaa1b71c4d701ab86e", + cloudflare.RuleListReplaceParams{ + Description: cloudflare.F("This is a note"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/rulelistitem.go b/rulelistitem.go index 0baca77ea46..e1f55a7ae02 100644 --- a/rulelistitem.go +++ b/rulelistitem.go @@ -36,16 +36,16 @@ func NewRuleListItemService(opts ...option.RequestOption) (r *RuleListItemServic return } -// Removes one or more items from a list. +// Appends new items to the list. // // This operation is asynchronous. To get current the operation status, invoke the // [Get bulk operation status](/operations/lists-get-bulk-operation-status) // endpoint with the returned `operation_id`. -func (r *RuleListItemService) Delete(ctx context.Context, accountID string, listID string, body RuleListItemDeleteParams, opts ...option.RequestOption) (res *RuleListItemDeleteResponse, err error) { +func (r *RuleListItemService) New(ctx context.Context, accountID string, listID string, body RuleListItemNewParams, opts ...option.RequestOption) (res *RuleListItemNewResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListItemDeleteResponseEnvelope + var env RuleListItemNewResponseEnvelope path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", accountID, listID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -53,12 +53,12 @@ func (r *RuleListItemService) Delete(ctx context.Context, accountID string, list return } -// Fetches a list item in the list. -func (r *RuleListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *RuleListItemGetResponse, err error) { +// Fetches all the items in the list. +func (r *RuleListItemService) List(ctx context.Context, accountID string, listID string, query RuleListItemListParams, opts ...option.RequestOption) (res *[]RuleListItemListResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListItemGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists/%s/items/%s", accountIdentifier, listID, itemID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env RuleListItemListResponseEnvelope + path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", accountID, listID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -66,16 +66,16 @@ func (r *RuleListItemService) Get(ctx context.Context, accountIdentifier string, return } -// Appends new items to the list. +// Removes one or more items from a list. // // This operation is asynchronous. To get current the operation status, invoke the // [Get bulk operation status](/operations/lists-get-bulk-operation-status) // endpoint with the returned `operation_id`. -func (r *RuleListItemService) ListsNewListItems(ctx context.Context, accountID string, listID string, body RuleListItemListsNewListItemsParams, opts ...option.RequestOption) (res *RuleListItemListsNewListItemsResponse, err error) { +func (r *RuleListItemService) Delete(ctx context.Context, accountID string, listID string, body RuleListItemDeleteParams, opts ...option.RequestOption) (res *RuleListItemDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListItemListsNewListItemsResponseEnvelope + var env RuleListItemDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", accountID, listID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) if err != nil { return } @@ -83,12 +83,12 @@ func (r *RuleListItemService) ListsNewListItems(ctx context.Context, accountID s return } -// Fetches all the items in the list. -func (r *RuleListItemService) ListsGetListItems(ctx context.Context, accountID string, listID string, query RuleListItemListsGetListItemsParams, opts ...option.RequestOption) (res *[]RuleListItemListsGetListItemsResponse, err error) { +// Fetches a list item in the list. +func (r *RuleListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *RuleListItemGetResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListItemListsGetListItemsResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", accountID, listID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env RuleListItemGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/rules/lists/%s/items/%s", accountIdentifier, listID, itemID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -102,9 +102,9 @@ func (r *RuleListItemService) ListsGetListItems(ctx context.Context, accountID s // This operation is asynchronous. To get current the operation status, invoke the // [Get bulk operation status](/operations/lists-get-bulk-operation-status) // endpoint with the returned `operation_id`. -func (r *RuleListItemService) ListsUpdateAllListItems(ctx context.Context, accountID string, listID string, body RuleListItemListsUpdateAllListItemsParams, opts ...option.RequestOption) (res *RuleListItemListsUpdateAllListItemsResponse, err error) { +func (r *RuleListItemService) Replace(ctx context.Context, accountID string, listID string, body RuleListItemReplaceParams, opts ...option.RequestOption) (res *RuleListItemReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env RuleListItemListsUpdateAllListItemsResponseEnvelope + var env RuleListItemReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", accountID, listID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -114,6 +114,26 @@ func (r *RuleListItemService) ListsUpdateAllListItems(ctx context.Context, accou return } +type RuleListItemNewResponse struct { + // The unique operation ID of the asynchronous action. + OperationID string `json:"operation_id"` + JSON ruleListItemNewResponseJSON `json:"-"` +} + +// ruleListItemNewResponseJSON contains the JSON metadata for the struct +// [RuleListItemNewResponse] +type ruleListItemNewResponseJSON struct { + OperationID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RuleListItemNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RuleListItemListResponse = interface{} + type RuleListItemDeleteResponse struct { // The unique operation ID of the asynchronous action. OperationID string `json:"operation_id"` @@ -219,73 +239,97 @@ func (r *RuleListItemGetResponseListsItemHostname) UnmarshalJSON(data []byte) (e func (r RuleListItemGetResponseListsItemHostname) ImplementsRuleListItemGetResponse() {} -type RuleListItemListsNewListItemsResponse struct { +type RuleListItemReplaceResponse struct { // The unique operation ID of the asynchronous action. - OperationID string `json:"operation_id"` - JSON ruleListItemListsNewListItemsResponseJSON `json:"-"` + OperationID string `json:"operation_id"` + JSON ruleListItemReplaceResponseJSON `json:"-"` } -// ruleListItemListsNewListItemsResponseJSON contains the JSON metadata for the -// struct [RuleListItemListsNewListItemsResponse] -type ruleListItemListsNewListItemsResponseJSON struct { +// ruleListItemReplaceResponseJSON contains the JSON metadata for the struct +// [RuleListItemReplaceResponse] +type ruleListItemReplaceResponseJSON struct { OperationID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsNewListItemsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsGetListItemsResponse = interface{} +type RuleListItemNewParams struct { + Body param.Field[[]RuleListItemNewParamsBody] `json:"body,required"` +} -type RuleListItemListsUpdateAllListItemsResponse struct { - // The unique operation ID of the asynchronous action. - OperationID string `json:"operation_id"` - JSON ruleListItemListsUpdateAllListItemsResponseJSON `json:"-"` +func (r RuleListItemNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } -// ruleListItemListsUpdateAllListItemsResponseJSON contains the JSON metadata for -// the struct [RuleListItemListsUpdateAllListItemsResponse] -type ruleListItemListsUpdateAllListItemsResponseJSON struct { - OperationID apijson.Field - raw string - ExtraFields map[string]apijson.Field +type RuleListItemNewParamsBody struct { + // A non-negative 32 bit integer + Asn param.Field[int64] `json:"asn"` + // An informative summary of the list item. + Comment param.Field[string] `json:"comment"` + // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + // 0 to 9, wildcards (\*), and the hyphen (-). + Hostname param.Field[RuleListItemNewParamsBodyHostname] `json:"hostname"` + // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a + // maximum of /64. + IP param.Field[string] `json:"ip"` + // The definition of the redirect. + Redirect param.Field[RuleListItemNewParamsBodyRedirect] `json:"redirect"` } -func (r *RuleListItemListsUpdateAllListItemsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r RuleListItemNewParamsBody) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type RuleListItemDeleteParams struct { - Items param.Field[[]RuleListItemDeleteParamsItem] `json:"items"` +// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from +// 0 to 9, wildcards (\*), and the hyphen (-). +type RuleListItemNewParamsBodyHostname struct { + URLHostname param.Field[string] `json:"url_hostname,required"` } -func (r RuleListItemDeleteParams) MarshalJSON() (data []byte, err error) { +func (r RuleListItemNewParamsBodyHostname) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RuleListItemDeleteParamsItem struct { - // The unique ID of the item in the List. - ID param.Field[string] `json:"id"` +// The definition of the redirect. +type RuleListItemNewParamsBodyRedirect struct { + SourceURL param.Field[string] `json:"source_url,required"` + TargetURL param.Field[string] `json:"target_url,required"` + IncludeSubdomains param.Field[bool] `json:"include_subdomains"` + PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` + PreserveQueryString param.Field[bool] `json:"preserve_query_string"` + StatusCode param.Field[RuleListItemNewParamsBodyRedirectStatusCode] `json:"status_code"` + SubpathMatching param.Field[bool] `json:"subpath_matching"` } -func (r RuleListItemDeleteParamsItem) MarshalJSON() (data []byte, err error) { +func (r RuleListItemNewParamsBodyRedirect) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RuleListItemDeleteResponseEnvelope struct { - Errors []RuleListItemDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListItemDeleteResponseEnvelopeMessages `json:"messages,required"` - Result RuleListItemDeleteResponse `json:"result,required,nullable"` +type RuleListItemNewParamsBodyRedirectStatusCode int64 + +const ( + RuleListItemNewParamsBodyRedirectStatusCode301 RuleListItemNewParamsBodyRedirectStatusCode = 301 + RuleListItemNewParamsBodyRedirectStatusCode302 RuleListItemNewParamsBodyRedirectStatusCode = 302 + RuleListItemNewParamsBodyRedirectStatusCode307 RuleListItemNewParamsBodyRedirectStatusCode = 307 + RuleListItemNewParamsBodyRedirectStatusCode308 RuleListItemNewParamsBodyRedirectStatusCode = 308 +) + +type RuleListItemNewResponseEnvelope struct { + Errors []RuleListItemNewResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListItemNewResponseEnvelopeMessages `json:"messages,required"` + Result RuleListItemNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListItemDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListItemDeleteResponseEnvelopeJSON `json:"-"` + Success RuleListItemNewResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListItemNewResponseEnvelopeJSON `json:"-"` } -// ruleListItemDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [RuleListItemDeleteResponseEnvelope] -type ruleListItemDeleteResponseEnvelopeJSON struct { +// ruleListItemNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListItemNewResponseEnvelope] +type ruleListItemNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -294,199 +338,214 @@ type ruleListItemDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListItemDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemDeleteResponseEnvelopeErrorsJSON `json:"-"` +type RuleListItemNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemNewResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListItemDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RuleListItemDeleteResponseEnvelopeErrors] -type ruleListItemDeleteResponseEnvelopeErrorsJSON struct { +// ruleListItemNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListItemNewResponseEnvelopeErrors] +type ruleListItemNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemDeleteResponseEnvelopeMessagesJSON `json:"-"` +type RuleListItemNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemNewResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListItemDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [RuleListItemDeleteResponseEnvelopeMessages] -type ruleListItemDeleteResponseEnvelopeMessagesJSON struct { +// ruleListItemNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListItemNewResponseEnvelopeMessages] +type ruleListItemNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListItemDeleteResponseEnvelopeSuccess bool +type RuleListItemNewResponseEnvelopeSuccess bool const ( - RuleListItemDeleteResponseEnvelopeSuccessTrue RuleListItemDeleteResponseEnvelopeSuccess = true + RuleListItemNewResponseEnvelopeSuccessTrue RuleListItemNewResponseEnvelopeSuccess = true ) -type RuleListItemGetResponseEnvelope struct { - Errors []RuleListItemGetResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListItemGetResponseEnvelopeMessages `json:"messages,required"` - // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - // maximum of /64. - Result RuleListItemGetResponse `json:"result,required,nullable"` +type RuleListItemListParams struct { + // The pagination cursor. An opaque string token indicating the position from which + // to continue when requesting the next/previous set of records. Cursor values are + // provided under `result_info.cursors` in the response. You should make no + // assumptions about a cursor's content or length. + Cursor param.Field[string] `query:"cursor"` + // Amount of results to include in each paginated response. A non-negative 32 bit + // integer. + PerPage param.Field[int64] `query:"per_page"` + // A search query to filter returned items. Its meaning depends on the list type: + // IP addresses must start with the provided string, hostnames and bulk redirects + // must contain the string, and ASNs must match the string exactly. + Search param.Field[string] `query:"search"` +} + +// URLQuery serializes [RuleListItemListParams]'s query parameters as `url.Values`. +func (r RuleListItemListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type RuleListItemListResponseEnvelope struct { + Errors []RuleListItemListResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListItemListResponseEnvelopeMessages `json:"messages,required"` + Result []RuleListItemListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListItemGetResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListItemGetResponseEnvelopeJSON `json:"-"` + Success RuleListItemListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo RuleListItemListResponseEnvelopeResultInfo `json:"result_info"` + JSON ruleListItemListResponseEnvelopeJSON `json:"-"` } -// ruleListItemGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [RuleListItemGetResponseEnvelope] -type ruleListItemGetResponseEnvelopeJSON struct { +// ruleListItemListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListItemListResponseEnvelope] +type ruleListItemListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemGetResponseEnvelopeErrorsJSON `json:"-"` +type RuleListItemListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemListResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListItemGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RuleListItemGetResponseEnvelopeErrors] -type ruleListItemGetResponseEnvelopeErrorsJSON struct { +// ruleListItemListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListItemListResponseEnvelopeErrors] +type ruleListItemListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemGetResponseEnvelopeMessagesJSON `json:"-"` +type RuleListItemListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemListResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListItemGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RuleListItemGetResponseEnvelopeMessages] -type ruleListItemGetResponseEnvelopeMessagesJSON struct { +// ruleListItemListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListItemListResponseEnvelopeMessages] +type ruleListItemListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListItemGetResponseEnvelopeSuccess bool +type RuleListItemListResponseEnvelopeSuccess bool const ( - RuleListItemGetResponseEnvelopeSuccessTrue RuleListItemGetResponseEnvelopeSuccess = true + RuleListItemListResponseEnvelopeSuccessTrue RuleListItemListResponseEnvelopeSuccess = true ) -type RuleListItemListsNewListItemsParams struct { - Body param.Field[[]RuleListItemListsNewListItemsParamsBody] `json:"body,required"` +type RuleListItemListResponseEnvelopeResultInfo struct { + Cursors RuleListItemListResponseEnvelopeResultInfoCursors `json:"cursors"` + JSON ruleListItemListResponseEnvelopeResultInfoJSON `json:"-"` } -func (r RuleListItemListsNewListItemsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) +// ruleListItemListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [RuleListItemListResponseEnvelopeResultInfo] +type ruleListItemListResponseEnvelopeResultInfoJSON struct { + Cursors apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type RuleListItemListsNewListItemsParamsBody struct { - // A non-negative 32 bit integer - Asn param.Field[int64] `json:"asn"` - // An informative summary of the list item. - Comment param.Field[string] `json:"comment"` - // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - // 0 to 9, wildcards (\*), and the hyphen (-). - Hostname param.Field[RuleListItemListsNewListItemsParamsBodyHostname] `json:"hostname"` - // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - // maximum of /64. - IP param.Field[string] `json:"ip"` - // The definition of the redirect. - Redirect param.Field[RuleListItemListsNewListItemsParamsBodyRedirect] `json:"redirect"` +func (r *RuleListItemListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -func (r RuleListItemListsNewListItemsParamsBody) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type RuleListItemListResponseEnvelopeResultInfoCursors struct { + After string `json:"after"` + Before string `json:"before"` + JSON ruleListItemListResponseEnvelopeResultInfoCursorsJSON `json:"-"` } -// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from -// 0 to 9, wildcards (\*), and the hyphen (-). -type RuleListItemListsNewListItemsParamsBodyHostname struct { - URLHostname param.Field[string] `json:"url_hostname,required"` +// ruleListItemListResponseEnvelopeResultInfoCursorsJSON contains the JSON metadata +// for the struct [RuleListItemListResponseEnvelopeResultInfoCursors] +type ruleListItemListResponseEnvelopeResultInfoCursorsJSON struct { + After apijson.Field + Before apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r RuleListItemListsNewListItemsParamsBodyHostname) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *RuleListItemListResponseEnvelopeResultInfoCursors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// The definition of the redirect. -type RuleListItemListsNewListItemsParamsBodyRedirect struct { - SourceURL param.Field[string] `json:"source_url,required"` - TargetURL param.Field[string] `json:"target_url,required"` - IncludeSubdomains param.Field[bool] `json:"include_subdomains"` - PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` - PreserveQueryString param.Field[bool] `json:"preserve_query_string"` - StatusCode param.Field[RuleListItemListsNewListItemsParamsBodyRedirectStatusCode] `json:"status_code"` - SubpathMatching param.Field[bool] `json:"subpath_matching"` +type RuleListItemDeleteParams struct { + Items param.Field[[]RuleListItemDeleteParamsItem] `json:"items"` } -func (r RuleListItemListsNewListItemsParamsBodyRedirect) MarshalJSON() (data []byte, err error) { +func (r RuleListItemDeleteParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RuleListItemListsNewListItemsParamsBodyRedirectStatusCode int64 +type RuleListItemDeleteParamsItem struct { + // The unique ID of the item in the List. + ID param.Field[string] `json:"id"` +} -const ( - RuleListItemListsNewListItemsParamsBodyRedirectStatusCode301 RuleListItemListsNewListItemsParamsBodyRedirectStatusCode = 301 - RuleListItemListsNewListItemsParamsBodyRedirectStatusCode302 RuleListItemListsNewListItemsParamsBodyRedirectStatusCode = 302 - RuleListItemListsNewListItemsParamsBodyRedirectStatusCode307 RuleListItemListsNewListItemsParamsBodyRedirectStatusCode = 307 - RuleListItemListsNewListItemsParamsBodyRedirectStatusCode308 RuleListItemListsNewListItemsParamsBodyRedirectStatusCode = 308 -) +func (r RuleListItemDeleteParamsItem) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} -type RuleListItemListsNewListItemsResponseEnvelope struct { - Errors []RuleListItemListsNewListItemsResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListItemListsNewListItemsResponseEnvelopeMessages `json:"messages,required"` - Result RuleListItemListsNewListItemsResponse `json:"result,required,nullable"` +type RuleListItemDeleteResponseEnvelope struct { + Errors []RuleListItemDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListItemDeleteResponseEnvelopeMessages `json:"messages,required"` + Result RuleListItemDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListItemListsNewListItemsResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListItemListsNewListItemsResponseEnvelopeJSON `json:"-"` + Success RuleListItemDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListItemDeleteResponseEnvelopeJSON `json:"-"` } -// ruleListItemListsNewListItemsResponseEnvelopeJSON contains the JSON metadata for -// the struct [RuleListItemListsNewListItemsResponseEnvelope] -type ruleListItemListsNewListItemsResponseEnvelopeJSON struct { +// ruleListItemDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListItemDeleteResponseEnvelope] +type ruleListItemDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -495,261 +554,199 @@ type ruleListItemListsNewListItemsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsNewListItemsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsNewListItemsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsNewListItemsResponseEnvelopeErrorsJSON `json:"-"` +type RuleListItemDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListItemListsNewListItemsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [RuleListItemListsNewListItemsResponseEnvelopeErrors] -type ruleListItemListsNewListItemsResponseEnvelopeErrorsJSON struct { +// ruleListItemDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListItemDeleteResponseEnvelopeErrors] +type ruleListItemDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsNewListItemsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsNewListItemsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsNewListItemsResponseEnvelopeMessagesJSON `json:"-"` +type RuleListItemDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListItemListsNewListItemsResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [RuleListItemListsNewListItemsResponseEnvelopeMessages] -type ruleListItemListsNewListItemsResponseEnvelopeMessagesJSON struct { +// ruleListItemDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [RuleListItemDeleteResponseEnvelopeMessages] +type ruleListItemDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsNewListItemsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListItemListsNewListItemsResponseEnvelopeSuccess bool +type RuleListItemDeleteResponseEnvelopeSuccess bool const ( - RuleListItemListsNewListItemsResponseEnvelopeSuccessTrue RuleListItemListsNewListItemsResponseEnvelopeSuccess = true + RuleListItemDeleteResponseEnvelopeSuccessTrue RuleListItemDeleteResponseEnvelopeSuccess = true ) -type RuleListItemListsGetListItemsParams struct { - // The pagination cursor. An opaque string token indicating the position from which - // to continue when requesting the next/previous set of records. Cursor values are - // provided under `result_info.cursors` in the response. You should make no - // assumptions about a cursor's content or length. - Cursor param.Field[string] `query:"cursor"` - // Amount of results to include in each paginated response. A non-negative 32 bit - // integer. - PerPage param.Field[int64] `query:"per_page"` - // A search query to filter returned items. Its meaning depends on the list type: - // IP addresses must start with the provided string, hostnames and bulk redirects - // must contain the string, and ASNs must match the string exactly. - Search param.Field[string] `query:"search"` -} - -// URLQuery serializes [RuleListItemListsGetListItemsParams]'s query parameters as -// `url.Values`. -func (r RuleListItemListsGetListItemsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type RuleListItemListsGetListItemsResponseEnvelope struct { - Errors []RuleListItemListsGetListItemsResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListItemListsGetListItemsResponseEnvelopeMessages `json:"messages,required"` - Result []RuleListItemListsGetListItemsResponse `json:"result,required,nullable"` +type RuleListItemGetResponseEnvelope struct { + Errors []RuleListItemGetResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListItemGetResponseEnvelopeMessages `json:"messages,required"` + // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a + // maximum of /64. + Result RuleListItemGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListItemListsGetListItemsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo RuleListItemListsGetListItemsResponseEnvelopeResultInfo `json:"result_info"` - JSON ruleListItemListsGetListItemsResponseEnvelopeJSON `json:"-"` + Success RuleListItemGetResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListItemGetResponseEnvelopeJSON `json:"-"` } -// ruleListItemListsGetListItemsResponseEnvelopeJSON contains the JSON metadata for -// the struct [RuleListItemListsGetListItemsResponseEnvelope] -type ruleListItemListsGetListItemsResponseEnvelopeJSON struct { +// ruleListItemGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [RuleListItemGetResponseEnvelope] +type ruleListItemGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsGetListItemsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsGetListItemsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsGetListItemsResponseEnvelopeErrorsJSON `json:"-"` +type RuleListItemGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemGetResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListItemListsGetListItemsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [RuleListItemListsGetListItemsResponseEnvelopeErrors] -type ruleListItemListsGetListItemsResponseEnvelopeErrorsJSON struct { +// ruleListItemGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListItemGetResponseEnvelopeErrors] +type ruleListItemGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsGetListItemsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsGetListItemsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsGetListItemsResponseEnvelopeMessagesJSON `json:"-"` +type RuleListItemGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemGetResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListItemListsGetListItemsResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [RuleListItemListsGetListItemsResponseEnvelopeMessages] -type ruleListItemListsGetListItemsResponseEnvelopeMessagesJSON struct { +// ruleListItemGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RuleListItemGetResponseEnvelopeMessages] +type ruleListItemGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsGetListItemsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListItemListsGetListItemsResponseEnvelopeSuccess bool +type RuleListItemGetResponseEnvelopeSuccess bool const ( - RuleListItemListsGetListItemsResponseEnvelopeSuccessTrue RuleListItemListsGetListItemsResponseEnvelopeSuccess = true + RuleListItemGetResponseEnvelopeSuccessTrue RuleListItemGetResponseEnvelopeSuccess = true ) -type RuleListItemListsGetListItemsResponseEnvelopeResultInfo struct { - Cursors RuleListItemListsGetListItemsResponseEnvelopeResultInfoCursors `json:"cursors"` - JSON ruleListItemListsGetListItemsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// ruleListItemListsGetListItemsResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct -// [RuleListItemListsGetListItemsResponseEnvelopeResultInfo] -type ruleListItemListsGetListItemsResponseEnvelopeResultInfoJSON struct { - Cursors apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListItemListsGetListItemsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RuleListItemListsGetListItemsResponseEnvelopeResultInfoCursors struct { - After string `json:"after"` - Before string `json:"before"` - JSON ruleListItemListsGetListItemsResponseEnvelopeResultInfoCursorsJSON `json:"-"` -} - -// ruleListItemListsGetListItemsResponseEnvelopeResultInfoCursorsJSON contains the -// JSON metadata for the struct -// [RuleListItemListsGetListItemsResponseEnvelopeResultInfoCursors] -type ruleListItemListsGetListItemsResponseEnvelopeResultInfoCursorsJSON struct { - After apijson.Field - Before apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RuleListItemListsGetListItemsResponseEnvelopeResultInfoCursors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RuleListItemListsUpdateAllListItemsParams struct { - Body param.Field[[]RuleListItemListsUpdateAllListItemsParamsBody] `json:"body,required"` +type RuleListItemReplaceParams struct { + Body param.Field[[]RuleListItemReplaceParamsBody] `json:"body,required"` } -func (r RuleListItemListsUpdateAllListItemsParams) MarshalJSON() (data []byte, err error) { +func (r RuleListItemReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type RuleListItemListsUpdateAllListItemsParamsBody struct { +type RuleListItemReplaceParamsBody struct { // A non-negative 32 bit integer Asn param.Field[int64] `json:"asn"` // An informative summary of the list item. Comment param.Field[string] `json:"comment"` // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from // 0 to 9, wildcards (\*), and the hyphen (-). - Hostname param.Field[RuleListItemListsUpdateAllListItemsParamsBodyHostname] `json:"hostname"` + Hostname param.Field[RuleListItemReplaceParamsBodyHostname] `json:"hostname"` // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a // maximum of /64. IP param.Field[string] `json:"ip"` // The definition of the redirect. - Redirect param.Field[RuleListItemListsUpdateAllListItemsParamsBodyRedirect] `json:"redirect"` + Redirect param.Field[RuleListItemReplaceParamsBodyRedirect] `json:"redirect"` } -func (r RuleListItemListsUpdateAllListItemsParamsBody) MarshalJSON() (data []byte, err error) { +func (r RuleListItemReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from // 0 to 9, wildcards (\*), and the hyphen (-). -type RuleListItemListsUpdateAllListItemsParamsBodyHostname struct { +type RuleListItemReplaceParamsBodyHostname struct { URLHostname param.Field[string] `json:"url_hostname,required"` } -func (r RuleListItemListsUpdateAllListItemsParamsBodyHostname) MarshalJSON() (data []byte, err error) { +func (r RuleListItemReplaceParamsBodyHostname) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The definition of the redirect. -type RuleListItemListsUpdateAllListItemsParamsBodyRedirect struct { - SourceURL param.Field[string] `json:"source_url,required"` - TargetURL param.Field[string] `json:"target_url,required"` - IncludeSubdomains param.Field[bool] `json:"include_subdomains"` - PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` - PreserveQueryString param.Field[bool] `json:"preserve_query_string"` - StatusCode param.Field[RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode] `json:"status_code"` - SubpathMatching param.Field[bool] `json:"subpath_matching"` +type RuleListItemReplaceParamsBodyRedirect struct { + SourceURL param.Field[string] `json:"source_url,required"` + TargetURL param.Field[string] `json:"target_url,required"` + IncludeSubdomains param.Field[bool] `json:"include_subdomains"` + PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` + PreserveQueryString param.Field[bool] `json:"preserve_query_string"` + StatusCode param.Field[RuleListItemReplaceParamsBodyRedirectStatusCode] `json:"status_code"` + SubpathMatching param.Field[bool] `json:"subpath_matching"` } -func (r RuleListItemListsUpdateAllListItemsParamsBodyRedirect) MarshalJSON() (data []byte, err error) { +func (r RuleListItemReplaceParamsBodyRedirect) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode int64 +type RuleListItemReplaceParamsBodyRedirectStatusCode int64 const ( - RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode301 RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode = 301 - RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode302 RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode = 302 - RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode307 RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode = 307 - RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode308 RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode = 308 + RuleListItemReplaceParamsBodyRedirectStatusCode301 RuleListItemReplaceParamsBodyRedirectStatusCode = 301 + RuleListItemReplaceParamsBodyRedirectStatusCode302 RuleListItemReplaceParamsBodyRedirectStatusCode = 302 + RuleListItemReplaceParamsBodyRedirectStatusCode307 RuleListItemReplaceParamsBodyRedirectStatusCode = 307 + RuleListItemReplaceParamsBodyRedirectStatusCode308 RuleListItemReplaceParamsBodyRedirectStatusCode = 308 ) -type RuleListItemListsUpdateAllListItemsResponseEnvelope struct { - Errors []RuleListItemListsUpdateAllListItemsResponseEnvelopeErrors `json:"errors,required"` - Messages []RuleListItemListsUpdateAllListItemsResponseEnvelopeMessages `json:"messages,required"` - Result RuleListItemListsUpdateAllListItemsResponse `json:"result,required,nullable"` +type RuleListItemReplaceResponseEnvelope struct { + Errors []RuleListItemReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []RuleListItemReplaceResponseEnvelopeMessages `json:"messages,required"` + Result RuleListItemReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success RuleListItemListsUpdateAllListItemsResponseEnvelopeSuccess `json:"success,required"` - JSON ruleListItemListsUpdateAllListItemsResponseEnvelopeJSON `json:"-"` + Success RuleListItemReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON ruleListItemReplaceResponseEnvelopeJSON `json:"-"` } -// ruleListItemListsUpdateAllListItemsResponseEnvelopeJSON contains the JSON -// metadata for the struct [RuleListItemListsUpdateAllListItemsResponseEnvelope] -type ruleListItemListsUpdateAllListItemsResponseEnvelopeJSON struct { +// ruleListItemReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [RuleListItemReplaceResponseEnvelope] +type ruleListItemReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -758,53 +755,51 @@ type ruleListItemListsUpdateAllListItemsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsUpdateAllListItemsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsUpdateAllListItemsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsUpdateAllListItemsResponseEnvelopeErrorsJSON `json:"-"` +type RuleListItemReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// ruleListItemListsUpdateAllListItemsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [RuleListItemListsUpdateAllListItemsResponseEnvelopeErrors] -type ruleListItemListsUpdateAllListItemsResponseEnvelopeErrorsJSON struct { +// ruleListItemReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RuleListItemReplaceResponseEnvelopeErrors] +type ruleListItemReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsUpdateAllListItemsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RuleListItemListsUpdateAllListItemsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON ruleListItemListsUpdateAllListItemsResponseEnvelopeMessagesJSON `json:"-"` +type RuleListItemReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON ruleListItemReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// ruleListItemListsUpdateAllListItemsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [RuleListItemListsUpdateAllListItemsResponseEnvelopeMessages] -type ruleListItemListsUpdateAllListItemsResponseEnvelopeMessagesJSON struct { +// ruleListItemReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [RuleListItemReplaceResponseEnvelopeMessages] +type ruleListItemReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RuleListItemListsUpdateAllListItemsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RuleListItemReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type RuleListItemListsUpdateAllListItemsResponseEnvelopeSuccess bool +type RuleListItemReplaceResponseEnvelopeSuccess bool const ( - RuleListItemListsUpdateAllListItemsResponseEnvelopeSuccessTrue RuleListItemListsUpdateAllListItemsResponseEnvelopeSuccess = true + RuleListItemReplaceResponseEnvelopeSuccessTrue RuleListItemReplaceResponseEnvelopeSuccess = true ) diff --git a/rulelistitem_test.go b/rulelistitem_test.go index fb59e0ea525..e9432275e52 100644 --- a/rulelistitem_test.go +++ b/rulelistitem_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRuleListItemDeleteWithOptionalParams(t *testing.T) { +func TestRuleListItemNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,59 @@ func TestRuleListItemDeleteWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Items.Delete( + _, err := client.Rules.Lists.Items.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", - cloudflare.RuleListItemDeleteParams{ - Items: cloudflare.F([]cloudflare.RuleListItemDeleteParamsItem{{ - ID: cloudflare.F("34b12448945f11eaa1b71c4d701ab86e"), + cloudflare.RuleListItemNewParams{ + Body: cloudflare.F([]cloudflare.RuleListItemNewParamsBody{{ + Asn: cloudflare.F(int64(5567)), + Comment: cloudflare.F("Private IP address"), + Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{ + URLHostname: cloudflare.F("example.com"), + }), + IP: cloudflare.F("10.0.0.1"), + Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{ + IncludeSubdomains: cloudflare.F(true), + PreservePathSuffix: cloudflare.F(true), + PreserveQueryString: cloudflare.F(true), + SourceURL: cloudflare.F("example.com/arch"), + StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301), + SubpathMatching: cloudflare.F(true), + TargetURL: cloudflare.F("https://archlinux.org/"), + }), + }, { + Asn: cloudflare.F(int64(5567)), + Comment: cloudflare.F("Private IP address"), + Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{ + URLHostname: cloudflare.F("example.com"), + }), + IP: cloudflare.F("10.0.0.1"), + Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{ + IncludeSubdomains: cloudflare.F(true), + PreservePathSuffix: cloudflare.F(true), + PreserveQueryString: cloudflare.F(true), + SourceURL: cloudflare.F("example.com/arch"), + StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301), + SubpathMatching: cloudflare.F(true), + TargetURL: cloudflare.F("https://archlinux.org/"), + }), + }, { + Asn: cloudflare.F(int64(5567)), + Comment: cloudflare.F("Private IP address"), + Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{ + URLHostname: cloudflare.F("example.com"), + }), + IP: cloudflare.F("10.0.0.1"), + Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{ + IncludeSubdomains: cloudflare.F(true), + PreservePathSuffix: cloudflare.F(true), + PreserveQueryString: cloudflare.F(true), + SourceURL: cloudflare.F("example.com/arch"), + StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301), + SubpathMatching: cloudflare.F(true), + TargetURL: cloudflare.F("https://archlinux.org/"), + }), }}), }, ) @@ -48,7 +94,7 @@ func TestRuleListItemDeleteWithOptionalParams(t *testing.T) { } } -func TestRuleListItemGet(t *testing.T) { +func TestRuleListItemListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,11 +110,15 @@ func TestRuleListItemGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Items.Get( + _, err := client.Rules.Lists.Items.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", - "34b12448945f11eaa1b71c4d701ab86e", + cloudflare.RuleListItemListParams{ + Cursor: cloudflare.F("zzz"), + PerPage: cloudflare.F(int64(1)), + Search: cloudflare.F("1.1.1."), + }, ) if err != nil { var apierr *cloudflare.Error @@ -79,7 +129,7 @@ func TestRuleListItemGet(t *testing.T) { } } -func TestRuleListItemListsNewListItems(t *testing.T) { +func TestRuleListItemDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -95,59 +145,13 @@ func TestRuleListItemListsNewListItems(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Items.ListsNewListItems( + _, err := client.Rules.Lists.Items.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", - cloudflare.RuleListItemListsNewListItemsParams{ - Body: cloudflare.F([]cloudflare.RuleListItemListsNewListItemsParamsBody{{ - Asn: cloudflare.F(int64(5567)), - Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyHostname{ - URLHostname: cloudflare.F("example.com"), - }), - IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirect{ - IncludeSubdomains: cloudflare.F(true), - PreservePathSuffix: cloudflare.F(true), - PreserveQueryString: cloudflare.F(true), - SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirectStatusCode301), - SubpathMatching: cloudflare.F(true), - TargetURL: cloudflare.F("https://archlinux.org/"), - }), - }, { - Asn: cloudflare.F(int64(5567)), - Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyHostname{ - URLHostname: cloudflare.F("example.com"), - }), - IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirect{ - IncludeSubdomains: cloudflare.F(true), - PreservePathSuffix: cloudflare.F(true), - PreserveQueryString: cloudflare.F(true), - SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirectStatusCode301), - SubpathMatching: cloudflare.F(true), - TargetURL: cloudflare.F("https://archlinux.org/"), - }), - }, { - Asn: cloudflare.F(int64(5567)), - Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyHostname{ - URLHostname: cloudflare.F("example.com"), - }), - IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirect{ - IncludeSubdomains: cloudflare.F(true), - PreservePathSuffix: cloudflare.F(true), - PreserveQueryString: cloudflare.F(true), - SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsNewListItemsParamsBodyRedirectStatusCode301), - SubpathMatching: cloudflare.F(true), - TargetURL: cloudflare.F("https://archlinux.org/"), - }), + cloudflare.RuleListItemDeleteParams{ + Items: cloudflare.F([]cloudflare.RuleListItemDeleteParamsItem{{ + ID: cloudflare.F("34b12448945f11eaa1b71c4d701ab86e"), }}), }, ) @@ -160,7 +164,7 @@ func TestRuleListItemListsNewListItems(t *testing.T) { } } -func TestRuleListItemListsGetListItemsWithOptionalParams(t *testing.T) { +func TestRuleListItemGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -176,15 +180,11 @@ func TestRuleListItemListsGetListItemsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Items.ListsGetListItems( + _, err := client.Rules.Lists.Items.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", - cloudflare.RuleListItemListsGetListItemsParams{ - Cursor: cloudflare.F("zzz"), - PerPage: cloudflare.F(int64(1)), - Search: cloudflare.F("1.1.1."), - }, + "34b12448945f11eaa1b71c4d701ab86e", ) if err != nil { var apierr *cloudflare.Error @@ -195,7 +195,7 @@ func TestRuleListItemListsGetListItemsWithOptionalParams(t *testing.T) { } } -func TestRuleListItemListsUpdateAllListItems(t *testing.T) { +func TestRuleListItemReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -211,56 +211,56 @@ func TestRuleListItemListsUpdateAllListItems(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rules.Lists.Items.ListsUpdateAllListItems( + _, err := client.Rules.Lists.Items.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "2c0fc9fa937b11eaa1b71c4d701ab86e", - cloudflare.RuleListItemListsUpdateAllListItemsParams{ - Body: cloudflare.F([]cloudflare.RuleListItemListsUpdateAllListItemsParamsBody{{ + cloudflare.RuleListItemReplaceParams{ + Body: cloudflare.F([]cloudflare.RuleListItemReplaceParamsBody{{ Asn: cloudflare.F(int64(5567)), Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyHostname{ + Hostname: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyHostname{ URLHostname: cloudflare.F("example.com"), }), IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirect{ + Redirect: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirect{ IncludeSubdomains: cloudflare.F(true), PreservePathSuffix: cloudflare.F(true), PreserveQueryString: cloudflare.F(true), SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode301), + StatusCode: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirectStatusCode301), SubpathMatching: cloudflare.F(true), TargetURL: cloudflare.F("https://archlinux.org/"), }), }, { Asn: cloudflare.F(int64(5567)), Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyHostname{ + Hostname: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyHostname{ URLHostname: cloudflare.F("example.com"), }), IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirect{ + Redirect: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirect{ IncludeSubdomains: cloudflare.F(true), PreservePathSuffix: cloudflare.F(true), PreserveQueryString: cloudflare.F(true), SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode301), + StatusCode: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirectStatusCode301), SubpathMatching: cloudflare.F(true), TargetURL: cloudflare.F("https://archlinux.org/"), }), }, { Asn: cloudflare.F(int64(5567)), Comment: cloudflare.F("Private IP address"), - Hostname: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyHostname{ + Hostname: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyHostname{ URLHostname: cloudflare.F("example.com"), }), IP: cloudflare.F("10.0.0.1"), - Redirect: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirect{ + Redirect: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirect{ IncludeSubdomains: cloudflare.F(true), PreservePathSuffix: cloudflare.F(true), PreserveQueryString: cloudflare.F(true), SourceURL: cloudflare.F("example.com/arch"), - StatusCode: cloudflare.F(cloudflare.RuleListItemListsUpdateAllListItemsParamsBodyRedirectStatusCode301), + StatusCode: cloudflare.F(cloudflare.RuleListItemReplaceParamsBodyRedirectStatusCode301), SubpathMatching: cloudflare.F(true), TargetURL: cloudflare.F("https://archlinux.org/"), }), diff --git a/ruleset.go b/ruleset.go index 1046e440bb1..a691af9cd63 100644 --- a/ruleset.go +++ b/ruleset.go @@ -52,19 +52,6 @@ func (r *RulesetService) New(ctx context.Context, accountOrZone string, accountO return } -// Updates an account or zone ruleset, creating a new version. -func (r *RulesetService) Update(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RulesetUpdateParams, opts ...option.RequestOption) (res *RulesetUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env RulesetUpdateResponseEnvelope - path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Fetches all rulesets. func (r *RulesetService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, opts ...option.RequestOption) (res *[]RulesetListResponse, err error) { opts = append(r.Options[:], opts...) @@ -100,6 +87,19 @@ func (r *RulesetService) Get(ctx context.Context, accountOrZone string, accountO return } +// Updates an account or zone ruleset, creating a new version. +func (r *RulesetService) Replace(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RulesetReplaceParams, opts ...option.RequestOption) (res *RulesetReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env RulesetReplaceResponseEnvelope + path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // A result. type RulesetNewResponse struct { // The unique ID of the ruleset. @@ -824,30 +824,106 @@ func (r *RulesetNewResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []by return apijson.UnmarshalRoot(data, r) } +// A ruleset object. +type RulesetListResponse struct { + // The kind of the ruleset. + Kind RulesetListResponseKind `json:"kind,required"` + // The human-readable name of the ruleset. + Name string `json:"name,required"` + // The phase of the ruleset. + Phase RulesetListResponsePhase `json:"phase,required"` + // The unique ID of the ruleset. + ID string `json:"id"` + // An informative description of the ruleset. + Description string `json:"description"` + // The timestamp of when the ruleset was last modified. + LastUpdated time.Time `json:"last_updated" format:"date-time"` + // The version of the ruleset. + Version string `json:"version"` + JSON rulesetListResponseJSON `json:"-"` +} + +// rulesetListResponseJSON contains the JSON metadata for the struct +// [RulesetListResponse] +type rulesetListResponseJSON struct { + Kind apijson.Field + Name apijson.Field + Phase apijson.Field + ID apijson.Field + Description apijson.Field + LastUpdated apijson.Field + Version apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The kind of the ruleset. +type RulesetListResponseKind string + +const ( + RulesetListResponseKindManaged RulesetListResponseKind = "managed" + RulesetListResponseKindCustom RulesetListResponseKind = "custom" + RulesetListResponseKindRoot RulesetListResponseKind = "root" + RulesetListResponseKindZone RulesetListResponseKind = "zone" +) + +// The phase of the ruleset. +type RulesetListResponsePhase string + +const ( + RulesetListResponsePhaseDDOSL4 RulesetListResponsePhase = "ddos_l4" + RulesetListResponsePhaseDDOSL7 RulesetListResponsePhase = "ddos_l7" + RulesetListResponsePhaseHTTPConfigSettings RulesetListResponsePhase = "http_config_settings" + RulesetListResponsePhaseHTTPCustomErrors RulesetListResponsePhase = "http_custom_errors" + RulesetListResponsePhaseHTTPLogCustomFields RulesetListResponsePhase = "http_log_custom_fields" + RulesetListResponsePhaseHTTPRatelimit RulesetListResponsePhase = "http_ratelimit" + RulesetListResponsePhaseHTTPRequestCacheSettings RulesetListResponsePhase = "http_request_cache_settings" + RulesetListResponsePhaseHTTPRequestDynamicRedirect RulesetListResponsePhase = "http_request_dynamic_redirect" + RulesetListResponsePhaseHTTPRequestFirewallCustom RulesetListResponsePhase = "http_request_firewall_custom" + RulesetListResponsePhaseHTTPRequestFirewallManaged RulesetListResponsePhase = "http_request_firewall_managed" + RulesetListResponsePhaseHTTPRequestLateTransform RulesetListResponsePhase = "http_request_late_transform" + RulesetListResponsePhaseHTTPRequestOrigin RulesetListResponsePhase = "http_request_origin" + RulesetListResponsePhaseHTTPRequestRedirect RulesetListResponsePhase = "http_request_redirect" + RulesetListResponsePhaseHTTPRequestSanitize RulesetListResponsePhase = "http_request_sanitize" + RulesetListResponsePhaseHTTPRequestSbfm RulesetListResponsePhase = "http_request_sbfm" + RulesetListResponsePhaseHTTPRequestSelectConfiguration RulesetListResponsePhase = "http_request_select_configuration" + RulesetListResponsePhaseHTTPRequestTransform RulesetListResponsePhase = "http_request_transform" + RulesetListResponsePhaseHTTPResponseCompression RulesetListResponsePhase = "http_response_compression" + RulesetListResponsePhaseHTTPResponseFirewallManaged RulesetListResponsePhase = "http_response_firewall_managed" + RulesetListResponsePhaseHTTPResponseHeadersTransform RulesetListResponsePhase = "http_response_headers_transform" + RulesetListResponsePhaseMagicTransit RulesetListResponsePhase = "magic_transit" + RulesetListResponsePhaseMagicTransitIDsManaged RulesetListResponsePhase = "magic_transit_ids_managed" + RulesetListResponsePhaseMagicTransitManaged RulesetListResponsePhase = "magic_transit_managed" +) + // A result. -type RulesetUpdateResponse struct { +type RulesetGetResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. - Kind RulesetUpdateResponseKind `json:"kind,required"` + Kind RulesetGetResponseKind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetUpdateResponsePhase `json:"phase,required"` + Phase RulesetGetResponsePhase `json:"phase,required"` // The list of rules in the ruleset. - Rules []RulesetUpdateResponseRule `json:"rules,required"` + Rules []RulesetGetResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. - Description string `json:"description"` - JSON rulesetUpdateResponseJSON `json:"-"` + Description string `json:"description"` + JSON rulesetGetResponseJSON `json:"-"` } -// rulesetUpdateResponseJSON contains the JSON metadata for the struct -// [RulesetUpdateResponse] -type rulesetUpdateResponseJSON struct { +// rulesetGetResponseJSON contains the JSON metadata for the struct +// [RulesetGetResponse] +type rulesetGetResponseJSON struct { ID apijson.Field Kind apijson.Field LastUpdated apijson.Field @@ -860,85 +936,85 @@ type rulesetUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetUpdateResponseKind string +type RulesetGetResponseKind string const ( - RulesetUpdateResponseKindManaged RulesetUpdateResponseKind = "managed" - RulesetUpdateResponseKindCustom RulesetUpdateResponseKind = "custom" - RulesetUpdateResponseKindRoot RulesetUpdateResponseKind = "root" - RulesetUpdateResponseKindZone RulesetUpdateResponseKind = "zone" + RulesetGetResponseKindManaged RulesetGetResponseKind = "managed" + RulesetGetResponseKindCustom RulesetGetResponseKind = "custom" + RulesetGetResponseKindRoot RulesetGetResponseKind = "root" + RulesetGetResponseKindZone RulesetGetResponseKind = "zone" ) // The phase of the ruleset. -type RulesetUpdateResponsePhase string - -const ( - RulesetUpdateResponsePhaseDDOSL4 RulesetUpdateResponsePhase = "ddos_l4" - RulesetUpdateResponsePhaseDDOSL7 RulesetUpdateResponsePhase = "ddos_l7" - RulesetUpdateResponsePhaseHTTPConfigSettings RulesetUpdateResponsePhase = "http_config_settings" - RulesetUpdateResponsePhaseHTTPCustomErrors RulesetUpdateResponsePhase = "http_custom_errors" - RulesetUpdateResponsePhaseHTTPLogCustomFields RulesetUpdateResponsePhase = "http_log_custom_fields" - RulesetUpdateResponsePhaseHTTPRatelimit RulesetUpdateResponsePhase = "http_ratelimit" - RulesetUpdateResponsePhaseHTTPRequestCacheSettings RulesetUpdateResponsePhase = "http_request_cache_settings" - RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetUpdateResponsePhase = "http_request_dynamic_redirect" - RulesetUpdateResponsePhaseHTTPRequestFirewallCustom RulesetUpdateResponsePhase = "http_request_firewall_custom" - RulesetUpdateResponsePhaseHTTPRequestFirewallManaged RulesetUpdateResponsePhase = "http_request_firewall_managed" - RulesetUpdateResponsePhaseHTTPRequestLateTransform RulesetUpdateResponsePhase = "http_request_late_transform" - RulesetUpdateResponsePhaseHTTPRequestOrigin RulesetUpdateResponsePhase = "http_request_origin" - RulesetUpdateResponsePhaseHTTPRequestRedirect RulesetUpdateResponsePhase = "http_request_redirect" - RulesetUpdateResponsePhaseHTTPRequestSanitize RulesetUpdateResponsePhase = "http_request_sanitize" - RulesetUpdateResponsePhaseHTTPRequestSbfm RulesetUpdateResponsePhase = "http_request_sbfm" - RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetUpdateResponsePhase = "http_request_select_configuration" - RulesetUpdateResponsePhaseHTTPRequestTransform RulesetUpdateResponsePhase = "http_request_transform" - RulesetUpdateResponsePhaseHTTPResponseCompression RulesetUpdateResponsePhase = "http_response_compression" - RulesetUpdateResponsePhaseHTTPResponseFirewallManaged RulesetUpdateResponsePhase = "http_response_firewall_managed" - RulesetUpdateResponsePhaseHTTPResponseHeadersTransform RulesetUpdateResponsePhase = "http_response_headers_transform" - RulesetUpdateResponsePhaseMagicTransit RulesetUpdateResponsePhase = "magic_transit" - RulesetUpdateResponsePhaseMagicTransitIDsManaged RulesetUpdateResponsePhase = "magic_transit_ids_managed" - RulesetUpdateResponsePhaseMagicTransitManaged RulesetUpdateResponsePhase = "magic_transit_managed" -) - -// Union satisfied by [RulesetUpdateResponseRulesRulesetsBlockRule], -// [RulesetUpdateResponseRulesRulesetsExecuteRule], -// [RulesetUpdateResponseRulesRulesetsLogRule] or -// [RulesetUpdateResponseRulesRulesetsSkipRule]. -type RulesetUpdateResponseRule interface { - implementsRulesetUpdateResponseRule() +type RulesetGetResponsePhase string + +const ( + RulesetGetResponsePhaseDDOSL4 RulesetGetResponsePhase = "ddos_l4" + RulesetGetResponsePhaseDDOSL7 RulesetGetResponsePhase = "ddos_l7" + RulesetGetResponsePhaseHTTPConfigSettings RulesetGetResponsePhase = "http_config_settings" + RulesetGetResponsePhaseHTTPCustomErrors RulesetGetResponsePhase = "http_custom_errors" + RulesetGetResponsePhaseHTTPLogCustomFields RulesetGetResponsePhase = "http_log_custom_fields" + RulesetGetResponsePhaseHTTPRatelimit RulesetGetResponsePhase = "http_ratelimit" + RulesetGetResponsePhaseHTTPRequestCacheSettings RulesetGetResponsePhase = "http_request_cache_settings" + RulesetGetResponsePhaseHTTPRequestDynamicRedirect RulesetGetResponsePhase = "http_request_dynamic_redirect" + RulesetGetResponsePhaseHTTPRequestFirewallCustom RulesetGetResponsePhase = "http_request_firewall_custom" + RulesetGetResponsePhaseHTTPRequestFirewallManaged RulesetGetResponsePhase = "http_request_firewall_managed" + RulesetGetResponsePhaseHTTPRequestLateTransform RulesetGetResponsePhase = "http_request_late_transform" + RulesetGetResponsePhaseHTTPRequestOrigin RulesetGetResponsePhase = "http_request_origin" + RulesetGetResponsePhaseHTTPRequestRedirect RulesetGetResponsePhase = "http_request_redirect" + RulesetGetResponsePhaseHTTPRequestSanitize RulesetGetResponsePhase = "http_request_sanitize" + RulesetGetResponsePhaseHTTPRequestSbfm RulesetGetResponsePhase = "http_request_sbfm" + RulesetGetResponsePhaseHTTPRequestSelectConfiguration RulesetGetResponsePhase = "http_request_select_configuration" + RulesetGetResponsePhaseHTTPRequestTransform RulesetGetResponsePhase = "http_request_transform" + RulesetGetResponsePhaseHTTPResponseCompression RulesetGetResponsePhase = "http_response_compression" + RulesetGetResponsePhaseHTTPResponseFirewallManaged RulesetGetResponsePhase = "http_response_firewall_managed" + RulesetGetResponsePhaseHTTPResponseHeadersTransform RulesetGetResponsePhase = "http_response_headers_transform" + RulesetGetResponsePhaseMagicTransit RulesetGetResponsePhase = "magic_transit" + RulesetGetResponsePhaseMagicTransitIDsManaged RulesetGetResponsePhase = "magic_transit_ids_managed" + RulesetGetResponsePhaseMagicTransitManaged RulesetGetResponsePhase = "magic_transit_managed" +) + +// Union satisfied by [RulesetGetResponseRulesRulesetsBlockRule], +// [RulesetGetResponseRulesRulesetsExecuteRule], +// [RulesetGetResponseRulesRulesetsLogRule] or +// [RulesetGetResponseRulesRulesetsSkipRule]. +type RulesetGetResponseRule interface { + implementsRulesetGetResponseRule() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*RulesetUpdateResponseRule)(nil)).Elem(), + reflect.TypeOf((*RulesetGetResponseRule)(nil)).Elem(), "action", apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsBlockRule{}), + Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsBlockRule{}), DiscriminatorValue: "block", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsExecuteRule{}), + Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsExecuteRule{}), DiscriminatorValue: "execute", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsLogRule{}), + Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsLogRule{}), DiscriminatorValue: "log", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsSkipRule{}), + Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsSkipRule{}), DiscriminatorValue: "skip", }, ) } -type RulesetUpdateResponseRulesRulesetsBlockRule struct { +type RulesetGetResponseRulesRulesetsBlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -946,9 +1022,9 @@ type RulesetUpdateResponseRulesRulesetsBlockRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetUpdateResponseRulesRulesetsBlockRuleAction `json:"action"` + Action RulesetGetResponseRulesRulesetsBlockRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -958,15 +1034,15 @@ type RulesetUpdateResponseRulesRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetUpdateResponseRulesRulesetsBlockRuleLogging `json:"logging"` + Logging RulesetGetResponseRulesRulesetsBlockRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetGetResponseRulesRulesetsBlockRuleJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for -// the struct [RulesetUpdateResponseRulesRulesetsBlockRule] -type rulesetUpdateResponseRulesRulesetsBlockRuleJSON struct { +// rulesetGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the +// struct [RulesetGetResponseRulesRulesetsBlockRule] +type rulesetGetResponseRulesRulesetsBlockRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -982,54 +1058,54 @@ type rulesetUpdateResponseRulesRulesetsBlockRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetUpdateResponseRulesRulesetsBlockRule) implementsRulesetUpdateResponseRule() {} +func (r RulesetGetResponseRulesRulesetsBlockRule) implementsRulesetGetResponseRule() {} // The action to perform when the rule matches. -type RulesetUpdateResponseRulesRulesetsBlockRuleAction string +type RulesetGetResponseRulesRulesetsBlockRuleAction string const ( - RulesetUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetUpdateResponseRulesRulesetsBlockRuleAction = "block" + RulesetGetResponseRulesRulesetsBlockRuleActionBlock RulesetGetResponseRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters struct { +type RulesetGetResponseRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` - JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` + Response RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` + JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the -// JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters] -type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct { +// rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON +// metadata for the struct +// [RulesetGetResponseRulesRulesetsBlockRuleActionParameters] +type rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON struct { Response apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The response to show when the block is applied. -type RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. - StatusCode int64 `json:"status_code,required"` - JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` + StatusCode int64 `json:"status_code,required"` + JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains +// rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains // the JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse] -type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { +// [RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse] +type rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { Content apijson.Field ContentType apijson.Field StatusCode apijson.Field @@ -1037,30 +1113,30 @@ type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON str ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // An object configuring the rule's logging behavior. -type RulesetUpdateResponseRulesRulesetsBlockRuleLogging struct { +type RulesetGetResponseRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetUpdateResponseRulesRulesetsBlockRuleLogging] -type rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON struct { +// rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON metadata +// for the struct [RulesetGetResponseRulesRulesetsBlockRuleLogging] +type rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetUpdateResponseRulesRulesetsExecuteRule struct { +type RulesetGetResponseRulesRulesetsExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1068,9 +1144,9 @@ type RulesetUpdateResponseRulesRulesetsExecuteRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"` + Action RulesetGetResponseRulesRulesetsExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1080,15 +1156,15 @@ type RulesetUpdateResponseRulesRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetUpdateResponseRulesRulesetsExecuteRuleLogging `json:"logging"` + Logging RulesetGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for -// the struct [RulesetUpdateResponseRulesRulesetsExecuteRule] -type rulesetUpdateResponseRulesRulesetsExecuteRuleJSON struct { +// rulesetGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for +// the struct [RulesetGetResponseRulesRulesetsExecuteRule] +type rulesetGetResponseRulesRulesetsExecuteRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1104,34 +1180,34 @@ type rulesetUpdateResponseRulesRulesetsExecuteRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetUpdateResponseRulesRulesetsExecuteRule) implementsRulesetUpdateResponseRule() {} +func (r RulesetGetResponseRulesRulesetsExecuteRule) implementsRulesetGetResponseRule() {} // The action to perform when the rule matches. -type RulesetUpdateResponseRulesRulesetsExecuteRuleAction string +type RulesetGetResponseRulesRulesetsExecuteRuleAction string const ( - RulesetUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetUpdateResponseRulesRulesetsExecuteRuleAction = "execute" + RulesetGetResponseRulesRulesetsExecuteRuleActionExecute RulesetGetResponseRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters struct { +type RulesetGetResponseRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. - MatchedData RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` + MatchedData RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` + Overrides RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains the -// JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters] -type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct { +// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON +// metadata for the struct +// [RulesetGetResponseRulesRulesetsExecuteRuleActionParameters] +type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ID apijson.Field MatchedData apijson.Field Overrides apijson.Field @@ -1139,53 +1215,53 @@ type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration to use for matched data logging. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. - PublicKey string `json:"public_key,required"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` + PublicKey string `json:"public_key,required"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON +// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON // contains the JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData] -type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { +// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData] +type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A set of overrides to apply to the target ruleset. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` + Categories []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` + Rules []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` + SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON -// contains the JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides] -type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { +// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains +// the JSON metadata for the struct +// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides] +type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { Action apijson.Field Categories apijson.Field Enabled apijson.Field @@ -1195,12 +1271,12 @@ type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A category-level override -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. @@ -1208,14 +1284,14 @@ type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCateg // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` + SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON +// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON // contains the JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] -type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { +// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] +type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { Category apijson.Field Action apijson.Field Enabled apijson.Field @@ -1224,22 +1300,22 @@ type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCateg ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for rules in the category. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. @@ -1249,14 +1325,14 @@ type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` + SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON +// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON // contains the JSON metadata for the struct -// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] -type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { +// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] +type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { ID apijson.Field Action apijson.Field Enabled apijson.Field @@ -1266,51 +1342,51 @@ type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJ ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for the rule. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetUpdateResponseRulesRulesetsExecuteRuleLogging struct { +type RulesetGetResponseRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetUpdateResponseRulesRulesetsExecuteRuleLogging] -type rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON struct { +// rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON metadata +// for the struct [RulesetGetResponseRulesRulesetsExecuteRuleLogging] +type rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetUpdateResponseRulesRulesetsLogRule struct { +type RulesetGetResponseRulesRulesetsLogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1318,7 +1394,7 @@ type RulesetUpdateResponseRulesRulesetsLogRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetUpdateResponseRulesRulesetsLogRuleAction `json:"action"` + Action RulesetGetResponseRulesRulesetsLogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. @@ -1330,15 +1406,15 @@ type RulesetUpdateResponseRulesRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetUpdateResponseRulesRulesetsLogRuleLogging `json:"logging"` + Logging RulesetGetResponseRulesRulesetsLogRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetUpdateResponseRulesRulesetsLogRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetGetResponseRulesRulesetsLogRuleJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the -// struct [RulesetUpdateResponseRulesRulesetsLogRule] -type rulesetUpdateResponseRulesRulesetsLogRuleJSON struct { +// rulesetGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the +// struct [RulesetGetResponseRulesRulesetsLogRule] +type rulesetGetResponseRulesRulesetsLogRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1354,39 +1430,39 @@ type rulesetUpdateResponseRulesRulesetsLogRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetUpdateResponseRulesRulesetsLogRule) implementsRulesetUpdateResponseRule() {} +func (r RulesetGetResponseRulesRulesetsLogRule) implementsRulesetGetResponseRule() {} // The action to perform when the rule matches. -type RulesetUpdateResponseRulesRulesetsLogRuleAction string +type RulesetGetResponseRulesRulesetsLogRuleAction string const ( - RulesetUpdateResponseRulesRulesetsLogRuleActionLog RulesetUpdateResponseRulesRulesetsLogRuleAction = "log" + RulesetGetResponseRulesRulesetsLogRuleActionLog RulesetGetResponseRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetUpdateResponseRulesRulesetsLogRuleLogging struct { +type RulesetGetResponseRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata -// for the struct [RulesetUpdateResponseRulesRulesetsLogRuleLogging] -type rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON struct { +// rulesetGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata for +// the struct [RulesetGetResponseRulesRulesetsLogRuleLogging] +type rulesetGetResponseRulesRulesetsLogRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetUpdateResponseRulesRulesetsSkipRule struct { +type RulesetGetResponseRulesRulesetsSkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1394,9 +1470,9 @@ type RulesetUpdateResponseRulesRulesetsSkipRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetUpdateResponseRulesRulesetsSkipRuleAction `json:"action"` + Action RulesetGetResponseRulesRulesetsSkipRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1406,15 +1482,15 @@ type RulesetUpdateResponseRulesRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetUpdateResponseRulesRulesetsSkipRuleLogging `json:"logging"` + Logging RulesetGetResponseRulesRulesetsSkipRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetGetResponseRulesRulesetsSkipRuleJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for -// the struct [RulesetUpdateResponseRulesRulesetsSkipRule] -type rulesetUpdateResponseRulesRulesetsSkipRuleJSON struct { +// rulesetGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the +// struct [RulesetGetResponseRulesRulesetsSkipRule] +type rulesetGetResponseRulesRulesetsSkipRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1430,42 +1506,42 @@ type rulesetUpdateResponseRulesRulesetsSkipRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetUpdateResponseRulesRulesetsSkipRule) implementsRulesetUpdateResponseRule() {} +func (r RulesetGetResponseRulesRulesetsSkipRule) implementsRulesetGetResponseRule() {} // The action to perform when the rule matches. -type RulesetUpdateResponseRulesRulesetsSkipRuleAction string +type RulesetGetResponseRulesRulesetsSkipRuleAction string const ( - RulesetUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetUpdateResponseRulesRulesetsSkipRuleAction = "skip" + RulesetGetResponseRulesRulesetsSkipRuleActionSkip RulesetGetResponseRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters struct { +type RulesetGetResponseRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` + Phases []RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` // A list of legacy security products to skip the execution of. - Products []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` + Products []RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` + Ruleset RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. - Rulesets []string `json:"rulesets"` - JSON rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` + Rulesets []string `json:"rulesets"` + JSON rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON +// rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON // metadata for the struct -// [RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters] -type rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct { +// [RulesetGetResponseRulesRulesetsSkipRuleActionParameters] +type rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON struct { Phases apijson.Field Products apijson.Field Rules apijson.Field @@ -1475,179 +1551,103 @@ type rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A phase to skip the execution of. -type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string - -const ( - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" +type RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase string + +const ( + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string +type RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct string const ( - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetUpdateResponseRulesRulesetsSkipRuleLogging struct { +type RulesetGetResponseRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` } -// rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata -// for the struct [RulesetUpdateResponseRulesRulesetsSkipRuleLogging] -type rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON struct { +// rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata +// for the struct [RulesetGetResponseRulesRulesetsSkipRuleLogging] +type rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetUpdateResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A ruleset object. -type RulesetListResponse struct { - // The kind of the ruleset. - Kind RulesetListResponseKind `json:"kind,required"` - // The human-readable name of the ruleset. - Name string `json:"name,required"` - // The phase of the ruleset. - Phase RulesetListResponsePhase `json:"phase,required"` - // The unique ID of the ruleset. - ID string `json:"id"` - // An informative description of the ruleset. - Description string `json:"description"` - // The timestamp of when the ruleset was last modified. - LastUpdated time.Time `json:"last_updated" format:"date-time"` - // The version of the ruleset. - Version string `json:"version"` - JSON rulesetListResponseJSON `json:"-"` -} - -// rulesetListResponseJSON contains the JSON metadata for the struct -// [RulesetListResponse] -type rulesetListResponseJSON struct { - Kind apijson.Field - Name apijson.Field - Phase apijson.Field - ID apijson.Field - Description apijson.Field - LastUpdated apijson.Field - Version apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The kind of the ruleset. -type RulesetListResponseKind string - -const ( - RulesetListResponseKindManaged RulesetListResponseKind = "managed" - RulesetListResponseKindCustom RulesetListResponseKind = "custom" - RulesetListResponseKindRoot RulesetListResponseKind = "root" - RulesetListResponseKindZone RulesetListResponseKind = "zone" -) - -// The phase of the ruleset. -type RulesetListResponsePhase string - -const ( - RulesetListResponsePhaseDDOSL4 RulesetListResponsePhase = "ddos_l4" - RulesetListResponsePhaseDDOSL7 RulesetListResponsePhase = "ddos_l7" - RulesetListResponsePhaseHTTPConfigSettings RulesetListResponsePhase = "http_config_settings" - RulesetListResponsePhaseHTTPCustomErrors RulesetListResponsePhase = "http_custom_errors" - RulesetListResponsePhaseHTTPLogCustomFields RulesetListResponsePhase = "http_log_custom_fields" - RulesetListResponsePhaseHTTPRatelimit RulesetListResponsePhase = "http_ratelimit" - RulesetListResponsePhaseHTTPRequestCacheSettings RulesetListResponsePhase = "http_request_cache_settings" - RulesetListResponsePhaseHTTPRequestDynamicRedirect RulesetListResponsePhase = "http_request_dynamic_redirect" - RulesetListResponsePhaseHTTPRequestFirewallCustom RulesetListResponsePhase = "http_request_firewall_custom" - RulesetListResponsePhaseHTTPRequestFirewallManaged RulesetListResponsePhase = "http_request_firewall_managed" - RulesetListResponsePhaseHTTPRequestLateTransform RulesetListResponsePhase = "http_request_late_transform" - RulesetListResponsePhaseHTTPRequestOrigin RulesetListResponsePhase = "http_request_origin" - RulesetListResponsePhaseHTTPRequestRedirect RulesetListResponsePhase = "http_request_redirect" - RulesetListResponsePhaseHTTPRequestSanitize RulesetListResponsePhase = "http_request_sanitize" - RulesetListResponsePhaseHTTPRequestSbfm RulesetListResponsePhase = "http_request_sbfm" - RulesetListResponsePhaseHTTPRequestSelectConfiguration RulesetListResponsePhase = "http_request_select_configuration" - RulesetListResponsePhaseHTTPRequestTransform RulesetListResponsePhase = "http_request_transform" - RulesetListResponsePhaseHTTPResponseCompression RulesetListResponsePhase = "http_response_compression" - RulesetListResponsePhaseHTTPResponseFirewallManaged RulesetListResponsePhase = "http_response_firewall_managed" - RulesetListResponsePhaseHTTPResponseHeadersTransform RulesetListResponsePhase = "http_response_headers_transform" - RulesetListResponsePhaseMagicTransit RulesetListResponsePhase = "magic_transit" - RulesetListResponsePhaseMagicTransitIDsManaged RulesetListResponsePhase = "magic_transit_ids_managed" - RulesetListResponsePhaseMagicTransitManaged RulesetListResponsePhase = "magic_transit_managed" -) - // A result. -type RulesetGetResponse struct { +type RulesetReplaceResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. - Kind RulesetGetResponseKind `json:"kind,required"` + Kind RulesetReplaceResponseKind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetGetResponsePhase `json:"phase,required"` + Phase RulesetReplaceResponsePhase `json:"phase,required"` // The list of rules in the ruleset. - Rules []RulesetGetResponseRule `json:"rules,required"` + Rules []RulesetReplaceResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. - Description string `json:"description"` - JSON rulesetGetResponseJSON `json:"-"` + Description string `json:"description"` + JSON rulesetReplaceResponseJSON `json:"-"` } -// rulesetGetResponseJSON contains the JSON metadata for the struct -// [RulesetGetResponse] -type rulesetGetResponseJSON struct { +// rulesetReplaceResponseJSON contains the JSON metadata for the struct +// [RulesetReplaceResponse] +type rulesetReplaceResponseJSON struct { ID apijson.Field Kind apijson.Field LastUpdated apijson.Field @@ -1660,85 +1660,85 @@ type rulesetGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetGetResponseKind string +type RulesetReplaceResponseKind string const ( - RulesetGetResponseKindManaged RulesetGetResponseKind = "managed" - RulesetGetResponseKindCustom RulesetGetResponseKind = "custom" - RulesetGetResponseKindRoot RulesetGetResponseKind = "root" - RulesetGetResponseKindZone RulesetGetResponseKind = "zone" + RulesetReplaceResponseKindManaged RulesetReplaceResponseKind = "managed" + RulesetReplaceResponseKindCustom RulesetReplaceResponseKind = "custom" + RulesetReplaceResponseKindRoot RulesetReplaceResponseKind = "root" + RulesetReplaceResponseKindZone RulesetReplaceResponseKind = "zone" ) // The phase of the ruleset. -type RulesetGetResponsePhase string - -const ( - RulesetGetResponsePhaseDDOSL4 RulesetGetResponsePhase = "ddos_l4" - RulesetGetResponsePhaseDDOSL7 RulesetGetResponsePhase = "ddos_l7" - RulesetGetResponsePhaseHTTPConfigSettings RulesetGetResponsePhase = "http_config_settings" - RulesetGetResponsePhaseHTTPCustomErrors RulesetGetResponsePhase = "http_custom_errors" - RulesetGetResponsePhaseHTTPLogCustomFields RulesetGetResponsePhase = "http_log_custom_fields" - RulesetGetResponsePhaseHTTPRatelimit RulesetGetResponsePhase = "http_ratelimit" - RulesetGetResponsePhaseHTTPRequestCacheSettings RulesetGetResponsePhase = "http_request_cache_settings" - RulesetGetResponsePhaseHTTPRequestDynamicRedirect RulesetGetResponsePhase = "http_request_dynamic_redirect" - RulesetGetResponsePhaseHTTPRequestFirewallCustom RulesetGetResponsePhase = "http_request_firewall_custom" - RulesetGetResponsePhaseHTTPRequestFirewallManaged RulesetGetResponsePhase = "http_request_firewall_managed" - RulesetGetResponsePhaseHTTPRequestLateTransform RulesetGetResponsePhase = "http_request_late_transform" - RulesetGetResponsePhaseHTTPRequestOrigin RulesetGetResponsePhase = "http_request_origin" - RulesetGetResponsePhaseHTTPRequestRedirect RulesetGetResponsePhase = "http_request_redirect" - RulesetGetResponsePhaseHTTPRequestSanitize RulesetGetResponsePhase = "http_request_sanitize" - RulesetGetResponsePhaseHTTPRequestSbfm RulesetGetResponsePhase = "http_request_sbfm" - RulesetGetResponsePhaseHTTPRequestSelectConfiguration RulesetGetResponsePhase = "http_request_select_configuration" - RulesetGetResponsePhaseHTTPRequestTransform RulesetGetResponsePhase = "http_request_transform" - RulesetGetResponsePhaseHTTPResponseCompression RulesetGetResponsePhase = "http_response_compression" - RulesetGetResponsePhaseHTTPResponseFirewallManaged RulesetGetResponsePhase = "http_response_firewall_managed" - RulesetGetResponsePhaseHTTPResponseHeadersTransform RulesetGetResponsePhase = "http_response_headers_transform" - RulesetGetResponsePhaseMagicTransit RulesetGetResponsePhase = "magic_transit" - RulesetGetResponsePhaseMagicTransitIDsManaged RulesetGetResponsePhase = "magic_transit_ids_managed" - RulesetGetResponsePhaseMagicTransitManaged RulesetGetResponsePhase = "magic_transit_managed" -) - -// Union satisfied by [RulesetGetResponseRulesRulesetsBlockRule], -// [RulesetGetResponseRulesRulesetsExecuteRule], -// [RulesetGetResponseRulesRulesetsLogRule] or -// [RulesetGetResponseRulesRulesetsSkipRule]. -type RulesetGetResponseRule interface { - implementsRulesetGetResponseRule() +type RulesetReplaceResponsePhase string + +const ( + RulesetReplaceResponsePhaseDDOSL4 RulesetReplaceResponsePhase = "ddos_l4" + RulesetReplaceResponsePhaseDDOSL7 RulesetReplaceResponsePhase = "ddos_l7" + RulesetReplaceResponsePhaseHTTPConfigSettings RulesetReplaceResponsePhase = "http_config_settings" + RulesetReplaceResponsePhaseHTTPCustomErrors RulesetReplaceResponsePhase = "http_custom_errors" + RulesetReplaceResponsePhaseHTTPLogCustomFields RulesetReplaceResponsePhase = "http_log_custom_fields" + RulesetReplaceResponsePhaseHTTPRatelimit RulesetReplaceResponsePhase = "http_ratelimit" + RulesetReplaceResponsePhaseHTTPRequestCacheSettings RulesetReplaceResponsePhase = "http_request_cache_settings" + RulesetReplaceResponsePhaseHTTPRequestDynamicRedirect RulesetReplaceResponsePhase = "http_request_dynamic_redirect" + RulesetReplaceResponsePhaseHTTPRequestFirewallCustom RulesetReplaceResponsePhase = "http_request_firewall_custom" + RulesetReplaceResponsePhaseHTTPRequestFirewallManaged RulesetReplaceResponsePhase = "http_request_firewall_managed" + RulesetReplaceResponsePhaseHTTPRequestLateTransform RulesetReplaceResponsePhase = "http_request_late_transform" + RulesetReplaceResponsePhaseHTTPRequestOrigin RulesetReplaceResponsePhase = "http_request_origin" + RulesetReplaceResponsePhaseHTTPRequestRedirect RulesetReplaceResponsePhase = "http_request_redirect" + RulesetReplaceResponsePhaseHTTPRequestSanitize RulesetReplaceResponsePhase = "http_request_sanitize" + RulesetReplaceResponsePhaseHTTPRequestSbfm RulesetReplaceResponsePhase = "http_request_sbfm" + RulesetReplaceResponsePhaseHTTPRequestSelectConfiguration RulesetReplaceResponsePhase = "http_request_select_configuration" + RulesetReplaceResponsePhaseHTTPRequestTransform RulesetReplaceResponsePhase = "http_request_transform" + RulesetReplaceResponsePhaseHTTPResponseCompression RulesetReplaceResponsePhase = "http_response_compression" + RulesetReplaceResponsePhaseHTTPResponseFirewallManaged RulesetReplaceResponsePhase = "http_response_firewall_managed" + RulesetReplaceResponsePhaseHTTPResponseHeadersTransform RulesetReplaceResponsePhase = "http_response_headers_transform" + RulesetReplaceResponsePhaseMagicTransit RulesetReplaceResponsePhase = "magic_transit" + RulesetReplaceResponsePhaseMagicTransitIDsManaged RulesetReplaceResponsePhase = "magic_transit_ids_managed" + RulesetReplaceResponsePhaseMagicTransitManaged RulesetReplaceResponsePhase = "magic_transit_managed" +) + +// Union satisfied by [RulesetReplaceResponseRulesRulesetsBlockRule], +// [RulesetReplaceResponseRulesRulesetsExecuteRule], +// [RulesetReplaceResponseRulesRulesetsLogRule] or +// [RulesetReplaceResponseRulesRulesetsSkipRule]. +type RulesetReplaceResponseRule interface { + implementsRulesetReplaceResponseRule() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*RulesetGetResponseRule)(nil)).Elem(), + reflect.TypeOf((*RulesetReplaceResponseRule)(nil)).Elem(), "action", apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsBlockRule{}), + Type: reflect.TypeOf(RulesetReplaceResponseRulesRulesetsBlockRule{}), DiscriminatorValue: "block", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsExecuteRule{}), + Type: reflect.TypeOf(RulesetReplaceResponseRulesRulesetsExecuteRule{}), DiscriminatorValue: "execute", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsLogRule{}), + Type: reflect.TypeOf(RulesetReplaceResponseRulesRulesetsLogRule{}), DiscriminatorValue: "log", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsSkipRule{}), + Type: reflect.TypeOf(RulesetReplaceResponseRulesRulesetsSkipRule{}), DiscriminatorValue: "skip", }, ) } -type RulesetGetResponseRulesRulesetsBlockRule struct { +type RulesetReplaceResponseRulesRulesetsBlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1746,9 +1746,9 @@ type RulesetGetResponseRulesRulesetsBlockRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetGetResponseRulesRulesetsBlockRuleAction `json:"action"` + Action RulesetReplaceResponseRulesRulesetsBlockRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetReplaceResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1758,15 +1758,15 @@ type RulesetGetResponseRulesRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetGetResponseRulesRulesetsBlockRuleLogging `json:"logging"` + Logging RulesetReplaceResponseRulesRulesetsBlockRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetGetResponseRulesRulesetsBlockRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetReplaceResponseRulesRulesetsBlockRuleJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the -// struct [RulesetGetResponseRulesRulesetsBlockRule] -type rulesetGetResponseRulesRulesetsBlockRuleJSON struct { +// rulesetReplaceResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for +// the struct [RulesetReplaceResponseRulesRulesetsBlockRule] +type rulesetReplaceResponseRulesRulesetsBlockRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1782,54 +1782,54 @@ type rulesetGetResponseRulesRulesetsBlockRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetGetResponseRulesRulesetsBlockRule) implementsRulesetGetResponseRule() {} +func (r RulesetReplaceResponseRulesRulesetsBlockRule) implementsRulesetReplaceResponseRule() {} // The action to perform when the rule matches. -type RulesetGetResponseRulesRulesetsBlockRuleAction string +type RulesetReplaceResponseRulesRulesetsBlockRuleAction string const ( - RulesetGetResponseRulesRulesetsBlockRuleActionBlock RulesetGetResponseRulesRulesetsBlockRuleAction = "block" + RulesetReplaceResponseRulesRulesetsBlockRuleActionBlock RulesetReplaceResponseRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetGetResponseRulesRulesetsBlockRuleActionParameters struct { +type RulesetReplaceResponseRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` - JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` + Response RulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` + JSON rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON -// metadata for the struct -// [RulesetGetResponseRulesRulesetsBlockRuleActionParameters] -type rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON struct { +// rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetReplaceResponseRulesRulesetsBlockRuleActionParameters] +type rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersJSON struct { Response apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The response to show when the block is applied. -type RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. - StatusCode int64 `json:"status_code,required"` - JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` + StatusCode int64 `json:"status_code,required"` + JSON rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains -// the JSON metadata for the struct -// [RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse] -type rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { +// rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponseJSON +// contains the JSON metadata for the struct +// [RulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponse] +type rulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { Content apijson.Field ContentType apijson.Field StatusCode apijson.Field @@ -1837,30 +1837,30 @@ type rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // An object configuring the rule's logging behavior. -type RulesetGetResponseRulesRulesetsBlockRuleLogging struct { +type RulesetReplaceResponseRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetReplaceResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON metadata -// for the struct [RulesetGetResponseRulesRulesetsBlockRuleLogging] -type rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON struct { +// rulesetReplaceResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetReplaceResponseRulesRulesetsBlockRuleLogging] +type rulesetReplaceResponseRulesRulesetsBlockRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetGetResponseRulesRulesetsExecuteRule struct { +type RulesetReplaceResponseRulesRulesetsExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1868,9 +1868,9 @@ type RulesetGetResponseRulesRulesetsExecuteRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetGetResponseRulesRulesetsExecuteRuleAction `json:"action"` + Action RulesetReplaceResponseRulesRulesetsExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetReplaceResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1880,15 +1880,15 @@ type RulesetGetResponseRulesRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"` + Logging RulesetReplaceResponseRulesRulesetsExecuteRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for -// the struct [RulesetGetResponseRulesRulesetsExecuteRule] -type rulesetGetResponseRulesRulesetsExecuteRuleJSON struct { +// rulesetReplaceResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata +// for the struct [RulesetReplaceResponseRulesRulesetsExecuteRule] +type rulesetReplaceResponseRulesRulesetsExecuteRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1904,34 +1904,34 @@ type rulesetGetResponseRulesRulesetsExecuteRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetGetResponseRulesRulesetsExecuteRule) implementsRulesetGetResponseRule() {} +func (r RulesetReplaceResponseRulesRulesetsExecuteRule) implementsRulesetReplaceResponseRule() {} // The action to perform when the rule matches. -type RulesetGetResponseRulesRulesetsExecuteRuleAction string +type RulesetReplaceResponseRulesRulesetsExecuteRuleAction string const ( - RulesetGetResponseRulesRulesetsExecuteRuleActionExecute RulesetGetResponseRulesRulesetsExecuteRuleAction = "execute" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionExecute RulesetReplaceResponseRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParameters struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. - MatchedData RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` + MatchedData RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` + Overrides RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON -// metadata for the struct -// [RulesetGetResponseRulesRulesetsExecuteRuleActionParameters] -type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct { +// rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetReplaceResponseRulesRulesetsExecuteRuleActionParameters] +type rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ID apijson.Field MatchedData apijson.Field Overrides apijson.Field @@ -1939,53 +1939,53 @@ type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration to use for matched data logging. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. - PublicKey string `json:"public_key,required"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` + PublicKey string `json:"public_key,required"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON +// rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON // contains the JSON metadata for the struct -// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData] -type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { +// [RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedData] +type rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A set of overrides to apply to the target ruleset. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` + Categories []RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` + Rules []RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` + SensitivityLevel RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains -// the JSON metadata for the struct -// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides] -type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { +// rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON +// contains the JSON metadata for the struct +// [RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverrides] +type rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { Action apijson.Field Categories apijson.Field Enabled apijson.Field @@ -1995,12 +1995,12 @@ type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON str ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A category-level override -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. @@ -2008,14 +2008,14 @@ type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` + SensitivityLevel RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON +// rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON // contains the JSON metadata for the struct -// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] -type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { +// [RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] +type rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { Category apijson.Field Action apijson.Field Enabled apijson.Field @@ -2024,22 +2024,22 @@ type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for rules in the category. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. @@ -2049,14 +2049,14 @@ type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule str // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` + SensitivityLevel RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON +// rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON // contains the JSON metadata for the struct -// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] -type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { +// [RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] +type rulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { ID apijson.Field Action apijson.Field Enabled apijson.Field @@ -2066,51 +2066,51 @@ type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for the rule. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetReplaceResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetGetResponseRulesRulesetsExecuteRuleLogging struct { +type RulesetReplaceResponseRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetReplaceResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON metadata -// for the struct [RulesetGetResponseRulesRulesetsExecuteRuleLogging] -type rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON struct { +// rulesetReplaceResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetReplaceResponseRulesRulesetsExecuteRuleLogging] +type rulesetReplaceResponseRulesRulesetsExecuteRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetGetResponseRulesRulesetsLogRule struct { +type RulesetReplaceResponseRulesRulesetsLogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -2118,7 +2118,7 @@ type RulesetGetResponseRulesRulesetsLogRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetGetResponseRulesRulesetsLogRuleAction `json:"action"` + Action RulesetReplaceResponseRulesRulesetsLogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. @@ -2130,15 +2130,15 @@ type RulesetGetResponseRulesRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetGetResponseRulesRulesetsLogRuleLogging `json:"logging"` + Logging RulesetReplaceResponseRulesRulesetsLogRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetGetResponseRulesRulesetsLogRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetReplaceResponseRulesRulesetsLogRuleJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the -// struct [RulesetGetResponseRulesRulesetsLogRule] -type rulesetGetResponseRulesRulesetsLogRuleJSON struct { +// rulesetReplaceResponseRulesRulesetsLogRuleJSON contains the JSON metadata for +// the struct [RulesetReplaceResponseRulesRulesetsLogRule] +type rulesetReplaceResponseRulesRulesetsLogRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -2154,39 +2154,39 @@ type rulesetGetResponseRulesRulesetsLogRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetGetResponseRulesRulesetsLogRule) implementsRulesetGetResponseRule() {} +func (r RulesetReplaceResponseRulesRulesetsLogRule) implementsRulesetReplaceResponseRule() {} // The action to perform when the rule matches. -type RulesetGetResponseRulesRulesetsLogRuleAction string +type RulesetReplaceResponseRulesRulesetsLogRuleAction string const ( - RulesetGetResponseRulesRulesetsLogRuleActionLog RulesetGetResponseRulesRulesetsLogRuleAction = "log" + RulesetReplaceResponseRulesRulesetsLogRuleActionLog RulesetReplaceResponseRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetGetResponseRulesRulesetsLogRuleLogging struct { +type RulesetReplaceResponseRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetReplaceResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata for -// the struct [RulesetGetResponseRulesRulesetsLogRuleLogging] -type rulesetGetResponseRulesRulesetsLogRuleLoggingJSON struct { +// rulesetReplaceResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata +// for the struct [RulesetReplaceResponseRulesRulesetsLogRuleLogging] +type rulesetReplaceResponseRulesRulesetsLogRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetGetResponseRulesRulesetsSkipRule struct { +type RulesetReplaceResponseRulesRulesetsSkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -2194,9 +2194,9 @@ type RulesetGetResponseRulesRulesetsSkipRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetGetResponseRulesRulesetsSkipRuleAction `json:"action"` + Action RulesetReplaceResponseRulesRulesetsSkipRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetReplaceResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -2206,15 +2206,15 @@ type RulesetGetResponseRulesRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetGetResponseRulesRulesetsSkipRuleLogging `json:"logging"` + Logging RulesetReplaceResponseRulesRulesetsSkipRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetGetResponseRulesRulesetsSkipRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetReplaceResponseRulesRulesetsSkipRuleJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the -// struct [RulesetGetResponseRulesRulesetsSkipRule] -type rulesetGetResponseRulesRulesetsSkipRuleJSON struct { +// rulesetReplaceResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for +// the struct [RulesetReplaceResponseRulesRulesetsSkipRule] +type rulesetReplaceResponseRulesRulesetsSkipRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -2230,42 +2230,42 @@ type rulesetGetResponseRulesRulesetsSkipRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetGetResponseRulesRulesetsSkipRule) implementsRulesetGetResponseRule() {} +func (r RulesetReplaceResponseRulesRulesetsSkipRule) implementsRulesetReplaceResponseRule() {} // The action to perform when the rule matches. -type RulesetGetResponseRulesRulesetsSkipRuleAction string +type RulesetReplaceResponseRulesRulesetsSkipRuleAction string const ( - RulesetGetResponseRulesRulesetsSkipRuleActionSkip RulesetGetResponseRulesRulesetsSkipRuleAction = "skip" + RulesetReplaceResponseRulesRulesetsSkipRuleActionSkip RulesetReplaceResponseRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetGetResponseRulesRulesetsSkipRuleActionParameters struct { +type RulesetReplaceResponseRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases []RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` + Phases []RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` // A list of legacy security products to skip the execution of. - Products []RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` + Products []RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` + Ruleset RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. - Rulesets []string `json:"rulesets"` - JSON rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` + Rulesets []string `json:"rulesets"` + JSON rulesetReplaceResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON -// metadata for the struct -// [RulesetGetResponseRulesRulesetsSkipRuleActionParameters] -type rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON struct { +// rulesetReplaceResponseRulesRulesetsSkipRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetReplaceResponseRulesRulesetsSkipRuleActionParameters] +type rulesetReplaceResponseRulesRulesetsSkipRuleActionParametersJSON struct { Phases apijson.Field Products apijson.Field Rules apijson.Field @@ -2275,76 +2275,76 @@ type rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A phase to skip the execution of. -type RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase string - -const ( - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" +type RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase string + +const ( + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) -// The name of a legacy security product to skip the execution of. -type RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct string - -const ( - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" +// The name of a legacy security product to skip the execution of. +type RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct string + +const ( + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetReplaceResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetGetResponseRulesRulesetsSkipRuleLogging struct { +type RulesetReplaceResponseRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetReplaceResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` } -// rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata -// for the struct [RulesetGetResponseRulesRulesetsSkipRuleLogging] -type rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON struct { +// rulesetReplaceResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetReplaceResponseRulesRulesetsSkipRuleLogging] +type rulesetReplaceResponseRulesRulesetsSkipRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -2898,51 +2898,297 @@ type rulesetNewResponseEnvelopeMessagesSourceJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type RulesetNewResponseEnvelopeSuccess bool + +const ( + RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true +) + +// A response object. +type RulesetListResponseEnvelope struct { + // A list of error messages. + Errors []RulesetListResponseEnvelopeErrors `json:"errors,required"` + // A list of warning messages. + Messages []RulesetListResponseEnvelopeMessages `json:"messages,required"` + // A result. + Result []RulesetListResponse `json:"result,required"` + // Whether the API call was successful. + Success RulesetListResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetListResponseEnvelopeJSON `json:"-"` +} + +// rulesetListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetListResponseEnvelope] +type rulesetListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetListResponseEnvelopeErrors struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetListResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetListResponseEnvelopeErrorsJSON `json:"-"` +} + +// rulesetListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RulesetListResponseEnvelopeErrors] +type rulesetListResponseEnvelopeErrorsJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetListResponseEnvelopeErrorsSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetListResponseEnvelopeErrorsSourceJSON `json:"-"` +} + +// rulesetListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the +// struct [RulesetListResponseEnvelopeErrorsSource] +type rulesetListResponseEnvelopeErrorsSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetListResponseEnvelopeMessages struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetListResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetListResponseEnvelopeMessagesJSON `json:"-"` +} + +// rulesetListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RulesetListResponseEnvelopeMessages] +type rulesetListResponseEnvelopeMessagesJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetListResponseEnvelopeMessagesSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetListResponseEnvelopeMessagesSourceJSON `json:"-"` +} + +// rulesetListResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the +// struct [RulesetListResponseEnvelopeMessagesSource] +type rulesetListResponseEnvelopeMessagesSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type RulesetListResponseEnvelopeSuccess bool + +const ( + RulesetListResponseEnvelopeSuccessTrue RulesetListResponseEnvelopeSuccess = true +) + +// A response object. +type RulesetGetResponseEnvelope struct { + // A list of error messages. + Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"` + // A list of warning messages. + Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"` + // A result. + Result RulesetGetResponse `json:"result,required"` + // Whether the API call was successful. + Success RulesetGetResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetGetResponseEnvelopeJSON `json:"-"` +} + +// rulesetGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetGetResponseEnvelope] +type rulesetGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetGetResponseEnvelopeErrors struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetGetResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// rulesetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [RulesetGetResponseEnvelopeErrors] +type rulesetGetResponseEnvelopeErrorsJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetGetResponseEnvelopeErrorsSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"` +} + +// rulesetGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the +// struct [RulesetGetResponseEnvelopeErrorsSource] +type rulesetGetResponseEnvelopeErrorsSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetGetResponseEnvelopeMessages struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetGetResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// rulesetGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [RulesetGetResponseEnvelopeMessages] +type rulesetGetResponseEnvelopeMessagesJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetGetResponseEnvelopeMessagesSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"` +} + +// rulesetGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the +// struct [RulesetGetResponseEnvelopeMessagesSource] +type rulesetGetResponseEnvelopeMessagesSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type RulesetNewResponseEnvelopeSuccess bool +type RulesetGetResponseEnvelopeSuccess bool const ( - RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true + RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true ) -type RulesetUpdateParams struct { +type RulesetReplaceParams struct { // The unique ID of the ruleset. ID param.Field[string] `json:"id,required"` // The list of rules in the ruleset. - Rules param.Field[[]RulesetUpdateParamsRule] `json:"rules,required"` + Rules param.Field[[]RulesetReplaceParamsRule] `json:"rules,required"` // An informative description of the ruleset. Description param.Field[string] `json:"description"` // The kind of the ruleset. - Kind param.Field[RulesetUpdateParamsKind] `json:"kind"` + Kind param.Field[RulesetReplaceParamsKind] `json:"kind"` // The human-readable name of the ruleset. Name param.Field[string] `json:"name"` // The phase of the ruleset. - Phase param.Field[RulesetUpdateParamsPhase] `json:"phase"` + Phase param.Field[RulesetReplaceParamsPhase] `json:"phase"` } -func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Satisfied by [RulesetUpdateParamsRulesRulesetsBlockRule], -// [RulesetUpdateParamsRulesRulesetsExecuteRule], -// [RulesetUpdateParamsRulesRulesetsLogRule], -// [RulesetUpdateParamsRulesRulesetsSkipRule]. -type RulesetUpdateParamsRule interface { - implementsRulesetUpdateParamsRule() +// Satisfied by [RulesetReplaceParamsRulesRulesetsBlockRule], +// [RulesetReplaceParamsRulesRulesetsExecuteRule], +// [RulesetReplaceParamsRulesRulesetsLogRule], +// [RulesetReplaceParamsRulesRulesetsSkipRule]. +type RulesetReplaceParamsRule interface { + implementsRulesetReplaceParamsRule() } -type RulesetUpdateParamsRulesRulesetsBlockRule struct { +type RulesetReplaceParamsRulesRulesetsBlockRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"` + Action param.Field[RulesetReplaceParamsRulesRulesetsBlockRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -2950,36 +3196,36 @@ type RulesetUpdateParamsRulesRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleLogging] `json:"logging"` + Logging param.Field[RulesetReplaceParamsRulesRulesetsBlockRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r RulesetUpdateParamsRulesRulesetsBlockRule) implementsRulesetUpdateParamsRule() {} +func (r RulesetReplaceParamsRulesRulesetsBlockRule) implementsRulesetReplaceParamsRule() {} // The action to perform when the rule matches. -type RulesetUpdateParamsRulesRulesetsBlockRuleAction string +type RulesetReplaceParamsRulesRulesetsBlockRuleAction string const ( - RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock RulesetUpdateParamsRulesRulesetsBlockRuleAction = "block" + RulesetReplaceParamsRulesRulesetsBlockRuleActionBlock RulesetReplaceParamsRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters struct { +type RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"` + Response param.Field[RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"` } -func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The response to show when the block is applied. -type RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content param.Field[string] `json:"content,required"` // The type of the content to return. @@ -2988,27 +3234,27 @@ type RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct { StatusCode param.Field[int64] `json:"status_code,required"` } -func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // An object configuring the rule's logging behavior. -type RulesetUpdateParamsRulesRulesetsBlockRuleLogging struct { +type RulesetReplaceParamsRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetUpdateParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetUpdateParamsRulesRulesetsExecuteRule struct { +type RulesetReplaceParamsRulesRulesetsExecuteRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"` + Action param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -3016,72 +3262,72 @@ type RulesetUpdateParamsRulesRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleLogging] `json:"logging"` + Logging param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r RulesetUpdateParamsRulesRulesetsExecuteRule) implementsRulesetUpdateParamsRule() {} +func (r RulesetReplaceParamsRulesRulesetsExecuteRule) implementsRulesetReplaceParamsRule() {} // The action to perform when the rule matches. -type RulesetUpdateParamsRulesRulesetsExecuteRuleAction string +type RulesetReplaceParamsRulesRulesetsExecuteRuleAction string const ( - RulesetUpdateParamsRulesRulesetsExecuteRuleActionExecute RulesetUpdateParamsRulesRulesetsExecuteRuleAction = "execute" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionExecute RulesetReplaceParamsRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID param.Field[string] `json:"id,required"` // The configuration to use for matched data logging. - MatchedData param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` + MatchedData param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` + Overrides param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration to use for matched data logging. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. PublicKey param.Field[string] `json:"public_key,required"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A set of overrides to apply to the target ruleset. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action param.Field[string] `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` + Categories param.Field[[]RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled param.Field[bool] `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` + Rules param.Field[[]RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A category-level override -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category param.Field[string] `json:"category,required"` // The action to override rules in the category with. @@ -3089,25 +3335,25 @@ type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategor // Whether to enable execution of rules in the category. Enabled param.Field[bool] `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for rules in the category. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID param.Field[string] `json:"id,required"` // The action to override the rule with. @@ -3117,49 +3363,49 @@ type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule st // The score threshold to use for the rule. ScoreThreshold param.Field[int64] `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for the rule. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetReplaceParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetUpdateParamsRulesRulesetsExecuteRuleLogging struct { +type RulesetReplaceParamsRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetUpdateParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetUpdateParamsRulesRulesetsLogRule struct { +type RulesetReplaceParamsRulesRulesetsLogRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetUpdateParamsRulesRulesetsLogRuleAction] `json:"action"` + Action param.Field[RulesetReplaceParamsRulesRulesetsLogRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. @@ -3169,41 +3415,41 @@ type RulesetUpdateParamsRulesRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetUpdateParamsRulesRulesetsLogRuleLogging] `json:"logging"` + Logging param.Field[RulesetReplaceParamsRulesRulesetsLogRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r RulesetUpdateParamsRulesRulesetsLogRule) implementsRulesetUpdateParamsRule() {} +func (r RulesetReplaceParamsRulesRulesetsLogRule) implementsRulesetReplaceParamsRule() {} // The action to perform when the rule matches. -type RulesetUpdateParamsRulesRulesetsLogRuleAction string +type RulesetReplaceParamsRulesRulesetsLogRuleAction string const ( - RulesetUpdateParamsRulesRulesetsLogRuleActionLog RulesetUpdateParamsRulesRulesetsLogRuleAction = "log" + RulesetReplaceParamsRulesRulesetsLogRuleActionLog RulesetReplaceParamsRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetUpdateParamsRulesRulesetsLogRuleLogging struct { +type RulesetReplaceParamsRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetUpdateParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetUpdateParamsRulesRulesetsSkipRule struct { +type RulesetReplaceParamsRulesRulesetsSkipRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"` + Action param.Field[RulesetReplaceParamsRulesRulesetsSkipRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetReplaceParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -3211,407 +3457,161 @@ type RulesetUpdateParamsRulesRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleLogging] `json:"logging"` + Logging param.Field[RulesetReplaceParamsRulesRulesetsSkipRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r RulesetUpdateParamsRulesRulesetsSkipRule) implementsRulesetUpdateParamsRule() {} +func (r RulesetReplaceParamsRulesRulesetsSkipRule) implementsRulesetReplaceParamsRule() {} // The action to perform when the rule matches. -type RulesetUpdateParamsRulesRulesetsSkipRuleAction string +type RulesetReplaceParamsRulesRulesetsSkipRuleAction string const ( - RulesetUpdateParamsRulesRulesetsSkipRuleActionSkip RulesetUpdateParamsRulesRulesetsSkipRuleAction = "skip" + RulesetReplaceParamsRulesRulesetsSkipRuleActionSkip RulesetReplaceParamsRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters struct { +type RulesetReplaceParamsRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"` + Phases param.Field[[]RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"` // A list of legacy security products to skip the execution of. - Products param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"` + Products param.Field[[]RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules param.Field[map[string][]string] `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` + Ruleset param.Field[RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets param.Field[[]string] `json:"rulesets"` } -func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A phase to skip the execution of. -type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string - -const ( - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" +type RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase string + +const ( + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string +type RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct string const ( - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetReplaceParamsRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetUpdateParamsRulesRulesetsSkipRuleLogging struct { +type RulesetReplaceParamsRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetUpdateParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetReplaceParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The kind of the ruleset. -type RulesetUpdateParamsKind string +type RulesetReplaceParamsKind string const ( - RulesetUpdateParamsKindManaged RulesetUpdateParamsKind = "managed" - RulesetUpdateParamsKindCustom RulesetUpdateParamsKind = "custom" - RulesetUpdateParamsKindRoot RulesetUpdateParamsKind = "root" - RulesetUpdateParamsKindZone RulesetUpdateParamsKind = "zone" + RulesetReplaceParamsKindManaged RulesetReplaceParamsKind = "managed" + RulesetReplaceParamsKindCustom RulesetReplaceParamsKind = "custom" + RulesetReplaceParamsKindRoot RulesetReplaceParamsKind = "root" + RulesetReplaceParamsKindZone RulesetReplaceParamsKind = "zone" ) // The phase of the ruleset. -type RulesetUpdateParamsPhase string - -const ( - RulesetUpdateParamsPhaseDDOSL4 RulesetUpdateParamsPhase = "ddos_l4" - RulesetUpdateParamsPhaseDDOSL7 RulesetUpdateParamsPhase = "ddos_l7" - RulesetUpdateParamsPhaseHTTPConfigSettings RulesetUpdateParamsPhase = "http_config_settings" - RulesetUpdateParamsPhaseHTTPCustomErrors RulesetUpdateParamsPhase = "http_custom_errors" - RulesetUpdateParamsPhaseHTTPLogCustomFields RulesetUpdateParamsPhase = "http_log_custom_fields" - RulesetUpdateParamsPhaseHTTPRatelimit RulesetUpdateParamsPhase = "http_ratelimit" - RulesetUpdateParamsPhaseHTTPRequestCacheSettings RulesetUpdateParamsPhase = "http_request_cache_settings" - RulesetUpdateParamsPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsPhase = "http_request_dynamic_redirect" - RulesetUpdateParamsPhaseHTTPRequestFirewallCustom RulesetUpdateParamsPhase = "http_request_firewall_custom" - RulesetUpdateParamsPhaseHTTPRequestFirewallManaged RulesetUpdateParamsPhase = "http_request_firewall_managed" - RulesetUpdateParamsPhaseHTTPRequestLateTransform RulesetUpdateParamsPhase = "http_request_late_transform" - RulesetUpdateParamsPhaseHTTPRequestOrigin RulesetUpdateParamsPhase = "http_request_origin" - RulesetUpdateParamsPhaseHTTPRequestRedirect RulesetUpdateParamsPhase = "http_request_redirect" - RulesetUpdateParamsPhaseHTTPRequestSanitize RulesetUpdateParamsPhase = "http_request_sanitize" - RulesetUpdateParamsPhaseHTTPRequestSbfm RulesetUpdateParamsPhase = "http_request_sbfm" - RulesetUpdateParamsPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsPhase = "http_request_select_configuration" - RulesetUpdateParamsPhaseHTTPRequestTransform RulesetUpdateParamsPhase = "http_request_transform" - RulesetUpdateParamsPhaseHTTPResponseCompression RulesetUpdateParamsPhase = "http_response_compression" - RulesetUpdateParamsPhaseHTTPResponseFirewallManaged RulesetUpdateParamsPhase = "http_response_firewall_managed" - RulesetUpdateParamsPhaseHTTPResponseHeadersTransform RulesetUpdateParamsPhase = "http_response_headers_transform" - RulesetUpdateParamsPhaseMagicTransit RulesetUpdateParamsPhase = "magic_transit" - RulesetUpdateParamsPhaseMagicTransitIDsManaged RulesetUpdateParamsPhase = "magic_transit_ids_managed" - RulesetUpdateParamsPhaseMagicTransitManaged RulesetUpdateParamsPhase = "magic_transit_managed" -) - -// A response object. -type RulesetUpdateResponseEnvelope struct { - // A list of error messages. - Errors []RulesetUpdateResponseEnvelopeErrors `json:"errors,required"` - // A list of warning messages. - Messages []RulesetUpdateResponseEnvelopeMessages `json:"messages,required"` - // A result. - Result RulesetUpdateResponse `json:"result,required"` - // Whether the API call was successful. - Success RulesetUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetUpdateResponseEnvelopeJSON `json:"-"` -} - -// rulesetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [RulesetUpdateResponseEnvelope] -type rulesetUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A message. -type RulesetUpdateResponseEnvelopeErrors struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetUpdateResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// rulesetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RulesetUpdateResponseEnvelopeErrors] -type rulesetUpdateResponseEnvelopeErrorsJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The source of this message. -type RulesetUpdateResponseEnvelopeErrorsSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetUpdateResponseEnvelopeErrorsSourceJSON `json:"-"` -} - -// rulesetUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the -// struct [RulesetUpdateResponseEnvelopeErrorsSource] -type rulesetUpdateResponseEnvelopeErrorsSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A message. -type RulesetUpdateResponseEnvelopeMessages struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetUpdateResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// rulesetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RulesetUpdateResponseEnvelopeMessages] -type rulesetUpdateResponseEnvelopeMessagesJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The source of this message. -type RulesetUpdateResponseEnvelopeMessagesSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetUpdateResponseEnvelopeMessagesSourceJSON `json:"-"` -} - -// rulesetUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata for -// the struct [RulesetUpdateResponseEnvelopeMessagesSource] -type rulesetUpdateResponseEnvelopeMessagesSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type RulesetUpdateResponseEnvelopeSuccess bool - -const ( - RulesetUpdateResponseEnvelopeSuccessTrue RulesetUpdateResponseEnvelopeSuccess = true -) - -// A response object. -type RulesetListResponseEnvelope struct { - // A list of error messages. - Errors []RulesetListResponseEnvelopeErrors `json:"errors,required"` - // A list of warning messages. - Messages []RulesetListResponseEnvelopeMessages `json:"messages,required"` - // A result. - Result []RulesetListResponse `json:"result,required"` - // Whether the API call was successful. - Success RulesetListResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetListResponseEnvelopeJSON `json:"-"` -} - -// rulesetListResponseEnvelopeJSON contains the JSON metadata for the struct -// [RulesetListResponseEnvelope] -type rulesetListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A message. -type RulesetListResponseEnvelopeErrors struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetListResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetListResponseEnvelopeErrorsJSON `json:"-"` -} - -// rulesetListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [RulesetListResponseEnvelopeErrors] -type rulesetListResponseEnvelopeErrorsJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The source of this message. -type RulesetListResponseEnvelopeErrorsSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetListResponseEnvelopeErrorsSourceJSON `json:"-"` -} - -// rulesetListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the -// struct [RulesetListResponseEnvelopeErrorsSource] -type rulesetListResponseEnvelopeErrorsSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A message. -type RulesetListResponseEnvelopeMessages struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetListResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetListResponseEnvelopeMessagesJSON `json:"-"` -} - -// rulesetListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RulesetListResponseEnvelopeMessages] -type rulesetListResponseEnvelopeMessagesJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The source of this message. -type RulesetListResponseEnvelopeMessagesSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetListResponseEnvelopeMessagesSourceJSON `json:"-"` -} - -// rulesetListResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the -// struct [RulesetListResponseEnvelopeMessagesSource] -type rulesetListResponseEnvelopeMessagesSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type RulesetListResponseEnvelopeSuccess bool - -const ( - RulesetListResponseEnvelopeSuccessTrue RulesetListResponseEnvelopeSuccess = true +type RulesetReplaceParamsPhase string + +const ( + RulesetReplaceParamsPhaseDDOSL4 RulesetReplaceParamsPhase = "ddos_l4" + RulesetReplaceParamsPhaseDDOSL7 RulesetReplaceParamsPhase = "ddos_l7" + RulesetReplaceParamsPhaseHTTPConfigSettings RulesetReplaceParamsPhase = "http_config_settings" + RulesetReplaceParamsPhaseHTTPCustomErrors RulesetReplaceParamsPhase = "http_custom_errors" + RulesetReplaceParamsPhaseHTTPLogCustomFields RulesetReplaceParamsPhase = "http_log_custom_fields" + RulesetReplaceParamsPhaseHTTPRatelimit RulesetReplaceParamsPhase = "http_ratelimit" + RulesetReplaceParamsPhaseHTTPRequestCacheSettings RulesetReplaceParamsPhase = "http_request_cache_settings" + RulesetReplaceParamsPhaseHTTPRequestDynamicRedirect RulesetReplaceParamsPhase = "http_request_dynamic_redirect" + RulesetReplaceParamsPhaseHTTPRequestFirewallCustom RulesetReplaceParamsPhase = "http_request_firewall_custom" + RulesetReplaceParamsPhaseHTTPRequestFirewallManaged RulesetReplaceParamsPhase = "http_request_firewall_managed" + RulesetReplaceParamsPhaseHTTPRequestLateTransform RulesetReplaceParamsPhase = "http_request_late_transform" + RulesetReplaceParamsPhaseHTTPRequestOrigin RulesetReplaceParamsPhase = "http_request_origin" + RulesetReplaceParamsPhaseHTTPRequestRedirect RulesetReplaceParamsPhase = "http_request_redirect" + RulesetReplaceParamsPhaseHTTPRequestSanitize RulesetReplaceParamsPhase = "http_request_sanitize" + RulesetReplaceParamsPhaseHTTPRequestSbfm RulesetReplaceParamsPhase = "http_request_sbfm" + RulesetReplaceParamsPhaseHTTPRequestSelectConfiguration RulesetReplaceParamsPhase = "http_request_select_configuration" + RulesetReplaceParamsPhaseHTTPRequestTransform RulesetReplaceParamsPhase = "http_request_transform" + RulesetReplaceParamsPhaseHTTPResponseCompression RulesetReplaceParamsPhase = "http_response_compression" + RulesetReplaceParamsPhaseHTTPResponseFirewallManaged RulesetReplaceParamsPhase = "http_response_firewall_managed" + RulesetReplaceParamsPhaseHTTPResponseHeadersTransform RulesetReplaceParamsPhase = "http_response_headers_transform" + RulesetReplaceParamsPhaseMagicTransit RulesetReplaceParamsPhase = "magic_transit" + RulesetReplaceParamsPhaseMagicTransitIDsManaged RulesetReplaceParamsPhase = "magic_transit_ids_managed" + RulesetReplaceParamsPhaseMagicTransitManaged RulesetReplaceParamsPhase = "magic_transit_managed" ) // A response object. -type RulesetGetResponseEnvelope struct { +type RulesetReplaceResponseEnvelope struct { // A list of error messages. - Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"` + Errors []RulesetReplaceResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. - Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"` + Messages []RulesetReplaceResponseEnvelopeMessages `json:"messages,required"` // A result. - Result RulesetGetResponse `json:"result,required"` + Result RulesetReplaceResponse `json:"result,required"` // Whether the API call was successful. - Success RulesetGetResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetGetResponseEnvelopeJSON `json:"-"` + Success RulesetReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetReplaceResponseEnvelopeJSON `json:"-"` } -// rulesetGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [RulesetGetResponseEnvelope] -type rulesetGetResponseEnvelopeJSON struct { +// rulesetReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetReplaceResponseEnvelope] +type rulesetReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -3620,24 +3620,24 @@ type rulesetGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetGetResponseEnvelopeErrors struct { +type RulesetReplaceResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetGetResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetGetResponseEnvelopeErrorsJSON `json:"-"` + Source RulesetReplaceResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// rulesetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [RulesetGetResponseEnvelopeErrors] -type rulesetGetResponseEnvelopeErrorsJSON struct { +// rulesetReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RulesetReplaceResponseEnvelopeErrors] +type rulesetReplaceResponseEnvelopeErrorsJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -3645,43 +3645,43 @@ type rulesetGetResponseEnvelopeErrorsJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetGetResponseEnvelopeErrorsSource struct { +type RulesetReplaceResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetReplaceResponseEnvelopeErrorsSourceJSON `json:"-"` } -// rulesetGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the -// struct [RulesetGetResponseEnvelopeErrorsSource] -type rulesetGetResponseEnvelopeErrorsSourceJSON struct { +// rulesetReplaceResponseEnvelopeErrorsSourceJSON contains the JSON metadata for +// the struct [RulesetReplaceResponseEnvelopeErrorsSource] +type rulesetReplaceResponseEnvelopeErrorsSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetGetResponseEnvelopeMessages struct { +type RulesetReplaceResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetGetResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetGetResponseEnvelopeMessagesJSON `json:"-"` + Source RulesetReplaceResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// rulesetGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct -// [RulesetGetResponseEnvelopeMessages] -type rulesetGetResponseEnvelopeMessagesJSON struct { +// rulesetReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RulesetReplaceResponseEnvelopeMessages] +type rulesetReplaceResponseEnvelopeMessagesJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -3689,32 +3689,32 @@ type rulesetGetResponseEnvelopeMessagesJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetGetResponseEnvelopeMessagesSource struct { +type RulesetReplaceResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetReplaceResponseEnvelopeMessagesSourceJSON `json:"-"` } -// rulesetGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the -// struct [RulesetGetResponseEnvelopeMessagesSource] -type rulesetGetResponseEnvelopeMessagesSourceJSON struct { +// rulesetReplaceResponseEnvelopeMessagesSourceJSON contains the JSON metadata for +// the struct [RulesetReplaceResponseEnvelopeMessagesSource] +type rulesetReplaceResponseEnvelopeMessagesSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetReplaceResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type RulesetGetResponseEnvelopeSuccess bool +type RulesetReplaceResponseEnvelopeSuccess bool const ( - RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true + RulesetReplaceResponseEnvelopeSuccessTrue RulesetReplaceResponseEnvelopeSuccess = true ) diff --git a/ruleset_test.go b/ruleset_test.go index 402ad268370..ebe5b89fc69 100644 --- a/ruleset_test.go +++ b/ruleset_test.go @@ -101,7 +101,7 @@ func TestRulesetNewWithOptionalParams(t *testing.T) { } } -func TestRulesetUpdateWithOptionalParams(t *testing.T) { +func TestRulesetList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -117,70 +117,10 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Update( + _, err := client.Rulesets.List( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", - "2f2feab2026849078ba485f918791bdc", - cloudflare.RulesetUpdateParams{ - ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"), - Rules: cloudflare.F([]cloudflare.RulesetUpdateParamsRule{cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{ - Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock), - ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{ - Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{ - Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), - ContentType: cloudflare.F("application/json"), - StatusCode: cloudflare.F(int64(400)), - }), - }), - Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("ip.src ne 1.1.1.1"), - ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), - Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{ - Enabled: cloudflare.F(true), - }), - Ref: cloudflare.F("my_ref"), - }), cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{ - Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock), - ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{ - Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{ - Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), - ContentType: cloudflare.F("application/json"), - StatusCode: cloudflare.F(int64(400)), - }), - }), - Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("ip.src ne 1.1.1.1"), - ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), - Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{ - Enabled: cloudflare.F(true), - }), - Ref: cloudflare.F("my_ref"), - }), cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{ - Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock), - ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{ - Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{ - Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), - ContentType: cloudflare.F("application/json"), - StatusCode: cloudflare.F(int64(400)), - }), - }), - Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("ip.src ne 1.1.1.1"), - ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), - Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{ - Enabled: cloudflare.F(true), - }), - Ref: cloudflare.F("my_ref"), - })}), - Description: cloudflare.F("My ruleset to execute managed rulesets"), - Kind: cloudflare.F(cloudflare.RulesetUpdateParamsKindRoot), - Name: cloudflare.F("My ruleset"), - Phase: cloudflare.F(cloudflare.RulesetUpdateParamsPhaseHTTPRequestFirewallCustom), - }, ) if err != nil { var apierr *cloudflare.Error @@ -191,7 +131,7 @@ func TestRulesetUpdateWithOptionalParams(t *testing.T) { } } -func TestRulesetList(t *testing.T) { +func TestRulesetDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -207,10 +147,11 @@ func TestRulesetList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.List( + err := client.Rulesets.Delete( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", + "2f2feab2026849078ba485f918791bdc", ) if err != nil { var apierr *cloudflare.Error @@ -221,7 +162,7 @@ func TestRulesetList(t *testing.T) { } } -func TestRulesetDelete(t *testing.T) { +func TestRulesetGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -237,7 +178,7 @@ func TestRulesetDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Rulesets.Delete( + _, err := client.Rulesets.Get( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", @@ -252,7 +193,7 @@ func TestRulesetDelete(t *testing.T) { } } -func TestRulesetGet(t *testing.T) { +func TestRulesetReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -268,11 +209,70 @@ func TestRulesetGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Get( + _, err := client.Rulesets.Replace( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", + cloudflare.RulesetReplaceParams{ + ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"), + Rules: cloudflare.F([]cloudflare.RulesetReplaceParamsRule{cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule{ + Action: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionBlock), + ActionParameters: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters{ + Response: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse{ + Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), + ContentType: cloudflare.F("application/json"), + StatusCode: cloudflare.F(int64(400)), + }), + }), + Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("ip.src ne 1.1.1.1"), + ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), + Logging: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleLogging{ + Enabled: cloudflare.F(true), + }), + Ref: cloudflare.F("my_ref"), + }), cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule{ + Action: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionBlock), + ActionParameters: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters{ + Response: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse{ + Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), + ContentType: cloudflare.F("application/json"), + StatusCode: cloudflare.F(int64(400)), + }), + }), + Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("ip.src ne 1.1.1.1"), + ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), + Logging: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleLogging{ + Enabled: cloudflare.F(true), + }), + Ref: cloudflare.F("my_ref"), + }), cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRule{ + Action: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionBlock), + ActionParameters: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParameters{ + Response: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleActionParametersResponse{ + Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), + ContentType: cloudflare.F("application/json"), + StatusCode: cloudflare.F(int64(400)), + }), + }), + Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("ip.src ne 1.1.1.1"), + ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), + Logging: cloudflare.F(cloudflare.RulesetReplaceParamsRulesRulesetsBlockRuleLogging{ + Enabled: cloudflare.F(true), + }), + Ref: cloudflare.F("my_ref"), + })}), + Description: cloudflare.F("My ruleset to execute managed rulesets"), + Kind: cloudflare.F(cloudflare.RulesetReplaceParamsKindRoot), + Name: cloudflare.F("My ruleset"), + Phase: cloudflare.F(cloudflare.RulesetReplaceParamsPhaseHTTPRequestFirewallCustom), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/rulesetrule.go b/rulesetrule.go index fcc0b540803..457136df5bd 100644 --- a/rulesetrule.go +++ b/rulesetrule.go @@ -34,6 +34,20 @@ func NewRulesetRuleService(opts ...option.RequestOption) (r *RulesetRuleService) return } +// Adds a new rule to an account or zone ruleset. The rule will be added to the end +// of the existing list of rules in the ruleset by default. +func (r *RulesetRuleService) New(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RulesetRuleNewParams, opts ...option.RequestOption) (res *RulesetRuleNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env RulesetRuleNewResponseEnvelope + path := fmt.Sprintf("%s/%s/rulesets/%s/rules", accountOrZone, accountOrZoneID, rulesetID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Updates an existing rule in an account ruleset. func (r *RulesetRuleService) Update(ctx context.Context, rulesetID string, ruleID string, params RulesetRuleUpdateParams, opts ...option.RequestOption) (res *RulesetRuleUpdateResponse, err error) { opts = append(r.Options[:], opts...) @@ -60,44 +74,30 @@ func (r *RulesetRuleService) Delete(ctx context.Context, accountOrZone string, a return } -// Adds a new rule to an account or zone ruleset. The rule will be added to the end -// of the existing list of rules in the ruleset by default. -func (r *RulesetRuleService) AccountRulesetsNewAnAccountRulesetRule(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, body RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams, opts ...option.RequestOption) (res *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelope - path := fmt.Sprintf("%s/%s/rulesets/%s/rules", accountOrZone, accountOrZoneID, rulesetID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // A result. -type RulesetRuleUpdateResponse struct { +type RulesetRuleNewResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. - Kind RulesetRuleUpdateResponseKind `json:"kind,required"` + Kind RulesetRuleNewResponseKind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetRuleUpdateResponsePhase `json:"phase,required"` + Phase RulesetRuleNewResponsePhase `json:"phase,required"` // The list of rules in the ruleset. - Rules []RulesetRuleUpdateResponseRule `json:"rules,required"` + Rules []RulesetRuleNewResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. - Description string `json:"description"` - JSON rulesetRuleUpdateResponseJSON `json:"-"` + Description string `json:"description"` + JSON rulesetRuleNewResponseJSON `json:"-"` } -// rulesetRuleUpdateResponseJSON contains the JSON metadata for the struct -// [RulesetRuleUpdateResponse] -type rulesetRuleUpdateResponseJSON struct { +// rulesetRuleNewResponseJSON contains the JSON metadata for the struct +// [RulesetRuleNewResponse] +type rulesetRuleNewResponseJSON struct { ID apijson.Field Kind apijson.Field LastUpdated apijson.Field @@ -110,85 +110,85 @@ type rulesetRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetRuleUpdateResponseKind string +type RulesetRuleNewResponseKind string const ( - RulesetRuleUpdateResponseKindManaged RulesetRuleUpdateResponseKind = "managed" - RulesetRuleUpdateResponseKindCustom RulesetRuleUpdateResponseKind = "custom" - RulesetRuleUpdateResponseKindRoot RulesetRuleUpdateResponseKind = "root" - RulesetRuleUpdateResponseKindZone RulesetRuleUpdateResponseKind = "zone" + RulesetRuleNewResponseKindManaged RulesetRuleNewResponseKind = "managed" + RulesetRuleNewResponseKindCustom RulesetRuleNewResponseKind = "custom" + RulesetRuleNewResponseKindRoot RulesetRuleNewResponseKind = "root" + RulesetRuleNewResponseKindZone RulesetRuleNewResponseKind = "zone" ) // The phase of the ruleset. -type RulesetRuleUpdateResponsePhase string +type RulesetRuleNewResponsePhase string const ( - RulesetRuleUpdateResponsePhaseDDOSL4 RulesetRuleUpdateResponsePhase = "ddos_l4" - RulesetRuleUpdateResponsePhaseDDOSL7 RulesetRuleUpdateResponsePhase = "ddos_l7" - RulesetRuleUpdateResponsePhaseHTTPConfigSettings RulesetRuleUpdateResponsePhase = "http_config_settings" - RulesetRuleUpdateResponsePhaseHTTPCustomErrors RulesetRuleUpdateResponsePhase = "http_custom_errors" - RulesetRuleUpdateResponsePhaseHTTPLogCustomFields RulesetRuleUpdateResponsePhase = "http_log_custom_fields" - RulesetRuleUpdateResponsePhaseHTTPRatelimit RulesetRuleUpdateResponsePhase = "http_ratelimit" - RulesetRuleUpdateResponsePhaseHTTPRequestCacheSettings RulesetRuleUpdateResponsePhase = "http_request_cache_settings" - RulesetRuleUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetRuleUpdateResponsePhase = "http_request_dynamic_redirect" - RulesetRuleUpdateResponsePhaseHTTPRequestFirewallCustom RulesetRuleUpdateResponsePhase = "http_request_firewall_custom" - RulesetRuleUpdateResponsePhaseHTTPRequestFirewallManaged RulesetRuleUpdateResponsePhase = "http_request_firewall_managed" - RulesetRuleUpdateResponsePhaseHTTPRequestLateTransform RulesetRuleUpdateResponsePhase = "http_request_late_transform" - RulesetRuleUpdateResponsePhaseHTTPRequestOrigin RulesetRuleUpdateResponsePhase = "http_request_origin" - RulesetRuleUpdateResponsePhaseHTTPRequestRedirect RulesetRuleUpdateResponsePhase = "http_request_redirect" - RulesetRuleUpdateResponsePhaseHTTPRequestSanitize RulesetRuleUpdateResponsePhase = "http_request_sanitize" - RulesetRuleUpdateResponsePhaseHTTPRequestSbfm RulesetRuleUpdateResponsePhase = "http_request_sbfm" - RulesetRuleUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetRuleUpdateResponsePhase = "http_request_select_configuration" - RulesetRuleUpdateResponsePhaseHTTPRequestTransform RulesetRuleUpdateResponsePhase = "http_request_transform" - RulesetRuleUpdateResponsePhaseHTTPResponseCompression RulesetRuleUpdateResponsePhase = "http_response_compression" - RulesetRuleUpdateResponsePhaseHTTPResponseFirewallManaged RulesetRuleUpdateResponsePhase = "http_response_firewall_managed" - RulesetRuleUpdateResponsePhaseHTTPResponseHeadersTransform RulesetRuleUpdateResponsePhase = "http_response_headers_transform" - RulesetRuleUpdateResponsePhaseMagicTransit RulesetRuleUpdateResponsePhase = "magic_transit" - RulesetRuleUpdateResponsePhaseMagicTransitIDsManaged RulesetRuleUpdateResponsePhase = "magic_transit_ids_managed" - RulesetRuleUpdateResponsePhaseMagicTransitManaged RulesetRuleUpdateResponsePhase = "magic_transit_managed" + RulesetRuleNewResponsePhaseDDOSL4 RulesetRuleNewResponsePhase = "ddos_l4" + RulesetRuleNewResponsePhaseDDOSL7 RulesetRuleNewResponsePhase = "ddos_l7" + RulesetRuleNewResponsePhaseHTTPConfigSettings RulesetRuleNewResponsePhase = "http_config_settings" + RulesetRuleNewResponsePhaseHTTPCustomErrors RulesetRuleNewResponsePhase = "http_custom_errors" + RulesetRuleNewResponsePhaseHTTPLogCustomFields RulesetRuleNewResponsePhase = "http_log_custom_fields" + RulesetRuleNewResponsePhaseHTTPRatelimit RulesetRuleNewResponsePhase = "http_ratelimit" + RulesetRuleNewResponsePhaseHTTPRequestCacheSettings RulesetRuleNewResponsePhase = "http_request_cache_settings" + RulesetRuleNewResponsePhaseHTTPRequestDynamicRedirect RulesetRuleNewResponsePhase = "http_request_dynamic_redirect" + RulesetRuleNewResponsePhaseHTTPRequestFirewallCustom RulesetRuleNewResponsePhase = "http_request_firewall_custom" + RulesetRuleNewResponsePhaseHTTPRequestFirewallManaged RulesetRuleNewResponsePhase = "http_request_firewall_managed" + RulesetRuleNewResponsePhaseHTTPRequestLateTransform RulesetRuleNewResponsePhase = "http_request_late_transform" + RulesetRuleNewResponsePhaseHTTPRequestOrigin RulesetRuleNewResponsePhase = "http_request_origin" + RulesetRuleNewResponsePhaseHTTPRequestRedirect RulesetRuleNewResponsePhase = "http_request_redirect" + RulesetRuleNewResponsePhaseHTTPRequestSanitize RulesetRuleNewResponsePhase = "http_request_sanitize" + RulesetRuleNewResponsePhaseHTTPRequestSbfm RulesetRuleNewResponsePhase = "http_request_sbfm" + RulesetRuleNewResponsePhaseHTTPRequestSelectConfiguration RulesetRuleNewResponsePhase = "http_request_select_configuration" + RulesetRuleNewResponsePhaseHTTPRequestTransform RulesetRuleNewResponsePhase = "http_request_transform" + RulesetRuleNewResponsePhaseHTTPResponseCompression RulesetRuleNewResponsePhase = "http_response_compression" + RulesetRuleNewResponsePhaseHTTPResponseFirewallManaged RulesetRuleNewResponsePhase = "http_response_firewall_managed" + RulesetRuleNewResponsePhaseHTTPResponseHeadersTransform RulesetRuleNewResponsePhase = "http_response_headers_transform" + RulesetRuleNewResponsePhaseMagicTransit RulesetRuleNewResponsePhase = "magic_transit" + RulesetRuleNewResponsePhaseMagicTransitIDsManaged RulesetRuleNewResponsePhase = "magic_transit_ids_managed" + RulesetRuleNewResponsePhaseMagicTransitManaged RulesetRuleNewResponsePhase = "magic_transit_managed" ) -// Union satisfied by [RulesetRuleUpdateResponseRulesRulesetsBlockRule], -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRule], -// [RulesetRuleUpdateResponseRulesRulesetsLogRule] or -// [RulesetRuleUpdateResponseRulesRulesetsSkipRule]. -type RulesetRuleUpdateResponseRule interface { - implementsRulesetRuleUpdateResponseRule() +// Union satisfied by [RulesetRuleNewResponseRulesRulesetsBlockRule], +// [RulesetRuleNewResponseRulesRulesetsExecuteRule], +// [RulesetRuleNewResponseRulesRulesetsLogRule] or +// [RulesetRuleNewResponseRulesRulesetsSkipRule]. +type RulesetRuleNewResponseRule interface { + implementsRulesetRuleNewResponseRule() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*RulesetRuleUpdateResponseRule)(nil)).Elem(), + reflect.TypeOf((*RulesetRuleNewResponseRule)(nil)).Elem(), "action", apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsBlockRule{}), + Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsBlockRule{}), DiscriminatorValue: "block", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsExecuteRule{}), + Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsExecuteRule{}), DiscriminatorValue: "execute", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsLogRule{}), + Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsLogRule{}), DiscriminatorValue: "log", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsSkipRule{}), + Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsSkipRule{}), DiscriminatorValue: "skip", }, ) } -type RulesetRuleUpdateResponseRulesRulesetsBlockRule struct { +type RulesetRuleNewResponseRulesRulesetsBlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -196,9 +196,9 @@ type RulesetRuleUpdateResponseRulesRulesetsBlockRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction `json:"action"` + Action RulesetRuleNewResponseRulesRulesetsBlockRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -208,15 +208,15 @@ type RulesetRuleUpdateResponseRulesRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging `json:"logging"` + Logging RulesetRuleNewResponseRulesRulesetsBlockRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleNewResponseRulesRulesetsBlockRuleJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata -// for the struct [RulesetRuleUpdateResponseRulesRulesetsBlockRule] -type rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON struct { +// rulesetRuleNewResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for +// the struct [RulesetRuleNewResponseRulesRulesetsBlockRule] +type rulesetRuleNewResponseRulesRulesetsBlockRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -232,54 +232,54 @@ type rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleUpdateResponseRulesRulesetsBlockRule) implementsRulesetRuleUpdateResponseRule() {} +func (r RulesetRuleNewResponseRulesRulesetsBlockRule) implementsRulesetRuleNewResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction string +type RulesetRuleNewResponseRulesRulesetsBlockRuleAction string const ( - RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction = "block" + RulesetRuleNewResponseRulesRulesetsBlockRuleActionBlock RulesetRuleNewResponseRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters struct { +type RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` - JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` + Response RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` + JSON rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the +// rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON contains the // JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters] -type rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct { +// [RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters] +type rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON struct { Response apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The response to show when the block is applied. -type RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. - StatusCode int64 `json:"status_code,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` + StatusCode int64 `json:"status_code,required"` + JSON rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON +// rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON // contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse] -type rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { +// [RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse] +type rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { Content apijson.Field ContentType apijson.Field StatusCode apijson.Field @@ -287,30 +287,30 @@ type rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // An object configuring the rule's logging behavior. -type RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging struct { +type RulesetRuleNewResponseRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging] -type rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON struct { +// rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleNewResponseRulesRulesetsBlockRuleLogging] +type rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleUpdateResponseRulesRulesetsExecuteRule struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -318,9 +318,9 @@ type RulesetRuleUpdateResponseRulesRulesetsExecuteRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"` + Action RulesetRuleNewResponseRulesRulesetsExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -330,15 +330,15 @@ type RulesetRuleUpdateResponseRulesRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging `json:"logging"` + Logging RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata -// for the struct [RulesetRuleUpdateResponseRulesRulesetsExecuteRule] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON struct { +// rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata +// for the struct [RulesetRuleNewResponseRulesRulesetsExecuteRule] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -354,35 +354,34 @@ type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleUpdateResponseRulesRulesetsExecuteRule) implementsRulesetRuleUpdateResponseRule() { -} +func (r RulesetRuleNewResponseRulesRulesetsExecuteRule) implementsRulesetRuleNewResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction string +type RulesetRuleNewResponseRulesRulesetsExecuteRuleAction string const ( - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction = "execute" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleNewResponseRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. - MatchedData RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` + MatchedData RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` + Overrides RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains -// the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct { +// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ID apijson.Field MatchedData apijson.Field Overrides apijson.Field @@ -390,53 +389,53 @@ type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struc ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration to use for matched data logging. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. - PublicKey string `json:"public_key,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` + PublicKey string `json:"public_key,required"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON +// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON // contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { +// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A set of overrides to apply to the target ruleset. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories []RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` + Categories []RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules []RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` + Rules []RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` + SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON +// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON // contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { +// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { Action apijson.Field Categories apijson.Field Enabled apijson.Field @@ -446,12 +445,12 @@ type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJ ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A category-level override -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. @@ -459,14 +458,14 @@ type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesC // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` + SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON +// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON // contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { +// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { Category apijson.Field Action apijson.Field Enabled apijson.Field @@ -475,22 +474,22 @@ type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesC ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for rules in the category. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. @@ -500,14 +499,14 @@ type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesR // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` + SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON +// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON // contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { +// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { ID apijson.Field Action apijson.Field Enabled apijson.Field @@ -517,52 +516,51 @@ type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesR ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for the rule. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging struct { +type RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON -// metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging] -type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON struct { +// rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging] +type rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleUpdateResponseRulesRulesetsLogRule struct { +type RulesetRuleNewResponseRulesRulesetsLogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -570,7 +568,7 @@ type RulesetRuleUpdateResponseRulesRulesetsLogRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleUpdateResponseRulesRulesetsLogRuleAction `json:"action"` + Action RulesetRuleNewResponseRulesRulesetsLogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. @@ -582,15 +580,15 @@ type RulesetRuleUpdateResponseRulesRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging `json:"logging"` + Logging RulesetRuleNewResponseRulesRulesetsLogRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleNewResponseRulesRulesetsLogRuleJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for -// the struct [RulesetRuleUpdateResponseRulesRulesetsLogRule] -type rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON struct { +// rulesetRuleNewResponseRulesRulesetsLogRuleJSON contains the JSON metadata for +// the struct [RulesetRuleNewResponseRulesRulesetsLogRule] +type rulesetRuleNewResponseRulesRulesetsLogRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -606,39 +604,39 @@ type rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleUpdateResponseRulesRulesetsLogRule) implementsRulesetRuleUpdateResponseRule() {} +func (r RulesetRuleNewResponseRulesRulesetsLogRule) implementsRulesetRuleNewResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleUpdateResponseRulesRulesetsLogRuleAction string +type RulesetRuleNewResponseRulesRulesetsLogRuleAction string const ( - RulesetRuleUpdateResponseRulesRulesetsLogRuleActionLog RulesetRuleUpdateResponseRulesRulesetsLogRuleAction = "log" + RulesetRuleNewResponseRulesRulesetsLogRuleActionLog RulesetRuleNewResponseRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging struct { +type RulesetRuleNewResponseRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging] -type rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON struct { +// rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata +// for the struct [RulesetRuleNewResponseRulesRulesetsLogRuleLogging] +type rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleUpdateResponseRulesRulesetsSkipRule struct { +type RulesetRuleNewResponseRulesRulesetsSkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -646,9 +644,9 @@ type RulesetRuleUpdateResponseRulesRulesetsSkipRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction `json:"action"` + Action RulesetRuleNewResponseRulesRulesetsSkipRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -658,15 +656,15 @@ type RulesetRuleUpdateResponseRulesRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging `json:"logging"` + Logging RulesetRuleNewResponseRulesRulesetsSkipRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleNewResponseRulesRulesetsSkipRuleJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata -// for the struct [RulesetRuleUpdateResponseRulesRulesetsSkipRule] -type rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON struct { +// rulesetRuleNewResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for +// the struct [RulesetRuleNewResponseRulesRulesetsSkipRule] +type rulesetRuleNewResponseRulesRulesetsSkipRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -682,42 +680,42 @@ type rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleUpdateResponseRulesRulesetsSkipRule) implementsRulesetRuleUpdateResponseRule() {} +func (r RulesetRuleNewResponseRulesRulesetsSkipRule) implementsRulesetRuleNewResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction string +type RulesetRuleNewResponseRulesRulesetsSkipRuleAction string const ( - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction = "skip" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionSkip RulesetRuleNewResponseRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters struct { +type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases []RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` + Phases []RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` // A list of legacy security products to skip the execution of. - Products []RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` + Products []RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` + Ruleset RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. - Rulesets []string `json:"rulesets"` - JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` + Rulesets []string `json:"rulesets"` + JSON rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the +// rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON contains the // JSON metadata for the struct -// [RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters] -type rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct { +// [RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters] +type rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON struct { Phases apijson.Field Products apijson.Field Rules apijson.Field @@ -727,103 +725,103 @@ type rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A phase to skip the execution of. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string +type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase string const ( - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string +type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct string const ( - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging struct { +type RulesetRuleNewResponseRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` } -// rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging] -type rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON struct { +// rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleNewResponseRulesRulesetsSkipRuleLogging] +type rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A result. -type RulesetRuleDeleteResponse struct { +type RulesetRuleUpdateResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. - Kind RulesetRuleDeleteResponseKind `json:"kind,required"` + Kind RulesetRuleUpdateResponseKind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetRuleDeleteResponsePhase `json:"phase,required"` + Phase RulesetRuleUpdateResponsePhase `json:"phase,required"` // The list of rules in the ruleset. - Rules []RulesetRuleDeleteResponseRule `json:"rules,required"` + Rules []RulesetRuleUpdateResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. Description string `json:"description"` - JSON rulesetRuleDeleteResponseJSON `json:"-"` + JSON rulesetRuleUpdateResponseJSON `json:"-"` } -// rulesetRuleDeleteResponseJSON contains the JSON metadata for the struct -// [RulesetRuleDeleteResponse] -type rulesetRuleDeleteResponseJSON struct { +// rulesetRuleUpdateResponseJSON contains the JSON metadata for the struct +// [RulesetRuleUpdateResponse] +type rulesetRuleUpdateResponseJSON struct { ID apijson.Field Kind apijson.Field LastUpdated apijson.Field @@ -836,85 +834,85 @@ type rulesetRuleDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetRuleDeleteResponseKind string +type RulesetRuleUpdateResponseKind string const ( - RulesetRuleDeleteResponseKindManaged RulesetRuleDeleteResponseKind = "managed" - RulesetRuleDeleteResponseKindCustom RulesetRuleDeleteResponseKind = "custom" - RulesetRuleDeleteResponseKindRoot RulesetRuleDeleteResponseKind = "root" - RulesetRuleDeleteResponseKindZone RulesetRuleDeleteResponseKind = "zone" + RulesetRuleUpdateResponseKindManaged RulesetRuleUpdateResponseKind = "managed" + RulesetRuleUpdateResponseKindCustom RulesetRuleUpdateResponseKind = "custom" + RulesetRuleUpdateResponseKindRoot RulesetRuleUpdateResponseKind = "root" + RulesetRuleUpdateResponseKindZone RulesetRuleUpdateResponseKind = "zone" ) // The phase of the ruleset. -type RulesetRuleDeleteResponsePhase string +type RulesetRuleUpdateResponsePhase string const ( - RulesetRuleDeleteResponsePhaseDDOSL4 RulesetRuleDeleteResponsePhase = "ddos_l4" - RulesetRuleDeleteResponsePhaseDDOSL7 RulesetRuleDeleteResponsePhase = "ddos_l7" - RulesetRuleDeleteResponsePhaseHTTPConfigSettings RulesetRuleDeleteResponsePhase = "http_config_settings" - RulesetRuleDeleteResponsePhaseHTTPCustomErrors RulesetRuleDeleteResponsePhase = "http_custom_errors" - RulesetRuleDeleteResponsePhaseHTTPLogCustomFields RulesetRuleDeleteResponsePhase = "http_log_custom_fields" - RulesetRuleDeleteResponsePhaseHTTPRatelimit RulesetRuleDeleteResponsePhase = "http_ratelimit" - RulesetRuleDeleteResponsePhaseHTTPRequestCacheSettings RulesetRuleDeleteResponsePhase = "http_request_cache_settings" - RulesetRuleDeleteResponsePhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponsePhase = "http_request_dynamic_redirect" - RulesetRuleDeleteResponsePhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponsePhase = "http_request_firewall_custom" - RulesetRuleDeleteResponsePhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponsePhase = "http_request_firewall_managed" - RulesetRuleDeleteResponsePhaseHTTPRequestLateTransform RulesetRuleDeleteResponsePhase = "http_request_late_transform" - RulesetRuleDeleteResponsePhaseHTTPRequestOrigin RulesetRuleDeleteResponsePhase = "http_request_origin" - RulesetRuleDeleteResponsePhaseHTTPRequestRedirect RulesetRuleDeleteResponsePhase = "http_request_redirect" - RulesetRuleDeleteResponsePhaseHTTPRequestSanitize RulesetRuleDeleteResponsePhase = "http_request_sanitize" - RulesetRuleDeleteResponsePhaseHTTPRequestSbfm RulesetRuleDeleteResponsePhase = "http_request_sbfm" - RulesetRuleDeleteResponsePhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponsePhase = "http_request_select_configuration" - RulesetRuleDeleteResponsePhaseHTTPRequestTransform RulesetRuleDeleteResponsePhase = "http_request_transform" - RulesetRuleDeleteResponsePhaseHTTPResponseCompression RulesetRuleDeleteResponsePhase = "http_response_compression" - RulesetRuleDeleteResponsePhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponsePhase = "http_response_firewall_managed" - RulesetRuleDeleteResponsePhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponsePhase = "http_response_headers_transform" - RulesetRuleDeleteResponsePhaseMagicTransit RulesetRuleDeleteResponsePhase = "magic_transit" - RulesetRuleDeleteResponsePhaseMagicTransitIDsManaged RulesetRuleDeleteResponsePhase = "magic_transit_ids_managed" - RulesetRuleDeleteResponsePhaseMagicTransitManaged RulesetRuleDeleteResponsePhase = "magic_transit_managed" + RulesetRuleUpdateResponsePhaseDDOSL4 RulesetRuleUpdateResponsePhase = "ddos_l4" + RulesetRuleUpdateResponsePhaseDDOSL7 RulesetRuleUpdateResponsePhase = "ddos_l7" + RulesetRuleUpdateResponsePhaseHTTPConfigSettings RulesetRuleUpdateResponsePhase = "http_config_settings" + RulesetRuleUpdateResponsePhaseHTTPCustomErrors RulesetRuleUpdateResponsePhase = "http_custom_errors" + RulesetRuleUpdateResponsePhaseHTTPLogCustomFields RulesetRuleUpdateResponsePhase = "http_log_custom_fields" + RulesetRuleUpdateResponsePhaseHTTPRatelimit RulesetRuleUpdateResponsePhase = "http_ratelimit" + RulesetRuleUpdateResponsePhaseHTTPRequestCacheSettings RulesetRuleUpdateResponsePhase = "http_request_cache_settings" + RulesetRuleUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetRuleUpdateResponsePhase = "http_request_dynamic_redirect" + RulesetRuleUpdateResponsePhaseHTTPRequestFirewallCustom RulesetRuleUpdateResponsePhase = "http_request_firewall_custom" + RulesetRuleUpdateResponsePhaseHTTPRequestFirewallManaged RulesetRuleUpdateResponsePhase = "http_request_firewall_managed" + RulesetRuleUpdateResponsePhaseHTTPRequestLateTransform RulesetRuleUpdateResponsePhase = "http_request_late_transform" + RulesetRuleUpdateResponsePhaseHTTPRequestOrigin RulesetRuleUpdateResponsePhase = "http_request_origin" + RulesetRuleUpdateResponsePhaseHTTPRequestRedirect RulesetRuleUpdateResponsePhase = "http_request_redirect" + RulesetRuleUpdateResponsePhaseHTTPRequestSanitize RulesetRuleUpdateResponsePhase = "http_request_sanitize" + RulesetRuleUpdateResponsePhaseHTTPRequestSbfm RulesetRuleUpdateResponsePhase = "http_request_sbfm" + RulesetRuleUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetRuleUpdateResponsePhase = "http_request_select_configuration" + RulesetRuleUpdateResponsePhaseHTTPRequestTransform RulesetRuleUpdateResponsePhase = "http_request_transform" + RulesetRuleUpdateResponsePhaseHTTPResponseCompression RulesetRuleUpdateResponsePhase = "http_response_compression" + RulesetRuleUpdateResponsePhaseHTTPResponseFirewallManaged RulesetRuleUpdateResponsePhase = "http_response_firewall_managed" + RulesetRuleUpdateResponsePhaseHTTPResponseHeadersTransform RulesetRuleUpdateResponsePhase = "http_response_headers_transform" + RulesetRuleUpdateResponsePhaseMagicTransit RulesetRuleUpdateResponsePhase = "magic_transit" + RulesetRuleUpdateResponsePhaseMagicTransitIDsManaged RulesetRuleUpdateResponsePhase = "magic_transit_ids_managed" + RulesetRuleUpdateResponsePhaseMagicTransitManaged RulesetRuleUpdateResponsePhase = "magic_transit_managed" ) -// Union satisfied by [RulesetRuleDeleteResponseRulesRulesetsBlockRule], -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRule], -// [RulesetRuleDeleteResponseRulesRulesetsLogRule] or -// [RulesetRuleDeleteResponseRulesRulesetsSkipRule]. -type RulesetRuleDeleteResponseRule interface { - implementsRulesetRuleDeleteResponseRule() +// Union satisfied by [RulesetRuleUpdateResponseRulesRulesetsBlockRule], +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRule], +// [RulesetRuleUpdateResponseRulesRulesetsLogRule] or +// [RulesetRuleUpdateResponseRulesRulesetsSkipRule]. +type RulesetRuleUpdateResponseRule interface { + implementsRulesetRuleUpdateResponseRule() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*RulesetRuleDeleteResponseRule)(nil)).Elem(), + reflect.TypeOf((*RulesetRuleUpdateResponseRule)(nil)).Elem(), "action", apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsBlockRule{}), + Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsBlockRule{}), DiscriminatorValue: "block", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsExecuteRule{}), + Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsExecuteRule{}), DiscriminatorValue: "execute", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsLogRule{}), + Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsLogRule{}), DiscriminatorValue: "log", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsSkipRule{}), + Type: reflect.TypeOf(RulesetRuleUpdateResponseRulesRulesetsSkipRule{}), DiscriminatorValue: "skip", }, ) } -type RulesetRuleDeleteResponseRulesRulesetsBlockRule struct { +type RulesetRuleUpdateResponseRulesRulesetsBlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -922,9 +920,9 @@ type RulesetRuleDeleteResponseRulesRulesetsBlockRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction `json:"action"` + Action RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -934,15 +932,15 @@ type RulesetRuleDeleteResponseRulesRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging `json:"logging"` + Logging RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` - JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON contains the JSON metadata -// for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRule] -type rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata +// for the struct [RulesetRuleUpdateResponseRulesRulesetsBlockRule] +type rulesetRuleUpdateResponseRulesRulesetsBlockRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -958,54 +956,54 @@ type rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleDeleteResponseRulesRulesetsBlockRule) implementsRulesetRuleDeleteResponseRule() {} +func (r RulesetRuleUpdateResponseRulesRulesetsBlockRule) implementsRulesetRuleUpdateResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction string +type RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction string const ( - RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionBlock RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction = "block" + RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetRuleUpdateResponseRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters struct { +type RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` - JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` + Response RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` + JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON contains the +// rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the // JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters] -type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters] +type rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct { Response apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The response to show when the block is applied. -type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. StatusCode int64 `json:"status_code,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON +// rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON // contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse] -type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse] +type rulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { Content apijson.Field ContentType apijson.Field StatusCode apijson.Field @@ -1013,30 +1011,30 @@ type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // An object configuring the rule's logging behavior. -type RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging struct { +type RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. Enabled bool `json:"enabled,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging] -type rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging] +type rulesetRuleUpdateResponseRulesRulesetsBlockRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleDeleteResponseRulesRulesetsExecuteRule struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1044,9 +1042,9 @@ type RulesetRuleDeleteResponseRulesRulesetsExecuteRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction `json:"action"` + Action RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1056,15 +1054,15 @@ type RulesetRuleDeleteResponseRulesRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging `json:"logging"` + Logging RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata -// for the struct [RulesetRuleDeleteResponseRulesRulesetsExecuteRule] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata +// for the struct [RulesetRuleUpdateResponseRulesRulesetsExecuteRule] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1080,35 +1078,35 @@ type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleDeleteResponseRulesRulesetsExecuteRule) implementsRulesetRuleDeleteResponseRule() { +func (r RulesetRuleUpdateResponseRulesRulesetsExecuteRule) implementsRulesetRuleUpdateResponseRule() { } // The action to perform when the rule matches. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction string +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction string const ( - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction = "execute" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleUpdateResponseRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. - MatchedData RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` + MatchedData RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` + Overrides RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON contains +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains // the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ID apijson.Field MatchedData apijson.Field Overrides apijson.Field @@ -1116,53 +1114,53 @@ type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON struc ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration to use for matched data logging. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. PublicKey string `json:"public_key,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON // contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A set of overrides to apply to the target ruleset. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` + Categories []RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` + Rules []RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` + SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON // contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { Action apijson.Field Categories apijson.Field Enabled apijson.Field @@ -1172,12 +1170,12 @@ type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJ ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A category-level override -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. @@ -1185,14 +1183,14 @@ type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesC // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` + SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON // contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { Category apijson.Field Action apijson.Field Enabled apijson.Field @@ -1201,22 +1199,22 @@ type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesC ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for rules in the category. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. @@ -1226,14 +1224,14 @@ type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesR // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` + SensitivityLevel RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON // contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { ID apijson.Field Action apijson.Field Enabled apijson.Field @@ -1243,52 +1241,52 @@ type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesR ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for the rule. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging struct { +type RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. Enabled bool `json:"enabled,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON +// rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON // metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging] -type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging] +type rulesetRuleUpdateResponseRulesRulesetsExecuteRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleDeleteResponseRulesRulesetsLogRule struct { +type RulesetRuleUpdateResponseRulesRulesetsLogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1296,7 +1294,7 @@ type RulesetRuleDeleteResponseRulesRulesetsLogRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleDeleteResponseRulesRulesetsLogRuleAction `json:"action"` + Action RulesetRuleUpdateResponseRulesRulesetsLogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. @@ -1308,15 +1306,15 @@ type RulesetRuleDeleteResponseRulesRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging `json:"logging"` + Logging RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` - JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON contains the JSON metadata for -// the struct [RulesetRuleDeleteResponseRulesRulesetsLogRule] -type rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for +// the struct [RulesetRuleUpdateResponseRulesRulesetsLogRule] +type rulesetRuleUpdateResponseRulesRulesetsLogRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1332,39 +1330,39 @@ type rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleDeleteResponseRulesRulesetsLogRule) implementsRulesetRuleDeleteResponseRule() {} +func (r RulesetRuleUpdateResponseRulesRulesetsLogRule) implementsRulesetRuleUpdateResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleDeleteResponseRulesRulesetsLogRuleAction string +type RulesetRuleUpdateResponseRulesRulesetsLogRuleAction string const ( - RulesetRuleDeleteResponseRulesRulesetsLogRuleActionLog RulesetRuleDeleteResponseRulesRulesetsLogRuleAction = "log" + RulesetRuleUpdateResponseRulesRulesetsLogRuleActionLog RulesetRuleUpdateResponseRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging struct { +type RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. Enabled bool `json:"enabled,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging] -type rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging] +type rulesetRuleUpdateResponseRulesRulesetsLogRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleDeleteResponseRulesRulesetsSkipRule struct { +type RulesetRuleUpdateResponseRulesRulesetsSkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1372,9 +1370,9 @@ type RulesetRuleDeleteResponseRulesRulesetsSkipRule struct { // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction `json:"action"` + Action RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1384,15 +1382,15 @@ type RulesetRuleDeleteResponseRulesRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging `json:"logging"` + Logging RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). Ref string `json:"ref"` - JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON contains the JSON metadata -// for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRule] -type rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata +// for the struct [RulesetRuleUpdateResponseRulesRulesetsSkipRule] +type rulesetRuleUpdateResponseRulesRulesetsSkipRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1408,42 +1406,42 @@ type rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleDeleteResponseRulesRulesetsSkipRule) implementsRulesetRuleDeleteResponseRule() {} +func (r RulesetRuleUpdateResponseRulesRulesetsSkipRule) implementsRulesetRuleUpdateResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction string +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction string const ( - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionSkip RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction = "skip" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetRuleUpdateResponseRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters struct { +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` + Phases []RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` // A list of legacy security products to skip the execution of. - Products []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` + Products []RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` + Ruleset RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets []string `json:"rulesets"` - JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON contains the +// rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the // JSON metadata for the struct -// [RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters] -type rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON struct { +// [RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters] +type rulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct { Phases apijson.Field Products apijson.Field Rules apijson.Field @@ -1453,104 +1451,103 @@ type rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A phase to skip the execution of. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase string +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string const ( - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct string +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string const ( - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging struct { +type RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. Enabled bool `json:"enabled,required"` - JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` + JSON rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` } -// rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON -// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging] -type rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON struct { +// rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging] +type rulesetRuleUpdateResponseRulesRulesetsSkipRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A result. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse struct { +type RulesetRuleDeleteResponse struct { // The unique ID of the ruleset. ID string `json:"id,required"` // The kind of the ruleset. - Kind RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind `json:"kind,required"` + Kind RulesetRuleDeleteResponseKind `json:"kind,required"` // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase `json:"phase,required"` + Phase RulesetRuleDeleteResponsePhase `json:"phase,required"` // The list of rules in the ruleset. - Rules []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule `json:"rules,required"` + Rules []RulesetRuleDeleteResponseRule `json:"rules,required"` // The version of the ruleset. Version string `json:"version,required"` // An informative description of the ruleset. - Description string `json:"description"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseJSON `json:"-"` + Description string `json:"description"` + JSON rulesetRuleDeleteResponseJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseJSON contains the JSON -// metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseJSON struct { +// rulesetRuleDeleteResponseJSON contains the JSON metadata for the struct +// [RulesetRuleDeleteResponse] +type rulesetRuleDeleteResponseJSON struct { ID apijson.Field Kind apijson.Field LastUpdated apijson.Field @@ -1563,87 +1560,85 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind string +type RulesetRuleDeleteResponseKind string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKindManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind = "managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKindCustom RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind = "custom" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKindRoot RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind = "root" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKindZone RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseKind = "zone" + RulesetRuleDeleteResponseKindManaged RulesetRuleDeleteResponseKind = "managed" + RulesetRuleDeleteResponseKindCustom RulesetRuleDeleteResponseKind = "custom" + RulesetRuleDeleteResponseKindRoot RulesetRuleDeleteResponseKind = "root" + RulesetRuleDeleteResponseKindZone RulesetRuleDeleteResponseKind = "zone" ) // The phase of the ruleset. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase string +type RulesetRuleDeleteResponsePhase string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseDDOSL4 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "ddos_l4" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseDDOSL7 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "ddos_l7" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPConfigSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_config_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPCustomErrors RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_custom_errors" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPLogCustomFields RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_log_custom_fields" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRatelimit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_ratelimit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestCacheSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_cache_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestDynamicRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_dynamic_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestFirewallCustom RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_firewall_custom" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestLateTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_late_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestOrigin RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_origin" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestSanitize RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_sanitize" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestSbfm RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_sbfm" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestSelectConfiguration RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_select_configuration" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPRequestTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_request_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPResponseCompression RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_response_compression" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPResponseFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_response_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseHTTPResponseHeadersTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "http_response_headers_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseMagicTransit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "magic_transit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseMagicTransitIDsManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "magic_transit_ids_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhaseMagicTransitManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponsePhase = "magic_transit_managed" + RulesetRuleDeleteResponsePhaseDDOSL4 RulesetRuleDeleteResponsePhase = "ddos_l4" + RulesetRuleDeleteResponsePhaseDDOSL7 RulesetRuleDeleteResponsePhase = "ddos_l7" + RulesetRuleDeleteResponsePhaseHTTPConfigSettings RulesetRuleDeleteResponsePhase = "http_config_settings" + RulesetRuleDeleteResponsePhaseHTTPCustomErrors RulesetRuleDeleteResponsePhase = "http_custom_errors" + RulesetRuleDeleteResponsePhaseHTTPLogCustomFields RulesetRuleDeleteResponsePhase = "http_log_custom_fields" + RulesetRuleDeleteResponsePhaseHTTPRatelimit RulesetRuleDeleteResponsePhase = "http_ratelimit" + RulesetRuleDeleteResponsePhaseHTTPRequestCacheSettings RulesetRuleDeleteResponsePhase = "http_request_cache_settings" + RulesetRuleDeleteResponsePhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponsePhase = "http_request_dynamic_redirect" + RulesetRuleDeleteResponsePhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponsePhase = "http_request_firewall_custom" + RulesetRuleDeleteResponsePhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponsePhase = "http_request_firewall_managed" + RulesetRuleDeleteResponsePhaseHTTPRequestLateTransform RulesetRuleDeleteResponsePhase = "http_request_late_transform" + RulesetRuleDeleteResponsePhaseHTTPRequestOrigin RulesetRuleDeleteResponsePhase = "http_request_origin" + RulesetRuleDeleteResponsePhaseHTTPRequestRedirect RulesetRuleDeleteResponsePhase = "http_request_redirect" + RulesetRuleDeleteResponsePhaseHTTPRequestSanitize RulesetRuleDeleteResponsePhase = "http_request_sanitize" + RulesetRuleDeleteResponsePhaseHTTPRequestSbfm RulesetRuleDeleteResponsePhase = "http_request_sbfm" + RulesetRuleDeleteResponsePhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponsePhase = "http_request_select_configuration" + RulesetRuleDeleteResponsePhaseHTTPRequestTransform RulesetRuleDeleteResponsePhase = "http_request_transform" + RulesetRuleDeleteResponsePhaseHTTPResponseCompression RulesetRuleDeleteResponsePhase = "http_response_compression" + RulesetRuleDeleteResponsePhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponsePhase = "http_response_firewall_managed" + RulesetRuleDeleteResponsePhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponsePhase = "http_response_headers_transform" + RulesetRuleDeleteResponsePhaseMagicTransit RulesetRuleDeleteResponsePhase = "magic_transit" + RulesetRuleDeleteResponsePhaseMagicTransitIDsManaged RulesetRuleDeleteResponsePhase = "magic_transit_ids_managed" + RulesetRuleDeleteResponsePhaseMagicTransitManaged RulesetRuleDeleteResponsePhase = "magic_transit_managed" ) -// Union satisfied by -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule], -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule], -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule] -// or -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule]. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule interface { - implementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule() -} - +// Union satisfied by [RulesetRuleDeleteResponseRulesRulesetsBlockRule], +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRule], +// [RulesetRuleDeleteResponseRulesRulesetsLogRule] or +// [RulesetRuleDeleteResponseRulesRulesetsSkipRule]. +type RulesetRuleDeleteResponseRule interface { + implementsRulesetRuleDeleteResponseRule() +} + func init() { apijson.RegisterUnion( - reflect.TypeOf((*RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule)(nil)).Elem(), + reflect.TypeOf((*RulesetRuleDeleteResponseRule)(nil)).Elem(), "action", apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule{}), + Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsBlockRule{}), DiscriminatorValue: "block", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule{}), + Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsExecuteRule{}), DiscriminatorValue: "execute", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule{}), + Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsLogRule{}), DiscriminatorValue: "log", }, apijson.UnionVariant{ TypeFilter: gjson.JSON, - Type: reflect.TypeOf(RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule{}), + Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsSkipRule{}), DiscriminatorValue: "skip", }, ) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule struct { +type RulesetRuleDeleteResponseRulesRulesetsBlockRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1651,9 +1646,9 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlock // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleAction `json:"action"` + Action RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1663,16 +1658,15 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlock // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLogging `json:"logging"` + Logging RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON contains the JSON metadata +// for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRule] +type rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1688,55 +1682,54 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlock ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRule) implementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule() { -} +func (r RulesetRuleDeleteResponseRulesRulesetsBlockRule) implementsRulesetRuleDeleteResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleAction string +type RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionBlock RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleAction = "block" + RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionBlock RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParameters struct { +type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` + Response RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"` + JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParameters] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters] +type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON struct { Response apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The response to show when the block is applied. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponse struct { +type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content string `json:"content,required"` // The type of the content to return. ContentType string `json:"content_type,required"` // The status code to return. - StatusCode int64 `json:"status_code,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` + StatusCode int64 `json:"status_code,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponseJSON +// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON // contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponse] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { +// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse] +type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct { Content apijson.Field ContentType apijson.Field StatusCode apijson.Field @@ -1744,31 +1737,30 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlock ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLogging struct { +type RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLoggingJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLogging] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLoggingJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging] +type rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -1776,9 +1768,9 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleAction `json:"action"` + Action RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -1788,16 +1780,15 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLogging `json:"logging"` + Logging RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata +// for the struct [RulesetRuleDeleteResponseRulesRulesetsExecuteRule] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -1813,35 +1804,35 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRule) implementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule() { +func (r RulesetRuleDeleteResponseRulesRulesetsExecuteRule) implementsRulesetRuleDeleteResponseRule() { } // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleAction string +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleAction = "execute" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParameters struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID string `json:"id,required"` // The configuration to use for matched data logging. - MatchedData RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` + MatchedData RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` + Overrides RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParameters] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON contains +// the JSON metadata for the struct +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON struct { ID apijson.Field MatchedData apijson.Field Overrides apijson.Field @@ -1849,53 +1840,53 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The configuration to use for matched data logging. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. - PublicKey string `json:"public_key,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` + PublicKey string `json:"public_key,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON // contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedData] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct { PublicKey apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A set of overrides to apply to the target ruleset. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action string `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` + Categories []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled bool `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` + Rules []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` + SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON // contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverrides] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct { Action apijson.Field Categories apijson.Field Enabled apijson.Field @@ -1905,12 +1896,12 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A category-level override -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category string `json:"category,required"` // The action to override rules in the category with. @@ -1918,14 +1909,14 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu // Whether to enable execution of rules in the category. Enabled bool `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` + SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON // contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct { Category apijson.Field Action apijson.Field Enabled apijson.Field @@ -1934,22 +1925,22 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for rules in the category. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID string `json:"id,required"` // The action to override the rule with. @@ -1959,14 +1950,14 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu // The score threshold to use for the rule. ScoreThreshold int64 `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` + SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON // contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct { ID apijson.Field Action apijson.Field Enabled apijson.Field @@ -1976,52 +1967,52 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The sensitivity level to use for the rule. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLogging struct { +type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLoggingJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLogging] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLoggingJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON +// metadata for the struct +// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging] +type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule struct { +type RulesetRuleDeleteResponseRulesRulesetsLogRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -2029,7 +2020,7 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRu // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleAction `json:"action"` + Action RulesetRuleDeleteResponseRulesRulesetsLogRuleAction `json:"action"` // The parameters configuring the rule's action. ActionParameters interface{} `json:"action_parameters"` // The categories of the rule. @@ -2041,16 +2032,15 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRu // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLogging `json:"logging"` + Logging RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON contains the JSON metadata for +// the struct [RulesetRuleDeleteResponseRulesRulesetsLogRule] +type rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -2066,41 +2056,39 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRu ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRule) implementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule() { -} +func (r RulesetRuleDeleteResponseRulesRulesetsLogRule) implementsRulesetRuleDeleteResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleAction string +type RulesetRuleDeleteResponseRulesRulesetsLogRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleActionLog RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleAction = "log" + RulesetRuleDeleteResponseRulesRulesetsLogRuleActionLog RulesetRuleDeleteResponseRulesRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLogging struct { +type RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLoggingJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLogging] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLoggingJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging] +type rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule struct { +type RulesetRuleDeleteResponseRulesRulesetsSkipRule struct { // The timestamp of when the rule was last modified. LastUpdated time.Time `json:"last_updated,required" format:"date-time"` // The version of the rule. @@ -2108,9 +2096,9 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipR // The unique ID of the rule. ID string `json:"id"` // The action to perform when the rule matches. - Action RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleAction `json:"action"` + Action RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction `json:"action"` // The parameters configuring the rule's action. - ActionParameters RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` + ActionParameters RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"` // The categories of the rule. Categories []string `json:"categories"` // An informative description of the rule. @@ -2120,16 +2108,15 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipR // The expression defining which traffic will match the rule. Expression string `json:"expression"` // An object configuring the rule's logging behavior. - Logging RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLogging `json:"logging"` + Logging RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging `json:"logging"` // The reference of the rule (the rule ID by default). - Ref string `json:"ref"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleJSON `json:"-"` + Ref string `json:"ref"` + JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON contains the JSON metadata +// for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRule] +type rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON struct { LastUpdated apijson.Field Version apijson.Field ID apijson.Field @@ -2145,43 +2132,42 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipR ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRule) implementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRule() { -} +func (r RulesetRuleDeleteResponseRulesRulesetsSkipRule) implementsRulesetRuleDeleteResponseRule() {} // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleAction string +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionSkip RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleAction = "skip" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionSkip RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParameters struct { +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` + Phases []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"` // A list of legacy security products to skip the execution of. - Products []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` + Products []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules map[string][]string `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` + Ruleset RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. - Rulesets []string `json:"rulesets"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` + Rulesets []string `json:"rulesets"` + JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParameters] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON contains the +// JSON metadata for the struct +// [RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters] +type rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON struct { Phases apijson.Field Products apijson.Field Rules apijson.Field @@ -2191,98 +2177,94 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipR ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A phase to skip the execution of. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase string +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct string +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "bic" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "hot" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "waf" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersRuleset string +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" + RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLogging struct { +type RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. - Enabled bool `json:"enabled,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` + Enabled bool `json:"enabled,required"` + JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLoggingJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLogging] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLoggingJSON struct { +// rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON +// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging] +type rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON struct { Enabled apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // This interface is a union satisfied by one of the following: -// [RulesetRuleUpdateParamsRulesetsBlockRule], -// [RulesetRuleUpdateParamsRulesetsExecuteRule], -// [RulesetRuleUpdateParamsRulesetsLogRule], -// [RulesetRuleUpdateParamsRulesetsSkipRule]. -type RulesetRuleUpdateParams interface { - ImplementsRulesetRuleUpdateParams() +// [RulesetRuleNewParamsRulesetsBlockRule], +// [RulesetRuleNewParamsRulesetsExecuteRule], +// [RulesetRuleNewParamsRulesetsLogRule], [RulesetRuleNewParamsRulesetsSkipRule]. +type RulesetRuleNewParams interface { + ImplementsRulesetRuleNewParams() } -type RulesetRuleUpdateParamsRulesetsBlockRule struct { - // The unique ID of the account. - AccountID param.Field[string] `path:"account_id,required"` +type RulesetRuleNewParamsRulesetsBlockRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleAction] `json:"action"` + Action param.Field[RulesetRuleNewParamsRulesetsBlockRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetRuleNewParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -2290,38 +2272,38 @@ type RulesetRuleUpdateParamsRulesetsBlockRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleNewParamsRulesetsBlockRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleUpdateParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleUpdateParamsRulesetsBlockRule) ImplementsRulesetRuleUpdateParams() { +func (RulesetRuleNewParamsRulesetsBlockRule) ImplementsRulesetRuleNewParams() { } // The action to perform when the rule matches. -type RulesetRuleUpdateParamsRulesetsBlockRuleAction string +type RulesetRuleNewParamsRulesetsBlockRuleAction string const ( - RulesetRuleUpdateParamsRulesetsBlockRuleActionBlock RulesetRuleUpdateParamsRulesetsBlockRuleAction = "block" + RulesetRuleNewParamsRulesetsBlockRuleActionBlock RulesetRuleNewParamsRulesetsBlockRuleAction = "block" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters struct { +type RulesetRuleNewParamsRulesetsBlockRuleActionParameters struct { // The response to show when the block is applied. - Response param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse] `json:"response"` + Response param.Field[RulesetRuleNewParamsRulesetsBlockRuleActionParametersResponse] `json:"response"` } -func (r RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The response to show when the block is applied. -type RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse struct { +type RulesetRuleNewParamsRulesetsBlockRuleActionParametersResponse struct { // The content to return. Content param.Field[string] `json:"content,required"` // The type of the content to return. @@ -2330,29 +2312,27 @@ type RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse struct { StatusCode param.Field[int64] `json:"status_code,required"` } -func (r RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // An object configuring the rule's logging behavior. -type RulesetRuleUpdateParamsRulesetsBlockRuleLogging struct { +type RulesetRuleNewParamsRulesetsBlockRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleUpdateParamsRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetRuleUpdateParamsRulesetsExecuteRule struct { - // The unique ID of the account. - AccountID param.Field[string] `path:"account_id,required"` +type RulesetRuleNewParamsRulesetsExecuteRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleAction] `json:"action"` + Action param.Field[RulesetRuleNewParamsRulesetsExecuteRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -2360,74 +2340,74 @@ type RulesetRuleUpdateParamsRulesetsExecuteRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleNewParamsRulesetsExecuteRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleUpdateParamsRulesetsExecuteRule) ImplementsRulesetRuleUpdateParams() { +func (RulesetRuleNewParamsRulesetsExecuteRule) ImplementsRulesetRuleNewParams() { } // The action to perform when the rule matches. -type RulesetRuleUpdateParamsRulesetsExecuteRuleAction string +type RulesetRuleNewParamsRulesetsExecuteRuleAction string const ( - RulesetRuleUpdateParamsRulesetsExecuteRuleActionExecute RulesetRuleUpdateParamsRulesetsExecuteRuleAction = "execute" + RulesetRuleNewParamsRulesetsExecuteRuleActionExecute RulesetRuleNewParamsRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters struct { +type RulesetRuleNewParamsRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID param.Field[string] `json:"id,required"` // The configuration to use for matched data logging. - MatchedData param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` + MatchedData param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` + Overrides param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration to use for matched data logging. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. PublicKey param.Field[string] `json:"public_key,required"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A set of overrides to apply to the target ruleset. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action param.Field[string] `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories param.Field[[]RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` + Categories param.Field[[]RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled param.Field[bool] `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules param.Field[[]RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` + Rules param.Field[[]RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A category-level override -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category param.Field[string] `json:"category,required"` // The action to override rules in the category with. @@ -2435,25 +2415,25 @@ type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory // Whether to enable execution of rules in the category. Enabled param.Field[bool] `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for rules in the category. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID param.Field[string] `json:"id,required"` // The action to override the rule with. @@ -2463,51 +2443,49 @@ type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule str // The score threshold to use for the rule. ScoreThreshold param.Field[int64] `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for the rule. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleNewParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateParamsRulesetsExecuteRuleLogging struct { +type RulesetRuleNewParamsRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleUpdateParamsRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetRuleUpdateParamsRulesetsLogRule struct { - // The unique ID of the account. - AccountID param.Field[string] `path:"account_id,required"` +type RulesetRuleNewParamsRulesetsLogRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleUpdateParamsRulesetsLogRuleAction] `json:"action"` + Action param.Field[RulesetRuleNewParamsRulesetsLogRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. @@ -2517,45 +2495,43 @@ type RulesetRuleUpdateParamsRulesetsLogRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleUpdateParamsRulesetsLogRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleNewParamsRulesetsLogRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleUpdateParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleUpdateParamsRulesetsLogRule) ImplementsRulesetRuleUpdateParams() { +func (RulesetRuleNewParamsRulesetsLogRule) ImplementsRulesetRuleNewParams() { } // The action to perform when the rule matches. -type RulesetRuleUpdateParamsRulesetsLogRuleAction string +type RulesetRuleNewParamsRulesetsLogRuleAction string const ( - RulesetRuleUpdateParamsRulesetsLogRuleActionLog RulesetRuleUpdateParamsRulesetsLogRuleAction = "log" + RulesetRuleNewParamsRulesetsLogRuleActionLog RulesetRuleNewParamsRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateParamsRulesetsLogRuleLogging struct { +type RulesetRuleNewParamsRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleUpdateParamsRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetRuleUpdateParamsRulesetsSkipRule struct { - // The unique ID of the account. - AccountID param.Field[string] `path:"account_id,required"` +type RulesetRuleNewParamsRulesetsSkipRule struct { // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleAction] `json:"action"` + Action param.Field[RulesetRuleNewParamsRulesetsSkipRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetRuleNewParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -2563,124 +2539,124 @@ type RulesetRuleUpdateParamsRulesetsSkipRule struct { // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleNewParamsRulesetsSkipRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleUpdateParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleUpdateParamsRulesetsSkipRule) ImplementsRulesetRuleUpdateParams() { +func (RulesetRuleNewParamsRulesetsSkipRule) ImplementsRulesetRuleNewParams() { } // The action to perform when the rule matches. -type RulesetRuleUpdateParamsRulesetsSkipRuleAction string +type RulesetRuleNewParamsRulesetsSkipRuleAction string const ( - RulesetRuleUpdateParamsRulesetsSkipRuleActionSkip RulesetRuleUpdateParamsRulesetsSkipRuleAction = "skip" + RulesetRuleNewParamsRulesetsSkipRuleActionSkip RulesetRuleNewParamsRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters struct { +type RulesetRuleNewParamsRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases param.Field[[]RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"` + Phases param.Field[[]RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"` // A list of legacy security products to skip the execution of. - Products param.Field[[]RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct] `json:"products"` + Products param.Field[[]RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct] `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules param.Field[map[string][]string] `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` + Ruleset param.Field[RulesetRuleNewParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets param.Field[[]string] `json:"rulesets"` } -func (r RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A phase to skip the execution of. -type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase string +type RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase string const ( - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleNewParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct string +type RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct string const ( - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductBic RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "bic" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductHot RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "hot" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductWAF RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "waf" - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductBic RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "bic" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductHot RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "hot" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductWAF RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "waf" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleNewParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset string +type RulesetRuleNewParamsRulesetsSkipRuleActionParametersRuleset string const ( - RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset = "current" + RulesetRuleNewParamsRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleNewParamsRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetRuleUpdateParamsRulesetsSkipRuleLogging struct { +type RulesetRuleNewParamsRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleUpdateParamsRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleNewParamsRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A response object. -type RulesetRuleUpdateResponseEnvelope struct { +type RulesetRuleNewResponseEnvelope struct { // A list of error messages. - Errors []RulesetRuleUpdateResponseEnvelopeErrors `json:"errors,required"` + Errors []RulesetRuleNewResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. - Messages []RulesetRuleUpdateResponseEnvelopeMessages `json:"messages,required"` + Messages []RulesetRuleNewResponseEnvelopeMessages `json:"messages,required"` // A result. - Result RulesetRuleUpdateResponse `json:"result,required"` + Result RulesetRuleNewResponse `json:"result,required"` // Whether the API call was successful. - Success RulesetRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetRuleUpdateResponseEnvelopeJSON `json:"-"` + Success RulesetRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetRuleNewResponseEnvelopeJSON `json:"-"` } -// rulesetRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [RulesetRuleUpdateResponseEnvelope] -type rulesetRuleUpdateResponseEnvelopeJSON struct { +// rulesetRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetRuleNewResponseEnvelope] +type rulesetRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -2689,24 +2665,24 @@ type rulesetRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetRuleUpdateResponseEnvelopeErrors struct { +type RulesetRuleNewResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetRuleUpdateResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` + Source RulesetRuleNewResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// rulesetRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RulesetRuleUpdateResponseEnvelopeErrors] -type rulesetRuleUpdateResponseEnvelopeErrorsJSON struct { +// rulesetRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RulesetRuleNewResponseEnvelopeErrors] +type rulesetRuleNewResponseEnvelopeErrorsJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -2714,43 +2690,43 @@ type rulesetRuleUpdateResponseEnvelopeErrorsJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetRuleUpdateResponseEnvelopeErrorsSource struct { +type RulesetRuleNewResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetRuleNewResponseEnvelopeErrorsSourceJSON `json:"-"` } -// rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for -// the struct [RulesetRuleUpdateResponseEnvelopeErrorsSource] -type rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON struct { +// rulesetRuleNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for +// the struct [RulesetRuleNewResponseEnvelopeErrorsSource] +type rulesetRuleNewResponseEnvelopeErrorsSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetRuleUpdateResponseEnvelopeMessages struct { +type RulesetRuleNewResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetRuleUpdateResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` + Source RulesetRuleNewResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// rulesetRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RulesetRuleUpdateResponseEnvelopeMessages] -type rulesetRuleUpdateResponseEnvelopeMessagesJSON struct { +// rulesetRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RulesetRuleNewResponseEnvelopeMessages] +type rulesetRuleNewResponseEnvelopeMessagesJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -2758,243 +2734,124 @@ type rulesetRuleUpdateResponseEnvelopeMessagesJSON struct { ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetRuleUpdateResponseEnvelopeMessagesSource struct { +type RulesetRuleNewResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetRuleNewResponseEnvelopeMessagesSourceJSON `json:"-"` } -// rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata -// for the struct [RulesetRuleUpdateResponseEnvelopeMessagesSource] -type rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON struct { +// rulesetRuleNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for +// the struct [RulesetRuleNewResponseEnvelopeMessagesSource] +type rulesetRuleNewResponseEnvelopeMessagesSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type RulesetRuleUpdateResponseEnvelopeSuccess bool +type RulesetRuleNewResponseEnvelopeSuccess bool const ( - RulesetRuleUpdateResponseEnvelopeSuccessTrue RulesetRuleUpdateResponseEnvelopeSuccess = true + RulesetRuleNewResponseEnvelopeSuccessTrue RulesetRuleNewResponseEnvelopeSuccess = true ) -// A response object. -type RulesetRuleDeleteResponseEnvelope struct { - // A list of error messages. - Errors []RulesetRuleDeleteResponseEnvelopeErrors `json:"errors,required"` - // A list of warning messages. - Messages []RulesetRuleDeleteResponseEnvelopeMessages `json:"messages,required"` - // A result. - Result RulesetRuleDeleteResponse `json:"result,required"` - // Whether the API call was successful. - Success RulesetRuleDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetRuleDeleteResponseEnvelopeJSON `json:"-"` +// This interface is a union satisfied by one of the following: +// [RulesetRuleUpdateParamsRulesetsBlockRule], +// [RulesetRuleUpdateParamsRulesetsExecuteRule], +// [RulesetRuleUpdateParamsRulesetsLogRule], +// [RulesetRuleUpdateParamsRulesetsSkipRule]. +type RulesetRuleUpdateParams interface { + ImplementsRulesetRuleUpdateParams() } -// rulesetRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [RulesetRuleDeleteResponseEnvelope] -type rulesetRuleDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field +type RulesetRuleUpdateParamsRulesetsBlockRule struct { + // The unique ID of the account. + AccountID param.Field[string] `path:"account_id,required"` + // The unique ID of the rule. + ID param.Field[string] `json:"id"` + // The action to perform when the rule matches. + Action param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleAction] `json:"action"` + // The parameters configuring the rule's action. + ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"` + // An informative description of the rule. + Description param.Field[string] `json:"description"` + // Whether the rule should be executed. + Enabled param.Field[bool] `json:"enabled"` + // The expression defining which traffic will match the rule. + Expression param.Field[string] `json:"expression"` + // An object configuring the rule's logging behavior. + Logging param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleLogging] `json:"logging"` + // The reference of the rule (the rule ID by default). + Ref param.Field[string] `json:"ref"` } -func (r *RulesetRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r RulesetRuleUpdateParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// A message. -type RulesetRuleDeleteResponseEnvelopeErrors struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetRuleDeleteResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` +func (RulesetRuleUpdateParamsRulesetsBlockRule) ImplementsRulesetRuleUpdateParams() { + } -// rulesetRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [RulesetRuleDeleteResponseEnvelopeErrors] -type rulesetRuleDeleteResponseEnvelopeErrorsJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field +// The action to perform when the rule matches. +type RulesetRuleUpdateParamsRulesetsBlockRuleAction string + +const ( + RulesetRuleUpdateParamsRulesetsBlockRuleActionBlock RulesetRuleUpdateParamsRulesetsBlockRuleAction = "block" +) + +// The parameters configuring the rule's action. +type RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters struct { + // The response to show when the block is applied. + Response param.Field[RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse] `json:"response"` } -func (r *RulesetRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// The source of this message. -type RulesetRuleDeleteResponseEnvelopeErrorsSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"` +// The response to show when the block is applied. +type RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse struct { + // The content to return. + Content param.Field[string] `json:"content,required"` + // The type of the content to return. + ContentType param.Field[string] `json:"content_type,required"` + // The status code to return. + StatusCode param.Field[int64] `json:"status_code,required"` } -// rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON contains the JSON metadata for -// the struct [RulesetRuleDeleteResponseEnvelopeErrorsSource] -type rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field +func (r RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -func (r *RulesetRuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// An object configuring the rule's logging behavior. +type RulesetRuleUpdateParamsRulesetsBlockRuleLogging struct { + // Whether to generate a log when the rule matches. + Enabled param.Field[bool] `json:"enabled,required"` } -// A message. -type RulesetRuleDeleteResponseEnvelopeMessages struct { - // A text description of this message. - Message string `json:"message,required"` - // A unique code for this message. - Code int64 `json:"code"` - // The source of this message. - Source RulesetRuleDeleteResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` +func (r RulesetRuleUpdateParamsRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// rulesetRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [RulesetRuleDeleteResponseEnvelopeMessages] -type rulesetRuleDeleteResponseEnvelopeMessagesJSON struct { - Message apijson.Field - Code apijson.Field - Source apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The source of this message. -type RulesetRuleDeleteResponseEnvelopeMessagesSource struct { - // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"` -} - -// rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON contains the JSON metadata -// for the struct [RulesetRuleDeleteResponseEnvelopeMessagesSource] -type rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON struct { - Pointer apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RulesetRuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful. -type RulesetRuleDeleteResponseEnvelopeSuccess bool - -const ( - RulesetRuleDeleteResponseEnvelopeSuccessTrue RulesetRuleDeleteResponseEnvelopeSuccess = true -) - -// This interface is a union satisfied by one of the following: -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRule], -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRule], -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRule], -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRule]. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams interface { - ImplementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams() -} - -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRule struct { - // The unique ID of the rule. - ID param.Field[string] `json:"id"` - // The action to perform when the rule matches. - Action param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleAction] `json:"action"` - // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParameters] `json:"action_parameters"` - // An informative description of the rule. - Description param.Field[string] `json:"description"` - // Whether the rule should be executed. - Enabled param.Field[bool] `json:"enabled"` - // The expression defining which traffic will match the rule. - Expression param.Field[string] `json:"expression"` - // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleLogging] `json:"logging"` - // The reference of the rule (the rule ID by default). - Ref param.Field[string] `json:"ref"` -} - -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRule) ImplementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams() { - -} - -// The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleAction string - -const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionBlock RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleAction = "block" -) - -// The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParameters struct { - // The response to show when the block is applied. - Response param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParametersResponse] `json:"response"` -} - -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The response to show when the block is applied. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParametersResponse struct { - // The content to return. - Content param.Field[string] `json:"content,required"` - // The type of the content to return. - ContentType param.Field[string] `json:"content_type,required"` - // The status code to return. - StatusCode param.Field[int64] `json:"status_code,required"` -} - -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleLogging struct { - // Whether to generate a log when the rule matches. - Enabled param.Field[bool] `json:"enabled,required"` -} - -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRule struct { +type RulesetRuleUpdateParamsRulesetsExecuteRule struct { + // The unique ID of the account. + AccountID param.Field[string] `path:"account_id,required"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleAction] `json:"action"` + Action param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -3002,74 +2859,74 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRule // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRule) ImplementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams() { +func (RulesetRuleUpdateParamsRulesetsExecuteRule) ImplementsRulesetRuleUpdateParams() { } // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleAction string +type RulesetRuleUpdateParamsRulesetsExecuteRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionExecute RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleAction = "execute" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionExecute RulesetRuleUpdateParamsRulesetsExecuteRuleAction = "execute" ) // The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParameters struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters struct { // The ID of the ruleset to execute. ID param.Field[string] `json:"id,required"` // The configuration to use for matched data logging. - MatchedData param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` + MatchedData param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"` // A set of overrides to apply to the target ruleset. - Overrides param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` + Overrides param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The configuration to use for matched data logging. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersMatchedData struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData struct { // The public key to encrypt matched data logs with. PublicKey param.Field[string] `json:"public_key,required"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A set of overrides to apply to the target ruleset. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverrides struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides struct { // An action to override all rules with. This option has lower precedence than rule // and category overrides. Action param.Field[string] `json:"action"` // A list of category-level overrides. This option has the second-highest // precedence after rule-level overrides. - Categories param.Field[[]RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` + Categories param.Field[[]RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"` // Whether to enable execution of all rules. This option has lower precedence than // rule and category overrides. Enabled param.Field[bool] `json:"enabled"` // A list of rule-level overrides. This option has the highest precedence. - Rules param.Field[[]RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` + Rules param.Field[[]RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"` // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. - SensitivityLevel param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A category-level override -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategory struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory struct { // The name of the category to override. Category param.Field[string] `json:"category,required"` // The action to override rules in the category with. @@ -3077,25 +2934,25 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleA // Whether to enable execution of rules in the category. Enabled param.Field[bool] `json:"enabled"` // The sensitivity level to use for rules in the category. - SensitivityLevel param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for rules in the category. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff" ) // A rule-level override -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRule struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule struct { // The ID of the rule to override. ID param.Field[string] `json:"id,required"` // The action to override the rule with. @@ -3105,49 +2962,51 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleA // The score threshold to use for the rule. ScoreThreshold param.Field[int64] `json:"score_threshold"` // The sensitivity level to use for the rule. - SensitivityLevel param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` + SensitivityLevel param.Field[RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The sensitivity level to use for the rule. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff" ) // A sensitivity level to set for all rules. This option has lower precedence than // rule and category overrides and is only applicable for DDoS phases. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string +type RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low" + RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleUpdateParamsRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleLogging struct { +type RulesetRuleUpdateParamsRulesetsExecuteRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRule struct { +type RulesetRuleUpdateParamsRulesetsLogRule struct { + // The unique ID of the account. + AccountID param.Field[string] `path:"account_id,required"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleAction] `json:"action"` + Action param.Field[RulesetRuleUpdateParamsRulesetsLogRuleAction] `json:"action"` // The parameters configuring the rule's action. ActionParameters param.Field[interface{}] `json:"action_parameters"` // An informative description of the rule. @@ -3157,43 +3016,45 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRule stru // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleUpdateParamsRulesetsLogRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsLogRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRule) ImplementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams() { +func (RulesetRuleUpdateParamsRulesetsLogRule) ImplementsRulesetRuleUpdateParams() { } // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleAction string +type RulesetRuleUpdateParamsRulesetsLogRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleActionLog RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleAction = "log" + RulesetRuleUpdateParamsRulesetsLogRuleActionLog RulesetRuleUpdateParamsRulesetsLogRuleAction = "log" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleLogging struct { +type RulesetRuleUpdateParamsRulesetsLogRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRule struct { +type RulesetRuleUpdateParamsRulesetsSkipRule struct { + // The unique ID of the account. + AccountID param.Field[string] `path:"account_id,required"` // The unique ID of the rule. ID param.Field[string] `json:"id"` // The action to perform when the rule matches. - Action param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleAction] `json:"action"` + Action param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleAction] `json:"action"` // The parameters configuring the rule's action. - ActionParameters param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"` + ActionParameters param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters] `json:"action_parameters"` // An informative description of the rule. Description param.Field[string] `json:"description"` // Whether the rule should be executed. @@ -3201,125 +3062,124 @@ type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRule str // The expression defining which traffic will match the rule. Expression param.Field[string] `json:"expression"` // An object configuring the rule's logging behavior. - Logging param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleLogging] `json:"logging"` + Logging param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleLogging] `json:"logging"` // The reference of the rule (the rule ID by default). Ref param.Field[string] `json:"ref"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsSkipRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRule) ImplementsRulesetRuleAccountRulesetsNewAnAccountRulesetRuleParams() { +func (RulesetRuleUpdateParamsRulesetsSkipRule) ImplementsRulesetRuleUpdateParams() { } // The action to perform when the rule matches. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleAction string +type RulesetRuleUpdateParamsRulesetsSkipRuleAction string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionSkip RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleAction = "skip" + RulesetRuleUpdateParamsRulesetsSkipRuleActionSkip RulesetRuleUpdateParamsRulesetsSkipRuleAction = "skip" ) // The parameters configuring the rule's action. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParameters struct { +type RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters struct { // A list of phases to skip the execution of. This option is incompatible with the // ruleset and rulesets options. - Phases param.Field[[]RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"` + Phases param.Field[[]RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase] `json:"phases"` // A list of legacy security products to skip the execution of. - Products param.Field[[]RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct] `json:"products"` + Products param.Field[[]RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct] `json:"products"` // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the // execution of. This option is incompatible with the ruleset option. Rules param.Field[map[string][]string] `json:"rules"` // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. - Ruleset param.Field[RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` + Ruleset param.Field[RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"` // A list of ruleset IDs to skip the execution of. This option is incompatible with // the ruleset and phases options. Rulesets param.Field[[]string] `json:"rulesets"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A phase to skip the execution of. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase string +type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "magic_transit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "ddos_l4" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "ddos_l7" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_config_settings" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_custom_errors" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_ratelimit" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_late_transform" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_origin" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_redirect" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_sanitize" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_sbfm" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_request_transform" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_compression" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersPhase = "magic_transit_managed" ) // The name of a legacy security product to skip the execution of. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct string +type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductBic RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "bic" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductHot RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "hot" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "rateLimit" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "securityLevel" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "uaBlock" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductWAF RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "waf" - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductBic RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "bic" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductHot RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "hot" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "rateLimit" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "securityLevel" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductUaBlock RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "uaBlock" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductWAF RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "waf" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersProduct = "zoneLockdown" ) // A ruleset to skip the execution of. This option is incompatible with the // rulesets, rules and phases options. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersRuleset string +type RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset string const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleActionParametersRuleset = "current" + RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleUpdateParamsRulesetsSkipRuleActionParametersRuleset = "current" ) // An object configuring the rule's logging behavior. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleLogging struct { +type RulesetRuleUpdateParamsRulesetsSkipRuleLogging struct { // Whether to generate a log when the rule matches. Enabled param.Field[bool] `json:"enabled,required"` } -func (r RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { +func (r RulesetRuleUpdateParamsRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A response object. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelope struct { +type RulesetRuleUpdateResponseEnvelope struct { // A list of error messages. - Errors []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrors `json:"errors,required"` + Errors []RulesetRuleUpdateResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. - Messages []RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessages `json:"messages,required"` + Messages []RulesetRuleUpdateResponseEnvelopeMessages `json:"messages,required"` // A result. - Result RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponse `json:"result,required"` + Result RulesetRuleUpdateResponse `json:"result,required"` // Whether the API call was successful. - Success RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeJSON `json:"-"` + Success RulesetRuleUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetRuleUpdateResponseEnvelopeJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelope] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeJSON struct { +// rulesetRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetRuleUpdateResponseEnvelope] +type rulesetRuleUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -3328,25 +3188,24 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrors struct { +type RulesetRuleUpdateResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsJSON `json:"-"` + Source RulesetRuleUpdateResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrors] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsJSON struct { +// rulesetRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RulesetRuleUpdateResponseEnvelopeErrors] +type rulesetRuleUpdateResponseEnvelopeErrorsJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -3354,45 +3213,43 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsJSON ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSource struct { +type RulesetRuleUpdateResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSourceJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSource] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSourceJSON struct { +// rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for +// the struct [RulesetRuleUpdateResponseEnvelopeErrorsSource] +type rulesetRuleUpdateResponseEnvelopeErrorsSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessages struct { +type RulesetRuleUpdateResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesJSON `json:"-"` + Source RulesetRuleUpdateResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessages] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesJSON struct { +// rulesetRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RulesetRuleUpdateResponseEnvelopeMessages] +type rulesetRuleUpdateResponseEnvelopeMessagesJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -3400,33 +3257,155 @@ type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesJS ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSource struct { +type RulesetRuleUpdateResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON `json:"-"` } -// rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSourceJSON -// contains the JSON metadata for the struct -// [RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSource] -type rulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSourceJSON struct { +// rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata +// for the struct [RulesetRuleUpdateResponseEnvelopeMessagesSource] +type rulesetRuleUpdateResponseEnvelopeMessagesSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetRuleUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeSuccess bool +type RulesetRuleUpdateResponseEnvelopeSuccess bool const ( - RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeSuccessTrue RulesetRuleAccountRulesetsNewAnAccountRulesetRuleResponseEnvelopeSuccess = true + RulesetRuleUpdateResponseEnvelopeSuccessTrue RulesetRuleUpdateResponseEnvelopeSuccess = true +) + +// A response object. +type RulesetRuleDeleteResponseEnvelope struct { + // A list of error messages. + Errors []RulesetRuleDeleteResponseEnvelopeErrors `json:"errors,required"` + // A list of warning messages. + Messages []RulesetRuleDeleteResponseEnvelopeMessages `json:"messages,required"` + // A result. + Result RulesetRuleDeleteResponse `json:"result,required"` + // Whether the API call was successful. + Success RulesetRuleDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetRuleDeleteResponseEnvelopeJSON `json:"-"` +} + +// rulesetRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetRuleDeleteResponseEnvelope] +type rulesetRuleDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetRuleDeleteResponseEnvelopeErrors struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetRuleDeleteResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` +} + +// rulesetRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RulesetRuleDeleteResponseEnvelopeErrors] +type rulesetRuleDeleteResponseEnvelopeErrorsJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetRuleDeleteResponseEnvelopeErrorsSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"` +} + +// rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON contains the JSON metadata for +// the struct [RulesetRuleDeleteResponseEnvelopeErrorsSource] +type rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetRuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A message. +type RulesetRuleDeleteResponseEnvelopeMessages struct { + // A text description of this message. + Message string `json:"message,required"` + // A unique code for this message. + Code int64 `json:"code"` + // The source of this message. + Source RulesetRuleDeleteResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` +} + +// rulesetRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [RulesetRuleDeleteResponseEnvelopeMessages] +type rulesetRuleDeleteResponseEnvelopeMessagesJSON struct { + Message apijson.Field + Code apijson.Field + Source apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The source of this message. +type RulesetRuleDeleteResponseEnvelopeMessagesSource struct { + // A JSON pointer to the field that is the source of the message. + Pointer string `json:"pointer,required"` + JSON rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"` +} + +// rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON contains the JSON metadata +// for the struct [RulesetRuleDeleteResponseEnvelopeMessagesSource] +type rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON struct { + Pointer apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RulesetRuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful. +type RulesetRuleDeleteResponseEnvelopeSuccess bool + +const ( + RulesetRuleDeleteResponseEnvelopeSuccessTrue RulesetRuleDeleteResponseEnvelopeSuccess = true ) diff --git a/rulesetrule_test.go b/rulesetrule_test.go index d9dc049c1a8..a2d5f0c5242 100644 --- a/rulesetrule_test.go +++ b/rulesetrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRulesetRuleUpdateWithOptionalParams(t *testing.T) { +func TestRulesetRuleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,16 +29,16 @@ func TestRulesetRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Rules.Update( + _, err := client.Rulesets.Rules.New( context.TODO(), + "string", + "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", - "3a03d665bac047339bb530ecb439a90d", - cloudflare.RulesetRuleUpdateParamsRulesetsBlockRule{ - AccountID: cloudflare.F("abf9b32d38c5f572afde3336ec0ce302"), - ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), - Action: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionBlock), - ActionParameters: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters{ - Response: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse{ + cloudflare.RulesetRuleNewParamsRulesetsBlockRule{ + ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), + Action: cloudflare.F(cloudflare.RulesetRuleNewParamsRulesetsBlockRuleActionBlock), + ActionParameters: cloudflare.F(cloudflare.RulesetRuleNewParamsRulesetsBlockRuleActionParameters{ + Response: cloudflare.F(cloudflare.RulesetRuleNewParamsRulesetsBlockRuleActionParametersResponse{ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), ContentType: cloudflare.F("application/json"), StatusCode: cloudflare.F(int64(400)), @@ -47,7 +47,7 @@ func TestRulesetRuleUpdateWithOptionalParams(t *testing.T) { Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), Enabled: cloudflare.F(true), Expression: cloudflare.F("ip.src ne 1.1.1.1"), - Logging: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleLogging{ + Logging: cloudflare.F(cloudflare.RulesetRuleNewParamsRulesetsBlockRuleLogging{ Enabled: cloudflare.F(true), }), Ref: cloudflare.F("my_ref"), @@ -62,7 +62,7 @@ func TestRulesetRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestRulesetRuleDelete(t *testing.T) { +func TestRulesetRuleUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -78,12 +78,29 @@ func TestRulesetRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Rules.Delete( + _, err := client.Rulesets.Rules.Update( context.TODO(), - "string", - "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", "3a03d665bac047339bb530ecb439a90d", + cloudflare.RulesetRuleUpdateParamsRulesetsBlockRule{ + AccountID: cloudflare.F("abf9b32d38c5f572afde3336ec0ce302"), + ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), + Action: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionBlock), + ActionParameters: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionParameters{ + Response: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleActionParametersResponse{ + Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), + ContentType: cloudflare.F("application/json"), + StatusCode: cloudflare.F(int64(400)), + }), + }), + Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("ip.src ne 1.1.1.1"), + Logging: cloudflare.F(cloudflare.RulesetRuleUpdateParamsRulesetsBlockRuleLogging{ + Enabled: cloudflare.F(true), + }), + Ref: cloudflare.F("my_ref"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -94,7 +111,7 @@ func TestRulesetRuleDelete(t *testing.T) { } } -func TestRulesetRuleAccountRulesetsNewAnAccountRulesetRuleWithOptionalParams(t *testing.T) { +func TestRulesetRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -110,29 +127,12 @@ func TestRulesetRuleAccountRulesetsNewAnAccountRulesetRuleWithOptionalParams(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Rules.AccountRulesetsNewAnAccountRulesetRule( + _, err := client.Rulesets.Rules.Delete( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", - cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRule{ - ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"), - Action: cloudflare.F(cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionBlock), - ActionParameters: cloudflare.F(cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParameters{ - Response: cloudflare.F(cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleActionParametersResponse{ - Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"), - ContentType: cloudflare.F("application/json"), - StatusCode: cloudflare.F(int64(400)), - }), - }), - Description: cloudflare.F("Block when the IP address is not 1.1.1.1"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("ip.src ne 1.1.1.1"), - Logging: cloudflare.F(cloudflare.RulesetRuleAccountRulesetsNewAnAccountRulesetRuleParamsRulesetsBlockRuleLogging{ - Enabled: cloudflare.F(true), - }), - Ref: cloudflare.F("my_ref"), - }, + "3a03d665bac047339bb530ecb439a90d", ) if err != nil { var apierr *cloudflare.Error diff --git a/rulesetversion.go b/rulesetversion.go index 0623f55bb7c..f4a7f5da40b 100644 --- a/rulesetversion.go +++ b/rulesetversion.go @@ -35,19 +35,10 @@ func NewRulesetVersionService(opts ...option.RequestOption) (r *RulesetVersionSe return } -// Deletes an existing version of an account or zone ruleset. -func (r *RulesetVersionService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string, opts ...option.RequestOption) (err error) { - opts = append(r.Options[:], opts...) - opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) - return -} - // Fetches the versions of an account or zone ruleset. -func (r *RulesetVersionService) AccountRulesetsListAnAccountRulesetSVersions(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) (res *[]RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse, err error) { +func (r *RulesetVersionService) List(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, opts ...option.RequestOption) (res *[]RulesetVersionListResponse, err error) { opts = append(r.Options[:], opts...) - var env RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelope + var env RulesetVersionListResponseEnvelope path := fmt.Sprintf("%s/%s/rulesets/%s/versions", accountOrZone, accountOrZoneID, rulesetID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -57,6 +48,15 @@ func (r *RulesetVersionService) AccountRulesetsListAnAccountRulesetSVersions(ctx return } +// Deletes an existing version of an account or zone ruleset. +func (r *RulesetVersionService) Delete(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string, opts ...option.RequestOption) (err error) { + opts = append(r.Options[:], opts...) + opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) + path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) + return +} + // Fetches a specific version of an account or zone ruleset. func (r *RulesetVersionService) Get(ctx context.Context, accountOrZone string, accountOrZoneID string, rulesetID string, rulesetVersion string, opts ...option.RequestOption) (res *RulesetVersionGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -71,13 +71,13 @@ func (r *RulesetVersionService) Get(ctx context.Context, accountOrZone string, a } // A ruleset object. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse struct { +type RulesetVersionListResponse struct { // The kind of the ruleset. - Kind RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind `json:"kind,required"` + Kind RulesetVersionListResponseKind `json:"kind,required"` // The human-readable name of the ruleset. Name string `json:"name,required"` // The phase of the ruleset. - Phase RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase `json:"phase,required"` + Phase RulesetVersionListResponsePhase `json:"phase,required"` // The unique ID of the ruleset. ID string `json:"id"` // An informative description of the ruleset. @@ -85,14 +85,13 @@ type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse struct { // The timestamp of when the ruleset was last modified. LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the ruleset. - Version string `json:"version"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseJSON `json:"-"` + Version string `json:"version"` + JSON rulesetVersionListResponseJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseJSON contains -// the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseJSON struct { +// rulesetVersionListResponseJSON contains the JSON metadata for the struct +// [RulesetVersionListResponse] +type rulesetVersionListResponseJSON struct { Kind apijson.Field Name apijson.Field Phase apijson.Field @@ -104,47 +103,47 @@ type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseJSON stru ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The kind of the ruleset. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind string +type RulesetVersionListResponseKind string const ( - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKindManaged RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind = "managed" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKindCustom RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind = "custom" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKindRoot RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind = "root" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKindZone RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseKind = "zone" + RulesetVersionListResponseKindManaged RulesetVersionListResponseKind = "managed" + RulesetVersionListResponseKindCustom RulesetVersionListResponseKind = "custom" + RulesetVersionListResponseKindRoot RulesetVersionListResponseKind = "root" + RulesetVersionListResponseKindZone RulesetVersionListResponseKind = "zone" ) // The phase of the ruleset. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase string +type RulesetVersionListResponsePhase string const ( - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseDDOSL4 RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "ddos_l4" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseDDOSL7 RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "ddos_l7" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPConfigSettings RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_config_settings" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPCustomErrors RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_custom_errors" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPLogCustomFields RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_log_custom_fields" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRatelimit RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_ratelimit" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestCacheSettings RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_cache_settings" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestDynamicRedirect RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_dynamic_redirect" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestFirewallCustom RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_firewall_custom" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestFirewallManaged RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_firewall_managed" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestLateTransform RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_late_transform" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestOrigin RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_origin" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestRedirect RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_redirect" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestSanitize RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_sanitize" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestSbfm RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_sbfm" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestSelectConfiguration RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_select_configuration" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPRequestTransform RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_request_transform" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPResponseCompression RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_response_compression" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPResponseFirewallManaged RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_response_firewall_managed" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseHTTPResponseHeadersTransform RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "http_response_headers_transform" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseMagicTransit RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "magic_transit" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseMagicTransitIDsManaged RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "magic_transit_ids_managed" - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhaseMagicTransitManaged RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponsePhase = "magic_transit_managed" + RulesetVersionListResponsePhaseDDOSL4 RulesetVersionListResponsePhase = "ddos_l4" + RulesetVersionListResponsePhaseDDOSL7 RulesetVersionListResponsePhase = "ddos_l7" + RulesetVersionListResponsePhaseHTTPConfigSettings RulesetVersionListResponsePhase = "http_config_settings" + RulesetVersionListResponsePhaseHTTPCustomErrors RulesetVersionListResponsePhase = "http_custom_errors" + RulesetVersionListResponsePhaseHTTPLogCustomFields RulesetVersionListResponsePhase = "http_log_custom_fields" + RulesetVersionListResponsePhaseHTTPRatelimit RulesetVersionListResponsePhase = "http_ratelimit" + RulesetVersionListResponsePhaseHTTPRequestCacheSettings RulesetVersionListResponsePhase = "http_request_cache_settings" + RulesetVersionListResponsePhaseHTTPRequestDynamicRedirect RulesetVersionListResponsePhase = "http_request_dynamic_redirect" + RulesetVersionListResponsePhaseHTTPRequestFirewallCustom RulesetVersionListResponsePhase = "http_request_firewall_custom" + RulesetVersionListResponsePhaseHTTPRequestFirewallManaged RulesetVersionListResponsePhase = "http_request_firewall_managed" + RulesetVersionListResponsePhaseHTTPRequestLateTransform RulesetVersionListResponsePhase = "http_request_late_transform" + RulesetVersionListResponsePhaseHTTPRequestOrigin RulesetVersionListResponsePhase = "http_request_origin" + RulesetVersionListResponsePhaseHTTPRequestRedirect RulesetVersionListResponsePhase = "http_request_redirect" + RulesetVersionListResponsePhaseHTTPRequestSanitize RulesetVersionListResponsePhase = "http_request_sanitize" + RulesetVersionListResponsePhaseHTTPRequestSbfm RulesetVersionListResponsePhase = "http_request_sbfm" + RulesetVersionListResponsePhaseHTTPRequestSelectConfiguration RulesetVersionListResponsePhase = "http_request_select_configuration" + RulesetVersionListResponsePhaseHTTPRequestTransform RulesetVersionListResponsePhase = "http_request_transform" + RulesetVersionListResponsePhaseHTTPResponseCompression RulesetVersionListResponsePhase = "http_response_compression" + RulesetVersionListResponsePhaseHTTPResponseFirewallManaged RulesetVersionListResponsePhase = "http_response_firewall_managed" + RulesetVersionListResponsePhaseHTTPResponseHeadersTransform RulesetVersionListResponsePhase = "http_response_headers_transform" + RulesetVersionListResponsePhaseMagicTransit RulesetVersionListResponsePhase = "magic_transit" + RulesetVersionListResponsePhaseMagicTransitIDsManaged RulesetVersionListResponsePhase = "magic_transit_ids_managed" + RulesetVersionListResponsePhaseMagicTransitManaged RulesetVersionListResponsePhase = "magic_transit_managed" ) // A result. @@ -874,22 +873,21 @@ func (r *RulesetVersionGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(da } // A response object. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelope struct { +type RulesetVersionListResponseEnvelope struct { // A list of error messages. - Errors []RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrors `json:"errors,required"` + Errors []RulesetVersionListResponseEnvelopeErrors `json:"errors,required"` // A list of warning messages. - Messages []RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessages `json:"messages,required"` + Messages []RulesetVersionListResponseEnvelopeMessages `json:"messages,required"` // A result. - Result []RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponse `json:"result,required"` + Result []RulesetVersionListResponse `json:"result,required"` // Whether the API call was successful. - Success RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeSuccess `json:"success,required"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeJSON `json:"-"` + Success RulesetVersionListResponseEnvelopeSuccess `json:"success,required"` + JSON rulesetVersionListResponseEnvelopeJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelope] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeJSON struct { +// rulesetVersionListResponseEnvelopeJSON contains the JSON metadata for the struct +// [RulesetVersionListResponseEnvelope] +type rulesetVersionListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -898,25 +896,24 @@ type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeJ ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrors struct { +type RulesetVersionListResponseEnvelopeErrors struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSource `json:"source"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsJSON `json:"-"` + Source RulesetVersionListResponseEnvelopeErrorsSource `json:"source"` + JSON rulesetVersionListResponseEnvelopeErrorsJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrors] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsJSON struct { +// rulesetVersionListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [RulesetVersionListResponseEnvelopeErrors] +type rulesetVersionListResponseEnvelopeErrorsJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -924,45 +921,43 @@ type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeE ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSource struct { +type RulesetVersionListResponseEnvelopeErrorsSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetVersionListResponseEnvelopeErrorsSourceJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSourceJSON -// contains the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSource] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSourceJSON struct { +// rulesetVersionListResponseEnvelopeErrorsSourceJSON contains the JSON metadata +// for the struct [RulesetVersionListResponseEnvelopeErrorsSource] +type rulesetVersionListResponseEnvelopeErrorsSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A message. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessages struct { +type RulesetVersionListResponseEnvelopeMessages struct { // A text description of this message. Message string `json:"message,required"` // A unique code for this message. Code int64 `json:"code"` // The source of this message. - Source RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSource `json:"source"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesJSON `json:"-"` + Source RulesetVersionListResponseEnvelopeMessagesSource `json:"source"` + JSON rulesetVersionListResponseEnvelopeMessagesJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessages] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesJSON struct { +// rulesetVersionListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [RulesetVersionListResponseEnvelopeMessages] +type rulesetVersionListResponseEnvelopeMessagesJSON struct { Message apijson.Field Code apijson.Field Source apijson.Field @@ -970,35 +965,34 @@ type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeM ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The source of this message. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSource struct { +type RulesetVersionListResponseEnvelopeMessagesSource struct { // A JSON pointer to the field that is the source of the message. - Pointer string `json:"pointer,required"` - JSON rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSourceJSON `json:"-"` + Pointer string `json:"pointer,required"` + JSON rulesetVersionListResponseEnvelopeMessagesSourceJSON `json:"-"` } -// rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSourceJSON -// contains the JSON metadata for the struct -// [RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSource] -type rulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSourceJSON struct { +// rulesetVersionListResponseEnvelopeMessagesSourceJSON contains the JSON metadata +// for the struct [RulesetVersionListResponseEnvelopeMessagesSource] +type rulesetVersionListResponseEnvelopeMessagesSourceJSON struct { Pointer apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { +func (r *RulesetVersionListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful. -type RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeSuccess bool +type RulesetVersionListResponseEnvelopeSuccess bool const ( - RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeSuccessTrue RulesetVersionAccountRulesetsListAnAccountRulesetSVersionsResponseEnvelopeSuccess = true + RulesetVersionListResponseEnvelopeSuccessTrue RulesetVersionListResponseEnvelopeSuccess = true ) // A response object. diff --git a/rulesetversion_test.go b/rulesetversion_test.go index 547b69b9b5f..b24599a7b00 100644 --- a/rulesetversion_test.go +++ b/rulesetversion_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestRulesetVersionDelete(t *testing.T) { +func TestRulesetVersionList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,11 @@ func TestRulesetVersionDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Rulesets.Versions.Delete( + _, err := client.Rulesets.Versions.List( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", - "1", ) if err != nil { var apierr *cloudflare.Error @@ -45,7 +44,7 @@ func TestRulesetVersionDelete(t *testing.T) { } } -func TestRulesetVersionAccountRulesetsListAnAccountRulesetSVersions(t *testing.T) { +func TestRulesetVersionDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,11 +60,12 @@ func TestRulesetVersionAccountRulesetsListAnAccountRulesetSVersions(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rulesets.Versions.AccountRulesetsListAnAccountRulesetSVersions( + err := client.Rulesets.Versions.Delete( context.TODO(), "string", "abf9b32d38c5f572afde3336ec0ce302", "2f2feab2026849078ba485f918791bdc", + "1", ) if err != nil { var apierr *cloudflare.Error diff --git a/rumrule.go b/rumrule.go index 3cec890d15b..9a15c450fe2 100644 --- a/rumrule.go +++ b/rumrule.go @@ -44,19 +44,6 @@ func (r *RumRuleService) New(ctx context.Context, accountID string, rulesetID st return } -// Updates a rule in a Web Analytics ruleset. -func (r *RumRuleService) Update(ctx context.Context, accountID string, rulesetID string, ruleID string, body RumRuleUpdateParams, opts ...option.RequestOption) (res *RumRuleUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env RumRuleUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", accountID, rulesetID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists all the rules in a Web Analytics ruleset. func (r *RumRuleService) List(ctx context.Context, accountID string, rulesetID string, opts ...option.RequestOption) (res *RumRuleListResponse, err error) { opts = append(r.Options[:], opts...) @@ -83,6 +70,19 @@ func (r *RumRuleService) Delete(ctx context.Context, accountID string, rulesetID return } +// Updates a rule in a Web Analytics ruleset. +func (r *RumRuleService) Replace(ctx context.Context, accountID string, rulesetID string, ruleID string, body RumRuleReplaceParams, opts ...option.RequestOption) (res *RumRuleReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env RumRuleReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", accountID, rulesetID, ruleID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type RumRuleNewResponse struct { // The Web Analytics rule identifier. ID string `json:"id"` @@ -117,40 +117,6 @@ func (r *RumRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumRuleUpdateResponse struct { - // The Web Analytics rule identifier. - ID string `json:"id"` - Created time.Time `json:"created" format:"date-time"` - // The hostname the rule will be applied to. - Host string `json:"host"` - // Whether the rule includes or excludes traffic from being measured. - Inclusive bool `json:"inclusive"` - // Whether the rule is paused or not. - IsPaused bool `json:"is_paused"` - // The paths the rule will be applied to. - Paths []string `json:"paths"` - Priority float64 `json:"priority"` - JSON rumRuleUpdateResponseJSON `json:"-"` -} - -// rumRuleUpdateResponseJSON contains the JSON metadata for the struct -// [RumRuleUpdateResponse] -type rumRuleUpdateResponseJSON struct { - ID apijson.Field - Created apijson.Field - Host apijson.Field - Inclusive apijson.Field - IsPaused apijson.Field - Paths apijson.Field - Priority apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RumRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type RumRuleListResponse struct { // A list of rules. Rules []RumRuleListResponseRule `json:"rules"` @@ -249,37 +215,41 @@ func (r *RumRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumRuleNewParams struct { - Host param.Field[string] `json:"host"` +type RumRuleReplaceResponse struct { + // The Web Analytics rule identifier. + ID string `json:"id"` + Created time.Time `json:"created" format:"date-time"` + // The hostname the rule will be applied to. + Host string `json:"host"` // Whether the rule includes or excludes traffic from being measured. - Inclusive param.Field[bool] `json:"inclusive"` + Inclusive bool `json:"inclusive"` // Whether the rule is paused or not. - IsPaused param.Field[bool] `json:"is_paused"` - Paths param.Field[[]string] `json:"paths"` -} - -func (r RumRuleNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type RumRuleNewResponseEnvelope struct { - Result RumRuleNewResponse `json:"result"` - JSON rumRuleNewResponseEnvelopeJSON `json:"-"` + IsPaused bool `json:"is_paused"` + // The paths the rule will be applied to. + Paths []string `json:"paths"` + Priority float64 `json:"priority"` + JSON rumRuleReplaceResponseJSON `json:"-"` } -// rumRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [RumRuleNewResponseEnvelope] -type rumRuleNewResponseEnvelopeJSON struct { - Result apijson.Field +// rumRuleReplaceResponseJSON contains the JSON metadata for the struct +// [RumRuleReplaceResponse] +type rumRuleReplaceResponseJSON struct { + ID apijson.Field + Created apijson.Field + Host apijson.Field + Inclusive apijson.Field + IsPaused apijson.Field + Paths apijson.Field + Priority apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RumRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RumRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumRuleUpdateParams struct { +type RumRuleNewParams struct { Host param.Field[string] `json:"host"` // Whether the rule includes or excludes traffic from being measured. Inclusive param.Field[bool] `json:"inclusive"` @@ -288,24 +258,24 @@ type RumRuleUpdateParams struct { Paths param.Field[[]string] `json:"paths"` } -func (r RumRuleUpdateParams) MarshalJSON() (data []byte, err error) { +func (r RumRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RumRuleUpdateResponseEnvelope struct { - Result RumRuleUpdateResponse `json:"result"` - JSON rumRuleUpdateResponseEnvelopeJSON `json:"-"` +type RumRuleNewResponseEnvelope struct { + Result RumRuleNewResponse `json:"result"` + JSON rumRuleNewResponseEnvelopeJSON `json:"-"` } -// rumRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [RumRuleUpdateResponseEnvelope] -type rumRuleUpdateResponseEnvelopeJSON struct { +// rumRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RumRuleNewResponseEnvelope] +type rumRuleNewResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RumRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RumRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -342,3 +312,33 @@ type rumRuleDeleteResponseEnvelopeJSON struct { func (r *RumRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type RumRuleReplaceParams struct { + Host param.Field[string] `json:"host"` + // Whether the rule includes or excludes traffic from being measured. + Inclusive param.Field[bool] `json:"inclusive"` + // Whether the rule is paused or not. + IsPaused param.Field[bool] `json:"is_paused"` + Paths param.Field[[]string] `json:"paths"` +} + +func (r RumRuleReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type RumRuleReplaceResponseEnvelope struct { + Result RumRuleReplaceResponse `json:"result"` + JSON rumRuleReplaceResponseEnvelopeJSON `json:"-"` +} + +// rumRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [RumRuleReplaceResponseEnvelope] +type rumRuleReplaceResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RumRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/rumrule_test.go b/rumrule_test.go index 13c79fcf702..7638ea68f3a 100644 --- a/rumrule_test.go +++ b/rumrule_test.go @@ -49,7 +49,7 @@ func TestRumRuleNewWithOptionalParams(t *testing.T) { } } -func TestRumRuleUpdateWithOptionalParams(t *testing.T) { +func TestRumRuleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -65,17 +65,10 @@ func TestRumRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.Rules.Update( + _, err := client.Rum.Rules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - cloudflare.RumRuleUpdateParams{ - Host: cloudflare.F("example.com"), - Inclusive: cloudflare.F(true), - IsPaused: cloudflare.F(false), - Paths: cloudflare.F([]string{"*"}), - }, ) if err != nil { var apierr *cloudflare.Error @@ -86,7 +79,7 @@ func TestRumRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestRumRuleList(t *testing.T) { +func TestRumRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -102,10 +95,11 @@ func TestRumRuleList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.Rules.List( + _, err := client.Rum.Rules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error @@ -116,7 +110,7 @@ func TestRumRuleList(t *testing.T) { } } -func TestRumRuleDelete(t *testing.T) { +func TestRumRuleReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -132,11 +126,17 @@ func TestRumRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.Rules.Delete( + _, err := client.Rum.Rules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + cloudflare.RumRuleReplaceParams{ + Host: cloudflare.F("example.com"), + Inclusive: cloudflare.F(true), + IsPaused: cloudflare.F(false), + Paths: cloudflare.F([]string{"*"}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/rumsiteinfo.go b/rumsiteinfo.go index 64f8f18eaab..029f01b8274 100644 --- a/rumsiteinfo.go +++ b/rumsiteinfo.go @@ -48,19 +48,6 @@ func (r *RumSiteInfoService) New(ctx context.Context, accountID string, body Rum return } -// Updates an existing Web Analytics site. -func (r *RumSiteInfoService) Update(ctx context.Context, accountID string, siteID string, body RumSiteInfoUpdateParams, opts ...option.RequestOption) (res *RumSiteInfoUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env RumSiteInfoUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/rum/site_info/%s", accountID, siteID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists all Web Analytics sites of an account. func (r *RumSiteInfoService) List(ctx context.Context, accountID string, query RumSiteInfoListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RumSiteInfoListResponse], err error) { var raw *http.Response @@ -110,6 +97,19 @@ func (r *RumSiteInfoService) Get(ctx context.Context, accountID string, siteID s return } +// Updates an existing Web Analytics site. +func (r *RumSiteInfoService) Replace(ctx context.Context, accountID string, siteID string, body RumSiteInfoReplaceParams, opts ...option.RequestOption) (res *RumSiteInfoReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env RumSiteInfoReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/rum/site_info/%s", accountID, siteID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type RumSiteInfoNewResponse struct { // If enabled, the JavaScript snippet is automatically injected for orange-clouded // sites. @@ -205,101 +205,6 @@ func (r *RumSiteInfoNewResponseRuleset) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumSiteInfoUpdateResponse struct { - // If enabled, the JavaScript snippet is automatically injected for orange-clouded - // sites. - AutoInstall bool `json:"auto_install"` - Created time.Time `json:"created" format:"date-time"` - // A list of rules. - Rules []RumSiteInfoUpdateResponseRule `json:"rules"` - Ruleset RumSiteInfoUpdateResponseRuleset `json:"ruleset"` - // The Web Analytics site identifier. - SiteTag string `json:"site_tag"` - // The Web Analytics site token. - SiteToken string `json:"site_token"` - // Encoded JavaScript snippet. - Snippet string `json:"snippet"` - JSON rumSiteInfoUpdateResponseJSON `json:"-"` -} - -// rumSiteInfoUpdateResponseJSON contains the JSON metadata for the struct -// [RumSiteInfoUpdateResponse] -type rumSiteInfoUpdateResponseJSON struct { - AutoInstall apijson.Field - Created apijson.Field - Rules apijson.Field - Ruleset apijson.Field - SiteTag apijson.Field - SiteToken apijson.Field - Snippet apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RumSiteInfoUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RumSiteInfoUpdateResponseRule struct { - // The Web Analytics rule identifier. - ID string `json:"id"` - Created time.Time `json:"created" format:"date-time"` - // The hostname the rule will be applied to. - Host string `json:"host"` - // Whether the rule includes or excludes traffic from being measured. - Inclusive bool `json:"inclusive"` - // Whether the rule is paused or not. - IsPaused bool `json:"is_paused"` - // The paths the rule will be applied to. - Paths []string `json:"paths"` - Priority float64 `json:"priority"` - JSON rumSiteInfoUpdateResponseRuleJSON `json:"-"` -} - -// rumSiteInfoUpdateResponseRuleJSON contains the JSON metadata for the struct -// [RumSiteInfoUpdateResponseRule] -type rumSiteInfoUpdateResponseRuleJSON struct { - ID apijson.Field - Created apijson.Field - Host apijson.Field - Inclusive apijson.Field - IsPaused apijson.Field - Paths apijson.Field - Priority apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RumSiteInfoUpdateResponseRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RumSiteInfoUpdateResponseRuleset struct { - // The Web Analytics ruleset identifier. - ID string `json:"id"` - // Whether the ruleset is enabled. - Enabled bool `json:"enabled"` - ZoneName string `json:"zone_name"` - // The zone identifier. - ZoneTag string `json:"zone_tag"` - JSON rumSiteInfoUpdateResponseRulesetJSON `json:"-"` -} - -// rumSiteInfoUpdateResponseRulesetJSON contains the JSON metadata for the struct -// [RumSiteInfoUpdateResponseRuleset] -type rumSiteInfoUpdateResponseRulesetJSON struct { - ID apijson.Field - Enabled apijson.Field - ZoneName apijson.Field - ZoneTag apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RumSiteInfoUpdateResponseRuleset) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type RumSiteInfoListResponse struct { // If enabled, the JavaScript snippet is automatically injected for orange-clouded // sites. @@ -508,38 +413,102 @@ func (r *RumSiteInfoGetResponseRuleset) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumSiteInfoNewParams struct { +type RumSiteInfoReplaceResponse struct { // If enabled, the JavaScript snippet is automatically injected for orange-clouded // sites. - AutoInstall param.Field[bool] `json:"auto_install"` - // The hostname to use for gray-clouded sites. - Host param.Field[string] `json:"host"` - // The zone identifier. - ZoneTag param.Field[string] `json:"zone_tag"` + AutoInstall bool `json:"auto_install"` + Created time.Time `json:"created" format:"date-time"` + // A list of rules. + Rules []RumSiteInfoReplaceResponseRule `json:"rules"` + Ruleset RumSiteInfoReplaceResponseRuleset `json:"ruleset"` + // The Web Analytics site identifier. + SiteTag string `json:"site_tag"` + // The Web Analytics site token. + SiteToken string `json:"site_token"` + // Encoded JavaScript snippet. + Snippet string `json:"snippet"` + JSON rumSiteInfoReplaceResponseJSON `json:"-"` } -func (r RumSiteInfoNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// rumSiteInfoReplaceResponseJSON contains the JSON metadata for the struct +// [RumSiteInfoReplaceResponse] +type rumSiteInfoReplaceResponseJSON struct { + AutoInstall apijson.Field + Created apijson.Field + Rules apijson.Field + Ruleset apijson.Field + SiteTag apijson.Field + SiteToken apijson.Field + Snippet apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type RumSiteInfoNewResponseEnvelope struct { - Result RumSiteInfoNewResponse `json:"result"` - JSON rumSiteInfoNewResponseEnvelopeJSON `json:"-"` +func (r *RumSiteInfoReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// rumSiteInfoNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [RumSiteInfoNewResponseEnvelope] -type rumSiteInfoNewResponseEnvelopeJSON struct { - Result apijson.Field +type RumSiteInfoReplaceResponseRule struct { + // The Web Analytics rule identifier. + ID string `json:"id"` + Created time.Time `json:"created" format:"date-time"` + // The hostname the rule will be applied to. + Host string `json:"host"` + // Whether the rule includes or excludes traffic from being measured. + Inclusive bool `json:"inclusive"` + // Whether the rule is paused or not. + IsPaused bool `json:"is_paused"` + // The paths the rule will be applied to. + Paths []string `json:"paths"` + Priority float64 `json:"priority"` + JSON rumSiteInfoReplaceResponseRuleJSON `json:"-"` +} + +// rumSiteInfoReplaceResponseRuleJSON contains the JSON metadata for the struct +// [RumSiteInfoReplaceResponseRule] +type rumSiteInfoReplaceResponseRuleJSON struct { + ID apijson.Field + Created apijson.Field + Host apijson.Field + Inclusive apijson.Field + IsPaused apijson.Field + Paths apijson.Field + Priority apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RumSiteInfoNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RumSiteInfoReplaceResponseRule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type RumSiteInfoReplaceResponseRuleset struct { + // The Web Analytics ruleset identifier. + ID string `json:"id"` + // Whether the ruleset is enabled. + Enabled bool `json:"enabled"` + ZoneName string `json:"zone_name"` + // The zone identifier. + ZoneTag string `json:"zone_tag"` + JSON rumSiteInfoReplaceResponseRulesetJSON `json:"-"` +} + +// rumSiteInfoReplaceResponseRulesetJSON contains the JSON metadata for the struct +// [RumSiteInfoReplaceResponseRuleset] +type rumSiteInfoReplaceResponseRulesetJSON struct { + ID apijson.Field + Enabled apijson.Field + ZoneName apijson.Field + ZoneTag apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RumSiteInfoReplaceResponseRuleset) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type RumSiteInfoUpdateParams struct { +type RumSiteInfoNewParams struct { // If enabled, the JavaScript snippet is automatically injected for orange-clouded // sites. AutoInstall param.Field[bool] `json:"auto_install"` @@ -549,24 +518,24 @@ type RumSiteInfoUpdateParams struct { ZoneTag param.Field[string] `json:"zone_tag"` } -func (r RumSiteInfoUpdateParams) MarshalJSON() (data []byte, err error) { +func (r RumSiteInfoNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type RumSiteInfoUpdateResponseEnvelope struct { - Result RumSiteInfoUpdateResponse `json:"result"` - JSON rumSiteInfoUpdateResponseEnvelopeJSON `json:"-"` +type RumSiteInfoNewResponseEnvelope struct { + Result RumSiteInfoNewResponse `json:"result"` + JSON rumSiteInfoNewResponseEnvelopeJSON `json:"-"` } -// rumSiteInfoUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [RumSiteInfoUpdateResponseEnvelope] -type rumSiteInfoUpdateResponseEnvelopeJSON struct { +// rumSiteInfoNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [RumSiteInfoNewResponseEnvelope] +type rumSiteInfoNewResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *RumSiteInfoUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *RumSiteInfoNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -628,3 +597,34 @@ type rumSiteInfoGetResponseEnvelopeJSON struct { func (r *RumSiteInfoGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type RumSiteInfoReplaceParams struct { + // If enabled, the JavaScript snippet is automatically injected for orange-clouded + // sites. + AutoInstall param.Field[bool] `json:"auto_install"` + // The hostname to use for gray-clouded sites. + Host param.Field[string] `json:"host"` + // The zone identifier. + ZoneTag param.Field[string] `json:"zone_tag"` +} + +func (r RumSiteInfoReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type RumSiteInfoReplaceResponseEnvelope struct { + Result RumSiteInfoReplaceResponse `json:"result"` + JSON rumSiteInfoReplaceResponseEnvelopeJSON `json:"-"` +} + +// rumSiteInfoReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [RumSiteInfoReplaceResponseEnvelope] +type rumSiteInfoReplaceResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RumSiteInfoReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/rumsiteinfo_test.go b/rumsiteinfo_test.go index 0a382b8c8cb..32c19ca2b88 100644 --- a/rumsiteinfo_test.go +++ b/rumsiteinfo_test.go @@ -47,7 +47,7 @@ func TestRumSiteInfoNewWithOptionalParams(t *testing.T) { } } -func TestRumSiteInfoUpdateWithOptionalParams(t *testing.T) { +func TestRumSiteInfoListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,14 +63,13 @@ func TestRumSiteInfoUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.SiteInfos.Update( + _, err := client.Rum.SiteInfos.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.RumSiteInfoUpdateParams{ - AutoInstall: cloudflare.F(true), - Host: cloudflare.F("example.com"), - ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + cloudflare.RumSiteInfoListParams{ + OrderBy: cloudflare.F(cloudflare.RumSiteInfoListParamsOrderByHost), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(10.000000), }, ) if err != nil { @@ -82,7 +81,7 @@ func TestRumSiteInfoUpdateWithOptionalParams(t *testing.T) { } } -func TestRumSiteInfoListWithOptionalParams(t *testing.T) { +func TestRumSiteInfoDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -98,14 +97,10 @@ func TestRumSiteInfoListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.SiteInfos.List( + _, err := client.Rum.SiteInfos.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.RumSiteInfoListParams{ - OrderBy: cloudflare.F(cloudflare.RumSiteInfoListParamsOrderByHost), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(10.000000), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -116,7 +111,7 @@ func TestRumSiteInfoListWithOptionalParams(t *testing.T) { } } -func TestRumSiteInfoDelete(t *testing.T) { +func TestRumSiteInfoGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -132,7 +127,7 @@ func TestRumSiteInfoDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.SiteInfos.Delete( + _, err := client.Rum.SiteInfos.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -146,7 +141,7 @@ func TestRumSiteInfoDelete(t *testing.T) { } } -func TestRumSiteInfoGet(t *testing.T) { +func TestRumSiteInfoReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -162,10 +157,15 @@ func TestRumSiteInfoGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Rum.SiteInfos.Get( + _, err := client.Rum.SiteInfos.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.RumSiteInfoReplaceParams{ + AutoInstall: cloudflare.F(true), + Host: cloudflare.F("example.com"), + ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/secondarydns.go b/secondarydns.go index 803f94a37de..0438a090eb1 100644 --- a/secondarydns.go +++ b/secondarydns.go @@ -14,8 +14,8 @@ import ( type SecondaryDNSService struct { Options []option.RequestOption ForceAxfrs *SecondaryDNSForceAxfrService - Incomings *SecondaryDNSIncomingService - Outgoings *SecondaryDNSOutgoingService + Incoming *SecondaryDNSIncomingService + Outgoing *SecondaryDNSOutgoingService ACLs *SecondaryDNSACLService Peers *SecondaryDNSPeerService Tsigs *SecondaryDNSTsigService @@ -28,8 +28,8 @@ func NewSecondaryDNSService(opts ...option.RequestOption) (r *SecondaryDNSServic r = &SecondaryDNSService{} r.Options = opts r.ForceAxfrs = NewSecondaryDNSForceAxfrService(opts...) - r.Incomings = NewSecondaryDNSIncomingService(opts...) - r.Outgoings = NewSecondaryDNSOutgoingService(opts...) + r.Incoming = NewSecondaryDNSIncomingService(opts...) + r.Outgoing = NewSecondaryDNSOutgoingService(opts...) r.ACLs = NewSecondaryDNSACLService(opts...) r.Peers = NewSecondaryDNSPeerService(opts...) r.Tsigs = NewSecondaryDNSTsigService(opts...) diff --git a/secondarydnsacl.go b/secondarydnsacl.go index c840cf1199b..b6f5e8e4f35 100644 --- a/secondarydnsacl.go +++ b/secondarydnsacl.go @@ -31,12 +31,25 @@ func NewSecondaryDNSACLService(opts ...option.RequestOption) (r *SecondaryDNSACL return } -// Modify ACL. -func (r *SecondaryDNSACLService) Update(ctx context.Context, accountID interface{}, aclID interface{}, body SecondaryDNSACLUpdateParams, opts ...option.RequestOption) (res *SecondaryDnsaclUpdateResponse, err error) { +// Create ACL. +func (r *SecondaryDNSACLService) New(ctx context.Context, accountID interface{}, body SecondaryDNSACLNewParams, opts ...option.RequestOption) (res *SecondaryDnsaclNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDnsaclUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", accountID, aclID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env SecondaryDnsaclNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/acls", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List ACLs. +func (r *SecondaryDNSACLService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDnsaclListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDnsaclListResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/acls", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -70,12 +83,12 @@ func (r *SecondaryDNSACLService) Get(ctx context.Context, accountID interface{}, return } -// Create ACL. -func (r *SecondaryDNSACLService) SecondaryDNSACLNewACL(ctx context.Context, accountID interface{}, body SecondaryDNSACLSecondaryDNSACLNewACLParams, opts ...option.RequestOption) (res *SecondaryDnsaclSecondaryDnsaclNewACLResponse, err error) { +// Modify ACL. +func (r *SecondaryDNSACLService) Replace(ctx context.Context, accountID interface{}, aclID interface{}, body SecondaryDNSACLReplaceParams, opts ...option.RequestOption) (res *SecondaryDnsaclReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/acls", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env SecondaryDnsaclReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", accountID, aclID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -83,20 +96,34 @@ func (r *SecondaryDNSACLService) SecondaryDNSACLNewACL(ctx context.Context, acco return } -// List ACLs. -func (r *SecondaryDNSACLService) SecondaryDNSACLListACLs(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDnsaclSecondaryDnsaclListACLsResponse, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/acls", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type SecondaryDnsaclNewResponse struct { + ID interface{} `json:"id,required"` + // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will + // be applied for the entire account. The IP range is used to allow additional + // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from + // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for + // IPv6 respectively. + IPRange string `json:"ip_range,required"` + // The name of the acl. + Name string `json:"name,required"` + JSON secondaryDnsaclNewResponseJSON `json:"-"` } -type SecondaryDnsaclUpdateResponse struct { +// secondaryDnsaclNewResponseJSON contains the JSON metadata for the struct +// [SecondaryDnsaclNewResponse] +type secondaryDnsaclNewResponseJSON struct { + ID apijson.Field + IPRange apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDnsaclNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDnsaclListResponse struct { ID interface{} `json:"id,required"` // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will // be applied for the entire account. The IP range is used to allow additional @@ -105,13 +132,13 @@ type SecondaryDnsaclUpdateResponse struct { // IPv6 respectively. IPRange string `json:"ip_range,required"` // The name of the acl. - Name string `json:"name,required"` - JSON secondaryDnsaclUpdateResponseJSON `json:"-"` + Name string `json:"name,required"` + JSON secondaryDnsaclListResponseJSON `json:"-"` } -// secondaryDnsaclUpdateResponseJSON contains the JSON metadata for the struct -// [SecondaryDnsaclUpdateResponse] -type secondaryDnsaclUpdateResponseJSON struct { +// secondaryDnsaclListResponseJSON contains the JSON metadata for the struct +// [SecondaryDnsaclListResponse] +type secondaryDnsaclListResponseJSON struct { ID apijson.Field IPRange apijson.Field Name apijson.Field @@ -119,7 +146,7 @@ type secondaryDnsaclUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -167,7 +194,7 @@ func (r *SecondaryDnsaclGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclSecondaryDnsaclNewACLResponse struct { +type SecondaryDnsaclReplaceResponse struct { ID interface{} `json:"id,required"` // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will // be applied for the entire account. The IP range is used to allow additional @@ -176,13 +203,13 @@ type SecondaryDnsaclSecondaryDnsaclNewACLResponse struct { // IPv6 respectively. IPRange string `json:"ip_range,required"` // The name of the acl. - Name string `json:"name,required"` - JSON secondaryDnsaclSecondaryDnsaclNewACLResponseJSON `json:"-"` + Name string `json:"name,required"` + JSON secondaryDnsaclReplaceResponseJSON `json:"-"` } -// secondaryDnsaclSecondaryDnsaclNewACLResponseJSON contains the JSON metadata for -// the struct [SecondaryDnsaclSecondaryDnsaclNewACLResponse] -type secondaryDnsaclSecondaryDnsaclNewACLResponseJSON struct { +// secondaryDnsaclReplaceResponseJSON contains the JSON metadata for the struct +// [SecondaryDnsaclReplaceResponse] +type secondaryDnsaclReplaceResponseJSON struct { ID apijson.Field IPRange apijson.Field Name apijson.Field @@ -190,121 +217,185 @@ type secondaryDnsaclSecondaryDnsaclNewACLResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclSecondaryDnsaclNewACLResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclSecondaryDnsaclListACLsResponse struct { - ID interface{} `json:"id,required"` - // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will - // be applied for the entire account. The IP range is used to allow additional - // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from - // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for - // IPv6 respectively. - IPRange string `json:"ip_range,required"` - // The name of the acl. - Name string `json:"name,required"` - JSON secondaryDnsaclSecondaryDnsaclListACLsResponseJSON `json:"-"` +type SecondaryDNSACLNewParams struct { + Body param.Field[interface{}] `json:"body,required"` } -// secondaryDnsaclSecondaryDnsaclListACLsResponseJSON contains the JSON metadata -// for the struct [SecondaryDnsaclSecondaryDnsaclListACLsResponse] -type secondaryDnsaclSecondaryDnsaclListACLsResponseJSON struct { - ID apijson.Field - IPRange apijson.Field - Name apijson.Field +func (r SecondaryDNSACLNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type SecondaryDnsaclNewResponseEnvelope struct { + Errors []SecondaryDnsaclNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDnsaclNewResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDnsaclNewResponse `json:"result,required"` + // Whether the API call was successful + Success SecondaryDnsaclNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDnsaclNewResponseEnvelopeJSON `json:"-"` +} + +// secondaryDnsaclNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SecondaryDnsaclNewResponseEnvelope] +type secondaryDnsaclNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclSecondaryDnsaclListACLsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSACLUpdateParams struct { - // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will - // be applied for the entire account. The IP range is used to allow additional - // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from - // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for - // IPv6 respectively. - IPRange param.Field[string] `json:"ip_range,required"` - // The name of the acl. - Name param.Field[string] `json:"name,required"` +type SecondaryDnsaclNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclNewResponseEnvelopeErrorsJSON `json:"-"` } -func (r SecondaryDNSACLUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// secondaryDnsaclNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SecondaryDnsaclNewResponseEnvelopeErrors] +type secondaryDnsaclNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDnsaclNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDnsaclNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclNewResponseEnvelopeMessagesJSON `json:"-"` } -type SecondaryDnsaclUpdateResponseEnvelope struct { - Errors []SecondaryDnsaclUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDnsaclUpdateResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDnsaclUpdateResponse `json:"result,required"` +// secondaryDnsaclNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDnsaclNewResponseEnvelopeMessages] +type secondaryDnsaclNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDnsaclNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SecondaryDnsaclNewResponseEnvelopeSuccess bool + +const ( + SecondaryDnsaclNewResponseEnvelopeSuccessTrue SecondaryDnsaclNewResponseEnvelopeSuccess = true +) + +type SecondaryDnsaclListResponseEnvelope struct { + Errors []SecondaryDnsaclListResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDnsaclListResponseEnvelopeMessages `json:"messages,required"` + Result []SecondaryDnsaclListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SecondaryDnsaclUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDnsaclUpdateResponseEnvelopeJSON `json:"-"` + Success SecondaryDnsaclListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo SecondaryDnsaclListResponseEnvelopeResultInfo `json:"result_info"` + JSON secondaryDnsaclListResponseEnvelopeJSON `json:"-"` } -// secondaryDnsaclUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [SecondaryDnsaclUpdateResponseEnvelope] -type secondaryDnsaclUpdateResponseEnvelopeJSON struct { +// secondaryDnsaclListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDnsaclListResponseEnvelope] +type secondaryDnsaclListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDnsaclListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclListResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDnsaclUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [SecondaryDnsaclUpdateResponseEnvelopeErrors] -type secondaryDnsaclUpdateResponseEnvelopeErrorsJSON struct { +// secondaryDnsaclListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SecondaryDnsaclListResponseEnvelopeErrors] +type secondaryDnsaclListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDnsaclListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclListResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDnsaclUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [SecondaryDnsaclUpdateResponseEnvelopeMessages] -type secondaryDnsaclUpdateResponseEnvelopeMessagesJSON struct { +// secondaryDnsaclListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDnsaclListResponseEnvelopeMessages] +type secondaryDnsaclListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDnsaclUpdateResponseEnvelopeSuccess bool +type SecondaryDnsaclListResponseEnvelopeSuccess bool const ( - SecondaryDnsaclUpdateResponseEnvelopeSuccessTrue SecondaryDnsaclUpdateResponseEnvelopeSuccess = true + SecondaryDnsaclListResponseEnvelopeSuccessTrue SecondaryDnsaclListResponseEnvelopeSuccess = true ) +type SecondaryDnsaclListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON secondaryDnsaclListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// secondaryDnsaclListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [SecondaryDnsaclListResponseEnvelopeResultInfo] +type secondaryDnsaclListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDnsaclListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type SecondaryDnsaclDeleteResponseEnvelope struct { Errors []SecondaryDnsaclDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []SecondaryDnsaclDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -443,182 +534,86 @@ const ( SecondaryDnsaclGetResponseEnvelopeSuccessTrue SecondaryDnsaclGetResponseEnvelopeSuccess = true ) -type SecondaryDNSACLSecondaryDNSACLNewACLParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r SecondaryDNSACLSecondaryDNSACLNewACLParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelope struct { - Errors []SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDnsaclSecondaryDnsaclNewACLResponse `json:"result,required"` - // Whether the API call was successful - Success SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeJSON `json:"-"` -} - -// secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeJSON contains the JSON -// metadata for the struct [SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelope] -type secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrors] -type secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessages] -type secondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type SecondaryDNSACLReplaceParams struct { + // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will + // be applied for the entire account. The IP range is used to allow additional + // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from + // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for + // IPv6 respectively. + IPRange param.Field[string] `json:"ip_range,required"` + // The name of the acl. + Name param.Field[string] `json:"name,required"` } -func (r *SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r SecondaryDNSACLReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeSuccess bool - -const ( - SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeSuccessTrue SecondaryDnsaclSecondaryDnsaclNewACLResponseEnvelopeSuccess = true -) - -type SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelope struct { - Errors []SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessages `json:"messages,required"` - Result []SecondaryDnsaclSecondaryDnsaclListACLsResponse `json:"result,required,nullable"` +type SecondaryDnsaclReplaceResponseEnvelope struct { + Errors []SecondaryDnsaclReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDnsaclReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDnsaclReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfo `json:"result_info"` - JSON secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeJSON `json:"-"` + Success SecondaryDnsaclReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDnsaclReplaceResponseEnvelopeJSON `json:"-"` } -// secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeJSON contains the JSON -// metadata for the struct [SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelope] -type secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeJSON struct { +// secondaryDnsaclReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDnsaclReplaceResponseEnvelope] +type secondaryDnsaclReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDnsaclReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrors] -type secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrorsJSON struct { +// secondaryDnsaclReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDnsaclReplaceResponseEnvelopeErrors] +type secondaryDnsaclReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDnsaclReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDnsaclReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessages] -type secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessagesJSON struct { +// secondaryDnsaclReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDnsaclReplaceResponseEnvelopeMessages] +type secondaryDnsaclReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDnsaclReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeSuccess bool +type SecondaryDnsaclReplaceResponseEnvelopeSuccess bool const ( - SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeSuccessTrue SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeSuccess = true + SecondaryDnsaclReplaceResponseEnvelopeSuccessTrue SecondaryDnsaclReplaceResponseEnvelopeSuccess = true ) - -type SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfo] -type secondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDnsaclSecondaryDnsaclListACLsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/secondarydnsacl_test.go b/secondarydnsacl_test.go index e0ca7d9c3ce..4312dc32acd 100644 --- a/secondarydnsacl_test.go +++ b/secondarydnsacl_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSACLUpdate(t *testing.T) { +func TestSecondaryDNSACLNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,11 @@ func TestSecondaryDNSACLUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ACLs.Update( + _, err := client.SecondaryDNS.ACLs.New( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - "23ff594956f20c2a721606e94745a8aa", - cloudflare.SecondaryDNSACLUpdateParams{ - IPRange: cloudflare.F("192.0.2.53/28"), - Name: cloudflare.F("my-acl-1"), + cloudflare.SecondaryDNSACLNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -47,7 +45,7 @@ func TestSecondaryDNSACLUpdate(t *testing.T) { } } -func TestSecondaryDNSACLDelete(t *testing.T) { +func TestSecondaryDNSACLList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +61,7 @@ func TestSecondaryDNSACLDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ACLs.Delete( - context.TODO(), - "01a7362d577a6c3019a474fd6f485823", - "23ff594956f20c2a721606e94745a8aa", - ) + _, err := client.SecondaryDNS.ACLs.List(context.TODO(), "01a7362d577a6c3019a474fd6f485823") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -77,7 +71,7 @@ func TestSecondaryDNSACLDelete(t *testing.T) { } } -func TestSecondaryDNSACLGet(t *testing.T) { +func TestSecondaryDNSACLDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,7 +87,7 @@ func TestSecondaryDNSACLGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ACLs.Get( + _, err := client.SecondaryDNS.ACLs.Delete( context.TODO(), "01a7362d577a6c3019a474fd6f485823", "23ff594956f20c2a721606e94745a8aa", @@ -107,7 +101,7 @@ func TestSecondaryDNSACLGet(t *testing.T) { } } -func TestSecondaryDNSACLSecondaryDNSACLNewACL(t *testing.T) { +func TestSecondaryDNSACLGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -123,12 +117,10 @@ func TestSecondaryDNSACLSecondaryDNSACLNewACL(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ACLs.SecondaryDNSACLNewACL( + _, err := client.SecondaryDNS.ACLs.Get( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - cloudflare.SecondaryDNSACLSecondaryDNSACLNewACLParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "23ff594956f20c2a721606e94745a8aa", ) if err != nil { var apierr *cloudflare.Error @@ -139,7 +131,7 @@ func TestSecondaryDNSACLSecondaryDNSACLNewACL(t *testing.T) { } } -func TestSecondaryDNSACLSecondaryDNSACLListACLs(t *testing.T) { +func TestSecondaryDNSACLReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -155,7 +147,15 @@ func TestSecondaryDNSACLSecondaryDNSACLListACLs(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ACLs.SecondaryDNSACLListACLs(context.TODO(), "01a7362d577a6c3019a474fd6f485823") + _, err := client.SecondaryDNS.ACLs.Replace( + context.TODO(), + "01a7362d577a6c3019a474fd6f485823", + "23ff594956f20c2a721606e94745a8aa", + cloudflare.SecondaryDNSACLReplaceParams{ + IPRange: cloudflare.F("192.0.2.53/28"), + Name: cloudflare.F("my-acl-1"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/secondarydnsforceaxfr.go b/secondarydnsforceaxfr.go index 7543ed1e43b..57b0cb9bfed 100644 --- a/secondarydnsforceaxfr.go +++ b/secondarydnsforceaxfr.go @@ -31,9 +31,9 @@ func NewSecondaryDNSForceAxfrService(opts ...option.RequestOption) (r *Secondary } // Sends AXFR zone transfer request to primary nameserver(s). -func (r *SecondaryDNSForceAxfrService) SecondaryDNSSecondaryZoneForceAxfr(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { +func (r *SecondaryDNSForceAxfrService) New(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelope + var env SecondaryDNSForceAxfrNewResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/force_axfr", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -43,20 +43,19 @@ func (r *SecondaryDNSForceAxfrService) SecondaryDNSSecondaryZoneForceAxfr(ctx co return } -type SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelope struct { - Errors []SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessages `json:"messages,required"` +type SecondaryDNSForceAxfrNewResponseEnvelope struct { + Errors []SecondaryDNSForceAxfrNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSForceAxfrNewResponseEnvelopeMessages `json:"messages,required"` // When force_axfr query parameter is set to true, the response is a simple string Result string `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSForceAxfrNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSForceAxfrNewResponseEnvelopeJSON `json:"-"` } -// secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelope] -type secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeJSON struct { +// secondaryDNSForceAxfrNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSForceAxfrNewResponseEnvelope] +type secondaryDNSForceAxfrNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -65,53 +64,51 @@ type secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSForceAxfrNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSForceAxfrNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrors] -type secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrorsJSON struct { +// secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSForceAxfrNewResponseEnvelopeErrors] +type secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSForceAxfrNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSForceAxfrNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessages] -type secondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessagesJSON struct { +// secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSForceAxfrNewResponseEnvelopeMessages] +type secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSForceAxfrNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeSuccess bool +type SecondaryDNSForceAxfrNewResponseEnvelopeSuccess bool const ( - SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeSuccessTrue SecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfrResponseEnvelopeSuccess = true + SecondaryDNSForceAxfrNewResponseEnvelopeSuccessTrue SecondaryDNSForceAxfrNewResponseEnvelopeSuccess = true ) diff --git a/secondarydnsforceaxfr_test.go b/secondarydnsforceaxfr_test.go index 6f6199059bd..a1f133bfa9f 100644 --- a/secondarydnsforceaxfr_test.go +++ b/secondarydnsforceaxfr_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfr(t *testing.T) { +func TestSecondaryDNSForceAxfrNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestSecondaryDNSForceAxfrSecondaryDNSSecondaryZoneForceAxfr(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.ForceAxfrs.SecondaryDNSSecondaryZoneForceAxfr(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.ForceAxfrs.New(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/secondarydnsincoming.go b/secondarydnsincoming.go index 878ae21e01d..c23f336299d 100644 --- a/secondarydnsincoming.go +++ b/secondarydnsincoming.go @@ -31,12 +31,12 @@ func NewSecondaryDNSIncomingService(opts ...option.RequestOption) (r *SecondaryD return } -// Delete secondary zone configuration for incoming zone transfers. -func (r *SecondaryDNSIncomingService) Delete(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSIncomingDeleteResponse, err error) { +// Create secondary zone configuration for incoming zone transfers. +func (r *SecondaryDNSIncomingService) New(ctx context.Context, zoneID interface{}, body SecondaryDNSIncomingNewParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSIncomingDeleteResponseEnvelope + var env SecondaryDNSIncomingNewResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/incoming", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *SecondaryDNSIncomingService) Delete(ctx context.Context, zoneID interfa return } -// Create secondary zone configuration for incoming zone transfers. -func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneNewSecondaryZoneConfiguration(ctx context.Context, zoneID interface{}, body SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse, err error) { +// Delete secondary zone configuration for incoming zone transfers. +func (r *SecondaryDNSIncomingService) Delete(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSIncomingDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelope + var env SecondaryDNSIncomingDeleteResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/incoming", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -58,9 +58,9 @@ func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneNewSecondaryZoneC } // Get secondary zone configuration for incoming zone transfers. -func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetails(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse, err error) { +func (r *SecondaryDNSIncomingService) Get(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSIncomingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelope + var env SecondaryDNSIncomingGetResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/incoming", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -71,9 +71,9 @@ func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneSecondaryZoneConf } // Update secondary zone configuration for incoming zone transfers. -func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneUpdateSecondaryZoneConfiguration(ctx context.Context, zoneID interface{}, body SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse, err error) { +func (r *SecondaryDNSIncomingService) Replace(ctx context.Context, zoneID interface{}, body SecondaryDNSIncomingReplaceParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelope + var env SecondaryDNSIncomingReplaceResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/incoming", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -83,24 +83,7 @@ func (r *SecondaryDNSIncomingService) SecondaryDNSSecondaryZoneUpdateSecondaryZo return } -type SecondaryDNSIncomingDeleteResponse struct { - ID interface{} `json:"id"` - JSON secondaryDNSIncomingDeleteResponseJSON `json:"-"` -} - -// secondaryDNSIncomingDeleteResponseJSON contains the JSON metadata for the struct -// [SecondaryDNSIncomingDeleteResponse] -type secondaryDNSIncomingDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSIncomingDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse struct { +type SecondaryDNSIncomingNewResponse struct { ID interface{} `json:"id"` // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not // applicable for primary zones. @@ -116,14 +99,13 @@ type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationR // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSIncomingNewResponseJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseJSON struct { +// secondaryDNSIncomingNewResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSIncomingNewResponse] +type secondaryDNSIncomingNewResponseJSON struct { ID apijson.Field AutoRefreshSeconds apijson.Field CheckedTime apijson.Field @@ -136,11 +118,28 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationR ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse struct { +type SecondaryDNSIncomingDeleteResponse struct { + ID interface{} `json:"id"` + JSON secondaryDNSIncomingDeleteResponseJSON `json:"-"` +} + +// secondaryDNSIncomingDeleteResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSIncomingDeleteResponse] +type secondaryDNSIncomingDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSIncomingDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSIncomingGetResponse struct { ID interface{} `json:"id"` // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not // applicable for primary zones. @@ -156,14 +155,13 @@ type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDeta // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSIncomingGetResponseJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseJSON struct { +// secondaryDNSIncomingGetResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSIncomingGetResponse] +type secondaryDNSIncomingGetResponseJSON struct { ID apijson.Field AutoRefreshSeconds apijson.Field CheckedTime apijson.Field @@ -176,11 +174,11 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDeta ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse struct { +type SecondaryDNSIncomingReplaceResponse struct { ID interface{} `json:"id"` // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not // applicable for primary zones. @@ -196,14 +194,13 @@ type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurati // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSIncomingReplaceResponseJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseJSON struct { +// secondaryDNSIncomingReplaceResponseJSON contains the JSON metadata for the +// struct [SecondaryDNSIncomingReplaceResponse] +type secondaryDNSIncomingReplaceResponseJSON struct { ID apijson.Field AutoRefreshSeconds apijson.Field CheckedTime apijson.Field @@ -216,22 +213,36 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurati ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingDeleteResponseEnvelope struct { - Errors []SecondaryDNSIncomingDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSIncomingDeleteResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSIncomingDeleteResponse `json:"result,required"` +type SecondaryDNSIncomingNewParams struct { + // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not + // applicable for primary zones. + AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"` + // Zone name. + Name param.Field[string] `json:"name,required"` + // A list of peer tags. + Peers param.Field[[]interface{}] `json:"peers,required"` +} + +func (r SecondaryDNSIncomingNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SecondaryDNSIncomingNewResponseEnvelope struct { + Errors []SecondaryDNSIncomingNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSIncomingNewResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSIncomingNewResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSIncomingDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSIncomingDeleteResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSIncomingNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSIncomingNewResponseEnvelopeJSON `json:"-"` } -// secondaryDNSIncomingDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [SecondaryDNSIncomingDeleteResponseEnvelope] -type secondaryDNSIncomingDeleteResponseEnvelopeJSON struct { +// secondaryDNSIncomingNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSIncomingNewResponseEnvelope] +type secondaryDNSIncomingNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -240,82 +251,67 @@ type secondaryDNSIncomingDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSIncomingNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingNewResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeErrors] -type secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON struct { +// secondaryDNSIncomingNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSIncomingNewResponseEnvelopeErrors] +type secondaryDNSIncomingNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSIncomingNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingNewResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeMessages] -type secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON struct { +// secondaryDNSIncomingNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSIncomingNewResponseEnvelopeMessages] +type secondaryDNSIncomingNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSIncomingDeleteResponseEnvelopeSuccess bool +type SecondaryDNSIncomingNewResponseEnvelopeSuccess bool const ( - SecondaryDNSIncomingDeleteResponseEnvelopeSuccessTrue SecondaryDNSIncomingDeleteResponseEnvelopeSuccess = true + SecondaryDNSIncomingNewResponseEnvelopeSuccessTrue SecondaryDNSIncomingNewResponseEnvelopeSuccess = true ) -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationParams struct { - // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not - // applicable for primary zones. - AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"` - // Zone name. - Name param.Field[string] `json:"name,required"` - // A list of peer tags. - Peers param.Field[[]interface{}] `json:"peers,required"` -} - -func (r SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelope struct { - Errors []SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponse `json:"result,required"` +type SecondaryDNSIncomingDeleteResponseEnvelope struct { + Errors []SecondaryDNSIncomingDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSIncomingDeleteResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSIncomingDeleteResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSIncomingDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSIncomingDeleteResponseEnvelopeJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelope] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeJSON struct { +// secondaryDNSIncomingDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSIncomingDeleteResponseEnvelope] +type secondaryDNSIncomingDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -324,70 +320,67 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationR ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSIncomingDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrors] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrorsJSON struct { +// secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeErrors] +type secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSIncomingDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessages] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessagesJSON struct { +// secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeMessages] +type secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeSuccess bool +type SecondaryDNSIncomingDeleteResponseEnvelopeSuccess bool const ( - SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeSuccessTrue SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationResponseEnvelopeSuccess = true + SecondaryDNSIncomingDeleteResponseEnvelopeSuccessTrue SecondaryDNSIncomingDeleteResponseEnvelopeSuccess = true ) -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelope struct { - Errors []SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponse `json:"result,required"` +type SecondaryDNSIncomingGetResponseEnvelope struct { + Errors []SecondaryDNSIncomingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSIncomingGetResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSIncomingGetResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSIncomingGetResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSIncomingGetResponseEnvelopeJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelope] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeJSON struct { +// secondaryDNSIncomingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSIncomingGetResponseEnvelope] +type secondaryDNSIncomingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -396,58 +389,56 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDeta ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSIncomingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingGetResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrors] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON struct { +// secondaryDNSIncomingGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSIncomingGetResponseEnvelopeErrors] +type secondaryDNSIncomingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSIncomingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingGetResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessages] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON struct { +// secondaryDNSIncomingGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSIncomingGetResponseEnvelopeMessages] +type secondaryDNSIncomingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeSuccess bool +type SecondaryDNSIncomingGetResponseEnvelopeSuccess bool const ( - SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeSuccessTrue SecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetailsResponseEnvelopeSuccess = true + SecondaryDNSIncomingGetResponseEnvelopeSuccessTrue SecondaryDNSIncomingGetResponseEnvelopeSuccess = true ) -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationParams struct { +type SecondaryDNSIncomingReplaceParams struct { // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not // applicable for primary zones. AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"` @@ -457,23 +448,22 @@ type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurati Peers param.Field[[]interface{}] `json:"peers,required"` } -func (r SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationParams) MarshalJSON() (data []byte, err error) { +func (r SecondaryDNSIncomingReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelope struct { - Errors []SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponse `json:"result,required"` +type SecondaryDNSIncomingReplaceResponseEnvelope struct { + Errors []SecondaryDNSIncomingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSIncomingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSIncomingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSIncomingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSIncomingReplaceResponseEnvelopeJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelope] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeJSON struct { +// secondaryDNSIncomingReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSIncomingReplaceResponseEnvelope] +type secondaryDNSIncomingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -482,53 +472,51 @@ type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurati ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSIncomingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrors] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrorsJSON struct { +// secondaryDNSIncomingReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSIncomingReplaceResponseEnvelopeErrors] +type secondaryDNSIncomingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSIncomingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSIncomingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessages] -type secondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessagesJSON struct { +// secondaryDNSIncomingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSIncomingReplaceResponseEnvelopeMessages] +type secondaryDNSIncomingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSIncomingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeSuccess bool +type SecondaryDNSIncomingReplaceResponseEnvelopeSuccess bool const ( - SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeSuccessTrue SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationResponseEnvelopeSuccess = true + SecondaryDNSIncomingReplaceResponseEnvelopeSuccessTrue SecondaryDNSIncomingReplaceResponseEnvelopeSuccess = true ) diff --git a/secondarydnsincoming_test.go b/secondarydnsincoming_test.go index 301c5b9d1f5..ed356c08c98 100644 --- a/secondarydnsincoming_test.go +++ b/secondarydnsincoming_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSIncomingDelete(t *testing.T) { +func TestSecondaryDNSIncomingNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,15 @@ func TestSecondaryDNSIncomingDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Incomings.Delete(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.Incoming.New( + context.TODO(), + "269d8f4853475ca241c4e730be286b20", + cloudflare.SecondaryDNSIncomingNewParams{ + AutoRefreshSeconds: cloudflare.F(86400.000000), + Name: cloudflare.F("www.example.com."), + Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +47,7 @@ func TestSecondaryDNSIncomingDelete(t *testing.T) { } } -func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfiguration(t *testing.T) { +func TestSecondaryDNSIncomingDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,15 +63,7 @@ func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurat option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneNewSecondaryZoneConfiguration( - context.TODO(), - "269d8f4853475ca241c4e730be286b20", - cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurationParams{ - AutoRefreshSeconds: cloudflare.F(86400.000000), - Name: cloudflare.F("www.example.com."), - Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), - }, - ) + _, err := client.SecondaryDNS.Incoming.Delete(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -73,7 +73,7 @@ func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneNewSecondaryZoneConfigurat } } -func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetails(t *testing.T) { +func TestSecondaryDNSIncomingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,7 +89,7 @@ func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfiguration option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneSecondaryZoneConfigurationDetails(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.Incoming.Get(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -99,7 +99,7 @@ func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneSecondaryZoneConfiguration } } -func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfiguration(t *testing.T) { +func TestSecondaryDNSIncomingReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -115,10 +115,10 @@ func TestSecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigu option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Incomings.SecondaryDNSSecondaryZoneUpdateSecondaryZoneConfiguration( + _, err := client.SecondaryDNS.Incoming.Replace( context.TODO(), "269d8f4853475ca241c4e730be286b20", - cloudflare.SecondaryDNSIncomingSecondaryDNSSecondaryZoneUpdateSecondaryZoneConfigurationParams{ + cloudflare.SecondaryDNSIncomingReplaceParams{ AutoRefreshSeconds: cloudflare.F(86400.000000), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), diff --git a/secondarydnsoutgoing.go b/secondarydnsoutgoing.go index 0999333015d..5fa56487e12 100644 --- a/secondarydnsoutgoing.go +++ b/secondarydnsoutgoing.go @@ -19,11 +19,8 @@ import ( // this service directly, and instead use the [NewSecondaryDNSOutgoingService] // method instead. type SecondaryDNSOutgoingService struct { - Options []option.RequestOption - Disables *SecondaryDNSOutgoingDisableService - Enables *SecondaryDNSOutgoingEnableService - ForceNotifies *SecondaryDNSOutgoingForceNotifyService - Statuses *SecondaryDNSOutgoingStatusService + Options []option.RequestOption + Status *SecondaryDNSOutgoingStatusService } // NewSecondaryDNSOutgoingService generates a new service that applies the given @@ -32,10 +29,20 @@ type SecondaryDNSOutgoingService struct { func NewSecondaryDNSOutgoingService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingService) { r = &SecondaryDNSOutgoingService{} r.Options = opts - r.Disables = NewSecondaryDNSOutgoingDisableService(opts...) - r.Enables = NewSecondaryDNSOutgoingEnableService(opts...) - r.ForceNotifies = NewSecondaryDNSOutgoingForceNotifyService(opts...) - r.Statuses = NewSecondaryDNSOutgoingStatusService(opts...) + r.Status = NewSecondaryDNSOutgoingStatusService(opts...) + return +} + +// Create primary zone configuration for outgoing zone transfers. +func (r *SecondaryDNSOutgoingService) New(ctx context.Context, zoneID interface{}, body SecondaryDNSOutgoingNewParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDNSOutgoingNewResponseEnvelope + path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result return } @@ -52,12 +59,39 @@ func (r *SecondaryDNSOutgoingService) Delete(ctx context.Context, zoneID interfa return } -// Create primary zone configuration for outgoing zone transfers. -func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration(ctx context.Context, zoneID interface{}, body SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse, err error) { +// Disable outgoing zone transfers for primary zone and clears IXFR backlog of +// primary zone. +func (r *SecondaryDNSOutgoingService) Disable(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelope - path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env SecondaryDNSOutgoingDisableResponseEnvelope + path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/disable", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Enable outgoing zone transfers for primary zone. +func (r *SecondaryDNSOutgoingService) Enable(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDNSOutgoingEnableResponseEnvelope + path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/enable", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. +func (r *SecondaryDNSOutgoingService) ForceNotify(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDNSOutgoingForceNotifyResponseEnvelope + path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/force_notify", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -66,9 +100,9 @@ func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZoneNewPrimaryZoneConfi } // Get primary zone configuration for outgoing zone transfers. -func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZonePrimaryZoneConfigurationDetails(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse, err error) { +func (r *SecondaryDNSOutgoingService) Get(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *SecondaryDNSOutgoingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelope + var env SecondaryDNSOutgoingGetResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -79,9 +113,9 @@ func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZonePrimaryZoneConfigur } // Update primary zone configuration for outgoing zone transfers. -func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZoneUpdatePrimaryZoneConfiguration(ctx context.Context, zoneID interface{}, body SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse, err error) { +func (r *SecondaryDNSOutgoingService) Replace(ctx context.Context, zoneID interface{}, body SecondaryDNSOutgoingReplaceParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelope + var env SecondaryDNSOutgoingReplaceResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -91,24 +125,7 @@ func (r *SecondaryDNSOutgoingService) SecondaryDNSPrimaryZoneUpdatePrimaryZoneCo return } -type SecondaryDNSOutgoingDeleteResponse struct { - ID interface{} `json:"id"` - JSON secondaryDNSOutgoingDeleteResponseJSON `json:"-"` -} - -// secondaryDNSOutgoingDeleteResponseJSON contains the JSON metadata for the struct -// [SecondaryDNSOutgoingDeleteResponse] -type secondaryDNSOutgoingDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse struct { +type SecondaryDNSOutgoingNewResponse struct { ID interface{} `json:"id"` // The time for a specific event. CheckedTime string `json:"checked_time"` @@ -121,14 +138,13 @@ type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationRespo // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSOutgoingNewResponseJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseJSON struct { +// secondaryDNSOutgoingNewResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSOutgoingNewResponse] +type secondaryDNSOutgoingNewResponseJSON struct { ID apijson.Field CheckedTime apijson.Field CreatedTime apijson.Field @@ -140,11 +156,28 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationRespo ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse struct { +type SecondaryDNSOutgoingDeleteResponse struct { + ID interface{} `json:"id"` + JSON secondaryDNSOutgoingDeleteResponseJSON `json:"-"` +} + +// secondaryDNSOutgoingDeleteResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSOutgoingDeleteResponse] +type secondaryDNSOutgoingDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingGetResponse struct { ID interface{} `json:"id"` // The time for a specific event. CheckedTime string `json:"checked_time"` @@ -157,14 +190,13 @@ type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsR // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSOutgoingGetResponseJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse] -type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseJSON struct { +// secondaryDNSOutgoingGetResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSOutgoingGetResponse] +type secondaryDNSOutgoingGetResponseJSON struct { ID apijson.Field CheckedTime apijson.Field CreatedTime apijson.Field @@ -176,11 +208,11 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsR ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse struct { +type SecondaryDNSOutgoingReplaceResponse struct { ID interface{} `json:"id"` // The time for a specific event. CheckedTime string `json:"checked_time"` @@ -193,14 +225,13 @@ type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationRe // A list of peer tags. Peers []interface{} `json:"peers"` // The serial number of the SOA for the given zone. - SoaSerial float64 `json:"soa_serial"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseJSON `json:"-"` + SoaSerial float64 `json:"soa_serial"` + JSON secondaryDNSOutgoingReplaceResponseJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseJSON struct { +// secondaryDNSOutgoingReplaceResponseJSON contains the JSON metadata for the +// struct [SecondaryDNSOutgoingReplaceResponse] +type secondaryDNSOutgoingReplaceResponseJSON struct { ID apijson.Field CheckedTime apijson.Field CreatedTime apijson.Field @@ -212,10 +243,90 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationRe ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingNewParams struct { + // Zone name. + Name param.Field[string] `json:"name,required"` + // A list of peer tags. + Peers param.Field[[]interface{}] `json:"peers,required"` +} + +func (r SecondaryDNSOutgoingNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SecondaryDNSOutgoingNewResponseEnvelope struct { + Errors []SecondaryDNSOutgoingNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingNewResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSOutgoingNewResponse `json:"result,required"` + // Whether the API call was successful + Success SecondaryDNSOutgoingNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingNewResponseEnvelopeJSON `json:"-"` +} + +// secondaryDNSOutgoingNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSOutgoingNewResponseEnvelope] +type secondaryDNSOutgoingNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +type SecondaryDNSOutgoingNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingNewResponseEnvelopeErrors] +type secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingNewResponseEnvelopeMessages] +type secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SecondaryDNSOutgoingNewResponseEnvelopeSuccess bool + +const ( + SecondaryDNSOutgoingNewResponseEnvelopeSuccessTrue SecondaryDNSOutgoingNewResponseEnvelopeSuccess = true +) + type SecondaryDNSOutgoingDeleteResponseEnvelope struct { Errors []SecondaryDNSOutgoingDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []SecondaryDNSOutgoingDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -285,30 +396,160 @@ const ( SecondaryDNSOutgoingDeleteResponseEnvelopeSuccessTrue SecondaryDNSOutgoingDeleteResponseEnvelopeSuccess = true ) -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationParams struct { - // Zone name. - Name param.Field[string] `json:"name,required"` - // A list of peer tags. - Peers param.Field[[]interface{}] `json:"peers,required"` +type SecondaryDNSOutgoingDisableResponseEnvelope struct { + Errors []SecondaryDNSOutgoingDisableResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingDisableResponseEnvelopeMessages `json:"messages,required"` + // The zone transfer status of a primary zone + Result string `json:"result,required"` + // Whether the API call was successful + Success SecondaryDNSOutgoingDisableResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingDisableResponseEnvelopeJSON `json:"-"` } -func (r SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// secondaryDNSOutgoingDisableResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingDisableResponseEnvelope] +type secondaryDNSOutgoingDisableResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingDisableResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingDisableResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON `json:"-"` +} + +// secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingDisableResponseEnvelopeErrors] +type secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingDisableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingDisableResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON `json:"-"` +} + +// secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingDisableResponseEnvelopeMessages] +type secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingDisableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelope struct { - Errors []SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponse `json:"result,required"` +// Whether the API call was successful +type SecondaryDNSOutgoingDisableResponseEnvelopeSuccess bool + +const ( + SecondaryDNSOutgoingDisableResponseEnvelopeSuccessTrue SecondaryDNSOutgoingDisableResponseEnvelopeSuccess = true +) + +type SecondaryDNSOutgoingEnableResponseEnvelope struct { + Errors []SecondaryDNSOutgoingEnableResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingEnableResponseEnvelopeMessages `json:"messages,required"` + // The zone transfer status of a primary zone + Result string `json:"result,required"` + // Whether the API call was successful + Success SecondaryDNSOutgoingEnableResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingEnableResponseEnvelopeJSON `json:"-"` +} + +// secondaryDNSOutgoingEnableResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingEnableResponseEnvelope] +type secondaryDNSOutgoingEnableResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingEnableResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingEnableResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON `json:"-"` +} + +// secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingEnableResponseEnvelopeErrors] +type secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingEnableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSOutgoingEnableResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON `json:"-"` +} + +// secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingEnableResponseEnvelopeMessages] +type secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSOutgoingEnableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SecondaryDNSOutgoingEnableResponseEnvelopeSuccess bool + +const ( + SecondaryDNSOutgoingEnableResponseEnvelopeSuccessTrue SecondaryDNSOutgoingEnableResponseEnvelopeSuccess = true +) + +type SecondaryDNSOutgoingForceNotifyResponseEnvelope struct { + Errors []SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages `json:"messages,required"` + // When force_notify query parameter is set to true, the response is a simple + // string + Result string `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelope] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeJSON struct { +// secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingForceNotifyResponseEnvelope] +type secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -317,70 +558,68 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationRespo ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrors] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrorsJSON struct { +// secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors] +type secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessages] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessagesJSON struct { +// secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages] +type secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeSuccess bool +type SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess bool const ( - SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeSuccessTrue SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationResponseEnvelopeSuccess = true + SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccessTrue SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess = true ) -type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelope struct { - Errors []SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponse `json:"result,required"` +type SecondaryDNSOutgoingGetResponseEnvelope struct { + Errors []SecondaryDNSOutgoingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingGetResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSOutgoingGetResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSOutgoingGetResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingGetResponseEnvelopeJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelope] -type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeJSON struct { +// secondaryDNSOutgoingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSOutgoingGetResponseEnvelope] +type secondaryDNSOutgoingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -389,81 +628,78 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsR ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSOutgoingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrors] -type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrorsJSON struct { +// secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingGetResponseEnvelopeErrors] +type secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSOutgoingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessages] -type secondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessagesJSON struct { +// secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingGetResponseEnvelopeMessages] +type secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeSuccess bool +type SecondaryDNSOutgoingGetResponseEnvelopeSuccess bool const ( - SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeSuccessTrue SecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetailsResponseEnvelopeSuccess = true + SecondaryDNSOutgoingGetResponseEnvelopeSuccessTrue SecondaryDNSOutgoingGetResponseEnvelopeSuccess = true ) -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationParams struct { +type SecondaryDNSOutgoingReplaceParams struct { // Zone name. Name param.Field[string] `json:"name,required"` // A list of peer tags. Peers param.Field[[]interface{}] `json:"peers,required"` } -func (r SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationParams) MarshalJSON() (data []byte, err error) { +func (r SecondaryDNSOutgoingReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelope struct { - Errors []SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponse `json:"result,required"` +type SecondaryDNSOutgoingReplaceResponseEnvelope struct { + Errors []SecondaryDNSOutgoingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSOutgoingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSOutgoingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingReplaceResponseEnvelopeJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelope] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeJSON struct { +// secondaryDNSOutgoingReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingReplaceResponseEnvelope] +type secondaryDNSOutgoingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -472,53 +708,51 @@ type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationRe ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSOutgoingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrors] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrorsJSON struct { +// secondaryDNSOutgoingReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SecondaryDNSOutgoingReplaceResponseEnvelopeErrors] +type secondaryDNSOutgoingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSOutgoingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessages] -type secondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessagesJSON struct { +// secondaryDNSOutgoingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingReplaceResponseEnvelopeMessages] +type secondaryDNSOutgoingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeSuccess bool +type SecondaryDNSOutgoingReplaceResponseEnvelopeSuccess bool const ( - SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeSuccessTrue SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationResponseEnvelopeSuccess = true + SecondaryDNSOutgoingReplaceResponseEnvelopeSuccessTrue SecondaryDNSOutgoingReplaceResponseEnvelopeSuccess = true ) diff --git a/secondarydnsoutgoing_test.go b/secondarydnsoutgoing_test.go index fbc4b5f3cca..0624e8f79d9 100644 --- a/secondarydnsoutgoing_test.go +++ b/secondarydnsoutgoing_test.go @@ -13,6 +13,39 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) +func TestSecondaryDNSOutgoingNew(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.SecondaryDNS.Outgoing.New( + context.TODO(), + "269d8f4853475ca241c4e730be286b20", + cloudflare.SecondaryDNSOutgoingNewParams{ + Name: cloudflare.F("www.example.com."), + Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestSecondaryDNSOutgoingDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -29,7 +62,7 @@ func TestSecondaryDNSOutgoingDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Outgoings.Delete(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.Outgoing.Delete(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +72,7 @@ func TestSecondaryDNSOutgoingDelete(t *testing.T) { } } -func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration(t *testing.T) { +func TestSecondaryDNSOutgoingDisable(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,14 +88,59 @@ func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration( - context.TODO(), - "269d8f4853475ca241c4e730be286b20", - cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfigurationParams{ - Name: cloudflare.F("www.example.com."), - Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), - }, + _, err := client.SecondaryDNS.Outgoing.Disable(context.TODO(), "269d8f4853475ca241c4e730be286b20") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestSecondaryDNSOutgoingEnable(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.SecondaryDNS.Outgoing.Enable(context.TODO(), "269d8f4853475ca241c4e730be286b20") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestSecondaryDNSOutgoingForceNotify(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), ) + _, err := client.SecondaryDNS.Outgoing.ForceNotify(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -72,7 +150,7 @@ func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZoneNewPrimaryZoneConfiguration( } } -func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDetails(t *testing.T) { +func TestSecondaryDNSOutgoingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -88,7 +166,7 @@ func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDeta option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZonePrimaryZoneConfigurationDetails(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.Outgoing.Get(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -98,7 +176,7 @@ func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZonePrimaryZoneConfigurationDeta } } -func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfiguration(t *testing.T) { +func TestSecondaryDNSOutgoingReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -114,10 +192,10 @@ func TestSecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurati option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Outgoings.SecondaryDNSPrimaryZoneUpdatePrimaryZoneConfiguration( + _, err := client.SecondaryDNS.Outgoing.Replace( context.TODO(), "269d8f4853475ca241c4e730be286b20", - cloudflare.SecondaryDNSOutgoingSecondaryDNSPrimaryZoneUpdatePrimaryZoneConfigurationParams{ + cloudflare.SecondaryDNSOutgoingReplaceParams{ Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }, diff --git a/secondarydnsoutgoingdisable.go b/secondarydnsoutgoingdisable.go deleted file mode 100644 index ebc41f7f6f2..00000000000 --- a/secondarydnsoutgoingdisable.go +++ /dev/null @@ -1,118 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// SecondaryDNSOutgoingDisableService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewSecondaryDNSOutgoingDisableService] method instead. -type SecondaryDNSOutgoingDisableService struct { - Options []option.RequestOption -} - -// NewSecondaryDNSOutgoingDisableService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewSecondaryDNSOutgoingDisableService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingDisableService) { - r = &SecondaryDNSOutgoingDisableService{} - r.Options = opts - return -} - -// Disable outgoing zone transfers for primary zone and clears IXFR backlog of -// primary zone. -func (r *SecondaryDNSOutgoingDisableService) SecondaryDNSPrimaryZoneDisableOutgoingZoneTransfers(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelope - path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/disable", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelope struct { - Errors []SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessages `json:"messages,required"` - // The zone transfer status of a primary zone - Result string `json:"result,required"` - // Whether the API call was successful - Success SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeJSON `json:"-"` -} - -// secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelope] -type secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrors] -type secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessages] -type secondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeSuccess bool - -const ( - SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeSuccessTrue SecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfersResponseEnvelopeSuccess = true -) diff --git a/secondarydnsoutgoingdisable_test.go b/secondarydnsoutgoingdisable_test.go deleted file mode 100644 index 2c8ca5af5e7..00000000000 --- a/secondarydnsoutgoingdisable_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestSecondaryDNSOutgoingDisableSecondaryDNSPrimaryZoneDisableOutgoingZoneTransfers(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SecondaryDNS.Outgoings.Disables.SecondaryDNSPrimaryZoneDisableOutgoingZoneTransfers(context.TODO(), "269d8f4853475ca241c4e730be286b20") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/secondarydnsoutgoingenable.go b/secondarydnsoutgoingenable.go deleted file mode 100644 index 2919454e0a2..00000000000 --- a/secondarydnsoutgoingenable.go +++ /dev/null @@ -1,117 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// SecondaryDNSOutgoingEnableService contains methods and other services that help -// with interacting with the cloudflare API. Note, unlike clients, this service -// does not read variables from the environment automatically. You should not -// instantiate this service directly, and instead use the -// [NewSecondaryDNSOutgoingEnableService] method instead. -type SecondaryDNSOutgoingEnableService struct { - Options []option.RequestOption -} - -// NewSecondaryDNSOutgoingEnableService generates a new service that applies the -// given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewSecondaryDNSOutgoingEnableService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingEnableService) { - r = &SecondaryDNSOutgoingEnableService{} - r.Options = opts - return -} - -// Enable outgoing zone transfers for primary zone. -func (r *SecondaryDNSOutgoingEnableService) SecondaryDNSPrimaryZoneEnableOutgoingZoneTransfers(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelope - path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/enable", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelope struct { - Errors []SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessages `json:"messages,required"` - // The zone transfer status of a primary zone - Result string `json:"result,required"` - // Whether the API call was successful - Success SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeJSON `json:"-"` -} - -// secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelope] -type secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrors] -type secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessages] -type secondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeSuccess bool - -const ( - SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeSuccessTrue SecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfersResponseEnvelopeSuccess = true -) diff --git a/secondarydnsoutgoingenable_test.go b/secondarydnsoutgoingenable_test.go deleted file mode 100644 index 083f575dcf4..00000000000 --- a/secondarydnsoutgoingenable_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestSecondaryDNSOutgoingEnableSecondaryDNSPrimaryZoneEnableOutgoingZoneTransfers(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SecondaryDNS.Outgoings.Enables.SecondaryDNSPrimaryZoneEnableOutgoingZoneTransfers(context.TODO(), "269d8f4853475ca241c4e730be286b20") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/secondarydnsoutgoingforcenotify.go b/secondarydnsoutgoingforcenotify.go deleted file mode 100644 index d3abca3c5e2..00000000000 --- a/secondarydnsoutgoingforcenotify.go +++ /dev/null @@ -1,118 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// SecondaryDNSOutgoingForceNotifyService contains methods and other services that -// help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewSecondaryDNSOutgoingForceNotifyService] method instead. -type SecondaryDNSOutgoingForceNotifyService struct { - Options []option.RequestOption -} - -// NewSecondaryDNSOutgoingForceNotifyService generates a new service that applies -// the given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewSecondaryDNSOutgoingForceNotifyService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingForceNotifyService) { - r = &SecondaryDNSOutgoingForceNotifyService{} - r.Options = opts - return -} - -// Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. -func (r *SecondaryDNSOutgoingForceNotifyService) SecondaryDNSPrimaryZoneForceDNSNotify(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelope - path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/force_notify", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelope struct { - Errors []SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessages `json:"messages,required"` - // When force_notify query parameter is set to true, the response is a simple - // string - Result string `json:"result,required"` - // Whether the API call was successful - Success SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeJSON `json:"-"` -} - -// secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelope] -type secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrors] -type secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessages] -type secondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeSuccess bool - -const ( - SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeSuccessTrue SecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotifyResponseEnvelopeSuccess = true -) diff --git a/secondarydnsoutgoingforcenotify_test.go b/secondarydnsoutgoingforcenotify_test.go deleted file mode 100644 index bc9470e453d..00000000000 --- a/secondarydnsoutgoingforcenotify_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestSecondaryDNSOutgoingForceNotifySecondaryDNSPrimaryZoneForceDNSNotify(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SecondaryDNS.Outgoings.ForceNotifies.SecondaryDNSPrimaryZoneForceDNSNotify(context.TODO(), "269d8f4853475ca241c4e730be286b20") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/secondarydnsoutgoingstatus.go b/secondarydnsoutgoingstatus.go index 82ba7b1386e..a788783e0c1 100644 --- a/secondarydnsoutgoingstatus.go +++ b/secondarydnsoutgoingstatus.go @@ -31,9 +31,9 @@ func NewSecondaryDNSOutgoingStatusService(opts ...option.RequestOption) (r *Seco } // Get primary zone transfer status. -func (r *SecondaryDNSOutgoingStatusService) SecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatus(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { +func (r *SecondaryDNSOutgoingStatusService) Get(ctx context.Context, zoneID interface{}, opts ...option.RequestOption) (res *string, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelope + var env SecondaryDNSOutgoingStatusGetResponseEnvelope path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/status", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,20 +43,19 @@ func (r *SecondaryDNSOutgoingStatusService) SecondaryDNSPrimaryZoneGetOutgoingZo return } -type SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelope struct { - Errors []SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessages `json:"messages,required"` +type SecondaryDNSOutgoingStatusGetResponseEnvelope struct { + Errors []SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages `json:"messages,required"` // The zone transfer status of a primary zone Result string `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSOutgoingStatusGetResponseEnvelopeJSON `json:"-"` } -// secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelope] -type secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeJSON struct { +// secondaryDNSOutgoingStatusGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [SecondaryDNSOutgoingStatusGetResponseEnvelope] +type secondaryDNSOutgoingStatusGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -65,53 +64,51 @@ type secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferSta ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrors] -type secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrorsJSON struct { +// secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors] +type secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessages] -type secondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessagesJSON struct { +// secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages] +type secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeSuccess bool +type SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess bool const ( - SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeSuccessTrue SecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatusResponseEnvelopeSuccess = true + SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccessTrue SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess = true ) diff --git a/secondarydnsoutgoingstatus_test.go b/secondarydnsoutgoingstatus_test.go index 26a82aeb7cf..3b36135fd24 100644 --- a/secondarydnsoutgoingstatus_test.go +++ b/secondarydnsoutgoingstatus_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatus(t *testing.T) { +func TestSecondaryDNSOutgoingStatusGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestSecondaryDNSOutgoingStatusSecondaryDNSPrimaryZoneGetOutgoingZoneTransfe option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Outgoings.Statuses.SecondaryDNSPrimaryZoneGetOutgoingZoneTransferStatus(context.TODO(), "269d8f4853475ca241c4e730be286b20") + _, err := client.SecondaryDNS.Outgoing.Status.Get(context.TODO(), "269d8f4853475ca241c4e730be286b20") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/secondarydnspeer.go b/secondarydnspeer.go index 58bd45543ef..70c9a3c7cc2 100644 --- a/secondarydnspeer.go +++ b/secondarydnspeer.go @@ -31,12 +31,25 @@ func NewSecondaryDNSPeerService(opts ...option.RequestOption) (r *SecondaryDNSPe return } -// Modify Peer. -func (r *SecondaryDNSPeerService) Update(ctx context.Context, accountID interface{}, peerID interface{}, body SecondaryDNSPeerUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSPeerUpdateResponse, err error) { +// Create Peer. +func (r *SecondaryDNSPeerService) New(ctx context.Context, accountID interface{}, body SecondaryDNSPeerNewParams, opts ...option.RequestOption) (res *SecondaryDNSPeerNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSPeerUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", accountID, peerID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env SecondaryDNSPeerNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/peers", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List Peers. +func (r *SecondaryDNSPeerService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDNSPeerListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDNSPeerListResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/peers", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -70,12 +83,12 @@ func (r *SecondaryDNSPeerService) Get(ctx context.Context, accountID interface{} return } -// Create Peer. -func (r *SecondaryDNSPeerService) SecondaryDNSPeerNewPeer(ctx context.Context, accountID interface{}, body SecondaryDNSPeerSecondaryDNSPeerNewPeerParams, opts ...option.RequestOption) (res *SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse, err error) { +// Modify Peer. +func (r *SecondaryDNSPeerService) Replace(ctx context.Context, accountID interface{}, peerID interface{}, body SecondaryDNSPeerReplaceParams, opts ...option.RequestOption) (res *SecondaryDNSPeerReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/peers", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env SecondaryDNSPeerReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", accountID, peerID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -83,20 +96,45 @@ func (r *SecondaryDNSPeerService) SecondaryDNSPeerNewPeer(ctx context.Context, a return } -// List Peers. -func (r *SecondaryDNSPeerService) SecondaryDNSPeerListPeers(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDNSPeerSecondaryDNSPeerListPeersResponse, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/peers", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type SecondaryDNSPeerNewResponse struct { + ID interface{} `json:"id,required"` + // The name of the peer. + Name string `json:"name,required"` + // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone + // this peer is linked to. For primary zones this IP defines the IP of the + // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary + // zones this IP defines the IP of the primary nameserver Cloudflare will send + // AXFR/IXFR requests to. + IP string `json:"ip"` + // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary + // zones. + IxfrEnable bool `json:"ixfr_enable"` + // DNS port of primary or secondary nameserver, depending on what zone this peer is + // linked to. + Port float64 `json:"port"` + // TSIG authentication will be used for zone transfer if configured. + TsigID string `json:"tsig_id"` + JSON secondaryDNSPeerNewResponseJSON `json:"-"` +} + +// secondaryDNSPeerNewResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSPeerNewResponse] +type secondaryDNSPeerNewResponseJSON struct { + ID apijson.Field + Name apijson.Field + IP apijson.Field + IxfrEnable apijson.Field + Port apijson.Field + TsigID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSPeerNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerUpdateResponse struct { +type SecondaryDNSPeerListResponse struct { ID interface{} `json:"id,required"` // The name of the peer. Name string `json:"name,required"` @@ -113,13 +151,13 @@ type SecondaryDNSPeerUpdateResponse struct { // linked to. Port float64 `json:"port"` // TSIG authentication will be used for zone transfer if configured. - TsigID string `json:"tsig_id"` - JSON secondaryDNSPeerUpdateResponseJSON `json:"-"` + TsigID string `json:"tsig_id"` + JSON secondaryDNSPeerListResponseJSON `json:"-"` } -// secondaryDNSPeerUpdateResponseJSON contains the JSON metadata for the struct -// [SecondaryDNSPeerUpdateResponse] -type secondaryDNSPeerUpdateResponseJSON struct { +// secondaryDNSPeerListResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSPeerListResponse] +type secondaryDNSPeerListResponseJSON struct { ID apijson.Field Name apijson.Field IP apijson.Field @@ -130,7 +168,7 @@ type secondaryDNSPeerUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -189,7 +227,7 @@ func (r *SecondaryDNSPeerGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse struct { +type SecondaryDNSPeerReplaceResponse struct { ID interface{} `json:"id,required"` // The name of the peer. Name string `json:"name,required"` @@ -206,13 +244,13 @@ type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse struct { // linked to. Port float64 `json:"port"` // TSIG authentication will be used for zone transfer if configured. - TsigID string `json:"tsig_id"` - JSON secondaryDNSPeerSecondaryDNSPeerNewPeerResponseJSON `json:"-"` + TsigID string `json:"tsig_id"` + JSON secondaryDNSPeerReplaceResponseJSON `json:"-"` } -// secondaryDNSPeerSecondaryDNSPeerNewPeerResponseJSON contains the JSON metadata -// for the struct [SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse] -type secondaryDNSPeerSecondaryDNSPeerNewPeerResponseJSON struct { +// secondaryDNSPeerReplaceResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSPeerReplaceResponse] +type secondaryDNSPeerReplaceResponseJSON struct { ID apijson.Field Name apijson.Field IP apijson.Field @@ -223,140 +261,185 @@ type secondaryDNSPeerSecondaryDNSPeerNewPeerResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponse struct { - ID interface{} `json:"id,required"` - // The name of the peer. - Name string `json:"name,required"` - // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone - // this peer is linked to. For primary zones this IP defines the IP of the - // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary - // zones this IP defines the IP of the primary nameserver Cloudflare will send - // AXFR/IXFR requests to. - IP string `json:"ip"` - // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary - // zones. - IxfrEnable bool `json:"ixfr_enable"` - // DNS port of primary or secondary nameserver, depending on what zone this peer is - // linked to. - Port float64 `json:"port"` - // TSIG authentication will be used for zone transfer if configured. - TsigID string `json:"tsig_id"` - JSON secondaryDNSPeerSecondaryDNSPeerListPeersResponseJSON `json:"-"` +type SecondaryDNSPeerNewParams struct { + Body param.Field[interface{}] `json:"body,required"` } -// secondaryDNSPeerSecondaryDNSPeerListPeersResponseJSON contains the JSON metadata -// for the struct [SecondaryDNSPeerSecondaryDNSPeerListPeersResponse] -type secondaryDNSPeerSecondaryDNSPeerListPeersResponseJSON struct { - ID apijson.Field - Name apijson.Field - IP apijson.Field - IxfrEnable apijson.Field - Port apijson.Field - TsigID apijson.Field +func (r SecondaryDNSPeerNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type SecondaryDNSPeerNewResponseEnvelope struct { + Errors []SecondaryDNSPeerNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSPeerNewResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSPeerNewResponse `json:"result,required"` + // Whether the API call was successful + Success SecondaryDNSPeerNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSPeerNewResponseEnvelopeJSON `json:"-"` +} + +// secondaryDNSPeerNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSPeerNewResponseEnvelope] +type secondaryDNSPeerNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerSecondaryDNSPeerListPeersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerUpdateParams struct { - // The name of the peer. - Name param.Field[string] `json:"name,required"` - // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone - // this peer is linked to. For primary zones this IP defines the IP of the - // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary - // zones this IP defines the IP of the primary nameserver Cloudflare will send - // AXFR/IXFR requests to. - IP param.Field[string] `json:"ip"` - // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary - // zones. - IxfrEnable param.Field[bool] `json:"ixfr_enable"` - // DNS port of primary or secondary nameserver, depending on what zone this peer is - // linked to. - Port param.Field[float64] `json:"port"` - // TSIG authentication will be used for zone transfer if configured. - TsigID param.Field[string] `json:"tsig_id"` +type SecondaryDNSPeerNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerNewResponseEnvelopeErrorsJSON `json:"-"` } -func (r SecondaryDNSPeerUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// secondaryDNSPeerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SecondaryDNSPeerNewResponseEnvelopeErrors] +type secondaryDNSPeerNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSPeerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerUpdateResponseEnvelope struct { - Errors []SecondaryDNSPeerUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSPeerUpdateResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSPeerUpdateResponse `json:"result,required"` +type SecondaryDNSPeerNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// secondaryDNSPeerNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDNSPeerNewResponseEnvelopeMessages] +type secondaryDNSPeerNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSPeerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SecondaryDNSPeerNewResponseEnvelopeSuccess bool + +const ( + SecondaryDNSPeerNewResponseEnvelopeSuccessTrue SecondaryDNSPeerNewResponseEnvelopeSuccess = true +) + +type SecondaryDNSPeerListResponseEnvelope struct { + Errors []SecondaryDNSPeerListResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSPeerListResponseEnvelopeMessages `json:"messages,required"` + Result []SecondaryDNSPeerListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SecondaryDNSPeerUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSPeerUpdateResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSPeerListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo SecondaryDNSPeerListResponseEnvelopeResultInfo `json:"result_info"` + JSON secondaryDNSPeerListResponseEnvelopeJSON `json:"-"` } -// secondaryDNSPeerUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [SecondaryDNSPeerUpdateResponseEnvelope] -type secondaryDNSPeerUpdateResponseEnvelopeJSON struct { +// secondaryDNSPeerListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSPeerListResponseEnvelope] +type secondaryDNSPeerListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSPeerListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerListResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [SecondaryDNSPeerUpdateResponseEnvelopeErrors] -type secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON struct { +// secondaryDNSPeerListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSPeerListResponseEnvelopeErrors] +type secondaryDNSPeerListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSPeerListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerListResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [SecondaryDNSPeerUpdateResponseEnvelopeMessages] -type secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON struct { +// secondaryDNSPeerListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDNSPeerListResponseEnvelopeMessages] +type secondaryDNSPeerListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSPeerUpdateResponseEnvelopeSuccess bool +type SecondaryDNSPeerListResponseEnvelopeSuccess bool const ( - SecondaryDNSPeerUpdateResponseEnvelopeSuccessTrue SecondaryDNSPeerUpdateResponseEnvelopeSuccess = true + SecondaryDNSPeerListResponseEnvelopeSuccessTrue SecondaryDNSPeerListResponseEnvelopeSuccess = true ) +type SecondaryDNSPeerListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON secondaryDNSPeerListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// secondaryDNSPeerListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [SecondaryDNSPeerListResponseEnvelopeResultInfo] +type secondaryDNSPeerListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSPeerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type SecondaryDNSPeerDeleteResponseEnvelope struct { Errors []SecondaryDNSPeerDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []SecondaryDNSPeerDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -495,184 +578,94 @@ const ( SecondaryDNSPeerGetResponseEnvelopeSuccessTrue SecondaryDNSPeerGetResponseEnvelopeSuccess = true ) -type SecondaryDNSPeerSecondaryDNSPeerNewPeerParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r SecondaryDNSPeerSecondaryDNSPeerNewPeerParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelope struct { - Errors []SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSPeerSecondaryDNSPeerNewPeerResponse `json:"result,required"` - // Whether the API call was successful - Success SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeJSON `json:"-"` -} - -// secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelope] -type secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrors] -type secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessages] -type secondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +type SecondaryDNSPeerReplaceParams struct { + // The name of the peer. + Name param.Field[string] `json:"name,required"` + // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone + // this peer is linked to. For primary zones this IP defines the IP of the + // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary + // zones this IP defines the IP of the primary nameserver Cloudflare will send + // AXFR/IXFR requests to. + IP param.Field[string] `json:"ip"` + // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary + // zones. + IxfrEnable param.Field[bool] `json:"ixfr_enable"` + // DNS port of primary or secondary nameserver, depending on what zone this peer is + // linked to. + Port param.Field[float64] `json:"port"` + // TSIG authentication will be used for zone transfer if configured. + TsigID param.Field[string] `json:"tsig_id"` } -func (r *SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r SecondaryDNSPeerReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// Whether the API call was successful -type SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeSuccess bool - -const ( - SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeSuccessTrue SecondaryDNSPeerSecondaryDNSPeerNewPeerResponseEnvelopeSuccess = true -) - -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelope struct { - Errors []SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessages `json:"messages,required"` - Result []SecondaryDNSPeerSecondaryDNSPeerListPeersResponse `json:"result,required,nullable"` +type SecondaryDNSPeerReplaceResponseEnvelope struct { + Errors []SecondaryDNSPeerReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSPeerReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSPeerReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfo `json:"result_info"` - JSON secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSPeerReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSPeerReplaceResponseEnvelopeJSON `json:"-"` } -// secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelope] -type secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeJSON struct { +// secondaryDNSPeerReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSPeerReplaceResponseEnvelope] +type secondaryDNSPeerReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSPeerReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrors] -type secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrorsJSON struct { +// secondaryDNSPeerReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSPeerReplaceResponseEnvelopeErrors] +type secondaryDNSPeerReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSPeerReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSPeerReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessages] -type secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessagesJSON struct { +// secondaryDNSPeerReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSPeerReplaceResponseEnvelopeMessages] +type secondaryDNSPeerReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSPeerReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeSuccess bool +type SecondaryDNSPeerReplaceResponseEnvelopeSuccess bool const ( - SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeSuccessTrue SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeSuccess = true + SecondaryDNSPeerReplaceResponseEnvelopeSuccessTrue SecondaryDNSPeerReplaceResponseEnvelopeSuccess = true ) - -type SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfoJSON `json:"-"` -} - -// secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfo] -type secondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSPeerSecondaryDNSPeerListPeersResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/secondarydnspeer_test.go b/secondarydnspeer_test.go index 40e78195460..b78cb30d177 100644 --- a/secondarydnspeer_test.go +++ b/secondarydnspeer_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSPeerUpdateWithOptionalParams(t *testing.T) { +func TestSecondaryDNSPeerNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,16 +29,11 @@ func TestSecondaryDNSPeerUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Peers.Update( + _, err := client.SecondaryDNS.Peers.New( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - "23ff594956f20c2a721606e94745a8aa", - cloudflare.SecondaryDNSPeerUpdateParams{ - Name: cloudflare.F("my-peer-1"), - IP: cloudflare.F("192.0.2.53"), - IxfrEnable: cloudflare.F(false), - Port: cloudflare.F(53.000000), - TsigID: cloudflare.F("69cd1e104af3e6ed3cb344f263fd0d5a"), + cloudflare.SecondaryDNSPeerNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -50,7 +45,7 @@ func TestSecondaryDNSPeerUpdateWithOptionalParams(t *testing.T) { } } -func TestSecondaryDNSPeerDelete(t *testing.T) { +func TestSecondaryDNSPeerList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -66,11 +61,7 @@ func TestSecondaryDNSPeerDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Peers.Delete( - context.TODO(), - "01a7362d577a6c3019a474fd6f485823", - "23ff594956f20c2a721606e94745a8aa", - ) + _, err := client.SecondaryDNS.Peers.List(context.TODO(), "01a7362d577a6c3019a474fd6f485823") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -80,7 +71,7 @@ func TestSecondaryDNSPeerDelete(t *testing.T) { } } -func TestSecondaryDNSPeerGet(t *testing.T) { +func TestSecondaryDNSPeerDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -96,7 +87,7 @@ func TestSecondaryDNSPeerGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Peers.Get( + _, err := client.SecondaryDNS.Peers.Delete( context.TODO(), "01a7362d577a6c3019a474fd6f485823", "23ff594956f20c2a721606e94745a8aa", @@ -110,7 +101,7 @@ func TestSecondaryDNSPeerGet(t *testing.T) { } } -func TestSecondaryDNSPeerSecondaryDNSPeerNewPeer(t *testing.T) { +func TestSecondaryDNSPeerGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,12 +117,10 @@ func TestSecondaryDNSPeerSecondaryDNSPeerNewPeer(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Peers.SecondaryDNSPeerNewPeer( + _, err := client.SecondaryDNS.Peers.Get( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - cloudflare.SecondaryDNSPeerSecondaryDNSPeerNewPeerParams{ - Body: cloudflare.F[any](map[string]interface{}{}), - }, + "23ff594956f20c2a721606e94745a8aa", ) if err != nil { var apierr *cloudflare.Error @@ -142,7 +131,7 @@ func TestSecondaryDNSPeerSecondaryDNSPeerNewPeer(t *testing.T) { } } -func TestSecondaryDNSPeerSecondaryDNSPeerListPeers(t *testing.T) { +func TestSecondaryDNSPeerReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -158,7 +147,18 @@ func TestSecondaryDNSPeerSecondaryDNSPeerListPeers(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Peers.SecondaryDNSPeerListPeers(context.TODO(), "01a7362d577a6c3019a474fd6f485823") + _, err := client.SecondaryDNS.Peers.Replace( + context.TODO(), + "01a7362d577a6c3019a474fd6f485823", + "23ff594956f20c2a721606e94745a8aa", + cloudflare.SecondaryDNSPeerReplaceParams{ + Name: cloudflare.F("my-peer-1"), + IP: cloudflare.F("192.0.2.53"), + IxfrEnable: cloudflare.F(false), + Port: cloudflare.F(53.000000), + TsigID: cloudflare.F("69cd1e104af3e6ed3cb344f263fd0d5a"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/secondarydnstsig.go b/secondarydnstsig.go index 5f2a4d7bced..e0fcab42060 100644 --- a/secondarydnstsig.go +++ b/secondarydnstsig.go @@ -31,12 +31,25 @@ func NewSecondaryDNSTsigService(opts ...option.RequestOption) (r *SecondaryDNSTs return } -// Modify TSIG. -func (r *SecondaryDNSTsigService) Update(ctx context.Context, accountID interface{}, tsigID interface{}, body SecondaryDNSTsigUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSTsigUpdateResponse, err error) { +// Create TSIG. +func (r *SecondaryDNSTsigService) New(ctx context.Context, accountID interface{}, body SecondaryDNSTsigNewParams, opts ...option.RequestOption) (res *SecondaryDNSTsigNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSTsigUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", accountID, tsigID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env SecondaryDNSTsigNewResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List TSIGs. +func (r *SecondaryDNSTsigService) List(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDNSTsigListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SecondaryDNSTsigListResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -70,12 +83,12 @@ func (r *SecondaryDNSTsigService) Get(ctx context.Context, accountID interface{} return } -// Create TSIG. -func (r *SecondaryDNSTsigService) SecondaryDNSTsigNewTsig(ctx context.Context, accountID interface{}, body SecondaryDNSTsigSecondaryDNSTsigNewTsigParams, opts ...option.RequestOption) (res *SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse, err error) { +// Modify TSIG. +func (r *SecondaryDNSTsigService) Replace(ctx context.Context, accountID interface{}, tsigID interface{}, body SecondaryDNSTsigReplaceParams, opts ...option.RequestOption) (res *SecondaryDNSTsigReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env SecondaryDNSTsigReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", accountID, tsigID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -83,33 +96,46 @@ func (r *SecondaryDNSTsigService) SecondaryDNSTsigNewTsig(ctx context.Context, a return } -// List TSIGs. -func (r *SecondaryDNSTsigService) SecondaryDNSTsigListTsiGs(ctx context.Context, accountID interface{}, opts ...option.RequestOption) (res *[]SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse, err error) { - opts = append(r.Options[:], opts...) - var env SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelope - path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type SecondaryDNSTsigNewResponse struct { + ID interface{} `json:"id,required"` + // TSIG algorithm. + Algo string `json:"algo,required"` + // TSIG key name. + Name string `json:"name,required"` + // TSIG secret. + Secret string `json:"secret,required"` + JSON secondaryDNSTsigNewResponseJSON `json:"-"` +} + +// secondaryDNSTsigNewResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSTsigNewResponse] +type secondaryDNSTsigNewResponseJSON struct { + ID apijson.Field + Algo apijson.Field + Name apijson.Field + Secret apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type SecondaryDNSTsigUpdateResponse struct { +func (r *SecondaryDNSTsigNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSTsigListResponse struct { ID interface{} `json:"id,required"` // TSIG algorithm. Algo string `json:"algo,required"` // TSIG key name. Name string `json:"name,required"` // TSIG secret. - Secret string `json:"secret,required"` - JSON secondaryDNSTsigUpdateResponseJSON `json:"-"` + Secret string `json:"secret,required"` + JSON secondaryDNSTsigListResponseJSON `json:"-"` } -// secondaryDNSTsigUpdateResponseJSON contains the JSON metadata for the struct -// [SecondaryDNSTsigUpdateResponse] -type secondaryDNSTsigUpdateResponseJSON struct { +// secondaryDNSTsigListResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSTsigListResponse] +type secondaryDNSTsigListResponseJSON struct { ID apijson.Field Algo apijson.Field Name apijson.Field @@ -118,7 +144,7 @@ type secondaryDNSTsigUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -165,20 +191,20 @@ func (r *SecondaryDNSTsigGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse struct { +type SecondaryDNSTsigReplaceResponse struct { ID interface{} `json:"id,required"` // TSIG algorithm. Algo string `json:"algo,required"` // TSIG key name. Name string `json:"name,required"` // TSIG secret. - Secret string `json:"secret,required"` - JSON secondaryDNSTsigSecondaryDNSTsigNewTsigResponseJSON `json:"-"` + Secret string `json:"secret,required"` + JSON secondaryDNSTsigReplaceResponseJSON `json:"-"` } -// secondaryDNSTsigSecondaryDNSTsigNewTsigResponseJSON contains the JSON metadata -// for the struct [SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse] -type secondaryDNSTsigSecondaryDNSTsigNewTsigResponseJSON struct { +// secondaryDNSTsigReplaceResponseJSON contains the JSON metadata for the struct +// [SecondaryDNSTsigReplaceResponse] +type secondaryDNSTsigReplaceResponseJSON struct { ID apijson.Field Algo apijson.Field Name apijson.Field @@ -187,118 +213,190 @@ type secondaryDNSTsigSecondaryDNSTsigNewTsigResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse struct { - ID interface{} `json:"id,required"` +type SecondaryDNSTsigNewParams struct { // TSIG algorithm. - Algo string `json:"algo,required"` + Algo param.Field[string] `json:"algo,required"` // TSIG key name. - Name string `json:"name,required"` + Name param.Field[string] `json:"name,required"` // TSIG secret. - Secret string `json:"secret,required"` - JSON secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseJSON `json:"-"` + Secret param.Field[string] `json:"secret,required"` } -// secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseJSON contains the JSON metadata -// for the struct [SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse] -type secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseJSON struct { - ID apijson.Field - Algo apijson.Field - Name apijson.Field - Secret apijson.Field +func (r SecondaryDNSTsigNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SecondaryDNSTsigNewResponseEnvelope struct { + Errors []SecondaryDNSTsigNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSTsigNewResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSTsigNewResponse `json:"result,required"` + // Whether the API call was successful + Success SecondaryDNSTsigNewResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSTsigNewResponseEnvelopeJSON `json:"-"` +} + +// secondaryDNSTsigNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSTsigNewResponseEnvelope] +type secondaryDNSTsigNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigUpdateParams struct { - // TSIG algorithm. - Algo param.Field[string] `json:"algo,required"` - // TSIG key name. - Name param.Field[string] `json:"name,required"` - // TSIG secret. - Secret param.Field[string] `json:"secret,required"` +type SecondaryDNSTsigNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigNewResponseEnvelopeErrorsJSON `json:"-"` } -func (r SecondaryDNSTsigUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// secondaryDNSTsigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SecondaryDNSTsigNewResponseEnvelopeErrors] +type secondaryDNSTsigNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSTsigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SecondaryDNSTsigNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// secondaryDNSTsigNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDNSTsigNewResponseEnvelopeMessages] +type secondaryDNSTsigNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type SecondaryDNSTsigUpdateResponseEnvelope struct { - Errors []SecondaryDNSTsigUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSTsigUpdateResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSTsigUpdateResponse `json:"result,required"` +func (r *SecondaryDNSTsigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SecondaryDNSTsigNewResponseEnvelopeSuccess bool + +const ( + SecondaryDNSTsigNewResponseEnvelopeSuccessTrue SecondaryDNSTsigNewResponseEnvelopeSuccess = true +) + +type SecondaryDNSTsigListResponseEnvelope struct { + Errors []SecondaryDNSTsigListResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSTsigListResponseEnvelopeMessages `json:"messages,required"` + Result []SecondaryDNSTsigListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SecondaryDNSTsigUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSTsigUpdateResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSTsigListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo SecondaryDNSTsigListResponseEnvelopeResultInfo `json:"result_info"` + JSON secondaryDNSTsigListResponseEnvelopeJSON `json:"-"` } -// secondaryDNSTsigUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [SecondaryDNSTsigUpdateResponseEnvelope] -type secondaryDNSTsigUpdateResponseEnvelopeJSON struct { +// secondaryDNSTsigListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSTsigListResponseEnvelope] +type secondaryDNSTsigListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSTsigListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigListResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSTsigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [SecondaryDNSTsigUpdateResponseEnvelopeErrors] -type secondaryDNSTsigUpdateResponseEnvelopeErrorsJSON struct { +// secondaryDNSTsigListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSTsigListResponseEnvelopeErrors] +type secondaryDNSTsigListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSTsigListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigListResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSTsigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [SecondaryDNSTsigUpdateResponseEnvelopeMessages] -type secondaryDNSTsigUpdateResponseEnvelopeMessagesJSON struct { +// secondaryDNSTsigListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SecondaryDNSTsigListResponseEnvelopeMessages] +type secondaryDNSTsigListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSTsigUpdateResponseEnvelopeSuccess bool +type SecondaryDNSTsigListResponseEnvelopeSuccess bool const ( - SecondaryDNSTsigUpdateResponseEnvelopeSuccessTrue SecondaryDNSTsigUpdateResponseEnvelopeSuccess = true + SecondaryDNSTsigListResponseEnvelopeSuccessTrue SecondaryDNSTsigListResponseEnvelopeSuccess = true ) +type SecondaryDNSTsigListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON secondaryDNSTsigListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// secondaryDNSTsigListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [SecondaryDNSTsigListResponseEnvelopeResultInfo] +type secondaryDNSTsigListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SecondaryDNSTsigListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type SecondaryDNSTsigDeleteResponseEnvelope struct { Errors []SecondaryDNSTsigDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []SecondaryDNSTsigDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -437,7 +535,7 @@ const ( SecondaryDNSTsigGetResponseEnvelopeSuccessTrue SecondaryDNSTsigGetResponseEnvelopeSuccess = true ) -type SecondaryDNSTsigSecondaryDNSTsigNewTsigParams struct { +type SecondaryDNSTsigReplaceParams struct { // TSIG algorithm. Algo param.Field[string] `json:"algo,required"` // TSIG key name. @@ -446,180 +544,75 @@ type SecondaryDNSTsigSecondaryDNSTsigNewTsigParams struct { Secret param.Field[string] `json:"secret,required"` } -func (r SecondaryDNSTsigSecondaryDNSTsigNewTsigParams) MarshalJSON() (data []byte, err error) { +func (r SecondaryDNSTsigReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelope struct { - Errors []SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessages `json:"messages,required"` - Result SecondaryDNSTsigSecondaryDNSTsigNewTsigResponse `json:"result,required"` - // Whether the API call was successful - Success SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeSuccess `json:"success,required"` - JSON secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeJSON `json:"-"` -} - -// secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelope] -type secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrorsJSON `json:"-"` -} - -// secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrors] -type secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessagesJSON `json:"-"` -} - -// secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessages] -type secondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeSuccess bool - -const ( - SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeSuccessTrue SecondaryDNSTsigSecondaryDNSTsigNewTsigResponseEnvelopeSuccess = true -) - -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelope struct { - Errors []SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrors `json:"errors,required"` - Messages []SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessages `json:"messages,required"` - Result []SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponse `json:"result,required,nullable"` +type SecondaryDNSTsigReplaceResponseEnvelope struct { + Errors []SecondaryDNSTsigReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SecondaryDNSTsigReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SecondaryDNSTsigReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfo `json:"result_info"` - JSON secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeJSON `json:"-"` + Success SecondaryDNSTsigReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON secondaryDNSTsigReplaceResponseEnvelopeJSON `json:"-"` } -// secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelope] -type secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeJSON struct { +// secondaryDNSTsigReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [SecondaryDNSTsigReplaceResponseEnvelope] +type secondaryDNSTsigReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrorsJSON `json:"-"` +type SecondaryDNSTsigReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrors] -type secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrorsJSON struct { +// secondaryDNSTsigReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SecondaryDNSTsigReplaceResponseEnvelopeErrors] +type secondaryDNSTsigReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessagesJSON `json:"-"` +type SecondaryDNSTsigReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON secondaryDNSTsigReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessages] -type secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessagesJSON struct { +// secondaryDNSTsigReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SecondaryDNSTsigReplaceResponseEnvelopeMessages] +type secondaryDNSTsigReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SecondaryDNSTsigReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeSuccess bool +type SecondaryDNSTsigReplaceResponseEnvelopeSuccess bool const ( - SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeSuccessTrue SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeSuccess = true + SecondaryDNSTsigReplaceResponseEnvelopeSuccessTrue SecondaryDNSTsigReplaceResponseEnvelopeSuccess = true ) - -type SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfo] -type secondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SecondaryDNSTsigSecondaryDNSTsigListTsiGsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/secondarydnstsig_test.go b/secondarydnstsig_test.go index 21fdd09c6b5..dd3edec3fdd 100644 --- a/secondarydnstsig_test.go +++ b/secondarydnstsig_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSecondaryDNSTsigUpdate(t *testing.T) { +func TestSecondaryDNSTsigNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestSecondaryDNSTsigUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Tsigs.Update( + _, err := client.SecondaryDNS.Tsigs.New( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - "69cd1e104af3e6ed3cb344f263fd0d5a", - cloudflare.SecondaryDNSTsigUpdateParams{ + cloudflare.SecondaryDNSTsigNewParams{ Algo: cloudflare.F("hmac-sha512."), Name: cloudflare.F("tsig.customer.cf."), Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), @@ -48,7 +47,7 @@ func TestSecondaryDNSTsigUpdate(t *testing.T) { } } -func TestSecondaryDNSTsigDelete(t *testing.T) { +func TestSecondaryDNSTsigList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,11 +63,7 @@ func TestSecondaryDNSTsigDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Tsigs.Delete( - context.TODO(), - "01a7362d577a6c3019a474fd6f485823", - "69cd1e104af3e6ed3cb344f263fd0d5a", - ) + _, err := client.SecondaryDNS.Tsigs.List(context.TODO(), "01a7362d577a6c3019a474fd6f485823") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -78,7 +73,7 @@ func TestSecondaryDNSTsigDelete(t *testing.T) { } } -func TestSecondaryDNSTsigGet(t *testing.T) { +func TestSecondaryDNSTsigDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,7 +89,7 @@ func TestSecondaryDNSTsigGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Tsigs.Get( + _, err := client.SecondaryDNS.Tsigs.Delete( context.TODO(), "01a7362d577a6c3019a474fd6f485823", "69cd1e104af3e6ed3cb344f263fd0d5a", @@ -108,7 +103,7 @@ func TestSecondaryDNSTsigGet(t *testing.T) { } } -func TestSecondaryDNSTsigSecondaryDNSTsigNewTsig(t *testing.T) { +func TestSecondaryDNSTsigGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,14 +119,10 @@ func TestSecondaryDNSTsigSecondaryDNSTsigNewTsig(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Tsigs.SecondaryDNSTsigNewTsig( + _, err := client.SecondaryDNS.Tsigs.Get( context.TODO(), "01a7362d577a6c3019a474fd6f485823", - cloudflare.SecondaryDNSTsigSecondaryDNSTsigNewTsigParams{ - Algo: cloudflare.F("hmac-sha512."), - Name: cloudflare.F("tsig.customer.cf."), - Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), - }, + "69cd1e104af3e6ed3cb344f263fd0d5a", ) if err != nil { var apierr *cloudflare.Error @@ -142,7 +133,7 @@ func TestSecondaryDNSTsigSecondaryDNSTsigNewTsig(t *testing.T) { } } -func TestSecondaryDNSTsigSecondaryDNSTsigListTsiGs(t *testing.T) { +func TestSecondaryDNSTsigReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -158,7 +149,16 @@ func TestSecondaryDNSTsigSecondaryDNSTsigListTsiGs(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SecondaryDNS.Tsigs.SecondaryDNSTsigListTsiGs(context.TODO(), "01a7362d577a6c3019a474fd6f485823") + _, err := client.SecondaryDNS.Tsigs.Replace( + context.TODO(), + "01a7362d577a6c3019a474fd6f485823", + "69cd1e104af3e6ed3cb344f263fd0d5a", + cloudflare.SecondaryDNSTsigReplaceParams{ + Algo: cloudflare.F("hmac-sha512."), + Name: cloudflare.F("tsig.customer.cf."), + Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/setting.go b/setting.go index 5af5a020ba3..16cf53a5d6a 100644 --- a/setting.go +++ b/setting.go @@ -34,7 +34,7 @@ type SettingService struct { ChallengeTTL *SettingChallengeTTLService Ciphers *SettingCipherService DevelopmentMode *SettingDevelopmentModeService - EarlyHint *SettingEarlyHintService + EarlyHints *SettingEarlyHintService EmailObfuscation *SettingEmailObfuscationService H2Prioritization *SettingH2PrioritizationService HotlinkProtection *SettingHotlinkProtectionService @@ -71,6 +71,7 @@ type SettingService struct { WAF *SettingWAFService Webp *SettingWebpService Websocket *SettingWebsocketService + FontSettings *SettingFontSettingService } // NewSettingService generates a new service that applies the given options to each @@ -92,7 +93,7 @@ func NewSettingService(opts ...option.RequestOption) (r *SettingService) { r.ChallengeTTL = NewSettingChallengeTTLService(opts...) r.Ciphers = NewSettingCipherService(opts...) r.DevelopmentMode = NewSettingDevelopmentModeService(opts...) - r.EarlyHint = NewSettingEarlyHintService(opts...) + r.EarlyHints = NewSettingEarlyHintService(opts...) r.EmailObfuscation = NewSettingEmailObfuscationService(opts...) r.H2Prioritization = NewSettingH2PrioritizationService(opts...) r.HotlinkProtection = NewSettingHotlinkProtectionService(opts...) @@ -129,6 +130,7 @@ func NewSettingService(opts ...option.RequestOption) (r *SettingService) { r.WAF = NewSettingWAFService(opts...) r.Webp = NewSettingWebpService(opts...) r.Websocket = NewSettingWebsocketService(opts...) + r.FontSettings = NewSettingFontSettingService(opts...) return } diff --git a/settingearlyhint_test.go b/settingearlyhint_test.go index aa2488bfeb8..f9ee4469e2b 100644 --- a/settingearlyhint_test.go +++ b/settingearlyhint_test.go @@ -29,7 +29,7 @@ func TestSettingEarlyHintUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Settings.EarlyHint.Update( + _, err := client.Settings.EarlyHints.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.SettingEarlyHintUpdateParams{ @@ -61,7 +61,7 @@ func TestSettingEarlyHintGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Settings.EarlyHint.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Settings.EarlyHints.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/settingfontsetting.go b/settingfontsetting.go new file mode 100644 index 00000000000..b529a288712 --- /dev/null +++ b/settingfontsetting.go @@ -0,0 +1,320 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "time" + + "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/option" +) + +// SettingFontSettingService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewSettingFontSettingService] method +// instead. +type SettingFontSettingService struct { + Options []option.RequestOption +} + +// NewSettingFontSettingService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewSettingFontSettingService(opts ...option.RequestOption) (r *SettingFontSettingService) { + r = &SettingFontSettingService{} + r.Options = opts + return +} + +// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google +// Hosted fonts from your own domain, boost performance, and enhance user privacy. +// Refer to the Cloudflare Fonts documentation for more information. +func (r *SettingFontSettingService) Update(ctx context.Context, zoneID string, body SettingFontSettingUpdateParams, opts ...option.RequestOption) (res *SettingFontSettingUpdateResponse, err error) { + opts = append(r.Options[:], opts...) + var env SettingFontSettingUpdateResponseEnvelope + path := fmt.Sprintf("zones/%s/settings/fonts", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google +// Hosted fonts from your own domain, boost performance, and enhance user privacy. +// Refer to the Cloudflare Fonts documentation for more information. +func (r *SettingFontSettingService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SettingFontSettingGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env SettingFontSettingGetResponseEnvelope + path := fmt.Sprintf("zones/%s/settings/fonts", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google +// Hosted fonts from your own domain, boost performance, and enhance user privacy. +// Refer to the Cloudflare Fonts documentation for more information. +type SettingFontSettingUpdateResponse struct { + // ID of the zone setting. + ID SettingFontSettingUpdateResponseID `json:"id,required"` + // Current value of the zone setting. + Value SettingFontSettingUpdateResponseValue `json:"value,required"` + // Whether or not this setting can be modified for this zone (based on your + // Cloudflare plan level). + Editable SettingFontSettingUpdateResponseEditable `json:"editable"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON settingFontSettingUpdateResponseJSON `json:"-"` +} + +// settingFontSettingUpdateResponseJSON contains the JSON metadata for the struct +// [SettingFontSettingUpdateResponse] +type settingFontSettingUpdateResponseJSON struct { + ID apijson.Field + Value apijson.Field + Editable apijson.Field + ModifiedOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type SettingFontSettingUpdateResponseID string + +const ( + SettingFontSettingUpdateResponseIDFonts SettingFontSettingUpdateResponseID = "fonts" +) + +// Current value of the zone setting. +type SettingFontSettingUpdateResponseValue string + +const ( + SettingFontSettingUpdateResponseValueOn SettingFontSettingUpdateResponseValue = "on" + SettingFontSettingUpdateResponseValueOff SettingFontSettingUpdateResponseValue = "off" +) + +// Whether or not this setting can be modified for this zone (based on your +// Cloudflare plan level). +type SettingFontSettingUpdateResponseEditable bool + +const ( + SettingFontSettingUpdateResponseEditableTrue SettingFontSettingUpdateResponseEditable = true + SettingFontSettingUpdateResponseEditableFalse SettingFontSettingUpdateResponseEditable = false +) + +// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google +// Hosted fonts from your own domain, boost performance, and enhance user privacy. +// Refer to the Cloudflare Fonts documentation for more information. +type SettingFontSettingGetResponse struct { + // ID of the zone setting. + ID SettingFontSettingGetResponseID `json:"id,required"` + // Current value of the zone setting. + Value SettingFontSettingGetResponseValue `json:"value,required"` + // Whether or not this setting can be modified for this zone (based on your + // Cloudflare plan level). + Editable SettingFontSettingGetResponseEditable `json:"editable"` + // last time this setting was modified. + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON settingFontSettingGetResponseJSON `json:"-"` +} + +// settingFontSettingGetResponseJSON contains the JSON metadata for the struct +// [SettingFontSettingGetResponse] +type settingFontSettingGetResponseJSON struct { + ID apijson.Field + Value apijson.Field + Editable apijson.Field + ModifiedOn apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// ID of the zone setting. +type SettingFontSettingGetResponseID string + +const ( + SettingFontSettingGetResponseIDFonts SettingFontSettingGetResponseID = "fonts" +) + +// Current value of the zone setting. +type SettingFontSettingGetResponseValue string + +const ( + SettingFontSettingGetResponseValueOn SettingFontSettingGetResponseValue = "on" + SettingFontSettingGetResponseValueOff SettingFontSettingGetResponseValue = "off" +) + +// Whether or not this setting can be modified for this zone (based on your +// Cloudflare plan level). +type SettingFontSettingGetResponseEditable bool + +const ( + SettingFontSettingGetResponseEditableTrue SettingFontSettingGetResponseEditable = true + SettingFontSettingGetResponseEditableFalse SettingFontSettingGetResponseEditable = false +) + +type SettingFontSettingUpdateParams struct { + // Whether the feature is enabled or disabled. + Value param.Field[SettingFontSettingUpdateParamsValue] `json:"value,required"` +} + +func (r SettingFontSettingUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Whether the feature is enabled or disabled. +type SettingFontSettingUpdateParamsValue string + +const ( + SettingFontSettingUpdateParamsValueOn SettingFontSettingUpdateParamsValue = "on" + SettingFontSettingUpdateParamsValueOff SettingFontSettingUpdateParamsValue = "off" +) + +type SettingFontSettingUpdateResponseEnvelope struct { + Errors []SettingFontSettingUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []SettingFontSettingUpdateResponseEnvelopeMessages `json:"messages,required"` + // Whether the API call was successful + Success bool `json:"success,required"` + // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google + // Hosted fonts from your own domain, boost performance, and enhance user privacy. + // Refer to the Cloudflare Fonts documentation for more information. + Result SettingFontSettingUpdateResponse `json:"result"` + JSON settingFontSettingUpdateResponseEnvelopeJSON `json:"-"` +} + +// settingFontSettingUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [SettingFontSettingUpdateResponseEnvelope] +type settingFontSettingUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SettingFontSettingUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingFontSettingUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// settingFontSettingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SettingFontSettingUpdateResponseEnvelopeErrors] +type settingFontSettingUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SettingFontSettingUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingFontSettingUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// settingFontSettingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SettingFontSettingUpdateResponseEnvelopeMessages] +type settingFontSettingUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SettingFontSettingGetResponseEnvelope struct { + Errors []SettingFontSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SettingFontSettingGetResponseEnvelopeMessages `json:"messages,required"` + // Whether the API call was successful + Success bool `json:"success,required"` + // Enhance your website's font delivery with Cloudflare Fonts. Deliver Google + // Hosted fonts from your own domain, boost performance, and enhance user privacy. + // Refer to the Cloudflare Fonts documentation for more information. + Result SettingFontSettingGetResponse `json:"result"` + JSON settingFontSettingGetResponseEnvelopeJSON `json:"-"` +} + +// settingFontSettingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [SettingFontSettingGetResponseEnvelope] +type settingFontSettingGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SettingFontSettingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingFontSettingGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// settingFontSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SettingFontSettingGetResponseEnvelopeErrors] +type settingFontSettingGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SettingFontSettingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingFontSettingGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// settingFontSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SettingFontSettingGetResponseEnvelopeMessages] +type settingFontSettingGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SettingFontSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/cachcachereserve_test.go b/settingfontsetting_test.go similarity index 79% rename from cachcachereserve_test.go rename to settingfontsetting_test.go index 70954c0c645..489ca1a6de8 100644 --- a/cachcachereserve_test.go +++ b/settingfontsetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCachCacheReserveList(t *testing.T) { +func TestSettingFontSettingUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,13 @@ func TestCachCacheReserveList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.CacheReserves.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Settings.FontSettings.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.SettingFontSettingUpdateParams{ + Value: cloudflare.F(cloudflare.SettingFontSettingUpdateParamsValueOn), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +45,7 @@ func TestCachCacheReserveList(t *testing.T) { } } -func TestCachCacheReserveZoneCacheSettingsChangeCacheReserveSetting(t *testing.T) { +func TestSettingFontSettingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,13 +61,7 @@ func TestCachCacheReserveZoneCacheSettingsChangeCacheReserveSetting(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Caches.CacheReserves.ZoneCacheSettingsChangeCacheReserveSetting( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParams{ - Value: cloudflare.F(cloudflare.CachCacheReserveZoneCacheSettingsChangeCacheReserveSettingParamsValueOn), - }, - ) + _, err := client.Settings.FontSettings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/settingzerortt.go b/settingzerortt.go index 1464c966f65..318b2e5e020 100644 --- a/settingzerortt.go +++ b/settingzerortt.go @@ -32,12 +32,12 @@ func NewSettingZeroRttService(opts ...option.RequestOption) (r *SettingZeroRttSe return } -// Gets 0-RTT session resumption setting. -func (r *SettingZeroRttService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SettingZeroRttGetResponse, err error) { +// Changes the 0-RTT session resumption setting. +func (r *SettingZeroRttService) Update(ctx context.Context, zoneID string, body SettingZeroRttUpdateParams, opts ...option.RequestOption) (res *SettingZeroRttUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env SettingZeroRttGetResponseEnvelope + var env SettingZeroRttUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/settings/0rtt", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *SettingZeroRttService) Get(ctx context.Context, zoneID string, opts ... return } -// Changes the 0-RTT session resumption setting. -func (r *SettingZeroRttService) ZoneSettingsChange0RttSessionResumptionSetting(ctx context.Context, zoneID string, body SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParams, opts ...option.RequestOption) (res *SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse, err error) { +// Gets 0-RTT session resumption setting. +func (r *SettingZeroRttService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SettingZeroRttGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelope + var env SettingZeroRttGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/0rtt", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -59,22 +59,22 @@ func (r *SettingZeroRttService) ZoneSettingsChange0RttSessionResumptionSetting(c } // 0-RTT session resumption enabled for this zone. -type SettingZeroRttGetResponse struct { +type SettingZeroRttUpdateResponse struct { // ID of the zone setting. - ID SettingZeroRttGetResponseID `json:"id,required"` + ID SettingZeroRttUpdateResponseID `json:"id,required"` // Current value of the zone setting. - Value SettingZeroRttGetResponseValue `json:"value,required"` + Value SettingZeroRttUpdateResponseValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable SettingZeroRttGetResponseEditable `json:"editable"` + Editable SettingZeroRttUpdateResponseEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON settingZeroRttGetResponseJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON settingZeroRttUpdateResponseJSON `json:"-"` } -// settingZeroRttGetResponseJSON contains the JSON metadata for the struct -// [SettingZeroRttGetResponse] -type settingZeroRttGetResponseJSON struct { +// settingZeroRttUpdateResponseJSON contains the JSON metadata for the struct +// [SettingZeroRttUpdateResponse] +type settingZeroRttUpdateResponseJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -83,52 +83,51 @@ type settingZeroRttGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // ID of the zone setting. -type SettingZeroRttGetResponseID string +type SettingZeroRttUpdateResponseID string const ( - SettingZeroRttGetResponseID0rtt SettingZeroRttGetResponseID = "0rtt" + SettingZeroRttUpdateResponseID0rtt SettingZeroRttUpdateResponseID = "0rtt" ) // Current value of the zone setting. -type SettingZeroRttGetResponseValue string +type SettingZeroRttUpdateResponseValue string const ( - SettingZeroRttGetResponseValueOn SettingZeroRttGetResponseValue = "on" - SettingZeroRttGetResponseValueOff SettingZeroRttGetResponseValue = "off" + SettingZeroRttUpdateResponseValueOn SettingZeroRttUpdateResponseValue = "on" + SettingZeroRttUpdateResponseValueOff SettingZeroRttUpdateResponseValue = "off" ) // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type SettingZeroRttGetResponseEditable bool +type SettingZeroRttUpdateResponseEditable bool const ( - SettingZeroRttGetResponseEditableTrue SettingZeroRttGetResponseEditable = true - SettingZeroRttGetResponseEditableFalse SettingZeroRttGetResponseEditable = false + SettingZeroRttUpdateResponseEditableTrue SettingZeroRttUpdateResponseEditable = true + SettingZeroRttUpdateResponseEditableFalse SettingZeroRttUpdateResponseEditable = false ) // 0-RTT session resumption enabled for this zone. -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse struct { +type SettingZeroRttGetResponse struct { // ID of the zone setting. - ID SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseID `json:"id,required"` + ID SettingZeroRttGetResponseID `json:"id,required"` // Current value of the zone setting. - Value SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValue `json:"value,required"` + Value SettingZeroRttGetResponseValue `json:"value,required"` // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). - Editable SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditable `json:"editable"` + Editable SettingZeroRttGetResponseEditable `json:"editable"` // last time this setting was modified. - ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` - JSON settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseJSON `json:"-"` + ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"` + JSON settingZeroRttGetResponseJSON `json:"-"` } -// settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseJSON -// contains the JSON metadata for the struct -// [SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse] -type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseJSON struct { +// settingZeroRttGetResponseJSON contains the JSON metadata for the struct +// [SettingZeroRttGetResponse] +type settingZeroRttGetResponseJSON struct { ID apijson.Field Value apijson.Field Editable apijson.Field @@ -137,47 +136,64 @@ type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseJSON st ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // ID of the zone setting. -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseID string +type SettingZeroRttGetResponseID string const ( - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseID0rtt SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseID = "0rtt" + SettingZeroRttGetResponseID0rtt SettingZeroRttGetResponseID = "0rtt" ) // Current value of the zone setting. -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValue string +type SettingZeroRttGetResponseValue string const ( - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValueOn SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValue = "on" - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValueOff SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseValue = "off" + SettingZeroRttGetResponseValueOn SettingZeroRttGetResponseValue = "on" + SettingZeroRttGetResponseValueOff SettingZeroRttGetResponseValue = "off" ) // Whether or not this setting can be modified for this zone (based on your // Cloudflare plan level). -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditable bool +type SettingZeroRttGetResponseEditable bool const ( - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditableTrue SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditable = true - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditableFalse SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEditable = false + SettingZeroRttGetResponseEditableTrue SettingZeroRttGetResponseEditable = true + SettingZeroRttGetResponseEditableFalse SettingZeroRttGetResponseEditable = false ) -type SettingZeroRttGetResponseEnvelope struct { - Errors []SettingZeroRttGetResponseEnvelopeErrors `json:"errors,required"` - Messages []SettingZeroRttGetResponseEnvelopeMessages `json:"messages,required"` +type SettingZeroRttUpdateParams struct { + // Value of the 0-RTT setting. + Value param.Field[SettingZeroRttUpdateParamsValue] `json:"value,required"` +} + +func (r SettingZeroRttUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Value of the 0-RTT setting. +type SettingZeroRttUpdateParamsValue string + +const ( + SettingZeroRttUpdateParamsValueOn SettingZeroRttUpdateParamsValue = "on" + SettingZeroRttUpdateParamsValueOff SettingZeroRttUpdateParamsValue = "off" +) + +type SettingZeroRttUpdateResponseEnvelope struct { + Errors []SettingZeroRttUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []SettingZeroRttUpdateResponseEnvelopeMessages `json:"messages,required"` // Whether the API call was successful Success bool `json:"success,required"` // 0-RTT session resumption enabled for this zone. - Result SettingZeroRttGetResponse `json:"result"` - JSON settingZeroRttGetResponseEnvelopeJSON `json:"-"` + Result SettingZeroRttUpdateResponse `json:"result"` + JSON settingZeroRttUpdateResponseEnvelopeJSON `json:"-"` } -// settingZeroRttGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [SettingZeroRttGetResponseEnvelope] -type settingZeroRttGetResponseEnvelopeJSON struct { +// settingZeroRttUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [SettingZeroRttUpdateResponseEnvelope] +type settingZeroRttUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Success apijson.Field @@ -186,79 +202,61 @@ type settingZeroRttGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SettingZeroRttGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON settingZeroRttGetResponseEnvelopeErrorsJSON `json:"-"` +type SettingZeroRttUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingZeroRttUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// settingZeroRttGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [SettingZeroRttGetResponseEnvelopeErrors] -type settingZeroRttGetResponseEnvelopeErrorsJSON struct { +// settingZeroRttUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SettingZeroRttUpdateResponseEnvelopeErrors] +type settingZeroRttUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SettingZeroRttGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON settingZeroRttGetResponseEnvelopeMessagesJSON `json:"-"` +type SettingZeroRttUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingZeroRttUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// settingZeroRttGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [SettingZeroRttGetResponseEnvelopeMessages] -type settingZeroRttGetResponseEnvelopeMessagesJSON struct { +// settingZeroRttUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SettingZeroRttUpdateResponseEnvelopeMessages] +type settingZeroRttUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParams struct { - // Value of the 0-RTT setting. - Value param.Field[SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValue] `json:"value,required"` -} - -func (r SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Value of the 0-RTT setting. -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValue string - -const ( - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValueOn SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValue = "on" - SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValueOff SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValue = "off" -) - -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelope struct { - Errors []SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrors `json:"errors,required"` - Messages []SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessages `json:"messages,required"` +type SettingZeroRttGetResponseEnvelope struct { + Errors []SettingZeroRttGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SettingZeroRttGetResponseEnvelopeMessages `json:"messages,required"` // Whether the API call was successful Success bool `json:"success,required"` // 0-RTT session resumption enabled for this zone. - Result SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponse `json:"result"` - JSON settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeJSON `json:"-"` + Result SettingZeroRttGetResponse `json:"result"` + JSON settingZeroRttGetResponseEnvelopeJSON `json:"-"` } -// settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelope] -type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeJSON struct { +// settingZeroRttGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [SettingZeroRttGetResponseEnvelope] +type settingZeroRttGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Success apijson.Field @@ -267,46 +265,44 @@ type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelop ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrorsJSON `json:"-"` +type SettingZeroRttGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingZeroRttGetResponseEnvelopeErrorsJSON `json:"-"` } -// settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrors] -type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrorsJSON struct { +// settingZeroRttGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SettingZeroRttGetResponseEnvelopeErrors] +type settingZeroRttGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessagesJSON `json:"-"` +type SettingZeroRttGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON settingZeroRttGetResponseEnvelopeMessagesJSON `json:"-"` } -// settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessages] -type settingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessagesJSON struct { +// settingZeroRttGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SettingZeroRttGetResponseEnvelopeMessages] +type settingZeroRttGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SettingZeroRttGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/settingzerortt_test.go b/settingzerortt_test.go index c345dbc45e1..f1606ff7a15 100644 --- a/settingzerortt_test.go +++ b/settingzerortt_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSettingZeroRttGet(t *testing.T) { +func TestSettingZeroRttUpdate(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,13 @@ func TestSettingZeroRttGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Settings.ZeroRtt.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Settings.ZeroRtt.Update( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.SettingZeroRttUpdateParams{ + Value: cloudflare.F(cloudflare.SettingZeroRttUpdateParamsValueOn), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +45,7 @@ func TestSettingZeroRttGet(t *testing.T) { } } -func TestSettingZeroRttZoneSettingsChange0RttSessionResumptionSetting(t *testing.T) { +func TestSettingZeroRttGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,13 +61,7 @@ func TestSettingZeroRttZoneSettingsChange0RttSessionResumptionSetting(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Settings.ZeroRtt.ZoneSettingsChange0RttSessionResumptionSetting( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParams{ - Value: cloudflare.F(cloudflare.SettingZeroRttZoneSettingsChange0RttSessionResumptionSettingParamsValueOn), - }, - ) + _, err := client.Settings.ZeroRtt.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/snippet.go b/snippet.go index 3f4f28435d2..34f395ee343 100644 --- a/snippet.go +++ b/snippet.go @@ -37,19 +37,6 @@ func NewSnippetService(opts ...option.RequestOption) (r *SnippetService) { return } -// Put Snippet -func (r *SnippetService) Update(ctx context.Context, zoneIdentifier string, snippetName string, body SnippetUpdateParams, opts ...option.RequestOption) (res *SnippetUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env SnippetUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/snippets/%s", zoneIdentifier, snippetName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // All Snippets func (r *SnippetService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]SnippetListResponse, err error) { opts = append(r.Options[:], opts...) @@ -89,29 +76,17 @@ func (r *SnippetService) Get(ctx context.Context, zoneIdentifier string, snippet return } -// Snippet Information -type SnippetUpdateResponse struct { - // Creation time of the snippet - CreatedOn string `json:"created_on"` - // Modification time of the snippet - ModifiedOn string `json:"modified_on"` - // Snippet identifying name - SnippetName string `json:"snippet_name"` - JSON snippetUpdateResponseJSON `json:"-"` -} - -// snippetUpdateResponseJSON contains the JSON metadata for the struct -// [SnippetUpdateResponse] -type snippetUpdateResponseJSON struct { - CreatedOn apijson.Field - ModifiedOn apijson.Field - SnippetName apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SnippetUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// Put Snippet +func (r *SnippetService) Replace(ctx context.Context, zoneIdentifier string, snippetName string, body SnippetReplaceParams, opts ...option.RequestOption) (res *SnippetReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env SnippetReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/snippets/%s", zoneIdentifier, snippetName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } // Snippet Information @@ -185,95 +160,31 @@ func (r *SnippetGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetUpdateParams struct { - // Content files of uploaded snippet - Files param.Field[string] `json:"files"` - Metadata param.Field[SnippetUpdateParamsMetadata] `json:"metadata"` -} - -func (r SnippetUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SnippetUpdateParamsMetadata struct { - // Main module name of uploaded snippet - MainModule param.Field[string] `json:"main_module"` -} - -func (r SnippetUpdateParamsMetadata) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SnippetUpdateResponseEnvelope struct { - Errors []SnippetUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SnippetUpdateResponseEnvelopeMessages `json:"messages,required"` - // Snippet Information - Result SnippetUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success SnippetUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON snippetUpdateResponseEnvelopeJSON `json:"-"` -} - -// snippetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [SnippetUpdateResponseEnvelope] -type snippetUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SnippetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SnippetUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// snippetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [SnippetUpdateResponseEnvelopeErrors] -type snippetUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SnippetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SnippetUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetUpdateResponseEnvelopeMessagesJSON `json:"-"` +// Snippet Information +type SnippetReplaceResponse struct { + // Creation time of the snippet + CreatedOn string `json:"created_on"` + // Modification time of the snippet + ModifiedOn string `json:"modified_on"` + // Snippet identifying name + SnippetName string `json:"snippet_name"` + JSON snippetReplaceResponseJSON `json:"-"` } -// snippetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [SnippetUpdateResponseEnvelopeMessages] -type snippetUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field +// snippetReplaceResponseJSON contains the JSON metadata for the struct +// [SnippetReplaceResponse] +type snippetReplaceResponseJSON struct { + CreatedOn apijson.Field + ModifiedOn apijson.Field + SnippetName apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SnippetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type SnippetUpdateResponseEnvelopeSuccess bool - -const ( - SnippetUpdateResponseEnvelopeSuccessTrue SnippetUpdateResponseEnvelopeSuccess = true -) - type SnippetListResponseEnvelope struct { Errors []SnippetListResponseEnvelopeErrors `json:"errors,required"` Messages []SnippetListResponseEnvelopeMessages `json:"messages,required"` @@ -482,3 +393,92 @@ type SnippetGetResponseEnvelopeSuccess bool const ( SnippetGetResponseEnvelopeSuccessTrue SnippetGetResponseEnvelopeSuccess = true ) + +type SnippetReplaceParams struct { + // Content files of uploaded snippet + Files param.Field[string] `json:"files"` + Metadata param.Field[SnippetReplaceParamsMetadata] `json:"metadata"` +} + +func (r SnippetReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SnippetReplaceParamsMetadata struct { + // Main module name of uploaded snippet + MainModule param.Field[string] `json:"main_module"` +} + +func (r SnippetReplaceParamsMetadata) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SnippetReplaceResponseEnvelope struct { + Errors []SnippetReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SnippetReplaceResponseEnvelopeMessages `json:"messages,required"` + // Snippet Information + Result SnippetReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success SnippetReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON snippetReplaceResponseEnvelopeJSON `json:"-"` +} + +// snippetReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [SnippetReplaceResponseEnvelope] +type snippetReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SnippetReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SnippetReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// snippetReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SnippetReplaceResponseEnvelopeErrors] +type snippetReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SnippetReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SnippetReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// snippetReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SnippetReplaceResponseEnvelopeMessages] +type snippetReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SnippetReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type SnippetReplaceResponseEnvelopeSuccess bool + +const ( + SnippetReplaceResponseEnvelopeSuccessTrue SnippetReplaceResponseEnvelopeSuccess = true +) diff --git a/snippet_test.go b/snippet_test.go index ccd1b371fe0..2e2a7f88fda 100644 --- a/snippet_test.go +++ b/snippet_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSnippetUpdateWithOptionalParams(t *testing.T) { +func TestSnippetList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,17 +29,7 @@ func TestSnippetUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "snippet_name_01", - cloudflare.SnippetUpdateParams{ - Files: cloudflare.F("export { async function fetch(request, env) {return new Response('some_response') } }"), - Metadata: cloudflare.F(cloudflare.SnippetUpdateParamsMetadata{ - MainModule: cloudflare.F("main.js"), - }), - }, - ) + _, err := client.Snippets.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -49,7 +39,7 @@ func TestSnippetUpdateWithOptionalParams(t *testing.T) { } } -func TestSnippetList(t *testing.T) { +func TestSnippetDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -65,7 +55,11 @@ func TestSnippetList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Snippets.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "snippet_name_01", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -75,7 +69,7 @@ func TestSnippetList(t *testing.T) { } } -func TestSnippetDelete(t *testing.T) { +func TestSnippetGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -91,7 +85,7 @@ func TestSnippetDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.Delete( + _, err := client.Snippets.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "snippet_name_01", @@ -105,7 +99,7 @@ func TestSnippetDelete(t *testing.T) { } } -func TestSnippetGet(t *testing.T) { +func TestSnippetReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -121,10 +115,16 @@ func TestSnippetGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.Get( + _, err := client.Snippets.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "snippet_name_01", + cloudflare.SnippetReplaceParams{ + Files: cloudflare.F("export { async function fetch(request, env) {return new Response('some_response') } }"), + Metadata: cloudflare.F(cloudflare.SnippetReplaceParamsMetadata{ + MainModule: cloudflare.F("main.js"), + }), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/snippetsnippetrule.go b/snippetsnippetrule.go index fbad77cbbeb..34b986fd9c3 100644 --- a/snippetsnippetrule.go +++ b/snippetsnippetrule.go @@ -31,12 +31,12 @@ func NewSnippetSnippetRuleService(opts ...option.RequestOption) (r *SnippetSnipp return } -// Put Rules -func (r *SnippetSnippetRuleService) Update(ctx context.Context, zoneIdentifier string, body SnippetSnippetRuleUpdateParams, opts ...option.RequestOption) (res *[]SnippetSnippetRuleUpdateResponse, err error) { +// Rules +func (r *SnippetSnippetRuleService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]SnippetSnippetRuleListResponse, err error) { opts = append(r.Options[:], opts...) - var env SnippetSnippetRuleUpdateResponseEnvelope + var env SnippetSnippetRuleListResponseEnvelope path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *SnippetSnippetRuleService) Update(ctx context.Context, zoneIdentifier s return } -// Rules -func (r *SnippetSnippetRuleService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]SnippetSnippetRuleListResponse, err error) { +// Put Rules +func (r *SnippetSnippetRuleService) Replace(ctx context.Context, zoneIdentifier string, body SnippetSnippetRuleReplaceParams, opts ...option.RequestOption) (res *[]SnippetSnippetRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SnippetSnippetRuleListResponseEnvelope + var env SnippetSnippetRuleReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -57,18 +57,18 @@ func (r *SnippetSnippetRuleService) List(ctx context.Context, zoneIdentifier str return } -type SnippetSnippetRuleUpdateResponse struct { +type SnippetSnippetRuleListResponse struct { Description string `json:"description"` Enabled bool `json:"enabled"` Expression string `json:"expression"` // Snippet identifying name - SnippetName string `json:"snippet_name"` - JSON snippetSnippetRuleUpdateResponseJSON `json:"-"` + SnippetName string `json:"snippet_name"` + JSON snippetSnippetRuleListResponseJSON `json:"-"` } -// snippetSnippetRuleUpdateResponseJSON contains the JSON metadata for the struct -// [SnippetSnippetRuleUpdateResponse] -type snippetSnippetRuleUpdateResponseJSON struct { +// snippetSnippetRuleListResponseJSON contains the JSON metadata for the struct +// [SnippetSnippetRuleListResponse] +type snippetSnippetRuleListResponseJSON struct { Description apijson.Field Enabled apijson.Field Expression apijson.Field @@ -77,22 +77,22 @@ type snippetSnippetRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleListResponse struct { +type SnippetSnippetRuleReplaceResponse struct { Description string `json:"description"` Enabled bool `json:"enabled"` Expression string `json:"expression"` // Snippet identifying name - SnippetName string `json:"snippet_name"` - JSON snippetSnippetRuleListResponseJSON `json:"-"` + SnippetName string `json:"snippet_name"` + JSON snippetSnippetRuleReplaceResponseJSON `json:"-"` } -// snippetSnippetRuleListResponseJSON contains the JSON metadata for the struct -// [SnippetSnippetRuleListResponse] -type snippetSnippetRuleListResponseJSON struct { +// snippetSnippetRuleReplaceResponseJSON contains the JSON metadata for the struct +// [SnippetSnippetRuleReplaceResponse] +type snippetSnippetRuleReplaceResponseJSON struct { Description apijson.Field Enabled apijson.Field Expression apijson.Field @@ -101,44 +101,23 @@ type snippetSnippetRuleListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleUpdateParams struct { - // List of snippet rules - Rules param.Field[[]SnippetSnippetRuleUpdateParamsRule] `json:"rules"` -} - -func (r SnippetSnippetRuleUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SnippetSnippetRuleUpdateParamsRule struct { - Description param.Field[string] `json:"description"` - Enabled param.Field[bool] `json:"enabled"` - Expression param.Field[string] `json:"expression"` - // Snippet identifying name - SnippetName param.Field[string] `json:"snippet_name"` -} - -func (r SnippetSnippetRuleUpdateParamsRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SnippetSnippetRuleUpdateResponseEnvelope struct { - Errors []SnippetSnippetRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SnippetSnippetRuleUpdateResponseEnvelopeMessages `json:"messages,required"` +type SnippetSnippetRuleListResponseEnvelope struct { + Errors []SnippetSnippetRuleListResponseEnvelopeErrors `json:"errors,required"` + Messages []SnippetSnippetRuleListResponseEnvelopeMessages `json:"messages,required"` // List of snippet rules - Result []SnippetSnippetRuleUpdateResponse `json:"result,required"` + Result []SnippetSnippetRuleListResponse `json:"result,required"` // Whether the API call was successful - Success SnippetSnippetRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON snippetSnippetRuleUpdateResponseEnvelopeJSON `json:"-"` + Success SnippetSnippetRuleListResponseEnvelopeSuccess `json:"success,required"` + JSON snippetSnippetRuleListResponseEnvelopeJSON `json:"-"` } -// snippetSnippetRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [SnippetSnippetRuleUpdateResponseEnvelope] -type snippetSnippetRuleUpdateResponseEnvelopeJSON struct { +// snippetSnippetRuleListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SnippetSnippetRuleListResponseEnvelope] +type snippetSnippetRuleListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -147,68 +126,89 @@ type snippetSnippetRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetSnippetRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SnippetSnippetRuleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetSnippetRuleListResponseEnvelopeErrorsJSON `json:"-"` } -// snippetSnippetRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [SnippetSnippetRuleUpdateResponseEnvelopeErrors] -type snippetSnippetRuleUpdateResponseEnvelopeErrorsJSON struct { +// snippetSnippetRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SnippetSnippetRuleListResponseEnvelopeErrors] +type snippetSnippetRuleListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetSnippetRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SnippetSnippetRuleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetSnippetRuleListResponseEnvelopeMessagesJSON `json:"-"` } -// snippetSnippetRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [SnippetSnippetRuleUpdateResponseEnvelopeMessages] -type snippetSnippetRuleUpdateResponseEnvelopeMessagesJSON struct { +// snippetSnippetRuleListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SnippetSnippetRuleListResponseEnvelopeMessages] +type snippetSnippetRuleListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SnippetSnippetRuleUpdateResponseEnvelopeSuccess bool +type SnippetSnippetRuleListResponseEnvelopeSuccess bool const ( - SnippetSnippetRuleUpdateResponseEnvelopeSuccessTrue SnippetSnippetRuleUpdateResponseEnvelopeSuccess = true + SnippetSnippetRuleListResponseEnvelopeSuccessTrue SnippetSnippetRuleListResponseEnvelopeSuccess = true ) -type SnippetSnippetRuleListResponseEnvelope struct { - Errors []SnippetSnippetRuleListResponseEnvelopeErrors `json:"errors,required"` - Messages []SnippetSnippetRuleListResponseEnvelopeMessages `json:"messages,required"` +type SnippetSnippetRuleReplaceParams struct { // List of snippet rules - Result []SnippetSnippetRuleListResponse `json:"result,required"` + Rules param.Field[[]SnippetSnippetRuleReplaceParamsRule] `json:"rules"` +} + +func (r SnippetSnippetRuleReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SnippetSnippetRuleReplaceParamsRule struct { + Description param.Field[string] `json:"description"` + Enabled param.Field[bool] `json:"enabled"` + Expression param.Field[string] `json:"expression"` + // Snippet identifying name + SnippetName param.Field[string] `json:"snippet_name"` +} + +func (r SnippetSnippetRuleReplaceParamsRule) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type SnippetSnippetRuleReplaceResponseEnvelope struct { + Errors []SnippetSnippetRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SnippetSnippetRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + // List of snippet rules + Result []SnippetSnippetRuleReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SnippetSnippetRuleListResponseEnvelopeSuccess `json:"success,required"` - JSON snippetSnippetRuleListResponseEnvelopeJSON `json:"-"` + Success SnippetSnippetRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON snippetSnippetRuleReplaceResponseEnvelopeJSON `json:"-"` } -// snippetSnippetRuleListResponseEnvelopeJSON contains the JSON metadata for the -// struct [SnippetSnippetRuleListResponseEnvelope] -type snippetSnippetRuleListResponseEnvelopeJSON struct { +// snippetSnippetRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [SnippetSnippetRuleReplaceResponseEnvelope] +type snippetSnippetRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -217,51 +217,51 @@ type snippetSnippetRuleListResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetSnippetRuleListResponseEnvelopeErrorsJSON `json:"-"` +type SnippetSnippetRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetSnippetRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// snippetSnippetRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [SnippetSnippetRuleListResponseEnvelopeErrors] -type snippetSnippetRuleListResponseEnvelopeErrorsJSON struct { +// snippetSnippetRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SnippetSnippetRuleReplaceResponseEnvelopeErrors] +type snippetSnippetRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SnippetSnippetRuleListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON snippetSnippetRuleListResponseEnvelopeMessagesJSON `json:"-"` +type SnippetSnippetRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON snippetSnippetRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// snippetSnippetRuleListResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [SnippetSnippetRuleListResponseEnvelopeMessages] -type snippetSnippetRuleListResponseEnvelopeMessagesJSON struct { +// snippetSnippetRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SnippetSnippetRuleReplaceResponseEnvelopeMessages] +type snippetSnippetRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SnippetSnippetRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SnippetSnippetRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SnippetSnippetRuleListResponseEnvelopeSuccess bool +type SnippetSnippetRuleReplaceResponseEnvelopeSuccess bool const ( - SnippetSnippetRuleListResponseEnvelopeSuccessTrue SnippetSnippetRuleListResponseEnvelopeSuccess = true + SnippetSnippetRuleReplaceResponseEnvelopeSuccessTrue SnippetSnippetRuleReplaceResponseEnvelopeSuccess = true ) diff --git a/snippetsnippetrule_test.go b/snippetsnippetrule_test.go index c4642247586..d3bab3723c1 100644 --- a/snippetsnippetrule_test.go +++ b/snippetsnippetrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSnippetSnippetRuleUpdateWithOptionalParams(t *testing.T) { +func TestSnippetSnippetRuleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,28 +29,7 @@ func TestSnippetSnippetRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.SnippetRules.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SnippetSnippetRuleUpdateParams{ - Rules: cloudflare.F([]cloudflare.SnippetSnippetRuleUpdateParamsRule{{ - Description: cloudflare.F("Rule description"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("http.cookie eq \"a=b\""), - SnippetName: cloudflare.F("snippet_name_01"), - }, { - Description: cloudflare.F("Rule description"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("http.cookie eq \"a=b\""), - SnippetName: cloudflare.F("snippet_name_01"), - }, { - Description: cloudflare.F("Rule description"), - Enabled: cloudflare.F(true), - Expression: cloudflare.F("http.cookie eq \"a=b\""), - SnippetName: cloudflare.F("snippet_name_01"), - }}), - }, - ) + _, err := client.Snippets.SnippetRules.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -60,7 +39,7 @@ func TestSnippetSnippetRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestSnippetSnippetRuleList(t *testing.T) { +func TestSnippetSnippetRuleReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -76,7 +55,28 @@ func TestSnippetSnippetRuleList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Snippets.SnippetRules.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Snippets.SnippetRules.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.SnippetSnippetRuleReplaceParams{ + Rules: cloudflare.F([]cloudflare.SnippetSnippetRuleReplaceParamsRule{{ + Description: cloudflare.F("Rule description"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("http.cookie eq \"a=b\""), + SnippetName: cloudflare.F("snippet_name_01"), + }, { + Description: cloudflare.F("Rule description"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("http.cookie eq \"a=b\""), + SnippetName: cloudflare.F("snippet_name_01"), + }, { + Description: cloudflare.F("Rule description"), + Enabled: cloudflare.F(true), + Expression: cloudflare.F("http.cookie eq \"a=b\""), + SnippetName: cloudflare.F("snippet_name_01"), + }}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/spectrumanalyticsaggregatecurrent.go b/spectrumanalyticsaggregatecurrent.go index 4f387f0fccb..cd6b4e0b36e 100644 --- a/spectrumanalyticsaggregatecurrent.go +++ b/spectrumanalyticsaggregatecurrent.go @@ -35,9 +35,9 @@ func NewSpectrumAnalyticsAggregateCurrentService(opts ...option.RequestOption) ( // Retrieves analytics aggregated from the last minute of usage on Spectrum // applications underneath a given zone. -func (r *SpectrumAnalyticsAggregateCurrentService) SpectrumAggregateAnalyticsGetCurrentAggregatedAnalytics(ctx context.Context, zone string, query SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams, opts ...option.RequestOption) (res *[]SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponse, err error) { +func (r *SpectrumAnalyticsAggregateCurrentService) Get(ctx context.Context, zone string, query SpectrumAnalyticsAggregateCurrentGetParams, opts ...option.RequestOption) (res *[]SpectrumAnalyticsAggregateCurrentGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelope + var env SpectrumAnalyticsAggregateCurrentGetResponseEnvelope path := fmt.Sprintf("zones/%s/spectrum/analytics/aggregate/current", zone) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -47,9 +47,9 @@ func (r *SpectrumAnalyticsAggregateCurrentService) SpectrumAggregateAnalyticsGet return } -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponse = interface{} +type SpectrumAnalyticsAggregateCurrentGetResponse = interface{} -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams struct { +type SpectrumAnalyticsAggregateCurrentGetParams struct { // Comma-delimited list of Spectrum Application Id(s). If provided, the response // will be limited to Spectrum Application Id(s) that match. AppIDParam param.Field[string] `query:"app_id_param"` @@ -60,29 +60,27 @@ type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggreg ColoName param.Field[string] `query:"colo_name"` } -// URLQuery serializes -// [SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams]'s -// query parameters as `url.Values`. -func (r SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams) URLQuery() (v url.Values) { +// URLQuery serializes [SpectrumAnalyticsAggregateCurrentGetParams]'s query +// parameters as `url.Values`. +func (r SpectrumAnalyticsAggregateCurrentGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelope struct { - Errors []SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessages `json:"messages,required"` - Result []SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponse `json:"result,required"` +type SpectrumAnalyticsAggregateCurrentGetResponseEnvelope struct { + Errors []SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages `json:"messages,required"` + Result []SpectrumAnalyticsAggregateCurrentGetResponse `json:"result,required"` // Whether the API call was successful - Success SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeSuccess `json:"success,required"` - JSON spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeJSON `json:"-"` + Success SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess `json:"success,required"` + JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON `json:"-"` } -// spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelope] -type spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeJSON struct { +// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON contains the JSON +// metadata for the struct [SpectrumAnalyticsAggregateCurrentGetResponseEnvelope] +type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -91,53 +89,53 @@ type spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggreg ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrorsJSON `json:"-"` +type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON `json:"-"` } -// spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrors] -type spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrorsJSON struct { +// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors] +type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessagesJSON `json:"-"` +type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON `json:"-"` } -// spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessages] -type spectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessagesJSON struct { +// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON contains the +// JSON metadata for the struct +// [SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages] +type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeSuccess bool +type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess bool const ( - SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeSuccessTrue SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsResponseEnvelopeSuccess = true + SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccessTrue SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess = true ) diff --git a/spectrumanalyticsaggregatecurrent_test.go b/spectrumanalyticsaggregatecurrent_test.go index 2c6fda928ab..f87be5e7df2 100644 --- a/spectrumanalyticsaggregatecurrent_test.go +++ b/spectrumanalyticsaggregatecurrent_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsWithOptionalParams(t *testing.T) { +func TestSpectrumAnalyticsAggregateCurrentGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestSpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAg option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Analytics.Aggregates.Currents.SpectrumAggregateAnalyticsGetCurrentAggregatedAnalytics( + _, err := client.Spectrum.Analytics.Aggregates.Currents.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SpectrumAnalyticsAggregateCurrentSpectrumAggregateAnalyticsGetCurrentAggregatedAnalyticsParams{ + cloudflare.SpectrumAnalyticsAggregateCurrentGetParams{ AppIDParam: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"), AppID: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"), ColoName: cloudflare.F("PDX"), diff --git a/spectrumanalyticseventbytime.go b/spectrumanalyticseventbytime.go index 9890059595d..1065c259e08 100644 --- a/spectrumanalyticseventbytime.go +++ b/spectrumanalyticseventbytime.go @@ -38,9 +38,9 @@ func NewSpectrumAnalyticsEventBytimeService(opts ...option.RequestOption) (r *Sp } // Retrieves a list of aggregate metrics grouped by time interval. -func (r *SpectrumAnalyticsEventBytimeService) SpectrumAnalyticsByTimeGetAnalyticsByTime(ctx context.Context, zone string, query SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse, err error) { +func (r *SpectrumAnalyticsEventBytimeService) Get(ctx context.Context, zone string, query SpectrumAnalyticsEventBytimeGetParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventBytimeGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelope + var env SpectrumAnalyticsEventBytimeGetResponseEnvelope path := fmt.Sprintf("zones/%s/spectrum/analytics/events/bytime", zone) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -50,16 +50,15 @@ func (r *SpectrumAnalyticsEventBytimeService) SpectrumAnalyticsByTimeGetAnalytic return } -// Union satisfied by -// [SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseUnknown] -// or [shared.UnionString]. -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse interface { - ImplementsSpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse() +// Union satisfied by [SpectrumAnalyticsEventBytimeGetResponseUnknown] or +// [shared.UnionString]. +type SpectrumAnalyticsEventBytimeGetResponse interface { + ImplementsSpectrumAnalyticsEventBytimeGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse)(nil)).Elem(), + reflect.TypeOf((*SpectrumAnalyticsEventBytimeGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -68,7 +67,7 @@ func init() { ) } -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams struct { +type SpectrumAnalyticsEventBytimeGetParams struct { // Can be used to break down the data by given attributes. Options are: // // | Dimension | Name | Example | @@ -77,7 +76,7 @@ type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 | // | coloName | Colo Name | SFO | // | ipVersion | IP version used by the client | 4, 6. | - Dimensions param.Field[[]SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension] `query:"dimensions"` + Dimensions param.Field[[]SpectrumAnalyticsEventBytimeGetParamsDimension] `query:"dimensions"` // Used to filter rows by one or more dimensions. Filters can be combined using OR // and AND boolean logic. AND takes precedence over OR in all the expressions. The // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. @@ -105,7 +104,7 @@ type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams // | durationMedian | Median connection duration | 1.0 | Time in milliseconds | // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - Metrics param.Field[[]SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric] `query:"metrics"` + Metrics param.Field[[]SpectrumAnalyticsEventBytimeGetParamsMetric] `query:"metrics"` // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must // be in RFC3339 format and uses UTC unless otherwise specified. Since param.Field[time.Time] `query:"since" format:"date-time"` @@ -113,70 +112,68 @@ type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams // `dimensions`. Sort param.Field[[]interface{}] `query:"sort"` // Used to select time series resolution. - TimeDelta param.Field[SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta] `query:"time_delta"` + TimeDelta param.Field[SpectrumAnalyticsEventBytimeGetParamsTimeDelta] `query:"time_delta"` // End of time interval to query, defaults to current time. Timestamp must be in // RFC3339 format and uses UTC unless otherwise specified. Until param.Field[time.Time] `query:"until" format:"date-time"` } -// URLQuery serializes -// [SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams]'s -// query parameters as `url.Values`. -func (r SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams) URLQuery() (v url.Values) { +// URLQuery serializes [SpectrumAnalyticsEventBytimeGetParams]'s query parameters +// as `url.Values`. +func (r SpectrumAnalyticsEventBytimeGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension string +type SpectrumAnalyticsEventBytimeGetParamsDimension string const ( - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionEvent SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension = "event" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionAppID SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension = "appID" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionColoName SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension = "coloName" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionIPVersion SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension = "ipVersion" + SpectrumAnalyticsEventBytimeGetParamsDimensionEvent SpectrumAnalyticsEventBytimeGetParamsDimension = "event" + SpectrumAnalyticsEventBytimeGetParamsDimensionAppID SpectrumAnalyticsEventBytimeGetParamsDimension = "appID" + SpectrumAnalyticsEventBytimeGetParamsDimensionColoName SpectrumAnalyticsEventBytimeGetParamsDimension = "coloName" + SpectrumAnalyticsEventBytimeGetParamsDimensionIPVersion SpectrumAnalyticsEventBytimeGetParamsDimension = "ipVersion" ) -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric string +type SpectrumAnalyticsEventBytimeGetParamsMetric string const ( - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricCount SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "count" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricBytesIngress SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "bytesIngress" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricBytesEgress SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "bytesEgress" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricDurationAvg SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "durationAvg" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricDurationMedian SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "durationMedian" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricDuration90th SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "duration90th" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricDuration99th SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric = "duration99th" + SpectrumAnalyticsEventBytimeGetParamsMetricCount SpectrumAnalyticsEventBytimeGetParamsMetric = "count" + SpectrumAnalyticsEventBytimeGetParamsMetricBytesIngress SpectrumAnalyticsEventBytimeGetParamsMetric = "bytesIngress" + SpectrumAnalyticsEventBytimeGetParamsMetricBytesEgress SpectrumAnalyticsEventBytimeGetParamsMetric = "bytesEgress" + SpectrumAnalyticsEventBytimeGetParamsMetricDurationAvg SpectrumAnalyticsEventBytimeGetParamsMetric = "durationAvg" + SpectrumAnalyticsEventBytimeGetParamsMetricDurationMedian SpectrumAnalyticsEventBytimeGetParamsMetric = "durationMedian" + SpectrumAnalyticsEventBytimeGetParamsMetricDuration90th SpectrumAnalyticsEventBytimeGetParamsMetric = "duration90th" + SpectrumAnalyticsEventBytimeGetParamsMetricDuration99th SpectrumAnalyticsEventBytimeGetParamsMetric = "duration99th" ) // Used to select time series resolution. -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta string +type SpectrumAnalyticsEventBytimeGetParamsTimeDelta string const ( - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaYear SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "year" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaQuarter SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "quarter" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaMonth SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "month" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaWeek SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "week" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaDay SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "day" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaHour SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "hour" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaDekaminute SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "dekaminute" - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaMinute SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDelta = "minute" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaYear SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "year" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaQuarter SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "quarter" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMonth SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "month" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaWeek SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "week" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaDay SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "day" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaHour SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "hour" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaDekaminute SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "dekaminute" + SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMinute SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "minute" ) -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelope struct { - Errors []SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessages `json:"messages,required"` - Result SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponse `json:"result,required,nullable"` +type SpectrumAnalyticsEventBytimeGetResponseEnvelope struct { + Errors []SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages `json:"messages,required"` + Result SpectrumAnalyticsEventBytimeGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeSuccess `json:"success,required"` - JSON spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeJSON `json:"-"` + Success SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess `json:"success,required"` + JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON `json:"-"` } -// spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelope] -type spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeJSON struct { +// spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [SpectrumAnalyticsEventBytimeGetResponseEnvelope] +type spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -185,53 +182,52 @@ type spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeRespon ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrorsJSON `json:"-"` +type SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON `json:"-"` } -// spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrors] -type spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrorsJSON struct { +// spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors] +type spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessagesJSON `json:"-"` +type SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON `json:"-"` } -// spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessages] -type spectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessagesJSON struct { +// spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages] +type spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeSuccess bool +type SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess bool const ( - SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeSuccessTrue SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeResponseEnvelopeSuccess = true + SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccessTrue SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess = true ) diff --git a/spectrumanalyticseventbytime_test.go b/spectrumanalyticseventbytime_test.go index 9faaf59bc94..52fce71bf00 100644 --- a/spectrumanalyticseventbytime_test.go +++ b/spectrumanalyticseventbytime_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeWithOptionalParams(t *testing.T) { +func TestSpectrumAnalyticsEventBytimeGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,16 +30,16 @@ func TestSpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeWi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Analytics.Events.Bytimes.SpectrumAnalyticsByTimeGetAnalyticsByTime( + _, err := client.Spectrum.Analytics.Events.Bytimes.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParams{ - Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimension{cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsDimensionAppID}), + cloudflare.SpectrumAnalyticsEventBytimeGetParams{ + Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimension{cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimensionAppID}), Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"), - Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetric{cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricCount, cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsMetricBytesIngress}), + Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetric{cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetricCount, cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetricBytesIngress}), Since: cloudflare.F(time.Now()), Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}), - TimeDelta: cloudflare.F(cloudflare.SpectrumAnalyticsEventBytimeSpectrumAnalyticsByTimeGetAnalyticsByTimeParamsTimeDeltaMinute), + TimeDelta: cloudflare.F(cloudflare.SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMinute), Until: cloudflare.F(time.Now()), }, ) diff --git a/spectrumanalyticseventsummary.go b/spectrumanalyticseventsummary.go index 195e5b4dcc2..fff26667757 100644 --- a/spectrumanalyticseventsummary.go +++ b/spectrumanalyticseventsummary.go @@ -38,9 +38,9 @@ func NewSpectrumAnalyticsEventSummaryService(opts ...option.RequestOption) (r *S } // Retrieves a list of summarised aggregate metrics over a given time period. -func (r *SpectrumAnalyticsEventSummaryService) SpectrumAnalyticsSummaryGetAnalyticsSummary(ctx context.Context, zone string, query SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse, err error) { +func (r *SpectrumAnalyticsEventSummaryService) Get(ctx context.Context, zone string, query SpectrumAnalyticsEventSummaryGetParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventSummaryGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelope + var env SpectrumAnalyticsEventSummaryGetResponseEnvelope path := fmt.Sprintf("zones/%s/spectrum/analytics/events/summary", zone) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -50,16 +50,15 @@ func (r *SpectrumAnalyticsEventSummaryService) SpectrumAnalyticsSummaryGetAnalyt return } -// Union satisfied by -// [SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseUnknown] -// or [shared.UnionString]. -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse interface { - ImplementsSpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse() +// Union satisfied by [SpectrumAnalyticsEventSummaryGetResponseUnknown] or +// [shared.UnionString]. +type SpectrumAnalyticsEventSummaryGetResponse interface { + ImplementsSpectrumAnalyticsEventSummaryGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse)(nil)).Elem(), + reflect.TypeOf((*SpectrumAnalyticsEventSummaryGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -68,7 +67,7 @@ func init() { ) } -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams struct { +type SpectrumAnalyticsEventSummaryGetParams struct { // Can be used to break down the data by given attributes. Options are: // // | Dimension | Name | Example | @@ -77,7 +76,7 @@ type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryPar // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 | // | coloName | Colo Name | SFO | // | ipVersion | IP version used by the client | 4, 6. | - Dimensions param.Field[[]SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension] `query:"dimensions"` + Dimensions param.Field[[]SpectrumAnalyticsEventSummaryGetParamsDimension] `query:"dimensions"` // Used to filter rows by one or more dimensions. Filters can be combined using OR // and AND boolean logic. AND takes precedence over OR in all the expressions. The // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. @@ -105,7 +104,7 @@ type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryPar // | durationMedian | Median connection duration | 1.0 | Time in milliseconds | // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - Metrics param.Field[[]SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric] `query:"metrics"` + Metrics param.Field[[]SpectrumAnalyticsEventSummaryGetParamsMetric] `query:"metrics"` // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must // be in RFC3339 format and uses UTC unless otherwise specified. Since param.Field[time.Time] `query:"since" format:"date-time"` @@ -117,50 +116,48 @@ type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryPar Until param.Field[time.Time] `query:"until" format:"date-time"` } -// URLQuery serializes -// [SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams]'s -// query parameters as `url.Values`. -func (r SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams) URLQuery() (v url.Values) { +// URLQuery serializes [SpectrumAnalyticsEventSummaryGetParams]'s query parameters +// as `url.Values`. +func (r SpectrumAnalyticsEventSummaryGetParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension string +type SpectrumAnalyticsEventSummaryGetParamsDimension string const ( - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionEvent SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension = "event" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionAppID SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension = "appID" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionColoName SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension = "coloName" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionIPVersion SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension = "ipVersion" + SpectrumAnalyticsEventSummaryGetParamsDimensionEvent SpectrumAnalyticsEventSummaryGetParamsDimension = "event" + SpectrumAnalyticsEventSummaryGetParamsDimensionAppID SpectrumAnalyticsEventSummaryGetParamsDimension = "appID" + SpectrumAnalyticsEventSummaryGetParamsDimensionColoName SpectrumAnalyticsEventSummaryGetParamsDimension = "coloName" + SpectrumAnalyticsEventSummaryGetParamsDimensionIPVersion SpectrumAnalyticsEventSummaryGetParamsDimension = "ipVersion" ) -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric string +type SpectrumAnalyticsEventSummaryGetParamsMetric string const ( - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricCount SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "count" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricBytesIngress SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "bytesIngress" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricBytesEgress SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "bytesEgress" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricDurationAvg SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "durationAvg" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricDurationMedian SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "durationMedian" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricDuration90th SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "duration90th" - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricDuration99th SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric = "duration99th" + SpectrumAnalyticsEventSummaryGetParamsMetricCount SpectrumAnalyticsEventSummaryGetParamsMetric = "count" + SpectrumAnalyticsEventSummaryGetParamsMetricBytesIngress SpectrumAnalyticsEventSummaryGetParamsMetric = "bytesIngress" + SpectrumAnalyticsEventSummaryGetParamsMetricBytesEgress SpectrumAnalyticsEventSummaryGetParamsMetric = "bytesEgress" + SpectrumAnalyticsEventSummaryGetParamsMetricDurationAvg SpectrumAnalyticsEventSummaryGetParamsMetric = "durationAvg" + SpectrumAnalyticsEventSummaryGetParamsMetricDurationMedian SpectrumAnalyticsEventSummaryGetParamsMetric = "durationMedian" + SpectrumAnalyticsEventSummaryGetParamsMetricDuration90th SpectrumAnalyticsEventSummaryGetParamsMetric = "duration90th" + SpectrumAnalyticsEventSummaryGetParamsMetricDuration99th SpectrumAnalyticsEventSummaryGetParamsMetric = "duration99th" ) -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelope struct { - Errors []SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessages `json:"messages,required"` - Result SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponse `json:"result,required,nullable"` +type SpectrumAnalyticsEventSummaryGetResponseEnvelope struct { + Errors []SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages `json:"messages,required"` + Result SpectrumAnalyticsEventSummaryGetResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeSuccess `json:"success,required"` - JSON spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeJSON `json:"-"` + Success SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess `json:"success,required"` + JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON `json:"-"` } -// spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelope] -type spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeJSON struct { +// spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON contains the JSON metadata +// for the struct [SpectrumAnalyticsEventSummaryGetResponseEnvelope] +type spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -169,53 +166,52 @@ type spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryRes ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrorsJSON `json:"-"` +type SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON `json:"-"` } -// spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrors] -type spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrorsJSON struct { +// spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors] +type spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessagesJSON `json:"-"` +type SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON `json:"-"` } -// spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessages] -type spectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessagesJSON struct { +// spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages] +type spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeSuccess bool +type SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess bool const ( - SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeSuccessTrue SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryResponseEnvelopeSuccess = true + SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccessTrue SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess = true ) diff --git a/spectrumanalyticseventsummary_test.go b/spectrumanalyticseventsummary_test.go index af62618852c..a180660b394 100644 --- a/spectrumanalyticseventsummary_test.go +++ b/spectrumanalyticseventsummary_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryWithOptionalParams(t *testing.T) { +func TestSpectrumAnalyticsEventSummaryGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,13 +30,13 @@ func TestSpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummar option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Analytics.Events.Summaries.SpectrumAnalyticsSummaryGetAnalyticsSummary( + _, err := client.Spectrum.Analytics.Events.Summaries.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParams{ - Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimension{cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsDimensionAppID}), + cloudflare.SpectrumAnalyticsEventSummaryGetParams{ + Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimension{cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimensionAppID}), Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"), - Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetric{cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricCount, cloudflare.SpectrumAnalyticsEventSummarySpectrumAnalyticsSummaryGetAnalyticsSummaryParamsMetricBytesIngress}), + Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetric{cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetricCount, cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetricBytesIngress}), Since: cloudflare.F(time.Now()), Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}), Until: cloudflare.F(time.Now()), diff --git a/spectrumapp.go b/spectrumapp.go index c6be0172def..245f52fa12c 100644 --- a/spectrumapp.go +++ b/spectrumapp.go @@ -37,13 +37,13 @@ func NewSpectrumAppService(opts ...option.RequestOption) (r *SpectrumAppService) return } -// Updates a previously existing application's configuration that uses a name for -// the origin. -func (r *SpectrumAppService) Update(ctx context.Context, zone string, appID string, body SpectrumAppUpdateParams, opts ...option.RequestOption) (res *SpectrumAppUpdateResponse, err error) { +// Creates a new Spectrum application from a configuration using a name for the +// origin. +func (r *SpectrumAppService) New(ctx context.Context, zone string, body SpectrumAppNewParams, opts ...option.RequestOption) (res *SpectrumAppNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SpectrumAppUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env SpectrumAppNewResponseEnvelope + path := fmt.Sprintf("zones/%s/spectrum/apps", zone) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -51,6 +51,29 @@ func (r *SpectrumAppService) Update(ctx context.Context, zone string, appID stri return } +// Retrieves a list of currently existing Spectrum applications inside a zone. +func (r *SpectrumAppService) List(ctx context.Context, zone string, query SpectrumAppListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[SpectrumAppListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := fmt.Sprintf("zones/%s/spectrum/apps", zone) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Retrieves a list of currently existing Spectrum applications inside a zone. +func (r *SpectrumAppService) ListAutoPaging(ctx context.Context, zone string, query SpectrumAppListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[SpectrumAppListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zone, query, opts...)) +} + // Deletes a previously existing application. func (r *SpectrumAppService) Delete(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *SpectrumAppDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -77,26 +100,13 @@ func (r *SpectrumAppService) Get(ctx context.Context, zone string, appID string, return } -// Creates a new Spectrum application from a configuration using a name for the -// origin. -func (r *SpectrumAppService) SpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin(ctx context.Context, zone string, body SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParams, opts ...option.RequestOption) (res *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelope - path := fmt.Sprintf("zones/%s/spectrum/apps", zone) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Retrieves a list of currently existing Spectrum applications inside a zone. -func (r *SpectrumAppService) SpectrumApplicationsListSpectrumApplications(ctx context.Context, zone string, query SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams, opts ...option.RequestOption) (res *[]SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponse, err error) { +// Updates a previously existing application's configuration that uses a name for +// the origin. +func (r *SpectrumAppService) Replace(ctx context.Context, zone string, appID string, body SpectrumAppReplaceParams, opts ...option.RequestOption) (res *SpectrumAppReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelope - path := fmt.Sprintf("zones/%s/spectrum/apps", zone) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env SpectrumAppReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -104,7 +114,7 @@ func (r *SpectrumAppService) SpectrumApplicationsListSpectrumApplications(ctx co return } -type SpectrumAppUpdateResponse struct { +type SpectrumAppNewResponse struct { // Application identifier. ID string `json:"id"` // Enables Argo Smart Routing for this application. Notes: Only available for TCP @@ -113,22 +123,22 @@ type SpectrumAppUpdateResponse struct { // When the Application was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // The name and type of DNS record for the Spectrum application. - DNS SpectrumAppUpdateResponseDNS `json:"dns"` + DNS SpectrumAppNewResponseDNS `json:"dns"` // The anycast edge IP configuration for the hostname of this application. - EdgeIPs SpectrumAppUpdateResponseEdgeIPs `json:"edge_ips"` + EdgeIPs SpectrumAppNewResponseEdgeIPs `json:"edge_ips"` // Enables IP Access Rules for this application. Notes: Only available for TCP // applications. IPFirewall bool `json:"ip_firewall"` // When the Application was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The name and type of DNS record for the Spectrum application. - OriginDNS SpectrumAppUpdateResponseOriginDNS `json:"origin_dns"` + OriginDNS SpectrumAppNewResponseOriginDNS `json:"origin_dns"` // The destination port at the origin. Only specified in conjunction with // origin_dns. May use an integer to specify a single origin port, for example // `1000`, or a string to specify a range of origin ports, for example // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the // range must match the number of ports specified in the "protocol" field. - OriginPort SpectrumAppUpdateResponseOriginPort `json:"origin_port"` + OriginPort SpectrumAppNewResponseOriginPort `json:"origin_port"` // The port configuration at Cloudflare’s edge. May specify a single port, for // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. Protocol string `json:"protocol"` @@ -136,21 +146,21 @@ type SpectrumAppUpdateResponse struct { // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. - ProxyProtocol SpectrumAppUpdateResponseProxyProtocol `json:"proxy_protocol"` + ProxyProtocol SpectrumAppNewResponseProxyProtocol `json:"proxy_protocol"` // The type of TLS termination associated with the application. - TLS SpectrumAppUpdateResponseTLS `json:"tls"` + TLS SpectrumAppNewResponseTLS `json:"tls"` // Determines how data travels from the edge to your origin. When set to "direct", // Spectrum will send traffic directly to your origin, and the application's type // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. - TrafficType SpectrumAppUpdateResponseTrafficType `json:"traffic_type"` - JSON spectrumAppUpdateResponseJSON `json:"-"` + TrafficType SpectrumAppNewResponseTrafficType `json:"traffic_type"` + JSON spectrumAppNewResponseJSON `json:"-"` } -// spectrumAppUpdateResponseJSON contains the JSON metadata for the struct -// [SpectrumAppUpdateResponse] -type spectrumAppUpdateResponseJSON struct { +// spectrumAppNewResponseJSON contains the JSON metadata for the struct +// [SpectrumAppNewResponse] +type spectrumAppNewResponseJSON struct { ID apijson.Field ArgoSmartRouting apijson.Field CreatedOn apijson.Field @@ -168,110 +178,110 @@ type spectrumAppUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The name and type of DNS record for the Spectrum application. -type SpectrumAppUpdateResponseDNS struct { +type SpectrumAppNewResponseDNS struct { // The name of the DNS record associated with the application. Name string `json:"name" format:"hostname"` // The type of DNS record associated with the application. - Type SpectrumAppUpdateResponseDNSType `json:"type"` - JSON spectrumAppUpdateResponseDNSJSON `json:"-"` + Type SpectrumAppNewResponseDNSType `json:"type"` + JSON spectrumAppNewResponseDNSJSON `json:"-"` } -// spectrumAppUpdateResponseDNSJSON contains the JSON metadata for the struct -// [SpectrumAppUpdateResponseDNS] -type spectrumAppUpdateResponseDNSJSON struct { +// spectrumAppNewResponseDNSJSON contains the JSON metadata for the struct +// [SpectrumAppNewResponseDNS] +type spectrumAppNewResponseDNSJSON struct { Name apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseDNS) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseDNS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of DNS record associated with the application. -type SpectrumAppUpdateResponseDNSType string +type SpectrumAppNewResponseDNSType string const ( - SpectrumAppUpdateResponseDNSTypeCname SpectrumAppUpdateResponseDNSType = "CNAME" - SpectrumAppUpdateResponseDNSTypeAddress SpectrumAppUpdateResponseDNSType = "ADDRESS" + SpectrumAppNewResponseDNSTypeCname SpectrumAppNewResponseDNSType = "CNAME" + SpectrumAppNewResponseDNSTypeAddress SpectrumAppNewResponseDNSType = "ADDRESS" ) // The anycast edge IP configuration for the hostname of this application. // -// Union satisfied by [SpectrumAppUpdateResponseEdgeIPsObject] or -// [SpectrumAppUpdateResponseEdgeIPsObject]. -type SpectrumAppUpdateResponseEdgeIPs interface { - implementsSpectrumAppUpdateResponseEdgeIPs() +// Union satisfied by [SpectrumAppNewResponseEdgeIPsObject] or +// [SpectrumAppNewResponseEdgeIPsObject]. +type SpectrumAppNewResponseEdgeIPs interface { + implementsSpectrumAppNewResponseEdgeIPs() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*SpectrumAppUpdateResponseEdgeIPs)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*SpectrumAppNewResponseEdgeIPs)(nil)).Elem(), "") } -type SpectrumAppUpdateResponseEdgeIPsObject struct { +type SpectrumAppNewResponseEdgeIPsObject struct { // The IP versions supported for inbound connections on Spectrum anycast IPs. - Connectivity SpectrumAppUpdateResponseEdgeIPsObjectConnectivity `json:"connectivity"` + Connectivity SpectrumAppNewResponseEdgeIPsObjectConnectivity `json:"connectivity"` // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. - Type SpectrumAppUpdateResponseEdgeIPsObjectType `json:"type"` - JSON spectrumAppUpdateResponseEdgeIPsObjectJSON `json:"-"` + Type SpectrumAppNewResponseEdgeIPsObjectType `json:"type"` + JSON spectrumAppNewResponseEdgeIPsObjectJSON `json:"-"` } -// spectrumAppUpdateResponseEdgeIPsObjectJSON contains the JSON metadata for the -// struct [SpectrumAppUpdateResponseEdgeIPsObject] -type spectrumAppUpdateResponseEdgeIPsObjectJSON struct { +// spectrumAppNewResponseEdgeIPsObjectJSON contains the JSON metadata for the +// struct [SpectrumAppNewResponseEdgeIPsObject] +type spectrumAppNewResponseEdgeIPsObjectJSON struct { Connectivity apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseEdgeIPsObject) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseEdgeIPsObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r SpectrumAppUpdateResponseEdgeIPsObject) implementsSpectrumAppUpdateResponseEdgeIPs() {} +func (r SpectrumAppNewResponseEdgeIPsObject) implementsSpectrumAppNewResponseEdgeIPs() {} // The IP versions supported for inbound connections on Spectrum anycast IPs. -type SpectrumAppUpdateResponseEdgeIPsObjectConnectivity string +type SpectrumAppNewResponseEdgeIPsObjectConnectivity string const ( - SpectrumAppUpdateResponseEdgeIPsObjectConnectivityAll SpectrumAppUpdateResponseEdgeIPsObjectConnectivity = "all" - SpectrumAppUpdateResponseEdgeIPsObjectConnectivityIPV4 SpectrumAppUpdateResponseEdgeIPsObjectConnectivity = "ipv4" - SpectrumAppUpdateResponseEdgeIPsObjectConnectivityIPV6 SpectrumAppUpdateResponseEdgeIPsObjectConnectivity = "ipv6" + SpectrumAppNewResponseEdgeIPsObjectConnectivityAll SpectrumAppNewResponseEdgeIPsObjectConnectivity = "all" + SpectrumAppNewResponseEdgeIPsObjectConnectivityIPV4 SpectrumAppNewResponseEdgeIPsObjectConnectivity = "ipv4" + SpectrumAppNewResponseEdgeIPsObjectConnectivityIPV6 SpectrumAppNewResponseEdgeIPsObjectConnectivity = "ipv6" ) // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. -type SpectrumAppUpdateResponseEdgeIPsObjectType string +type SpectrumAppNewResponseEdgeIPsObjectType string const ( - SpectrumAppUpdateResponseEdgeIPsObjectTypeDynamic SpectrumAppUpdateResponseEdgeIPsObjectType = "dynamic" + SpectrumAppNewResponseEdgeIPsObjectTypeDynamic SpectrumAppNewResponseEdgeIPsObjectType = "dynamic" ) // The name and type of DNS record for the Spectrum application. -type SpectrumAppUpdateResponseOriginDNS struct { +type SpectrumAppNewResponseOriginDNS struct { // The name of the DNS record associated with the origin. Name string `json:"name" format:"hostname"` // The TTL of our resolution of your DNS record in seconds. TTL int64 `json:"ttl"` // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. - Type SpectrumAppUpdateResponseOriginDNSType `json:"type"` - JSON spectrumAppUpdateResponseOriginDNSJSON `json:"-"` + Type SpectrumAppNewResponseOriginDNSType `json:"type"` + JSON spectrumAppNewResponseOriginDNSJSON `json:"-"` } -// spectrumAppUpdateResponseOriginDNSJSON contains the JSON metadata for the struct -// [SpectrumAppUpdateResponseOriginDNS] -type spectrumAppUpdateResponseOriginDNSJSON struct { +// spectrumAppNewResponseOriginDNSJSON contains the JSON metadata for the struct +// [SpectrumAppNewResponseOriginDNS] +type spectrumAppNewResponseOriginDNSJSON struct { Name apijson.Field TTL apijson.Field Type apijson.Field @@ -279,19 +289,19 @@ type spectrumAppUpdateResponseOriginDNSJSON struct { ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseOriginDNS) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseOriginDNS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. -type SpectrumAppUpdateResponseOriginDNSType string +type SpectrumAppNewResponseOriginDNSType string const ( - SpectrumAppUpdateResponseOriginDNSTypeEmpty SpectrumAppUpdateResponseOriginDNSType = "" - SpectrumAppUpdateResponseOriginDNSTypeA SpectrumAppUpdateResponseOriginDNSType = "A" - SpectrumAppUpdateResponseOriginDNSTypeAaaa SpectrumAppUpdateResponseOriginDNSType = "AAAA" - SpectrumAppUpdateResponseOriginDNSTypeSrv SpectrumAppUpdateResponseOriginDNSType = "SRV" + SpectrumAppNewResponseOriginDNSTypeEmpty SpectrumAppNewResponseOriginDNSType = "" + SpectrumAppNewResponseOriginDNSTypeA SpectrumAppNewResponseOriginDNSType = "A" + SpectrumAppNewResponseOriginDNSTypeAaaa SpectrumAppNewResponseOriginDNSType = "AAAA" + SpectrumAppNewResponseOriginDNSTypeSrv SpectrumAppNewResponseOriginDNSType = "SRV" ) // The destination port at the origin. Only specified in conjunction with @@ -301,13 +311,13 @@ const ( // range must match the number of ports specified in the "protocol" field. // // Union satisfied by [shared.UnionInt] or [shared.UnionString]. -type SpectrumAppUpdateResponseOriginPort interface { - ImplementsSpectrumAppUpdateResponseOriginPort() +type SpectrumAppNewResponseOriginPort interface { + ImplementsSpectrumAppNewResponseOriginPort() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SpectrumAppUpdateResponseOriginPort)(nil)).Elem(), + reflect.TypeOf((*SpectrumAppNewResponseOriginPort)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -324,23 +334,23 @@ func init() { // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. -type SpectrumAppUpdateResponseProxyProtocol string +type SpectrumAppNewResponseProxyProtocol string const ( - SpectrumAppUpdateResponseProxyProtocolOff SpectrumAppUpdateResponseProxyProtocol = "off" - SpectrumAppUpdateResponseProxyProtocolV1 SpectrumAppUpdateResponseProxyProtocol = "v1" - SpectrumAppUpdateResponseProxyProtocolV2 SpectrumAppUpdateResponseProxyProtocol = "v2" - SpectrumAppUpdateResponseProxyProtocolSimple SpectrumAppUpdateResponseProxyProtocol = "simple" + SpectrumAppNewResponseProxyProtocolOff SpectrumAppNewResponseProxyProtocol = "off" + SpectrumAppNewResponseProxyProtocolV1 SpectrumAppNewResponseProxyProtocol = "v1" + SpectrumAppNewResponseProxyProtocolV2 SpectrumAppNewResponseProxyProtocol = "v2" + SpectrumAppNewResponseProxyProtocolSimple SpectrumAppNewResponseProxyProtocol = "simple" ) // The type of TLS termination associated with the application. -type SpectrumAppUpdateResponseTLS string +type SpectrumAppNewResponseTLS string const ( - SpectrumAppUpdateResponseTLSOff SpectrumAppUpdateResponseTLS = "off" - SpectrumAppUpdateResponseTLSFlexible SpectrumAppUpdateResponseTLS = "flexible" - SpectrumAppUpdateResponseTLSFull SpectrumAppUpdateResponseTLS = "full" - SpectrumAppUpdateResponseTLSStrict SpectrumAppUpdateResponseTLS = "strict" + SpectrumAppNewResponseTLSOff SpectrumAppNewResponseTLS = "off" + SpectrumAppNewResponseTLSFlexible SpectrumAppNewResponseTLS = "flexible" + SpectrumAppNewResponseTLSFull SpectrumAppNewResponseTLS = "full" + SpectrumAppNewResponseTLSStrict SpectrumAppNewResponseTLS = "strict" ) // Determines how data travels from the edge to your origin. When set to "direct", @@ -348,14 +358,16 @@ const ( // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. -type SpectrumAppUpdateResponseTrafficType string +type SpectrumAppNewResponseTrafficType string const ( - SpectrumAppUpdateResponseTrafficTypeDirect SpectrumAppUpdateResponseTrafficType = "direct" - SpectrumAppUpdateResponseTrafficTypeHTTP SpectrumAppUpdateResponseTrafficType = "http" - SpectrumAppUpdateResponseTrafficTypeHTTPS SpectrumAppUpdateResponseTrafficType = "https" + SpectrumAppNewResponseTrafficTypeDirect SpectrumAppNewResponseTrafficType = "direct" + SpectrumAppNewResponseTrafficTypeHTTP SpectrumAppNewResponseTrafficType = "http" + SpectrumAppNewResponseTrafficTypeHTTPS SpectrumAppNewResponseTrafficType = "https" ) +type SpectrumAppListResponse = interface{} + type SpectrumAppDeleteResponse struct { // Application identifier. ID string `json:"id"` @@ -390,7 +402,7 @@ func init() { ) } -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse struct { +type SpectrumAppReplaceResponse struct { // Application identifier. ID string `json:"id"` // Enables Argo Smart Routing for this application. Notes: Only available for TCP @@ -399,22 +411,22 @@ type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin // When the Application was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // The name and type of DNS record for the Spectrum application. - DNS SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNS `json:"dns"` + DNS SpectrumAppReplaceResponseDNS `json:"dns"` // The anycast edge IP configuration for the hostname of this application. - EdgeIPs SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPs `json:"edge_ips"` + EdgeIPs SpectrumAppReplaceResponseEdgeIPs `json:"edge_ips"` // Enables IP Access Rules for this application. Notes: Only available for TCP // applications. IPFirewall bool `json:"ip_firewall"` // When the Application was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The name and type of DNS record for the Spectrum application. - OriginDNS SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNS `json:"origin_dns"` + OriginDNS SpectrumAppReplaceResponseOriginDNS `json:"origin_dns"` // The destination port at the origin. Only specified in conjunction with // origin_dns. May use an integer to specify a single origin port, for example // `1000`, or a string to specify a range of origin ports, for example // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the // range must match the number of ports specified in the "protocol" field. - OriginPort SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort `json:"origin_port"` + OriginPort SpectrumAppReplaceResponseOriginPort `json:"origin_port"` // The port configuration at Cloudflare’s edge. May specify a single port, for // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. Protocol string `json:"protocol"` @@ -422,22 +434,21 @@ type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. - ProxyProtocol SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol `json:"proxy_protocol"` + ProxyProtocol SpectrumAppReplaceResponseProxyProtocol `json:"proxy_protocol"` // The type of TLS termination associated with the application. - TLS SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS `json:"tls"` + TLS SpectrumAppReplaceResponseTLS `json:"tls"` // Determines how data travels from the edge to your origin. When set to "direct", // Spectrum will send traffic directly to your origin, and the application's type // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. - TrafficType SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficType `json:"traffic_type"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseJSON `json:"-"` + TrafficType SpectrumAppReplaceResponseTrafficType `json:"traffic_type"` + JSON spectrumAppReplaceResponseJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseJSON struct { +// spectrumAppReplaceResponseJSON contains the JSON metadata for the struct +// [SpectrumAppReplaceResponse] +type spectrumAppReplaceResponseJSON struct { ID apijson.Field ArgoSmartRouting apijson.Field CreatedOn apijson.Field @@ -455,116 +466,110 @@ type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The name and type of DNS record for the Spectrum application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNS struct { +type SpectrumAppReplaceResponseDNS struct { // The name of the DNS record associated with the application. Name string `json:"name" format:"hostname"` // The type of DNS record associated with the application. - Type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSType `json:"type"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSJSON `json:"-"` + Type SpectrumAppReplaceResponseDNSType `json:"type"` + JSON spectrumAppReplaceResponseDNSJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNS] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSJSON struct { +// spectrumAppReplaceResponseDNSJSON contains the JSON metadata for the struct +// [SpectrumAppReplaceResponseDNS] +type spectrumAppReplaceResponseDNSJSON struct { Name apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNS) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseDNS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of DNS record associated with the application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSType string +type SpectrumAppReplaceResponseDNSType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSTypeCname SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSType = "CNAME" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSTypeAddress SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseDNSType = "ADDRESS" + SpectrumAppReplaceResponseDNSTypeCname SpectrumAppReplaceResponseDNSType = "CNAME" + SpectrumAppReplaceResponseDNSTypeAddress SpectrumAppReplaceResponseDNSType = "ADDRESS" ) // The anycast edge IP configuration for the hostname of this application. // -// Union satisfied by -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject] -// or -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject]. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPs interface { - implementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPs() +// Union satisfied by [SpectrumAppReplaceResponseEdgeIPsObject] or +// [SpectrumAppReplaceResponseEdgeIPsObject]. +type SpectrumAppReplaceResponseEdgeIPs interface { + implementsSpectrumAppReplaceResponseEdgeIPs() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPs)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*SpectrumAppReplaceResponseEdgeIPs)(nil)).Elem(), "") } -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject struct { +type SpectrumAppReplaceResponseEdgeIPsObject struct { // The IP versions supported for inbound connections on Spectrum anycast IPs. - Connectivity SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivity `json:"connectivity"` + Connectivity SpectrumAppReplaceResponseEdgeIPsObjectConnectivity `json:"connectivity"` // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. - Type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectType `json:"type"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectJSON `json:"-"` + Type SpectrumAppReplaceResponseEdgeIPsObjectType `json:"type"` + JSON spectrumAppReplaceResponseEdgeIPsObjectJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectJSON struct { +// spectrumAppReplaceResponseEdgeIPsObjectJSON contains the JSON metadata for the +// struct [SpectrumAppReplaceResponseEdgeIPsObject] +type spectrumAppReplaceResponseEdgeIPsObjectJSON struct { Connectivity apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseEdgeIPsObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObject) implementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPs() { -} +func (r SpectrumAppReplaceResponseEdgeIPsObject) implementsSpectrumAppReplaceResponseEdgeIPs() {} // The IP versions supported for inbound connections on Spectrum anycast IPs. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivity string +type SpectrumAppReplaceResponseEdgeIPsObjectConnectivity string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivityAll SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivity = "all" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivityIPV4 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivity = "ipv4" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivityIPV6 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectConnectivity = "ipv6" + SpectrumAppReplaceResponseEdgeIPsObjectConnectivityAll SpectrumAppReplaceResponseEdgeIPsObjectConnectivity = "all" + SpectrumAppReplaceResponseEdgeIPsObjectConnectivityIPV4 SpectrumAppReplaceResponseEdgeIPsObjectConnectivity = "ipv4" + SpectrumAppReplaceResponseEdgeIPsObjectConnectivityIPV6 SpectrumAppReplaceResponseEdgeIPsObjectConnectivity = "ipv6" ) // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectType string +type SpectrumAppReplaceResponseEdgeIPsObjectType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectTypeDynamic SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEdgeIPsObjectType = "dynamic" + SpectrumAppReplaceResponseEdgeIPsObjectTypeDynamic SpectrumAppReplaceResponseEdgeIPsObjectType = "dynamic" ) // The name and type of DNS record for the Spectrum application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNS struct { +type SpectrumAppReplaceResponseOriginDNS struct { // The name of the DNS record associated with the origin. Name string `json:"name" format:"hostname"` // The TTL of our resolution of your DNS record in seconds. TTL int64 `json:"ttl"` // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. - Type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType `json:"type"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSJSON `json:"-"` + Type SpectrumAppReplaceResponseOriginDNSType `json:"type"` + JSON spectrumAppReplaceResponseOriginDNSJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNS] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSJSON struct { +// spectrumAppReplaceResponseOriginDNSJSON contains the JSON metadata for the +// struct [SpectrumAppReplaceResponseOriginDNS] +type spectrumAppReplaceResponseOriginDNSJSON struct { Name apijson.Field TTL apijson.Field Type apijson.Field @@ -572,19 +577,19 @@ type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNS) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseOriginDNS) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType string +type SpectrumAppReplaceResponseOriginDNSType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSTypeEmpty SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType = "" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSTypeA SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType = "A" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSTypeAaaa SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType = "AAAA" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSTypeSrv SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginDNSType = "SRV" + SpectrumAppReplaceResponseOriginDNSTypeEmpty SpectrumAppReplaceResponseOriginDNSType = "" + SpectrumAppReplaceResponseOriginDNSTypeA SpectrumAppReplaceResponseOriginDNSType = "A" + SpectrumAppReplaceResponseOriginDNSTypeAaaa SpectrumAppReplaceResponseOriginDNSType = "AAAA" + SpectrumAppReplaceResponseOriginDNSTypeSrv SpectrumAppReplaceResponseOriginDNSType = "SRV" ) // The destination port at the origin. Only specified in conjunction with @@ -594,13 +599,13 @@ const ( // range must match the number of ports specified in the "protocol" field. // // Union satisfied by [shared.UnionInt] or [shared.UnionString]. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort interface { - ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort() +type SpectrumAppReplaceResponseOriginPort interface { + ImplementsSpectrumAppReplaceResponseOriginPort() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseOriginPort)(nil)).Elem(), + reflect.TypeOf((*SpectrumAppReplaceResponseOriginPort)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.Number, @@ -617,23 +622,23 @@ func init() { // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol string +type SpectrumAppReplaceResponseProxyProtocol string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocolOff SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol = "off" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocolV1 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol = "v1" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocolV2 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol = "v2" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocolSimple SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseProxyProtocol = "simple" + SpectrumAppReplaceResponseProxyProtocolOff SpectrumAppReplaceResponseProxyProtocol = "off" + SpectrumAppReplaceResponseProxyProtocolV1 SpectrumAppReplaceResponseProxyProtocol = "v1" + SpectrumAppReplaceResponseProxyProtocolV2 SpectrumAppReplaceResponseProxyProtocol = "v2" + SpectrumAppReplaceResponseProxyProtocolSimple SpectrumAppReplaceResponseProxyProtocol = "simple" ) // The type of TLS termination associated with the application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS string +type SpectrumAppReplaceResponseTLS string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLSOff SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS = "off" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLSFlexible SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS = "flexible" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLSFull SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS = "full" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLSStrict SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTLS = "strict" + SpectrumAppReplaceResponseTLSOff SpectrumAppReplaceResponseTLS = "off" + SpectrumAppReplaceResponseTLSFlexible SpectrumAppReplaceResponseTLS = "flexible" + SpectrumAppReplaceResponseTLSFull SpectrumAppReplaceResponseTLS = "full" + SpectrumAppReplaceResponseTLSStrict SpectrumAppReplaceResponseTLS = "strict" ) // Determines how data travels from the edge to your origin. When set to "direct", @@ -641,27 +646,25 @@ const ( // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficType string +type SpectrumAppReplaceResponseTrafficType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficTypeDirect SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficType = "direct" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficTypeHTTP SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficType = "http" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficTypeHTTPS SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseTrafficType = "https" + SpectrumAppReplaceResponseTrafficTypeDirect SpectrumAppReplaceResponseTrafficType = "direct" + SpectrumAppReplaceResponseTrafficTypeHTTP SpectrumAppReplaceResponseTrafficType = "http" + SpectrumAppReplaceResponseTrafficTypeHTTPS SpectrumAppReplaceResponseTrafficType = "https" ) -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponse = interface{} - -type SpectrumAppUpdateParams struct { +type SpectrumAppNewParams struct { // The name and type of DNS record for the Spectrum application. - DNS param.Field[SpectrumAppUpdateParamsDNS] `json:"dns,required"` + DNS param.Field[SpectrumAppNewParamsDNS] `json:"dns,required"` // The name and type of DNS record for the Spectrum application. - OriginDNS param.Field[SpectrumAppUpdateParamsOriginDNS] `json:"origin_dns,required"` + OriginDNS param.Field[SpectrumAppNewParamsOriginDNS] `json:"origin_dns,required"` // The destination port at the origin. Only specified in conjunction with // origin_dns. May use an integer to specify a single origin port, for example // `1000`, or a string to specify a range of origin ports, for example // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the // range must match the number of ports specified in the "protocol" field. - OriginPort param.Field[SpectrumAppUpdateParamsOriginPort] `json:"origin_port,required"` + OriginPort param.Field[SpectrumAppNewParamsOriginPort] `json:"origin_port,required"` // The port configuration at Cloudflare’s edge. May specify a single port, for // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. Protocol param.Field[string] `json:"protocol,required"` @@ -669,7 +672,7 @@ type SpectrumAppUpdateParams struct { // applications with traffic_type set to "direct". ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"` // The anycast edge IP configuration for the hostname of this application. - EdgeIPs param.Field[SpectrumAppUpdateParamsEdgeIPs] `json:"edge_ips"` + EdgeIPs param.Field[SpectrumAppNewParamsEdgeIPs] `json:"edge_ips"` // Enables IP Access Rules for this application. Notes: Only available for TCP // applications. IPFirewall param.Field[bool] `json:"ip_firewall"` @@ -677,65 +680,65 @@ type SpectrumAppUpdateParams struct { // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. - ProxyProtocol param.Field[SpectrumAppUpdateParamsProxyProtocol] `json:"proxy_protocol"` + ProxyProtocol param.Field[SpectrumAppNewParamsProxyProtocol] `json:"proxy_protocol"` // The type of TLS termination associated with the application. - TLS param.Field[SpectrumAppUpdateParamsTLS] `json:"tls"` + TLS param.Field[SpectrumAppNewParamsTLS] `json:"tls"` // Determines how data travels from the edge to your origin. When set to "direct", // Spectrum will send traffic directly to your origin, and the application's type // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. - TrafficType param.Field[SpectrumAppUpdateParamsTrafficType] `json:"traffic_type"` + TrafficType param.Field[SpectrumAppNewParamsTrafficType] `json:"traffic_type"` } -func (r SpectrumAppUpdateParams) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The name and type of DNS record for the Spectrum application. -type SpectrumAppUpdateParamsDNS struct { +type SpectrumAppNewParamsDNS struct { // The name of the DNS record associated with the application. Name param.Field[string] `json:"name" format:"hostname"` // The type of DNS record associated with the application. - Type param.Field[SpectrumAppUpdateParamsDNSType] `json:"type"` + Type param.Field[SpectrumAppNewParamsDNSType] `json:"type"` } -func (r SpectrumAppUpdateParamsDNS) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppNewParamsDNS) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of DNS record associated with the application. -type SpectrumAppUpdateParamsDNSType string +type SpectrumAppNewParamsDNSType string const ( - SpectrumAppUpdateParamsDNSTypeCname SpectrumAppUpdateParamsDNSType = "CNAME" - SpectrumAppUpdateParamsDNSTypeAddress SpectrumAppUpdateParamsDNSType = "ADDRESS" + SpectrumAppNewParamsDNSTypeCname SpectrumAppNewParamsDNSType = "CNAME" + SpectrumAppNewParamsDNSTypeAddress SpectrumAppNewParamsDNSType = "ADDRESS" ) // The name and type of DNS record for the Spectrum application. -type SpectrumAppUpdateParamsOriginDNS struct { +type SpectrumAppNewParamsOriginDNS struct { // The name of the DNS record associated with the origin. Name param.Field[string] `json:"name" format:"hostname"` // The TTL of our resolution of your DNS record in seconds. TTL param.Field[int64] `json:"ttl"` // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. - Type param.Field[SpectrumAppUpdateParamsOriginDNSType] `json:"type"` + Type param.Field[SpectrumAppNewParamsOriginDNSType] `json:"type"` } -func (r SpectrumAppUpdateParamsOriginDNS) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppNewParamsOriginDNS) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. -type SpectrumAppUpdateParamsOriginDNSType string +type SpectrumAppNewParamsOriginDNSType string const ( - SpectrumAppUpdateParamsOriginDNSTypeEmpty SpectrumAppUpdateParamsOriginDNSType = "" - SpectrumAppUpdateParamsOriginDNSTypeA SpectrumAppUpdateParamsOriginDNSType = "A" - SpectrumAppUpdateParamsOriginDNSTypeAaaa SpectrumAppUpdateParamsOriginDNSType = "AAAA" - SpectrumAppUpdateParamsOriginDNSTypeSrv SpectrumAppUpdateParamsOriginDNSType = "SRV" + SpectrumAppNewParamsOriginDNSTypeEmpty SpectrumAppNewParamsOriginDNSType = "" + SpectrumAppNewParamsOriginDNSTypeA SpectrumAppNewParamsOriginDNSType = "A" + SpectrumAppNewParamsOriginDNSTypeAaaa SpectrumAppNewParamsOriginDNSType = "AAAA" + SpectrumAppNewParamsOriginDNSTypeSrv SpectrumAppNewParamsOriginDNSType = "SRV" ) // The destination port at the origin. Only specified in conjunction with @@ -745,72 +748,72 @@ const ( // range must match the number of ports specified in the "protocol" field. // // Satisfied by [shared.UnionInt], [shared.UnionString]. -type SpectrumAppUpdateParamsOriginPort interface { - ImplementsSpectrumAppUpdateParamsOriginPort() +type SpectrumAppNewParamsOriginPort interface { + ImplementsSpectrumAppNewParamsOriginPort() } // The anycast edge IP configuration for the hostname of this application. // -// Satisfied by [SpectrumAppUpdateParamsEdgeIPsObject], -// [SpectrumAppUpdateParamsEdgeIPsObject]. -type SpectrumAppUpdateParamsEdgeIPs interface { - implementsSpectrumAppUpdateParamsEdgeIPs() +// Satisfied by [SpectrumAppNewParamsEdgeIPsObject], +// [SpectrumAppNewParamsEdgeIPsObject]. +type SpectrumAppNewParamsEdgeIPs interface { + implementsSpectrumAppNewParamsEdgeIPs() } -type SpectrumAppUpdateParamsEdgeIPsObject struct { +type SpectrumAppNewParamsEdgeIPsObject struct { // The IP versions supported for inbound connections on Spectrum anycast IPs. - Connectivity param.Field[SpectrumAppUpdateParamsEdgeIPsObjectConnectivity] `json:"connectivity"` + Connectivity param.Field[SpectrumAppNewParamsEdgeIPsObjectConnectivity] `json:"connectivity"` // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. - Type param.Field[SpectrumAppUpdateParamsEdgeIPsObjectType] `json:"type"` + Type param.Field[SpectrumAppNewParamsEdgeIPsObjectType] `json:"type"` } -func (r SpectrumAppUpdateParamsEdgeIPsObject) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppNewParamsEdgeIPsObject) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r SpectrumAppUpdateParamsEdgeIPsObject) implementsSpectrumAppUpdateParamsEdgeIPs() {} +func (r SpectrumAppNewParamsEdgeIPsObject) implementsSpectrumAppNewParamsEdgeIPs() {} // The IP versions supported for inbound connections on Spectrum anycast IPs. -type SpectrumAppUpdateParamsEdgeIPsObjectConnectivity string +type SpectrumAppNewParamsEdgeIPsObjectConnectivity string const ( - SpectrumAppUpdateParamsEdgeIPsObjectConnectivityAll SpectrumAppUpdateParamsEdgeIPsObjectConnectivity = "all" - SpectrumAppUpdateParamsEdgeIPsObjectConnectivityIPV4 SpectrumAppUpdateParamsEdgeIPsObjectConnectivity = "ipv4" - SpectrumAppUpdateParamsEdgeIPsObjectConnectivityIPV6 SpectrumAppUpdateParamsEdgeIPsObjectConnectivity = "ipv6" + SpectrumAppNewParamsEdgeIPsObjectConnectivityAll SpectrumAppNewParamsEdgeIPsObjectConnectivity = "all" + SpectrumAppNewParamsEdgeIPsObjectConnectivityIPV4 SpectrumAppNewParamsEdgeIPsObjectConnectivity = "ipv4" + SpectrumAppNewParamsEdgeIPsObjectConnectivityIPV6 SpectrumAppNewParamsEdgeIPsObjectConnectivity = "ipv6" ) // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. -type SpectrumAppUpdateParamsEdgeIPsObjectType string +type SpectrumAppNewParamsEdgeIPsObjectType string const ( - SpectrumAppUpdateParamsEdgeIPsObjectTypeDynamic SpectrumAppUpdateParamsEdgeIPsObjectType = "dynamic" + SpectrumAppNewParamsEdgeIPsObjectTypeDynamic SpectrumAppNewParamsEdgeIPsObjectType = "dynamic" ) // Enables Proxy Protocol to the origin. Refer to // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. -type SpectrumAppUpdateParamsProxyProtocol string +type SpectrumAppNewParamsProxyProtocol string const ( - SpectrumAppUpdateParamsProxyProtocolOff SpectrumAppUpdateParamsProxyProtocol = "off" - SpectrumAppUpdateParamsProxyProtocolV1 SpectrumAppUpdateParamsProxyProtocol = "v1" - SpectrumAppUpdateParamsProxyProtocolV2 SpectrumAppUpdateParamsProxyProtocol = "v2" - SpectrumAppUpdateParamsProxyProtocolSimple SpectrumAppUpdateParamsProxyProtocol = "simple" + SpectrumAppNewParamsProxyProtocolOff SpectrumAppNewParamsProxyProtocol = "off" + SpectrumAppNewParamsProxyProtocolV1 SpectrumAppNewParamsProxyProtocol = "v1" + SpectrumAppNewParamsProxyProtocolV2 SpectrumAppNewParamsProxyProtocol = "v2" + SpectrumAppNewParamsProxyProtocolSimple SpectrumAppNewParamsProxyProtocol = "simple" ) // The type of TLS termination associated with the application. -type SpectrumAppUpdateParamsTLS string +type SpectrumAppNewParamsTLS string const ( - SpectrumAppUpdateParamsTLSOff SpectrumAppUpdateParamsTLS = "off" - SpectrumAppUpdateParamsTLSFlexible SpectrumAppUpdateParamsTLS = "flexible" - SpectrumAppUpdateParamsTLSFull SpectrumAppUpdateParamsTLS = "full" - SpectrumAppUpdateParamsTLSStrict SpectrumAppUpdateParamsTLS = "strict" + SpectrumAppNewParamsTLSOff SpectrumAppNewParamsTLS = "off" + SpectrumAppNewParamsTLSFlexible SpectrumAppNewParamsTLS = "flexible" + SpectrumAppNewParamsTLSFull SpectrumAppNewParamsTLS = "full" + SpectrumAppNewParamsTLSStrict SpectrumAppNewParamsTLS = "strict" ) // Determines how data travels from the edge to your origin. When set to "direct", @@ -818,26 +821,26 @@ const ( // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. -type SpectrumAppUpdateParamsTrafficType string +type SpectrumAppNewParamsTrafficType string const ( - SpectrumAppUpdateParamsTrafficTypeDirect SpectrumAppUpdateParamsTrafficType = "direct" - SpectrumAppUpdateParamsTrafficTypeHTTP SpectrumAppUpdateParamsTrafficType = "http" - SpectrumAppUpdateParamsTrafficTypeHTTPS SpectrumAppUpdateParamsTrafficType = "https" + SpectrumAppNewParamsTrafficTypeDirect SpectrumAppNewParamsTrafficType = "direct" + SpectrumAppNewParamsTrafficTypeHTTP SpectrumAppNewParamsTrafficType = "http" + SpectrumAppNewParamsTrafficTypeHTTPS SpectrumAppNewParamsTrafficType = "https" ) -type SpectrumAppUpdateResponseEnvelope struct { - Errors []SpectrumAppUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAppUpdateResponseEnvelopeMessages `json:"messages,required"` - Result SpectrumAppUpdateResponse `json:"result,required,nullable"` +type SpectrumAppNewResponseEnvelope struct { + Errors []SpectrumAppNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SpectrumAppNewResponseEnvelopeMessages `json:"messages,required"` + Result SpectrumAppNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SpectrumAppUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON spectrumAppUpdateResponseEnvelopeJSON `json:"-"` + Success SpectrumAppNewResponseEnvelopeSuccess `json:"success,required"` + JSON spectrumAppNewResponseEnvelopeJSON `json:"-"` } -// spectrumAppUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [SpectrumAppUpdateResponseEnvelope] -type spectrumAppUpdateResponseEnvelopeJSON struct { +// spectrumAppNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpectrumAppNewResponseEnvelope] +type spectrumAppNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -846,53 +849,93 @@ type spectrumAppUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAppUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SpectrumAppNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAppNewResponseEnvelopeErrorsJSON `json:"-"` } -// spectrumAppUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [SpectrumAppUpdateResponseEnvelopeErrors] -type spectrumAppUpdateResponseEnvelopeErrorsJSON struct { +// spectrumAppNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SpectrumAppNewResponseEnvelopeErrors] +type spectrumAppNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAppUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SpectrumAppNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAppNewResponseEnvelopeMessagesJSON `json:"-"` } -// spectrumAppUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [SpectrumAppUpdateResponseEnvelopeMessages] -type spectrumAppUpdateResponseEnvelopeMessagesJSON struct { +// spectrumAppNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SpectrumAppNewResponseEnvelopeMessages] +type spectrumAppNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SpectrumAppUpdateResponseEnvelopeSuccess bool +type SpectrumAppNewResponseEnvelopeSuccess bool const ( - SpectrumAppUpdateResponseEnvelopeSuccessTrue SpectrumAppUpdateResponseEnvelopeSuccess = true + SpectrumAppNewResponseEnvelopeSuccessTrue SpectrumAppNewResponseEnvelopeSuccess = true +) + +type SpectrumAppListParams struct { + // Sets the direction by which results are ordered. + Direction param.Field[SpectrumAppListParamsDirection] `query:"direction"` + // Application field by which results are ordered. + Order param.Field[SpectrumAppListParamsOrder] `query:"order"` + // Page number of paginated results. This parameter is required in order to use + // other pagination parameters. If included in the query, `result_info` will be + // present in the response. + Page param.Field[float64] `query:"page"` + // Sets the maximum number of results per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [SpectrumAppListParams]'s query parameters as `url.Values`. +func (r SpectrumAppListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Sets the direction by which results are ordered. +type SpectrumAppListParamsDirection string + +const ( + SpectrumAppListParamsDirectionAsc SpectrumAppListParamsDirection = "asc" + SpectrumAppListParamsDirectionDesc SpectrumAppListParamsDirection = "desc" +) + +// Application field by which results are ordered. +type SpectrumAppListParamsOrder string + +const ( + SpectrumAppListParamsOrderProtocol SpectrumAppListParamsOrder = "protocol" + SpectrumAppListParamsOrderAppID SpectrumAppListParamsOrder = "app_id" + SpectrumAppListParamsOrderCreatedOn SpectrumAppListParamsOrder = "created_on" + SpectrumAppListParamsOrderModifiedOn SpectrumAppListParamsOrder = "modified_on" + SpectrumAppListParamsOrderDNS SpectrumAppListParamsOrder = "dns" ) type SpectrumAppDeleteResponseEnvelope struct { @@ -1033,17 +1076,17 @@ const ( SpectrumAppGetResponseEnvelopeSuccessTrue SpectrumAppGetResponseEnvelopeSuccess = true ) -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParams struct { +type SpectrumAppReplaceParams struct { // The name and type of DNS record for the Spectrum application. - DNS param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNS] `json:"dns,required"` + DNS param.Field[SpectrumAppReplaceParamsDNS] `json:"dns,required"` // The name and type of DNS record for the Spectrum application. - OriginDNS param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNS] `json:"origin_dns,required"` + OriginDNS param.Field[SpectrumAppReplaceParamsOriginDNS] `json:"origin_dns,required"` // The destination port at the origin. Only specified in conjunction with // origin_dns. May use an integer to specify a single origin port, for example // `1000`, or a string to specify a range of origin ports, for example // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the // range must match the number of ports specified in the "protocol" field. - OriginPort param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort] `json:"origin_port,required"` + OriginPort param.Field[SpectrumAppReplaceParamsOriginPort] `json:"origin_port,required"` // The port configuration at Cloudflare’s edge. May specify a single port, for // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. Protocol param.Field[string] `json:"protocol,required"` @@ -1051,7 +1094,7 @@ type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin // applications with traffic_type set to "direct". ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"` // The anycast edge IP configuration for the hostname of this application. - EdgeIPs param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPs] `json:"edge_ips"` + EdgeIPs param.Field[SpectrumAppReplaceParamsEdgeIPs] `json:"edge_ips"` // Enables IP Access Rules for this application. Notes: Only available for TCP // applications. IPFirewall param.Field[bool] `json:"ip_firewall"` @@ -1059,65 +1102,65 @@ type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. - ProxyProtocol param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol] `json:"proxy_protocol"` + ProxyProtocol param.Field[SpectrumAppReplaceParamsProxyProtocol] `json:"proxy_protocol"` // The type of TLS termination associated with the application. - TLS param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS] `json:"tls"` + TLS param.Field[SpectrumAppReplaceParamsTLS] `json:"tls"` // Determines how data travels from the edge to your origin. When set to "direct", // Spectrum will send traffic directly to your origin, and the application's type // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. - TrafficType param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficType] `json:"traffic_type"` + TrafficType param.Field[SpectrumAppReplaceParamsTrafficType] `json:"traffic_type"` } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParams) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The name and type of DNS record for the Spectrum application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNS struct { +type SpectrumAppReplaceParamsDNS struct { // The name of the DNS record associated with the application. Name param.Field[string] `json:"name" format:"hostname"` // The type of DNS record associated with the application. - Type param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSType] `json:"type"` + Type param.Field[SpectrumAppReplaceParamsDNSType] `json:"type"` } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNS) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppReplaceParamsDNS) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of DNS record associated with the application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSType string +type SpectrumAppReplaceParamsDNSType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSTypeCname SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSType = "CNAME" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSTypeAddress SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSType = "ADDRESS" + SpectrumAppReplaceParamsDNSTypeCname SpectrumAppReplaceParamsDNSType = "CNAME" + SpectrumAppReplaceParamsDNSTypeAddress SpectrumAppReplaceParamsDNSType = "ADDRESS" ) // The name and type of DNS record for the Spectrum application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNS struct { +type SpectrumAppReplaceParamsOriginDNS struct { // The name of the DNS record associated with the origin. Name param.Field[string] `json:"name" format:"hostname"` // The TTL of our resolution of your DNS record in seconds. TTL param.Field[int64] `json:"ttl"` // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. - Type param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType] `json:"type"` + Type param.Field[SpectrumAppReplaceParamsOriginDNSType] `json:"type"` } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNS) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppReplaceParamsOriginDNS) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The type of DNS record associated with the origin. "" is used to specify a // combination of A/AAAA records. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType string +type SpectrumAppReplaceParamsOriginDNSType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSTypeEmpty SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType = "" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSTypeA SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType = "A" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSTypeAaaa SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType = "AAAA" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSTypeSrv SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSType = "SRV" + SpectrumAppReplaceParamsOriginDNSTypeEmpty SpectrumAppReplaceParamsOriginDNSType = "" + SpectrumAppReplaceParamsOriginDNSTypeA SpectrumAppReplaceParamsOriginDNSType = "A" + SpectrumAppReplaceParamsOriginDNSTypeAaaa SpectrumAppReplaceParamsOriginDNSType = "AAAA" + SpectrumAppReplaceParamsOriginDNSTypeSrv SpectrumAppReplaceParamsOriginDNSType = "SRV" ) // The destination port at the origin. Only specified in conjunction with @@ -1127,74 +1170,72 @@ const ( // range must match the number of ports specified in the "protocol" field. // // Satisfied by [shared.UnionInt], [shared.UnionString]. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort interface { - ImplementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort() +type SpectrumAppReplaceParamsOriginPort interface { + ImplementsSpectrumAppReplaceParamsOriginPort() } // The anycast edge IP configuration for the hostname of this application. // -// Satisfied by -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject], -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject]. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPs interface { - implementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPs() +// Satisfied by [SpectrumAppReplaceParamsEdgeIPsObject], +// [SpectrumAppReplaceParamsEdgeIPsObject]. +type SpectrumAppReplaceParamsEdgeIPs interface { + implementsSpectrumAppReplaceParamsEdgeIPs() } -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject struct { +type SpectrumAppReplaceParamsEdgeIPsObject struct { // The IP versions supported for inbound connections on Spectrum anycast IPs. - Connectivity param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivity] `json:"connectivity"` + Connectivity param.Field[SpectrumAppReplaceParamsEdgeIPsObjectConnectivity] `json:"connectivity"` // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. - Type param.Field[SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectType] `json:"type"` + Type param.Field[SpectrumAppReplaceParamsEdgeIPsObjectType] `json:"type"` } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject) MarshalJSON() (data []byte, err error) { +func (r SpectrumAppReplaceParamsEdgeIPsObject) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject) implementsSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPs() { -} +func (r SpectrumAppReplaceParamsEdgeIPsObject) implementsSpectrumAppReplaceParamsEdgeIPs() {} // The IP versions supported for inbound connections on Spectrum anycast IPs. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivity string +type SpectrumAppReplaceParamsEdgeIPsObjectConnectivity string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivityAll SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivity = "all" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivityIPV4 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivity = "ipv4" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivityIPV6 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivity = "ipv6" + SpectrumAppReplaceParamsEdgeIPsObjectConnectivityAll SpectrumAppReplaceParamsEdgeIPsObjectConnectivity = "all" + SpectrumAppReplaceParamsEdgeIPsObjectConnectivityIPV4 SpectrumAppReplaceParamsEdgeIPsObjectConnectivity = "ipv4" + SpectrumAppReplaceParamsEdgeIPsObjectConnectivityIPV6 SpectrumAppReplaceParamsEdgeIPsObjectConnectivity = "ipv6" ) // The type of edge IP configuration specified. Dynamically allocated edge IPs use // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid // with CNAME DNS names. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectType string +type SpectrumAppReplaceParamsEdgeIPsObjectType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectTypeDynamic SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectType = "dynamic" + SpectrumAppReplaceParamsEdgeIPsObjectTypeDynamic SpectrumAppReplaceParamsEdgeIPsObjectType = "dynamic" ) // Enables Proxy Protocol to the origin. Refer to // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple // Proxy Protocol. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol string +type SpectrumAppReplaceParamsProxyProtocol string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocolOff SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol = "off" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocolV1 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol = "v1" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocolV2 SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol = "v2" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocolSimple SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocol = "simple" + SpectrumAppReplaceParamsProxyProtocolOff SpectrumAppReplaceParamsProxyProtocol = "off" + SpectrumAppReplaceParamsProxyProtocolV1 SpectrumAppReplaceParamsProxyProtocol = "v1" + SpectrumAppReplaceParamsProxyProtocolV2 SpectrumAppReplaceParamsProxyProtocol = "v2" + SpectrumAppReplaceParamsProxyProtocolSimple SpectrumAppReplaceParamsProxyProtocol = "simple" ) // The type of TLS termination associated with the application. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS string +type SpectrumAppReplaceParamsTLS string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLSOff SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS = "off" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLSFlexible SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS = "flexible" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLSFull SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS = "full" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLSStrict SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLS = "strict" + SpectrumAppReplaceParamsTLSOff SpectrumAppReplaceParamsTLS = "off" + SpectrumAppReplaceParamsTLSFlexible SpectrumAppReplaceParamsTLS = "flexible" + SpectrumAppReplaceParamsTLSFull SpectrumAppReplaceParamsTLS = "full" + SpectrumAppReplaceParamsTLSStrict SpectrumAppReplaceParamsTLS = "strict" ) // Determines how data travels from the edge to your origin. When set to "direct", @@ -1202,27 +1243,26 @@ const ( // is derived from the `protocol`. When set to "http" or "https", Spectrum will // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and // the application type matches this property exactly. -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficType string +type SpectrumAppReplaceParamsTrafficType string const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficTypeDirect SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficType = "direct" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficTypeHTTP SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficType = "http" - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficTypeHTTPS SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficType = "https" + SpectrumAppReplaceParamsTrafficTypeDirect SpectrumAppReplaceParamsTrafficType = "direct" + SpectrumAppReplaceParamsTrafficTypeHTTP SpectrumAppReplaceParamsTrafficType = "http" + SpectrumAppReplaceParamsTrafficTypeHTTPS SpectrumAppReplaceParamsTrafficType = "https" ) -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelope struct { - Errors []SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessages `json:"messages,required"` - Result SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponse `json:"result,required,nullable"` +type SpectrumAppReplaceResponseEnvelope struct { + Errors []SpectrumAppReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SpectrumAppReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SpectrumAppReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeSuccess `json:"success,required"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeJSON `json:"-"` + Success SpectrumAppReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON spectrumAppReplaceResponseEnvelopeJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelope] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeJSON struct { +// spectrumAppReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpectrumAppReplaceResponseEnvelope] +type spectrumAppReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1231,197 +1271,51 @@ type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrorsJSON `json:"-"` +type SpectrumAppReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAppReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrors] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrorsJSON struct { +// spectrumAppReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SpectrumAppReplaceResponseEnvelopeErrors] +type spectrumAppReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessagesJSON `json:"-"` +type SpectrumAppReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON spectrumAppReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessages] -type spectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessagesJSON struct { +// spectrumAppReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SpectrumAppReplaceResponseEnvelopeMessages] +type spectrumAppReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SpectrumAppReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeSuccess bool +type SpectrumAppReplaceResponseEnvelopeSuccess bool const ( - SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeSuccessTrue SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginResponseEnvelopeSuccess = true + SpectrumAppReplaceResponseEnvelopeSuccessTrue SpectrumAppReplaceResponseEnvelopeSuccess = true ) - -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams struct { - // Sets the direction by which results are ordered. - Direction param.Field[SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirection] `query:"direction"` - // Application field by which results are ordered. - Order param.Field[SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder] `query:"order"` - // Page number of paginated results. This parameter is required in order to use - // other pagination parameters. If included in the query, `result_info` will be - // present in the response. - Page param.Field[float64] `query:"page"` - // Sets the maximum number of results per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes -// [SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams]'s query -// parameters as `url.Values`. -func (r SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Sets the direction by which results are ordered. -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirection string - -const ( - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirectionAsc SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirection = "asc" - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirectionDesc SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirection = "desc" -) - -// Application field by which results are ordered. -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder string - -const ( - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderProtocol SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder = "protocol" - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderAppID SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder = "app_id" - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderCreatedOn SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder = "created_on" - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderModifiedOn SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder = "modified_on" - SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderDNS SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrder = "dns" -) - -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelope struct { - Errors []SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrors `json:"errors,required"` - Messages []SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessages `json:"messages,required"` - Result []SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfo `json:"result_info"` - JSON spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeJSON `json:"-"` -} - -// spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelope] -type spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrorsJSON `json:"-"` -} - -// spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrors] -type spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessagesJSON `json:"-"` -} - -// spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessages] -type spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeSuccess bool - -const ( - SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeSuccessTrue SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeSuccess = true -) - -type SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfo] -type spectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpectrumAppSpectrumApplicationsListSpectrumApplicationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/spectrumapp_test.go b/spectrumapp_test.go index ed57dc2b469..986b13d0786 100644 --- a/spectrumapp_test.go +++ b/spectrumapp_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSpectrumAppUpdateWithOptionalParams(t *testing.T) { +func TestSpectrumAppNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,31 +30,30 @@ func TestSpectrumAppUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Apps.Update( + _, err := client.Spectrum.Apps.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", - cloudflare.SpectrumAppUpdateParams{ - DNS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsDNS{ + cloudflare.SpectrumAppNewParams{ + DNS: cloudflare.F(cloudflare.SpectrumAppNewParamsDNS{ Name: cloudflare.F("ssh.example.com"), - Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsDNSTypeCname), + Type: cloudflare.F(cloudflare.SpectrumAppNewParamsDNSTypeCname), }), - OriginDNS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsOriginDNS{ + OriginDNS: cloudflare.F(cloudflare.SpectrumAppNewParamsOriginDNS{ Name: cloudflare.F("origin.example.com"), TTL: cloudflare.F(int64(600)), - Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsOriginDNSTypeEmpty), + Type: cloudflare.F(cloudflare.SpectrumAppNewParamsOriginDNSTypeEmpty), }), - OriginPort: cloudflare.F[cloudflare.SpectrumAppUpdateParamsOriginPort](shared.UnionInt(int64(22))), + OriginPort: cloudflare.F[cloudflare.SpectrumAppNewParamsOriginPort](shared.UnionInt(int64(22))), Protocol: cloudflare.F("tcp/22"), ArgoSmartRouting: cloudflare.F(true), - EdgeIPs: cloudflare.F[cloudflare.SpectrumAppUpdateParamsEdgeIPs](cloudflare.SpectrumAppUpdateParamsEdgeIPsObject(cloudflare.SpectrumAppUpdateParamsEdgeIPsObject{ - Connectivity: cloudflare.F(cloudflare.SpectrumAppUpdateParamsEdgeIPsObjectConnectivityAll), - Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsEdgeIPsObjectTypeDynamic), + EdgeIPs: cloudflare.F[cloudflare.SpectrumAppNewParamsEdgeIPs](cloudflare.SpectrumAppNewParamsEdgeIPsObject(cloudflare.SpectrumAppNewParamsEdgeIPsObject{ + Connectivity: cloudflare.F(cloudflare.SpectrumAppNewParamsEdgeIPsObjectConnectivityAll), + Type: cloudflare.F(cloudflare.SpectrumAppNewParamsEdgeIPsObjectTypeDynamic), })), IPFirewall: cloudflare.F(true), - ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppUpdateParamsProxyProtocolOff), - TLS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsTLSFull), - TrafficType: cloudflare.F(cloudflare.SpectrumAppUpdateParamsTrafficTypeDirect), + ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppNewParamsProxyProtocolOff), + TLS: cloudflare.F(cloudflare.SpectrumAppNewParamsTLSFull), + TrafficType: cloudflare.F(cloudflare.SpectrumAppNewParamsTrafficTypeDirect), }, ) if err != nil { @@ -66,7 +65,7 @@ func TestSpectrumAppUpdateWithOptionalParams(t *testing.T) { } } -func TestSpectrumAppDelete(t *testing.T) { +func TestSpectrumAppListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -82,10 +81,15 @@ func TestSpectrumAppDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Apps.Delete( + _, err := client.Spectrum.Apps.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", + cloudflare.SpectrumAppListParams{ + Direction: cloudflare.F(cloudflare.SpectrumAppListParamsDirectionDesc), + Order: cloudflare.F(cloudflare.SpectrumAppListParamsOrderProtocol), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(1.000000), + }, ) if err != nil { var apierr *cloudflare.Error @@ -96,7 +100,7 @@ func TestSpectrumAppDelete(t *testing.T) { } } -func TestSpectrumAppGet(t *testing.T) { +func TestSpectrumAppDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -112,7 +116,7 @@ func TestSpectrumAppGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Apps.Get( + _, err := client.Spectrum.Apps.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", @@ -126,7 +130,7 @@ func TestSpectrumAppGet(t *testing.T) { } } -func TestSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginWithOptionalParams(t *testing.T) { +func TestSpectrumAppGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -142,31 +146,10 @@ func TestSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOr option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Apps.SpectrumApplicationsNewSpectrumApplicationUsingANameForTheOrigin( + _, err := client.Spectrum.Apps.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParams{ - DNS: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNS{ - Name: cloudflare.F("ssh.example.com"), - Type: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsDNSTypeCname), - }), - OriginDNS: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNS{ - Name: cloudflare.F("origin.example.com"), - TTL: cloudflare.F(int64(600)), - Type: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginDNSTypeEmpty), - }), - OriginPort: cloudflare.F[cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsOriginPort](shared.UnionInt(int64(22))), - Protocol: cloudflare.F("tcp/22"), - ArgoSmartRouting: cloudflare.F(true), - EdgeIPs: cloudflare.F[cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPs](cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObject{ - Connectivity: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectConnectivityAll), - Type: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsEdgeIPsObjectTypeDynamic), - })), - IPFirewall: cloudflare.F(true), - ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsProxyProtocolOff), - TLS: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTLSFull), - TrafficType: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOriginParamsTrafficTypeDirect), - }, + "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error @@ -177,7 +160,7 @@ func TestSpectrumAppSpectrumApplicationsNewSpectrumApplicationUsingANameForTheOr } } -func TestSpectrumAppSpectrumApplicationsListSpectrumApplicationsWithOptionalParams(t *testing.T) { +func TestSpectrumAppReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -193,14 +176,31 @@ func TestSpectrumAppSpectrumApplicationsListSpectrumApplicationsWithOptionalPara option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Spectrums.Apps.SpectrumApplicationsListSpectrumApplications( + _, err := client.Spectrum.Apps.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsParams{ - Direction: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsDirectionDesc), - Order: cloudflare.F(cloudflare.SpectrumAppSpectrumApplicationsListSpectrumApplicationsParamsOrderProtocol), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(1.000000), + "ea95132c15732412d22c1476fa83f27a", + cloudflare.SpectrumAppReplaceParams{ + DNS: cloudflare.F(cloudflare.SpectrumAppReplaceParamsDNS{ + Name: cloudflare.F("ssh.example.com"), + Type: cloudflare.F(cloudflare.SpectrumAppReplaceParamsDNSTypeCname), + }), + OriginDNS: cloudflare.F(cloudflare.SpectrumAppReplaceParamsOriginDNS{ + Name: cloudflare.F("origin.example.com"), + TTL: cloudflare.F(int64(600)), + Type: cloudflare.F(cloudflare.SpectrumAppReplaceParamsOriginDNSTypeEmpty), + }), + OriginPort: cloudflare.F[cloudflare.SpectrumAppReplaceParamsOriginPort](shared.UnionInt(int64(22))), + Protocol: cloudflare.F("tcp/22"), + ArgoSmartRouting: cloudflare.F(true), + EdgeIPs: cloudflare.F[cloudflare.SpectrumAppReplaceParamsEdgeIPs](cloudflare.SpectrumAppReplaceParamsEdgeIPsObject(cloudflare.SpectrumAppReplaceParamsEdgeIPsObject{ + Connectivity: cloudflare.F(cloudflare.SpectrumAppReplaceParamsEdgeIPsObjectConnectivityAll), + Type: cloudflare.F(cloudflare.SpectrumAppReplaceParamsEdgeIPsObjectTypeDynamic), + })), + IPFirewall: cloudflare.F(true), + ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppReplaceParamsProxyProtocolOff), + TLS: cloudflare.F(cloudflare.SpectrumAppReplaceParamsTLSFull), + TrafficType: cloudflare.F(cloudflare.SpectrumAppReplaceParamsTrafficTypeDirect), }, ) if err != nil { diff --git a/speed.go b/speed.go new file mode 100644 index 00000000000..384ea36b29d --- /dev/null +++ b/speed.go @@ -0,0 +1,1075 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// SpeedService contains methods and other services that help with interacting with +// the cloudflare API. Note, unlike clients, this service does not read variables +// from the environment automatically. You should not instantiate this service +// directly, and instead use the [NewSpeedService] method instead. +type SpeedService struct { + Options []option.RequestOption + Schedule *SpeedScheduleService + Availabilities *SpeedAvailabilityService + Pages *SpeedPageService + Tests *SpeedTestService +} + +// NewSpeedService generates a new service that applies the given options to each +// request. These options are applied after the parent client's options (if there +// is one), and before any request-specific options. +func NewSpeedService(opts ...option.RequestOption) (r *SpeedService) { + r = &SpeedService{} + r.Options = opts + r.Schedule = NewSpeedScheduleService(opts...) + r.Availabilities = NewSpeedAvailabilityService(opts...) + r.Pages = NewSpeedPageService(opts...) + r.Tests = NewSpeedTestService(opts...) + return +} + +// Starts a test for a specific webpage, in a specific region. +func (r *SpeedService) New(ctx context.Context, zoneID string, url string, body SpeedNewParams, opts ...option.RequestOption) (res *SpeedNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedNewResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Deletes all tests for a specific webpage from a specific region. Deleted tests +// are still counted as part of the quota. +func (r *SpeedService) Delete(ctx context.Context, zoneID string, url string, body SpeedDeleteParams, opts ...option.RequestOption) (res *SpeedDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Retrieves the test schedule for a page in a specific region. +func (r *SpeedService) ScheduleGet(ctx context.Context, zoneID string, url string, query SpeedScheduleGetParams, opts ...option.RequestOption) (res *SpeedScheduleGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedScheduleGetResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Retrieves the result of a specific test. +func (r *SpeedService) TestsGet(ctx context.Context, zoneID string, url string, testID string, opts ...option.RequestOption) (res *SpeedTestsGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedTestsGetResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests/%s", zoneID, url, testID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists the core web vital metrics trend over time for a specific page. +func (r *SpeedService) TrendsList(ctx context.Context, zoneID string, url string, query SpeedTrendsListParams, opts ...option.RequestOption) (res *SpeedTrendsListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedTrendsListResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/pages/%s/trend", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type SpeedNewResponse struct { + // UUID + ID string `json:"id"` + Date time.Time `json:"date" format:"date-time"` + // The Lighthouse report. + DesktopReport SpeedNewResponseDesktopReport `json:"desktopReport"` + // The Lighthouse report. + MobileReport SpeedNewResponseMobileReport `json:"mobileReport"` + // A test region with a label. + Region SpeedNewResponseRegion `json:"region"` + // The frequency of the test. + ScheduleFrequency SpeedNewResponseScheduleFrequency `json:"scheduleFrequency"` + // A URL. + URL string `json:"url"` + JSON speedNewResponseJSON `json:"-"` +} + +// speedNewResponseJSON contains the JSON metadata for the struct +// [SpeedNewResponse] +type speedNewResponseJSON struct { + ID apijson.Field + Date apijson.Field + DesktopReport apijson.Field + MobileReport apijson.Field + Region apijson.Field + ScheduleFrequency apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The Lighthouse report. +type SpeedNewResponseDesktopReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedNewResponseDesktopReportDeviceType `json:"deviceType"` + Error SpeedNewResponseDesktopReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedNewResponseDesktopReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedNewResponseDesktopReportJSON `json:"-"` +} + +// speedNewResponseDesktopReportJSON contains the JSON metadata for the struct +// [SpeedNewResponseDesktopReport] +type speedNewResponseDesktopReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseDesktopReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedNewResponseDesktopReportDeviceType string + +const ( + SpeedNewResponseDesktopReportDeviceTypeDesktop SpeedNewResponseDesktopReportDeviceType = "DESKTOP" + SpeedNewResponseDesktopReportDeviceTypeMobile SpeedNewResponseDesktopReportDeviceType = "MOBILE" +) + +type SpeedNewResponseDesktopReportError struct { + // The error code of the Lighthouse result. + Code SpeedNewResponseDesktopReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedNewResponseDesktopReportErrorJSON `json:"-"` +} + +// speedNewResponseDesktopReportErrorJSON contains the JSON metadata for the struct +// [SpeedNewResponseDesktopReportError] +type speedNewResponseDesktopReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedNewResponseDesktopReportErrorCode string + +const ( + SpeedNewResponseDesktopReportErrorCodeNotReachable SpeedNewResponseDesktopReportErrorCode = "NOT_REACHABLE" + SpeedNewResponseDesktopReportErrorCodeDNSFailure SpeedNewResponseDesktopReportErrorCode = "DNS_FAILURE" + SpeedNewResponseDesktopReportErrorCodeNotHTML SpeedNewResponseDesktopReportErrorCode = "NOT_HTML" + SpeedNewResponseDesktopReportErrorCodeLighthouseTimeout SpeedNewResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedNewResponseDesktopReportErrorCodeUnknown SpeedNewResponseDesktopReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedNewResponseDesktopReportState string + +const ( + SpeedNewResponseDesktopReportStateRunning SpeedNewResponseDesktopReportState = "RUNNING" + SpeedNewResponseDesktopReportStateComplete SpeedNewResponseDesktopReportState = "COMPLETE" + SpeedNewResponseDesktopReportStateFailed SpeedNewResponseDesktopReportState = "FAILED" +) + +// The Lighthouse report. +type SpeedNewResponseMobileReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedNewResponseMobileReportDeviceType `json:"deviceType"` + Error SpeedNewResponseMobileReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedNewResponseMobileReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedNewResponseMobileReportJSON `json:"-"` +} + +// speedNewResponseMobileReportJSON contains the JSON metadata for the struct +// [SpeedNewResponseMobileReport] +type speedNewResponseMobileReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseMobileReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedNewResponseMobileReportDeviceType string + +const ( + SpeedNewResponseMobileReportDeviceTypeDesktop SpeedNewResponseMobileReportDeviceType = "DESKTOP" + SpeedNewResponseMobileReportDeviceTypeMobile SpeedNewResponseMobileReportDeviceType = "MOBILE" +) + +type SpeedNewResponseMobileReportError struct { + // The error code of the Lighthouse result. + Code SpeedNewResponseMobileReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedNewResponseMobileReportErrorJSON `json:"-"` +} + +// speedNewResponseMobileReportErrorJSON contains the JSON metadata for the struct +// [SpeedNewResponseMobileReportError] +type speedNewResponseMobileReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseMobileReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedNewResponseMobileReportErrorCode string + +const ( + SpeedNewResponseMobileReportErrorCodeNotReachable SpeedNewResponseMobileReportErrorCode = "NOT_REACHABLE" + SpeedNewResponseMobileReportErrorCodeDNSFailure SpeedNewResponseMobileReportErrorCode = "DNS_FAILURE" + SpeedNewResponseMobileReportErrorCodeNotHTML SpeedNewResponseMobileReportErrorCode = "NOT_HTML" + SpeedNewResponseMobileReportErrorCodeLighthouseTimeout SpeedNewResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedNewResponseMobileReportErrorCodeUnknown SpeedNewResponseMobileReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedNewResponseMobileReportState string + +const ( + SpeedNewResponseMobileReportStateRunning SpeedNewResponseMobileReportState = "RUNNING" + SpeedNewResponseMobileReportStateComplete SpeedNewResponseMobileReportState = "COMPLETE" + SpeedNewResponseMobileReportStateFailed SpeedNewResponseMobileReportState = "FAILED" +) + +// A test region with a label. +type SpeedNewResponseRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedNewResponseRegionValue `json:"value"` + JSON speedNewResponseRegionJSON `json:"-"` +} + +// speedNewResponseRegionJSON contains the JSON metadata for the struct +// [SpeedNewResponseRegion] +type speedNewResponseRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedNewResponseRegionValue string + +const ( + SpeedNewResponseRegionValueAsiaEast1 SpeedNewResponseRegionValue = "asia-east1" + SpeedNewResponseRegionValueAsiaNortheast1 SpeedNewResponseRegionValue = "asia-northeast1" + SpeedNewResponseRegionValueAsiaNortheast2 SpeedNewResponseRegionValue = "asia-northeast2" + SpeedNewResponseRegionValueAsiaSouth1 SpeedNewResponseRegionValue = "asia-south1" + SpeedNewResponseRegionValueAsiaSoutheast1 SpeedNewResponseRegionValue = "asia-southeast1" + SpeedNewResponseRegionValueAustraliaSoutheast1 SpeedNewResponseRegionValue = "australia-southeast1" + SpeedNewResponseRegionValueEuropeNorth1 SpeedNewResponseRegionValue = "europe-north1" + SpeedNewResponseRegionValueEuropeSouthwest1 SpeedNewResponseRegionValue = "europe-southwest1" + SpeedNewResponseRegionValueEuropeWest1 SpeedNewResponseRegionValue = "europe-west1" + SpeedNewResponseRegionValueEuropeWest2 SpeedNewResponseRegionValue = "europe-west2" + SpeedNewResponseRegionValueEuropeWest3 SpeedNewResponseRegionValue = "europe-west3" + SpeedNewResponseRegionValueEuropeWest4 SpeedNewResponseRegionValue = "europe-west4" + SpeedNewResponseRegionValueEuropeWest8 SpeedNewResponseRegionValue = "europe-west8" + SpeedNewResponseRegionValueEuropeWest9 SpeedNewResponseRegionValue = "europe-west9" + SpeedNewResponseRegionValueMeWest1 SpeedNewResponseRegionValue = "me-west1" + SpeedNewResponseRegionValueSouthamericaEast1 SpeedNewResponseRegionValue = "southamerica-east1" + SpeedNewResponseRegionValueUsCentral1 SpeedNewResponseRegionValue = "us-central1" + SpeedNewResponseRegionValueUsEast1 SpeedNewResponseRegionValue = "us-east1" + SpeedNewResponseRegionValueUsEast4 SpeedNewResponseRegionValue = "us-east4" + SpeedNewResponseRegionValueUsSouth1 SpeedNewResponseRegionValue = "us-south1" + SpeedNewResponseRegionValueUsWest1 SpeedNewResponseRegionValue = "us-west1" +) + +// The frequency of the test. +type SpeedNewResponseScheduleFrequency string + +const ( + SpeedNewResponseScheduleFrequencyDaily SpeedNewResponseScheduleFrequency = "DAILY" + SpeedNewResponseScheduleFrequencyWeekly SpeedNewResponseScheduleFrequency = "WEEKLY" +) + +type SpeedDeleteResponse struct { + // Number of items affected. + Count float64 `json:"count"` + JSON speedDeleteResponseJSON `json:"-"` +} + +// speedDeleteResponseJSON contains the JSON metadata for the struct +// [SpeedDeleteResponse] +type speedDeleteResponseJSON struct { + Count apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The test schedule. +type SpeedScheduleGetResponse struct { + // The frequency of the test. + Frequency SpeedScheduleGetResponseFrequency `json:"frequency"` + // A test region. + Region SpeedScheduleGetResponseRegion `json:"region"` + // A URL. + URL string `json:"url"` + JSON speedScheduleGetResponseJSON `json:"-"` +} + +// speedScheduleGetResponseJSON contains the JSON metadata for the struct +// [SpeedScheduleGetResponse] +type speedScheduleGetResponseJSON struct { + Frequency apijson.Field + Region apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The frequency of the test. +type SpeedScheduleGetResponseFrequency string + +const ( + SpeedScheduleGetResponseFrequencyDaily SpeedScheduleGetResponseFrequency = "DAILY" + SpeedScheduleGetResponseFrequencyWeekly SpeedScheduleGetResponseFrequency = "WEEKLY" +) + +// A test region. +type SpeedScheduleGetResponseRegion string + +const ( + SpeedScheduleGetResponseRegionAsiaEast1 SpeedScheduleGetResponseRegion = "asia-east1" + SpeedScheduleGetResponseRegionAsiaNortheast1 SpeedScheduleGetResponseRegion = "asia-northeast1" + SpeedScheduleGetResponseRegionAsiaNortheast2 SpeedScheduleGetResponseRegion = "asia-northeast2" + SpeedScheduleGetResponseRegionAsiaSouth1 SpeedScheduleGetResponseRegion = "asia-south1" + SpeedScheduleGetResponseRegionAsiaSoutheast1 SpeedScheduleGetResponseRegion = "asia-southeast1" + SpeedScheduleGetResponseRegionAustraliaSoutheast1 SpeedScheduleGetResponseRegion = "australia-southeast1" + SpeedScheduleGetResponseRegionEuropeNorth1 SpeedScheduleGetResponseRegion = "europe-north1" + SpeedScheduleGetResponseRegionEuropeSouthwest1 SpeedScheduleGetResponseRegion = "europe-southwest1" + SpeedScheduleGetResponseRegionEuropeWest1 SpeedScheduleGetResponseRegion = "europe-west1" + SpeedScheduleGetResponseRegionEuropeWest2 SpeedScheduleGetResponseRegion = "europe-west2" + SpeedScheduleGetResponseRegionEuropeWest3 SpeedScheduleGetResponseRegion = "europe-west3" + SpeedScheduleGetResponseRegionEuropeWest4 SpeedScheduleGetResponseRegion = "europe-west4" + SpeedScheduleGetResponseRegionEuropeWest8 SpeedScheduleGetResponseRegion = "europe-west8" + SpeedScheduleGetResponseRegionEuropeWest9 SpeedScheduleGetResponseRegion = "europe-west9" + SpeedScheduleGetResponseRegionMeWest1 SpeedScheduleGetResponseRegion = "me-west1" + SpeedScheduleGetResponseRegionSouthamericaEast1 SpeedScheduleGetResponseRegion = "southamerica-east1" + SpeedScheduleGetResponseRegionUsCentral1 SpeedScheduleGetResponseRegion = "us-central1" + SpeedScheduleGetResponseRegionUsEast1 SpeedScheduleGetResponseRegion = "us-east1" + SpeedScheduleGetResponseRegionUsEast4 SpeedScheduleGetResponseRegion = "us-east4" + SpeedScheduleGetResponseRegionUsSouth1 SpeedScheduleGetResponseRegion = "us-south1" + SpeedScheduleGetResponseRegionUsWest1 SpeedScheduleGetResponseRegion = "us-west1" +) + +type SpeedTestsGetResponse struct { + // UUID + ID string `json:"id"` + Date time.Time `json:"date" format:"date-time"` + // The Lighthouse report. + DesktopReport SpeedTestsGetResponseDesktopReport `json:"desktopReport"` + // The Lighthouse report. + MobileReport SpeedTestsGetResponseMobileReport `json:"mobileReport"` + // A test region with a label. + Region SpeedTestsGetResponseRegion `json:"region"` + // The frequency of the test. + ScheduleFrequency SpeedTestsGetResponseScheduleFrequency `json:"scheduleFrequency"` + // A URL. + URL string `json:"url"` + JSON speedTestsGetResponseJSON `json:"-"` +} + +// speedTestsGetResponseJSON contains the JSON metadata for the struct +// [SpeedTestsGetResponse] +type speedTestsGetResponseJSON struct { + ID apijson.Field + Date apijson.Field + DesktopReport apijson.Field + MobileReport apijson.Field + Region apijson.Field + ScheduleFrequency apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The Lighthouse report. +type SpeedTestsGetResponseDesktopReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedTestsGetResponseDesktopReportDeviceType `json:"deviceType"` + Error SpeedTestsGetResponseDesktopReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedTestsGetResponseDesktopReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedTestsGetResponseDesktopReportJSON `json:"-"` +} + +// speedTestsGetResponseDesktopReportJSON contains the JSON metadata for the struct +// [SpeedTestsGetResponseDesktopReport] +type speedTestsGetResponseDesktopReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseDesktopReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedTestsGetResponseDesktopReportDeviceType string + +const ( + SpeedTestsGetResponseDesktopReportDeviceTypeDesktop SpeedTestsGetResponseDesktopReportDeviceType = "DESKTOP" + SpeedTestsGetResponseDesktopReportDeviceTypeMobile SpeedTestsGetResponseDesktopReportDeviceType = "MOBILE" +) + +type SpeedTestsGetResponseDesktopReportError struct { + // The error code of the Lighthouse result. + Code SpeedTestsGetResponseDesktopReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedTestsGetResponseDesktopReportErrorJSON `json:"-"` +} + +// speedTestsGetResponseDesktopReportErrorJSON contains the JSON metadata for the +// struct [SpeedTestsGetResponseDesktopReportError] +type speedTestsGetResponseDesktopReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedTestsGetResponseDesktopReportErrorCode string + +const ( + SpeedTestsGetResponseDesktopReportErrorCodeNotReachable SpeedTestsGetResponseDesktopReportErrorCode = "NOT_REACHABLE" + SpeedTestsGetResponseDesktopReportErrorCodeDNSFailure SpeedTestsGetResponseDesktopReportErrorCode = "DNS_FAILURE" + SpeedTestsGetResponseDesktopReportErrorCodeNotHTML SpeedTestsGetResponseDesktopReportErrorCode = "NOT_HTML" + SpeedTestsGetResponseDesktopReportErrorCodeLighthouseTimeout SpeedTestsGetResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedTestsGetResponseDesktopReportErrorCodeUnknown SpeedTestsGetResponseDesktopReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedTestsGetResponseDesktopReportState string + +const ( + SpeedTestsGetResponseDesktopReportStateRunning SpeedTestsGetResponseDesktopReportState = "RUNNING" + SpeedTestsGetResponseDesktopReportStateComplete SpeedTestsGetResponseDesktopReportState = "COMPLETE" + SpeedTestsGetResponseDesktopReportStateFailed SpeedTestsGetResponseDesktopReportState = "FAILED" +) + +// The Lighthouse report. +type SpeedTestsGetResponseMobileReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedTestsGetResponseMobileReportDeviceType `json:"deviceType"` + Error SpeedTestsGetResponseMobileReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedTestsGetResponseMobileReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedTestsGetResponseMobileReportJSON `json:"-"` +} + +// speedTestsGetResponseMobileReportJSON contains the JSON metadata for the struct +// [SpeedTestsGetResponseMobileReport] +type speedTestsGetResponseMobileReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseMobileReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedTestsGetResponseMobileReportDeviceType string + +const ( + SpeedTestsGetResponseMobileReportDeviceTypeDesktop SpeedTestsGetResponseMobileReportDeviceType = "DESKTOP" + SpeedTestsGetResponseMobileReportDeviceTypeMobile SpeedTestsGetResponseMobileReportDeviceType = "MOBILE" +) + +type SpeedTestsGetResponseMobileReportError struct { + // The error code of the Lighthouse result. + Code SpeedTestsGetResponseMobileReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedTestsGetResponseMobileReportErrorJSON `json:"-"` +} + +// speedTestsGetResponseMobileReportErrorJSON contains the JSON metadata for the +// struct [SpeedTestsGetResponseMobileReportError] +type speedTestsGetResponseMobileReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseMobileReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedTestsGetResponseMobileReportErrorCode string + +const ( + SpeedTestsGetResponseMobileReportErrorCodeNotReachable SpeedTestsGetResponseMobileReportErrorCode = "NOT_REACHABLE" + SpeedTestsGetResponseMobileReportErrorCodeDNSFailure SpeedTestsGetResponseMobileReportErrorCode = "DNS_FAILURE" + SpeedTestsGetResponseMobileReportErrorCodeNotHTML SpeedTestsGetResponseMobileReportErrorCode = "NOT_HTML" + SpeedTestsGetResponseMobileReportErrorCodeLighthouseTimeout SpeedTestsGetResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedTestsGetResponseMobileReportErrorCodeUnknown SpeedTestsGetResponseMobileReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedTestsGetResponseMobileReportState string + +const ( + SpeedTestsGetResponseMobileReportStateRunning SpeedTestsGetResponseMobileReportState = "RUNNING" + SpeedTestsGetResponseMobileReportStateComplete SpeedTestsGetResponseMobileReportState = "COMPLETE" + SpeedTestsGetResponseMobileReportStateFailed SpeedTestsGetResponseMobileReportState = "FAILED" +) + +// A test region with a label. +type SpeedTestsGetResponseRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedTestsGetResponseRegionValue `json:"value"` + JSON speedTestsGetResponseRegionJSON `json:"-"` +} + +// speedTestsGetResponseRegionJSON contains the JSON metadata for the struct +// [SpeedTestsGetResponseRegion] +type speedTestsGetResponseRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedTestsGetResponseRegionValue string + +const ( + SpeedTestsGetResponseRegionValueAsiaEast1 SpeedTestsGetResponseRegionValue = "asia-east1" + SpeedTestsGetResponseRegionValueAsiaNortheast1 SpeedTestsGetResponseRegionValue = "asia-northeast1" + SpeedTestsGetResponseRegionValueAsiaNortheast2 SpeedTestsGetResponseRegionValue = "asia-northeast2" + SpeedTestsGetResponseRegionValueAsiaSouth1 SpeedTestsGetResponseRegionValue = "asia-south1" + SpeedTestsGetResponseRegionValueAsiaSoutheast1 SpeedTestsGetResponseRegionValue = "asia-southeast1" + SpeedTestsGetResponseRegionValueAustraliaSoutheast1 SpeedTestsGetResponseRegionValue = "australia-southeast1" + SpeedTestsGetResponseRegionValueEuropeNorth1 SpeedTestsGetResponseRegionValue = "europe-north1" + SpeedTestsGetResponseRegionValueEuropeSouthwest1 SpeedTestsGetResponseRegionValue = "europe-southwest1" + SpeedTestsGetResponseRegionValueEuropeWest1 SpeedTestsGetResponseRegionValue = "europe-west1" + SpeedTestsGetResponseRegionValueEuropeWest2 SpeedTestsGetResponseRegionValue = "europe-west2" + SpeedTestsGetResponseRegionValueEuropeWest3 SpeedTestsGetResponseRegionValue = "europe-west3" + SpeedTestsGetResponseRegionValueEuropeWest4 SpeedTestsGetResponseRegionValue = "europe-west4" + SpeedTestsGetResponseRegionValueEuropeWest8 SpeedTestsGetResponseRegionValue = "europe-west8" + SpeedTestsGetResponseRegionValueEuropeWest9 SpeedTestsGetResponseRegionValue = "europe-west9" + SpeedTestsGetResponseRegionValueMeWest1 SpeedTestsGetResponseRegionValue = "me-west1" + SpeedTestsGetResponseRegionValueSouthamericaEast1 SpeedTestsGetResponseRegionValue = "southamerica-east1" + SpeedTestsGetResponseRegionValueUsCentral1 SpeedTestsGetResponseRegionValue = "us-central1" + SpeedTestsGetResponseRegionValueUsEast1 SpeedTestsGetResponseRegionValue = "us-east1" + SpeedTestsGetResponseRegionValueUsEast4 SpeedTestsGetResponseRegionValue = "us-east4" + SpeedTestsGetResponseRegionValueUsSouth1 SpeedTestsGetResponseRegionValue = "us-south1" + SpeedTestsGetResponseRegionValueUsWest1 SpeedTestsGetResponseRegionValue = "us-west1" +) + +// The frequency of the test. +type SpeedTestsGetResponseScheduleFrequency string + +const ( + SpeedTestsGetResponseScheduleFrequencyDaily SpeedTestsGetResponseScheduleFrequency = "DAILY" + SpeedTestsGetResponseScheduleFrequencyWeekly SpeedTestsGetResponseScheduleFrequency = "WEEKLY" +) + +type SpeedTrendsListResponse struct { + // Cumulative Layout Shift trend. + Cls []float64 `json:"cls"` + // First Contentful Paint trend. + Fcp []float64 `json:"fcp"` + // Largest Contentful Paint trend. + Lcp []float64 `json:"lcp"` + // The Lighthouse score trend. + PerformanceScore []float64 `json:"performanceScore"` + // Speed Index trend. + Si []float64 `json:"si"` + // Total Blocking Time trend. + Tbt []float64 `json:"tbt"` + // Time To First Byte trend. + Ttfb []float64 `json:"ttfb"` + // Time To Interactive trend. + Tti []float64 `json:"tti"` + JSON speedTrendsListResponseJSON `json:"-"` +} + +// speedTrendsListResponseJSON contains the JSON metadata for the struct +// [SpeedTrendsListResponse] +type speedTrendsListResponseJSON struct { + Cls apijson.Field + Fcp apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTrendsListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedNewParams struct { + // A test region. + Region param.Field[SpeedNewParamsRegion] `json:"region"` +} + +func (r SpeedNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// A test region. +type SpeedNewParamsRegion string + +const ( + SpeedNewParamsRegionAsiaEast1 SpeedNewParamsRegion = "asia-east1" + SpeedNewParamsRegionAsiaNortheast1 SpeedNewParamsRegion = "asia-northeast1" + SpeedNewParamsRegionAsiaNortheast2 SpeedNewParamsRegion = "asia-northeast2" + SpeedNewParamsRegionAsiaSouth1 SpeedNewParamsRegion = "asia-south1" + SpeedNewParamsRegionAsiaSoutheast1 SpeedNewParamsRegion = "asia-southeast1" + SpeedNewParamsRegionAustraliaSoutheast1 SpeedNewParamsRegion = "australia-southeast1" + SpeedNewParamsRegionEuropeNorth1 SpeedNewParamsRegion = "europe-north1" + SpeedNewParamsRegionEuropeSouthwest1 SpeedNewParamsRegion = "europe-southwest1" + SpeedNewParamsRegionEuropeWest1 SpeedNewParamsRegion = "europe-west1" + SpeedNewParamsRegionEuropeWest2 SpeedNewParamsRegion = "europe-west2" + SpeedNewParamsRegionEuropeWest3 SpeedNewParamsRegion = "europe-west3" + SpeedNewParamsRegionEuropeWest4 SpeedNewParamsRegion = "europe-west4" + SpeedNewParamsRegionEuropeWest8 SpeedNewParamsRegion = "europe-west8" + SpeedNewParamsRegionEuropeWest9 SpeedNewParamsRegion = "europe-west9" + SpeedNewParamsRegionMeWest1 SpeedNewParamsRegion = "me-west1" + SpeedNewParamsRegionSouthamericaEast1 SpeedNewParamsRegion = "southamerica-east1" + SpeedNewParamsRegionUsCentral1 SpeedNewParamsRegion = "us-central1" + SpeedNewParamsRegionUsEast1 SpeedNewParamsRegion = "us-east1" + SpeedNewParamsRegionUsEast4 SpeedNewParamsRegion = "us-east4" + SpeedNewParamsRegionUsSouth1 SpeedNewParamsRegion = "us-south1" + SpeedNewParamsRegionUsWest1 SpeedNewParamsRegion = "us-west1" +) + +type SpeedNewResponseEnvelope struct { + Result SpeedNewResponse `json:"result"` + JSON speedNewResponseEnvelopeJSON `json:"-"` +} + +// speedNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedNewResponseEnvelope] +type speedNewResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedDeleteParams struct { + // A test region. + Region param.Field[SpeedDeleteParamsRegion] `query:"region"` +} + +// URLQuery serializes [SpeedDeleteParams]'s query parameters as `url.Values`. +func (r SpeedDeleteParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// A test region. +type SpeedDeleteParamsRegion string + +const ( + SpeedDeleteParamsRegionAsiaEast1 SpeedDeleteParamsRegion = "asia-east1" + SpeedDeleteParamsRegionAsiaNortheast1 SpeedDeleteParamsRegion = "asia-northeast1" + SpeedDeleteParamsRegionAsiaNortheast2 SpeedDeleteParamsRegion = "asia-northeast2" + SpeedDeleteParamsRegionAsiaSouth1 SpeedDeleteParamsRegion = "asia-south1" + SpeedDeleteParamsRegionAsiaSoutheast1 SpeedDeleteParamsRegion = "asia-southeast1" + SpeedDeleteParamsRegionAustraliaSoutheast1 SpeedDeleteParamsRegion = "australia-southeast1" + SpeedDeleteParamsRegionEuropeNorth1 SpeedDeleteParamsRegion = "europe-north1" + SpeedDeleteParamsRegionEuropeSouthwest1 SpeedDeleteParamsRegion = "europe-southwest1" + SpeedDeleteParamsRegionEuropeWest1 SpeedDeleteParamsRegion = "europe-west1" + SpeedDeleteParamsRegionEuropeWest2 SpeedDeleteParamsRegion = "europe-west2" + SpeedDeleteParamsRegionEuropeWest3 SpeedDeleteParamsRegion = "europe-west3" + SpeedDeleteParamsRegionEuropeWest4 SpeedDeleteParamsRegion = "europe-west4" + SpeedDeleteParamsRegionEuropeWest8 SpeedDeleteParamsRegion = "europe-west8" + SpeedDeleteParamsRegionEuropeWest9 SpeedDeleteParamsRegion = "europe-west9" + SpeedDeleteParamsRegionMeWest1 SpeedDeleteParamsRegion = "me-west1" + SpeedDeleteParamsRegionSouthamericaEast1 SpeedDeleteParamsRegion = "southamerica-east1" + SpeedDeleteParamsRegionUsCentral1 SpeedDeleteParamsRegion = "us-central1" + SpeedDeleteParamsRegionUsEast1 SpeedDeleteParamsRegion = "us-east1" + SpeedDeleteParamsRegionUsEast4 SpeedDeleteParamsRegion = "us-east4" + SpeedDeleteParamsRegionUsSouth1 SpeedDeleteParamsRegion = "us-south1" + SpeedDeleteParamsRegionUsWest1 SpeedDeleteParamsRegion = "us-west1" +) + +type SpeedDeleteResponseEnvelope struct { + Result SpeedDeleteResponse `json:"result"` + JSON speedDeleteResponseEnvelopeJSON `json:"-"` +} + +// speedDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedDeleteResponseEnvelope] +type speedDeleteResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedScheduleGetParams struct { + // A test region. + Region param.Field[SpeedScheduleGetParamsRegion] `query:"region"` +} + +// URLQuery serializes [SpeedScheduleGetParams]'s query parameters as `url.Values`. +func (r SpeedScheduleGetParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// A test region. +type SpeedScheduleGetParamsRegion string + +const ( + SpeedScheduleGetParamsRegionAsiaEast1 SpeedScheduleGetParamsRegion = "asia-east1" + SpeedScheduleGetParamsRegionAsiaNortheast1 SpeedScheduleGetParamsRegion = "asia-northeast1" + SpeedScheduleGetParamsRegionAsiaNortheast2 SpeedScheduleGetParamsRegion = "asia-northeast2" + SpeedScheduleGetParamsRegionAsiaSouth1 SpeedScheduleGetParamsRegion = "asia-south1" + SpeedScheduleGetParamsRegionAsiaSoutheast1 SpeedScheduleGetParamsRegion = "asia-southeast1" + SpeedScheduleGetParamsRegionAustraliaSoutheast1 SpeedScheduleGetParamsRegion = "australia-southeast1" + SpeedScheduleGetParamsRegionEuropeNorth1 SpeedScheduleGetParamsRegion = "europe-north1" + SpeedScheduleGetParamsRegionEuropeSouthwest1 SpeedScheduleGetParamsRegion = "europe-southwest1" + SpeedScheduleGetParamsRegionEuropeWest1 SpeedScheduleGetParamsRegion = "europe-west1" + SpeedScheduleGetParamsRegionEuropeWest2 SpeedScheduleGetParamsRegion = "europe-west2" + SpeedScheduleGetParamsRegionEuropeWest3 SpeedScheduleGetParamsRegion = "europe-west3" + SpeedScheduleGetParamsRegionEuropeWest4 SpeedScheduleGetParamsRegion = "europe-west4" + SpeedScheduleGetParamsRegionEuropeWest8 SpeedScheduleGetParamsRegion = "europe-west8" + SpeedScheduleGetParamsRegionEuropeWest9 SpeedScheduleGetParamsRegion = "europe-west9" + SpeedScheduleGetParamsRegionMeWest1 SpeedScheduleGetParamsRegion = "me-west1" + SpeedScheduleGetParamsRegionSouthamericaEast1 SpeedScheduleGetParamsRegion = "southamerica-east1" + SpeedScheduleGetParamsRegionUsCentral1 SpeedScheduleGetParamsRegion = "us-central1" + SpeedScheduleGetParamsRegionUsEast1 SpeedScheduleGetParamsRegion = "us-east1" + SpeedScheduleGetParamsRegionUsEast4 SpeedScheduleGetParamsRegion = "us-east4" + SpeedScheduleGetParamsRegionUsSouth1 SpeedScheduleGetParamsRegion = "us-south1" + SpeedScheduleGetParamsRegionUsWest1 SpeedScheduleGetParamsRegion = "us-west1" +) + +type SpeedScheduleGetResponseEnvelope struct { + // The test schedule. + Result SpeedScheduleGetResponse `json:"result"` + JSON speedScheduleGetResponseEnvelopeJSON `json:"-"` +} + +// speedScheduleGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedScheduleGetResponseEnvelope] +type speedScheduleGetResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTestsGetResponseEnvelope struct { + Result SpeedTestsGetResponse `json:"result"` + JSON speedTestsGetResponseEnvelopeJSON `json:"-"` +} + +// speedTestsGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedTestsGetResponseEnvelope] +type speedTestsGetResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestsGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTrendsListParams struct { + // The type of device. + DeviceType param.Field[SpeedTrendsListParamsDeviceType] `query:"deviceType,required"` + // A comma-separated list of metrics to include in the results. + Metrics param.Field[string] `query:"metrics,required"` + // A test region. + Region param.Field[SpeedTrendsListParamsRegion] `query:"region,required"` + // The timezone of the start and end timestamps. + Tz param.Field[string] `query:"tz,required"` +} + +// URLQuery serializes [SpeedTrendsListParams]'s query parameters as `url.Values`. +func (r SpeedTrendsListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// The type of device. +type SpeedTrendsListParamsDeviceType string + +const ( + SpeedTrendsListParamsDeviceTypeDesktop SpeedTrendsListParamsDeviceType = "DESKTOP" + SpeedTrendsListParamsDeviceTypeMobile SpeedTrendsListParamsDeviceType = "MOBILE" +) + +// A test region. +type SpeedTrendsListParamsRegion string + +const ( + SpeedTrendsListParamsRegionAsiaEast1 SpeedTrendsListParamsRegion = "asia-east1" + SpeedTrendsListParamsRegionAsiaNortheast1 SpeedTrendsListParamsRegion = "asia-northeast1" + SpeedTrendsListParamsRegionAsiaNortheast2 SpeedTrendsListParamsRegion = "asia-northeast2" + SpeedTrendsListParamsRegionAsiaSouth1 SpeedTrendsListParamsRegion = "asia-south1" + SpeedTrendsListParamsRegionAsiaSoutheast1 SpeedTrendsListParamsRegion = "asia-southeast1" + SpeedTrendsListParamsRegionAustraliaSoutheast1 SpeedTrendsListParamsRegion = "australia-southeast1" + SpeedTrendsListParamsRegionEuropeNorth1 SpeedTrendsListParamsRegion = "europe-north1" + SpeedTrendsListParamsRegionEuropeSouthwest1 SpeedTrendsListParamsRegion = "europe-southwest1" + SpeedTrendsListParamsRegionEuropeWest1 SpeedTrendsListParamsRegion = "europe-west1" + SpeedTrendsListParamsRegionEuropeWest2 SpeedTrendsListParamsRegion = "europe-west2" + SpeedTrendsListParamsRegionEuropeWest3 SpeedTrendsListParamsRegion = "europe-west3" + SpeedTrendsListParamsRegionEuropeWest4 SpeedTrendsListParamsRegion = "europe-west4" + SpeedTrendsListParamsRegionEuropeWest8 SpeedTrendsListParamsRegion = "europe-west8" + SpeedTrendsListParamsRegionEuropeWest9 SpeedTrendsListParamsRegion = "europe-west9" + SpeedTrendsListParamsRegionMeWest1 SpeedTrendsListParamsRegion = "me-west1" + SpeedTrendsListParamsRegionSouthamericaEast1 SpeedTrendsListParamsRegion = "southamerica-east1" + SpeedTrendsListParamsRegionUsCentral1 SpeedTrendsListParamsRegion = "us-central1" + SpeedTrendsListParamsRegionUsEast1 SpeedTrendsListParamsRegion = "us-east1" + SpeedTrendsListParamsRegionUsEast4 SpeedTrendsListParamsRegion = "us-east4" + SpeedTrendsListParamsRegionUsSouth1 SpeedTrendsListParamsRegion = "us-south1" + SpeedTrendsListParamsRegionUsWest1 SpeedTrendsListParamsRegion = "us-west1" +) + +type SpeedTrendsListResponseEnvelope struct { + Result SpeedTrendsListResponse `json:"result"` + JSON speedTrendsListResponseEnvelopeJSON `json:"-"` +} + +// speedTrendsListResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedTrendsListResponseEnvelope] +type speedTrendsListResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTrendsListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/cfdtunnel_test.go b/speed_test.go similarity index 67% rename from cfdtunnel_test.go rename to speed_test.go index cdb0a4c95a3..8210c38ef27 100644 --- a/cfdtunnel_test.go +++ b/speed_test.go @@ -7,14 +7,13 @@ import ( "errors" "os" "testing" - "time" "github.com/cloudflare/cloudflare-sdk-go" "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelUpdateWithOptionalParams(t *testing.T) { +func TestSpeedNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,13 +29,12 @@ func TestCfdTunnelUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Update( + _, err := client.Speed.New( context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.CfdTunnelUpdateParams{ - Name: cloudflare.F("blog"), - TunnelSecret: cloudflare.F("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="), + "023e105f4ecef8ad9ca31a8372d0c353", + "example.com", + cloudflare.SpeedNewParams{ + Region: cloudflare.F(cloudflare.SpeedNewParamsRegionUsCentral1), }, ) if err != nil { @@ -48,7 +46,7 @@ func TestCfdTunnelUpdateWithOptionalParams(t *testing.T) { } } -func TestCfdTunnelDelete(t *testing.T) { +func TestSpeedDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,12 +62,12 @@ func TestCfdTunnelDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Delete( + _, err := client.Speed.Delete( context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.CfdTunnelDeleteParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + "023e105f4ecef8ad9ca31a8372d0c353", + "example.com", + cloudflare.SpeedDeleteParams{ + Region: cloudflare.F(cloudflare.SpeedDeleteParamsRegionUsCentral1), }, ) if err != nil { @@ -81,7 +79,7 @@ func TestCfdTunnelDelete(t *testing.T) { } } -func TestCfdTunnelCloudflareTunnelNewACloudflareTunnelWithOptionalParams(t *testing.T) { +func TestSpeedScheduleGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -97,13 +95,12 @@ func TestCfdTunnelCloudflareTunnelNewACloudflareTunnelWithOptionalParams(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.CloudflareTunnelNewACloudflareTunnel( + _, err := client.Speed.ScheduleGet( context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.CfdTunnelCloudflareTunnelNewACloudflareTunnelParams{ - Name: cloudflare.F("blog"), - ConfigSrc: cloudflare.F(cloudflare.CfdTunnelCloudflareTunnelNewACloudflareTunnelParamsConfigSrcCloudflare), - TunnelSecret: cloudflare.F("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="), + "023e105f4ecef8ad9ca31a8372d0c353", + "example.com", + cloudflare.SpeedScheduleGetParams{ + Region: cloudflare.F(cloudflare.SpeedScheduleGetParamsRegionUsCentral1), }, ) if err != nil { @@ -115,7 +112,7 @@ func TestCfdTunnelCloudflareTunnelNewACloudflareTunnelWithOptionalParams(t *test } } -func TestCfdTunnelCloudflareTunnelListCloudflareTunnelsWithOptionalParams(t *testing.T) { +func TestSpeedTestsGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -131,20 +128,11 @@ func TestCfdTunnelCloudflareTunnelListCloudflareTunnelsWithOptionalParams(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.CloudflareTunnelListCloudflareTunnels( + _, err := client.Speed.TestsGet( context.TODO(), - "699d98642c564d2e855e9661899b7252", - cloudflare.CfdTunnelCloudflareTunnelListCloudflareTunnelsParams{ - ExcludePrefix: cloudflare.F("vpc1-"), - ExistedAt: cloudflare.F(time.Now()), - IncludePrefix: cloudflare.F("vpc1-"), - IsDeleted: cloudflare.F(true), - Name: cloudflare.F("blog"), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(1.000000), - WasActiveAt: cloudflare.F(time.Now()), - WasInactiveAt: cloudflare.F(time.Now()), - }, + "023e105f4ecef8ad9ca31a8372d0c353", + "example.com", + "string", ) if err != nil { var apierr *cloudflare.Error @@ -155,7 +143,7 @@ func TestCfdTunnelCloudflareTunnelListCloudflareTunnelsWithOptionalParams(t *tes } } -func TestCfdTunnelGet(t *testing.T) { +func TestSpeedTrendsList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -171,10 +159,16 @@ func TestCfdTunnelGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Get( + _, err := client.Speed.TrendsList( context.TODO(), - "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + "023e105f4ecef8ad9ca31a8372d0c353", + "example.com", + cloudflare.SpeedTrendsListParams{ + DeviceType: cloudflare.F(cloudflare.SpeedTrendsListParamsDeviceTypeDesktop), + Metrics: cloudflare.F("performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls"), + Region: cloudflare.F(cloudflare.SpeedTrendsListParamsRegionUsCentral1), + Tz: cloudflare.F("string"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/speedapi.go b/speedapi.go deleted file mode 100644 index f7d33205b66..00000000000 --- a/speedapi.go +++ /dev/null @@ -1,1835 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// SpeedAPIService contains methods and other services that help with interacting -// with the cloudflare API. Note, unlike clients, this service does not read -// variables from the environment automatically. You should not instantiate this -// service directly, and instead use the [NewSpeedAPIService] method instead. -type SpeedAPIService struct { - Options []option.RequestOption - Schedule *SpeedAPIScheduleService -} - -// NewSpeedAPIService generates a new service that applies the given options to -// each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewSpeedAPIService(opts ...option.RequestOption) (r *SpeedAPIService) { - r = &SpeedAPIService{} - r.Options = opts - r.Schedule = NewSpeedAPIScheduleService(opts...) - return -} - -// Retrieves quota for all plans, as well as the current zone quota. -func (r *SpeedAPIService) AvailabilitiesList(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SpeedAPIAvailabilitiesListResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPIAvailabilitiesListResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/availabilities", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists all webpages which have been tested. -func (r *SpeedAPIService) PagesList(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]SpeedAPIPagesListResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPIPagesListResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/pages", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes a scheduled test for a page. -func (r *SpeedAPIService) ScheduleDelete(ctx context.Context, zoneID string, url string, body SpeedAPIScheduleDeleteParams, opts ...option.RequestOption) (res *SpeedAPIScheduleDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPIScheduleDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Retrieves the test schedule for a page in a specific region. -func (r *SpeedAPIService) ScheduleGet(ctx context.Context, zoneID string, url string, query SpeedAPIScheduleGetParams, opts ...option.RequestOption) (res *SpeedAPIScheduleGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPIScheduleGetResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Starts a test for a specific webpage, in a specific region. -func (r *SpeedAPIService) TestsNew(ctx context.Context, zoneID string, url string, body SpeedAPITestsNewParams, opts ...option.RequestOption) (res *SpeedAPITestsNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPITestsNewResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes all tests for a specific webpage from a specific region. Deleted tests -// are still counted as part of the quota. -func (r *SpeedAPIService) TestsDelete(ctx context.Context, zoneID string, url string, body SpeedAPITestsDeleteParams, opts ...option.RequestOption) (res *SpeedAPITestsDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPITestsDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Retrieves the result of a specific test. -func (r *SpeedAPIService) TestsGet(ctx context.Context, zoneID string, url string, testID string, opts ...option.RequestOption) (res *SpeedAPITestsGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPITestsGetResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests/%s", zoneID, url, testID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Test history (list of tests) for a specific webpage. -func (r *SpeedAPIService) TestsList(ctx context.Context, zoneID string, url string, query SpeedAPITestsListParams, opts ...option.RequestOption) (res *SpeedAPITestsListResponse, err error) { - opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) - return -} - -// Lists the core web vital metrics trend over time for a specific page. -func (r *SpeedAPIService) TrendsList(ctx context.Context, zoneID string, url string, query SpeedAPITrendsListParams, opts ...option.RequestOption) (res *SpeedAPITrendsListResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPITrendsListResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/pages/%s/trend", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type SpeedAPIAvailabilitiesListResponse struct { - Quota SpeedAPIAvailabilitiesListResponseQuota `json:"quota"` - Regions []SpeedAPIAvailabilitiesListResponseRegion `json:"regions"` - RegionsPerPlan interface{} `json:"regionsPerPlan"` - JSON speedAPIAvailabilitiesListResponseJSON `json:"-"` -} - -// speedAPIAvailabilitiesListResponseJSON contains the JSON metadata for the struct -// [SpeedAPIAvailabilitiesListResponse] -type speedAPIAvailabilitiesListResponseJSON struct { - Quota apijson.Field - Regions apijson.Field - RegionsPerPlan apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIAvailabilitiesListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPIAvailabilitiesListResponseQuota struct { - // Cloudflare plan. - Plan string `json:"plan"` - // The number of tests available per plan. - QuotasPerPlan map[string]float64 `json:"quotasPerPlan"` - // The number of remaining schedules available. - RemainingSchedules float64 `json:"remainingSchedules"` - // The number of remaining tests available. - RemainingTests float64 `json:"remainingTests"` - // The number of schedules available per plan. - ScheduleQuotasPerPlan map[string]float64 `json:"scheduleQuotasPerPlan"` - JSON speedAPIAvailabilitiesListResponseQuotaJSON `json:"-"` -} - -// speedAPIAvailabilitiesListResponseQuotaJSON contains the JSON metadata for the -// struct [SpeedAPIAvailabilitiesListResponseQuota] -type speedAPIAvailabilitiesListResponseQuotaJSON struct { - Plan apijson.Field - QuotasPerPlan apijson.Field - RemainingSchedules apijson.Field - RemainingTests apijson.Field - ScheduleQuotasPerPlan apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIAvailabilitiesListResponseQuota) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region with a label. -type SpeedAPIAvailabilitiesListResponseRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPIAvailabilitiesListResponseRegionsValue `json:"value"` - JSON speedAPIAvailabilitiesListResponseRegionJSON `json:"-"` -} - -// speedAPIAvailabilitiesListResponseRegionJSON contains the JSON metadata for the -// struct [SpeedAPIAvailabilitiesListResponseRegion] -type speedAPIAvailabilitiesListResponseRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIAvailabilitiesListResponseRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPIAvailabilitiesListResponseRegionsValue string - -const ( - SpeedAPIAvailabilitiesListResponseRegionsValueAsiaEast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "asia-east1" - SpeedAPIAvailabilitiesListResponseRegionsValueAsiaNortheast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "asia-northeast1" - SpeedAPIAvailabilitiesListResponseRegionsValueAsiaNortheast2 SpeedAPIAvailabilitiesListResponseRegionsValue = "asia-northeast2" - SpeedAPIAvailabilitiesListResponseRegionsValueAsiaSouth1 SpeedAPIAvailabilitiesListResponseRegionsValue = "asia-south1" - SpeedAPIAvailabilitiesListResponseRegionsValueAsiaSoutheast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "asia-southeast1" - SpeedAPIAvailabilitiesListResponseRegionsValueAustraliaSoutheast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "australia-southeast1" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeNorth1 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-north1" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeSouthwest1 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-southwest1" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest1 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west1" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest2 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west2" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest3 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west3" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest4 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west4" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest8 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west8" - SpeedAPIAvailabilitiesListResponseRegionsValueEuropeWest9 SpeedAPIAvailabilitiesListResponseRegionsValue = "europe-west9" - SpeedAPIAvailabilitiesListResponseRegionsValueMeWest1 SpeedAPIAvailabilitiesListResponseRegionsValue = "me-west1" - SpeedAPIAvailabilitiesListResponseRegionsValueSouthamericaEast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "southamerica-east1" - SpeedAPIAvailabilitiesListResponseRegionsValueUsCentral1 SpeedAPIAvailabilitiesListResponseRegionsValue = "us-central1" - SpeedAPIAvailabilitiesListResponseRegionsValueUsEast1 SpeedAPIAvailabilitiesListResponseRegionsValue = "us-east1" - SpeedAPIAvailabilitiesListResponseRegionsValueUsEast4 SpeedAPIAvailabilitiesListResponseRegionsValue = "us-east4" - SpeedAPIAvailabilitiesListResponseRegionsValueUsSouth1 SpeedAPIAvailabilitiesListResponseRegionsValue = "us-south1" - SpeedAPIAvailabilitiesListResponseRegionsValueUsWest1 SpeedAPIAvailabilitiesListResponseRegionsValue = "us-west1" -) - -type SpeedAPIPagesListResponse struct { - // A test region with a label. - Region SpeedAPIPagesListResponseRegion `json:"region"` - // The frequency of the test. - ScheduleFrequency SpeedAPIPagesListResponseScheduleFrequency `json:"scheduleFrequency"` - Tests []SpeedAPIPagesListResponseTest `json:"tests"` - // A URL. - URL string `json:"url"` - JSON speedAPIPagesListResponseJSON `json:"-"` -} - -// speedAPIPagesListResponseJSON contains the JSON metadata for the struct -// [SpeedAPIPagesListResponse] -type speedAPIPagesListResponseJSON struct { - Region apijson.Field - ScheduleFrequency apijson.Field - Tests apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region with a label. -type SpeedAPIPagesListResponseRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPIPagesListResponseRegionValue `json:"value"` - JSON speedAPIPagesListResponseRegionJSON `json:"-"` -} - -// speedAPIPagesListResponseRegionJSON contains the JSON metadata for the struct -// [SpeedAPIPagesListResponseRegion] -type speedAPIPagesListResponseRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPIPagesListResponseRegionValue string - -const ( - SpeedAPIPagesListResponseRegionValueAsiaEast1 SpeedAPIPagesListResponseRegionValue = "asia-east1" - SpeedAPIPagesListResponseRegionValueAsiaNortheast1 SpeedAPIPagesListResponseRegionValue = "asia-northeast1" - SpeedAPIPagesListResponseRegionValueAsiaNortheast2 SpeedAPIPagesListResponseRegionValue = "asia-northeast2" - SpeedAPIPagesListResponseRegionValueAsiaSouth1 SpeedAPIPagesListResponseRegionValue = "asia-south1" - SpeedAPIPagesListResponseRegionValueAsiaSoutheast1 SpeedAPIPagesListResponseRegionValue = "asia-southeast1" - SpeedAPIPagesListResponseRegionValueAustraliaSoutheast1 SpeedAPIPagesListResponseRegionValue = "australia-southeast1" - SpeedAPIPagesListResponseRegionValueEuropeNorth1 SpeedAPIPagesListResponseRegionValue = "europe-north1" - SpeedAPIPagesListResponseRegionValueEuropeSouthwest1 SpeedAPIPagesListResponseRegionValue = "europe-southwest1" - SpeedAPIPagesListResponseRegionValueEuropeWest1 SpeedAPIPagesListResponseRegionValue = "europe-west1" - SpeedAPIPagesListResponseRegionValueEuropeWest2 SpeedAPIPagesListResponseRegionValue = "europe-west2" - SpeedAPIPagesListResponseRegionValueEuropeWest3 SpeedAPIPagesListResponseRegionValue = "europe-west3" - SpeedAPIPagesListResponseRegionValueEuropeWest4 SpeedAPIPagesListResponseRegionValue = "europe-west4" - SpeedAPIPagesListResponseRegionValueEuropeWest8 SpeedAPIPagesListResponseRegionValue = "europe-west8" - SpeedAPIPagesListResponseRegionValueEuropeWest9 SpeedAPIPagesListResponseRegionValue = "europe-west9" - SpeedAPIPagesListResponseRegionValueMeWest1 SpeedAPIPagesListResponseRegionValue = "me-west1" - SpeedAPIPagesListResponseRegionValueSouthamericaEast1 SpeedAPIPagesListResponseRegionValue = "southamerica-east1" - SpeedAPIPagesListResponseRegionValueUsCentral1 SpeedAPIPagesListResponseRegionValue = "us-central1" - SpeedAPIPagesListResponseRegionValueUsEast1 SpeedAPIPagesListResponseRegionValue = "us-east1" - SpeedAPIPagesListResponseRegionValueUsEast4 SpeedAPIPagesListResponseRegionValue = "us-east4" - SpeedAPIPagesListResponseRegionValueUsSouth1 SpeedAPIPagesListResponseRegionValue = "us-south1" - SpeedAPIPagesListResponseRegionValueUsWest1 SpeedAPIPagesListResponseRegionValue = "us-west1" -) - -// The frequency of the test. -type SpeedAPIPagesListResponseScheduleFrequency string - -const ( - SpeedAPIPagesListResponseScheduleFrequencyDaily SpeedAPIPagesListResponseScheduleFrequency = "DAILY" - SpeedAPIPagesListResponseScheduleFrequencyWeekly SpeedAPIPagesListResponseScheduleFrequency = "WEEKLY" -) - -type SpeedAPIPagesListResponseTest struct { - // UUID - ID string `json:"id"` - Date time.Time `json:"date" format:"date-time"` - // The Lighthouse report. - DesktopReport SpeedAPIPagesListResponseTestsDesktopReport `json:"desktopReport"` - // The Lighthouse report. - MobileReport SpeedAPIPagesListResponseTestsMobileReport `json:"mobileReport"` - // A test region with a label. - Region SpeedAPIPagesListResponseTestsRegion `json:"region"` - // The frequency of the test. - ScheduleFrequency SpeedAPIPagesListResponseTestsScheduleFrequency `json:"scheduleFrequency"` - // A URL. - URL string `json:"url"` - JSON speedAPIPagesListResponseTestJSON `json:"-"` -} - -// speedAPIPagesListResponseTestJSON contains the JSON metadata for the struct -// [SpeedAPIPagesListResponseTest] -type speedAPIPagesListResponseTestJSON struct { - ID apijson.Field - Date apijson.Field - DesktopReport apijson.Field - MobileReport apijson.Field - Region apijson.Field - ScheduleFrequency apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTest) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The Lighthouse report. -type SpeedAPIPagesListResponseTestsDesktopReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPIPagesListResponseTestsDesktopReportDeviceType `json:"deviceType"` - Error SpeedAPIPagesListResponseTestsDesktopReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPIPagesListResponseTestsDesktopReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPIPagesListResponseTestsDesktopReportJSON `json:"-"` -} - -// speedAPIPagesListResponseTestsDesktopReportJSON contains the JSON metadata for -// the struct [SpeedAPIPagesListResponseTestsDesktopReport] -type speedAPIPagesListResponseTestsDesktopReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTestsDesktopReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPIPagesListResponseTestsDesktopReportDeviceType string - -const ( - SpeedAPIPagesListResponseTestsDesktopReportDeviceTypeDesktop SpeedAPIPagesListResponseTestsDesktopReportDeviceType = "DESKTOP" - SpeedAPIPagesListResponseTestsDesktopReportDeviceTypeMobile SpeedAPIPagesListResponseTestsDesktopReportDeviceType = "MOBILE" -) - -type SpeedAPIPagesListResponseTestsDesktopReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPIPagesListResponseTestsDesktopReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPIPagesListResponseTestsDesktopReportErrorJSON `json:"-"` -} - -// speedAPIPagesListResponseTestsDesktopReportErrorJSON contains the JSON metadata -// for the struct [SpeedAPIPagesListResponseTestsDesktopReportError] -type speedAPIPagesListResponseTestsDesktopReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTestsDesktopReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPIPagesListResponseTestsDesktopReportErrorCode string - -const ( - SpeedAPIPagesListResponseTestsDesktopReportErrorCodeNotReachable SpeedAPIPagesListResponseTestsDesktopReportErrorCode = "NOT_REACHABLE" - SpeedAPIPagesListResponseTestsDesktopReportErrorCodeDNSFailure SpeedAPIPagesListResponseTestsDesktopReportErrorCode = "DNS_FAILURE" - SpeedAPIPagesListResponseTestsDesktopReportErrorCodeNotHTML SpeedAPIPagesListResponseTestsDesktopReportErrorCode = "NOT_HTML" - SpeedAPIPagesListResponseTestsDesktopReportErrorCodeLighthouseTimeout SpeedAPIPagesListResponseTestsDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPIPagesListResponseTestsDesktopReportErrorCodeUnknown SpeedAPIPagesListResponseTestsDesktopReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPIPagesListResponseTestsDesktopReportState string - -const ( - SpeedAPIPagesListResponseTestsDesktopReportStateRunning SpeedAPIPagesListResponseTestsDesktopReportState = "RUNNING" - SpeedAPIPagesListResponseTestsDesktopReportStateComplete SpeedAPIPagesListResponseTestsDesktopReportState = "COMPLETE" - SpeedAPIPagesListResponseTestsDesktopReportStateFailed SpeedAPIPagesListResponseTestsDesktopReportState = "FAILED" -) - -// The Lighthouse report. -type SpeedAPIPagesListResponseTestsMobileReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPIPagesListResponseTestsMobileReportDeviceType `json:"deviceType"` - Error SpeedAPIPagesListResponseTestsMobileReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPIPagesListResponseTestsMobileReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPIPagesListResponseTestsMobileReportJSON `json:"-"` -} - -// speedAPIPagesListResponseTestsMobileReportJSON contains the JSON metadata for -// the struct [SpeedAPIPagesListResponseTestsMobileReport] -type speedAPIPagesListResponseTestsMobileReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTestsMobileReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPIPagesListResponseTestsMobileReportDeviceType string - -const ( - SpeedAPIPagesListResponseTestsMobileReportDeviceTypeDesktop SpeedAPIPagesListResponseTestsMobileReportDeviceType = "DESKTOP" - SpeedAPIPagesListResponseTestsMobileReportDeviceTypeMobile SpeedAPIPagesListResponseTestsMobileReportDeviceType = "MOBILE" -) - -type SpeedAPIPagesListResponseTestsMobileReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPIPagesListResponseTestsMobileReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPIPagesListResponseTestsMobileReportErrorJSON `json:"-"` -} - -// speedAPIPagesListResponseTestsMobileReportErrorJSON contains the JSON metadata -// for the struct [SpeedAPIPagesListResponseTestsMobileReportError] -type speedAPIPagesListResponseTestsMobileReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTestsMobileReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPIPagesListResponseTestsMobileReportErrorCode string - -const ( - SpeedAPIPagesListResponseTestsMobileReportErrorCodeNotReachable SpeedAPIPagesListResponseTestsMobileReportErrorCode = "NOT_REACHABLE" - SpeedAPIPagesListResponseTestsMobileReportErrorCodeDNSFailure SpeedAPIPagesListResponseTestsMobileReportErrorCode = "DNS_FAILURE" - SpeedAPIPagesListResponseTestsMobileReportErrorCodeNotHTML SpeedAPIPagesListResponseTestsMobileReportErrorCode = "NOT_HTML" - SpeedAPIPagesListResponseTestsMobileReportErrorCodeLighthouseTimeout SpeedAPIPagesListResponseTestsMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPIPagesListResponseTestsMobileReportErrorCodeUnknown SpeedAPIPagesListResponseTestsMobileReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPIPagesListResponseTestsMobileReportState string - -const ( - SpeedAPIPagesListResponseTestsMobileReportStateRunning SpeedAPIPagesListResponseTestsMobileReportState = "RUNNING" - SpeedAPIPagesListResponseTestsMobileReportStateComplete SpeedAPIPagesListResponseTestsMobileReportState = "COMPLETE" - SpeedAPIPagesListResponseTestsMobileReportStateFailed SpeedAPIPagesListResponseTestsMobileReportState = "FAILED" -) - -// A test region with a label. -type SpeedAPIPagesListResponseTestsRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPIPagesListResponseTestsRegionValue `json:"value"` - JSON speedAPIPagesListResponseTestsRegionJSON `json:"-"` -} - -// speedAPIPagesListResponseTestsRegionJSON contains the JSON metadata for the -// struct [SpeedAPIPagesListResponseTestsRegion] -type speedAPIPagesListResponseTestsRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseTestsRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPIPagesListResponseTestsRegionValue string - -const ( - SpeedAPIPagesListResponseTestsRegionValueAsiaEast1 SpeedAPIPagesListResponseTestsRegionValue = "asia-east1" - SpeedAPIPagesListResponseTestsRegionValueAsiaNortheast1 SpeedAPIPagesListResponseTestsRegionValue = "asia-northeast1" - SpeedAPIPagesListResponseTestsRegionValueAsiaNortheast2 SpeedAPIPagesListResponseTestsRegionValue = "asia-northeast2" - SpeedAPIPagesListResponseTestsRegionValueAsiaSouth1 SpeedAPIPagesListResponseTestsRegionValue = "asia-south1" - SpeedAPIPagesListResponseTestsRegionValueAsiaSoutheast1 SpeedAPIPagesListResponseTestsRegionValue = "asia-southeast1" - SpeedAPIPagesListResponseTestsRegionValueAustraliaSoutheast1 SpeedAPIPagesListResponseTestsRegionValue = "australia-southeast1" - SpeedAPIPagesListResponseTestsRegionValueEuropeNorth1 SpeedAPIPagesListResponseTestsRegionValue = "europe-north1" - SpeedAPIPagesListResponseTestsRegionValueEuropeSouthwest1 SpeedAPIPagesListResponseTestsRegionValue = "europe-southwest1" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest1 SpeedAPIPagesListResponseTestsRegionValue = "europe-west1" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest2 SpeedAPIPagesListResponseTestsRegionValue = "europe-west2" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest3 SpeedAPIPagesListResponseTestsRegionValue = "europe-west3" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest4 SpeedAPIPagesListResponseTestsRegionValue = "europe-west4" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest8 SpeedAPIPagesListResponseTestsRegionValue = "europe-west8" - SpeedAPIPagesListResponseTestsRegionValueEuropeWest9 SpeedAPIPagesListResponseTestsRegionValue = "europe-west9" - SpeedAPIPagesListResponseTestsRegionValueMeWest1 SpeedAPIPagesListResponseTestsRegionValue = "me-west1" - SpeedAPIPagesListResponseTestsRegionValueSouthamericaEast1 SpeedAPIPagesListResponseTestsRegionValue = "southamerica-east1" - SpeedAPIPagesListResponseTestsRegionValueUsCentral1 SpeedAPIPagesListResponseTestsRegionValue = "us-central1" - SpeedAPIPagesListResponseTestsRegionValueUsEast1 SpeedAPIPagesListResponseTestsRegionValue = "us-east1" - SpeedAPIPagesListResponseTestsRegionValueUsEast4 SpeedAPIPagesListResponseTestsRegionValue = "us-east4" - SpeedAPIPagesListResponseTestsRegionValueUsSouth1 SpeedAPIPagesListResponseTestsRegionValue = "us-south1" - SpeedAPIPagesListResponseTestsRegionValueUsWest1 SpeedAPIPagesListResponseTestsRegionValue = "us-west1" -) - -// The frequency of the test. -type SpeedAPIPagesListResponseTestsScheduleFrequency string - -const ( - SpeedAPIPagesListResponseTestsScheduleFrequencyDaily SpeedAPIPagesListResponseTestsScheduleFrequency = "DAILY" - SpeedAPIPagesListResponseTestsScheduleFrequencyWeekly SpeedAPIPagesListResponseTestsScheduleFrequency = "WEEKLY" -) - -type SpeedAPIScheduleDeleteResponse struct { - // Number of items affected. - Count float64 `json:"count"` - JSON speedAPIScheduleDeleteResponseJSON `json:"-"` -} - -// speedAPIScheduleDeleteResponseJSON contains the JSON metadata for the struct -// [SpeedAPIScheduleDeleteResponse] -type speedAPIScheduleDeleteResponseJSON struct { - Count apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The test schedule. -type SpeedAPIScheduleGetResponse struct { - // The frequency of the test. - Frequency SpeedAPIScheduleGetResponseFrequency `json:"frequency"` - // A test region. - Region SpeedAPIScheduleGetResponseRegion `json:"region"` - // A URL. - URL string `json:"url"` - JSON speedAPIScheduleGetResponseJSON `json:"-"` -} - -// speedAPIScheduleGetResponseJSON contains the JSON metadata for the struct -// [SpeedAPIScheduleGetResponse] -type speedAPIScheduleGetResponseJSON struct { - Frequency apijson.Field - Region apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The frequency of the test. -type SpeedAPIScheduleGetResponseFrequency string - -const ( - SpeedAPIScheduleGetResponseFrequencyDaily SpeedAPIScheduleGetResponseFrequency = "DAILY" - SpeedAPIScheduleGetResponseFrequencyWeekly SpeedAPIScheduleGetResponseFrequency = "WEEKLY" -) - -// A test region. -type SpeedAPIScheduleGetResponseRegion string - -const ( - SpeedAPIScheduleGetResponseRegionAsiaEast1 SpeedAPIScheduleGetResponseRegion = "asia-east1" - SpeedAPIScheduleGetResponseRegionAsiaNortheast1 SpeedAPIScheduleGetResponseRegion = "asia-northeast1" - SpeedAPIScheduleGetResponseRegionAsiaNortheast2 SpeedAPIScheduleGetResponseRegion = "asia-northeast2" - SpeedAPIScheduleGetResponseRegionAsiaSouth1 SpeedAPIScheduleGetResponseRegion = "asia-south1" - SpeedAPIScheduleGetResponseRegionAsiaSoutheast1 SpeedAPIScheduleGetResponseRegion = "asia-southeast1" - SpeedAPIScheduleGetResponseRegionAustraliaSoutheast1 SpeedAPIScheduleGetResponseRegion = "australia-southeast1" - SpeedAPIScheduleGetResponseRegionEuropeNorth1 SpeedAPIScheduleGetResponseRegion = "europe-north1" - SpeedAPIScheduleGetResponseRegionEuropeSouthwest1 SpeedAPIScheduleGetResponseRegion = "europe-southwest1" - SpeedAPIScheduleGetResponseRegionEuropeWest1 SpeedAPIScheduleGetResponseRegion = "europe-west1" - SpeedAPIScheduleGetResponseRegionEuropeWest2 SpeedAPIScheduleGetResponseRegion = "europe-west2" - SpeedAPIScheduleGetResponseRegionEuropeWest3 SpeedAPIScheduleGetResponseRegion = "europe-west3" - SpeedAPIScheduleGetResponseRegionEuropeWest4 SpeedAPIScheduleGetResponseRegion = "europe-west4" - SpeedAPIScheduleGetResponseRegionEuropeWest8 SpeedAPIScheduleGetResponseRegion = "europe-west8" - SpeedAPIScheduleGetResponseRegionEuropeWest9 SpeedAPIScheduleGetResponseRegion = "europe-west9" - SpeedAPIScheduleGetResponseRegionMeWest1 SpeedAPIScheduleGetResponseRegion = "me-west1" - SpeedAPIScheduleGetResponseRegionSouthamericaEast1 SpeedAPIScheduleGetResponseRegion = "southamerica-east1" - SpeedAPIScheduleGetResponseRegionUsCentral1 SpeedAPIScheduleGetResponseRegion = "us-central1" - SpeedAPIScheduleGetResponseRegionUsEast1 SpeedAPIScheduleGetResponseRegion = "us-east1" - SpeedAPIScheduleGetResponseRegionUsEast4 SpeedAPIScheduleGetResponseRegion = "us-east4" - SpeedAPIScheduleGetResponseRegionUsSouth1 SpeedAPIScheduleGetResponseRegion = "us-south1" - SpeedAPIScheduleGetResponseRegionUsWest1 SpeedAPIScheduleGetResponseRegion = "us-west1" -) - -type SpeedAPITestsNewResponse struct { - // UUID - ID string `json:"id"` - Date time.Time `json:"date" format:"date-time"` - // The Lighthouse report. - DesktopReport SpeedAPITestsNewResponseDesktopReport `json:"desktopReport"` - // The Lighthouse report. - MobileReport SpeedAPITestsNewResponseMobileReport `json:"mobileReport"` - // A test region with a label. - Region SpeedAPITestsNewResponseRegion `json:"region"` - // The frequency of the test. - ScheduleFrequency SpeedAPITestsNewResponseScheduleFrequency `json:"scheduleFrequency"` - // A URL. - URL string `json:"url"` - JSON speedAPITestsNewResponseJSON `json:"-"` -} - -// speedAPITestsNewResponseJSON contains the JSON metadata for the struct -// [SpeedAPITestsNewResponse] -type speedAPITestsNewResponseJSON struct { - ID apijson.Field - Date apijson.Field - DesktopReport apijson.Field - MobileReport apijson.Field - Region apijson.Field - ScheduleFrequency apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The Lighthouse report. -type SpeedAPITestsNewResponseDesktopReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPITestsNewResponseDesktopReportDeviceType `json:"deviceType"` - Error SpeedAPITestsNewResponseDesktopReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPITestsNewResponseDesktopReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPITestsNewResponseDesktopReportJSON `json:"-"` -} - -// speedAPITestsNewResponseDesktopReportJSON contains the JSON metadata for the -// struct [SpeedAPITestsNewResponseDesktopReport] -type speedAPITestsNewResponseDesktopReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseDesktopReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPITestsNewResponseDesktopReportDeviceType string - -const ( - SpeedAPITestsNewResponseDesktopReportDeviceTypeDesktop SpeedAPITestsNewResponseDesktopReportDeviceType = "DESKTOP" - SpeedAPITestsNewResponseDesktopReportDeviceTypeMobile SpeedAPITestsNewResponseDesktopReportDeviceType = "MOBILE" -) - -type SpeedAPITestsNewResponseDesktopReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPITestsNewResponseDesktopReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPITestsNewResponseDesktopReportErrorJSON `json:"-"` -} - -// speedAPITestsNewResponseDesktopReportErrorJSON contains the JSON metadata for -// the struct [SpeedAPITestsNewResponseDesktopReportError] -type speedAPITestsNewResponseDesktopReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPITestsNewResponseDesktopReportErrorCode string - -const ( - SpeedAPITestsNewResponseDesktopReportErrorCodeNotReachable SpeedAPITestsNewResponseDesktopReportErrorCode = "NOT_REACHABLE" - SpeedAPITestsNewResponseDesktopReportErrorCodeDNSFailure SpeedAPITestsNewResponseDesktopReportErrorCode = "DNS_FAILURE" - SpeedAPITestsNewResponseDesktopReportErrorCodeNotHTML SpeedAPITestsNewResponseDesktopReportErrorCode = "NOT_HTML" - SpeedAPITestsNewResponseDesktopReportErrorCodeLighthouseTimeout SpeedAPITestsNewResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPITestsNewResponseDesktopReportErrorCodeUnknown SpeedAPITestsNewResponseDesktopReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPITestsNewResponseDesktopReportState string - -const ( - SpeedAPITestsNewResponseDesktopReportStateRunning SpeedAPITestsNewResponseDesktopReportState = "RUNNING" - SpeedAPITestsNewResponseDesktopReportStateComplete SpeedAPITestsNewResponseDesktopReportState = "COMPLETE" - SpeedAPITestsNewResponseDesktopReportStateFailed SpeedAPITestsNewResponseDesktopReportState = "FAILED" -) - -// The Lighthouse report. -type SpeedAPITestsNewResponseMobileReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPITestsNewResponseMobileReportDeviceType `json:"deviceType"` - Error SpeedAPITestsNewResponseMobileReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPITestsNewResponseMobileReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPITestsNewResponseMobileReportJSON `json:"-"` -} - -// speedAPITestsNewResponseMobileReportJSON contains the JSON metadata for the -// struct [SpeedAPITestsNewResponseMobileReport] -type speedAPITestsNewResponseMobileReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseMobileReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPITestsNewResponseMobileReportDeviceType string - -const ( - SpeedAPITestsNewResponseMobileReportDeviceTypeDesktop SpeedAPITestsNewResponseMobileReportDeviceType = "DESKTOP" - SpeedAPITestsNewResponseMobileReportDeviceTypeMobile SpeedAPITestsNewResponseMobileReportDeviceType = "MOBILE" -) - -type SpeedAPITestsNewResponseMobileReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPITestsNewResponseMobileReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPITestsNewResponseMobileReportErrorJSON `json:"-"` -} - -// speedAPITestsNewResponseMobileReportErrorJSON contains the JSON metadata for the -// struct [SpeedAPITestsNewResponseMobileReportError] -type speedAPITestsNewResponseMobileReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseMobileReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPITestsNewResponseMobileReportErrorCode string - -const ( - SpeedAPITestsNewResponseMobileReportErrorCodeNotReachable SpeedAPITestsNewResponseMobileReportErrorCode = "NOT_REACHABLE" - SpeedAPITestsNewResponseMobileReportErrorCodeDNSFailure SpeedAPITestsNewResponseMobileReportErrorCode = "DNS_FAILURE" - SpeedAPITestsNewResponseMobileReportErrorCodeNotHTML SpeedAPITestsNewResponseMobileReportErrorCode = "NOT_HTML" - SpeedAPITestsNewResponseMobileReportErrorCodeLighthouseTimeout SpeedAPITestsNewResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPITestsNewResponseMobileReportErrorCodeUnknown SpeedAPITestsNewResponseMobileReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPITestsNewResponseMobileReportState string - -const ( - SpeedAPITestsNewResponseMobileReportStateRunning SpeedAPITestsNewResponseMobileReportState = "RUNNING" - SpeedAPITestsNewResponseMobileReportStateComplete SpeedAPITestsNewResponseMobileReportState = "COMPLETE" - SpeedAPITestsNewResponseMobileReportStateFailed SpeedAPITestsNewResponseMobileReportState = "FAILED" -) - -// A test region with a label. -type SpeedAPITestsNewResponseRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPITestsNewResponseRegionValue `json:"value"` - JSON speedAPITestsNewResponseRegionJSON `json:"-"` -} - -// speedAPITestsNewResponseRegionJSON contains the JSON metadata for the struct -// [SpeedAPITestsNewResponseRegion] -type speedAPITestsNewResponseRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPITestsNewResponseRegionValue string - -const ( - SpeedAPITestsNewResponseRegionValueAsiaEast1 SpeedAPITestsNewResponseRegionValue = "asia-east1" - SpeedAPITestsNewResponseRegionValueAsiaNortheast1 SpeedAPITestsNewResponseRegionValue = "asia-northeast1" - SpeedAPITestsNewResponseRegionValueAsiaNortheast2 SpeedAPITestsNewResponseRegionValue = "asia-northeast2" - SpeedAPITestsNewResponseRegionValueAsiaSouth1 SpeedAPITestsNewResponseRegionValue = "asia-south1" - SpeedAPITestsNewResponseRegionValueAsiaSoutheast1 SpeedAPITestsNewResponseRegionValue = "asia-southeast1" - SpeedAPITestsNewResponseRegionValueAustraliaSoutheast1 SpeedAPITestsNewResponseRegionValue = "australia-southeast1" - SpeedAPITestsNewResponseRegionValueEuropeNorth1 SpeedAPITestsNewResponseRegionValue = "europe-north1" - SpeedAPITestsNewResponseRegionValueEuropeSouthwest1 SpeedAPITestsNewResponseRegionValue = "europe-southwest1" - SpeedAPITestsNewResponseRegionValueEuropeWest1 SpeedAPITestsNewResponseRegionValue = "europe-west1" - SpeedAPITestsNewResponseRegionValueEuropeWest2 SpeedAPITestsNewResponseRegionValue = "europe-west2" - SpeedAPITestsNewResponseRegionValueEuropeWest3 SpeedAPITestsNewResponseRegionValue = "europe-west3" - SpeedAPITestsNewResponseRegionValueEuropeWest4 SpeedAPITestsNewResponseRegionValue = "europe-west4" - SpeedAPITestsNewResponseRegionValueEuropeWest8 SpeedAPITestsNewResponseRegionValue = "europe-west8" - SpeedAPITestsNewResponseRegionValueEuropeWest9 SpeedAPITestsNewResponseRegionValue = "europe-west9" - SpeedAPITestsNewResponseRegionValueMeWest1 SpeedAPITestsNewResponseRegionValue = "me-west1" - SpeedAPITestsNewResponseRegionValueSouthamericaEast1 SpeedAPITestsNewResponseRegionValue = "southamerica-east1" - SpeedAPITestsNewResponseRegionValueUsCentral1 SpeedAPITestsNewResponseRegionValue = "us-central1" - SpeedAPITestsNewResponseRegionValueUsEast1 SpeedAPITestsNewResponseRegionValue = "us-east1" - SpeedAPITestsNewResponseRegionValueUsEast4 SpeedAPITestsNewResponseRegionValue = "us-east4" - SpeedAPITestsNewResponseRegionValueUsSouth1 SpeedAPITestsNewResponseRegionValue = "us-south1" - SpeedAPITestsNewResponseRegionValueUsWest1 SpeedAPITestsNewResponseRegionValue = "us-west1" -) - -// The frequency of the test. -type SpeedAPITestsNewResponseScheduleFrequency string - -const ( - SpeedAPITestsNewResponseScheduleFrequencyDaily SpeedAPITestsNewResponseScheduleFrequency = "DAILY" - SpeedAPITestsNewResponseScheduleFrequencyWeekly SpeedAPITestsNewResponseScheduleFrequency = "WEEKLY" -) - -type SpeedAPITestsDeleteResponse struct { - // Number of items affected. - Count float64 `json:"count"` - JSON speedAPITestsDeleteResponseJSON `json:"-"` -} - -// speedAPITestsDeleteResponseJSON contains the JSON metadata for the struct -// [SpeedAPITestsDeleteResponse] -type speedAPITestsDeleteResponseJSON struct { - Count apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsGetResponse struct { - // UUID - ID string `json:"id"` - Date time.Time `json:"date" format:"date-time"` - // The Lighthouse report. - DesktopReport SpeedAPITestsGetResponseDesktopReport `json:"desktopReport"` - // The Lighthouse report. - MobileReport SpeedAPITestsGetResponseMobileReport `json:"mobileReport"` - // A test region with a label. - Region SpeedAPITestsGetResponseRegion `json:"region"` - // The frequency of the test. - ScheduleFrequency SpeedAPITestsGetResponseScheduleFrequency `json:"scheduleFrequency"` - // A URL. - URL string `json:"url"` - JSON speedAPITestsGetResponseJSON `json:"-"` -} - -// speedAPITestsGetResponseJSON contains the JSON metadata for the struct -// [SpeedAPITestsGetResponse] -type speedAPITestsGetResponseJSON struct { - ID apijson.Field - Date apijson.Field - DesktopReport apijson.Field - MobileReport apijson.Field - Region apijson.Field - ScheduleFrequency apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The Lighthouse report. -type SpeedAPITestsGetResponseDesktopReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPITestsGetResponseDesktopReportDeviceType `json:"deviceType"` - Error SpeedAPITestsGetResponseDesktopReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPITestsGetResponseDesktopReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPITestsGetResponseDesktopReportJSON `json:"-"` -} - -// speedAPITestsGetResponseDesktopReportJSON contains the JSON metadata for the -// struct [SpeedAPITestsGetResponseDesktopReport] -type speedAPITestsGetResponseDesktopReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseDesktopReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPITestsGetResponseDesktopReportDeviceType string - -const ( - SpeedAPITestsGetResponseDesktopReportDeviceTypeDesktop SpeedAPITestsGetResponseDesktopReportDeviceType = "DESKTOP" - SpeedAPITestsGetResponseDesktopReportDeviceTypeMobile SpeedAPITestsGetResponseDesktopReportDeviceType = "MOBILE" -) - -type SpeedAPITestsGetResponseDesktopReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPITestsGetResponseDesktopReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPITestsGetResponseDesktopReportErrorJSON `json:"-"` -} - -// speedAPITestsGetResponseDesktopReportErrorJSON contains the JSON metadata for -// the struct [SpeedAPITestsGetResponseDesktopReportError] -type speedAPITestsGetResponseDesktopReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPITestsGetResponseDesktopReportErrorCode string - -const ( - SpeedAPITestsGetResponseDesktopReportErrorCodeNotReachable SpeedAPITestsGetResponseDesktopReportErrorCode = "NOT_REACHABLE" - SpeedAPITestsGetResponseDesktopReportErrorCodeDNSFailure SpeedAPITestsGetResponseDesktopReportErrorCode = "DNS_FAILURE" - SpeedAPITestsGetResponseDesktopReportErrorCodeNotHTML SpeedAPITestsGetResponseDesktopReportErrorCode = "NOT_HTML" - SpeedAPITestsGetResponseDesktopReportErrorCodeLighthouseTimeout SpeedAPITestsGetResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPITestsGetResponseDesktopReportErrorCodeUnknown SpeedAPITestsGetResponseDesktopReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPITestsGetResponseDesktopReportState string - -const ( - SpeedAPITestsGetResponseDesktopReportStateRunning SpeedAPITestsGetResponseDesktopReportState = "RUNNING" - SpeedAPITestsGetResponseDesktopReportStateComplete SpeedAPITestsGetResponseDesktopReportState = "COMPLETE" - SpeedAPITestsGetResponseDesktopReportStateFailed SpeedAPITestsGetResponseDesktopReportState = "FAILED" -) - -// The Lighthouse report. -type SpeedAPITestsGetResponseMobileReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPITestsGetResponseMobileReportDeviceType `json:"deviceType"` - Error SpeedAPITestsGetResponseMobileReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPITestsGetResponseMobileReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPITestsGetResponseMobileReportJSON `json:"-"` -} - -// speedAPITestsGetResponseMobileReportJSON contains the JSON metadata for the -// struct [SpeedAPITestsGetResponseMobileReport] -type speedAPITestsGetResponseMobileReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseMobileReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPITestsGetResponseMobileReportDeviceType string - -const ( - SpeedAPITestsGetResponseMobileReportDeviceTypeDesktop SpeedAPITestsGetResponseMobileReportDeviceType = "DESKTOP" - SpeedAPITestsGetResponseMobileReportDeviceTypeMobile SpeedAPITestsGetResponseMobileReportDeviceType = "MOBILE" -) - -type SpeedAPITestsGetResponseMobileReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPITestsGetResponseMobileReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPITestsGetResponseMobileReportErrorJSON `json:"-"` -} - -// speedAPITestsGetResponseMobileReportErrorJSON contains the JSON metadata for the -// struct [SpeedAPITestsGetResponseMobileReportError] -type speedAPITestsGetResponseMobileReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseMobileReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPITestsGetResponseMobileReportErrorCode string - -const ( - SpeedAPITestsGetResponseMobileReportErrorCodeNotReachable SpeedAPITestsGetResponseMobileReportErrorCode = "NOT_REACHABLE" - SpeedAPITestsGetResponseMobileReportErrorCodeDNSFailure SpeedAPITestsGetResponseMobileReportErrorCode = "DNS_FAILURE" - SpeedAPITestsGetResponseMobileReportErrorCodeNotHTML SpeedAPITestsGetResponseMobileReportErrorCode = "NOT_HTML" - SpeedAPITestsGetResponseMobileReportErrorCodeLighthouseTimeout SpeedAPITestsGetResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPITestsGetResponseMobileReportErrorCodeUnknown SpeedAPITestsGetResponseMobileReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPITestsGetResponseMobileReportState string - -const ( - SpeedAPITestsGetResponseMobileReportStateRunning SpeedAPITestsGetResponseMobileReportState = "RUNNING" - SpeedAPITestsGetResponseMobileReportStateComplete SpeedAPITestsGetResponseMobileReportState = "COMPLETE" - SpeedAPITestsGetResponseMobileReportStateFailed SpeedAPITestsGetResponseMobileReportState = "FAILED" -) - -// A test region with a label. -type SpeedAPITestsGetResponseRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPITestsGetResponseRegionValue `json:"value"` - JSON speedAPITestsGetResponseRegionJSON `json:"-"` -} - -// speedAPITestsGetResponseRegionJSON contains the JSON metadata for the struct -// [SpeedAPITestsGetResponseRegion] -type speedAPITestsGetResponseRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPITestsGetResponseRegionValue string - -const ( - SpeedAPITestsGetResponseRegionValueAsiaEast1 SpeedAPITestsGetResponseRegionValue = "asia-east1" - SpeedAPITestsGetResponseRegionValueAsiaNortheast1 SpeedAPITestsGetResponseRegionValue = "asia-northeast1" - SpeedAPITestsGetResponseRegionValueAsiaNortheast2 SpeedAPITestsGetResponseRegionValue = "asia-northeast2" - SpeedAPITestsGetResponseRegionValueAsiaSouth1 SpeedAPITestsGetResponseRegionValue = "asia-south1" - SpeedAPITestsGetResponseRegionValueAsiaSoutheast1 SpeedAPITestsGetResponseRegionValue = "asia-southeast1" - SpeedAPITestsGetResponseRegionValueAustraliaSoutheast1 SpeedAPITestsGetResponseRegionValue = "australia-southeast1" - SpeedAPITestsGetResponseRegionValueEuropeNorth1 SpeedAPITestsGetResponseRegionValue = "europe-north1" - SpeedAPITestsGetResponseRegionValueEuropeSouthwest1 SpeedAPITestsGetResponseRegionValue = "europe-southwest1" - SpeedAPITestsGetResponseRegionValueEuropeWest1 SpeedAPITestsGetResponseRegionValue = "europe-west1" - SpeedAPITestsGetResponseRegionValueEuropeWest2 SpeedAPITestsGetResponseRegionValue = "europe-west2" - SpeedAPITestsGetResponseRegionValueEuropeWest3 SpeedAPITestsGetResponseRegionValue = "europe-west3" - SpeedAPITestsGetResponseRegionValueEuropeWest4 SpeedAPITestsGetResponseRegionValue = "europe-west4" - SpeedAPITestsGetResponseRegionValueEuropeWest8 SpeedAPITestsGetResponseRegionValue = "europe-west8" - SpeedAPITestsGetResponseRegionValueEuropeWest9 SpeedAPITestsGetResponseRegionValue = "europe-west9" - SpeedAPITestsGetResponseRegionValueMeWest1 SpeedAPITestsGetResponseRegionValue = "me-west1" - SpeedAPITestsGetResponseRegionValueSouthamericaEast1 SpeedAPITestsGetResponseRegionValue = "southamerica-east1" - SpeedAPITestsGetResponseRegionValueUsCentral1 SpeedAPITestsGetResponseRegionValue = "us-central1" - SpeedAPITestsGetResponseRegionValueUsEast1 SpeedAPITestsGetResponseRegionValue = "us-east1" - SpeedAPITestsGetResponseRegionValueUsEast4 SpeedAPITestsGetResponseRegionValue = "us-east4" - SpeedAPITestsGetResponseRegionValueUsSouth1 SpeedAPITestsGetResponseRegionValue = "us-south1" - SpeedAPITestsGetResponseRegionValueUsWest1 SpeedAPITestsGetResponseRegionValue = "us-west1" -) - -// The frequency of the test. -type SpeedAPITestsGetResponseScheduleFrequency string - -const ( - SpeedAPITestsGetResponseScheduleFrequencyDaily SpeedAPITestsGetResponseScheduleFrequency = "DAILY" - SpeedAPITestsGetResponseScheduleFrequencyWeekly SpeedAPITestsGetResponseScheduleFrequency = "WEEKLY" -) - -type SpeedAPITestsListResponse struct { - Errors []SpeedAPITestsListResponseError `json:"errors,required"` - Messages []SpeedAPITestsListResponseMessage `json:"messages,required"` - // Whether the API call was successful. - Success bool `json:"success,required"` - ResultInfo SpeedAPITestsListResponseResultInfo `json:"result_info"` - JSON speedAPITestsListResponseJSON `json:"-"` -} - -// speedAPITestsListResponseJSON contains the JSON metadata for the struct -// [SpeedAPITestsListResponse] -type speedAPITestsListResponseJSON struct { - Errors apijson.Field - Messages apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsListResponseError struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON speedAPITestsListResponseErrorJSON `json:"-"` -} - -// speedAPITestsListResponseErrorJSON contains the JSON metadata for the struct -// [SpeedAPITestsListResponseError] -type speedAPITestsListResponseErrorJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsListResponseError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsListResponseMessage struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON speedAPITestsListResponseMessageJSON `json:"-"` -} - -// speedAPITestsListResponseMessageJSON contains the JSON metadata for the struct -// [SpeedAPITestsListResponseMessage] -type speedAPITestsListResponseMessageJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsListResponseMessage) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsListResponseResultInfo struct { - Count int64 `json:"count"` - Page int64 `json:"page"` - PerPage int64 `json:"per_page"` - TotalCount int64 `json:"total_count"` - JSON speedAPITestsListResponseResultInfoJSON `json:"-"` -} - -// speedAPITestsListResponseResultInfoJSON contains the JSON metadata for the -// struct [SpeedAPITestsListResponseResultInfo] -type speedAPITestsListResponseResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsListResponseResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITrendsListResponse struct { - // Cumulative Layout Shift trend. - Cls []float64 `json:"cls"` - // First Contentful Paint trend. - Fcp []float64 `json:"fcp"` - // Largest Contentful Paint trend. - Lcp []float64 `json:"lcp"` - // The Lighthouse score trend. - PerformanceScore []float64 `json:"performanceScore"` - // Speed Index trend. - Si []float64 `json:"si"` - // Total Blocking Time trend. - Tbt []float64 `json:"tbt"` - // Time To First Byte trend. - Ttfb []float64 `json:"ttfb"` - // Time To Interactive trend. - Tti []float64 `json:"tti"` - JSON speedAPITrendsListResponseJSON `json:"-"` -} - -// speedAPITrendsListResponseJSON contains the JSON metadata for the struct -// [SpeedAPITrendsListResponse] -type speedAPITrendsListResponseJSON struct { - Cls apijson.Field - Fcp apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITrendsListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPIAvailabilitiesListResponseEnvelope struct { - Result SpeedAPIAvailabilitiesListResponse `json:"result"` - JSON speedAPIAvailabilitiesListResponseEnvelopeJSON `json:"-"` -} - -// speedAPIAvailabilitiesListResponseEnvelopeJSON contains the JSON metadata for -// the struct [SpeedAPIAvailabilitiesListResponseEnvelope] -type speedAPIAvailabilitiesListResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIAvailabilitiesListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPIPagesListResponseEnvelope struct { - Result []SpeedAPIPagesListResponse `json:"result"` - JSON speedAPIPagesListResponseEnvelopeJSON `json:"-"` -} - -// speedAPIPagesListResponseEnvelopeJSON contains the JSON metadata for the struct -// [SpeedAPIPagesListResponseEnvelope] -type speedAPIPagesListResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIPagesListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPIScheduleDeleteParams struct { - // A test region. - Region param.Field[SpeedAPIScheduleDeleteParamsRegion] `query:"region"` -} - -// URLQuery serializes [SpeedAPIScheduleDeleteParams]'s query parameters as -// `url.Values`. -func (r SpeedAPIScheduleDeleteParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// A test region. -type SpeedAPIScheduleDeleteParamsRegion string - -const ( - SpeedAPIScheduleDeleteParamsRegionAsiaEast1 SpeedAPIScheduleDeleteParamsRegion = "asia-east1" - SpeedAPIScheduleDeleteParamsRegionAsiaNortheast1 SpeedAPIScheduleDeleteParamsRegion = "asia-northeast1" - SpeedAPIScheduleDeleteParamsRegionAsiaNortheast2 SpeedAPIScheduleDeleteParamsRegion = "asia-northeast2" - SpeedAPIScheduleDeleteParamsRegionAsiaSouth1 SpeedAPIScheduleDeleteParamsRegion = "asia-south1" - SpeedAPIScheduleDeleteParamsRegionAsiaSoutheast1 SpeedAPIScheduleDeleteParamsRegion = "asia-southeast1" - SpeedAPIScheduleDeleteParamsRegionAustraliaSoutheast1 SpeedAPIScheduleDeleteParamsRegion = "australia-southeast1" - SpeedAPIScheduleDeleteParamsRegionEuropeNorth1 SpeedAPIScheduleDeleteParamsRegion = "europe-north1" - SpeedAPIScheduleDeleteParamsRegionEuropeSouthwest1 SpeedAPIScheduleDeleteParamsRegion = "europe-southwest1" - SpeedAPIScheduleDeleteParamsRegionEuropeWest1 SpeedAPIScheduleDeleteParamsRegion = "europe-west1" - SpeedAPIScheduleDeleteParamsRegionEuropeWest2 SpeedAPIScheduleDeleteParamsRegion = "europe-west2" - SpeedAPIScheduleDeleteParamsRegionEuropeWest3 SpeedAPIScheduleDeleteParamsRegion = "europe-west3" - SpeedAPIScheduleDeleteParamsRegionEuropeWest4 SpeedAPIScheduleDeleteParamsRegion = "europe-west4" - SpeedAPIScheduleDeleteParamsRegionEuropeWest8 SpeedAPIScheduleDeleteParamsRegion = "europe-west8" - SpeedAPIScheduleDeleteParamsRegionEuropeWest9 SpeedAPIScheduleDeleteParamsRegion = "europe-west9" - SpeedAPIScheduleDeleteParamsRegionMeWest1 SpeedAPIScheduleDeleteParamsRegion = "me-west1" - SpeedAPIScheduleDeleteParamsRegionSouthamericaEast1 SpeedAPIScheduleDeleteParamsRegion = "southamerica-east1" - SpeedAPIScheduleDeleteParamsRegionUsCentral1 SpeedAPIScheduleDeleteParamsRegion = "us-central1" - SpeedAPIScheduleDeleteParamsRegionUsEast1 SpeedAPIScheduleDeleteParamsRegion = "us-east1" - SpeedAPIScheduleDeleteParamsRegionUsEast4 SpeedAPIScheduleDeleteParamsRegion = "us-east4" - SpeedAPIScheduleDeleteParamsRegionUsSouth1 SpeedAPIScheduleDeleteParamsRegion = "us-south1" - SpeedAPIScheduleDeleteParamsRegionUsWest1 SpeedAPIScheduleDeleteParamsRegion = "us-west1" -) - -type SpeedAPIScheduleDeleteResponseEnvelope struct { - Result SpeedAPIScheduleDeleteResponse `json:"result"` - JSON speedAPIScheduleDeleteResponseEnvelopeJSON `json:"-"` -} - -// speedAPIScheduleDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [SpeedAPIScheduleDeleteResponseEnvelope] -type speedAPIScheduleDeleteResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPIScheduleGetParams struct { - // A test region. - Region param.Field[SpeedAPIScheduleGetParamsRegion] `query:"region"` -} - -// URLQuery serializes [SpeedAPIScheduleGetParams]'s query parameters as -// `url.Values`. -func (r SpeedAPIScheduleGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// A test region. -type SpeedAPIScheduleGetParamsRegion string - -const ( - SpeedAPIScheduleGetParamsRegionAsiaEast1 SpeedAPIScheduleGetParamsRegion = "asia-east1" - SpeedAPIScheduleGetParamsRegionAsiaNortheast1 SpeedAPIScheduleGetParamsRegion = "asia-northeast1" - SpeedAPIScheduleGetParamsRegionAsiaNortheast2 SpeedAPIScheduleGetParamsRegion = "asia-northeast2" - SpeedAPIScheduleGetParamsRegionAsiaSouth1 SpeedAPIScheduleGetParamsRegion = "asia-south1" - SpeedAPIScheduleGetParamsRegionAsiaSoutheast1 SpeedAPIScheduleGetParamsRegion = "asia-southeast1" - SpeedAPIScheduleGetParamsRegionAustraliaSoutheast1 SpeedAPIScheduleGetParamsRegion = "australia-southeast1" - SpeedAPIScheduleGetParamsRegionEuropeNorth1 SpeedAPIScheduleGetParamsRegion = "europe-north1" - SpeedAPIScheduleGetParamsRegionEuropeSouthwest1 SpeedAPIScheduleGetParamsRegion = "europe-southwest1" - SpeedAPIScheduleGetParamsRegionEuropeWest1 SpeedAPIScheduleGetParamsRegion = "europe-west1" - SpeedAPIScheduleGetParamsRegionEuropeWest2 SpeedAPIScheduleGetParamsRegion = "europe-west2" - SpeedAPIScheduleGetParamsRegionEuropeWest3 SpeedAPIScheduleGetParamsRegion = "europe-west3" - SpeedAPIScheduleGetParamsRegionEuropeWest4 SpeedAPIScheduleGetParamsRegion = "europe-west4" - SpeedAPIScheduleGetParamsRegionEuropeWest8 SpeedAPIScheduleGetParamsRegion = "europe-west8" - SpeedAPIScheduleGetParamsRegionEuropeWest9 SpeedAPIScheduleGetParamsRegion = "europe-west9" - SpeedAPIScheduleGetParamsRegionMeWest1 SpeedAPIScheduleGetParamsRegion = "me-west1" - SpeedAPIScheduleGetParamsRegionSouthamericaEast1 SpeedAPIScheduleGetParamsRegion = "southamerica-east1" - SpeedAPIScheduleGetParamsRegionUsCentral1 SpeedAPIScheduleGetParamsRegion = "us-central1" - SpeedAPIScheduleGetParamsRegionUsEast1 SpeedAPIScheduleGetParamsRegion = "us-east1" - SpeedAPIScheduleGetParamsRegionUsEast4 SpeedAPIScheduleGetParamsRegion = "us-east4" - SpeedAPIScheduleGetParamsRegionUsSouth1 SpeedAPIScheduleGetParamsRegion = "us-south1" - SpeedAPIScheduleGetParamsRegionUsWest1 SpeedAPIScheduleGetParamsRegion = "us-west1" -) - -type SpeedAPIScheduleGetResponseEnvelope struct { - // The test schedule. - Result SpeedAPIScheduleGetResponse `json:"result"` - JSON speedAPIScheduleGetResponseEnvelopeJSON `json:"-"` -} - -// speedAPIScheduleGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [SpeedAPIScheduleGetResponseEnvelope] -type speedAPIScheduleGetResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsNewParams struct { - // A test region. - Region param.Field[SpeedAPITestsNewParamsRegion] `json:"region"` -} - -func (r SpeedAPITestsNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A test region. -type SpeedAPITestsNewParamsRegion string - -const ( - SpeedAPITestsNewParamsRegionAsiaEast1 SpeedAPITestsNewParamsRegion = "asia-east1" - SpeedAPITestsNewParamsRegionAsiaNortheast1 SpeedAPITestsNewParamsRegion = "asia-northeast1" - SpeedAPITestsNewParamsRegionAsiaNortheast2 SpeedAPITestsNewParamsRegion = "asia-northeast2" - SpeedAPITestsNewParamsRegionAsiaSouth1 SpeedAPITestsNewParamsRegion = "asia-south1" - SpeedAPITestsNewParamsRegionAsiaSoutheast1 SpeedAPITestsNewParamsRegion = "asia-southeast1" - SpeedAPITestsNewParamsRegionAustraliaSoutheast1 SpeedAPITestsNewParamsRegion = "australia-southeast1" - SpeedAPITestsNewParamsRegionEuropeNorth1 SpeedAPITestsNewParamsRegion = "europe-north1" - SpeedAPITestsNewParamsRegionEuropeSouthwest1 SpeedAPITestsNewParamsRegion = "europe-southwest1" - SpeedAPITestsNewParamsRegionEuropeWest1 SpeedAPITestsNewParamsRegion = "europe-west1" - SpeedAPITestsNewParamsRegionEuropeWest2 SpeedAPITestsNewParamsRegion = "europe-west2" - SpeedAPITestsNewParamsRegionEuropeWest3 SpeedAPITestsNewParamsRegion = "europe-west3" - SpeedAPITestsNewParamsRegionEuropeWest4 SpeedAPITestsNewParamsRegion = "europe-west4" - SpeedAPITestsNewParamsRegionEuropeWest8 SpeedAPITestsNewParamsRegion = "europe-west8" - SpeedAPITestsNewParamsRegionEuropeWest9 SpeedAPITestsNewParamsRegion = "europe-west9" - SpeedAPITestsNewParamsRegionMeWest1 SpeedAPITestsNewParamsRegion = "me-west1" - SpeedAPITestsNewParamsRegionSouthamericaEast1 SpeedAPITestsNewParamsRegion = "southamerica-east1" - SpeedAPITestsNewParamsRegionUsCentral1 SpeedAPITestsNewParamsRegion = "us-central1" - SpeedAPITestsNewParamsRegionUsEast1 SpeedAPITestsNewParamsRegion = "us-east1" - SpeedAPITestsNewParamsRegionUsEast4 SpeedAPITestsNewParamsRegion = "us-east4" - SpeedAPITestsNewParamsRegionUsSouth1 SpeedAPITestsNewParamsRegion = "us-south1" - SpeedAPITestsNewParamsRegionUsWest1 SpeedAPITestsNewParamsRegion = "us-west1" -) - -type SpeedAPITestsNewResponseEnvelope struct { - Result SpeedAPITestsNewResponse `json:"result"` - JSON speedAPITestsNewResponseEnvelopeJSON `json:"-"` -} - -// speedAPITestsNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [SpeedAPITestsNewResponseEnvelope] -type speedAPITestsNewResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsDeleteParams struct { - // A test region. - Region param.Field[SpeedAPITestsDeleteParamsRegion] `query:"region"` -} - -// URLQuery serializes [SpeedAPITestsDeleteParams]'s query parameters as -// `url.Values`. -func (r SpeedAPITestsDeleteParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// A test region. -type SpeedAPITestsDeleteParamsRegion string - -const ( - SpeedAPITestsDeleteParamsRegionAsiaEast1 SpeedAPITestsDeleteParamsRegion = "asia-east1" - SpeedAPITestsDeleteParamsRegionAsiaNortheast1 SpeedAPITestsDeleteParamsRegion = "asia-northeast1" - SpeedAPITestsDeleteParamsRegionAsiaNortheast2 SpeedAPITestsDeleteParamsRegion = "asia-northeast2" - SpeedAPITestsDeleteParamsRegionAsiaSouth1 SpeedAPITestsDeleteParamsRegion = "asia-south1" - SpeedAPITestsDeleteParamsRegionAsiaSoutheast1 SpeedAPITestsDeleteParamsRegion = "asia-southeast1" - SpeedAPITestsDeleteParamsRegionAustraliaSoutheast1 SpeedAPITestsDeleteParamsRegion = "australia-southeast1" - SpeedAPITestsDeleteParamsRegionEuropeNorth1 SpeedAPITestsDeleteParamsRegion = "europe-north1" - SpeedAPITestsDeleteParamsRegionEuropeSouthwest1 SpeedAPITestsDeleteParamsRegion = "europe-southwest1" - SpeedAPITestsDeleteParamsRegionEuropeWest1 SpeedAPITestsDeleteParamsRegion = "europe-west1" - SpeedAPITestsDeleteParamsRegionEuropeWest2 SpeedAPITestsDeleteParamsRegion = "europe-west2" - SpeedAPITestsDeleteParamsRegionEuropeWest3 SpeedAPITestsDeleteParamsRegion = "europe-west3" - SpeedAPITestsDeleteParamsRegionEuropeWest4 SpeedAPITestsDeleteParamsRegion = "europe-west4" - SpeedAPITestsDeleteParamsRegionEuropeWest8 SpeedAPITestsDeleteParamsRegion = "europe-west8" - SpeedAPITestsDeleteParamsRegionEuropeWest9 SpeedAPITestsDeleteParamsRegion = "europe-west9" - SpeedAPITestsDeleteParamsRegionMeWest1 SpeedAPITestsDeleteParamsRegion = "me-west1" - SpeedAPITestsDeleteParamsRegionSouthamericaEast1 SpeedAPITestsDeleteParamsRegion = "southamerica-east1" - SpeedAPITestsDeleteParamsRegionUsCentral1 SpeedAPITestsDeleteParamsRegion = "us-central1" - SpeedAPITestsDeleteParamsRegionUsEast1 SpeedAPITestsDeleteParamsRegion = "us-east1" - SpeedAPITestsDeleteParamsRegionUsEast4 SpeedAPITestsDeleteParamsRegion = "us-east4" - SpeedAPITestsDeleteParamsRegionUsSouth1 SpeedAPITestsDeleteParamsRegion = "us-south1" - SpeedAPITestsDeleteParamsRegionUsWest1 SpeedAPITestsDeleteParamsRegion = "us-west1" -) - -type SpeedAPITestsDeleteResponseEnvelope struct { - Result SpeedAPITestsDeleteResponse `json:"result"` - JSON speedAPITestsDeleteResponseEnvelopeJSON `json:"-"` -} - -// speedAPITestsDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [SpeedAPITestsDeleteResponseEnvelope] -type speedAPITestsDeleteResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsGetResponseEnvelope struct { - Result SpeedAPITestsGetResponse `json:"result"` - JSON speedAPITestsGetResponseEnvelopeJSON `json:"-"` -} - -// speedAPITestsGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [SpeedAPITestsGetResponseEnvelope] -type speedAPITestsGetResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITestsGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SpeedAPITestsListParams struct { - Page param.Field[int64] `query:"page"` - PerPage param.Field[int64] `query:"per_page"` - // A test region. - Region param.Field[SpeedAPITestsListParamsRegion] `query:"region"` -} - -// URLQuery serializes [SpeedAPITestsListParams]'s query parameters as -// `url.Values`. -func (r SpeedAPITestsListParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// A test region. -type SpeedAPITestsListParamsRegion string - -const ( - SpeedAPITestsListParamsRegionAsiaEast1 SpeedAPITestsListParamsRegion = "asia-east1" - SpeedAPITestsListParamsRegionAsiaNortheast1 SpeedAPITestsListParamsRegion = "asia-northeast1" - SpeedAPITestsListParamsRegionAsiaNortheast2 SpeedAPITestsListParamsRegion = "asia-northeast2" - SpeedAPITestsListParamsRegionAsiaSouth1 SpeedAPITestsListParamsRegion = "asia-south1" - SpeedAPITestsListParamsRegionAsiaSoutheast1 SpeedAPITestsListParamsRegion = "asia-southeast1" - SpeedAPITestsListParamsRegionAustraliaSoutheast1 SpeedAPITestsListParamsRegion = "australia-southeast1" - SpeedAPITestsListParamsRegionEuropeNorth1 SpeedAPITestsListParamsRegion = "europe-north1" - SpeedAPITestsListParamsRegionEuropeSouthwest1 SpeedAPITestsListParamsRegion = "europe-southwest1" - SpeedAPITestsListParamsRegionEuropeWest1 SpeedAPITestsListParamsRegion = "europe-west1" - SpeedAPITestsListParamsRegionEuropeWest2 SpeedAPITestsListParamsRegion = "europe-west2" - SpeedAPITestsListParamsRegionEuropeWest3 SpeedAPITestsListParamsRegion = "europe-west3" - SpeedAPITestsListParamsRegionEuropeWest4 SpeedAPITestsListParamsRegion = "europe-west4" - SpeedAPITestsListParamsRegionEuropeWest8 SpeedAPITestsListParamsRegion = "europe-west8" - SpeedAPITestsListParamsRegionEuropeWest9 SpeedAPITestsListParamsRegion = "europe-west9" - SpeedAPITestsListParamsRegionMeWest1 SpeedAPITestsListParamsRegion = "me-west1" - SpeedAPITestsListParamsRegionSouthamericaEast1 SpeedAPITestsListParamsRegion = "southamerica-east1" - SpeedAPITestsListParamsRegionUsCentral1 SpeedAPITestsListParamsRegion = "us-central1" - SpeedAPITestsListParamsRegionUsEast1 SpeedAPITestsListParamsRegion = "us-east1" - SpeedAPITestsListParamsRegionUsEast4 SpeedAPITestsListParamsRegion = "us-east4" - SpeedAPITestsListParamsRegionUsSouth1 SpeedAPITestsListParamsRegion = "us-south1" - SpeedAPITestsListParamsRegionUsWest1 SpeedAPITestsListParamsRegion = "us-west1" -) - -type SpeedAPITrendsListParams struct { - // The type of device. - DeviceType param.Field[SpeedAPITrendsListParamsDeviceType] `query:"deviceType,required"` - // A comma-separated list of metrics to include in the results. - Metrics param.Field[string] `query:"metrics,required"` - // A test region. - Region param.Field[SpeedAPITrendsListParamsRegion] `query:"region,required"` - // The timezone of the start and end timestamps. - Tz param.Field[string] `query:"tz,required"` -} - -// URLQuery serializes [SpeedAPITrendsListParams]'s query parameters as -// `url.Values`. -func (r SpeedAPITrendsListParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// The type of device. -type SpeedAPITrendsListParamsDeviceType string - -const ( - SpeedAPITrendsListParamsDeviceTypeDesktop SpeedAPITrendsListParamsDeviceType = "DESKTOP" - SpeedAPITrendsListParamsDeviceTypeMobile SpeedAPITrendsListParamsDeviceType = "MOBILE" -) - -// A test region. -type SpeedAPITrendsListParamsRegion string - -const ( - SpeedAPITrendsListParamsRegionAsiaEast1 SpeedAPITrendsListParamsRegion = "asia-east1" - SpeedAPITrendsListParamsRegionAsiaNortheast1 SpeedAPITrendsListParamsRegion = "asia-northeast1" - SpeedAPITrendsListParamsRegionAsiaNortheast2 SpeedAPITrendsListParamsRegion = "asia-northeast2" - SpeedAPITrendsListParamsRegionAsiaSouth1 SpeedAPITrendsListParamsRegion = "asia-south1" - SpeedAPITrendsListParamsRegionAsiaSoutheast1 SpeedAPITrendsListParamsRegion = "asia-southeast1" - SpeedAPITrendsListParamsRegionAustraliaSoutheast1 SpeedAPITrendsListParamsRegion = "australia-southeast1" - SpeedAPITrendsListParamsRegionEuropeNorth1 SpeedAPITrendsListParamsRegion = "europe-north1" - SpeedAPITrendsListParamsRegionEuropeSouthwest1 SpeedAPITrendsListParamsRegion = "europe-southwest1" - SpeedAPITrendsListParamsRegionEuropeWest1 SpeedAPITrendsListParamsRegion = "europe-west1" - SpeedAPITrendsListParamsRegionEuropeWest2 SpeedAPITrendsListParamsRegion = "europe-west2" - SpeedAPITrendsListParamsRegionEuropeWest3 SpeedAPITrendsListParamsRegion = "europe-west3" - SpeedAPITrendsListParamsRegionEuropeWest4 SpeedAPITrendsListParamsRegion = "europe-west4" - SpeedAPITrendsListParamsRegionEuropeWest8 SpeedAPITrendsListParamsRegion = "europe-west8" - SpeedAPITrendsListParamsRegionEuropeWest9 SpeedAPITrendsListParamsRegion = "europe-west9" - SpeedAPITrendsListParamsRegionMeWest1 SpeedAPITrendsListParamsRegion = "me-west1" - SpeedAPITrendsListParamsRegionSouthamericaEast1 SpeedAPITrendsListParamsRegion = "southamerica-east1" - SpeedAPITrendsListParamsRegionUsCentral1 SpeedAPITrendsListParamsRegion = "us-central1" - SpeedAPITrendsListParamsRegionUsEast1 SpeedAPITrendsListParamsRegion = "us-east1" - SpeedAPITrendsListParamsRegionUsEast4 SpeedAPITrendsListParamsRegion = "us-east4" - SpeedAPITrendsListParamsRegionUsSouth1 SpeedAPITrendsListParamsRegion = "us-south1" - SpeedAPITrendsListParamsRegionUsWest1 SpeedAPITrendsListParamsRegion = "us-west1" -) - -type SpeedAPITrendsListResponseEnvelope struct { - Result SpeedAPITrendsListResponse `json:"result"` - JSON speedAPITrendsListResponseEnvelopeJSON `json:"-"` -} - -// speedAPITrendsListResponseEnvelopeJSON contains the JSON metadata for the struct -// [SpeedAPITrendsListResponseEnvelope] -type speedAPITrendsListResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPITrendsListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/speedapi_test.go b/speedapi_test.go deleted file mode 100644 index 9f85c57dd22..00000000000 --- a/speedapi_test.go +++ /dev/null @@ -1,300 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestSpeedAPIAvailabilitiesList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.AvailabilitiesList(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPIPagesList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.PagesList(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPIScheduleDeleteWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.ScheduleDelete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPIScheduleDeleteParams{ - Region: cloudflare.F(cloudflare.SpeedAPIScheduleDeleteParamsRegionUsCentral1), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPIScheduleGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.ScheduleGet( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPIScheduleGetParams{ - Region: cloudflare.F(cloudflare.SpeedAPIScheduleGetParamsRegionUsCentral1), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPITestsNewWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.TestsNew( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPITestsNewParams{ - Region: cloudflare.F(cloudflare.SpeedAPITestsNewParamsRegionUsCentral1), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPITestsDeleteWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.TestsDelete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPITestsDeleteParams{ - Region: cloudflare.F(cloudflare.SpeedAPITestsDeleteParamsRegionUsCentral1), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPITestsGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.TestsGet( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - "string", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPITestsListWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.TestsList( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPITestsListParams{ - Page: cloudflare.F(int64(1)), - PerPage: cloudflare.F(int64(20)), - Region: cloudflare.F(cloudflare.SpeedAPITestsListParamsRegionUsCentral1), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSpeedAPITrendsList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.SpeedAPI.TrendsList( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example.com", - cloudflare.SpeedAPITrendsListParams{ - DeviceType: cloudflare.F(cloudflare.SpeedAPITrendsListParamsDeviceTypeDesktop), - Metrics: cloudflare.F("performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls"), - Region: cloudflare.F(cloudflare.SpeedAPITrendsListParamsRegionUsCentral1), - Tz: cloudflare.F("string"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/speedapischedule.go b/speedapischedule.go deleted file mode 100644 index 5a651eed0cb..00000000000 --- a/speedapischedule.go +++ /dev/null @@ -1,483 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// SpeedAPIScheduleService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewSpeedAPIScheduleService] method -// instead. -type SpeedAPIScheduleService struct { - Options []option.RequestOption -} - -// NewSpeedAPIScheduleService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewSpeedAPIScheduleService(opts ...option.RequestOption) (r *SpeedAPIScheduleService) { - r = &SpeedAPIScheduleService{} - r.Options = opts - return -} - -// Creates a scheduled test for a page. -func (r *SpeedAPIScheduleService) New(ctx context.Context, zoneID string, url string, body SpeedAPIScheduleNewParams, opts ...option.RequestOption) (res *SpeedAPIScheduleNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env SpeedAPIScheduleNewResponseEnvelope - path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", zoneID, url) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type SpeedAPIScheduleNewResponse struct { - // The test schedule. - Schedule SpeedAPIScheduleNewResponseSchedule `json:"schedule"` - Test SpeedAPIScheduleNewResponseTest `json:"test"` - JSON speedAPIScheduleNewResponseJSON `json:"-"` -} - -// speedAPIScheduleNewResponseJSON contains the JSON metadata for the struct -// [SpeedAPIScheduleNewResponse] -type speedAPIScheduleNewResponseJSON struct { - Schedule apijson.Field - Test apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The test schedule. -type SpeedAPIScheduleNewResponseSchedule struct { - // The frequency of the test. - Frequency SpeedAPIScheduleNewResponseScheduleFrequency `json:"frequency"` - // A test region. - Region SpeedAPIScheduleNewResponseScheduleRegion `json:"region"` - // A URL. - URL string `json:"url"` - JSON speedAPIScheduleNewResponseScheduleJSON `json:"-"` -} - -// speedAPIScheduleNewResponseScheduleJSON contains the JSON metadata for the -// struct [SpeedAPIScheduleNewResponseSchedule] -type speedAPIScheduleNewResponseScheduleJSON struct { - Frequency apijson.Field - Region apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseSchedule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The frequency of the test. -type SpeedAPIScheduleNewResponseScheduleFrequency string - -const ( - SpeedAPIScheduleNewResponseScheduleFrequencyDaily SpeedAPIScheduleNewResponseScheduleFrequency = "DAILY" - SpeedAPIScheduleNewResponseScheduleFrequencyWeekly SpeedAPIScheduleNewResponseScheduleFrequency = "WEEKLY" -) - -// A test region. -type SpeedAPIScheduleNewResponseScheduleRegion string - -const ( - SpeedAPIScheduleNewResponseScheduleRegionAsiaEast1 SpeedAPIScheduleNewResponseScheduleRegion = "asia-east1" - SpeedAPIScheduleNewResponseScheduleRegionAsiaNortheast1 SpeedAPIScheduleNewResponseScheduleRegion = "asia-northeast1" - SpeedAPIScheduleNewResponseScheduleRegionAsiaNortheast2 SpeedAPIScheduleNewResponseScheduleRegion = "asia-northeast2" - SpeedAPIScheduleNewResponseScheduleRegionAsiaSouth1 SpeedAPIScheduleNewResponseScheduleRegion = "asia-south1" - SpeedAPIScheduleNewResponseScheduleRegionAsiaSoutheast1 SpeedAPIScheduleNewResponseScheduleRegion = "asia-southeast1" - SpeedAPIScheduleNewResponseScheduleRegionAustraliaSoutheast1 SpeedAPIScheduleNewResponseScheduleRegion = "australia-southeast1" - SpeedAPIScheduleNewResponseScheduleRegionEuropeNorth1 SpeedAPIScheduleNewResponseScheduleRegion = "europe-north1" - SpeedAPIScheduleNewResponseScheduleRegionEuropeSouthwest1 SpeedAPIScheduleNewResponseScheduleRegion = "europe-southwest1" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest1 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west1" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest2 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west2" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest3 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west3" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest4 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west4" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest8 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west8" - SpeedAPIScheduleNewResponseScheduleRegionEuropeWest9 SpeedAPIScheduleNewResponseScheduleRegion = "europe-west9" - SpeedAPIScheduleNewResponseScheduleRegionMeWest1 SpeedAPIScheduleNewResponseScheduleRegion = "me-west1" - SpeedAPIScheduleNewResponseScheduleRegionSouthamericaEast1 SpeedAPIScheduleNewResponseScheduleRegion = "southamerica-east1" - SpeedAPIScheduleNewResponseScheduleRegionUsCentral1 SpeedAPIScheduleNewResponseScheduleRegion = "us-central1" - SpeedAPIScheduleNewResponseScheduleRegionUsEast1 SpeedAPIScheduleNewResponseScheduleRegion = "us-east1" - SpeedAPIScheduleNewResponseScheduleRegionUsEast4 SpeedAPIScheduleNewResponseScheduleRegion = "us-east4" - SpeedAPIScheduleNewResponseScheduleRegionUsSouth1 SpeedAPIScheduleNewResponseScheduleRegion = "us-south1" - SpeedAPIScheduleNewResponseScheduleRegionUsWest1 SpeedAPIScheduleNewResponseScheduleRegion = "us-west1" -) - -type SpeedAPIScheduleNewResponseTest struct { - // UUID - ID string `json:"id"` - Date time.Time `json:"date" format:"date-time"` - // The Lighthouse report. - DesktopReport SpeedAPIScheduleNewResponseTestDesktopReport `json:"desktopReport"` - // The Lighthouse report. - MobileReport SpeedAPIScheduleNewResponseTestMobileReport `json:"mobileReport"` - // A test region with a label. - Region SpeedAPIScheduleNewResponseTestRegion `json:"region"` - // The frequency of the test. - ScheduleFrequency SpeedAPIScheduleNewResponseTestScheduleFrequency `json:"scheduleFrequency"` - // A URL. - URL string `json:"url"` - JSON speedAPIScheduleNewResponseTestJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestJSON contains the JSON metadata for the struct -// [SpeedAPIScheduleNewResponseTest] -type speedAPIScheduleNewResponseTestJSON struct { - ID apijson.Field - Date apijson.Field - DesktopReport apijson.Field - MobileReport apijson.Field - Region apijson.Field - ScheduleFrequency apijson.Field - URL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTest) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The Lighthouse report. -type SpeedAPIScheduleNewResponseTestDesktopReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPIScheduleNewResponseTestDesktopReportDeviceType `json:"deviceType"` - Error SpeedAPIScheduleNewResponseTestDesktopReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPIScheduleNewResponseTestDesktopReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPIScheduleNewResponseTestDesktopReportJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestDesktopReportJSON contains the JSON metadata for -// the struct [SpeedAPIScheduleNewResponseTestDesktopReport] -type speedAPIScheduleNewResponseTestDesktopReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTestDesktopReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPIScheduleNewResponseTestDesktopReportDeviceType string - -const ( - SpeedAPIScheduleNewResponseTestDesktopReportDeviceTypeDesktop SpeedAPIScheduleNewResponseTestDesktopReportDeviceType = "DESKTOP" - SpeedAPIScheduleNewResponseTestDesktopReportDeviceTypeMobile SpeedAPIScheduleNewResponseTestDesktopReportDeviceType = "MOBILE" -) - -type SpeedAPIScheduleNewResponseTestDesktopReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPIScheduleNewResponseTestDesktopReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPIScheduleNewResponseTestDesktopReportErrorJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestDesktopReportErrorJSON contains the JSON metadata -// for the struct [SpeedAPIScheduleNewResponseTestDesktopReportError] -type speedAPIScheduleNewResponseTestDesktopReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTestDesktopReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPIScheduleNewResponseTestDesktopReportErrorCode string - -const ( - SpeedAPIScheduleNewResponseTestDesktopReportErrorCodeNotReachable SpeedAPIScheduleNewResponseTestDesktopReportErrorCode = "NOT_REACHABLE" - SpeedAPIScheduleNewResponseTestDesktopReportErrorCodeDNSFailure SpeedAPIScheduleNewResponseTestDesktopReportErrorCode = "DNS_FAILURE" - SpeedAPIScheduleNewResponseTestDesktopReportErrorCodeNotHTML SpeedAPIScheduleNewResponseTestDesktopReportErrorCode = "NOT_HTML" - SpeedAPIScheduleNewResponseTestDesktopReportErrorCodeLighthouseTimeout SpeedAPIScheduleNewResponseTestDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPIScheduleNewResponseTestDesktopReportErrorCodeUnknown SpeedAPIScheduleNewResponseTestDesktopReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPIScheduleNewResponseTestDesktopReportState string - -const ( - SpeedAPIScheduleNewResponseTestDesktopReportStateRunning SpeedAPIScheduleNewResponseTestDesktopReportState = "RUNNING" - SpeedAPIScheduleNewResponseTestDesktopReportStateComplete SpeedAPIScheduleNewResponseTestDesktopReportState = "COMPLETE" - SpeedAPIScheduleNewResponseTestDesktopReportStateFailed SpeedAPIScheduleNewResponseTestDesktopReportState = "FAILED" -) - -// The Lighthouse report. -type SpeedAPIScheduleNewResponseTestMobileReport struct { - // Cumulative Layout Shift. - Cls float64 `json:"cls"` - // The type of device. - DeviceType SpeedAPIScheduleNewResponseTestMobileReportDeviceType `json:"deviceType"` - Error SpeedAPIScheduleNewResponseTestMobileReportError `json:"error"` - // First Contentful Paint. - Fcp float64 `json:"fcp"` - // The URL to the full Lighthouse JSON report. - JsonReportURL string `json:"jsonReportUrl"` - // Largest Contentful Paint. - Lcp float64 `json:"lcp"` - // The Lighthouse performance score. - PerformanceScore float64 `json:"performanceScore"` - // Speed Index. - Si float64 `json:"si"` - // The state of the Lighthouse report. - State SpeedAPIScheduleNewResponseTestMobileReportState `json:"state"` - // Total Blocking Time. - Tbt float64 `json:"tbt"` - // Time To First Byte. - Ttfb float64 `json:"ttfb"` - // Time To Interactive. - Tti float64 `json:"tti"` - JSON speedAPIScheduleNewResponseTestMobileReportJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestMobileReportJSON contains the JSON metadata for -// the struct [SpeedAPIScheduleNewResponseTestMobileReport] -type speedAPIScheduleNewResponseTestMobileReportJSON struct { - Cls apijson.Field - DeviceType apijson.Field - Error apijson.Field - Fcp apijson.Field - JsonReportURL apijson.Field - Lcp apijson.Field - PerformanceScore apijson.Field - Si apijson.Field - State apijson.Field - Tbt apijson.Field - Ttfb apijson.Field - Tti apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTestMobileReport) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The type of device. -type SpeedAPIScheduleNewResponseTestMobileReportDeviceType string - -const ( - SpeedAPIScheduleNewResponseTestMobileReportDeviceTypeDesktop SpeedAPIScheduleNewResponseTestMobileReportDeviceType = "DESKTOP" - SpeedAPIScheduleNewResponseTestMobileReportDeviceTypeMobile SpeedAPIScheduleNewResponseTestMobileReportDeviceType = "MOBILE" -) - -type SpeedAPIScheduleNewResponseTestMobileReportError struct { - // The error code of the Lighthouse result. - Code SpeedAPIScheduleNewResponseTestMobileReportErrorCode `json:"code"` - // Detailed error message. - Detail string `json:"detail"` - // The final URL displayed to the user. - FinalDisplayedURL string `json:"finalDisplayedUrl"` - JSON speedAPIScheduleNewResponseTestMobileReportErrorJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestMobileReportErrorJSON contains the JSON metadata -// for the struct [SpeedAPIScheduleNewResponseTestMobileReportError] -type speedAPIScheduleNewResponseTestMobileReportErrorJSON struct { - Code apijson.Field - Detail apijson.Field - FinalDisplayedURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTestMobileReportError) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// The error code of the Lighthouse result. -type SpeedAPIScheduleNewResponseTestMobileReportErrorCode string - -const ( - SpeedAPIScheduleNewResponseTestMobileReportErrorCodeNotReachable SpeedAPIScheduleNewResponseTestMobileReportErrorCode = "NOT_REACHABLE" - SpeedAPIScheduleNewResponseTestMobileReportErrorCodeDNSFailure SpeedAPIScheduleNewResponseTestMobileReportErrorCode = "DNS_FAILURE" - SpeedAPIScheduleNewResponseTestMobileReportErrorCodeNotHTML SpeedAPIScheduleNewResponseTestMobileReportErrorCode = "NOT_HTML" - SpeedAPIScheduleNewResponseTestMobileReportErrorCodeLighthouseTimeout SpeedAPIScheduleNewResponseTestMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" - SpeedAPIScheduleNewResponseTestMobileReportErrorCodeUnknown SpeedAPIScheduleNewResponseTestMobileReportErrorCode = "UNKNOWN" -) - -// The state of the Lighthouse report. -type SpeedAPIScheduleNewResponseTestMobileReportState string - -const ( - SpeedAPIScheduleNewResponseTestMobileReportStateRunning SpeedAPIScheduleNewResponseTestMobileReportState = "RUNNING" - SpeedAPIScheduleNewResponseTestMobileReportStateComplete SpeedAPIScheduleNewResponseTestMobileReportState = "COMPLETE" - SpeedAPIScheduleNewResponseTestMobileReportStateFailed SpeedAPIScheduleNewResponseTestMobileReportState = "FAILED" -) - -// A test region with a label. -type SpeedAPIScheduleNewResponseTestRegion struct { - Label string `json:"label"` - // A test region. - Value SpeedAPIScheduleNewResponseTestRegionValue `json:"value"` - JSON speedAPIScheduleNewResponseTestRegionJSON `json:"-"` -} - -// speedAPIScheduleNewResponseTestRegionJSON contains the JSON metadata for the -// struct [SpeedAPIScheduleNewResponseTestRegion] -type speedAPIScheduleNewResponseTestRegionJSON struct { - Label apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseTestRegion) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// A test region. -type SpeedAPIScheduleNewResponseTestRegionValue string - -const ( - SpeedAPIScheduleNewResponseTestRegionValueAsiaEast1 SpeedAPIScheduleNewResponseTestRegionValue = "asia-east1" - SpeedAPIScheduleNewResponseTestRegionValueAsiaNortheast1 SpeedAPIScheduleNewResponseTestRegionValue = "asia-northeast1" - SpeedAPIScheduleNewResponseTestRegionValueAsiaNortheast2 SpeedAPIScheduleNewResponseTestRegionValue = "asia-northeast2" - SpeedAPIScheduleNewResponseTestRegionValueAsiaSouth1 SpeedAPIScheduleNewResponseTestRegionValue = "asia-south1" - SpeedAPIScheduleNewResponseTestRegionValueAsiaSoutheast1 SpeedAPIScheduleNewResponseTestRegionValue = "asia-southeast1" - SpeedAPIScheduleNewResponseTestRegionValueAustraliaSoutheast1 SpeedAPIScheduleNewResponseTestRegionValue = "australia-southeast1" - SpeedAPIScheduleNewResponseTestRegionValueEuropeNorth1 SpeedAPIScheduleNewResponseTestRegionValue = "europe-north1" - SpeedAPIScheduleNewResponseTestRegionValueEuropeSouthwest1 SpeedAPIScheduleNewResponseTestRegionValue = "europe-southwest1" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest1 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west1" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest2 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west2" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest3 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west3" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest4 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west4" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest8 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west8" - SpeedAPIScheduleNewResponseTestRegionValueEuropeWest9 SpeedAPIScheduleNewResponseTestRegionValue = "europe-west9" - SpeedAPIScheduleNewResponseTestRegionValueMeWest1 SpeedAPIScheduleNewResponseTestRegionValue = "me-west1" - SpeedAPIScheduleNewResponseTestRegionValueSouthamericaEast1 SpeedAPIScheduleNewResponseTestRegionValue = "southamerica-east1" - SpeedAPIScheduleNewResponseTestRegionValueUsCentral1 SpeedAPIScheduleNewResponseTestRegionValue = "us-central1" - SpeedAPIScheduleNewResponseTestRegionValueUsEast1 SpeedAPIScheduleNewResponseTestRegionValue = "us-east1" - SpeedAPIScheduleNewResponseTestRegionValueUsEast4 SpeedAPIScheduleNewResponseTestRegionValue = "us-east4" - SpeedAPIScheduleNewResponseTestRegionValueUsSouth1 SpeedAPIScheduleNewResponseTestRegionValue = "us-south1" - SpeedAPIScheduleNewResponseTestRegionValueUsWest1 SpeedAPIScheduleNewResponseTestRegionValue = "us-west1" -) - -// The frequency of the test. -type SpeedAPIScheduleNewResponseTestScheduleFrequency string - -const ( - SpeedAPIScheduleNewResponseTestScheduleFrequencyDaily SpeedAPIScheduleNewResponseTestScheduleFrequency = "DAILY" - SpeedAPIScheduleNewResponseTestScheduleFrequencyWeekly SpeedAPIScheduleNewResponseTestScheduleFrequency = "WEEKLY" -) - -type SpeedAPIScheduleNewParams struct { - // A test region. - Region param.Field[SpeedAPIScheduleNewParamsRegion] `query:"region"` -} - -// URLQuery serializes [SpeedAPIScheduleNewParams]'s query parameters as -// `url.Values`. -func (r SpeedAPIScheduleNewParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// A test region. -type SpeedAPIScheduleNewParamsRegion string - -const ( - SpeedAPIScheduleNewParamsRegionAsiaEast1 SpeedAPIScheduleNewParamsRegion = "asia-east1" - SpeedAPIScheduleNewParamsRegionAsiaNortheast1 SpeedAPIScheduleNewParamsRegion = "asia-northeast1" - SpeedAPIScheduleNewParamsRegionAsiaNortheast2 SpeedAPIScheduleNewParamsRegion = "asia-northeast2" - SpeedAPIScheduleNewParamsRegionAsiaSouth1 SpeedAPIScheduleNewParamsRegion = "asia-south1" - SpeedAPIScheduleNewParamsRegionAsiaSoutheast1 SpeedAPIScheduleNewParamsRegion = "asia-southeast1" - SpeedAPIScheduleNewParamsRegionAustraliaSoutheast1 SpeedAPIScheduleNewParamsRegion = "australia-southeast1" - SpeedAPIScheduleNewParamsRegionEuropeNorth1 SpeedAPIScheduleNewParamsRegion = "europe-north1" - SpeedAPIScheduleNewParamsRegionEuropeSouthwest1 SpeedAPIScheduleNewParamsRegion = "europe-southwest1" - SpeedAPIScheduleNewParamsRegionEuropeWest1 SpeedAPIScheduleNewParamsRegion = "europe-west1" - SpeedAPIScheduleNewParamsRegionEuropeWest2 SpeedAPIScheduleNewParamsRegion = "europe-west2" - SpeedAPIScheduleNewParamsRegionEuropeWest3 SpeedAPIScheduleNewParamsRegion = "europe-west3" - SpeedAPIScheduleNewParamsRegionEuropeWest4 SpeedAPIScheduleNewParamsRegion = "europe-west4" - SpeedAPIScheduleNewParamsRegionEuropeWest8 SpeedAPIScheduleNewParamsRegion = "europe-west8" - SpeedAPIScheduleNewParamsRegionEuropeWest9 SpeedAPIScheduleNewParamsRegion = "europe-west9" - SpeedAPIScheduleNewParamsRegionMeWest1 SpeedAPIScheduleNewParamsRegion = "me-west1" - SpeedAPIScheduleNewParamsRegionSouthamericaEast1 SpeedAPIScheduleNewParamsRegion = "southamerica-east1" - SpeedAPIScheduleNewParamsRegionUsCentral1 SpeedAPIScheduleNewParamsRegion = "us-central1" - SpeedAPIScheduleNewParamsRegionUsEast1 SpeedAPIScheduleNewParamsRegion = "us-east1" - SpeedAPIScheduleNewParamsRegionUsEast4 SpeedAPIScheduleNewParamsRegion = "us-east4" - SpeedAPIScheduleNewParamsRegionUsSouth1 SpeedAPIScheduleNewParamsRegion = "us-south1" - SpeedAPIScheduleNewParamsRegionUsWest1 SpeedAPIScheduleNewParamsRegion = "us-west1" -) - -type SpeedAPIScheduleNewResponseEnvelope struct { - Result SpeedAPIScheduleNewResponse `json:"result"` - JSON speedAPIScheduleNewResponseEnvelopeJSON `json:"-"` -} - -// speedAPIScheduleNewResponseEnvelopeJSON contains the JSON metadata for the -// struct [SpeedAPIScheduleNewResponseEnvelope] -type speedAPIScheduleNewResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SpeedAPIScheduleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/speedavailability.go b/speedavailability.go new file mode 100644 index 00000000000..53b9156fa9c --- /dev/null +++ b/speedavailability.go @@ -0,0 +1,160 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// SpeedAvailabilityService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewSpeedAvailabilityService] method +// instead. +type SpeedAvailabilityService struct { + Options []option.RequestOption +} + +// NewSpeedAvailabilityService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewSpeedAvailabilityService(opts ...option.RequestOption) (r *SpeedAvailabilityService) { + r = &SpeedAvailabilityService{} + r.Options = opts + return +} + +// Retrieves quota for all plans, as well as the current zone quota. +func (r *SpeedAvailabilityService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SpeedAvailabilityListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedAvailabilityListResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/availabilities", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type SpeedAvailabilityListResponse struct { + Quota SpeedAvailabilityListResponseQuota `json:"quota"` + Regions []SpeedAvailabilityListResponseRegion `json:"regions"` + RegionsPerPlan interface{} `json:"regionsPerPlan"` + JSON speedAvailabilityListResponseJSON `json:"-"` +} + +// speedAvailabilityListResponseJSON contains the JSON metadata for the struct +// [SpeedAvailabilityListResponse] +type speedAvailabilityListResponseJSON struct { + Quota apijson.Field + Regions apijson.Field + RegionsPerPlan apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedAvailabilityListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedAvailabilityListResponseQuota struct { + // Cloudflare plan. + Plan string `json:"plan"` + // The number of tests available per plan. + QuotasPerPlan map[string]float64 `json:"quotasPerPlan"` + // The number of remaining schedules available. + RemainingSchedules float64 `json:"remainingSchedules"` + // The number of remaining tests available. + RemainingTests float64 `json:"remainingTests"` + // The number of schedules available per plan. + ScheduleQuotasPerPlan map[string]float64 `json:"scheduleQuotasPerPlan"` + JSON speedAvailabilityListResponseQuotaJSON `json:"-"` +} + +// speedAvailabilityListResponseQuotaJSON contains the JSON metadata for the struct +// [SpeedAvailabilityListResponseQuota] +type speedAvailabilityListResponseQuotaJSON struct { + Plan apijson.Field + QuotasPerPlan apijson.Field + RemainingSchedules apijson.Field + RemainingTests apijson.Field + ScheduleQuotasPerPlan apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedAvailabilityListResponseQuota) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region with a label. +type SpeedAvailabilityListResponseRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedAvailabilityListResponseRegionsValue `json:"value"` + JSON speedAvailabilityListResponseRegionJSON `json:"-"` +} + +// speedAvailabilityListResponseRegionJSON contains the JSON metadata for the +// struct [SpeedAvailabilityListResponseRegion] +type speedAvailabilityListResponseRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedAvailabilityListResponseRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedAvailabilityListResponseRegionsValue string + +const ( + SpeedAvailabilityListResponseRegionsValueAsiaEast1 SpeedAvailabilityListResponseRegionsValue = "asia-east1" + SpeedAvailabilityListResponseRegionsValueAsiaNortheast1 SpeedAvailabilityListResponseRegionsValue = "asia-northeast1" + SpeedAvailabilityListResponseRegionsValueAsiaNortheast2 SpeedAvailabilityListResponseRegionsValue = "asia-northeast2" + SpeedAvailabilityListResponseRegionsValueAsiaSouth1 SpeedAvailabilityListResponseRegionsValue = "asia-south1" + SpeedAvailabilityListResponseRegionsValueAsiaSoutheast1 SpeedAvailabilityListResponseRegionsValue = "asia-southeast1" + SpeedAvailabilityListResponseRegionsValueAustraliaSoutheast1 SpeedAvailabilityListResponseRegionsValue = "australia-southeast1" + SpeedAvailabilityListResponseRegionsValueEuropeNorth1 SpeedAvailabilityListResponseRegionsValue = "europe-north1" + SpeedAvailabilityListResponseRegionsValueEuropeSouthwest1 SpeedAvailabilityListResponseRegionsValue = "europe-southwest1" + SpeedAvailabilityListResponseRegionsValueEuropeWest1 SpeedAvailabilityListResponseRegionsValue = "europe-west1" + SpeedAvailabilityListResponseRegionsValueEuropeWest2 SpeedAvailabilityListResponseRegionsValue = "europe-west2" + SpeedAvailabilityListResponseRegionsValueEuropeWest3 SpeedAvailabilityListResponseRegionsValue = "europe-west3" + SpeedAvailabilityListResponseRegionsValueEuropeWest4 SpeedAvailabilityListResponseRegionsValue = "europe-west4" + SpeedAvailabilityListResponseRegionsValueEuropeWest8 SpeedAvailabilityListResponseRegionsValue = "europe-west8" + SpeedAvailabilityListResponseRegionsValueEuropeWest9 SpeedAvailabilityListResponseRegionsValue = "europe-west9" + SpeedAvailabilityListResponseRegionsValueMeWest1 SpeedAvailabilityListResponseRegionsValue = "me-west1" + SpeedAvailabilityListResponseRegionsValueSouthamericaEast1 SpeedAvailabilityListResponseRegionsValue = "southamerica-east1" + SpeedAvailabilityListResponseRegionsValueUsCentral1 SpeedAvailabilityListResponseRegionsValue = "us-central1" + SpeedAvailabilityListResponseRegionsValueUsEast1 SpeedAvailabilityListResponseRegionsValue = "us-east1" + SpeedAvailabilityListResponseRegionsValueUsEast4 SpeedAvailabilityListResponseRegionsValue = "us-east4" + SpeedAvailabilityListResponseRegionsValueUsSouth1 SpeedAvailabilityListResponseRegionsValue = "us-south1" + SpeedAvailabilityListResponseRegionsValueUsWest1 SpeedAvailabilityListResponseRegionsValue = "us-west1" +) + +type SpeedAvailabilityListResponseEnvelope struct { + Result SpeedAvailabilityListResponse `json:"result"` + JSON speedAvailabilityListResponseEnvelopeJSON `json:"-"` +} + +// speedAvailabilityListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SpeedAvailabilityListResponseEnvelope] +type speedAvailabilityListResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedAvailabilityListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/customnavailability_test.go b/speedavailability_test.go similarity index 87% rename from customnavailability_test.go rename to speedavailability_test.go index 07a087936ea..2ab3f657ff1 100644 --- a/customnavailability_test.go +++ b/speedavailability_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCustomNAvailabilityGet(t *testing.T) { +func TestSpeedAvailabilityList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestCustomNAvailabilityGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CustomNs.Availabilities.Get(context.TODO(), "372e67954025e0ba6aaa6d586b9e0b59") + _, err := client.Speed.Availabilities.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/speedpage.go b/speedpage.go new file mode 100644 index 00000000000..bbca96727f4 --- /dev/null +++ b/speedpage.go @@ -0,0 +1,440 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// SpeedPageService contains methods and other services that help with interacting +// with the cloudflare API. Note, unlike clients, this service does not read +// variables from the environment automatically. You should not instantiate this +// service directly, and instead use the [NewSpeedPageService] method instead. +type SpeedPageService struct { + Options []option.RequestOption +} + +// NewSpeedPageService generates a new service that applies the given options to +// each request. These options are applied after the parent client's options (if +// there is one), and before any request-specific options. +func NewSpeedPageService(opts ...option.RequestOption) (r *SpeedPageService) { + r = &SpeedPageService{} + r.Options = opts + return +} + +// Lists all webpages which have been tested. +func (r *SpeedPageService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]SpeedPageListResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedPageListResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/pages", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type SpeedPageListResponse struct { + // A test region with a label. + Region SpeedPageListResponseRegion `json:"region"` + // The frequency of the test. + ScheduleFrequency SpeedPageListResponseScheduleFrequency `json:"scheduleFrequency"` + Tests []SpeedPageListResponseTest `json:"tests"` + // A URL. + URL string `json:"url"` + JSON speedPageListResponseJSON `json:"-"` +} + +// speedPageListResponseJSON contains the JSON metadata for the struct +// [SpeedPageListResponse] +type speedPageListResponseJSON struct { + Region apijson.Field + ScheduleFrequency apijson.Field + Tests apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region with a label. +type SpeedPageListResponseRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedPageListResponseRegionValue `json:"value"` + JSON speedPageListResponseRegionJSON `json:"-"` +} + +// speedPageListResponseRegionJSON contains the JSON metadata for the struct +// [SpeedPageListResponseRegion] +type speedPageListResponseRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedPageListResponseRegionValue string + +const ( + SpeedPageListResponseRegionValueAsiaEast1 SpeedPageListResponseRegionValue = "asia-east1" + SpeedPageListResponseRegionValueAsiaNortheast1 SpeedPageListResponseRegionValue = "asia-northeast1" + SpeedPageListResponseRegionValueAsiaNortheast2 SpeedPageListResponseRegionValue = "asia-northeast2" + SpeedPageListResponseRegionValueAsiaSouth1 SpeedPageListResponseRegionValue = "asia-south1" + SpeedPageListResponseRegionValueAsiaSoutheast1 SpeedPageListResponseRegionValue = "asia-southeast1" + SpeedPageListResponseRegionValueAustraliaSoutheast1 SpeedPageListResponseRegionValue = "australia-southeast1" + SpeedPageListResponseRegionValueEuropeNorth1 SpeedPageListResponseRegionValue = "europe-north1" + SpeedPageListResponseRegionValueEuropeSouthwest1 SpeedPageListResponseRegionValue = "europe-southwest1" + SpeedPageListResponseRegionValueEuropeWest1 SpeedPageListResponseRegionValue = "europe-west1" + SpeedPageListResponseRegionValueEuropeWest2 SpeedPageListResponseRegionValue = "europe-west2" + SpeedPageListResponseRegionValueEuropeWest3 SpeedPageListResponseRegionValue = "europe-west3" + SpeedPageListResponseRegionValueEuropeWest4 SpeedPageListResponseRegionValue = "europe-west4" + SpeedPageListResponseRegionValueEuropeWest8 SpeedPageListResponseRegionValue = "europe-west8" + SpeedPageListResponseRegionValueEuropeWest9 SpeedPageListResponseRegionValue = "europe-west9" + SpeedPageListResponseRegionValueMeWest1 SpeedPageListResponseRegionValue = "me-west1" + SpeedPageListResponseRegionValueSouthamericaEast1 SpeedPageListResponseRegionValue = "southamerica-east1" + SpeedPageListResponseRegionValueUsCentral1 SpeedPageListResponseRegionValue = "us-central1" + SpeedPageListResponseRegionValueUsEast1 SpeedPageListResponseRegionValue = "us-east1" + SpeedPageListResponseRegionValueUsEast4 SpeedPageListResponseRegionValue = "us-east4" + SpeedPageListResponseRegionValueUsSouth1 SpeedPageListResponseRegionValue = "us-south1" + SpeedPageListResponseRegionValueUsWest1 SpeedPageListResponseRegionValue = "us-west1" +) + +// The frequency of the test. +type SpeedPageListResponseScheduleFrequency string + +const ( + SpeedPageListResponseScheduleFrequencyDaily SpeedPageListResponseScheduleFrequency = "DAILY" + SpeedPageListResponseScheduleFrequencyWeekly SpeedPageListResponseScheduleFrequency = "WEEKLY" +) + +type SpeedPageListResponseTest struct { + // UUID + ID string `json:"id"` + Date time.Time `json:"date" format:"date-time"` + // The Lighthouse report. + DesktopReport SpeedPageListResponseTestsDesktopReport `json:"desktopReport"` + // The Lighthouse report. + MobileReport SpeedPageListResponseTestsMobileReport `json:"mobileReport"` + // A test region with a label. + Region SpeedPageListResponseTestsRegion `json:"region"` + // The frequency of the test. + ScheduleFrequency SpeedPageListResponseTestsScheduleFrequency `json:"scheduleFrequency"` + // A URL. + URL string `json:"url"` + JSON speedPageListResponseTestJSON `json:"-"` +} + +// speedPageListResponseTestJSON contains the JSON metadata for the struct +// [SpeedPageListResponseTest] +type speedPageListResponseTestJSON struct { + ID apijson.Field + Date apijson.Field + DesktopReport apijson.Field + MobileReport apijson.Field + Region apijson.Field + ScheduleFrequency apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTest) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The Lighthouse report. +type SpeedPageListResponseTestsDesktopReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedPageListResponseTestsDesktopReportDeviceType `json:"deviceType"` + Error SpeedPageListResponseTestsDesktopReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedPageListResponseTestsDesktopReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedPageListResponseTestsDesktopReportJSON `json:"-"` +} + +// speedPageListResponseTestsDesktopReportJSON contains the JSON metadata for the +// struct [SpeedPageListResponseTestsDesktopReport] +type speedPageListResponseTestsDesktopReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTestsDesktopReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedPageListResponseTestsDesktopReportDeviceType string + +const ( + SpeedPageListResponseTestsDesktopReportDeviceTypeDesktop SpeedPageListResponseTestsDesktopReportDeviceType = "DESKTOP" + SpeedPageListResponseTestsDesktopReportDeviceTypeMobile SpeedPageListResponseTestsDesktopReportDeviceType = "MOBILE" +) + +type SpeedPageListResponseTestsDesktopReportError struct { + // The error code of the Lighthouse result. + Code SpeedPageListResponseTestsDesktopReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedPageListResponseTestsDesktopReportErrorJSON `json:"-"` +} + +// speedPageListResponseTestsDesktopReportErrorJSON contains the JSON metadata for +// the struct [SpeedPageListResponseTestsDesktopReportError] +type speedPageListResponseTestsDesktopReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTestsDesktopReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedPageListResponseTestsDesktopReportErrorCode string + +const ( + SpeedPageListResponseTestsDesktopReportErrorCodeNotReachable SpeedPageListResponseTestsDesktopReportErrorCode = "NOT_REACHABLE" + SpeedPageListResponseTestsDesktopReportErrorCodeDNSFailure SpeedPageListResponseTestsDesktopReportErrorCode = "DNS_FAILURE" + SpeedPageListResponseTestsDesktopReportErrorCodeNotHTML SpeedPageListResponseTestsDesktopReportErrorCode = "NOT_HTML" + SpeedPageListResponseTestsDesktopReportErrorCodeLighthouseTimeout SpeedPageListResponseTestsDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedPageListResponseTestsDesktopReportErrorCodeUnknown SpeedPageListResponseTestsDesktopReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedPageListResponseTestsDesktopReportState string + +const ( + SpeedPageListResponseTestsDesktopReportStateRunning SpeedPageListResponseTestsDesktopReportState = "RUNNING" + SpeedPageListResponseTestsDesktopReportStateComplete SpeedPageListResponseTestsDesktopReportState = "COMPLETE" + SpeedPageListResponseTestsDesktopReportStateFailed SpeedPageListResponseTestsDesktopReportState = "FAILED" +) + +// The Lighthouse report. +type SpeedPageListResponseTestsMobileReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedPageListResponseTestsMobileReportDeviceType `json:"deviceType"` + Error SpeedPageListResponseTestsMobileReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedPageListResponseTestsMobileReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedPageListResponseTestsMobileReportJSON `json:"-"` +} + +// speedPageListResponseTestsMobileReportJSON contains the JSON metadata for the +// struct [SpeedPageListResponseTestsMobileReport] +type speedPageListResponseTestsMobileReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTestsMobileReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedPageListResponseTestsMobileReportDeviceType string + +const ( + SpeedPageListResponseTestsMobileReportDeviceTypeDesktop SpeedPageListResponseTestsMobileReportDeviceType = "DESKTOP" + SpeedPageListResponseTestsMobileReportDeviceTypeMobile SpeedPageListResponseTestsMobileReportDeviceType = "MOBILE" +) + +type SpeedPageListResponseTestsMobileReportError struct { + // The error code of the Lighthouse result. + Code SpeedPageListResponseTestsMobileReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedPageListResponseTestsMobileReportErrorJSON `json:"-"` +} + +// speedPageListResponseTestsMobileReportErrorJSON contains the JSON metadata for +// the struct [SpeedPageListResponseTestsMobileReportError] +type speedPageListResponseTestsMobileReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTestsMobileReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedPageListResponseTestsMobileReportErrorCode string + +const ( + SpeedPageListResponseTestsMobileReportErrorCodeNotReachable SpeedPageListResponseTestsMobileReportErrorCode = "NOT_REACHABLE" + SpeedPageListResponseTestsMobileReportErrorCodeDNSFailure SpeedPageListResponseTestsMobileReportErrorCode = "DNS_FAILURE" + SpeedPageListResponseTestsMobileReportErrorCodeNotHTML SpeedPageListResponseTestsMobileReportErrorCode = "NOT_HTML" + SpeedPageListResponseTestsMobileReportErrorCodeLighthouseTimeout SpeedPageListResponseTestsMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedPageListResponseTestsMobileReportErrorCodeUnknown SpeedPageListResponseTestsMobileReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedPageListResponseTestsMobileReportState string + +const ( + SpeedPageListResponseTestsMobileReportStateRunning SpeedPageListResponseTestsMobileReportState = "RUNNING" + SpeedPageListResponseTestsMobileReportStateComplete SpeedPageListResponseTestsMobileReportState = "COMPLETE" + SpeedPageListResponseTestsMobileReportStateFailed SpeedPageListResponseTestsMobileReportState = "FAILED" +) + +// A test region with a label. +type SpeedPageListResponseTestsRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedPageListResponseTestsRegionValue `json:"value"` + JSON speedPageListResponseTestsRegionJSON `json:"-"` +} + +// speedPageListResponseTestsRegionJSON contains the JSON metadata for the struct +// [SpeedPageListResponseTestsRegion] +type speedPageListResponseTestsRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseTestsRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedPageListResponseTestsRegionValue string + +const ( + SpeedPageListResponseTestsRegionValueAsiaEast1 SpeedPageListResponseTestsRegionValue = "asia-east1" + SpeedPageListResponseTestsRegionValueAsiaNortheast1 SpeedPageListResponseTestsRegionValue = "asia-northeast1" + SpeedPageListResponseTestsRegionValueAsiaNortheast2 SpeedPageListResponseTestsRegionValue = "asia-northeast2" + SpeedPageListResponseTestsRegionValueAsiaSouth1 SpeedPageListResponseTestsRegionValue = "asia-south1" + SpeedPageListResponseTestsRegionValueAsiaSoutheast1 SpeedPageListResponseTestsRegionValue = "asia-southeast1" + SpeedPageListResponseTestsRegionValueAustraliaSoutheast1 SpeedPageListResponseTestsRegionValue = "australia-southeast1" + SpeedPageListResponseTestsRegionValueEuropeNorth1 SpeedPageListResponseTestsRegionValue = "europe-north1" + SpeedPageListResponseTestsRegionValueEuropeSouthwest1 SpeedPageListResponseTestsRegionValue = "europe-southwest1" + SpeedPageListResponseTestsRegionValueEuropeWest1 SpeedPageListResponseTestsRegionValue = "europe-west1" + SpeedPageListResponseTestsRegionValueEuropeWest2 SpeedPageListResponseTestsRegionValue = "europe-west2" + SpeedPageListResponseTestsRegionValueEuropeWest3 SpeedPageListResponseTestsRegionValue = "europe-west3" + SpeedPageListResponseTestsRegionValueEuropeWest4 SpeedPageListResponseTestsRegionValue = "europe-west4" + SpeedPageListResponseTestsRegionValueEuropeWest8 SpeedPageListResponseTestsRegionValue = "europe-west8" + SpeedPageListResponseTestsRegionValueEuropeWest9 SpeedPageListResponseTestsRegionValue = "europe-west9" + SpeedPageListResponseTestsRegionValueMeWest1 SpeedPageListResponseTestsRegionValue = "me-west1" + SpeedPageListResponseTestsRegionValueSouthamericaEast1 SpeedPageListResponseTestsRegionValue = "southamerica-east1" + SpeedPageListResponseTestsRegionValueUsCentral1 SpeedPageListResponseTestsRegionValue = "us-central1" + SpeedPageListResponseTestsRegionValueUsEast1 SpeedPageListResponseTestsRegionValue = "us-east1" + SpeedPageListResponseTestsRegionValueUsEast4 SpeedPageListResponseTestsRegionValue = "us-east4" + SpeedPageListResponseTestsRegionValueUsSouth1 SpeedPageListResponseTestsRegionValue = "us-south1" + SpeedPageListResponseTestsRegionValueUsWest1 SpeedPageListResponseTestsRegionValue = "us-west1" +) + +// The frequency of the test. +type SpeedPageListResponseTestsScheduleFrequency string + +const ( + SpeedPageListResponseTestsScheduleFrequencyDaily SpeedPageListResponseTestsScheduleFrequency = "DAILY" + SpeedPageListResponseTestsScheduleFrequencyWeekly SpeedPageListResponseTestsScheduleFrequency = "WEEKLY" +) + +type SpeedPageListResponseEnvelope struct { + Result []SpeedPageListResponse `json:"result"` + JSON speedPageListResponseEnvelopeJSON `json:"-"` +} + +// speedPageListResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedPageListResponseEnvelope] +type speedPageListResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedPageListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/usertokenverify_test.go b/speedpage_test.go similarity index 87% rename from usertokenverify_test.go rename to speedpage_test.go index 138b4b6afb5..7fa7aaa664a 100644 --- a/usertokenverify_test.go +++ b/speedpage_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserTokenVerifyUserAPITokensVerifyToken(t *testing.T) { +func TestSpeedPageList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserTokenVerifyUserAPITokensVerifyToken(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.Verifies.UserAPITokensVerifyToken(context.TODO()) + _, err := client.Speed.Pages.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/speedschedule.go b/speedschedule.go new file mode 100644 index 00000000000..6a6e24b62ce --- /dev/null +++ b/speedschedule.go @@ -0,0 +1,482 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// SpeedScheduleService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewSpeedScheduleService] method +// instead. +type SpeedScheduleService struct { + Options []option.RequestOption +} + +// NewSpeedScheduleService generates a new service that applies the given options +// to each request. These options are applied after the parent client's options (if +// there is one), and before any request-specific options. +func NewSpeedScheduleService(opts ...option.RequestOption) (r *SpeedScheduleService) { + r = &SpeedScheduleService{} + r.Options = opts + return +} + +// Creates a scheduled test for a page. +func (r *SpeedScheduleService) New(ctx context.Context, zoneID string, url string, body SpeedScheduleNewParams, opts ...option.RequestOption) (res *SpeedScheduleNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env SpeedScheduleNewResponseEnvelope + path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +type SpeedScheduleNewResponse struct { + // The test schedule. + Schedule SpeedScheduleNewResponseSchedule `json:"schedule"` + Test SpeedScheduleNewResponseTest `json:"test"` + JSON speedScheduleNewResponseJSON `json:"-"` +} + +// speedScheduleNewResponseJSON contains the JSON metadata for the struct +// [SpeedScheduleNewResponse] +type speedScheduleNewResponseJSON struct { + Schedule apijson.Field + Test apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The test schedule. +type SpeedScheduleNewResponseSchedule struct { + // The frequency of the test. + Frequency SpeedScheduleNewResponseScheduleFrequency `json:"frequency"` + // A test region. + Region SpeedScheduleNewResponseScheduleRegion `json:"region"` + // A URL. + URL string `json:"url"` + JSON speedScheduleNewResponseScheduleJSON `json:"-"` +} + +// speedScheduleNewResponseScheduleJSON contains the JSON metadata for the struct +// [SpeedScheduleNewResponseSchedule] +type speedScheduleNewResponseScheduleJSON struct { + Frequency apijson.Field + Region apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseSchedule) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The frequency of the test. +type SpeedScheduleNewResponseScheduleFrequency string + +const ( + SpeedScheduleNewResponseScheduleFrequencyDaily SpeedScheduleNewResponseScheduleFrequency = "DAILY" + SpeedScheduleNewResponseScheduleFrequencyWeekly SpeedScheduleNewResponseScheduleFrequency = "WEEKLY" +) + +// A test region. +type SpeedScheduleNewResponseScheduleRegion string + +const ( + SpeedScheduleNewResponseScheduleRegionAsiaEast1 SpeedScheduleNewResponseScheduleRegion = "asia-east1" + SpeedScheduleNewResponseScheduleRegionAsiaNortheast1 SpeedScheduleNewResponseScheduleRegion = "asia-northeast1" + SpeedScheduleNewResponseScheduleRegionAsiaNortheast2 SpeedScheduleNewResponseScheduleRegion = "asia-northeast2" + SpeedScheduleNewResponseScheduleRegionAsiaSouth1 SpeedScheduleNewResponseScheduleRegion = "asia-south1" + SpeedScheduleNewResponseScheduleRegionAsiaSoutheast1 SpeedScheduleNewResponseScheduleRegion = "asia-southeast1" + SpeedScheduleNewResponseScheduleRegionAustraliaSoutheast1 SpeedScheduleNewResponseScheduleRegion = "australia-southeast1" + SpeedScheduleNewResponseScheduleRegionEuropeNorth1 SpeedScheduleNewResponseScheduleRegion = "europe-north1" + SpeedScheduleNewResponseScheduleRegionEuropeSouthwest1 SpeedScheduleNewResponseScheduleRegion = "europe-southwest1" + SpeedScheduleNewResponseScheduleRegionEuropeWest1 SpeedScheduleNewResponseScheduleRegion = "europe-west1" + SpeedScheduleNewResponseScheduleRegionEuropeWest2 SpeedScheduleNewResponseScheduleRegion = "europe-west2" + SpeedScheduleNewResponseScheduleRegionEuropeWest3 SpeedScheduleNewResponseScheduleRegion = "europe-west3" + SpeedScheduleNewResponseScheduleRegionEuropeWest4 SpeedScheduleNewResponseScheduleRegion = "europe-west4" + SpeedScheduleNewResponseScheduleRegionEuropeWest8 SpeedScheduleNewResponseScheduleRegion = "europe-west8" + SpeedScheduleNewResponseScheduleRegionEuropeWest9 SpeedScheduleNewResponseScheduleRegion = "europe-west9" + SpeedScheduleNewResponseScheduleRegionMeWest1 SpeedScheduleNewResponseScheduleRegion = "me-west1" + SpeedScheduleNewResponseScheduleRegionSouthamericaEast1 SpeedScheduleNewResponseScheduleRegion = "southamerica-east1" + SpeedScheduleNewResponseScheduleRegionUsCentral1 SpeedScheduleNewResponseScheduleRegion = "us-central1" + SpeedScheduleNewResponseScheduleRegionUsEast1 SpeedScheduleNewResponseScheduleRegion = "us-east1" + SpeedScheduleNewResponseScheduleRegionUsEast4 SpeedScheduleNewResponseScheduleRegion = "us-east4" + SpeedScheduleNewResponseScheduleRegionUsSouth1 SpeedScheduleNewResponseScheduleRegion = "us-south1" + SpeedScheduleNewResponseScheduleRegionUsWest1 SpeedScheduleNewResponseScheduleRegion = "us-west1" +) + +type SpeedScheduleNewResponseTest struct { + // UUID + ID string `json:"id"` + Date time.Time `json:"date" format:"date-time"` + // The Lighthouse report. + DesktopReport SpeedScheduleNewResponseTestDesktopReport `json:"desktopReport"` + // The Lighthouse report. + MobileReport SpeedScheduleNewResponseTestMobileReport `json:"mobileReport"` + // A test region with a label. + Region SpeedScheduleNewResponseTestRegion `json:"region"` + // The frequency of the test. + ScheduleFrequency SpeedScheduleNewResponseTestScheduleFrequency `json:"scheduleFrequency"` + // A URL. + URL string `json:"url"` + JSON speedScheduleNewResponseTestJSON `json:"-"` +} + +// speedScheduleNewResponseTestJSON contains the JSON metadata for the struct +// [SpeedScheduleNewResponseTest] +type speedScheduleNewResponseTestJSON struct { + ID apijson.Field + Date apijson.Field + DesktopReport apijson.Field + MobileReport apijson.Field + Region apijson.Field + ScheduleFrequency apijson.Field + URL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTest) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The Lighthouse report. +type SpeedScheduleNewResponseTestDesktopReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedScheduleNewResponseTestDesktopReportDeviceType `json:"deviceType"` + Error SpeedScheduleNewResponseTestDesktopReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedScheduleNewResponseTestDesktopReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedScheduleNewResponseTestDesktopReportJSON `json:"-"` +} + +// speedScheduleNewResponseTestDesktopReportJSON contains the JSON metadata for the +// struct [SpeedScheduleNewResponseTestDesktopReport] +type speedScheduleNewResponseTestDesktopReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTestDesktopReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedScheduleNewResponseTestDesktopReportDeviceType string + +const ( + SpeedScheduleNewResponseTestDesktopReportDeviceTypeDesktop SpeedScheduleNewResponseTestDesktopReportDeviceType = "DESKTOP" + SpeedScheduleNewResponseTestDesktopReportDeviceTypeMobile SpeedScheduleNewResponseTestDesktopReportDeviceType = "MOBILE" +) + +type SpeedScheduleNewResponseTestDesktopReportError struct { + // The error code of the Lighthouse result. + Code SpeedScheduleNewResponseTestDesktopReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedScheduleNewResponseTestDesktopReportErrorJSON `json:"-"` +} + +// speedScheduleNewResponseTestDesktopReportErrorJSON contains the JSON metadata +// for the struct [SpeedScheduleNewResponseTestDesktopReportError] +type speedScheduleNewResponseTestDesktopReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTestDesktopReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedScheduleNewResponseTestDesktopReportErrorCode string + +const ( + SpeedScheduleNewResponseTestDesktopReportErrorCodeNotReachable SpeedScheduleNewResponseTestDesktopReportErrorCode = "NOT_REACHABLE" + SpeedScheduleNewResponseTestDesktopReportErrorCodeDNSFailure SpeedScheduleNewResponseTestDesktopReportErrorCode = "DNS_FAILURE" + SpeedScheduleNewResponseTestDesktopReportErrorCodeNotHTML SpeedScheduleNewResponseTestDesktopReportErrorCode = "NOT_HTML" + SpeedScheduleNewResponseTestDesktopReportErrorCodeLighthouseTimeout SpeedScheduleNewResponseTestDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedScheduleNewResponseTestDesktopReportErrorCodeUnknown SpeedScheduleNewResponseTestDesktopReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedScheduleNewResponseTestDesktopReportState string + +const ( + SpeedScheduleNewResponseTestDesktopReportStateRunning SpeedScheduleNewResponseTestDesktopReportState = "RUNNING" + SpeedScheduleNewResponseTestDesktopReportStateComplete SpeedScheduleNewResponseTestDesktopReportState = "COMPLETE" + SpeedScheduleNewResponseTestDesktopReportStateFailed SpeedScheduleNewResponseTestDesktopReportState = "FAILED" +) + +// The Lighthouse report. +type SpeedScheduleNewResponseTestMobileReport struct { + // Cumulative Layout Shift. + Cls float64 `json:"cls"` + // The type of device. + DeviceType SpeedScheduleNewResponseTestMobileReportDeviceType `json:"deviceType"` + Error SpeedScheduleNewResponseTestMobileReportError `json:"error"` + // First Contentful Paint. + Fcp float64 `json:"fcp"` + // The URL to the full Lighthouse JSON report. + JsonReportURL string `json:"jsonReportUrl"` + // Largest Contentful Paint. + Lcp float64 `json:"lcp"` + // The Lighthouse performance score. + PerformanceScore float64 `json:"performanceScore"` + // Speed Index. + Si float64 `json:"si"` + // The state of the Lighthouse report. + State SpeedScheduleNewResponseTestMobileReportState `json:"state"` + // Total Blocking Time. + Tbt float64 `json:"tbt"` + // Time To First Byte. + Ttfb float64 `json:"ttfb"` + // Time To Interactive. + Tti float64 `json:"tti"` + JSON speedScheduleNewResponseTestMobileReportJSON `json:"-"` +} + +// speedScheduleNewResponseTestMobileReportJSON contains the JSON metadata for the +// struct [SpeedScheduleNewResponseTestMobileReport] +type speedScheduleNewResponseTestMobileReportJSON struct { + Cls apijson.Field + DeviceType apijson.Field + Error apijson.Field + Fcp apijson.Field + JsonReportURL apijson.Field + Lcp apijson.Field + PerformanceScore apijson.Field + Si apijson.Field + State apijson.Field + Tbt apijson.Field + Ttfb apijson.Field + Tti apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTestMobileReport) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of device. +type SpeedScheduleNewResponseTestMobileReportDeviceType string + +const ( + SpeedScheduleNewResponseTestMobileReportDeviceTypeDesktop SpeedScheduleNewResponseTestMobileReportDeviceType = "DESKTOP" + SpeedScheduleNewResponseTestMobileReportDeviceTypeMobile SpeedScheduleNewResponseTestMobileReportDeviceType = "MOBILE" +) + +type SpeedScheduleNewResponseTestMobileReportError struct { + // The error code of the Lighthouse result. + Code SpeedScheduleNewResponseTestMobileReportErrorCode `json:"code"` + // Detailed error message. + Detail string `json:"detail"` + // The final URL displayed to the user. + FinalDisplayedURL string `json:"finalDisplayedUrl"` + JSON speedScheduleNewResponseTestMobileReportErrorJSON `json:"-"` +} + +// speedScheduleNewResponseTestMobileReportErrorJSON contains the JSON metadata for +// the struct [SpeedScheduleNewResponseTestMobileReportError] +type speedScheduleNewResponseTestMobileReportErrorJSON struct { + Code apijson.Field + Detail apijson.Field + FinalDisplayedURL apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTestMobileReportError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The error code of the Lighthouse result. +type SpeedScheduleNewResponseTestMobileReportErrorCode string + +const ( + SpeedScheduleNewResponseTestMobileReportErrorCodeNotReachable SpeedScheduleNewResponseTestMobileReportErrorCode = "NOT_REACHABLE" + SpeedScheduleNewResponseTestMobileReportErrorCodeDNSFailure SpeedScheduleNewResponseTestMobileReportErrorCode = "DNS_FAILURE" + SpeedScheduleNewResponseTestMobileReportErrorCodeNotHTML SpeedScheduleNewResponseTestMobileReportErrorCode = "NOT_HTML" + SpeedScheduleNewResponseTestMobileReportErrorCodeLighthouseTimeout SpeedScheduleNewResponseTestMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT" + SpeedScheduleNewResponseTestMobileReportErrorCodeUnknown SpeedScheduleNewResponseTestMobileReportErrorCode = "UNKNOWN" +) + +// The state of the Lighthouse report. +type SpeedScheduleNewResponseTestMobileReportState string + +const ( + SpeedScheduleNewResponseTestMobileReportStateRunning SpeedScheduleNewResponseTestMobileReportState = "RUNNING" + SpeedScheduleNewResponseTestMobileReportStateComplete SpeedScheduleNewResponseTestMobileReportState = "COMPLETE" + SpeedScheduleNewResponseTestMobileReportStateFailed SpeedScheduleNewResponseTestMobileReportState = "FAILED" +) + +// A test region with a label. +type SpeedScheduleNewResponseTestRegion struct { + Label string `json:"label"` + // A test region. + Value SpeedScheduleNewResponseTestRegionValue `json:"value"` + JSON speedScheduleNewResponseTestRegionJSON `json:"-"` +} + +// speedScheduleNewResponseTestRegionJSON contains the JSON metadata for the struct +// [SpeedScheduleNewResponseTestRegion] +type speedScheduleNewResponseTestRegionJSON struct { + Label apijson.Field + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseTestRegion) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// A test region. +type SpeedScheduleNewResponseTestRegionValue string + +const ( + SpeedScheduleNewResponseTestRegionValueAsiaEast1 SpeedScheduleNewResponseTestRegionValue = "asia-east1" + SpeedScheduleNewResponseTestRegionValueAsiaNortheast1 SpeedScheduleNewResponseTestRegionValue = "asia-northeast1" + SpeedScheduleNewResponseTestRegionValueAsiaNortheast2 SpeedScheduleNewResponseTestRegionValue = "asia-northeast2" + SpeedScheduleNewResponseTestRegionValueAsiaSouth1 SpeedScheduleNewResponseTestRegionValue = "asia-south1" + SpeedScheduleNewResponseTestRegionValueAsiaSoutheast1 SpeedScheduleNewResponseTestRegionValue = "asia-southeast1" + SpeedScheduleNewResponseTestRegionValueAustraliaSoutheast1 SpeedScheduleNewResponseTestRegionValue = "australia-southeast1" + SpeedScheduleNewResponseTestRegionValueEuropeNorth1 SpeedScheduleNewResponseTestRegionValue = "europe-north1" + SpeedScheduleNewResponseTestRegionValueEuropeSouthwest1 SpeedScheduleNewResponseTestRegionValue = "europe-southwest1" + SpeedScheduleNewResponseTestRegionValueEuropeWest1 SpeedScheduleNewResponseTestRegionValue = "europe-west1" + SpeedScheduleNewResponseTestRegionValueEuropeWest2 SpeedScheduleNewResponseTestRegionValue = "europe-west2" + SpeedScheduleNewResponseTestRegionValueEuropeWest3 SpeedScheduleNewResponseTestRegionValue = "europe-west3" + SpeedScheduleNewResponseTestRegionValueEuropeWest4 SpeedScheduleNewResponseTestRegionValue = "europe-west4" + SpeedScheduleNewResponseTestRegionValueEuropeWest8 SpeedScheduleNewResponseTestRegionValue = "europe-west8" + SpeedScheduleNewResponseTestRegionValueEuropeWest9 SpeedScheduleNewResponseTestRegionValue = "europe-west9" + SpeedScheduleNewResponseTestRegionValueMeWest1 SpeedScheduleNewResponseTestRegionValue = "me-west1" + SpeedScheduleNewResponseTestRegionValueSouthamericaEast1 SpeedScheduleNewResponseTestRegionValue = "southamerica-east1" + SpeedScheduleNewResponseTestRegionValueUsCentral1 SpeedScheduleNewResponseTestRegionValue = "us-central1" + SpeedScheduleNewResponseTestRegionValueUsEast1 SpeedScheduleNewResponseTestRegionValue = "us-east1" + SpeedScheduleNewResponseTestRegionValueUsEast4 SpeedScheduleNewResponseTestRegionValue = "us-east4" + SpeedScheduleNewResponseTestRegionValueUsSouth1 SpeedScheduleNewResponseTestRegionValue = "us-south1" + SpeedScheduleNewResponseTestRegionValueUsWest1 SpeedScheduleNewResponseTestRegionValue = "us-west1" +) + +// The frequency of the test. +type SpeedScheduleNewResponseTestScheduleFrequency string + +const ( + SpeedScheduleNewResponseTestScheduleFrequencyDaily SpeedScheduleNewResponseTestScheduleFrequency = "DAILY" + SpeedScheduleNewResponseTestScheduleFrequencyWeekly SpeedScheduleNewResponseTestScheduleFrequency = "WEEKLY" +) + +type SpeedScheduleNewParams struct { + // A test region. + Region param.Field[SpeedScheduleNewParamsRegion] `query:"region"` +} + +// URLQuery serializes [SpeedScheduleNewParams]'s query parameters as `url.Values`. +func (r SpeedScheduleNewParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// A test region. +type SpeedScheduleNewParamsRegion string + +const ( + SpeedScheduleNewParamsRegionAsiaEast1 SpeedScheduleNewParamsRegion = "asia-east1" + SpeedScheduleNewParamsRegionAsiaNortheast1 SpeedScheduleNewParamsRegion = "asia-northeast1" + SpeedScheduleNewParamsRegionAsiaNortheast2 SpeedScheduleNewParamsRegion = "asia-northeast2" + SpeedScheduleNewParamsRegionAsiaSouth1 SpeedScheduleNewParamsRegion = "asia-south1" + SpeedScheduleNewParamsRegionAsiaSoutheast1 SpeedScheduleNewParamsRegion = "asia-southeast1" + SpeedScheduleNewParamsRegionAustraliaSoutheast1 SpeedScheduleNewParamsRegion = "australia-southeast1" + SpeedScheduleNewParamsRegionEuropeNorth1 SpeedScheduleNewParamsRegion = "europe-north1" + SpeedScheduleNewParamsRegionEuropeSouthwest1 SpeedScheduleNewParamsRegion = "europe-southwest1" + SpeedScheduleNewParamsRegionEuropeWest1 SpeedScheduleNewParamsRegion = "europe-west1" + SpeedScheduleNewParamsRegionEuropeWest2 SpeedScheduleNewParamsRegion = "europe-west2" + SpeedScheduleNewParamsRegionEuropeWest3 SpeedScheduleNewParamsRegion = "europe-west3" + SpeedScheduleNewParamsRegionEuropeWest4 SpeedScheduleNewParamsRegion = "europe-west4" + SpeedScheduleNewParamsRegionEuropeWest8 SpeedScheduleNewParamsRegion = "europe-west8" + SpeedScheduleNewParamsRegionEuropeWest9 SpeedScheduleNewParamsRegion = "europe-west9" + SpeedScheduleNewParamsRegionMeWest1 SpeedScheduleNewParamsRegion = "me-west1" + SpeedScheduleNewParamsRegionSouthamericaEast1 SpeedScheduleNewParamsRegion = "southamerica-east1" + SpeedScheduleNewParamsRegionUsCentral1 SpeedScheduleNewParamsRegion = "us-central1" + SpeedScheduleNewParamsRegionUsEast1 SpeedScheduleNewParamsRegion = "us-east1" + SpeedScheduleNewParamsRegionUsEast4 SpeedScheduleNewParamsRegion = "us-east4" + SpeedScheduleNewParamsRegionUsSouth1 SpeedScheduleNewParamsRegion = "us-south1" + SpeedScheduleNewParamsRegionUsWest1 SpeedScheduleNewParamsRegion = "us-west1" +) + +type SpeedScheduleNewResponseEnvelope struct { + Result SpeedScheduleNewResponse `json:"result"` + JSON speedScheduleNewResponseEnvelopeJSON `json:"-"` +} + +// speedScheduleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SpeedScheduleNewResponseEnvelope] +type speedScheduleNewResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedScheduleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/speedapischedule_test.go b/speedschedule_test.go similarity index 82% rename from speedapischedule_test.go rename to speedschedule_test.go index a2318a41d7a..9d45da413a1 100644 --- a/speedapischedule_test.go +++ b/speedschedule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSpeedAPIScheduleNewWithOptionalParams(t *testing.T) { +func TestSpeedScheduleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,12 @@ func TestSpeedAPIScheduleNewWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SpeedAPI.Schedule.New( + _, err := client.Speed.Schedule.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example.com", - cloudflare.SpeedAPIScheduleNewParams{ - Region: cloudflare.F(cloudflare.SpeedAPIScheduleNewParamsRegionUsCentral1), + cloudflare.SpeedScheduleNewParams{ + Region: cloudflare.F(cloudflare.SpeedScheduleNewParamsRegionUsCentral1), }, ) if err != nil { diff --git a/speedtest.go b/speedtest.go new file mode 100644 index 00000000000..fd178787ece --- /dev/null +++ b/speedtest.go @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" + "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" + "github.com/cloudflare/cloudflare-sdk-go/internal/param" + "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" + "github.com/cloudflare/cloudflare-sdk-go/option" +) + +// SpeedTestService contains methods and other services that help with interacting +// with the cloudflare API. Note, unlike clients, this service does not read +// variables from the environment automatically. You should not instantiate this +// service directly, and instead use the [NewSpeedTestService] method instead. +type SpeedTestService struct { + Options []option.RequestOption +} + +// NewSpeedTestService generates a new service that applies the given options to +// each request. These options are applied after the parent client's options (if +// there is one), and before any request-specific options. +func NewSpeedTestService(opts ...option.RequestOption) (r *SpeedTestService) { + r = &SpeedTestService{} + r.Options = opts + return +} + +// Test history (list of tests) for a specific webpage. +func (r *SpeedTestService) List(ctx context.Context, zoneID string, url string, query SpeedTestListParams, opts ...option.RequestOption) (res *SpeedTestListResponse, err error) { + opts = append(r.Options[:], opts...) + path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", zoneID, url) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) + return +} + +type SpeedTestListResponse struct { + Errors []SpeedTestListResponseError `json:"errors,required"` + Messages []SpeedTestListResponseMessage `json:"messages,required"` + // Whether the API call was successful. + Success bool `json:"success,required"` + ResultInfo SpeedTestListResponseResultInfo `json:"result_info"` + JSON speedTestListResponseJSON `json:"-"` +} + +// speedTestListResponseJSON contains the JSON metadata for the struct +// [SpeedTestListResponse] +type speedTestListResponseJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTestListResponseError struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON speedTestListResponseErrorJSON `json:"-"` +} + +// speedTestListResponseErrorJSON contains the JSON metadata for the struct +// [SpeedTestListResponseError] +type speedTestListResponseErrorJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestListResponseError) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTestListResponseMessage struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON speedTestListResponseMessageJSON `json:"-"` +} + +// speedTestListResponseMessageJSON contains the JSON metadata for the struct +// [SpeedTestListResponseMessage] +type speedTestListResponseMessageJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestListResponseMessage) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTestListResponseResultInfo struct { + Count int64 `json:"count"` + Page int64 `json:"page"` + PerPage int64 `json:"per_page"` + TotalCount int64 `json:"total_count"` + JSON speedTestListResponseResultInfoJSON `json:"-"` +} + +// speedTestListResponseResultInfoJSON contains the JSON metadata for the struct +// [SpeedTestListResponseResultInfo] +type speedTestListResponseResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SpeedTestListResponseResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type SpeedTestListParams struct { + Page param.Field[int64] `query:"page"` + PerPage param.Field[int64] `query:"per_page"` + // A test region. + Region param.Field[SpeedTestListParamsRegion] `query:"region"` +} + +// URLQuery serializes [SpeedTestListParams]'s query parameters as `url.Values`. +func (r SpeedTestListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// A test region. +type SpeedTestListParamsRegion string + +const ( + SpeedTestListParamsRegionAsiaEast1 SpeedTestListParamsRegion = "asia-east1" + SpeedTestListParamsRegionAsiaNortheast1 SpeedTestListParamsRegion = "asia-northeast1" + SpeedTestListParamsRegionAsiaNortheast2 SpeedTestListParamsRegion = "asia-northeast2" + SpeedTestListParamsRegionAsiaSouth1 SpeedTestListParamsRegion = "asia-south1" + SpeedTestListParamsRegionAsiaSoutheast1 SpeedTestListParamsRegion = "asia-southeast1" + SpeedTestListParamsRegionAustraliaSoutheast1 SpeedTestListParamsRegion = "australia-southeast1" + SpeedTestListParamsRegionEuropeNorth1 SpeedTestListParamsRegion = "europe-north1" + SpeedTestListParamsRegionEuropeSouthwest1 SpeedTestListParamsRegion = "europe-southwest1" + SpeedTestListParamsRegionEuropeWest1 SpeedTestListParamsRegion = "europe-west1" + SpeedTestListParamsRegionEuropeWest2 SpeedTestListParamsRegion = "europe-west2" + SpeedTestListParamsRegionEuropeWest3 SpeedTestListParamsRegion = "europe-west3" + SpeedTestListParamsRegionEuropeWest4 SpeedTestListParamsRegion = "europe-west4" + SpeedTestListParamsRegionEuropeWest8 SpeedTestListParamsRegion = "europe-west8" + SpeedTestListParamsRegionEuropeWest9 SpeedTestListParamsRegion = "europe-west9" + SpeedTestListParamsRegionMeWest1 SpeedTestListParamsRegion = "me-west1" + SpeedTestListParamsRegionSouthamericaEast1 SpeedTestListParamsRegion = "southamerica-east1" + SpeedTestListParamsRegionUsCentral1 SpeedTestListParamsRegion = "us-central1" + SpeedTestListParamsRegionUsEast1 SpeedTestListParamsRegion = "us-east1" + SpeedTestListParamsRegionUsEast4 SpeedTestListParamsRegion = "us-east4" + SpeedTestListParamsRegionUsSouth1 SpeedTestListParamsRegion = "us-south1" + SpeedTestListParamsRegionUsWest1 SpeedTestListParamsRegion = "us-west1" +) diff --git a/dlppatternvalidate_test.go b/speedtest_test.go similarity index 78% rename from dlppatternvalidate_test.go rename to speedtest_test.go index 6efe74bd05d..9e24ced286a 100644 --- a/dlppatternvalidate_test.go +++ b/speedtest_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestDLPPatternValidateDLPPatternValidationValidatePattern(t *testing.T) { +func TestSpeedTestListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,14 @@ func TestDLPPatternValidateDLPPatternValidationValidatePattern(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.DLPs.Patterns.Validates.DLPPatternValidationValidatePattern( + _, err := client.Speed.Tests.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.DLPPatternValidateDLPPatternValidationValidatePatternParams{ - Regex: cloudflare.F("^4[0-9]{6,}$"), + "example.com", + cloudflare.SpeedTestListParams{ + Page: cloudflare.F(int64(1)), + PerPage: cloudflare.F(int64(20)), + Region: cloudflare.F(cloudflare.SpeedTestListParamsRegionUsCentral1), }, ) if err != nil { diff --git a/ssl.go b/ssl.go index 33a236e0bfb..13af46ee347 100644 --- a/ssl.go +++ b/ssl.go @@ -12,11 +12,11 @@ import ( // directly, and instead use the [NewSSLService] method instead. type SSLService struct { Options []option.RequestOption - Analyzes *SSLAnalyzeService + Analyze *SSLAnalyzeService CertificatePacks *SSLCertificatePackService Recommendations *SSLRecommendationService - Universals *SSLUniversalService - Verifications *SSLVerificationService + Universal *SSLUniversalService + Verification *SSLVerificationService } // NewSSLService generates a new service that applies the given options to each @@ -25,10 +25,10 @@ type SSLService struct { func NewSSLService(opts ...option.RequestOption) (r *SSLService) { r = &SSLService{} r.Options = opts - r.Analyzes = NewSSLAnalyzeService(opts...) + r.Analyze = NewSSLAnalyzeService(opts...) r.CertificatePacks = NewSSLCertificatePackService(opts...) r.Recommendations = NewSSLRecommendationService(opts...) - r.Universals = NewSSLUniversalService(opts...) - r.Verifications = NewSSLVerificationService(opts...) + r.Universal = NewSSLUniversalService(opts...) + r.Verification = NewSSLVerificationService(opts...) return } diff --git a/sslanalyze.go b/sslanalyze.go index e4b321cbabe..926a8c63bac 100644 --- a/sslanalyze.go +++ b/sslanalyze.go @@ -35,9 +35,9 @@ func NewSSLAnalyzeService(opts ...option.RequestOption) (r *SSLAnalyzeService) { // Returns the set of hostnames, the signature algorithm, and the expiration date // of the certificate. -func (r *SSLAnalyzeService) AnalyzeCertificateAnalyzeCertificate(ctx context.Context, zoneID string, body SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams, opts ...option.RequestOption) (res *SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse, err error) { +func (r *SSLAnalyzeService) New(ctx context.Context, zoneID string, body SSLAnalyzeNewParams, opts ...option.RequestOption) (res *SSLAnalyzeNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelope + var env SSLAnalyzeNewResponseEnvelope path := fmt.Sprintf("zones/%s/ssl/analyze", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -47,16 +47,14 @@ func (r *SSLAnalyzeService) AnalyzeCertificateAnalyzeCertificate(ctx context.Con return } -// Union satisfied by -// [SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseUnknown] or -// [shared.UnionString]. -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse interface { - ImplementsSSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse() +// Union satisfied by [SSLAnalyzeNewResponseUnknown] or [shared.UnionString]. +type SSLAnalyzeNewResponse interface { + ImplementsSSLAnalyzeNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse)(nil)).Elem(), + reflect.TypeOf((*SSLAnalyzeNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -65,17 +63,17 @@ func init() { ) } -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams struct { +type SSLAnalyzeNewParams struct { // A ubiquitous bundle has the highest probability of being verified everywhere, // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. - BundleMethod param.Field[SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethod] `json:"bundle_method"` + BundleMethod param.Field[SSLAnalyzeNewParamsBundleMethod] `json:"bundle_method"` // The zone's SSL certificate or certificate and the intermediate(s). Certificate param.Field[string] `json:"certificate"` } -func (r SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams) MarshalJSON() (data []byte, err error) { +func (r SSLAnalyzeNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -83,27 +81,26 @@ func (r SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams) MarshalJSON() (dat // even by clients using outdated or unusual trust stores. An optimal bundle uses // the shortest chain and newest intermediates. And the force bundle verifies the // chain, but does not otherwise modify it. -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethod string +type SSLAnalyzeNewParamsBundleMethod string const ( - SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethodUbiquitous SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethod = "ubiquitous" - SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethodOptimal SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethod = "optimal" - SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethodForce SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethod = "force" + SSLAnalyzeNewParamsBundleMethodUbiquitous SSLAnalyzeNewParamsBundleMethod = "ubiquitous" + SSLAnalyzeNewParamsBundleMethodOptimal SSLAnalyzeNewParamsBundleMethod = "optimal" + SSLAnalyzeNewParamsBundleMethodForce SSLAnalyzeNewParamsBundleMethod = "force" ) -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelope struct { - Errors []SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrors `json:"errors,required"` - Messages []SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessages `json:"messages,required"` - Result SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse `json:"result,required"` +type SSLAnalyzeNewResponseEnvelope struct { + Errors []SSLAnalyzeNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SSLAnalyzeNewResponseEnvelopeMessages `json:"messages,required"` + Result SSLAnalyzeNewResponse `json:"result,required"` // Whether the API call was successful - Success SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeSuccess `json:"success,required"` - JSON sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeJSON `json:"-"` + Success SSLAnalyzeNewResponseEnvelopeSuccess `json:"success,required"` + JSON sslAnalyzeNewResponseEnvelopeJSON `json:"-"` } -// sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelope] -type sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeJSON struct { +// sslAnalyzeNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SSLAnalyzeNewResponseEnvelope] +type sslAnalyzeNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -112,53 +109,51 @@ type sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLAnalyzeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrorsJSON `json:"-"` +type SSLAnalyzeNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslAnalyzeNewResponseEnvelopeErrorsJSON `json:"-"` } -// sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrors] -type sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrorsJSON struct { +// sslAnalyzeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SSLAnalyzeNewResponseEnvelopeErrors] +type sslAnalyzeNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SSLAnalyzeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessagesJSON `json:"-"` +type SSLAnalyzeNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslAnalyzeNewResponseEnvelopeMessagesJSON `json:"-"` } -// sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessages] -type sslAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessagesJSON struct { +// sslAnalyzeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SSLAnalyzeNewResponseEnvelopeMessages] +type sslAnalyzeNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SSLAnalyzeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeSuccess bool +type SSLAnalyzeNewResponseEnvelopeSuccess bool const ( - SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeSuccessTrue SSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponseEnvelopeSuccess = true + SSLAnalyzeNewResponseEnvelopeSuccessTrue SSLAnalyzeNewResponseEnvelopeSuccess = true ) diff --git a/sslanalyze_test.go b/sslanalyze_test.go index be4d263f39f..2581df384af 100644 --- a/sslanalyze_test.go +++ b/sslanalyze_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSSLAnalyzeAnalyzeCertificateAnalyzeCertificateWithOptionalParams(t *testing.T) { +func TestSSLAnalyzeNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestSSLAnalyzeAnalyzeCertificateAnalyzeCertificateWithOptionalParams(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Analyzes.AnalyzeCertificateAnalyzeCertificate( + _, err := client.SSL.Analyze.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParams{ - BundleMethod: cloudflare.F(cloudflare.SSLAnalyzeAnalyzeCertificateAnalyzeCertificateParamsBundleMethodUbiquitous), + cloudflare.SSLAnalyzeNewParams{ + BundleMethod: cloudflare.F(cloudflare.SSLAnalyzeNewParamsBundleMethodUbiquitous), Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"), }, ) diff --git a/sslcertificatepack.go b/sslcertificatepack.go index 69a7f3da3ab..05e91dd2eb7 100644 --- a/sslcertificatepack.go +++ b/sslcertificatepack.go @@ -25,8 +25,8 @@ import ( // instead. type SSLCertificatePackService struct { Options []option.RequestOption - Orders *SSLCertificatePackOrderService - Quotas *SSLCertificatePackQuotaService + Order *SSLCertificatePackOrderService + Quota *SSLCertificatePackQuotaService } // NewSSLCertificatePackService generates a new service that applies the given @@ -35,8 +35,8 @@ type SSLCertificatePackService struct { func NewSSLCertificatePackService(opts ...option.RequestOption) (r *SSLCertificatePackService) { r = &SSLCertificatePackService{} r.Options = opts - r.Orders = NewSSLCertificatePackOrderService(opts...) - r.Quotas = NewSSLCertificatePackQuotaService(opts...) + r.Order = NewSSLCertificatePackOrderService(opts...) + r.Quota = NewSSLCertificatePackQuotaService(opts...) return } @@ -55,12 +55,12 @@ func (r *SSLCertificatePackService) Update(ctx context.Context, zoneID string, c return } -// For a given zone, delete an advanced certificate pack. -func (r *SSLCertificatePackService) Delete(ctx context.Context, zoneID string, certificatePackID string, opts ...option.RequestOption) (res *SSLCertificatePackDeleteResponse, err error) { +// For a given zone, list all active certificate packs. +func (r *SSLCertificatePackService) List(ctx context.Context, zoneID string, query SSLCertificatePackListParams, opts ...option.RequestOption) (res *[]SSLCertificatePackListResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLCertificatePackDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", zoneID, certificatePackID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env SSLCertificatePackListResponseEnvelope + path := fmt.Sprintf("zones/%s/ssl/certificate_packs", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -68,12 +68,12 @@ func (r *SSLCertificatePackService) Delete(ctx context.Context, zoneID string, c return } -// For a given zone, list all active certificate packs. -func (r *SSLCertificatePackService) CertificatePacksListCertificatePacks(ctx context.Context, zoneID string, query SSLCertificatePackCertificatePacksListCertificatePacksParams, opts ...option.RequestOption) (res *[]SSLCertificatePackCertificatePacksListCertificatePacksResponse, err error) { +// For a given zone, delete an advanced certificate pack. +func (r *SSLCertificatePackService) Delete(ctx context.Context, zoneID string, certificatePackID string, opts ...option.RequestOption) (res *SSLCertificatePackDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelope - path := fmt.Sprintf("zones/%s/ssl/certificate_packs", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env SSLCertificatePackDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", zoneID, certificatePackID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -200,6 +200,8 @@ const ( SSLCertificatePackUpdateResponseValidityDays365 SSLCertificatePackUpdateResponseValidityDays = 365 ) +type SSLCertificatePackListResponse = interface{} + type SSLCertificatePackDeleteResponse struct { // Identifier ID string `json:"id"` @@ -218,8 +220,6 @@ func (r *SSLCertificatePackDeleteResponse) UnmarshalJSON(data []byte) (err error return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackCertificatePacksListCertificatePacksResponse = interface{} - // Union satisfied by [SSLCertificatePackGetResponseUnknown] or // [shared.UnionString]. type SSLCertificatePackGetResponse interface { @@ -306,199 +306,194 @@ const ( SSLCertificatePackUpdateResponseEnvelopeSuccessTrue SSLCertificatePackUpdateResponseEnvelopeSuccess = true ) -type SSLCertificatePackDeleteResponseEnvelope struct { - Errors []SSLCertificatePackDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []SSLCertificatePackDeleteResponseEnvelopeMessages `json:"messages,required"` - Result SSLCertificatePackDeleteResponse `json:"result,required"` +type SSLCertificatePackListParams struct { + // Include Certificate Packs of all statuses, not just active ones. + Status param.Field[SSLCertificatePackListParamsStatus] `query:"status"` +} + +// URLQuery serializes [SSLCertificatePackListParams]'s query parameters as +// `url.Values`. +func (r SSLCertificatePackListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Include Certificate Packs of all statuses, not just active ones. +type SSLCertificatePackListParamsStatus string + +const ( + SSLCertificatePackListParamsStatusAll SSLCertificatePackListParamsStatus = "all" +) + +type SSLCertificatePackListResponseEnvelope struct { + Errors []SSLCertificatePackListResponseEnvelopeErrors `json:"errors,required"` + Messages []SSLCertificatePackListResponseEnvelopeMessages `json:"messages,required"` + Result []SSLCertificatePackListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SSLCertificatePackDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON sslCertificatePackDeleteResponseEnvelopeJSON `json:"-"` + Success SSLCertificatePackListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo SSLCertificatePackListResponseEnvelopeResultInfo `json:"result_info"` + JSON sslCertificatePackListResponseEnvelopeJSON `json:"-"` } -// sslCertificatePackDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [SSLCertificatePackDeleteResponseEnvelope] -type sslCertificatePackDeleteResponseEnvelopeJSON struct { +// sslCertificatePackListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SSLCertificatePackListResponseEnvelope] +type sslCertificatePackListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackDeleteResponseEnvelopeErrorsJSON `json:"-"` +type SSLCertificatePackListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackListResponseEnvelopeErrorsJSON `json:"-"` } -// sslCertificatePackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [SSLCertificatePackDeleteResponseEnvelopeErrors] -type sslCertificatePackDeleteResponseEnvelopeErrorsJSON struct { +// sslCertificatePackListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [SSLCertificatePackListResponseEnvelopeErrors] +type sslCertificatePackListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackDeleteResponseEnvelopeMessagesJSON `json:"-"` +type SSLCertificatePackListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackListResponseEnvelopeMessagesJSON `json:"-"` } -// sslCertificatePackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [SSLCertificatePackDeleteResponseEnvelopeMessages] -type sslCertificatePackDeleteResponseEnvelopeMessagesJSON struct { +// sslCertificatePackListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SSLCertificatePackListResponseEnvelopeMessages] +type sslCertificatePackListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SSLCertificatePackDeleteResponseEnvelopeSuccess bool +type SSLCertificatePackListResponseEnvelopeSuccess bool const ( - SSLCertificatePackDeleteResponseEnvelopeSuccessTrue SSLCertificatePackDeleteResponseEnvelopeSuccess = true + SSLCertificatePackListResponseEnvelopeSuccessTrue SSLCertificatePackListResponseEnvelopeSuccess = true ) -type SSLCertificatePackCertificatePacksListCertificatePacksParams struct { - // Include Certificate Packs of all statuses, not just active ones. - Status param.Field[SSLCertificatePackCertificatePacksListCertificatePacksParamsStatus] `query:"status"` +type SSLCertificatePackListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON sslCertificatePackListResponseEnvelopeResultInfoJSON `json:"-"` } -// URLQuery serializes -// [SSLCertificatePackCertificatePacksListCertificatePacksParams]'s query -// parameters as `url.Values`. -func (r SSLCertificatePackCertificatePacksListCertificatePacksParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +// sslCertificatePackListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [SSLCertificatePackListResponseEnvelopeResultInfo] +type sslCertificatePackListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// Include Certificate Packs of all statuses, not just active ones. -type SSLCertificatePackCertificatePacksListCertificatePacksParamsStatus string - -const ( - SSLCertificatePackCertificatePacksListCertificatePacksParamsStatusAll SSLCertificatePackCertificatePacksListCertificatePacksParamsStatus = "all" -) +func (r *SSLCertificatePackListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -type SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelope struct { - Errors []SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrors `json:"errors,required"` - Messages []SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessages `json:"messages,required"` - Result []SSLCertificatePackCertificatePacksListCertificatePacksResponse `json:"result,required,nullable"` +type SSLCertificatePackDeleteResponseEnvelope struct { + Errors []SSLCertificatePackDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []SSLCertificatePackDeleteResponseEnvelopeMessages `json:"messages,required"` + Result SSLCertificatePackDeleteResponse `json:"result,required"` // Whether the API call was successful - Success SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfo `json:"result_info"` - JSON sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeJSON `json:"-"` + Success SSLCertificatePackDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON sslCertificatePackDeleteResponseEnvelopeJSON `json:"-"` } -// sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelope] -type sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeJSON struct { +// sslCertificatePackDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [SSLCertificatePackDeleteResponseEnvelope] +type sslCertificatePackDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrorsJSON `json:"-"` +type SSLCertificatePackDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrors] -type sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrorsJSON struct { +// sslCertificatePackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SSLCertificatePackDeleteResponseEnvelopeErrors] +type sslCertificatePackDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessagesJSON `json:"-"` +type SSLCertificatePackDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessages] -type sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessagesJSON struct { +// sslCertificatePackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [SSLCertificatePackDeleteResponseEnvelopeMessages] +type sslCertificatePackDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeSuccess bool +type SSLCertificatePackDeleteResponseEnvelopeSuccess bool const ( - SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeSuccessTrue SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeSuccess = true + SSLCertificatePackDeleteResponseEnvelopeSuccessTrue SSLCertificatePackDeleteResponseEnvelopeSuccess = true ) -type SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfoJSON `json:"-"` -} - -// sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfo] -type sslCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SSLCertificatePackCertificatePacksListCertificatePacksResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type SSLCertificatePackGetResponseEnvelope struct { Errors []SSLCertificatePackGetResponseEnvelopeErrors `json:"errors,required"` Messages []SSLCertificatePackGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/sslcertificatepack_test.go b/sslcertificatepack_test.go index 8f202f732f5..b876c78d397 100644 --- a/sslcertificatepack_test.go +++ b/sslcertificatepack_test.go @@ -29,7 +29,7 @@ func TestSSLCertificatePackUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.Update( + _, err := client.SSL.CertificatePacks.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -43,7 +43,7 @@ func TestSSLCertificatePackUpdate(t *testing.T) { } } -func TestSSLCertificatePackDelete(t *testing.T) { +func TestSSLCertificatePackListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,10 +59,12 @@ func TestSSLCertificatePackDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.Delete( + _, err := client.SSL.CertificatePacks.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.SSLCertificatePackListParams{ + Status: cloudflare.F(cloudflare.SSLCertificatePackListParamsStatusAll), + }, ) if err != nil { var apierr *cloudflare.Error @@ -73,7 +75,7 @@ func TestSSLCertificatePackDelete(t *testing.T) { } } -func TestSSLCertificatePackCertificatePacksListCertificatePacksWithOptionalParams(t *testing.T) { +func TestSSLCertificatePackDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,12 +91,10 @@ func TestSSLCertificatePackCertificatePacksListCertificatePacksWithOptionalParam option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.CertificatePacksListCertificatePacks( + _, err := client.SSL.CertificatePacks.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SSLCertificatePackCertificatePacksListCertificatePacksParams{ - Status: cloudflare.F(cloudflare.SSLCertificatePackCertificatePacksListCertificatePacksParamsStatusAll), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -121,7 +121,7 @@ func TestSSLCertificatePackGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.Get( + _, err := client.SSL.CertificatePacks.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/sslcertificatepackorder.go b/sslcertificatepackorder.go index 594e1fd1592..bb8c73b0686 100644 --- a/sslcertificatepackorder.go +++ b/sslcertificatepackorder.go @@ -32,9 +32,9 @@ func NewSSLCertificatePackOrderService(opts ...option.RequestOption) (r *SSLCert } // For a given zone, order an advanced certificate pack. -func (r *SSLCertificatePackOrderService) CertificatePacksOrderAdvancedCertificateManagerCertificatePack(ctx context.Context, zoneID string, body SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams, opts ...option.RequestOption) (res *SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse, err error) { +func (r *SSLCertificatePackOrderService) New(ctx context.Context, zoneID string, body SSLCertificatePackOrderNewParams, opts ...option.RequestOption) (res *SSLCertificatePackOrderNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelope + var env SSLCertificatePackOrderNewResponseEnvelope path := fmt.Sprintf("zones/%s/ssl/certificate_packs/order", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -44,13 +44,13 @@ func (r *SSLCertificatePackOrderService) CertificatePacksOrderAdvancedCertificat return } -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse struct { +type SSLCertificatePackOrderNewResponse struct { // Identifier ID string `json:"id"` // Certificate Authority selected for the order. For information on any certificate // authority specific details or restrictions // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) - CertificateAuthority SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthority `json:"certificate_authority"` + CertificateAuthority SSLCertificatePackOrderNewResponseCertificateAuthority `json:"certificate_authority"` // Whether or not to add Cloudflare Branding for the order. This will add // sni.cloudflaressl.com as the Common Name if set true. CloudflareBranding bool `json:"cloudflare_branding"` @@ -58,20 +58,19 @@ type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCerti // the zone apex, may not contain more than 50 hosts, and may not be empty. Hosts []string `json:"hosts"` // Status of certificate pack. - Status SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus `json:"status"` + Status SSLCertificatePackOrderNewResponseStatus `json:"status"` // Type of certificate pack. - Type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseType `json:"type"` + Type SSLCertificatePackOrderNewResponseType `json:"type"` // Validation Method selected for the order. - ValidationMethod SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethod `json:"validation_method"` + ValidationMethod SSLCertificatePackOrderNewResponseValidationMethod `json:"validation_method"` // Validity Days selected for the order. - ValidityDays SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays `json:"validity_days"` - JSON sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseJSON `json:"-"` + ValidityDays SSLCertificatePackOrderNewResponseValidityDays `json:"validity_days"` + JSON sslCertificatePackOrderNewResponseJSON `json:"-"` } -// sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse] -type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseJSON struct { +// sslCertificatePackOrderNewResponseJSON contains the JSON metadata for the struct +// [SSLCertificatePackOrderNewResponse] +type sslCertificatePackOrderNewResponseJSON struct { ID apijson.Field CertificateAuthority apijson.Field CloudflareBranding apijson.Field @@ -84,145 +83,144 @@ type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCerti ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackOrderNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Certificate Authority selected for the order. For information on any certificate // authority specific details or restrictions // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthority string +type SSLCertificatePackOrderNewResponseCertificateAuthority string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthorityGoogle SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthority = "google" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthorityLetsEncrypt SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseCertificateAuthority = "lets_encrypt" + SSLCertificatePackOrderNewResponseCertificateAuthorityGoogle SSLCertificatePackOrderNewResponseCertificateAuthority = "google" + SSLCertificatePackOrderNewResponseCertificateAuthorityLetsEncrypt SSLCertificatePackOrderNewResponseCertificateAuthority = "lets_encrypt" ) // Status of certificate pack. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus string +type SSLCertificatePackOrderNewResponseStatus string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusInitializing SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "initializing" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingValidation SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_validation" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusDeleted SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "deleted" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingIssuance SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_issuance" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingDeployment SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_deployment" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingDeletion SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_deletion" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingExpiration SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_expiration" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusExpired SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "expired" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusActive SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "active" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusInitializingTimedOut SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "initializing_timed_out" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusValidationTimedOut SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "validation_timed_out" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusIssuanceTimedOut SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "issuance_timed_out" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusDeploymentTimedOut SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "deployment_timed_out" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusDeletionTimedOut SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "deletion_timed_out" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusPendingCleanup SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "pending_cleanup" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusStagingDeployment SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "staging_deployment" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusStagingActive SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "staging_active" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusDeactivating SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "deactivating" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusInactive SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "inactive" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusBackupIssued SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "backup_issued" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatusHoldingDeployment SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseStatus = "holding_deployment" + SSLCertificatePackOrderNewResponseStatusInitializing SSLCertificatePackOrderNewResponseStatus = "initializing" + SSLCertificatePackOrderNewResponseStatusPendingValidation SSLCertificatePackOrderNewResponseStatus = "pending_validation" + SSLCertificatePackOrderNewResponseStatusDeleted SSLCertificatePackOrderNewResponseStatus = "deleted" + SSLCertificatePackOrderNewResponseStatusPendingIssuance SSLCertificatePackOrderNewResponseStatus = "pending_issuance" + SSLCertificatePackOrderNewResponseStatusPendingDeployment SSLCertificatePackOrderNewResponseStatus = "pending_deployment" + SSLCertificatePackOrderNewResponseStatusPendingDeletion SSLCertificatePackOrderNewResponseStatus = "pending_deletion" + SSLCertificatePackOrderNewResponseStatusPendingExpiration SSLCertificatePackOrderNewResponseStatus = "pending_expiration" + SSLCertificatePackOrderNewResponseStatusExpired SSLCertificatePackOrderNewResponseStatus = "expired" + SSLCertificatePackOrderNewResponseStatusActive SSLCertificatePackOrderNewResponseStatus = "active" + SSLCertificatePackOrderNewResponseStatusInitializingTimedOut SSLCertificatePackOrderNewResponseStatus = "initializing_timed_out" + SSLCertificatePackOrderNewResponseStatusValidationTimedOut SSLCertificatePackOrderNewResponseStatus = "validation_timed_out" + SSLCertificatePackOrderNewResponseStatusIssuanceTimedOut SSLCertificatePackOrderNewResponseStatus = "issuance_timed_out" + SSLCertificatePackOrderNewResponseStatusDeploymentTimedOut SSLCertificatePackOrderNewResponseStatus = "deployment_timed_out" + SSLCertificatePackOrderNewResponseStatusDeletionTimedOut SSLCertificatePackOrderNewResponseStatus = "deletion_timed_out" + SSLCertificatePackOrderNewResponseStatusPendingCleanup SSLCertificatePackOrderNewResponseStatus = "pending_cleanup" + SSLCertificatePackOrderNewResponseStatusStagingDeployment SSLCertificatePackOrderNewResponseStatus = "staging_deployment" + SSLCertificatePackOrderNewResponseStatusStagingActive SSLCertificatePackOrderNewResponseStatus = "staging_active" + SSLCertificatePackOrderNewResponseStatusDeactivating SSLCertificatePackOrderNewResponseStatus = "deactivating" + SSLCertificatePackOrderNewResponseStatusInactive SSLCertificatePackOrderNewResponseStatus = "inactive" + SSLCertificatePackOrderNewResponseStatusBackupIssued SSLCertificatePackOrderNewResponseStatus = "backup_issued" + SSLCertificatePackOrderNewResponseStatusHoldingDeployment SSLCertificatePackOrderNewResponseStatus = "holding_deployment" ) // Type of certificate pack. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseType string +type SSLCertificatePackOrderNewResponseType string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseTypeAdvanced SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseType = "advanced" + SSLCertificatePackOrderNewResponseTypeAdvanced SSLCertificatePackOrderNewResponseType = "advanced" ) // Validation Method selected for the order. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethod string +type SSLCertificatePackOrderNewResponseValidationMethod string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethodTxt SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethod = "txt" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethodHTTP SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethod = "http" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethodEmail SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidationMethod = "email" + SSLCertificatePackOrderNewResponseValidationMethodTxt SSLCertificatePackOrderNewResponseValidationMethod = "txt" + SSLCertificatePackOrderNewResponseValidationMethodHTTP SSLCertificatePackOrderNewResponseValidationMethod = "http" + SSLCertificatePackOrderNewResponseValidationMethodEmail SSLCertificatePackOrderNewResponseValidationMethod = "email" ) // Validity Days selected for the order. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays int64 +type SSLCertificatePackOrderNewResponseValidityDays int64 const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays14 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays = 14 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays30 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays = 30 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays90 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays = 90 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays365 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseValidityDays = 365 + SSLCertificatePackOrderNewResponseValidityDays14 SSLCertificatePackOrderNewResponseValidityDays = 14 + SSLCertificatePackOrderNewResponseValidityDays30 SSLCertificatePackOrderNewResponseValidityDays = 30 + SSLCertificatePackOrderNewResponseValidityDays90 SSLCertificatePackOrderNewResponseValidityDays = 90 + SSLCertificatePackOrderNewResponseValidityDays365 SSLCertificatePackOrderNewResponseValidityDays = 365 ) -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams struct { +type SSLCertificatePackOrderNewParams struct { // Certificate Authority selected for the order. For information on any certificate // authority specific details or restrictions // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) - CertificateAuthority param.Field[SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthority] `json:"certificate_authority,required"` + CertificateAuthority param.Field[SSLCertificatePackOrderNewParamsCertificateAuthority] `json:"certificate_authority,required"` // Comma separated list of valid host names for the certificate packs. Must contain // the zone apex, may not contain more than 50 hosts, and may not be empty. Hosts param.Field[[]string] `json:"hosts,required"` // Type of certificate pack. - Type param.Field[SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsType] `json:"type,required"` + Type param.Field[SSLCertificatePackOrderNewParamsType] `json:"type,required"` // Validation Method selected for the order. - ValidationMethod param.Field[SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethod] `json:"validation_method,required"` + ValidationMethod param.Field[SSLCertificatePackOrderNewParamsValidationMethod] `json:"validation_method,required"` // Validity Days selected for the order. - ValidityDays param.Field[SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays] `json:"validity_days,required"` + ValidityDays param.Field[SSLCertificatePackOrderNewParamsValidityDays] `json:"validity_days,required"` // Whether or not to add Cloudflare Branding for the order. This will add // sni.cloudflaressl.com as the Common Name if set true. CloudflareBranding param.Field[bool] `json:"cloudflare_branding"` } -func (r SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams) MarshalJSON() (data []byte, err error) { +func (r SSLCertificatePackOrderNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Certificate Authority selected for the order. For information on any certificate // authority specific details or restrictions // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities) -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthority string +type SSLCertificatePackOrderNewParamsCertificateAuthority string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthorityGoogle SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthority = "google" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthorityLetsEncrypt SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthority = "lets_encrypt" + SSLCertificatePackOrderNewParamsCertificateAuthorityGoogle SSLCertificatePackOrderNewParamsCertificateAuthority = "google" + SSLCertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt SSLCertificatePackOrderNewParamsCertificateAuthority = "lets_encrypt" ) // Type of certificate pack. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsType string +type SSLCertificatePackOrderNewParamsType string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsTypeAdvanced SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsType = "advanced" + SSLCertificatePackOrderNewParamsTypeAdvanced SSLCertificatePackOrderNewParamsType = "advanced" ) // Validation Method selected for the order. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethod string +type SSLCertificatePackOrderNewParamsValidationMethod string const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethodTxt SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethod = "txt" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethodHTTP SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethod = "http" - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethodEmail SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethod = "email" + SSLCertificatePackOrderNewParamsValidationMethodTxt SSLCertificatePackOrderNewParamsValidationMethod = "txt" + SSLCertificatePackOrderNewParamsValidationMethodHTTP SSLCertificatePackOrderNewParamsValidationMethod = "http" + SSLCertificatePackOrderNewParamsValidationMethodEmail SSLCertificatePackOrderNewParamsValidationMethod = "email" ) // Validity Days selected for the order. -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays int64 +type SSLCertificatePackOrderNewParamsValidityDays int64 const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays14 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays = 14 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays30 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays = 30 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays90 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays = 90 - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays365 SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays = 365 + SSLCertificatePackOrderNewParamsValidityDays14 SSLCertificatePackOrderNewParamsValidityDays = 14 + SSLCertificatePackOrderNewParamsValidityDays30 SSLCertificatePackOrderNewParamsValidityDays = 30 + SSLCertificatePackOrderNewParamsValidityDays90 SSLCertificatePackOrderNewParamsValidityDays = 90 + SSLCertificatePackOrderNewParamsValidityDays365 SSLCertificatePackOrderNewParamsValidityDays = 365 ) -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelope struct { - Errors []SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrors `json:"errors,required"` - Messages []SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessages `json:"messages,required"` - Result SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponse `json:"result,required"` +type SSLCertificatePackOrderNewResponseEnvelope struct { + Errors []SSLCertificatePackOrderNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SSLCertificatePackOrderNewResponseEnvelopeMessages `json:"messages,required"` + Result SSLCertificatePackOrderNewResponse `json:"result,required"` // Whether the API call was successful - Success SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeSuccess `json:"success,required"` - JSON sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeJSON `json:"-"` + Success SSLCertificatePackOrderNewResponseEnvelopeSuccess `json:"success,required"` + JSON sslCertificatePackOrderNewResponseEnvelopeJSON `json:"-"` } -// sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelope] -type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeJSON struct { +// sslCertificatePackOrderNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [SSLCertificatePackOrderNewResponseEnvelope] +type sslCertificatePackOrderNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -231,53 +229,51 @@ type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCerti ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackOrderNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrorsJSON `json:"-"` +type SSLCertificatePackOrderNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackOrderNewResponseEnvelopeErrorsJSON `json:"-"` } -// sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrors] -type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrorsJSON struct { +// sslCertificatePackOrderNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SSLCertificatePackOrderNewResponseEnvelopeErrors] +type sslCertificatePackOrderNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackOrderNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessagesJSON `json:"-"` +type SSLCertificatePackOrderNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackOrderNewResponseEnvelopeMessagesJSON `json:"-"` } -// sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessages] -type sslCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessagesJSON struct { +// sslCertificatePackOrderNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SSLCertificatePackOrderNewResponseEnvelopeMessages] +type sslCertificatePackOrderNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackOrderNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeSuccess bool +type SSLCertificatePackOrderNewResponseEnvelopeSuccess bool const ( - SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeSuccessTrue SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackResponseEnvelopeSuccess = true + SSLCertificatePackOrderNewResponseEnvelopeSuccessTrue SSLCertificatePackOrderNewResponseEnvelopeSuccess = true ) diff --git a/sslcertificatepackorder_test.go b/sslcertificatepackorder_test.go index 43807d06c32..41ddbb0f386 100644 --- a/sslcertificatepackorder_test.go +++ b/sslcertificatepackorder_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackWithOptionalParams(t *testing.T) { +func TestSSLCertificatePackOrderNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,15 @@ func TestSSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerC option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.Orders.CertificatePacksOrderAdvancedCertificateManagerCertificatePack( + _, err := client.SSL.CertificatePacks.Order.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParams{ - CertificateAuthority: cloudflare.F(cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsCertificateAuthorityLetsEncrypt), + cloudflare.SSLCertificatePackOrderNewParams{ + CertificateAuthority: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt), Hosts: cloudflare.F([]string{"example.com", "*.example.com", "www.example.com"}), - Type: cloudflare.F(cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsTypeAdvanced), - ValidationMethod: cloudflare.F(cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidationMethodTxt), - ValidityDays: cloudflare.F(cloudflare.SSLCertificatePackOrderCertificatePacksOrderAdvancedCertificateManagerCertificatePackParamsValidityDays14), + Type: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsTypeAdvanced), + ValidationMethod: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsValidationMethodTxt), + ValidityDays: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsValidityDays14), CloudflareBranding: cloudflare.F(false), }, ) diff --git a/sslcertificatepackquota.go b/sslcertificatepackquota.go index 4e07ba6b3d5..d907325a188 100644 --- a/sslcertificatepackquota.go +++ b/sslcertificatepackquota.go @@ -31,9 +31,9 @@ func NewSSLCertificatePackQuotaService(opts ...option.RequestOption) (r *SSLCert } // For a given zone, list certificate pack quotas. -func (r *SSLCertificatePackQuotaService) CertificatePacksGetCertificatePackQuotas(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse, err error) { +func (r *SSLCertificatePackQuotaService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *SSLCertificatePackQuotaListResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelope + var env SSLCertificatePackQuotaListResponseEnvelope path := fmt.Sprintf("zones/%s/ssl/certificate_packs/quota", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,59 +43,56 @@ func (r *SSLCertificatePackQuotaService) CertificatePacksGetCertificatePackQuota return } -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse struct { - Advanced SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvanced `json:"advanced"` - JSON sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseJSON `json:"-"` +type SSLCertificatePackQuotaListResponse struct { + Advanced SSLCertificatePackQuotaListResponseAdvanced `json:"advanced"` + JSON sslCertificatePackQuotaListResponseJSON `json:"-"` } -// sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse] -type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseJSON struct { +// sslCertificatePackQuotaListResponseJSON contains the JSON metadata for the +// struct [SSLCertificatePackQuotaListResponse] +type sslCertificatePackQuotaListResponseJSON struct { Advanced apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackQuotaListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvanced struct { +type SSLCertificatePackQuotaListResponseAdvanced struct { // Quantity Allocated. Allocated int64 `json:"allocated"` // Quantity Used. - Used int64 `json:"used"` - JSON sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvancedJSON `json:"-"` + Used int64 `json:"used"` + JSON sslCertificatePackQuotaListResponseAdvancedJSON `json:"-"` } -// sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvancedJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvanced] -type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvancedJSON struct { +// sslCertificatePackQuotaListResponseAdvancedJSON contains the JSON metadata for +// the struct [SSLCertificatePackQuotaListResponseAdvanced] +type sslCertificatePackQuotaListResponseAdvancedJSON struct { Allocated apijson.Field Used apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseAdvanced) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackQuotaListResponseAdvanced) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelope struct { - Errors []SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrors `json:"errors,required"` - Messages []SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessages `json:"messages,required"` - Result SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponse `json:"result,required"` +type SSLCertificatePackQuotaListResponseEnvelope struct { + Errors []SSLCertificatePackQuotaListResponseEnvelopeErrors `json:"errors,required"` + Messages []SSLCertificatePackQuotaListResponseEnvelopeMessages `json:"messages,required"` + Result SSLCertificatePackQuotaListResponse `json:"result,required"` // Whether the API call was successful - Success SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeSuccess `json:"success,required"` - JSON sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeJSON `json:"-"` + Success SSLCertificatePackQuotaListResponseEnvelopeSuccess `json:"success,required"` + JSON sslCertificatePackQuotaListResponseEnvelopeJSON `json:"-"` } -// sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelope] -type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeJSON struct { +// sslCertificatePackQuotaListResponseEnvelopeJSON contains the JSON metadata for +// the struct [SSLCertificatePackQuotaListResponseEnvelope] +type sslCertificatePackQuotaListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -104,53 +101,51 @@ type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnve ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackQuotaListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrorsJSON `json:"-"` +type SSLCertificatePackQuotaListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackQuotaListResponseEnvelopeErrorsJSON `json:"-"` } -// sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrors] -type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrorsJSON struct { +// sslCertificatePackQuotaListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [SSLCertificatePackQuotaListResponseEnvelopeErrors] +type sslCertificatePackQuotaListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackQuotaListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessagesJSON `json:"-"` +type SSLCertificatePackQuotaListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON sslCertificatePackQuotaListResponseEnvelopeMessagesJSON `json:"-"` } -// sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessages] -type sslCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessagesJSON struct { +// sslCertificatePackQuotaListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [SSLCertificatePackQuotaListResponseEnvelopeMessages] +type sslCertificatePackQuotaListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SSLCertificatePackQuotaListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeSuccess bool +type SSLCertificatePackQuotaListResponseEnvelopeSuccess bool const ( - SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeSuccessTrue SSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotasResponseEnvelopeSuccess = true + SSLCertificatePackQuotaListResponseEnvelopeSuccessTrue SSLCertificatePackQuotaListResponseEnvelopeSuccess = true ) diff --git a/sslcertificatepackquota_test.go b/sslcertificatepackquota_test.go index 8d79134afb1..015491ee03b 100644 --- a/sslcertificatepackquota_test.go +++ b/sslcertificatepackquota_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotas(t *testing.T) { +func TestSSLCertificatePackQuotaList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestSSLCertificatePackQuotaCertificatePacksGetCertificatePackQuotas(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.CertificatePacks.Quotas.CertificatePacksGetCertificatePackQuotas(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.SSL.CertificatePacks.Quota.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/sslrecommendation_test.go b/sslrecommendation_test.go index 3ede6a97f61..2db47520632 100644 --- a/sslrecommendation_test.go +++ b/sslrecommendation_test.go @@ -29,7 +29,7 @@ func TestSSLRecommendationList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Recommendations.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.SSL.Recommendations.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/ssluniversalsetting_test.go b/ssluniversalsetting_test.go index 573f9d30bf7..a9fa7448a59 100644 --- a/ssluniversalsetting_test.go +++ b/ssluniversalsetting_test.go @@ -29,7 +29,7 @@ func TestSSLUniversalSettingUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Universals.Settings.Update( + _, err := client.SSL.Universal.Settings.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", cloudflare.SSLUniversalSettingUpdateParams{ @@ -61,7 +61,7 @@ func TestSSLUniversalSettingGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Universals.Settings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.SSL.Universal.Settings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/sslverification.go b/sslverification.go index f4bc8fdeaef..392b45386d5 100644 --- a/sslverification.go +++ b/sslverification.go @@ -50,9 +50,9 @@ func (r *SSLVerificationService) Update(ctx context.Context, zoneID string, cert } // Get SSL Verification Info for a Zone. -func (r *SSLVerificationService) SSLVerificationSSLVerificationDetails(ctx context.Context, zoneID string, query SSLVerificationSSLVerificationSSLVerificationDetailsParams, opts ...option.RequestOption) (res *[]SSLVerificationSSLVerificationSSLVerificationDetailsResponse, err error) { +func (r *SSLVerificationService) List(ctx context.Context, zoneID string, query SSLVerificationListParams, opts ...option.RequestOption) (res *[]SSLVerificationListResponse, err error) { opts = append(r.Options[:], opts...) - var env SSLVerificationSSLVerificationSSLVerificationDetailsResponseEnvelope + var env SSLVerificationListResponseEnvelope path := fmt.Sprintf("zones/%s/ssl/verification", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -93,31 +93,30 @@ const ( SSLVerificationUpdateResponseValidationMethodEmail SSLVerificationUpdateResponseValidationMethod = "email" ) -type SSLVerificationSSLVerificationSSLVerificationDetailsResponse struct { +type SSLVerificationListResponse struct { // Current status of certificate. - CertificateStatus SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus `json:"certificate_status,required"` + CertificateStatus SSLVerificationListResponseCertificateStatus `json:"certificate_status,required"` // Certificate Authority is manually reviewing the order. BrandCheck bool `json:"brand_check"` // Certificate Pack UUID. CertPackUuid string `json:"cert_pack_uuid"` // Certificate's signature algorithm. - Signature SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignature `json:"signature"` + Signature SSLVerificationListResponseSignature `json:"signature"` // Validation method in use for a certificate pack order. - ValidationMethod SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethod `json:"validation_method"` + ValidationMethod SSLVerificationListResponseValidationMethod `json:"validation_method"` // Certificate's required verification information. - VerificationInfo SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfo `json:"verification_info"` + VerificationInfo SSLVerificationListResponseVerificationInfo `json:"verification_info"` // Status of the required verification information, omitted if verification status // is unknown. VerificationStatus bool `json:"verification_status"` // Method of verification. - VerificationType SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationType `json:"verification_type"` - JSON sslVerificationSSLVerificationSSLVerificationDetailsResponseJSON `json:"-"` + VerificationType SSLVerificationListResponseVerificationType `json:"verification_type"` + JSON sslVerificationListResponseJSON `json:"-"` } -// sslVerificationSSLVerificationSSLVerificationDetailsResponseJSON contains the -// JSON metadata for the struct -// [SSLVerificationSSLVerificationSSLVerificationDetailsResponse] -type sslVerificationSSLVerificationSSLVerificationDetailsResponseJSON struct { +// sslVerificationListResponseJSON contains the JSON metadata for the struct +// [SSLVerificationListResponse] +type sslVerificationListResponseJSON struct { CertificateStatus apijson.Field BrandCheck apijson.Field CertPackUuid apijson.Field @@ -130,90 +129,89 @@ type sslVerificationSSLVerificationSSLVerificationDetailsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SSLVerificationSSLVerificationSSLVerificationDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SSLVerificationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Current status of certificate. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus string +type SSLVerificationListResponseCertificateStatus string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusInitializing SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "initializing" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusAuthorizing SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "authorizing" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusActive SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "active" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusExpired SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "expired" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusIssuing SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "issuing" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusTimingOut SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "timing_out" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatusPendingDeployment SSLVerificationSSLVerificationSSLVerificationDetailsResponseCertificateStatus = "pending_deployment" + SSLVerificationListResponseCertificateStatusInitializing SSLVerificationListResponseCertificateStatus = "initializing" + SSLVerificationListResponseCertificateStatusAuthorizing SSLVerificationListResponseCertificateStatus = "authorizing" + SSLVerificationListResponseCertificateStatusActive SSLVerificationListResponseCertificateStatus = "active" + SSLVerificationListResponseCertificateStatusExpired SSLVerificationListResponseCertificateStatus = "expired" + SSLVerificationListResponseCertificateStatusIssuing SSLVerificationListResponseCertificateStatus = "issuing" + SSLVerificationListResponseCertificateStatusTimingOut SSLVerificationListResponseCertificateStatus = "timing_out" + SSLVerificationListResponseCertificateStatusPendingDeployment SSLVerificationListResponseCertificateStatus = "pending_deployment" ) // Certificate's signature algorithm. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignature string +type SSLVerificationListResponseSignature string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignatureEcdsaWithSha256 SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignature = "ECDSAWithSHA256" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignatureSha1WithRsa SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignature = "SHA1WithRSA" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignatureSha256WithRsa SSLVerificationSSLVerificationSSLVerificationDetailsResponseSignature = "SHA256WithRSA" + SSLVerificationListResponseSignatureEcdsaWithSha256 SSLVerificationListResponseSignature = "ECDSAWithSHA256" + SSLVerificationListResponseSignatureSha1WithRsa SSLVerificationListResponseSignature = "SHA1WithRSA" + SSLVerificationListResponseSignatureSha256WithRsa SSLVerificationListResponseSignature = "SHA256WithRSA" ) // Validation method in use for a certificate pack order. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethod string +type SSLVerificationListResponseValidationMethod string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethodHTTP SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethod = "http" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethodCname SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethod = "cname" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethodTxt SSLVerificationSSLVerificationSSLVerificationDetailsResponseValidationMethod = "txt" + SSLVerificationListResponseValidationMethodHTTP SSLVerificationListResponseValidationMethod = "http" + SSLVerificationListResponseValidationMethodCname SSLVerificationListResponseValidationMethod = "cname" + SSLVerificationListResponseValidationMethodTxt SSLVerificationListResponseValidationMethod = "txt" ) // Certificate's required verification information. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfo struct { +type SSLVerificationListResponseVerificationInfo struct { // Name of CNAME record. - RecordName SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName `json:"record_name"` + RecordName SSLVerificationListResponseVerificationInfoRecordName `json:"record_name"` // Target of CNAME record. - RecordTarget SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget `json:"record_target"` - JSON sslVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoJSON `json:"-"` + RecordTarget SSLVerificationListResponseVerificationInfoRecordTarget `json:"record_target"` + JSON sslVerificationListResponseVerificationInfoJSON `json:"-"` } -// sslVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoJSON -// contains the JSON metadata for the struct -// [SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfo] -type sslVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoJSON struct { +// sslVerificationListResponseVerificationInfoJSON contains the JSON metadata for +// the struct [SSLVerificationListResponseVerificationInfo] +type sslVerificationListResponseVerificationInfoJSON struct { RecordName apijson.Field RecordTarget apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfo) UnmarshalJSON(data []byte) (err error) { +func (r *SSLVerificationListResponseVerificationInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Name of CNAME record. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName string +type SSLVerificationListResponseVerificationInfoRecordName string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordNameRecordName SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName = "record_name" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordNameHTTPURL SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName = "http_url" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordNameCname SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName = "cname" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordNameTxtName SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordName = "txt_name" + SSLVerificationListResponseVerificationInfoRecordNameRecordName SSLVerificationListResponseVerificationInfoRecordName = "record_name" + SSLVerificationListResponseVerificationInfoRecordNameHTTPURL SSLVerificationListResponseVerificationInfoRecordName = "http_url" + SSLVerificationListResponseVerificationInfoRecordNameCname SSLVerificationListResponseVerificationInfoRecordName = "cname" + SSLVerificationListResponseVerificationInfoRecordNameTxtName SSLVerificationListResponseVerificationInfoRecordName = "txt_name" ) // Target of CNAME record. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget string +type SSLVerificationListResponseVerificationInfoRecordTarget string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTargetRecordValue SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget = "record_value" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTargetHTTPBody SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget = "http_body" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTargetCnameTarget SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget = "cname_target" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTargetTxtValue SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationInfoRecordTarget = "txt_value" + SSLVerificationListResponseVerificationInfoRecordTargetRecordValue SSLVerificationListResponseVerificationInfoRecordTarget = "record_value" + SSLVerificationListResponseVerificationInfoRecordTargetHTTPBody SSLVerificationListResponseVerificationInfoRecordTarget = "http_body" + SSLVerificationListResponseVerificationInfoRecordTargetCnameTarget SSLVerificationListResponseVerificationInfoRecordTarget = "cname_target" + SSLVerificationListResponseVerificationInfoRecordTargetTxtValue SSLVerificationListResponseVerificationInfoRecordTarget = "txt_value" ) // Method of verification. -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationType string +type SSLVerificationListResponseVerificationType string const ( - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationTypeCname SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationType = "cname" - SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationTypeMetaTag SSLVerificationSSLVerificationSSLVerificationDetailsResponseVerificationType = "meta tag" + SSLVerificationListResponseVerificationTypeCname SSLVerificationListResponseVerificationType = "cname" + SSLVerificationListResponseVerificationTypeMetaTag SSLVerificationListResponseVerificationType = "meta tag" ) type SSLVerificationUpdateParams struct { @@ -304,15 +302,14 @@ const ( SSLVerificationUpdateResponseEnvelopeSuccessTrue SSLVerificationUpdateResponseEnvelopeSuccess = true ) -type SSLVerificationSSLVerificationSSLVerificationDetailsParams struct { +type SSLVerificationListParams struct { // Immediately retry SSL Verification. - Retry param.Field[SSLVerificationSSLVerificationSSLVerificationDetailsParamsRetry] `query:"retry"` + Retry param.Field[SSLVerificationListParamsRetry] `query:"retry"` } -// URLQuery serializes -// [SSLVerificationSSLVerificationSSLVerificationDetailsParams]'s query parameters -// as `url.Values`. -func (r SSLVerificationSSLVerificationSSLVerificationDetailsParams) URLQuery() (v url.Values) { +// URLQuery serializes [SSLVerificationListParams]'s query parameters as +// `url.Values`. +func (r SSLVerificationListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -320,26 +317,25 @@ func (r SSLVerificationSSLVerificationSSLVerificationDetailsParams) URLQuery() ( } // Immediately retry SSL Verification. -type SSLVerificationSSLVerificationSSLVerificationDetailsParamsRetry bool +type SSLVerificationListParamsRetry bool const ( - SSLVerificationSSLVerificationSSLVerificationDetailsParamsRetryTrue SSLVerificationSSLVerificationSSLVerificationDetailsParamsRetry = true + SSLVerificationListParamsRetryTrue SSLVerificationListParamsRetry = true ) -type SSLVerificationSSLVerificationSSLVerificationDetailsResponseEnvelope struct { - Result []SSLVerificationSSLVerificationSSLVerificationDetailsResponse `json:"result"` - JSON sslVerificationSSLVerificationSSLVerificationDetailsResponseEnvelopeJSON `json:"-"` +type SSLVerificationListResponseEnvelope struct { + Result []SSLVerificationListResponse `json:"result"` + JSON sslVerificationListResponseEnvelopeJSON `json:"-"` } -// sslVerificationSSLVerificationSSLVerificationDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [SSLVerificationSSLVerificationSSLVerificationDetailsResponseEnvelope] -type sslVerificationSSLVerificationSSLVerificationDetailsResponseEnvelopeJSON struct { +// sslVerificationListResponseEnvelopeJSON contains the JSON metadata for the +// struct [SSLVerificationListResponseEnvelope] +type sslVerificationListResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SSLVerificationSSLVerificationSSLVerificationDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SSLVerificationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/sslverification_test.go b/sslverification_test.go index 98eb93a865a..b2120e5e731 100644 --- a/sslverification_test.go +++ b/sslverification_test.go @@ -29,7 +29,7 @@ func TestSSLVerificationUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Verifications.Update( + _, err := client.SSL.Verification.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "a77f8bd7-3b47-46b4-a6f1-75cf98109948", @@ -46,7 +46,7 @@ func TestSSLVerificationUpdate(t *testing.T) { } } -func TestSSLVerificationSSLVerificationSSLVerificationDetailsWithOptionalParams(t *testing.T) { +func TestSSLVerificationListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,11 +62,11 @@ func TestSSLVerificationSSLVerificationSSLVerificationDetailsWithOptionalParams( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.SSLs.Verifications.SSLVerificationSSLVerificationDetails( + _, err := client.SSL.Verification.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SSLVerificationSSLVerificationSSLVerificationDetailsParams{ - Retry: cloudflare.F(cloudflare.SSLVerificationSSLVerificationSSLVerificationDetailsParamsRetryTrue), + cloudflare.SSLVerificationListParams{ + Retry: cloudflare.F(cloudflare.SSLVerificationListParamsRetryTrue), }, ) if err != nil { diff --git a/storagekvnamespace.go b/storagekvnamespace.go index 1af0c976073..776d0e3123a 100644 --- a/storagekvnamespace.go +++ b/storagekvnamespace.go @@ -25,7 +25,7 @@ import ( // instead. type StorageKvNamespaceService struct { Options []option.RequestOption - Bulks *StorageKvNamespaceBulkService + Bulk *StorageKvNamespaceBulkService Keys *StorageKvNamespaceKeyService Metadata *StorageKvNamespaceMetadataService Values *StorageKvNamespaceValueService @@ -37,19 +37,21 @@ type StorageKvNamespaceService struct { func NewStorageKvNamespaceService(opts ...option.RequestOption) (r *StorageKvNamespaceService) { r = &StorageKvNamespaceService{} r.Options = opts - r.Bulks = NewStorageKvNamespaceBulkService(opts...) + r.Bulk = NewStorageKvNamespaceBulkService(opts...) r.Keys = NewStorageKvNamespaceKeyService(opts...) r.Metadata = NewStorageKvNamespaceMetadataService(opts...) r.Values = NewStorageKvNamespaceValueService(opts...) return } -// Modifies a namespace's title. -func (r *StorageKvNamespaceService) Update(ctx context.Context, accountID string, namespaceID string, body StorageKvNamespaceUpdateParams, opts ...option.RequestOption) (res *StorageKvNamespaceUpdateResponse, err error) { +// Creates a namespace under the given title. A `400` is returned if the account +// already owns a namespace with this title. A namespace must be explicitly deleted +// to be replaced. +func (r *StorageKvNamespaceService) New(ctx context.Context, accountID string, body StorageKvNamespaceNewParams, opts ...option.RequestOption) (res *StorageKvNamespaceNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StorageKvNamespaceUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", accountID, namespaceID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env StorageKvNamespaceNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -93,14 +95,12 @@ func (r *StorageKvNamespaceService) Delete(ctx context.Context, accountID string return } -// Creates a namespace under the given title. A `400` is returned if the account -// already owns a namespace with this title. A namespace must be explicitly deleted -// to be replaced. -func (r *StorageKvNamespaceService) WorkersKvNamespaceNewANamespace(ctx context.Context, accountID string, body StorageKvNamespaceWorkersKvNamespaceNewANamespaceParams, opts ...option.RequestOption) (res *StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse, err error) { +// Modifies a namespace's title. +func (r *StorageKvNamespaceService) Replace(ctx context.Context, accountID string, namespaceID string, body StorageKvNamespaceReplaceParams, opts ...option.RequestOption) (res *StorageKvNamespaceReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelope - path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env StorageKvNamespaceReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", accountID, namespaceID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -108,21 +108,29 @@ func (r *StorageKvNamespaceService) WorkersKvNamespaceNewANamespace(ctx context. return } -// Union satisfied by [StorageKvNamespaceUpdateResponseUnknown] or -// [shared.UnionString]. -type StorageKvNamespaceUpdateResponse interface { - ImplementsStorageKvNamespaceUpdateResponse() +type StorageKvNamespaceNewResponse struct { + // Namespace identifier tag. + ID string `json:"id,required"` + // A human-readable string name for a Namespace. + Title string `json:"title,required"` + // True if keys written on the URL will be URL-decoded before storing. For example, + // if set to "true", a key written on the URL as "%3F" will be stored as "?". + SupportsURLEncoding bool `json:"supports_url_encoding"` + JSON storageKvNamespaceNewResponseJSON `json:"-"` } -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*StorageKvNamespaceUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// storageKvNamespaceNewResponseJSON contains the JSON metadata for the struct +// [StorageKvNamespaceNewResponse] +type storageKvNamespaceNewResponseJSON struct { + ID apijson.Field + Title apijson.Field + SupportsURLEncoding apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StorageKvNamespaceNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } type StorageKvNamespaceListResponse struct { @@ -167,53 +175,44 @@ func init() { ) } -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse struct { - // Namespace identifier tag. - ID string `json:"id,required"` - // A human-readable string name for a Namespace. - Title string `json:"title,required"` - // True if keys written on the URL will be URL-decoded before storing. For example, - // if set to "true", a key written on the URL as "%3F" will be stored as "?". - SupportsURLEncoding bool `json:"supports_url_encoding"` - JSON storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseJSON `json:"-"` -} - -// storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseJSON contains the JSON -// metadata for the struct -// [StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse] -type storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseJSON struct { - ID apijson.Field - Title apijson.Field - SupportsURLEncoding apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Union satisfied by [StorageKvNamespaceReplaceResponseUnknown] or +// [shared.UnionString]. +type StorageKvNamespaceReplaceResponse interface { + ImplementsStorageKvNamespaceReplaceResponse() } -func (r *StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*StorageKvNamespaceReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -type StorageKvNamespaceUpdateParams struct { +type StorageKvNamespaceNewParams struct { // A human-readable string name for a Namespace. Title param.Field[string] `json:"title,required"` } -func (r StorageKvNamespaceUpdateParams) MarshalJSON() (data []byte, err error) { +func (r StorageKvNamespaceNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StorageKvNamespaceUpdateResponseEnvelope struct { - Errors []StorageKvNamespaceUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StorageKvNamespaceUpdateResponseEnvelopeMessages `json:"messages,required"` - Result StorageKvNamespaceUpdateResponse `json:"result,required"` +type StorageKvNamespaceNewResponseEnvelope struct { + Errors []StorageKvNamespaceNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StorageKvNamespaceNewResponseEnvelopeMessages `json:"messages,required"` + Result StorageKvNamespaceNewResponse `json:"result,required"` // Whether the API call was successful - Success StorageKvNamespaceUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON storageKvNamespaceUpdateResponseEnvelopeJSON `json:"-"` + Success StorageKvNamespaceNewResponseEnvelopeSuccess `json:"success,required"` + JSON storageKvNamespaceNewResponseEnvelopeJSON `json:"-"` } -// storageKvNamespaceUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [StorageKvNamespaceUpdateResponseEnvelope] -type storageKvNamespaceUpdateResponseEnvelopeJSON struct { +// storageKvNamespaceNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [StorageKvNamespaceNewResponseEnvelope] +type storageKvNamespaceNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -222,53 +221,53 @@ type storageKvNamespaceUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceUpdateResponseEnvelopeErrorsJSON `json:"-"` +type StorageKvNamespaceNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceNewResponseEnvelopeErrorsJSON `json:"-"` } -// storageKvNamespaceUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [StorageKvNamespaceUpdateResponseEnvelopeErrors] -type storageKvNamespaceUpdateResponseEnvelopeErrorsJSON struct { +// storageKvNamespaceNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StorageKvNamespaceNewResponseEnvelopeErrors] +type storageKvNamespaceNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceUpdateResponseEnvelopeMessagesJSON `json:"-"` +type StorageKvNamespaceNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceNewResponseEnvelopeMessagesJSON `json:"-"` } -// storageKvNamespaceUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [StorageKvNamespaceUpdateResponseEnvelopeMessages] -type storageKvNamespaceUpdateResponseEnvelopeMessagesJSON struct { +// storageKvNamespaceNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StorageKvNamespaceNewResponseEnvelopeMessages] +type storageKvNamespaceNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StorageKvNamespaceUpdateResponseEnvelopeSuccess bool +type StorageKvNamespaceNewResponseEnvelopeSuccess bool const ( - StorageKvNamespaceUpdateResponseEnvelopeSuccessTrue StorageKvNamespaceUpdateResponseEnvelopeSuccess = true + StorageKvNamespaceNewResponseEnvelopeSuccessTrue StorageKvNamespaceNewResponseEnvelopeSuccess = true ) type StorageKvNamespaceListParams struct { @@ -376,28 +375,27 @@ const ( StorageKvNamespaceDeleteResponseEnvelopeSuccessTrue StorageKvNamespaceDeleteResponseEnvelopeSuccess = true ) -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceParams struct { +type StorageKvNamespaceReplaceParams struct { // A human-readable string name for a Namespace. Title param.Field[string] `json:"title,required"` } -func (r StorageKvNamespaceWorkersKvNamespaceNewANamespaceParams) MarshalJSON() (data []byte, err error) { +func (r StorageKvNamespaceReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelope struct { - Errors []StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrors `json:"errors,required"` - Messages []StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessages `json:"messages,required"` - Result StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponse `json:"result,required"` +type StorageKvNamespaceReplaceResponseEnvelope struct { + Errors []StorageKvNamespaceReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StorageKvNamespaceReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StorageKvNamespaceReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeSuccess `json:"success,required"` - JSON storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeJSON `json:"-"` + Success StorageKvNamespaceReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON storageKvNamespaceReplaceResponseEnvelopeJSON `json:"-"` } -// storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelope] -type storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeJSON struct { +// storageKvNamespaceReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [StorageKvNamespaceReplaceResponseEnvelope] +type storageKvNamespaceReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -406,53 +404,51 @@ type storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrorsJSON `json:"-"` +type StorageKvNamespaceReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrors] -type storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrorsJSON struct { +// storageKvNamespaceReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [StorageKvNamespaceReplaceResponseEnvelopeErrors] +type storageKvNamespaceReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessagesJSON `json:"-"` +type StorageKvNamespaceReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessages] -type storageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessagesJSON struct { +// storageKvNamespaceReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [StorageKvNamespaceReplaceResponseEnvelopeMessages] +type storageKvNamespaceReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeSuccess bool +type StorageKvNamespaceReplaceResponseEnvelopeSuccess bool const ( - StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeSuccessTrue StorageKvNamespaceWorkersKvNamespaceNewANamespaceResponseEnvelopeSuccess = true + StorageKvNamespaceReplaceResponseEnvelopeSuccessTrue StorageKvNamespaceReplaceResponseEnvelopeSuccess = true ) diff --git a/storagekvnamespace_test.go b/storagekvnamespace_test.go index 0ec3cea9c75..856911be7f9 100644 --- a/storagekvnamespace_test.go +++ b/storagekvnamespace_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStorageKvNamespaceUpdate(t *testing.T) { +func TestStorageKvNamespaceNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestStorageKvNamespaceUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Update( + _, err := client.Storage.Kv.Namespaces.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "0f2ac74b498b48028cb68387c421e279", - cloudflare.StorageKvNamespaceUpdateParams{ + cloudflare.StorageKvNamespaceNewParams{ Title: cloudflare.F("My Own Namespace"), }, ) @@ -111,7 +110,7 @@ func TestStorageKvNamespaceDelete(t *testing.T) { } } -func TestStorageKvNamespaceWorkersKvNamespaceNewANamespace(t *testing.T) { +func TestStorageKvNamespaceReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -127,10 +126,11 @@ func TestStorageKvNamespaceWorkersKvNamespaceNewANamespace(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.WorkersKvNamespaceNewANamespace( + _, err := client.Storage.Kv.Namespaces.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StorageKvNamespaceWorkersKvNamespaceNewANamespaceParams{ + "0f2ac74b498b48028cb68387c421e279", + cloudflare.StorageKvNamespaceReplaceParams{ Title: cloudflare.F("My Own Namespace"), }, ) diff --git a/storagekvnamespacebulk.go b/storagekvnamespacebulk.go index f11301c19d9..2fd8e73dd2d 100644 --- a/storagekvnamespacebulk.go +++ b/storagekvnamespacebulk.go @@ -54,9 +54,9 @@ func (r *StorageKvNamespaceBulkService) Delete(ctx context.Context, accountID st // `expiration_ttl` is specified, the key-value pair will never expire. If both are // set, `expiration_ttl` is used and `expiration` is ignored. The entire request // size must be 100 megabytes or less. -func (r *StorageKvNamespaceBulkService) WorkersKvNamespaceWriteMultipleKeyValuePairs(ctx context.Context, accountID string, namespaceID string, body StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParams, opts ...option.RequestOption) (res *StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse, err error) { +func (r *StorageKvNamespaceBulkService) Replace(ctx context.Context, accountID string, namespaceID string, body StorageKvNamespaceBulkReplaceParams, opts ...option.RequestOption) (res *StorageKvNamespaceBulkReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelope + var env StorageKvNamespaceBulkReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/bulk", accountID, namespaceID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -83,16 +83,15 @@ func init() { ) } -// Union satisfied by -// [StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseUnknown] -// or [shared.UnionString]. -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse interface { - ImplementsStorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse() +// Union satisfied by [StorageKvNamespaceBulkReplaceResponseUnknown] or +// [shared.UnionString]. +type StorageKvNamespaceBulkReplaceResponse interface { + ImplementsStorageKvNamespaceBulkReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse)(nil)).Elem(), + reflect.TypeOf((*StorageKvNamespaceBulkReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -178,15 +177,15 @@ const ( StorageKvNamespaceBulkDeleteResponseEnvelopeSuccessTrue StorageKvNamespaceBulkDeleteResponseEnvelopeSuccess = true ) -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParams struct { - Body param.Field[[]StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParamsBody] `json:"body,required"` +type StorageKvNamespaceBulkReplaceParams struct { + Body param.Field[[]StorageKvNamespaceBulkReplaceParamsBody] `json:"body,required"` } -func (r StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParams) MarshalJSON() (data []byte, err error) { +func (r StorageKvNamespaceBulkReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParamsBody struct { +type StorageKvNamespaceBulkReplaceParamsBody struct { // Whether or not the server should base64 decode the value before storing it. // Useful for writing values that wouldn't otherwise be valid JSON strings, such as // images. @@ -206,23 +205,22 @@ type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParamsBod Value param.Field[string] `json:"value"` } -func (r StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParamsBody) MarshalJSON() (data []byte, err error) { +func (r StorageKvNamespaceBulkReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelope struct { - Errors []StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrors `json:"errors,required"` - Messages []StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessages `json:"messages,required"` - Result StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponse `json:"result,required"` +type StorageKvNamespaceBulkReplaceResponseEnvelope struct { + Errors []StorageKvNamespaceBulkReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StorageKvNamespaceBulkReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StorageKvNamespaceBulkReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeSuccess `json:"success,required"` - JSON storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeJSON `json:"-"` + Success StorageKvNamespaceBulkReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON storageKvNamespaceBulkReplaceResponseEnvelopeJSON `json:"-"` } -// storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelope] -type storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeJSON struct { +// storageKvNamespaceBulkReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [StorageKvNamespaceBulkReplaceResponseEnvelope] +type storageKvNamespaceBulkReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -231,53 +229,51 @@ type storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseE ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceBulkReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrorsJSON `json:"-"` +type StorageKvNamespaceBulkReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceBulkReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrors] -type storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrorsJSON struct { +// storageKvNamespaceBulkReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [StorageKvNamespaceBulkReplaceResponseEnvelopeErrors] +type storageKvNamespaceBulkReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceBulkReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessagesJSON `json:"-"` +type StorageKvNamespaceBulkReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceBulkReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessages] -type storageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessagesJSON struct { +// storageKvNamespaceBulkReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [StorageKvNamespaceBulkReplaceResponseEnvelopeMessages] +type storageKvNamespaceBulkReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceBulkReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeSuccess bool +type StorageKvNamespaceBulkReplaceResponseEnvelopeSuccess bool const ( - StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeSuccessTrue StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsResponseEnvelopeSuccess = true + StorageKvNamespaceBulkReplaceResponseEnvelopeSuccessTrue StorageKvNamespaceBulkReplaceResponseEnvelopeSuccess = true ) diff --git a/storagekvnamespacebulk_test.go b/storagekvnamespacebulk_test.go index 69d6739fa77..ab5cd174ce1 100644 --- a/storagekvnamespacebulk_test.go +++ b/storagekvnamespacebulk_test.go @@ -29,7 +29,7 @@ func TestStorageKvNamespaceBulkDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Bulks.Delete( + _, err := client.Storage.Kv.Namespaces.Bulk.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0f2ac74b498b48028cb68387c421e279", @@ -46,7 +46,7 @@ func TestStorageKvNamespaceBulkDelete(t *testing.T) { } } -func TestStorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairs(t *testing.T) { +func TestStorageKvNamespaceBulkReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,12 +62,12 @@ func TestStorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairs(t *t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Bulks.WorkersKvNamespaceWriteMultipleKeyValuePairs( + _, err := client.Storage.Kv.Namespaces.Bulk.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0f2ac74b498b48028cb68387c421e279", - cloudflare.StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParams{ - Body: cloudflare.F([]cloudflare.StorageKvNamespaceBulkWorkersKvNamespaceWriteMultipleKeyValuePairsParamsBody{{ + cloudflare.StorageKvNamespaceBulkReplaceParams{ + Body: cloudflare.F([]cloudflare.StorageKvNamespaceBulkReplaceParamsBody{{ Base64: cloudflare.F(true), Expiration: cloudflare.F(1578435000.000000), ExpirationTTL: cloudflare.F(300.000000), diff --git a/storagekvnamespacevalue.go b/storagekvnamespacevalue.go index e4aff2b98ea..608ec59027c 100644 --- a/storagekvnamespacevalue.go +++ b/storagekvnamespacevalue.go @@ -34,24 +34,6 @@ func NewStorageKvNamespaceValueService(opts ...option.RequestOption) (r *Storage return } -// Write a value identified by a key. Use URL-encoding to use special characters -// (for example, `:`, `!`, `%`) in the key name. Body should be the value to be -// stored along with JSON metadata to be associated with the key/value pair. -// Existing values, expirations, and metadata will be overwritten. If neither -// `expiration` nor `expiration_ttl` is specified, the key-value pair will never -// expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. -func (r *StorageKvNamespaceValueService) Update(ctx context.Context, accountID string, namespaceID string, keyName string, body StorageKvNamespaceValueUpdateParams, opts ...option.RequestOption) (res *StorageKvNamespaceValueUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env StorageKvNamespaceValueUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", accountID, namespaceID, keyName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Remove a KV pair from the namespace. Use URL-encoding to use special characters // (for example, `:`, `!`, `%`) in the key name. func (r *StorageKvNamespaceValueService) Delete(ctx context.Context, accountID string, namespaceID string, keyName string, opts ...option.RequestOption) (res *StorageKvNamespaceValueDeleteResponse, err error) { @@ -78,15 +60,33 @@ func (r *StorageKvNamespaceValueService) Get(ctx context.Context, accountID stri return } -// Union satisfied by [StorageKvNamespaceValueUpdateResponseUnknown] or +// Write a value identified by a key. Use URL-encoding to use special characters +// (for example, `:`, `!`, `%`) in the key name. Body should be the value to be +// stored along with JSON metadata to be associated with the key/value pair. +// Existing values, expirations, and metadata will be overwritten. If neither +// `expiration` nor `expiration_ttl` is specified, the key-value pair will never +// expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. +func (r *StorageKvNamespaceValueService) Replace(ctx context.Context, accountID string, namespaceID string, keyName string, body StorageKvNamespaceValueReplaceParams, opts ...option.RequestOption) (res *StorageKvNamespaceValueReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env StorageKvNamespaceValueReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", accountID, namespaceID, keyName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [StorageKvNamespaceValueDeleteResponseUnknown] or // [shared.UnionString]. -type StorageKvNamespaceValueUpdateResponse interface { - ImplementsStorageKvNamespaceValueUpdateResponse() +type StorageKvNamespaceValueDeleteResponse interface { + ImplementsStorageKvNamespaceValueDeleteResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StorageKvNamespaceValueUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*StorageKvNamespaceValueDeleteResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -95,15 +95,15 @@ func init() { ) } -// Union satisfied by [StorageKvNamespaceValueDeleteResponseUnknown] or +// Union satisfied by [StorageKvNamespaceValueReplaceResponseUnknown] or // [shared.UnionString]. -type StorageKvNamespaceValueDeleteResponse interface { - ImplementsStorageKvNamespaceValueDeleteResponse() +type StorageKvNamespaceValueReplaceResponse interface { + ImplementsStorageKvNamespaceValueReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StorageKvNamespaceValueDeleteResponse)(nil)).Elem(), + reflect.TypeOf((*StorageKvNamespaceValueReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -112,29 +112,18 @@ func init() { ) } -type StorageKvNamespaceValueUpdateParams struct { - // Arbitrary JSON to be associated with a key/value pair. - Metadata param.Field[string] `json:"metadata,required"` - // A byte sequence to be stored, up to 25 MiB in length. - Value param.Field[string] `json:"value,required"` -} - -func (r StorageKvNamespaceValueUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StorageKvNamespaceValueUpdateResponseEnvelope struct { - Errors []StorageKvNamespaceValueUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StorageKvNamespaceValueUpdateResponseEnvelopeMessages `json:"messages,required"` - Result StorageKvNamespaceValueUpdateResponse `json:"result,required"` +type StorageKvNamespaceValueDeleteResponseEnvelope struct { + Errors []StorageKvNamespaceValueDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []StorageKvNamespaceValueDeleteResponseEnvelopeMessages `json:"messages,required"` + Result StorageKvNamespaceValueDeleteResponse `json:"result,required"` // Whether the API call was successful - Success StorageKvNamespaceValueUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON storageKvNamespaceValueUpdateResponseEnvelopeJSON `json:"-"` + Success StorageKvNamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON storageKvNamespaceValueDeleteResponseEnvelopeJSON `json:"-"` } -// storageKvNamespaceValueUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [StorageKvNamespaceValueUpdateResponseEnvelope] -type storageKvNamespaceValueUpdateResponseEnvelopeJSON struct { +// storageKvNamespaceValueDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [StorageKvNamespaceValueDeleteResponseEnvelope] +type storageKvNamespaceValueDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -143,67 +132,78 @@ type storageKvNamespaceValueUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceValueUpdateResponseEnvelopeErrors struct { +type StorageKvNamespaceValueDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON storageKvNamespaceValueUpdateResponseEnvelopeErrorsJSON `json:"-"` + JSON storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// storageKvNamespaceValueUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [StorageKvNamespaceValueUpdateResponseEnvelopeErrors] -type storageKvNamespaceValueUpdateResponseEnvelopeErrorsJSON struct { +// storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [StorageKvNamespaceValueDeleteResponseEnvelopeErrors] +type storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceValueUpdateResponseEnvelopeMessages struct { +type StorageKvNamespaceValueDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON storageKvNamespaceValueUpdateResponseEnvelopeMessagesJSON `json:"-"` + JSON storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// storageKvNamespaceValueUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [StorageKvNamespaceValueUpdateResponseEnvelopeMessages] -type storageKvNamespaceValueUpdateResponseEnvelopeMessagesJSON struct { +// storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [StorageKvNamespaceValueDeleteResponseEnvelopeMessages] +type storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StorageKvNamespaceValueUpdateResponseEnvelopeSuccess bool +type StorageKvNamespaceValueDeleteResponseEnvelopeSuccess bool const ( - StorageKvNamespaceValueUpdateResponseEnvelopeSuccessTrue StorageKvNamespaceValueUpdateResponseEnvelopeSuccess = true + StorageKvNamespaceValueDeleteResponseEnvelopeSuccessTrue StorageKvNamespaceValueDeleteResponseEnvelopeSuccess = true ) -type StorageKvNamespaceValueDeleteResponseEnvelope struct { - Errors []StorageKvNamespaceValueDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []StorageKvNamespaceValueDeleteResponseEnvelopeMessages `json:"messages,required"` - Result StorageKvNamespaceValueDeleteResponse `json:"result,required"` +type StorageKvNamespaceValueReplaceParams struct { + // Arbitrary JSON to be associated with a key/value pair. + Metadata param.Field[string] `json:"metadata,required"` + // A byte sequence to be stored, up to 25 MiB in length. + Value param.Field[string] `json:"value,required"` +} + +func (r StorageKvNamespaceValueReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StorageKvNamespaceValueReplaceResponseEnvelope struct { + Errors []StorageKvNamespaceValueReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StorageKvNamespaceValueReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StorageKvNamespaceValueReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StorageKvNamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON storageKvNamespaceValueDeleteResponseEnvelopeJSON `json:"-"` + Success StorageKvNamespaceValueReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON storageKvNamespaceValueReplaceResponseEnvelopeJSON `json:"-"` } -// storageKvNamespaceValueDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [StorageKvNamespaceValueDeleteResponseEnvelope] -type storageKvNamespaceValueDeleteResponseEnvelopeJSON struct { +// storageKvNamespaceValueReplaceResponseEnvelopeJSON contains the JSON metadata +// for the struct [StorageKvNamespaceValueReplaceResponseEnvelope] +type storageKvNamespaceValueReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -212,51 +212,51 @@ type storageKvNamespaceValueDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceValueDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON `json:"-"` +type StorageKvNamespaceValueReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceValueReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [StorageKvNamespaceValueDeleteResponseEnvelopeErrors] -type storageKvNamespaceValueDeleteResponseEnvelopeErrorsJSON struct { +// storageKvNamespaceValueReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [StorageKvNamespaceValueReplaceResponseEnvelopeErrors] +type storageKvNamespaceValueReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StorageKvNamespaceValueDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON `json:"-"` +type StorageKvNamespaceValueReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON storageKvNamespaceValueReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [StorageKvNamespaceValueDeleteResponseEnvelopeMessages] -type storageKvNamespaceValueDeleteResponseEnvelopeMessagesJSON struct { +// storageKvNamespaceValueReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [StorageKvNamespaceValueReplaceResponseEnvelopeMessages] +type storageKvNamespaceValueReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StorageKvNamespaceValueDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StorageKvNamespaceValueReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StorageKvNamespaceValueDeleteResponseEnvelopeSuccess bool +type StorageKvNamespaceValueReplaceResponseEnvelopeSuccess bool const ( - StorageKvNamespaceValueDeleteResponseEnvelopeSuccessTrue StorageKvNamespaceValueDeleteResponseEnvelopeSuccess = true + StorageKvNamespaceValueReplaceResponseEnvelopeSuccessTrue StorageKvNamespaceValueReplaceResponseEnvelopeSuccess = true ) diff --git a/storagekvnamespacevalue_test.go b/storagekvnamespacevalue_test.go index db71b42bee0..59b2955196a 100644 --- a/storagekvnamespacevalue_test.go +++ b/storagekvnamespacevalue_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStorageKvNamespaceValueUpdate(t *testing.T) { +func TestStorageKvNamespaceValueDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,11 @@ func TestStorageKvNamespaceValueUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Values.Update( + _, err := client.Storage.Kv.Namespaces.Values.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0f2ac74b498b48028cb68387c421e279", "My-Key", - cloudflare.StorageKvNamespaceValueUpdateParams{ - Metadata: cloudflare.F("{\"someMetadataKey\": \"someMetadataValue\"}"), - Value: cloudflare.F("Some Value"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -48,7 +44,7 @@ func TestStorageKvNamespaceValueUpdate(t *testing.T) { } } -func TestStorageKvNamespaceValueDelete(t *testing.T) { +func TestStorageKvNamespaceValueGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,7 +60,7 @@ func TestStorageKvNamespaceValueDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Values.Delete( + _, err := client.Storage.Kv.Namespaces.Values.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0f2ac74b498b48028cb68387c421e279", @@ -79,7 +75,7 @@ func TestStorageKvNamespaceValueDelete(t *testing.T) { } } -func TestStorageKvNamespaceValueGet(t *testing.T) { +func TestStorageKvNamespaceValueReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -95,11 +91,15 @@ func TestStorageKvNamespaceValueGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Storage.Kv.Namespaces.Values.Get( + _, err := client.Storage.Kv.Namespaces.Values.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "0f2ac74b498b48028cb68387c421e279", "My-Key", + cloudflare.StorageKvNamespaceValueReplaceParams{ + Metadata: cloudflare.F("{\"someMetadataKey\": \"someMetadataValue\"}"), + Value: cloudflare.F("Some Value"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/stream.go b/stream.go index e7dc077903a..b4fddd3dac0 100644 --- a/stream.go +++ b/stream.go @@ -59,12 +59,25 @@ func NewStreamService(opts ...option.RequestOption) (r *StreamService) { return } -// Edit details for a single video. -func (r *StreamService) Update(ctx context.Context, accountID string, identifier string, body StreamUpdateParams, opts ...option.RequestOption) (res *StreamUpdateResponse, err error) { +// Initiates a video upload using the TUS protocol. On success, the server responds +// with a status code 201 (created) and includes a `location` header to indicate +// where the content should be uploaded. Refer to https://tus.io for protocol +// details. +func (r *StreamService) New(ctx context.Context, accountID string, body StreamNewParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) - var env StreamUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) + path := fmt.Sprintf("accounts/%s/stream", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, nil, opts...) + return +} + +// Lists up to 1000 videos from a single request. For a specific range, refer to +// the optional parameters. +func (r *StreamService) List(ctx context.Context, accountID string, query StreamListParams, opts ...option.RequestOption) (res *[]StreamListResponse, err error) { + opts = append(r.Options[:], opts...) + var env StreamListResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -94,33 +107,7 @@ func (r *StreamService) Get(ctx context.Context, accountID string, identifier st return } -// Initiates a video upload using the TUS protocol. On success, the server responds -// with a status code 201 (created) and includes a `location` header to indicate -// where the content should be uploaded. Refer to https://tus.io for protocol -// details. -func (r *StreamService) StreamVideosInitiateVideoUploadsUsingTus(ctx context.Context, accountID string, body StreamStreamVideosInitiateVideoUploadsUsingTusParams, opts ...option.RequestOption) (err error) { - opts = append(r.Options[:], opts...) - opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/stream", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, nil, opts...) - return -} - -// Lists up to 1000 videos from a single request. For a specific range, refer to -// the optional parameters. -func (r *StreamService) StreamVideosListVideos(ctx context.Context, accountID string, query StreamStreamVideosListVideosParams, opts ...option.RequestOption) (res *[]StreamStreamVideosListVideosResponse, err error) { - opts = append(r.Options[:], opts...) - var env StreamStreamVideosListVideosResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type StreamUpdateResponse struct { +type StreamListResponse struct { // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. @@ -132,8 +119,8 @@ type StreamUpdateResponse struct { // The duration of the video in seconds. A value of `-1` means the duration is // unknown. The duration becomes available after the upload and before the video is // ready. - Duration float64 `json:"duration"` - Input StreamUpdateResponseInput `json:"input"` + Duration float64 `json:"duration"` + Input StreamListResponseInput `json:"input"` // The live input ID used to upload a video with Stream Live. LiveInput string `json:"liveInput"` // The maximum duration in seconds for a video upload. Can be set for a video that @@ -145,8 +132,8 @@ type StreamUpdateResponse struct { // managing videos. Meta interface{} `json:"meta"` // The date and time the media item was last modified. - Modified time.Time `json:"modified" format:"date-time"` - Playback StreamUpdateResponsePlayback `json:"playback"` + Modified time.Time `json:"modified" format:"date-time"` + Playback StreamListResponsePlayback `json:"playback"` // The video's preview page URI. This field is omitted until encoding is complete. Preview string `json:"preview" format:"uri"` // Indicates whether the video is playable. The field is empty if the video is not @@ -169,7 +156,7 @@ type StreamUpdateResponse struct { // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the // approximate percent of completion. If the `state` is `error`, `errorReasonCode` // and `errorReasonText` provide additional details. - Status StreamUpdateResponseStatus `json:"status"` + Status StreamListResponseStatus `json:"status"` // The media item's thumbnail URI. This field is omitted until encoding is // complete. Thumbnail string `json:"thumbnail" format:"uri"` @@ -184,14 +171,14 @@ type StreamUpdateResponse struct { Uploaded time.Time `json:"uploaded" format:"date-time"` // The date and time when the video upload URL is no longer valid for direct user // uploads. - UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` - Watermark StreamUpdateResponseWatermark `json:"watermark"` - JSON streamUpdateResponseJSON `json:"-"` + UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` + Watermark StreamListResponseWatermark `json:"watermark"` + JSON streamListResponseJSON `json:"-"` } -// streamUpdateResponseJSON contains the JSON metadata for the struct -// [StreamUpdateResponse] -type streamUpdateResponseJSON struct { +// streamListResponseJSON contains the JSON metadata for the struct +// [StreamListResponse] +type streamListResponseJSON struct { AllowedOrigins apijson.Field Created apijson.Field Creator apijson.Field @@ -219,51 +206,51 @@ type streamUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamUpdateResponseInput struct { +type StreamListResponseInput struct { // The video height in pixels. A value of `-1` means the height is unknown. The // value becomes available after the upload and before the video is ready. Height int64 `json:"height"` // The video width in pixels. A value of `-1` means the width is unknown. The value // becomes available after the upload and before the video is ready. - Width int64 `json:"width"` - JSON streamUpdateResponseInputJSON `json:"-"` + Width int64 `json:"width"` + JSON streamListResponseInputJSON `json:"-"` } -// streamUpdateResponseInputJSON contains the JSON metadata for the struct -// [StreamUpdateResponseInput] -type streamUpdateResponseInputJSON struct { +// streamListResponseInputJSON contains the JSON metadata for the struct +// [StreamListResponseInput] +type streamListResponseInputJSON struct { Height apijson.Field Width apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseInput) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseInput) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamUpdateResponsePlayback struct { +type StreamListResponsePlayback struct { // DASH Media Presentation Description for the video. Dash string `json:"dash"` // The HLS manifest for the video. - Hls string `json:"hls"` - JSON streamUpdateResponsePlaybackJSON `json:"-"` + Hls string `json:"hls"` + JSON streamListResponsePlaybackJSON `json:"-"` } -// streamUpdateResponsePlaybackJSON contains the JSON metadata for the struct -// [StreamUpdateResponsePlayback] -type streamUpdateResponsePlaybackJSON struct { +// streamListResponsePlaybackJSON contains the JSON metadata for the struct +// [StreamListResponsePlayback] +type streamListResponsePlaybackJSON struct { Dash apijson.Field Hls apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponsePlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponsePlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -272,7 +259,7 @@ func (r *StreamUpdateResponsePlayback) UnmarshalJSON(data []byte) (err error) { // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the // approximate percent of completion. If the `state` is `error`, `errorReasonCode` // and `errorReasonText` provide additional details. -type StreamUpdateResponseStatus struct { +type StreamListResponseStatus struct { // Specifies why the video failed to encode. This field is empty if the video is // not in an `error` state. Preferred for programmatic use. ErrorReasonCode string `json:"errorReasonCode"` @@ -283,13 +270,13 @@ type StreamUpdateResponseStatus struct { // non-negative integer. PctComplete string `json:"pctComplete"` // Specifies the processing status for all quality levels for a video. - State StreamUpdateResponseStatusState `json:"state"` - JSON streamUpdateResponseStatusJSON `json:"-"` + State StreamListResponseStatusState `json:"state"` + JSON streamListResponseStatusJSON `json:"-"` } -// streamUpdateResponseStatusJSON contains the JSON metadata for the struct -// [StreamUpdateResponseStatus] -type streamUpdateResponseStatusJSON struct { +// streamListResponseStatusJSON contains the JSON metadata for the struct +// [StreamListResponseStatus] +type streamListResponseStatusJSON struct { ErrorReasonCode apijson.Field ErrorReasonText apijson.Field PctComplete apijson.Field @@ -298,23 +285,23 @@ type streamUpdateResponseStatusJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseStatus) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseStatus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the processing status for all quality levels for a video. -type StreamUpdateResponseStatusState string +type StreamListResponseStatusState string const ( - StreamUpdateResponseStatusStatePendingupload StreamUpdateResponseStatusState = "pendingupload" - StreamUpdateResponseStatusStateDownloading StreamUpdateResponseStatusState = "downloading" - StreamUpdateResponseStatusStateQueued StreamUpdateResponseStatusState = "queued" - StreamUpdateResponseStatusStateInprogress StreamUpdateResponseStatusState = "inprogress" - StreamUpdateResponseStatusStateReady StreamUpdateResponseStatusState = "ready" - StreamUpdateResponseStatusStateError StreamUpdateResponseStatusState = "error" + StreamListResponseStatusStatePendingupload StreamListResponseStatusState = "pendingupload" + StreamListResponseStatusStateDownloading StreamListResponseStatusState = "downloading" + StreamListResponseStatusStateQueued StreamListResponseStatusState = "queued" + StreamListResponseStatusStateInprogress StreamListResponseStatusState = "inprogress" + StreamListResponseStatusStateReady StreamListResponseStatusState = "ready" + StreamListResponseStatusStateError StreamListResponseStatusState = "error" ) -type StreamUpdateResponseWatermark struct { +type StreamListResponseWatermark struct { // The date and a time a watermark profile was created. Created time.Time `json:"created" format:"date-time"` // The source URL for a downloaded image. If the watermark profile was created via @@ -346,13 +333,13 @@ type StreamUpdateResponseWatermark struct { // The unique identifier for a watermark profile. Uid string `json:"uid"` // The width of the image in pixels. - Width int64 `json:"width"` - JSON streamUpdateResponseWatermarkJSON `json:"-"` + Width int64 `json:"width"` + JSON streamListResponseWatermarkJSON `json:"-"` } -// streamUpdateResponseWatermarkJSON contains the JSON metadata for the struct -// [StreamUpdateResponseWatermark] -type streamUpdateResponseWatermarkJSON struct { +// streamListResponseWatermarkJSON contains the JSON metadata for the struct +// [StreamListResponseWatermark] +type streamListResponseWatermarkJSON struct { Created apijson.Field DownloadedFrom apijson.Field Height apijson.Field @@ -368,7 +355,7 @@ type streamUpdateResponseWatermarkJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseWatermark) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseWatermark) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -624,361 +611,143 @@ func (r *StreamGetResponseWatermark) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamStreamVideosListVideosResponse struct { - // Lists the origins allowed to display the video. Enter allowed origin domains in - // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be - // viewed on any origin. - AllowedOrigins []string `json:"allowedOrigins"` - // The date and time the media item was created. - Created time.Time `json:"created" format:"date-time"` +type StreamNewParams struct { + // Specifies the TUS protocol version. This value must be included in every upload + // request. Notes: The only supported version of TUS protocol is 1.0.0. + TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"` + // Indicates the size of the entire upload in bytes. The value must be a + // non-negative integer. + UploadLength param.Field[int64] `header:"Upload-Length,required"` // A user-defined identifier for the media creator. - Creator string `json:"creator"` - // The duration of the video in seconds. A value of `-1` means the duration is - // unknown. The duration becomes available after the upload and before the video is - // ready. - Duration float64 `json:"duration"` - Input StreamStreamVideosListVideosResponseInput `json:"input"` - // The live input ID used to upload a video with Stream Live. - LiveInput string `json:"liveInput"` - // The maximum duration in seconds for a video upload. Can be set for a video that - // is not yet uploaded to limit its duration. Uploads that exceed the specified - // duration will fail during processing. A value of `-1` means the value is - // unknown. - MaxDurationSeconds int64 `json:"maxDurationSeconds"` - // A user modifiable key-value store used to reference other systems of record for - // managing videos. - Meta interface{} `json:"meta"` - // The date and time the media item was last modified. - Modified time.Time `json:"modified" format:"date-time"` - Playback StreamStreamVideosListVideosResponsePlayback `json:"playback"` - // The video's preview page URI. This field is omitted until encoding is complete. - Preview string `json:"preview" format:"uri"` - // Indicates whether the video is playable. The field is empty if the video is not - // ready for viewing or the live stream is still in progress. - ReadyToStream bool `json:"readyToStream"` - // Indicates the time at which the video became playable. The field is empty if the - // video is not ready for viewing or the live stream is still in progress. - ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"` - // Indicates whether the video can be a accessed using the UID. When set to `true`, - // a signed token must be generated with a signing key to view the video. - RequireSignedURLs bool `json:"requireSignedURLs"` - // Indicates the date and time at which the video will be deleted. Omit the field - // to indicate no change, or include with a `null` value to remove an existing - // scheduled deletion. If specified, must be at least 30 days from upload time. - ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"` - // The size of the media item in bytes. - Size float64 `json:"size"` - // Specifies a detailed status for a video. If the `state` is `inprogress` or - // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is - // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the - // approximate percent of completion. If the `state` is `error`, `errorReasonCode` - // and `errorReasonText` provide additional details. - Status StreamStreamVideosListVideosResponseStatus `json:"status"` - // The media item's thumbnail URI. This field is omitted until encoding is - // complete. - Thumbnail string `json:"thumbnail" format:"uri"` - // The timestamp for a thumbnail image calculated as a percentage value of the - // video's duration. To convert from a second-wise timestamp to a percentage, - // divide the desired timestamp by the total duration of the video. If this value - // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"` - // A Cloudflare-generated unique identifier for a media item. - Uid string `json:"uid"` - // The date and time the media item was uploaded. - Uploaded time.Time `json:"uploaded" format:"date-time"` - // The date and time when the video upload URL is no longer valid for direct user - // uploads. - UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` - Watermark StreamStreamVideosListVideosResponseWatermark `json:"watermark"` - JSON streamStreamVideosListVideosResponseJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseJSON contains the JSON metadata for the -// struct [StreamStreamVideosListVideosResponse] -type streamStreamVideosListVideosResponseJSON struct { - AllowedOrigins apijson.Field - Created apijson.Field - Creator apijson.Field - Duration apijson.Field - Input apijson.Field - LiveInput apijson.Field - MaxDurationSeconds apijson.Field - Meta apijson.Field - Modified apijson.Field - Playback apijson.Field - Preview apijson.Field - ReadyToStream apijson.Field - ReadyToStreamAt apijson.Field - RequireSignedURLs apijson.Field - ScheduledDeletion apijson.Field - Size apijson.Field - Status apijson.Field - Thumbnail apijson.Field - ThumbnailTimestampPct apijson.Field - Uid apijson.Field - Uploaded apijson.Field - UploadExpiry apijson.Field - Watermark apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamStreamVideosListVideosResponseInput struct { - // The video height in pixels. A value of `-1` means the height is unknown. The - // value becomes available after the upload and before the video is ready. - Height int64 `json:"height"` - // The video width in pixels. A value of `-1` means the width is unknown. The value - // becomes available after the upload and before the video is ready. - Width int64 `json:"width"` - JSON streamStreamVideosListVideosResponseInputJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseInputJSON contains the JSON metadata for the -// struct [StreamStreamVideosListVideosResponseInput] -type streamStreamVideosListVideosResponseInputJSON struct { - Height apijson.Field - Width apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponseInput) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamStreamVideosListVideosResponsePlayback struct { - // DASH Media Presentation Description for the video. - Dash string `json:"dash"` - // The HLS manifest for the video. - Hls string `json:"hls"` - JSON streamStreamVideosListVideosResponsePlaybackJSON `json:"-"` + UploadCreator param.Field[string] `header:"Upload-Creator"` + // Comma-separated key-value pairs following the TUS protocol specification. Values + // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`, + // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`. + UploadMetadata param.Field[string] `header:"Upload-Metadata"` } -// streamStreamVideosListVideosResponsePlaybackJSON contains the JSON metadata for -// the struct [StreamStreamVideosListVideosResponsePlayback] -type streamStreamVideosListVideosResponsePlaybackJSON struct { - Dash apijson.Field - Hls apijson.Field - raw string - ExtraFields map[string]apijson.Field -} +// Specifies the TUS protocol version. This value must be included in every upload +// request. Notes: The only supported version of TUS protocol is 1.0.0. +type StreamNewParamsTusResumable string -func (r *StreamStreamVideosListVideosResponsePlayback) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} +const ( + StreamNewParamsTusResumable1_0_0 StreamNewParamsTusResumable = "1.0.0" +) -// Specifies a detailed status for a video. If the `state` is `inprogress` or -// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is -// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the -// approximate percent of completion. If the `state` is `error`, `errorReasonCode` -// and `errorReasonText` provide additional details. -type StreamStreamVideosListVideosResponseStatus struct { - // Specifies why the video failed to encode. This field is empty if the video is - // not in an `error` state. Preferred for programmatic use. - ErrorReasonCode string `json:"errorReasonCode"` - // Specifies why the video failed to encode using a human readable error message in - // English. This field is empty if the video is not in an `error` state. - ErrorReasonText string `json:"errorReasonText"` - // Indicates the size of the entire upload in bytes. The value must be a - // non-negative integer. - PctComplete string `json:"pctComplete"` +type StreamListParams struct { + // Lists videos in ascending order of creation. + Asc param.Field[bool] `query:"asc"` + // A user-defined identifier for the media creator. + Creator param.Field[string] `query:"creator"` + // Lists videos created before the specified date. + End param.Field[time.Time] `query:"end" format:"date-time"` + // Includes the total number of videos associated with the submitted query + // parameters. + IncludeCounts param.Field[bool] `query:"include_counts"` + // Searches over the `name` key in the `meta` field. This field can be set with or + // after the upload request. + Search param.Field[string] `query:"search"` + // Lists videos created after the specified date. + Start param.Field[time.Time] `query:"start" format:"date-time"` // Specifies the processing status for all quality levels for a video. - State StreamStreamVideosListVideosResponseStatusState `json:"state"` - JSON streamStreamVideosListVideosResponseStatusJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseStatusJSON contains the JSON metadata for -// the struct [StreamStreamVideosListVideosResponseStatus] -type streamStreamVideosListVideosResponseStatusJSON struct { - ErrorReasonCode apijson.Field - ErrorReasonText apijson.Field - PctComplete apijson.Field - State apijson.Field - raw string - ExtraFields map[string]apijson.Field + Status param.Field[StreamListParamsStatus] `query:"status"` + // Specifies whether the video is `vod` or `live`. + Type param.Field[string] `query:"type"` } -func (r *StreamStreamVideosListVideosResponseStatus) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +// URLQuery serializes [StreamListParams]'s query parameters as `url.Values`. +func (r StreamListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) } // Specifies the processing status for all quality levels for a video. -type StreamStreamVideosListVideosResponseStatusState string +type StreamListParamsStatus string const ( - StreamStreamVideosListVideosResponseStatusStatePendingupload StreamStreamVideosListVideosResponseStatusState = "pendingupload" - StreamStreamVideosListVideosResponseStatusStateDownloading StreamStreamVideosListVideosResponseStatusState = "downloading" - StreamStreamVideosListVideosResponseStatusStateQueued StreamStreamVideosListVideosResponseStatusState = "queued" - StreamStreamVideosListVideosResponseStatusStateInprogress StreamStreamVideosListVideosResponseStatusState = "inprogress" - StreamStreamVideosListVideosResponseStatusStateReady StreamStreamVideosListVideosResponseStatusState = "ready" - StreamStreamVideosListVideosResponseStatusStateError StreamStreamVideosListVideosResponseStatusState = "error" + StreamListParamsStatusPendingupload StreamListParamsStatus = "pendingupload" + StreamListParamsStatusDownloading StreamListParamsStatus = "downloading" + StreamListParamsStatusQueued StreamListParamsStatus = "queued" + StreamListParamsStatusInprogress StreamListParamsStatus = "inprogress" + StreamListParamsStatusReady StreamListParamsStatus = "ready" + StreamListParamsStatusError StreamListParamsStatus = "error" ) -type StreamStreamVideosListVideosResponseWatermark struct { - // The date and a time a watermark profile was created. - Created time.Time `json:"created" format:"date-time"` - // The source URL for a downloaded image. If the watermark profile was created via - // direct upload, this field is null. - DownloadedFrom string `json:"downloadedFrom"` - // The height of the image in pixels. - Height int64 `json:"height"` - // A short description of the watermark profile. - Name string `json:"name"` - // The translucency of the image. A value of `0.0` makes the image completely - // transparent, and `1.0` makes the image completely opaque. Note that if the image - // is already semi-transparent, setting this to `1.0` will not make the image - // completely opaque. - Opacity float64 `json:"opacity"` - // The whitespace between the adjacent edges (determined by position) of the video - // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded - // video width or length, as determined by the algorithm. - Padding float64 `json:"padding"` - // The location of the image. Valid positions are: `upperRight`, `upperLeft`, - // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the - // `padding` parameter. - Position string `json:"position"` - // The size of the image relative to the overall size of the video. This parameter - // will adapt to horizontal and vertical videos automatically. `0.0` indicates no - // scaling (use the size of the image as-is), and `1.0 `fills the entire video. - Scale float64 `json:"scale"` - // The size of the image in bytes. - Size float64 `json:"size"` - // The unique identifier for a watermark profile. - Uid string `json:"uid"` - // The width of the image in pixels. - Width int64 `json:"width"` - JSON streamStreamVideosListVideosResponseWatermarkJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseWatermarkJSON contains the JSON metadata for -// the struct [StreamStreamVideosListVideosResponseWatermark] -type streamStreamVideosListVideosResponseWatermarkJSON struct { - Created apijson.Field - DownloadedFrom apijson.Field - Height apijson.Field - Name apijson.Field - Opacity apijson.Field - Padding apijson.Field - Position apijson.Field - Scale apijson.Field - Size apijson.Field - Uid apijson.Field - Width apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponseWatermark) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamUpdateParams struct { - // Lists the origins allowed to display the video. Enter allowed origin domains in - // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be - // viewed on any origin. - AllowedOrigins param.Field[[]string] `json:"allowedOrigins"` - // A user-defined identifier for the media creator. - Creator param.Field[string] `json:"creator"` - // The maximum duration in seconds for a video upload. Can be set for a video that - // is not yet uploaded to limit its duration. Uploads that exceed the specified - // duration will fail during processing. A value of `-1` means the value is - // unknown. - MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds"` - // A user modifiable key-value store used to reference other systems of record for - // managing videos. - Meta param.Field[interface{}] `json:"meta"` - // Indicates whether the video can be a accessed using the UID. When set to `true`, - // a signed token must be generated with a signing key to view the video. - RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` - // Indicates the date and time at which the video will be deleted. Omit the field - // to indicate no change, or include with a `null` value to remove an existing - // scheduled deletion. If specified, must be at least 30 days from upload time. - ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"` - // The timestamp for a thumbnail image calculated as a percentage value of the - // video's duration. To convert from a second-wise timestamp to a percentage, - // divide the desired timestamp by the total duration of the video. If this value - // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` - // The date and time when the video upload URL is no longer valid for direct user - // uploads. - UploadExpiry param.Field[time.Time] `json:"uploadExpiry" format:"date-time"` -} - -func (r StreamUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StreamUpdateResponseEnvelope struct { - Errors []StreamUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamUpdateResponseEnvelopeMessages `json:"messages,required"` - Result StreamUpdateResponse `json:"result,required"` +type StreamListResponseEnvelope struct { + Errors []StreamListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamListResponseEnvelopeMessages `json:"messages,required"` + Result []StreamListResponse `json:"result,required"` // Whether the API call was successful - Success StreamUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON streamUpdateResponseEnvelopeJSON `json:"-"` + Success StreamListResponseEnvelopeSuccess `json:"success,required"` + // The total number of remaining videos based on cursor position. + Range int64 `json:"range"` + // The total number of videos that match the provided filters. + Total int64 `json:"total"` + JSON streamListResponseEnvelopeJSON `json:"-"` } -// streamUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [StreamUpdateResponseEnvelope] -type streamUpdateResponseEnvelopeJSON struct { +// streamListResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamListResponseEnvelope] +type streamListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + Range apijson.Field + Total apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamUpdateResponseEnvelopeErrorsJSON `json:"-"` +type StreamListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamListResponseEnvelopeErrorsJSON `json:"-"` } -// streamUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [StreamUpdateResponseEnvelopeErrors] -type streamUpdateResponseEnvelopeErrorsJSON struct { +// streamListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [StreamListResponseEnvelopeErrors] +type streamListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamUpdateResponseEnvelopeMessagesJSON `json:"-"` +type StreamListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamListResponseEnvelopeMessagesJSON `json:"-"` } -// streamUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [StreamUpdateResponseEnvelopeMessages] -type streamUpdateResponseEnvelopeMessagesJSON struct { +// streamListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [StreamListResponseEnvelopeMessages] +type streamListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamUpdateResponseEnvelopeSuccess bool +type StreamListResponseEnvelopeSuccess bool const ( - StreamUpdateResponseEnvelopeSuccessTrue StreamUpdateResponseEnvelopeSuccess = true + StreamListResponseEnvelopeSuccessTrue StreamListResponseEnvelopeSuccess = true ) type StreamGetResponseEnvelope struct { @@ -1049,143 +818,3 @@ type StreamGetResponseEnvelopeSuccess bool const ( StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true ) - -type StreamStreamVideosInitiateVideoUploadsUsingTusParams struct { - // Specifies the TUS protocol version. This value must be included in every upload - // request. Notes: The only supported version of TUS protocol is 1.0.0. - TusResumable param.Field[StreamStreamVideosInitiateVideoUploadsUsingTusParamsTusResumable] `header:"Tus-Resumable,required"` - // Indicates the size of the entire upload in bytes. The value must be a - // non-negative integer. - UploadLength param.Field[int64] `header:"Upload-Length,required"` - // A user-defined identifier for the media creator. - UploadCreator param.Field[string] `header:"Upload-Creator"` - // Comma-separated key-value pairs following the TUS protocol specification. Values - // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`, - // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`. - UploadMetadata param.Field[string] `header:"Upload-Metadata"` -} - -// Specifies the TUS protocol version. This value must be included in every upload -// request. Notes: The only supported version of TUS protocol is 1.0.0. -type StreamStreamVideosInitiateVideoUploadsUsingTusParamsTusResumable string - -const ( - StreamStreamVideosInitiateVideoUploadsUsingTusParamsTusResumable1_0_0 StreamStreamVideosInitiateVideoUploadsUsingTusParamsTusResumable = "1.0.0" -) - -type StreamStreamVideosListVideosParams struct { - // Lists videos in ascending order of creation. - Asc param.Field[bool] `query:"asc"` - // A user-defined identifier for the media creator. - Creator param.Field[string] `query:"creator"` - // Lists videos created before the specified date. - End param.Field[time.Time] `query:"end" format:"date-time"` - // Includes the total number of videos associated with the submitted query - // parameters. - IncludeCounts param.Field[bool] `query:"include_counts"` - // Searches over the `name` key in the `meta` field. This field can be set with or - // after the upload request. - Search param.Field[string] `query:"search"` - // Lists videos created after the specified date. - Start param.Field[time.Time] `query:"start" format:"date-time"` - // Specifies the processing status for all quality levels for a video. - Status param.Field[StreamStreamVideosListVideosParamsStatus] `query:"status"` - // Specifies whether the video is `vod` or `live`. - Type param.Field[string] `query:"type"` -} - -// URLQuery serializes [StreamStreamVideosListVideosParams]'s query parameters as -// `url.Values`. -func (r StreamStreamVideosListVideosParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Specifies the processing status for all quality levels for a video. -type StreamStreamVideosListVideosParamsStatus string - -const ( - StreamStreamVideosListVideosParamsStatusPendingupload StreamStreamVideosListVideosParamsStatus = "pendingupload" - StreamStreamVideosListVideosParamsStatusDownloading StreamStreamVideosListVideosParamsStatus = "downloading" - StreamStreamVideosListVideosParamsStatusQueued StreamStreamVideosListVideosParamsStatus = "queued" - StreamStreamVideosListVideosParamsStatusInprogress StreamStreamVideosListVideosParamsStatus = "inprogress" - StreamStreamVideosListVideosParamsStatusReady StreamStreamVideosListVideosParamsStatus = "ready" - StreamStreamVideosListVideosParamsStatusError StreamStreamVideosListVideosParamsStatus = "error" -) - -type StreamStreamVideosListVideosResponseEnvelope struct { - Errors []StreamStreamVideosListVideosResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamStreamVideosListVideosResponseEnvelopeMessages `json:"messages,required"` - Result []StreamStreamVideosListVideosResponse `json:"result,required"` - // Whether the API call was successful - Success StreamStreamVideosListVideosResponseEnvelopeSuccess `json:"success,required"` - // The total number of remaining videos based on cursor position. - Range int64 `json:"range"` - // The total number of videos that match the provided filters. - Total int64 `json:"total"` - JSON streamStreamVideosListVideosResponseEnvelopeJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseEnvelopeJSON contains the JSON metadata for -// the struct [StreamStreamVideosListVideosResponseEnvelope] -type streamStreamVideosListVideosResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - Range apijson.Field - Total apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamStreamVideosListVideosResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamStreamVideosListVideosResponseEnvelopeErrorsJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [StreamStreamVideosListVideosResponseEnvelopeErrors] -type streamStreamVideosListVideosResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamStreamVideosListVideosResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamStreamVideosListVideosResponseEnvelopeMessagesJSON `json:"-"` -} - -// streamStreamVideosListVideosResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [StreamStreamVideosListVideosResponseEnvelopeMessages] -type streamStreamVideosListVideosResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamStreamVideosListVideosResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type StreamStreamVideosListVideosResponseEnvelopeSuccess bool - -const ( - StreamStreamVideosListVideosResponseEnvelopeSuccessTrue StreamStreamVideosListVideosResponseEnvelopeSuccess = true -) diff --git a/stream_test.go b/stream_test.go index 23e2e09b191..1e0faae6188 100644 --- a/stream_test.go +++ b/stream_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamUpdateWithOptionalParams(t *testing.T) { +func TestStreamNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,21 +30,14 @@ func TestStreamUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Update( + err := client.Stream.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", - cloudflare.StreamUpdateParams{ - AllowedOrigins: cloudflare.F([]string{"example.com"}), - Creator: cloudflare.F("creator-id_abcde12345"), - MaxDurationSeconds: cloudflare.F(int64(1)), - Meta: cloudflare.F[any](map[string]interface{}{ - "name": "video12345.mp4", - }), - RequireSignedURLs: cloudflare.F(true), - ScheduledDeletion: cloudflare.F(time.Now()), - ThumbnailTimestampPct: cloudflare.F(0.529241), - UploadExpiry: cloudflare.F(time.Now()), + cloudflare.StreamNewParams{ + TusResumable: cloudflare.F(cloudflare.StreamNewParamsTusResumable1_0_0), + UploadLength: cloudflare.F(int64(0)), + UploadCreator: cloudflare.F("creator-id_abcde12345"), + UploadMetadata: cloudflare.F("name aGVsbG8gd29ybGQ=, requiresignedurls, allowedorigins ZXhhbXBsZS5jb20sdGVzdC5jb20="), }, ) if err != nil { @@ -56,7 +49,7 @@ func TestStreamUpdateWithOptionalParams(t *testing.T) { } } -func TestStreamDelete(t *testing.T) { +func TestStreamListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -72,10 +65,19 @@ func TestStreamDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Stream.Delete( + _, err := client.Stream.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", + cloudflare.StreamListParams{ + Asc: cloudflare.F(true), + Creator: cloudflare.F("creator-id_abcde12345"), + End: cloudflare.F(time.Now()), + IncludeCounts: cloudflare.F(true), + Search: cloudflare.F("puppy.mp4"), + Start: cloudflare.F(time.Now()), + Status: cloudflare.F(cloudflare.StreamListParamsStatusInprogress), + Type: cloudflare.F("live"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -86,7 +88,7 @@ func TestStreamDelete(t *testing.T) { } } -func TestStreamGet(t *testing.T) { +func TestStreamDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -102,7 +104,7 @@ func TestStreamGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Get( + err := client.Stream.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", @@ -116,42 +118,7 @@ func TestStreamGet(t *testing.T) { } } -func TestStreamStreamVideosInitiateVideoUploadsUsingTusWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - err := client.Stream.StreamVideosInitiateVideoUploadsUsingTus( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamStreamVideosInitiateVideoUploadsUsingTusParams{ - TusResumable: cloudflare.F(cloudflare.StreamStreamVideosInitiateVideoUploadsUsingTusParamsTusResumable1_0_0), - UploadLength: cloudflare.F(int64(0)), - UploadCreator: cloudflare.F("creator-id_abcde12345"), - UploadMetadata: cloudflare.F("name aGVsbG8gd29ybGQ=, requiresignedurls, allowedorigins ZXhhbXBsZS5jb20sdGVzdC5jb20="), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestStreamStreamVideosListVideosWithOptionalParams(t *testing.T) { +func TestStreamGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -167,19 +134,10 @@ func TestStreamStreamVideosListVideosWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.StreamVideosListVideos( + _, err := client.Stream.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamStreamVideosListVideosParams{ - Asc: cloudflare.F(true), - Creator: cloudflare.F("creator-id_abcde12345"), - End: cloudflare.F(time.Now()), - IncludeCounts: cloudflare.F(true), - Search: cloudflare.F("puppy.mp4"), - Start: cloudflare.F(time.Now()), - Status: cloudflare.F(cloudflare.StreamStreamVideosListVideosParamsStatusInprogress), - Type: cloudflare.F("live"), - }, + "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error diff --git a/streamaudiotrack.go b/streamaudiotrack.go index 9fd5caba511..1a7a5cbeee1 100644 --- a/streamaudiotrack.go +++ b/streamaudiotrack.go @@ -34,6 +34,19 @@ func NewStreamAudioTrackService(opts ...option.RequestOption) (r *StreamAudioTra return } +// Adds an additional audio track to a video using the provided audio track URL. +func (r *StreamAudioTrackService) New(ctx context.Context, accountID string, identifier string, body StreamAudioTrackNewParams, opts ...option.RequestOption) (res *StreamAudioTrackNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env StreamAudioTrackNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/%s/audio/copy", accountID, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Edits additional audio tracks on a video. Editing the default status of an audio // track to `true` will mark all other audio tracks on the video default status to // `false`. @@ -77,19 +90,43 @@ func (r *StreamAudioTrackService) Delete(ctx context.Context, accountID string, return } -// Adds an additional audio track to a video using the provided audio track URL. -func (r *StreamAudioTrackService) Copy(ctx context.Context, accountID string, identifier string, body StreamAudioTrackCopyParams, opts ...option.RequestOption) (res *StreamAudioTrackCopyResponse, err error) { - opts = append(r.Options[:], opts...) - var env StreamAudioTrackCopyResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s/audio/copy", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +type StreamAudioTrackNewResponse struct { + // Denotes whether the audio track will be played by default in a player. + Default bool `json:"default"` + // A string to uniquely identify the track amongst other audio track labels for the + // specified video. + Label string `json:"label"` + // Specifies the processing status of the video. + Status StreamAudioTrackNewResponseStatus `json:"status"` + // A Cloudflare-generated unique identifier for a media item. + Uid string `json:"uid"` + JSON streamAudioTrackNewResponseJSON `json:"-"` +} + +// streamAudioTrackNewResponseJSON contains the JSON metadata for the struct +// [StreamAudioTrackNewResponse] +type streamAudioTrackNewResponseJSON struct { + Default apijson.Field + Label apijson.Field + Status apijson.Field + Uid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamAudioTrackNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } +// Specifies the processing status of the video. +type StreamAudioTrackNewResponseStatus string + +const ( + StreamAudioTrackNewResponseStatusQueued StreamAudioTrackNewResponseStatus = "queued" + StreamAudioTrackNewResponseStatusReady StreamAudioTrackNewResponseStatus = "ready" + StreamAudioTrackNewResponseStatusError StreamAudioTrackNewResponseStatus = "error" +) + type StreamAudioTrackUpdateResponse struct { // Denotes whether the audio track will be played by default in a player. Default bool `json:"default"` @@ -181,41 +218,87 @@ func init() { ) } -type StreamAudioTrackCopyResponse struct { - // Denotes whether the audio track will be played by default in a player. - Default bool `json:"default"` +type StreamAudioTrackNewParams struct { // A string to uniquely identify the track amongst other audio track labels for the // specified video. - Label string `json:"label"` - // Specifies the processing status of the video. - Status StreamAudioTrackCopyResponseStatus `json:"status"` - // A Cloudflare-generated unique identifier for a media item. - Uid string `json:"uid"` - JSON streamAudioTrackCopyResponseJSON `json:"-"` + Label param.Field[string] `json:"label,required"` + // An audio track URL. The server must be publicly routable and support `HTTP HEAD` + // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` + // requests with a `content-range` header that includes the size of the file. + URL param.Field[string] `json:"url" format:"uri"` } -// streamAudioTrackCopyResponseJSON contains the JSON metadata for the struct -// [StreamAudioTrackCopyResponse] -type streamAudioTrackCopyResponseJSON struct { - Default apijson.Field - Label apijson.Field - Status apijson.Field - Uid apijson.Field +func (r StreamAudioTrackNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StreamAudioTrackNewResponseEnvelope struct { + Errors []StreamAudioTrackNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamAudioTrackNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamAudioTrackNewResponse `json:"result,required"` + // Whether the API call was successful + Success StreamAudioTrackNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamAudioTrackNewResponseEnvelopeJSON `json:"-"` +} + +// streamAudioTrackNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamAudioTrackNewResponseEnvelope] +type streamAudioTrackNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamAudioTrackCopyResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamAudioTrackNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Specifies the processing status of the video. -type StreamAudioTrackCopyResponseStatus string +type StreamAudioTrackNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamAudioTrackNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// streamAudioTrackNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamAudioTrackNewResponseEnvelopeErrors] +type streamAudioTrackNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamAudioTrackNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type StreamAudioTrackNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamAudioTrackNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// streamAudioTrackNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamAudioTrackNewResponseEnvelopeMessages] +type streamAudioTrackNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamAudioTrackNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type StreamAudioTrackNewResponseEnvelopeSuccess bool const ( - StreamAudioTrackCopyResponseStatusQueued StreamAudioTrackCopyResponseStatus = "queued" - StreamAudioTrackCopyResponseStatusReady StreamAudioTrackCopyResponseStatus = "ready" - StreamAudioTrackCopyResponseStatusError StreamAudioTrackCopyResponseStatus = "error" + StreamAudioTrackNewResponseEnvelopeSuccessTrue StreamAudioTrackNewResponseEnvelopeSuccess = true ) type StreamAudioTrackUpdateParams struct { @@ -436,86 +519,3 @@ type StreamAudioTrackDeleteResponseEnvelopeSuccess bool const ( StreamAudioTrackDeleteResponseEnvelopeSuccessTrue StreamAudioTrackDeleteResponseEnvelopeSuccess = true ) - -type StreamAudioTrackCopyParams struct { - // A string to uniquely identify the track amongst other audio track labels for the - // specified video. - Label param.Field[string] `json:"label,required"` - // An audio track URL. The server must be publicly routable and support `HTTP HEAD` - // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` - // requests with a `content-range` header that includes the size of the file. - URL param.Field[string] `json:"url" format:"uri"` -} - -func (r StreamAudioTrackCopyParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StreamAudioTrackCopyResponseEnvelope struct { - Errors []StreamAudioTrackCopyResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamAudioTrackCopyResponseEnvelopeMessages `json:"messages,required"` - Result StreamAudioTrackCopyResponse `json:"result,required"` - // Whether the API call was successful - Success StreamAudioTrackCopyResponseEnvelopeSuccess `json:"success,required"` - JSON streamAudioTrackCopyResponseEnvelopeJSON `json:"-"` -} - -// streamAudioTrackCopyResponseEnvelopeJSON contains the JSON metadata for the -// struct [StreamAudioTrackCopyResponseEnvelope] -type streamAudioTrackCopyResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamAudioTrackCopyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamAudioTrackCopyResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamAudioTrackCopyResponseEnvelopeErrorsJSON `json:"-"` -} - -// streamAudioTrackCopyResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [StreamAudioTrackCopyResponseEnvelopeErrors] -type streamAudioTrackCopyResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamAudioTrackCopyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamAudioTrackCopyResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamAudioTrackCopyResponseEnvelopeMessagesJSON `json:"-"` -} - -// streamAudioTrackCopyResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamAudioTrackCopyResponseEnvelopeMessages] -type streamAudioTrackCopyResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamAudioTrackCopyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type StreamAudioTrackCopyResponseEnvelopeSuccess bool - -const ( - StreamAudioTrackCopyResponseEnvelopeSuccessTrue StreamAudioTrackCopyResponseEnvelopeSuccess = true -) diff --git a/streamaudiotrack_test.go b/streamaudiotrack_test.go index bde8e96270e..8e87f198f70 100644 --- a/streamaudiotrack_test.go +++ b/streamaudiotrack_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamAudioTrackUpdateWithOptionalParams(t *testing.T) { +func TestStreamAudioTrackNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,13 @@ func TestStreamAudioTrackUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.AudioTracks.Update( + _, err := client.Stream.AudioTracks.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", - "ea95132c15732412d22c1476fa83f27a", - cloudflare.StreamAudioTrackUpdateParams{ - Default: cloudflare.F(true), - Label: cloudflare.F("director commentary"), + cloudflare.StreamAudioTrackNewParams{ + Label: cloudflare.F("director commentary"), + URL: cloudflare.F("https://www.examplestorage.com/audio_file.mp3"), }, ) if err != nil { @@ -48,7 +47,7 @@ func TestStreamAudioTrackUpdateWithOptionalParams(t *testing.T) { } } -func TestStreamAudioTrackList(t *testing.T) { +func TestStreamAudioTrackUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,10 +63,15 @@ func TestStreamAudioTrackList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.AudioTracks.List( + _, err := client.Stream.AudioTracks.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", + "ea95132c15732412d22c1476fa83f27a", + cloudflare.StreamAudioTrackUpdateParams{ + Default: cloudflare.F(true), + Label: cloudflare.F("director commentary"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +82,7 @@ func TestStreamAudioTrackList(t *testing.T) { } } -func TestStreamAudioTrackDelete(t *testing.T) { +func TestStreamAudioTrackList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,11 +98,10 @@ func TestStreamAudioTrackDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.AudioTracks.Delete( + _, err := client.Stream.AudioTracks.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", - "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error @@ -109,7 +112,7 @@ func TestStreamAudioTrackDelete(t *testing.T) { } } -func TestStreamAudioTrackCopyWithOptionalParams(t *testing.T) { +func TestStreamAudioTrackDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -125,14 +128,11 @@ func TestStreamAudioTrackCopyWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.AudioTracks.Copy( + _, err := client.Stream.AudioTracks.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", - cloudflare.StreamAudioTrackCopyParams{ - Label: cloudflare.F("director commentary"), - URL: cloudflare.F("https://www.examplestorage.com/audio_file.mp3"), - }, + "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error diff --git a/streamcaption.go b/streamcaption.go index 433cf95b310..4cc7d98e3c6 100644 --- a/streamcaption.go +++ b/streamcaption.go @@ -34,13 +34,12 @@ func NewStreamCaptionService(opts ...option.RequestOption) (r *StreamCaptionServ return } -// Uploads the caption or subtitle file to the endpoint for a specific BCP47 -// language. One caption or subtitle file per language is allowed. -func (r *StreamCaptionService) Update(ctx context.Context, accountID string, identifier string, language string, body StreamCaptionUpdateParams, opts ...option.RequestOption) (res *StreamCaptionUpdateResponse, err error) { +// Lists the available captions or subtitles for a specific video. +func (r *StreamCaptionService) List(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *[]StreamCaptionListResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamCaptionUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", accountID, identifier, language) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env StreamCaptionListResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/%s/captions", accountID, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -61,12 +60,13 @@ func (r *StreamCaptionService) Delete(ctx context.Context, accountID string, ide return } -// Lists the available captions or subtitles for a specific video. -func (r *StreamCaptionService) StreamSubtitlesCaptionsListCaptionsOrSubtitles(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *[]StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse, err error) { +// Uploads the caption or subtitle file to the endpoint for a specific BCP47 +// language. One caption or subtitle file per language is allowed. +func (r *StreamCaptionService) Replace(ctx context.Context, accountID string, identifier string, language string, body StreamCaptionReplaceParams, opts ...option.RequestOption) (res *StreamCaptionReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s/captions", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env StreamCaptionReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", accountID, identifier, language) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -74,20 +74,25 @@ func (r *StreamCaptionService) StreamSubtitlesCaptionsListCaptionsOrSubtitles(ct return } -// Union satisfied by [StreamCaptionUpdateResponseUnknown] or [shared.UnionString]. -type StreamCaptionUpdateResponse interface { - ImplementsStreamCaptionUpdateResponse() +type StreamCaptionListResponse struct { + // The language label displayed in the native language to users. + Label string `json:"label"` + // The language tag in BCP 47 format. + Language string `json:"language"` + JSON streamCaptionListResponseJSON `json:"-"` } -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*StreamCaptionUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// streamCaptionListResponseJSON contains the JSON metadata for the struct +// [StreamCaptionListResponse] +type streamCaptionListResponseJSON struct { + Label apijson.Field + Language apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamCaptionListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } // Union satisfied by [StreamCaptionDeleteResponseUnknown], @@ -111,49 +116,35 @@ type StreamCaptionDeleteResponseArray []interface{} func (r StreamCaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponse() {} -type StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse struct { - // The language label displayed in the native language to users. - Label string `json:"label"` - // The language tag in BCP 47 format. - Language string `json:"language"` - JSON streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseJSON `json:"-"` -} - -// streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseJSON contains -// the JSON metadata for the struct -// [StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse] -type streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseJSON struct { - Label apijson.Field - Language apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamCaptionUpdateParams struct { - // The WebVTT file containing the caption or subtitle content. - File param.Field[string] `json:"file,required"` +// Union satisfied by [StreamCaptionReplaceResponseUnknown] or +// [shared.UnionString]. +type StreamCaptionReplaceResponse interface { + ImplementsStreamCaptionReplaceResponse() } -func (r StreamCaptionUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*StreamCaptionReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -type StreamCaptionUpdateResponseEnvelope struct { - Errors []StreamCaptionUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamCaptionUpdateResponseEnvelopeMessages `json:"messages,required"` - Result StreamCaptionUpdateResponse `json:"result,required"` +type StreamCaptionListResponseEnvelope struct { + Errors []StreamCaptionListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamCaptionListResponseEnvelopeMessages `json:"messages,required"` + Result []StreamCaptionListResponse `json:"result,required"` // Whether the API call was successful - Success StreamCaptionUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON streamCaptionUpdateResponseEnvelopeJSON `json:"-"` + Success StreamCaptionListResponseEnvelopeSuccess `json:"success,required"` + JSON streamCaptionListResponseEnvelopeJSON `json:"-"` } -// streamCaptionUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [StreamCaptionUpdateResponseEnvelope] -type streamCaptionUpdateResponseEnvelopeJSON struct { +// streamCaptionListResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamCaptionListResponseEnvelope] +type streamCaptionListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -162,53 +153,53 @@ type streamCaptionUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamCaptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCaptionUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCaptionUpdateResponseEnvelopeErrorsJSON `json:"-"` +type StreamCaptionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCaptionListResponseEnvelopeErrorsJSON `json:"-"` } -// streamCaptionUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [StreamCaptionUpdateResponseEnvelopeErrors] -type streamCaptionUpdateResponseEnvelopeErrorsJSON struct { +// streamCaptionListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamCaptionListResponseEnvelopeErrors] +type streamCaptionListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCaptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCaptionUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCaptionUpdateResponseEnvelopeMessagesJSON `json:"-"` +type StreamCaptionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCaptionListResponseEnvelopeMessagesJSON `json:"-"` } -// streamCaptionUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamCaptionUpdateResponseEnvelopeMessages] -type streamCaptionUpdateResponseEnvelopeMessagesJSON struct { +// streamCaptionListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamCaptionListResponseEnvelopeMessages] +type streamCaptionListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCaptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamCaptionUpdateResponseEnvelopeSuccess bool +type StreamCaptionListResponseEnvelopeSuccess bool const ( - StreamCaptionUpdateResponseEnvelopeSuccessTrue StreamCaptionUpdateResponseEnvelopeSuccess = true + StreamCaptionListResponseEnvelopeSuccessTrue StreamCaptionListResponseEnvelopeSuccess = true ) type StreamCaptionDeleteResponseEnvelope struct { @@ -280,19 +271,27 @@ const ( StreamCaptionDeleteResponseEnvelopeSuccessTrue StreamCaptionDeleteResponseEnvelopeSuccess = true ) -type StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelope struct { - Errors []StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessages `json:"messages,required"` - Result []StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponse `json:"result,required"` +type StreamCaptionReplaceParams struct { + // The WebVTT file containing the caption or subtitle content. + File param.Field[string] `json:"file,required"` +} + +func (r StreamCaptionReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StreamCaptionReplaceResponseEnvelope struct { + Errors []StreamCaptionReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamCaptionReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StreamCaptionReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeSuccess `json:"success,required"` - JSON streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeJSON `json:"-"` + Success StreamCaptionReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON streamCaptionReplaceResponseEnvelopeJSON `json:"-"` } -// streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelope] -type streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeJSON struct { +// streamCaptionReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamCaptionReplaceResponseEnvelope] +type streamCaptionReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -301,53 +300,51 @@ type streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelope ExtraFields map[string]apijson.Field } -func (r *StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrorsJSON `json:"-"` +type StreamCaptionReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCaptionReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrors] -type streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrorsJSON struct { +// streamCaptionReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamCaptionReplaceResponseEnvelopeErrors] +type streamCaptionReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessagesJSON `json:"-"` +type StreamCaptionReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCaptionReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessages] -type streamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessagesJSON struct { +// streamCaptionReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamCaptionReplaceResponseEnvelopeMessages] +type streamCaptionReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCaptionReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeSuccess bool +type StreamCaptionReplaceResponseEnvelopeSuccess bool const ( - StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeSuccessTrue StreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitlesResponseEnvelopeSuccess = true + StreamCaptionReplaceResponseEnvelopeSuccessTrue StreamCaptionReplaceResponseEnvelopeSuccess = true ) diff --git a/streamcaption_test.go b/streamcaption_test.go index f47d144738e..a8f70db2911 100644 --- a/streamcaption_test.go +++ b/streamcaption_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamCaptionUpdate(t *testing.T) { +func TestStreamCaptionList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,10 @@ func TestStreamCaptionUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Captions.Update( + _, err := client.Stream.Captions.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", - "tr", - cloudflare.StreamCaptionUpdateParams{ - File: cloudflare.F("@/Users/kyle/Desktop/tr.vtt"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +74,7 @@ func TestStreamCaptionDelete(t *testing.T) { } } -func TestStreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitles(t *testing.T) { +func TestStreamCaptionReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,10 +90,14 @@ func TestStreamCaptionStreamSubtitlesCaptionsListCaptionsOrSubtitles(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Captions.StreamSubtitlesCaptionsListCaptionsOrSubtitles( + _, err := client.Stream.Captions.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", + "tr", + cloudflare.StreamCaptionReplaceParams{ + File: cloudflare.F("@/Users/kyle/Desktop/tr.vtt"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/streamclip.go b/streamclip.go index 5ca99c07f3d..2f356127147 100644 --- a/streamclip.go +++ b/streamclip.go @@ -32,9 +32,9 @@ func NewStreamClipService(opts ...option.RequestOption) (r *StreamClipService) { } // Clips a video based on the specified start and end times provided in seconds. -func (r *StreamClipService) StreamVideoClippingClipVideosGivenAStartAndEndTime(ctx context.Context, accountID string, body StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams, opts ...option.RequestOption) (res *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse, err error) { +func (r *StreamClipService) New(ctx context.Context, accountID string, body StreamClipNewParams, opts ...option.RequestOption) (res *StreamClipNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelope + var env StreamClipNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/clip", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -44,7 +44,7 @@ func (r *StreamClipService) StreamVideoClippingClipVideosGivenAStartAndEndTime(c return } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse struct { +type StreamClipNewResponse struct { // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. @@ -66,8 +66,8 @@ type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse struct // managing videos. Meta interface{} `json:"meta"` // The date and time the live input was last modified. - Modified time.Time `json:"modified" format:"date-time"` - Playback StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlayback `json:"playback"` + Modified time.Time `json:"modified" format:"date-time"` + Playback StreamClipNewResponsePlayback `json:"playback"` // The video's preview page URI. This field is omitted until encoding is complete. Preview string `json:"preview" format:"uri"` // Indicates whether the video can be a accessed using the UID. When set to `true`, @@ -76,20 +76,19 @@ type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse struct // Specifies the start time for the video clip in seconds. StartTimeSeconds int64 `json:"startTimeSeconds"` // Specifies the processing status for all quality levels for a video. - Status StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus `json:"status"` + Status StreamClipNewResponseStatus `json:"status"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"` - Watermark StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermark `json:"watermark"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseJSON `json:"-"` + ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"` + Watermark StreamClipNewResponseWatermark `json:"watermark"` + JSON streamClipNewResponseJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseJSON struct { +// streamClipNewResponseJSON contains the JSON metadata for the struct +// [StreamClipNewResponse] +type streamClipNewResponseJSON struct { AllowedOrigins apijson.Field ClippedFromVideoUid apijson.Field Created apijson.Field @@ -109,64 +108,62 @@ type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseJSON st ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlayback struct { +type StreamClipNewResponsePlayback struct { // DASH Media Presentation Description for the video. Dash string `json:"dash"` // The HLS manifest for the video. - Hls string `json:"hls"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlaybackJSON `json:"-"` + Hls string `json:"hls"` + JSON streamClipNewResponsePlaybackJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlaybackJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlayback] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlaybackJSON struct { +// streamClipNewResponsePlaybackJSON contains the JSON metadata for the struct +// [StreamClipNewResponsePlayback] +type streamClipNewResponsePlaybackJSON struct { Dash apijson.Field Hls apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponsePlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponsePlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the processing status for all quality levels for a video. -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus string +type StreamClipNewResponseStatus string const ( - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusPendingupload StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "pendingupload" - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusDownloading StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "downloading" - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusQueued StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "queued" - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusInprogress StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "inprogress" - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusReady StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "ready" - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatusError StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseStatus = "error" + StreamClipNewResponseStatusPendingupload StreamClipNewResponseStatus = "pendingupload" + StreamClipNewResponseStatusDownloading StreamClipNewResponseStatus = "downloading" + StreamClipNewResponseStatusQueued StreamClipNewResponseStatus = "queued" + StreamClipNewResponseStatusInprogress StreamClipNewResponseStatus = "inprogress" + StreamClipNewResponseStatusReady StreamClipNewResponseStatus = "ready" + StreamClipNewResponseStatusError StreamClipNewResponseStatus = "error" ) -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermark struct { +type StreamClipNewResponseWatermark struct { // The unique identifier for the watermark profile. - Uid string `json:"uid"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermarkJSON `json:"-"` + Uid string `json:"uid"` + JSON streamClipNewResponseWatermarkJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermarkJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermark] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermarkJSON struct { +// streamClipNewResponseWatermarkJSON contains the JSON metadata for the struct +// [StreamClipNewResponseWatermark] +type streamClipNewResponseWatermarkJSON struct { Uid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseWatermark) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponseWatermark) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams struct { +type StreamClipNewParams struct { // The unique video identifier (UID). ClippedFromVideoUid param.Field[string] `json:"clippedFromVideoUID,required"` // Specifies the end time for the video clip in seconds. @@ -191,36 +188,35 @@ type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams struct { // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` - Watermark param.Field[StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParamsWatermark] `json:"watermark"` + ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` + Watermark param.Field[StreamClipNewParamsWatermark] `json:"watermark"` } -func (r StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams) MarshalJSON() (data []byte, err error) { +func (r StreamClipNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParamsWatermark struct { +type StreamClipNewParamsWatermark struct { // The unique identifier for the watermark profile. Uid param.Field[string] `json:"uid"` } -func (r StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParamsWatermark) MarshalJSON() (data []byte, err error) { +func (r StreamClipNewParamsWatermark) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelope struct { - Errors []StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessages `json:"messages,required"` - Result StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponse `json:"result,required"` +type StreamClipNewResponseEnvelope struct { + Errors []StreamClipNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamClipNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamClipNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeSuccess `json:"success,required"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeJSON `json:"-"` + Success StreamClipNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamClipNewResponseEnvelopeJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelope] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeJSON struct { +// streamClipNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamClipNewResponseEnvelope] +type streamClipNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -229,53 +225,51 @@ type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelop ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrorsJSON `json:"-"` +type StreamClipNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamClipNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrors] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrorsJSON struct { +// streamClipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamClipNewResponseEnvelopeErrors] +type streamClipNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessagesJSON `json:"-"` +type StreamClipNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamClipNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessages] -type streamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessagesJSON struct { +// streamClipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamClipNewResponseEnvelopeMessages] +type streamClipNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamClipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeSuccess bool +type StreamClipNewResponseEnvelopeSuccess bool const ( - StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeSuccessTrue StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeResponseEnvelopeSuccess = true + StreamClipNewResponseEnvelopeSuccessTrue StreamClipNewResponseEnvelopeSuccess = true ) diff --git a/streamclip_test.go b/streamclip_test.go index 41bc7cab16d..82adf1eac5b 100644 --- a/streamclip_test.go +++ b/streamclip_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeWithOptionalParams(t *testing.T) { +func TestStreamClipNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestStreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeWithOptiona option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Clips.StreamVideoClippingClipVideosGivenAStartAndEndTime( + _, err := client.Stream.Clips.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParams{ + cloudflare.StreamClipNewParams{ ClippedFromVideoUid: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), EndTimeSeconds: cloudflare.F(int64(0)), StartTimeSeconds: cloudflare.F(int64(0)), @@ -41,7 +41,7 @@ func TestStreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeWithOptiona MaxDurationSeconds: cloudflare.F(int64(1)), RequireSignedURLs: cloudflare.F(true), ThumbnailTimestampPct: cloudflare.F(0.529241), - Watermark: cloudflare.F(cloudflare.StreamClipStreamVideoClippingClipVideosGivenAStartAndEndTimeParamsWatermark{ + Watermark: cloudflare.F(cloudflare.StreamClipNewParamsWatermark{ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"), }), }, diff --git a/streamcopy.go b/streamcopy.go index b7084e40c2b..5401c1f0d7a 100644 --- a/streamcopy.go +++ b/streamcopy.go @@ -32,9 +32,9 @@ func NewStreamCopyService(opts ...option.RequestOption) (r *StreamCopyService) { } // Uploads a video to Stream from a provided URL. -func (r *StreamCopyService) StreamVideosUploadVideosFromAURL(ctx context.Context, accountID string, params StreamCopyStreamVideosUploadVideosFromAURLParams, opts ...option.RequestOption) (res *StreamCopyStreamVideosUploadVideosFromAurlResponse, err error) { +func (r *StreamCopyService) New(ctx context.Context, accountID string, params StreamCopyNewParams, opts ...option.RequestOption) (res *StreamCopyNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelope + var env StreamCopyNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/copy", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { @@ -44,7 +44,7 @@ func (r *StreamCopyService) StreamVideosUploadVideosFromAURL(ctx context.Context return } -type StreamCopyStreamVideosUploadVideosFromAurlResponse struct { +type StreamCopyNewResponse struct { // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. @@ -56,8 +56,8 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponse struct { // The duration of the video in seconds. A value of `-1` means the duration is // unknown. The duration becomes available after the upload and before the video is // ready. - Duration float64 `json:"duration"` - Input StreamCopyStreamVideosUploadVideosFromAurlResponseInput `json:"input"` + Duration float64 `json:"duration"` + Input StreamCopyNewResponseInput `json:"input"` // The live input ID used to upload a video with Stream Live. LiveInput string `json:"liveInput"` // The maximum duration in seconds for a video upload. Can be set for a video that @@ -69,8 +69,8 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponse struct { // managing videos. Meta interface{} `json:"meta"` // The date and time the media item was last modified. - Modified time.Time `json:"modified" format:"date-time"` - Playback StreamCopyStreamVideosUploadVideosFromAurlResponsePlayback `json:"playback"` + Modified time.Time `json:"modified" format:"date-time"` + Playback StreamCopyNewResponsePlayback `json:"playback"` // The video's preview page URI. This field is omitted until encoding is complete. Preview string `json:"preview" format:"uri"` // Indicates whether the video is playable. The field is empty if the video is not @@ -93,7 +93,7 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponse struct { // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the // approximate percent of completion. If the `state` is `error`, `errorReasonCode` // and `errorReasonText` provide additional details. - Status StreamCopyStreamVideosUploadVideosFromAurlResponseStatus `json:"status"` + Status StreamCopyNewResponseStatus `json:"status"` // The media item's thumbnail URI. This field is omitted until encoding is // complete. Thumbnail string `json:"thumbnail" format:"uri"` @@ -108,14 +108,14 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponse struct { Uploaded time.Time `json:"uploaded" format:"date-time"` // The date and time when the video upload URL is no longer valid for direct user // uploads. - UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` - Watermark StreamCopyStreamVideosUploadVideosFromAurlResponseWatermark `json:"watermark"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseJSON `json:"-"` + UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` + Watermark StreamCopyNewResponseWatermark `json:"watermark"` + JSON streamCopyNewResponseJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseJSON contains the JSON -// metadata for the struct [StreamCopyStreamVideosUploadVideosFromAurlResponse] -type streamCopyStreamVideosUploadVideosFromAurlResponseJSON struct { +// streamCopyNewResponseJSON contains the JSON metadata for the struct +// [StreamCopyNewResponse] +type streamCopyNewResponseJSON struct { AllowedOrigins apijson.Field Created apijson.Field Creator apijson.Field @@ -143,53 +143,51 @@ type streamCopyStreamVideosUploadVideosFromAurlResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCopyStreamVideosUploadVideosFromAurlResponseInput struct { +type StreamCopyNewResponseInput struct { // The video height in pixels. A value of `-1` means the height is unknown. The // value becomes available after the upload and before the video is ready. Height int64 `json:"height"` // The video width in pixels. A value of `-1` means the width is unknown. The value // becomes available after the upload and before the video is ready. - Width int64 `json:"width"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseInputJSON `json:"-"` + Width int64 `json:"width"` + JSON streamCopyNewResponseInputJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseInputJSON contains the JSON -// metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseInput] -type streamCopyStreamVideosUploadVideosFromAurlResponseInputJSON struct { +// streamCopyNewResponseInputJSON contains the JSON metadata for the struct +// [StreamCopyNewResponseInput] +type streamCopyNewResponseInputJSON struct { Height apijson.Field Width apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseInput) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseInput) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCopyStreamVideosUploadVideosFromAurlResponsePlayback struct { +type StreamCopyNewResponsePlayback struct { // DASH Media Presentation Description for the video. Dash string `json:"dash"` // The HLS manifest for the video. - Hls string `json:"hls"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponsePlaybackJSON `json:"-"` + Hls string `json:"hls"` + JSON streamCopyNewResponsePlaybackJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponsePlaybackJSON contains the JSON -// metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponsePlayback] -type streamCopyStreamVideosUploadVideosFromAurlResponsePlaybackJSON struct { +// streamCopyNewResponsePlaybackJSON contains the JSON metadata for the struct +// [StreamCopyNewResponsePlayback] +type streamCopyNewResponsePlaybackJSON struct { Dash apijson.Field Hls apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponsePlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponsePlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -198,7 +196,7 @@ func (r *StreamCopyStreamVideosUploadVideosFromAurlResponsePlayback) UnmarshalJS // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the // approximate percent of completion. If the `state` is `error`, `errorReasonCode` // and `errorReasonText` provide additional details. -type StreamCopyStreamVideosUploadVideosFromAurlResponseStatus struct { +type StreamCopyNewResponseStatus struct { // Specifies why the video failed to encode. This field is empty if the video is // not in an `error` state. Preferred for programmatic use. ErrorReasonCode string `json:"errorReasonCode"` @@ -209,14 +207,13 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponseStatus struct { // non-negative integer. PctComplete string `json:"pctComplete"` // Specifies the processing status for all quality levels for a video. - State StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState `json:"state"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseStatusJSON `json:"-"` + State StreamCopyNewResponseStatusState `json:"state"` + JSON streamCopyNewResponseStatusJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseStatusJSON contains the JSON -// metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseStatus] -type streamCopyStreamVideosUploadVideosFromAurlResponseStatusJSON struct { +// streamCopyNewResponseStatusJSON contains the JSON metadata for the struct +// [StreamCopyNewResponseStatus] +type streamCopyNewResponseStatusJSON struct { ErrorReasonCode apijson.Field ErrorReasonText apijson.Field PctComplete apijson.Field @@ -225,23 +222,23 @@ type streamCopyStreamVideosUploadVideosFromAurlResponseStatusJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseStatus) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseStatus) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the processing status for all quality levels for a video. -type StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState string +type StreamCopyNewResponseStatusState string const ( - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStatePendingupload StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "pendingupload" - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStateDownloading StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "downloading" - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStateQueued StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "queued" - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStateInprogress StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "inprogress" - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStateReady StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "ready" - StreamCopyStreamVideosUploadVideosFromAurlResponseStatusStateError StreamCopyStreamVideosUploadVideosFromAurlResponseStatusState = "error" + StreamCopyNewResponseStatusStatePendingupload StreamCopyNewResponseStatusState = "pendingupload" + StreamCopyNewResponseStatusStateDownloading StreamCopyNewResponseStatusState = "downloading" + StreamCopyNewResponseStatusStateQueued StreamCopyNewResponseStatusState = "queued" + StreamCopyNewResponseStatusStateInprogress StreamCopyNewResponseStatusState = "inprogress" + StreamCopyNewResponseStatusStateReady StreamCopyNewResponseStatusState = "ready" + StreamCopyNewResponseStatusStateError StreamCopyNewResponseStatusState = "error" ) -type StreamCopyStreamVideosUploadVideosFromAurlResponseWatermark struct { +type StreamCopyNewResponseWatermark struct { // The date and a time a watermark profile was created. Created time.Time `json:"created" format:"date-time"` // The source URL for a downloaded image. If the watermark profile was created via @@ -273,14 +270,13 @@ type StreamCopyStreamVideosUploadVideosFromAurlResponseWatermark struct { // The unique identifier for a watermark profile. Uid string `json:"uid"` // The width of the image in pixels. - Width int64 `json:"width"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseWatermarkJSON `json:"-"` + Width int64 `json:"width"` + JSON streamCopyNewResponseWatermarkJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseWatermarkJSON contains the -// JSON metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseWatermark] -type streamCopyStreamVideosUploadVideosFromAurlResponseWatermarkJSON struct { +// streamCopyNewResponseWatermarkJSON contains the JSON metadata for the struct +// [StreamCopyNewResponseWatermark] +type streamCopyNewResponseWatermarkJSON struct { Created apijson.Field DownloadedFrom apijson.Field Height apijson.Field @@ -296,11 +292,11 @@ type streamCopyStreamVideosUploadVideosFromAurlResponseWatermarkJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseWatermark) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseWatermark) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCopyStreamVideosUploadVideosFromAURLParams struct { +type StreamCopyNewParams struct { // A video's URL. The server must be publicly routable and support `HTTP HEAD` // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` // requests with a `content-range` header that includes the size of the file. @@ -325,8 +321,8 @@ type StreamCopyStreamVideosUploadVideosFromAURLParams struct { // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` - Watermark param.Field[StreamCopyStreamVideosUploadVideosFromAurlParamsWatermark] `json:"watermark"` + ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` + Watermark param.Field[StreamCopyNewParamsWatermark] `json:"watermark"` // A user-defined identifier for the media creator. UploadCreator param.Field[string] `header:"Upload-Creator"` // Comma-separated key-value pairs following the TUS protocol specification. Values @@ -335,32 +331,31 @@ type StreamCopyStreamVideosUploadVideosFromAURLParams struct { UploadMetadata param.Field[string] `header:"Upload-Metadata"` } -func (r StreamCopyStreamVideosUploadVideosFromAURLParams) MarshalJSON() (data []byte, err error) { +func (r StreamCopyNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamCopyStreamVideosUploadVideosFromAurlParamsWatermark struct { +type StreamCopyNewParamsWatermark struct { // The unique identifier for the watermark profile. Uid param.Field[string] `json:"uid"` } -func (r StreamCopyStreamVideosUploadVideosFromAurlParamsWatermark) MarshalJSON() (data []byte, err error) { +func (r StreamCopyNewParamsWatermark) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelope struct { - Errors []StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessages `json:"messages,required"` - Result StreamCopyStreamVideosUploadVideosFromAurlResponse `json:"result,required"` +type StreamCopyNewResponseEnvelope struct { + Errors []StreamCopyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamCopyNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamCopyNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeSuccess `json:"success,required"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeJSON `json:"-"` + Success StreamCopyNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamCopyNewResponseEnvelopeJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelope] -type streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeJSON struct { +// streamCopyNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamCopyNewResponseEnvelope] +type streamCopyNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -369,53 +364,51 @@ type streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrorsJSON `json:"-"` +type StreamCopyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCopyNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrors] -type streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrorsJSON struct { +// streamCopyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamCopyNewResponseEnvelopeErrors] +type streamCopyNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessagesJSON `json:"-"` +type StreamCopyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamCopyNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessages] -type streamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessagesJSON struct { +// streamCopyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamCopyNewResponseEnvelopeMessages] +type streamCopyNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamCopyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeSuccess bool +type StreamCopyNewResponseEnvelopeSuccess bool const ( - StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeSuccessTrue StreamCopyStreamVideosUploadVideosFromAurlResponseEnvelopeSuccess = true + StreamCopyNewResponseEnvelopeSuccessTrue StreamCopyNewResponseEnvelopeSuccess = true ) diff --git a/streamcopy_test.go b/streamcopy_test.go index fe367264989..b00e554f876 100644 --- a/streamcopy_test.go +++ b/streamcopy_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamCopyStreamVideosUploadVideosFromAURLWithOptionalParams(t *testing.T) { +func TestStreamCopyNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,10 +30,10 @@ func TestStreamCopyStreamVideosUploadVideosFromAURLWithOptionalParams(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Copies.StreamVideosUploadVideosFromAURL( + _, err := client.Stream.Copies.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamCopyStreamVideosUploadVideosFromAURLParams{ + cloudflare.StreamCopyNewParams{ URL: cloudflare.F("https://example.com/myvideo.mp4"), AllowedOrigins: cloudflare.F([]string{"example.com"}), Creator: cloudflare.F("creator-id_abcde12345"), @@ -43,7 +43,7 @@ func TestStreamCopyStreamVideosUploadVideosFromAURLWithOptionalParams(t *testing RequireSignedURLs: cloudflare.F(true), ScheduledDeletion: cloudflare.F(time.Now()), ThumbnailTimestampPct: cloudflare.F(0.529241), - Watermark: cloudflare.F(cloudflare.StreamCopyStreamVideosUploadVideosFromAurlParamsWatermark{ + Watermark: cloudflare.F(cloudflare.StreamCopyNewParamsWatermark{ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"), }), UploadCreator: cloudflare.F("creator-id_abcde12345"), diff --git a/streamdirectupload.go b/streamdirectupload.go index fc2d3355f2c..a38b9969d28 100644 --- a/streamdirectupload.go +++ b/streamdirectupload.go @@ -33,9 +33,9 @@ func NewStreamDirectUploadService(opts ...option.RequestOption) (r *StreamDirect } // Creates a direct upload that allows video uploads without an API key. -func (r *StreamDirectUploadService) StreamVideosUploadVideosViaDirectUploadURLs(ctx context.Context, accountID string, params StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams, opts ...option.RequestOption) (res *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse, err error) { +func (r *StreamDirectUploadService) New(ctx context.Context, accountID string, params StreamDirectUploadNewParams, opts ...option.RequestOption) (res *StreamDirectUploadNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelope + var env StreamDirectUploadNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/direct_upload", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { @@ -45,7 +45,7 @@ func (r *StreamDirectUploadService) StreamVideosUploadVideosViaDirectUploadURLs( return } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse struct { +type StreamDirectUploadNewResponse struct { // Indicates the date and time at which the video will be deleted. Omit the field // to indicate no change, or include with a `null` value to remove an existing // scheduled deletion. If specified, must be at least 30 days from upload time. @@ -54,15 +54,14 @@ type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse struc Uid string `json:"uid"` // The URL an unauthenticated upload can use for a single // `HTTP POST multipart/form-data` request. - UploadURL string `json:"uploadURL"` - Watermark StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermark `json:"watermark"` - JSON streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseJSON `json:"-"` + UploadURL string `json:"uploadURL"` + Watermark StreamDirectUploadNewResponseWatermark `json:"watermark"` + JSON streamDirectUploadNewResponseJSON `json:"-"` } -// streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseJSON -// contains the JSON metadata for the struct -// [StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse] -type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseJSON struct { +// streamDirectUploadNewResponseJSON contains the JSON metadata for the struct +// [StreamDirectUploadNewResponse] +type streamDirectUploadNewResponseJSON struct { ScheduledDeletion apijson.Field Uid apijson.Field UploadURL apijson.Field @@ -71,11 +70,11 @@ type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseJSON s ExtraFields map[string]apijson.Field } -func (r *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermark struct { +type StreamDirectUploadNewResponseWatermark struct { // The date and a time a watermark profile was created. Created time.Time `json:"created" format:"date-time"` // The source URL for a downloaded image. If the watermark profile was created via @@ -107,14 +106,13 @@ type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWaterm // The unique identifier for a watermark profile. Uid string `json:"uid"` // The width of the image in pixels. - Width int64 `json:"width"` - JSON streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermarkJSON `json:"-"` + Width int64 `json:"width"` + JSON streamDirectUploadNewResponseWatermarkJSON `json:"-"` } -// streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermarkJSON -// contains the JSON metadata for the struct -// [StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermark] -type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermarkJSON struct { +// streamDirectUploadNewResponseWatermarkJSON contains the JSON metadata for the +// struct [StreamDirectUploadNewResponseWatermark] +type streamDirectUploadNewResponseWatermarkJSON struct { Created apijson.Field DownloadedFrom apijson.Field Height apijson.Field @@ -130,11 +128,11 @@ type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWaterm ExtraFields map[string]apijson.Field } -func (r *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseWatermark) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDirectUploadNewResponseWatermark) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams struct { +type StreamDirectUploadNewParams struct { // The maximum duration in seconds for a video upload. Can be set for a video that // is not yet uploaded to limit its duration. Uploads that exceed the specified // duration will fail during processing. A value of `-1` means the value is @@ -162,38 +160,37 @@ type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams struct // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. - ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` - Watermark param.Field[StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParamsWatermark] `json:"watermark"` + ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` + Watermark param.Field[StreamDirectUploadNewParamsWatermark] `json:"watermark"` // A user-defined identifier for the media creator. UploadCreator param.Field[string] `header:"Upload-Creator"` } -func (r StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams) MarshalJSON() (data []byte, err error) { +func (r StreamDirectUploadNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParamsWatermark struct { +type StreamDirectUploadNewParamsWatermark struct { // The unique identifier for the watermark profile. Uid param.Field[string] `json:"uid"` } -func (r StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParamsWatermark) MarshalJSON() (data []byte, err error) { +func (r StreamDirectUploadNewParamsWatermark) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelope struct { - Errors []StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessages `json:"messages,required"` - Result StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponse `json:"result,required"` +type StreamDirectUploadNewResponseEnvelope struct { + Errors []StreamDirectUploadNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamDirectUploadNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamDirectUploadNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeSuccess `json:"success,required"` - JSON streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeJSON `json:"-"` + Success StreamDirectUploadNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamDirectUploadNewResponseEnvelopeJSON `json:"-"` } -// streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelope] -type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeJSON struct { +// streamDirectUploadNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamDirectUploadNewResponseEnvelope] +type streamDirectUploadNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -202,53 +199,51 @@ type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelo ExtraFields map[string]apijson.Field } -func (r *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrorsJSON `json:"-"` +type StreamDirectUploadNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDirectUploadNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrors] -type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrorsJSON struct { +// streamDirectUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamDirectUploadNewResponseEnvelopeErrors] +type streamDirectUploadNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessagesJSON `json:"-"` +type StreamDirectUploadNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDirectUploadNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessages] -type streamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessagesJSON struct { +// streamDirectUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamDirectUploadNewResponseEnvelopeMessages] +type streamDirectUploadNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeSuccess bool +type StreamDirectUploadNewResponseEnvelopeSuccess bool const ( - StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeSuccessTrue StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsResponseEnvelopeSuccess = true + StreamDirectUploadNewResponseEnvelopeSuccessTrue StreamDirectUploadNewResponseEnvelopeSuccess = true ) diff --git a/streamdirectupload_test.go b/streamdirectupload_test.go index b2675bd9b44..dbb35edee69 100644 --- a/streamdirectupload_test.go +++ b/streamdirectupload_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsWithOptionalParams(t *testing.T) { +func TestStreamDirectUploadNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,10 +30,10 @@ func TestStreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsWithOption option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.DirectUploads.StreamVideosUploadVideosViaDirectUploadURLs( + _, err := client.Stream.DirectUploads.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParams{ + cloudflare.StreamDirectUploadNewParams{ MaxDurationSeconds: cloudflare.F(int64(1)), AllowedOrigins: cloudflare.F([]string{"example.com"}), Creator: cloudflare.F("creator-id_abcde12345"), @@ -44,7 +44,7 @@ func TestStreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsWithOption RequireSignedURLs: cloudflare.F(true), ScheduledDeletion: cloudflare.F(time.Now()), ThumbnailTimestampPct: cloudflare.F(0.529241), - Watermark: cloudflare.F(cloudflare.StreamDirectUploadStreamVideosUploadVideosViaDirectUploadURLsParamsWatermark{ + Watermark: cloudflare.F(cloudflare.StreamDirectUploadNewParamsWatermark{ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"), }), UploadCreator: cloudflare.F("creator-id_abcde12345"), diff --git a/streamdownload.go b/streamdownload.go index ccc63f1df3c..c82c559e2b7 100644 --- a/streamdownload.go +++ b/streamdownload.go @@ -33,12 +33,12 @@ func NewStreamDownloadService(opts ...option.RequestOption) (r *StreamDownloadSe return } -// Delete the downloads for a video. -func (r *StreamDownloadService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadDeleteResponse, err error) { +// Creates a download for a video when a video is ready to view. +func (r *StreamDownloadService) New(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamDownloadDeleteResponseEnvelope + var env StreamDownloadNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/%s/downloads", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -46,12 +46,12 @@ func (r *StreamDownloadService) Delete(ctx context.Context, accountID string, id return } -// Creates a download for a video when a video is ready to view. -func (r *StreamDownloadService) StreamMP4DownloadsNewDownloads(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadStreamMP4DownloadsNewDownloadsResponse, err error) { +// Lists the downloads created for a video. +func (r *StreamDownloadService) List(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadListResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelope + var env StreamDownloadListResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/%s/downloads", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -59,12 +59,12 @@ func (r *StreamDownloadService) StreamMP4DownloadsNewDownloads(ctx context.Conte return } -// Lists the downloads created for a video. -func (r *StreamDownloadService) StreamMP4DownloadsListDownloads(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadStreamMP4DownloadsListDownloadsResponse, err error) { +// Delete the downloads for a video. +func (r *StreamDownloadService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamDownloadDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelope + var env StreamDownloadDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/%s/downloads", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -72,15 +72,14 @@ func (r *StreamDownloadService) StreamMP4DownloadsListDownloads(ctx context.Cont return } -// Union satisfied by [StreamDownloadDeleteResponseUnknown] or -// [shared.UnionString]. -type StreamDownloadDeleteResponse interface { - ImplementsStreamDownloadDeleteResponse() +// Union satisfied by [StreamDownloadNewResponseUnknown] or [shared.UnionString]. +type StreamDownloadNewResponse interface { + ImplementsStreamDownloadNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamDownloadDeleteResponse)(nil)).Elem(), + reflect.TypeOf((*StreamDownloadNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -89,15 +88,14 @@ func init() { ) } -// Union satisfied by [StreamDownloadStreamMP4DownloadsNewDownloadsResponseUnknown] -// or [shared.UnionString]. -type StreamDownloadStreamMP4DownloadsNewDownloadsResponse interface { - ImplementsStreamDownloadStreamMP4DownloadsNewDownloadsResponse() +// Union satisfied by [StreamDownloadListResponseUnknown] or [shared.UnionString]. +type StreamDownloadListResponse interface { + ImplementsStreamDownloadListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamDownloadStreamMP4DownloadsNewDownloadsResponse)(nil)).Elem(), + reflect.TypeOf((*StreamDownloadListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -106,16 +104,15 @@ func init() { ) } -// Union satisfied by -// [StreamDownloadStreamMP4DownloadsListDownloadsResponseUnknown] or +// Union satisfied by [StreamDownloadDeleteResponseUnknown] or // [shared.UnionString]. -type StreamDownloadStreamMP4DownloadsListDownloadsResponse interface { - ImplementsStreamDownloadStreamMP4DownloadsListDownloadsResponse() +type StreamDownloadDeleteResponse interface { + ImplementsStreamDownloadDeleteResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamDownloadStreamMP4DownloadsListDownloadsResponse)(nil)).Elem(), + reflect.TypeOf((*StreamDownloadDeleteResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -124,18 +121,18 @@ func init() { ) } -type StreamDownloadDeleteResponseEnvelope struct { - Errors []StreamDownloadDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamDownloadDeleteResponseEnvelopeMessages `json:"messages,required"` - Result StreamDownloadDeleteResponse `json:"result,required"` +type StreamDownloadNewResponseEnvelope struct { + Errors []StreamDownloadNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamDownloadNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamDownloadNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamDownloadDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON streamDownloadDeleteResponseEnvelopeJSON `json:"-"` + Success StreamDownloadNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamDownloadNewResponseEnvelopeJSON `json:"-"` } -// streamDownloadDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [StreamDownloadDeleteResponseEnvelope] -type streamDownloadDeleteResponseEnvelopeJSON struct { +// streamDownloadNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamDownloadNewResponseEnvelope] +type streamDownloadNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -144,68 +141,67 @@ type streamDownloadDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamDownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadDeleteResponseEnvelopeErrorsJSON `json:"-"` +type StreamDownloadNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamDownloadDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [StreamDownloadDeleteResponseEnvelopeErrors] -type streamDownloadDeleteResponseEnvelopeErrorsJSON struct { +// streamDownloadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamDownloadNewResponseEnvelopeErrors] +type streamDownloadNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadDeleteResponseEnvelopeMessagesJSON `json:"-"` +type StreamDownloadNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamDownloadDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamDownloadDeleteResponseEnvelopeMessages] -type streamDownloadDeleteResponseEnvelopeMessagesJSON struct { +// streamDownloadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamDownloadNewResponseEnvelopeMessages] +type streamDownloadNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamDownloadDeleteResponseEnvelopeSuccess bool +type StreamDownloadNewResponseEnvelopeSuccess bool const ( - StreamDownloadDeleteResponseEnvelopeSuccessTrue StreamDownloadDeleteResponseEnvelopeSuccess = true + StreamDownloadNewResponseEnvelopeSuccessTrue StreamDownloadNewResponseEnvelopeSuccess = true ) -type StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelope struct { - Errors []StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessages `json:"messages,required"` - Result StreamDownloadStreamMP4DownloadsNewDownloadsResponse `json:"result,required"` +type StreamDownloadListResponseEnvelope struct { + Errors []StreamDownloadListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamDownloadListResponseEnvelopeMessages `json:"messages,required"` + Result StreamDownloadListResponse `json:"result,required"` // Whether the API call was successful - Success StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeSuccess `json:"success,required"` - JSON streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeJSON `json:"-"` + Success StreamDownloadListResponseEnvelopeSuccess `json:"success,required"` + JSON streamDownloadListResponseEnvelopeJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelope] -type streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeJSON struct { +// streamDownloadListResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamDownloadListResponseEnvelope] +type streamDownloadListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -214,70 +210,67 @@ type streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrorsJSON `json:"-"` +type StreamDownloadListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadListResponseEnvelopeErrorsJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrors] -type streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrorsJSON struct { +// streamDownloadListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamDownloadListResponseEnvelopeErrors] +type streamDownloadListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessagesJSON `json:"-"` +type StreamDownloadListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadListResponseEnvelopeMessagesJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessages] -type streamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessagesJSON struct { +// streamDownloadListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamDownloadListResponseEnvelopeMessages] +type streamDownloadListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeSuccess bool +type StreamDownloadListResponseEnvelopeSuccess bool const ( - StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeSuccessTrue StreamDownloadStreamMP4DownloadsNewDownloadsResponseEnvelopeSuccess = true + StreamDownloadListResponseEnvelopeSuccessTrue StreamDownloadListResponseEnvelopeSuccess = true ) -type StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelope struct { - Errors []StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessages `json:"messages,required"` - Result StreamDownloadStreamMP4DownloadsListDownloadsResponse `json:"result,required"` +type StreamDownloadDeleteResponseEnvelope struct { + Errors []StreamDownloadDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamDownloadDeleteResponseEnvelopeMessages `json:"messages,required"` + Result StreamDownloadDeleteResponse `json:"result,required"` // Whether the API call was successful - Success StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeSuccess `json:"success,required"` - JSON streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeJSON `json:"-"` + Success StreamDownloadDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON streamDownloadDeleteResponseEnvelopeJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelope] -type streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeJSON struct { +// streamDownloadDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamDownloadDeleteResponseEnvelope] +type streamDownloadDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -286,53 +279,51 @@ type streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrorsJSON `json:"-"` +type StreamDownloadDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrors] -type streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrorsJSON struct { +// streamDownloadDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamDownloadDeleteResponseEnvelopeErrors] +type streamDownloadDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessagesJSON `json:"-"` +type StreamDownloadDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamDownloadDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessages] -type streamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessagesJSON struct { +// streamDownloadDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamDownloadDeleteResponseEnvelopeMessages] +type streamDownloadDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamDownloadDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeSuccess bool +type StreamDownloadDeleteResponseEnvelopeSuccess bool const ( - StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeSuccessTrue StreamDownloadStreamMP4DownloadsListDownloadsResponseEnvelopeSuccess = true + StreamDownloadDeleteResponseEnvelopeSuccessTrue StreamDownloadDeleteResponseEnvelopeSuccess = true ) diff --git a/streamdownload_test.go b/streamdownload_test.go index 9d0e7795058..0aa60467087 100644 --- a/streamdownload_test.go +++ b/streamdownload_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamDownloadDelete(t *testing.T) { +func TestStreamDownloadNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestStreamDownloadDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Downloads.Delete( + _, err := client.Stream.Downloads.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", @@ -43,7 +43,7 @@ func TestStreamDownloadDelete(t *testing.T) { } } -func TestStreamDownloadStreamMP4DownloadsNewDownloads(t *testing.T) { +func TestStreamDownloadList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +59,7 @@ func TestStreamDownloadStreamMP4DownloadsNewDownloads(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Downloads.StreamMP4DownloadsNewDownloads( + _, err := client.Stream.Downloads.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", @@ -73,7 +73,7 @@ func TestStreamDownloadStreamMP4DownloadsNewDownloads(t *testing.T) { } } -func TestStreamDownloadStreamMP4DownloadsListDownloads(t *testing.T) { +func TestStreamDownloadDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,7 +89,7 @@ func TestStreamDownloadStreamMP4DownloadsListDownloads(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Downloads.StreamMP4DownloadsListDownloads( + _, err := client.Stream.Downloads.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", diff --git a/streamkey.go b/streamkey.go index 5abd1f40d7b..1600a4eb774 100644 --- a/streamkey.go +++ b/streamkey.go @@ -33,25 +33,12 @@ func NewStreamKeyService(opts ...option.RequestOption) (r *StreamKeyService) { return } -// Deletes signing keys and revokes all signed URLs generated with the key. -func (r *StreamKeyService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamKeyDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env StreamKeyDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/keys/%s", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Creates an RSA private key in PEM and JWK formats. Key files are only displayed // once after creation. Keys are created, used, and deleted independently of // videos, and every key can sign any video. -func (r *StreamKeyService) StreamSigningKeysNewSigningKeys(ctx context.Context, accountID string, opts ...option.RequestOption) (res *StreamKeyStreamSigningKeysNewSigningKeysResponse, err error) { +func (r *StreamKeyService) New(ctx context.Context, accountID string, opts ...option.RequestOption) (res *StreamKeyNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelope + var env StreamKeyNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/keys", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { @@ -62,9 +49,9 @@ func (r *StreamKeyService) StreamSigningKeysNewSigningKeys(ctx context.Context, } // Lists the video ID and creation date and time when a signing key was created. -func (r *StreamKeyService) StreamSigningKeysListSigningKeys(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]StreamKeyStreamSigningKeysListSigningKeysResponse, err error) { +func (r *StreamKeyService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]StreamKeyListResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamKeyStreamSigningKeysListSigningKeysResponseEnvelope + var env StreamKeyListResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/keys", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -74,23 +61,20 @@ func (r *StreamKeyService) StreamSigningKeysListSigningKeys(ctx context.Context, return } -// Union satisfied by [StreamKeyDeleteResponseUnknown] or [shared.UnionString]. -type StreamKeyDeleteResponse interface { - ImplementsStreamKeyDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*StreamKeyDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Deletes signing keys and revokes all signed URLs generated with the key. +func (r *StreamKeyService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamKeyDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env StreamKeyDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/keys/%s", accountID, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } -type StreamKeyStreamSigningKeysNewSigningKeysResponse struct { +type StreamKeyNewResponse struct { // Identifier ID string `json:"id"` // The date and time a signing key was created. @@ -98,13 +82,13 @@ type StreamKeyStreamSigningKeysNewSigningKeysResponse struct { // The signing key in JWK format. Jwk string `json:"jwk"` // The signing key in PEM format. - Pem string `json:"pem"` - JSON streamKeyStreamSigningKeysNewSigningKeysResponseJSON `json:"-"` + Pem string `json:"pem"` + JSON streamKeyNewResponseJSON `json:"-"` } -// streamKeyStreamSigningKeysNewSigningKeysResponseJSON contains the JSON metadata -// for the struct [StreamKeyStreamSigningKeysNewSigningKeysResponse] -type streamKeyStreamSigningKeysNewSigningKeysResponseJSON struct { +// streamKeyNewResponseJSON contains the JSON metadata for the struct +// [StreamKeyNewResponse] +type streamKeyNewResponseJSON struct { ID apijson.Field Created apijson.Field Jwk apijson.Field @@ -113,43 +97,59 @@ type streamKeyStreamSigningKeysNewSigningKeysResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysNewSigningKeysResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyStreamSigningKeysListSigningKeysResponse struct { +type StreamKeyListResponse struct { // Identifier ID string `json:"id"` // The date and time a signing key was created. - Created time.Time `json:"created" format:"date-time"` - JSON streamKeyStreamSigningKeysListSigningKeysResponseJSON `json:"-"` + Created time.Time `json:"created" format:"date-time"` + JSON streamKeyListResponseJSON `json:"-"` } -// streamKeyStreamSigningKeysListSigningKeysResponseJSON contains the JSON metadata -// for the struct [StreamKeyStreamSigningKeysListSigningKeysResponse] -type streamKeyStreamSigningKeysListSigningKeysResponseJSON struct { +// streamKeyListResponseJSON contains the JSON metadata for the struct +// [StreamKeyListResponse] +type streamKeyListResponseJSON struct { ID apijson.Field Created apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysListSigningKeysResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyDeleteResponseEnvelope struct { - Errors []StreamKeyDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamKeyDeleteResponseEnvelopeMessages `json:"messages,required"` - Result StreamKeyDeleteResponse `json:"result,required"` +// Union satisfied by [StreamKeyDeleteResponseUnknown] or [shared.UnionString]. +type StreamKeyDeleteResponse interface { + ImplementsStreamKeyDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*StreamKeyDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type StreamKeyNewResponseEnvelope struct { + Errors []StreamKeyNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamKeyNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamKeyNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamKeyDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON streamKeyDeleteResponseEnvelopeJSON `json:"-"` + Success StreamKeyNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamKeyNewResponseEnvelopeJSON `json:"-"` } -// streamKeyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [StreamKeyDeleteResponseEnvelope] -type streamKeyDeleteResponseEnvelopeJSON struct { +// streamKeyNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamKeyNewResponseEnvelope] +type streamKeyNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -158,68 +158,67 @@ type streamKeyDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamKeyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyDeleteResponseEnvelopeErrorsJSON `json:"-"` +type StreamKeyNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamKeyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [StreamKeyDeleteResponseEnvelopeErrors] -type streamKeyDeleteResponseEnvelopeErrorsJSON struct { +// streamKeyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [StreamKeyNewResponseEnvelopeErrors] +type streamKeyNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyDeleteResponseEnvelopeMessagesJSON `json:"-"` +type StreamKeyNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamKeyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [StreamKeyDeleteResponseEnvelopeMessages] -type streamKeyDeleteResponseEnvelopeMessagesJSON struct { +// streamKeyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamKeyNewResponseEnvelopeMessages] +type streamKeyNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamKeyDeleteResponseEnvelopeSuccess bool +type StreamKeyNewResponseEnvelopeSuccess bool const ( - StreamKeyDeleteResponseEnvelopeSuccessTrue StreamKeyDeleteResponseEnvelopeSuccess = true + StreamKeyNewResponseEnvelopeSuccessTrue StreamKeyNewResponseEnvelopeSuccess = true ) -type StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelope struct { - Errors []StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessages `json:"messages,required"` - Result StreamKeyStreamSigningKeysNewSigningKeysResponse `json:"result,required"` +type StreamKeyListResponseEnvelope struct { + Errors []StreamKeyListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamKeyListResponseEnvelopeMessages `json:"messages,required"` + Result []StreamKeyListResponse `json:"result,required"` // Whether the API call was successful - Success StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeSuccess `json:"success,required"` - JSON streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeJSON `json:"-"` + Success StreamKeyListResponseEnvelopeSuccess `json:"success,required"` + JSON streamKeyListResponseEnvelopeJSON `json:"-"` } -// streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelope] -type streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeJSON struct { +// streamKeyListResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamKeyListResponseEnvelope] +type streamKeyListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -228,70 +227,67 @@ type streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrorsJSON `json:"-"` +type StreamKeyListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyListResponseEnvelopeErrorsJSON `json:"-"` } -// streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrors] -type streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrorsJSON struct { +// streamKeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamKeyListResponseEnvelopeErrors] +type streamKeyListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessagesJSON `json:"-"` +type StreamKeyListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyListResponseEnvelopeMessagesJSON `json:"-"` } -// streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessages] -type streamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessagesJSON struct { +// streamKeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamKeyListResponseEnvelopeMessages] +type streamKeyListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeSuccess bool +type StreamKeyListResponseEnvelopeSuccess bool const ( - StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeSuccessTrue StreamKeyStreamSigningKeysNewSigningKeysResponseEnvelopeSuccess = true + StreamKeyListResponseEnvelopeSuccessTrue StreamKeyListResponseEnvelopeSuccess = true ) -type StreamKeyStreamSigningKeysListSigningKeysResponseEnvelope struct { - Errors []StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessages `json:"messages,required"` - Result []StreamKeyStreamSigningKeysListSigningKeysResponse `json:"result,required"` +type StreamKeyDeleteResponseEnvelope struct { + Errors []StreamKeyDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamKeyDeleteResponseEnvelopeMessages `json:"messages,required"` + Result StreamKeyDeleteResponse `json:"result,required"` // Whether the API call was successful - Success StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeSuccess `json:"success,required"` - JSON streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeJSON `json:"-"` + Success StreamKeyDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON streamKeyDeleteResponseEnvelopeJSON `json:"-"` } -// streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [StreamKeyStreamSigningKeysListSigningKeysResponseEnvelope] -type streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeJSON struct { +// streamKeyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamKeyDeleteResponseEnvelope] +type streamKeyDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -300,53 +296,51 @@ type streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysListSigningKeysResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrorsJSON `json:"-"` +type StreamKeyDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrors] -type streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrorsJSON struct { +// streamKeyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamKeyDeleteResponseEnvelopeErrors] +type streamKeyDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessagesJSON `json:"-"` +type StreamKeyDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamKeyDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessages] -type streamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessagesJSON struct { +// streamKeyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamKeyDeleteResponseEnvelopeMessages] +type streamKeyDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamKeyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeSuccess bool +type StreamKeyDeleteResponseEnvelopeSuccess bool const ( - StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeSuccessTrue StreamKeyStreamSigningKeysListSigningKeysResponseEnvelopeSuccess = true + StreamKeyDeleteResponseEnvelopeSuccessTrue StreamKeyDeleteResponseEnvelopeSuccess = true ) diff --git a/streamkey_test.go b/streamkey_test.go index 31f7d3ba485..a9d2a983e99 100644 --- a/streamkey_test.go +++ b/streamkey_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamKeyDelete(t *testing.T) { +func TestStreamKeyNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,7 @@ func TestStreamKeyDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Keys.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Stream.Keys.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -43,7 +39,7 @@ func TestStreamKeyDelete(t *testing.T) { } } -func TestStreamKeyStreamSigningKeysNewSigningKeys(t *testing.T) { +func TestStreamKeyList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +55,7 @@ func TestStreamKeyStreamSigningKeysNewSigningKeys(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Keys.StreamSigningKeysNewSigningKeys(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Stream.Keys.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -69,7 +65,7 @@ func TestStreamKeyStreamSigningKeysNewSigningKeys(t *testing.T) { } } -func TestStreamKeyStreamSigningKeysListSigningKeys(t *testing.T) { +func TestStreamKeyDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -85,7 +81,11 @@ func TestStreamKeyStreamSigningKeysListSigningKeys(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Keys.StreamSigningKeysListSigningKeys(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Stream.Keys.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/streamliveinput.go b/streamliveinput.go index 191a75eac85..7d64a83a360 100644 --- a/streamliveinput.go +++ b/streamliveinput.go @@ -36,12 +36,27 @@ func NewStreamLiveInputService(opts ...option.RequestOption) (r *StreamLiveInput return } -// Updates a specified live input. -func (r *StreamLiveInputService) Update(ctx context.Context, accountID string, liveInputIdentifier string, body StreamLiveInputUpdateParams, opts ...option.RequestOption) (res *StreamLiveInputUpdateResponse, err error) { +// Creates a live input, and returns credentials that you or your users can use to +// stream live video to Cloudflare Stream. +func (r *StreamLiveInputService) New(ctx context.Context, accountID string, body StreamLiveInputNewParams, opts ...option.RequestOption) (res *StreamLiveInputNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamLiveInputUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", accountID, liveInputIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env StreamLiveInputNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/live_inputs", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists the live inputs created for an account. To get the credentials needed to +// stream to a specific live input, request a single live input. +func (r *StreamLiveInputService) List(ctx context.Context, accountID string, query StreamLiveInputListParams, opts ...option.RequestOption) (res *StreamLiveInputListResponse, err error) { + opts = append(r.Options[:], opts...) + var env StreamLiveInputListResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/live_inputs", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -72,27 +87,12 @@ func (r *StreamLiveInputService) Get(ctx context.Context, accountID string, live return } -// Creates a live input, and returns credentials that you or your users can use to -// stream live video to Cloudflare Stream. -func (r *StreamLiveInputService) StreamLiveInputsNewALiveInput(ctx context.Context, accountID string, body StreamLiveInputStreamLiveInputsNewALiveInputParams, opts ...option.RequestOption) (res *StreamLiveInputStreamLiveInputsNewALiveInputResponse, err error) { - opts = append(r.Options[:], opts...) - var env StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/live_inputs", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists the live inputs created for an account. To get the credentials needed to -// stream to a specific live input, request a single live input. -func (r *StreamLiveInputService) StreamLiveInputsListLiveInputs(ctx context.Context, accountID string, query StreamLiveInputStreamLiveInputsListLiveInputsParams, opts ...option.RequestOption) (res *StreamLiveInputStreamLiveInputsListLiveInputsResponse, err error) { +// Updates a specified live input. +func (r *StreamLiveInputService) Replace(ctx context.Context, accountID string, liveInputIdentifier string, body StreamLiveInputReplaceParams, opts ...option.RequestOption) (res *StreamLiveInputReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/live_inputs", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env StreamLiveInputReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", accountID, liveInputIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -101,7 +101,7 @@ func (r *StreamLiveInputService) StreamLiveInputsListLiveInputs(ctx context.Cont } // Details about a live input. -type StreamLiveInputUpdateResponse struct { +type StreamLiveInputNewResponse struct { // The date and time the live input was created. Created time.Time `json:"created" format:"date-time"` // Indicates the number of days after which the live inputs recordings will be @@ -118,29 +118,29 @@ type StreamLiveInputUpdateResponse struct { // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. - Recording StreamLiveInputUpdateResponseRecording `json:"recording"` + Recording StreamLiveInputNewResponseRecording `json:"recording"` // Details for streaming to an live input using RTMPS. - Rtmps StreamLiveInputUpdateResponseRtmps `json:"rtmps"` + Rtmps StreamLiveInputNewResponseRtmps `json:"rtmps"` // Details for playback from an live input using RTMPS. - RtmpsPlayback StreamLiveInputUpdateResponseRtmpsPlayback `json:"rtmpsPlayback"` + RtmpsPlayback StreamLiveInputNewResponseRtmpsPlayback `json:"rtmpsPlayback"` // Details for streaming to a live input using SRT. - Srt StreamLiveInputUpdateResponseSrt `json:"srt"` + Srt StreamLiveInputNewResponseSrt `json:"srt"` // Details for playback from an live input using SRT. - SrtPlayback StreamLiveInputUpdateResponseSrtPlayback `json:"srtPlayback"` + SrtPlayback StreamLiveInputNewResponseSrtPlayback `json:"srtPlayback"` // The connection status of a live input. - Status StreamLiveInputUpdateResponseStatus `json:"status,nullable"` + Status StreamLiveInputNewResponseStatus `json:"status,nullable"` // A unique identifier for a live input. Uid string `json:"uid"` // Details for streaming to a live input using WebRTC. - WebRtc StreamLiveInputUpdateResponseWebRtc `json:"webRTC"` + WebRtc StreamLiveInputNewResponseWebRtc `json:"webRTC"` // Details for playback from a live input using WebRTC. - WebRtcPlayback StreamLiveInputUpdateResponseWebRtcPlayback `json:"webRTCPlayback"` - JSON streamLiveInputUpdateResponseJSON `json:"-"` + WebRtcPlayback StreamLiveInputNewResponseWebRtcPlayback `json:"webRTCPlayback"` + JSON streamLiveInputNewResponseJSON `json:"-"` } -// streamLiveInputUpdateResponseJSON contains the JSON metadata for the struct -// [StreamLiveInputUpdateResponse] -type streamLiveInputUpdateResponseJSON struct { +// streamLiveInputNewResponseJSON contains the JSON metadata for the struct +// [StreamLiveInputNewResponse] +type streamLiveInputNewResponseJSON struct { Created apijson.Field DeleteRecordingAfterDays apijson.Field Meta apijson.Field @@ -158,14 +158,14 @@ type streamLiveInputUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. -type StreamLiveInputUpdateResponseRecording struct { +type StreamLiveInputNewResponseRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. @@ -173,7 +173,7 @@ type StreamLiveInputUpdateResponseRecording struct { // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. - Mode StreamLiveInputUpdateResponseRecordingMode `json:"mode"` + Mode StreamLiveInputNewResponseRecordingMode `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. @@ -181,13 +181,13 @@ type StreamLiveInputUpdateResponseRecording struct { // Determines the amount of time a live input configured in `automatic` mode should // wait before a recording transitions from live to on-demand. `0` is recommended // for most use cases and indicates the platform default should be used. - TimeoutSeconds int64 `json:"timeoutSeconds"` - JSON streamLiveInputUpdateResponseRecordingJSON `json:"-"` + TimeoutSeconds int64 `json:"timeoutSeconds"` + JSON streamLiveInputNewResponseRecordingJSON `json:"-"` } -// streamLiveInputUpdateResponseRecordingJSON contains the JSON metadata for the -// struct [StreamLiveInputUpdateResponseRecording] -type streamLiveInputUpdateResponseRecordingJSON struct { +// streamLiveInputNewResponseRecordingJSON contains the JSON metadata for the +// struct [StreamLiveInputNewResponseRecording] +type streamLiveInputNewResponseRecordingJSON struct { AllowedOrigins apijson.Field Mode apijson.Field RequireSignedURLs apijson.Field @@ -196,78 +196,78 @@ type streamLiveInputUpdateResponseRecordingJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseRecording) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseRecording) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. -type StreamLiveInputUpdateResponseRecordingMode string +type StreamLiveInputNewResponseRecordingMode string const ( - StreamLiveInputUpdateResponseRecordingModeOff StreamLiveInputUpdateResponseRecordingMode = "off" - StreamLiveInputUpdateResponseRecordingModeAutomatic StreamLiveInputUpdateResponseRecordingMode = "automatic" + StreamLiveInputNewResponseRecordingModeOff StreamLiveInputNewResponseRecordingMode = "off" + StreamLiveInputNewResponseRecordingModeAutomatic StreamLiveInputNewResponseRecordingMode = "automatic" ) // Details for streaming to an live input using RTMPS. -type StreamLiveInputUpdateResponseRtmps struct { +type StreamLiveInputNewResponseRtmps struct { // The secret key to use when streaming via RTMPS to a live input. StreamKey string `json:"streamKey"` // The RTMPS URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseRtmpsJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseRtmpsJSON `json:"-"` } -// streamLiveInputUpdateResponseRtmpsJSON contains the JSON metadata for the struct -// [StreamLiveInputUpdateResponseRtmps] -type streamLiveInputUpdateResponseRtmpsJSON struct { +// streamLiveInputNewResponseRtmpsJSON contains the JSON metadata for the struct +// [StreamLiveInputNewResponseRtmps] +type streamLiveInputNewResponseRtmpsJSON struct { StreamKey apijson.Field URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseRtmps) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseRtmps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from an live input using RTMPS. -type StreamLiveInputUpdateResponseRtmpsPlayback struct { +type StreamLiveInputNewResponseRtmpsPlayback struct { // The secret key to use for playback via RTMPS. StreamKey string `json:"streamKey"` // The URL used to play live video over RTMPS. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseRtmpsPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseRtmpsPlaybackJSON `json:"-"` } -// streamLiveInputUpdateResponseRtmpsPlaybackJSON contains the JSON metadata for -// the struct [StreamLiveInputUpdateResponseRtmpsPlayback] -type streamLiveInputUpdateResponseRtmpsPlaybackJSON struct { +// streamLiveInputNewResponseRtmpsPlaybackJSON contains the JSON metadata for the +// struct [StreamLiveInputNewResponseRtmpsPlayback] +type streamLiveInputNewResponseRtmpsPlaybackJSON struct { StreamKey apijson.Field URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseRtmpsPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseRtmpsPlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for streaming to a live input using SRT. -type StreamLiveInputUpdateResponseSrt struct { +type StreamLiveInputNewResponseSrt struct { // The secret key to use when streaming via SRT to a live input. Passphrase string `json:"passphrase"` // The identifier of the live input to use when streaming via SRT. StreamID string `json:"streamId"` // The SRT URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseSrtJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseSrtJSON `json:"-"` } -// streamLiveInputUpdateResponseSrtJSON contains the JSON metadata for the struct -// [StreamLiveInputUpdateResponseSrt] -type streamLiveInputUpdateResponseSrtJSON struct { +// streamLiveInputNewResponseSrtJSON contains the JSON metadata for the struct +// [StreamLiveInputNewResponseSrt] +type streamLiveInputNewResponseSrtJSON struct { Passphrase apijson.Field StreamID apijson.Field URL apijson.Field @@ -275,24 +275,24 @@ type streamLiveInputUpdateResponseSrtJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseSrt) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseSrt) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from an live input using SRT. -type StreamLiveInputUpdateResponseSrtPlayback struct { +type StreamLiveInputNewResponseSrtPlayback struct { // The secret key to use for playback via SRT. Passphrase string `json:"passphrase"` // The identifier of the live input to use for playback via SRT. StreamID string `json:"streamId"` // The URL used to play live video over SRT. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseSrtPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseSrtPlaybackJSON `json:"-"` } -// streamLiveInputUpdateResponseSrtPlaybackJSON contains the JSON metadata for the -// struct [StreamLiveInputUpdateResponseSrtPlayback] -type streamLiveInputUpdateResponseSrtPlaybackJSON struct { +// streamLiveInputNewResponseSrtPlaybackJSON contains the JSON metadata for the +// struct [StreamLiveInputNewResponseSrtPlayback] +type streamLiveInputNewResponseSrtPlaybackJSON struct { Passphrase apijson.Field StreamID apijson.Field URL apijson.Field @@ -300,59 +300,117 @@ type streamLiveInputUpdateResponseSrtPlaybackJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseSrtPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseSrtPlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The connection status of a live input. -type StreamLiveInputUpdateResponseStatus string +type StreamLiveInputNewResponseStatus string const ( - StreamLiveInputUpdateResponseStatusConnected StreamLiveInputUpdateResponseStatus = "connected" - StreamLiveInputUpdateResponseStatusReconnected StreamLiveInputUpdateResponseStatus = "reconnected" - StreamLiveInputUpdateResponseStatusReconnecting StreamLiveInputUpdateResponseStatus = "reconnecting" - StreamLiveInputUpdateResponseStatusClientDisconnect StreamLiveInputUpdateResponseStatus = "client_disconnect" - StreamLiveInputUpdateResponseStatusTTLExceeded StreamLiveInputUpdateResponseStatus = "ttl_exceeded" - StreamLiveInputUpdateResponseStatusFailedToConnect StreamLiveInputUpdateResponseStatus = "failed_to_connect" - StreamLiveInputUpdateResponseStatusFailedToReconnect StreamLiveInputUpdateResponseStatus = "failed_to_reconnect" - StreamLiveInputUpdateResponseStatusNewConfigurationAccepted StreamLiveInputUpdateResponseStatus = "new_configuration_accepted" + StreamLiveInputNewResponseStatusConnected StreamLiveInputNewResponseStatus = "connected" + StreamLiveInputNewResponseStatusReconnected StreamLiveInputNewResponseStatus = "reconnected" + StreamLiveInputNewResponseStatusReconnecting StreamLiveInputNewResponseStatus = "reconnecting" + StreamLiveInputNewResponseStatusClientDisconnect StreamLiveInputNewResponseStatus = "client_disconnect" + StreamLiveInputNewResponseStatusTTLExceeded StreamLiveInputNewResponseStatus = "ttl_exceeded" + StreamLiveInputNewResponseStatusFailedToConnect StreamLiveInputNewResponseStatus = "failed_to_connect" + StreamLiveInputNewResponseStatusFailedToReconnect StreamLiveInputNewResponseStatus = "failed_to_reconnect" + StreamLiveInputNewResponseStatusNewConfigurationAccepted StreamLiveInputNewResponseStatus = "new_configuration_accepted" ) // Details for streaming to a live input using WebRTC. -type StreamLiveInputUpdateResponseWebRtc struct { +type StreamLiveInputNewResponseWebRtc struct { // The WebRTC URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseWebRtcJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseWebRtcJSON `json:"-"` } -// streamLiveInputUpdateResponseWebRtcJSON contains the JSON metadata for the -// struct [StreamLiveInputUpdateResponseWebRtc] -type streamLiveInputUpdateResponseWebRtcJSON struct { +// streamLiveInputNewResponseWebRtcJSON contains the JSON metadata for the struct +// [StreamLiveInputNewResponseWebRtc] +type streamLiveInputNewResponseWebRtcJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseWebRtc) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseWebRtc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from a live input using WebRTC. -type StreamLiveInputUpdateResponseWebRtcPlayback struct { +type StreamLiveInputNewResponseWebRtcPlayback struct { // The URL used to play live video over WebRTC. - URL string `json:"url"` - JSON streamLiveInputUpdateResponseWebRtcPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputNewResponseWebRtcPlaybackJSON `json:"-"` } -// streamLiveInputUpdateResponseWebRtcPlaybackJSON contains the JSON metadata for -// the struct [StreamLiveInputUpdateResponseWebRtcPlayback] -type streamLiveInputUpdateResponseWebRtcPlaybackJSON struct { +// streamLiveInputNewResponseWebRtcPlaybackJSON contains the JSON metadata for the +// struct [StreamLiveInputNewResponseWebRtcPlayback] +type streamLiveInputNewResponseWebRtcPlaybackJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseWebRtcPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseWebRtcPlayback) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type StreamLiveInputListResponse struct { + LiveInputs []StreamLiveInputListResponseLiveInput `json:"liveInputs"` + // The total number of remaining live inputs based on cursor position. + Range int64 `json:"range"` + // The total number of live inputs that match the provided filters. + Total int64 `json:"total"` + JSON streamLiveInputListResponseJSON `json:"-"` +} + +// streamLiveInputListResponseJSON contains the JSON metadata for the struct +// [StreamLiveInputListResponse] +type streamLiveInputListResponseJSON struct { + LiveInputs apijson.Field + Range apijson.Field + Total apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamLiveInputListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type StreamLiveInputListResponseLiveInput struct { + // The date and time the live input was created. + Created time.Time `json:"created" format:"date-time"` + // Indicates the number of days after which the live inputs recordings will be + // deleted. When a stream completes and the recording is ready, the value is used + // to calculate a scheduled deletion date for that recording. Omit the field to + // indicate no change, or include with a `null` value to remove an existing + // scheduled deletion. + DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"` + // A user modifiable key-value store used to reference other systems of record for + // managing live inputs. + Meta interface{} `json:"meta"` + // The date and time the live input was last modified. + Modified time.Time `json:"modified" format:"date-time"` + // A unique identifier for a live input. + Uid string `json:"uid"` + JSON streamLiveInputListResponseLiveInputJSON `json:"-"` +} + +// streamLiveInputListResponseLiveInputJSON contains the JSON metadata for the +// struct [StreamLiveInputListResponseLiveInput] +type streamLiveInputListResponseLiveInputJSON struct { + Created apijson.Field + DeleteRecordingAfterDays apijson.Field + Meta apijson.Field + Modified apijson.Field + Uid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamLiveInputListResponseLiveInput) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -613,7 +671,7 @@ func (r *StreamLiveInputGetResponseWebRtcPlayback) UnmarshalJSON(data []byte) (e } // Details about a live input. -type StreamLiveInputStreamLiveInputsNewALiveInputResponse struct { +type StreamLiveInputReplaceResponse struct { // The date and time the live input was created. Created time.Time `json:"created" format:"date-time"` // Indicates the number of days after which the live inputs recordings will be @@ -630,29 +688,29 @@ type StreamLiveInputStreamLiveInputsNewALiveInputResponse struct { // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. - Recording StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording `json:"recording"` + Recording StreamLiveInputReplaceResponseRecording `json:"recording"` // Details for streaming to an live input using RTMPS. - Rtmps StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmps `json:"rtmps"` + Rtmps StreamLiveInputReplaceResponseRtmps `json:"rtmps"` // Details for playback from an live input using RTMPS. - RtmpsPlayback StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlayback `json:"rtmpsPlayback"` + RtmpsPlayback StreamLiveInputReplaceResponseRtmpsPlayback `json:"rtmpsPlayback"` // Details for streaming to a live input using SRT. - Srt StreamLiveInputStreamLiveInputsNewALiveInputResponseSrt `json:"srt"` + Srt StreamLiveInputReplaceResponseSrt `json:"srt"` // Details for playback from an live input using SRT. - SrtPlayback StreamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlayback `json:"srtPlayback"` + SrtPlayback StreamLiveInputReplaceResponseSrtPlayback `json:"srtPlayback"` // The connection status of a live input. - Status StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus `json:"status,nullable"` + Status StreamLiveInputReplaceResponseStatus `json:"status,nullable"` // A unique identifier for a live input. Uid string `json:"uid"` // Details for streaming to a live input using WebRTC. - WebRtc StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtc `json:"webRTC"` + WebRtc StreamLiveInputReplaceResponseWebRtc `json:"webRTC"` // Details for playback from a live input using WebRTC. - WebRtcPlayback StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlayback `json:"webRTCPlayback"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseJSON `json:"-"` + WebRtcPlayback StreamLiveInputReplaceResponseWebRtcPlayback `json:"webRTCPlayback"` + JSON streamLiveInputReplaceResponseJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseJSON contains the JSON -// metadata for the struct [StreamLiveInputStreamLiveInputsNewALiveInputResponse] -type streamLiveInputStreamLiveInputsNewALiveInputResponseJSON struct { +// streamLiveInputReplaceResponseJSON contains the JSON metadata for the struct +// [StreamLiveInputReplaceResponse] +type streamLiveInputReplaceResponseJSON struct { Created apijson.Field DeleteRecordingAfterDays apijson.Field Meta apijson.Field @@ -670,14 +728,14 @@ type streamLiveInputStreamLiveInputsNewALiveInputResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording struct { +type StreamLiveInputReplaceResponseRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. @@ -685,7 +743,7 @@ type StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording struct { // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. - Mode StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingMode `json:"mode"` + Mode StreamLiveInputReplaceResponseRecordingMode `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. @@ -693,14 +751,13 @@ type StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording struct { // Determines the amount of time a live input configured in `automatic` mode should // wait before a recording transitions from live to on-demand. `0` is recommended // for most use cases and indicates the platform default should be used. - TimeoutSeconds int64 `json:"timeoutSeconds"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseRecordingJSON `json:"-"` + TimeoutSeconds int64 `json:"timeoutSeconds"` + JSON streamLiveInputReplaceResponseRecordingJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseRecordingJSON contains the -// JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording] -type streamLiveInputStreamLiveInputsNewALiveInputResponseRecordingJSON struct { +// streamLiveInputReplaceResponseRecordingJSON contains the JSON metadata for the +// struct [StreamLiveInputReplaceResponseRecording] +type streamLiveInputReplaceResponseRecordingJSON struct { AllowedOrigins apijson.Field Mode apijson.Field RequireSignedURLs apijson.Field @@ -709,81 +766,78 @@ type streamLiveInputStreamLiveInputsNewALiveInputResponseRecordingJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseRecording) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseRecording) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingMode string +type StreamLiveInputReplaceResponseRecordingMode string const ( - StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingModeOff StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingMode = "off" - StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingModeAutomatic StreamLiveInputStreamLiveInputsNewALiveInputResponseRecordingMode = "automatic" + StreamLiveInputReplaceResponseRecordingModeOff StreamLiveInputReplaceResponseRecordingMode = "off" + StreamLiveInputReplaceResponseRecordingModeAutomatic StreamLiveInputReplaceResponseRecordingMode = "automatic" ) // Details for streaming to an live input using RTMPS. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmps struct { +type StreamLiveInputReplaceResponseRtmps struct { // The secret key to use when streaming via RTMPS to a live input. StreamKey string `json:"streamKey"` // The RTMPS URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseRtmpsJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsJSON contains the JSON -// metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmps] -type streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsJSON struct { +// streamLiveInputReplaceResponseRtmpsJSON contains the JSON metadata for the +// struct [StreamLiveInputReplaceResponseRtmps] +type streamLiveInputReplaceResponseRtmpsJSON struct { StreamKey apijson.Field URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmps) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseRtmps) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from an live input using RTMPS. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlayback struct { +type StreamLiveInputReplaceResponseRtmpsPlayback struct { // The secret key to use for playback via RTMPS. StreamKey string `json:"streamKey"` // The URL used to play live video over RTMPS. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseRtmpsPlaybackJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlaybackJSON contains -// the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlayback] -type streamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlaybackJSON struct { +// streamLiveInputReplaceResponseRtmpsPlaybackJSON contains the JSON metadata for +// the struct [StreamLiveInputReplaceResponseRtmpsPlayback] +type streamLiveInputReplaceResponseRtmpsPlaybackJSON struct { StreamKey apijson.Field URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseRtmpsPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseRtmpsPlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for streaming to a live input using SRT. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseSrt struct { +type StreamLiveInputReplaceResponseSrt struct { // The secret key to use when streaming via SRT to a live input. Passphrase string `json:"passphrase"` // The identifier of the live input to use when streaming via SRT. StreamID string `json:"streamId"` // The SRT URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseSrtJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseSrtJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseSrtJSON contains the JSON -// metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseSrt] -type streamLiveInputStreamLiveInputsNewALiveInputResponseSrtJSON struct { +// streamLiveInputReplaceResponseSrtJSON contains the JSON metadata for the struct +// [StreamLiveInputReplaceResponseSrt] +type streamLiveInputReplaceResponseSrtJSON struct { Passphrase apijson.Field StreamID apijson.Field URL apijson.Field @@ -791,25 +845,24 @@ type streamLiveInputStreamLiveInputsNewALiveInputResponseSrtJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseSrt) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseSrt) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from an live input using SRT. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlayback struct { +type StreamLiveInputReplaceResponseSrtPlayback struct { // The secret key to use for playback via SRT. Passphrase string `json:"passphrase"` // The identifier of the live input to use for playback via SRT. StreamID string `json:"streamId"` // The URL used to play live video over SRT. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseSrtPlaybackJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlaybackJSON contains the -// JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlayback] -type streamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlaybackJSON struct { +// streamLiveInputReplaceResponseSrtPlaybackJSON contains the JSON metadata for the +// struct [StreamLiveInputReplaceResponseSrtPlayback] +type streamLiveInputReplaceResponseSrtPlaybackJSON struct { Passphrase apijson.Field StreamID apijson.Field URL apijson.Field @@ -817,124 +870,63 @@ type streamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlaybackJSON struct ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseSrtPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseSrtPlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The connection status of a live input. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus string +type StreamLiveInputReplaceResponseStatus string const ( - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusConnected StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "connected" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusReconnected StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "reconnected" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusReconnecting StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "reconnecting" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusClientDisconnect StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "client_disconnect" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusTTLExceeded StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "ttl_exceeded" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusFailedToConnect StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "failed_to_connect" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusFailedToReconnect StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "failed_to_reconnect" - StreamLiveInputStreamLiveInputsNewALiveInputResponseStatusNewConfigurationAccepted StreamLiveInputStreamLiveInputsNewALiveInputResponseStatus = "new_configuration_accepted" + StreamLiveInputReplaceResponseStatusConnected StreamLiveInputReplaceResponseStatus = "connected" + StreamLiveInputReplaceResponseStatusReconnected StreamLiveInputReplaceResponseStatus = "reconnected" + StreamLiveInputReplaceResponseStatusReconnecting StreamLiveInputReplaceResponseStatus = "reconnecting" + StreamLiveInputReplaceResponseStatusClientDisconnect StreamLiveInputReplaceResponseStatus = "client_disconnect" + StreamLiveInputReplaceResponseStatusTTLExceeded StreamLiveInputReplaceResponseStatus = "ttl_exceeded" + StreamLiveInputReplaceResponseStatusFailedToConnect StreamLiveInputReplaceResponseStatus = "failed_to_connect" + StreamLiveInputReplaceResponseStatusFailedToReconnect StreamLiveInputReplaceResponseStatus = "failed_to_reconnect" + StreamLiveInputReplaceResponseStatusNewConfigurationAccepted StreamLiveInputReplaceResponseStatus = "new_configuration_accepted" ) // Details for streaming to a live input using WebRTC. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtc struct { +type StreamLiveInputReplaceResponseWebRtc struct { // The WebRTC URL you provide to the broadcaster, which they stream live video to. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseWebRtcJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcJSON contains the JSON -// metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtc] -type streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcJSON struct { +// streamLiveInputReplaceResponseWebRtcJSON contains the JSON metadata for the +// struct [StreamLiveInputReplaceResponseWebRtc] +type streamLiveInputReplaceResponseWebRtcJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtc) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseWebRtc) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details for playback from a live input using WebRTC. -type StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlayback struct { +type StreamLiveInputReplaceResponseWebRtcPlayback struct { // The URL used to play live video over WebRTC. - URL string `json:"url"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlaybackJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputReplaceResponseWebRtcPlaybackJSON `json:"-"` } -// streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlaybackJSON contains -// the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlayback] -type streamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlaybackJSON struct { +// streamLiveInputReplaceResponseWebRtcPlaybackJSON contains the JSON metadata for +// the struct [StreamLiveInputReplaceResponseWebRtcPlayback] +type streamLiveInputReplaceResponseWebRtcPlaybackJSON struct { URL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseWebRtcPlayback) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseWebRtcPlayback) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputStreamLiveInputsListLiveInputsResponse struct { - LiveInputs []StreamLiveInputStreamLiveInputsListLiveInputsResponseLiveInput `json:"liveInputs"` - // The total number of remaining live inputs based on cursor position. - Range int64 `json:"range"` - // The total number of live inputs that match the provided filters. - Total int64 `json:"total"` - JSON streamLiveInputStreamLiveInputsListLiveInputsResponseJSON `json:"-"` -} - -// streamLiveInputStreamLiveInputsListLiveInputsResponseJSON contains the JSON -// metadata for the struct [StreamLiveInputStreamLiveInputsListLiveInputsResponse] -type streamLiveInputStreamLiveInputsListLiveInputsResponseJSON struct { - LiveInputs apijson.Field - Range apijson.Field - Total apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamLiveInputStreamLiveInputsListLiveInputsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamLiveInputStreamLiveInputsListLiveInputsResponseLiveInput struct { - // The date and time the live input was created. - Created time.Time `json:"created" format:"date-time"` - // Indicates the number of days after which the live inputs recordings will be - // deleted. When a stream completes and the recording is ready, the value is used - // to calculate a scheduled deletion date for that recording. Omit the field to - // indicate no change, or include with a `null` value to remove an existing - // scheduled deletion. - DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"` - // A user modifiable key-value store used to reference other systems of record for - // managing live inputs. - Meta interface{} `json:"meta"` - // The date and time the live input was last modified. - Modified time.Time `json:"modified" format:"date-time"` - // A unique identifier for a live input. - Uid string `json:"uid"` - JSON streamLiveInputStreamLiveInputsListLiveInputsResponseLiveInputJSON `json:"-"` -} - -// streamLiveInputStreamLiveInputsListLiveInputsResponseLiveInputJSON contains the -// JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsListLiveInputsResponseLiveInput] -type streamLiveInputStreamLiveInputsListLiveInputsResponseLiveInputJSON struct { - Created apijson.Field - DeleteRecordingAfterDays apijson.Field - Meta apijson.Field - Modified apijson.Field - Uid apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamLiveInputStreamLiveInputsListLiveInputsResponseLiveInput) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamLiveInputUpdateParams struct { +type StreamLiveInputNewParams struct { // Sets the creator ID asssociated with this live input. DefaultCreator param.Field[string] `json:"defaultCreator"` // Indicates the number of days after which the live inputs recordings will be @@ -949,17 +941,17 @@ type StreamLiveInputUpdateParams struct { // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. - Recording param.Field[StreamLiveInputUpdateParamsRecording] `json:"recording"` + Recording param.Field[StreamLiveInputNewParamsRecording] `json:"recording"` } -func (r StreamLiveInputUpdateParams) MarshalJSON() (data []byte, err error) { +func (r StreamLiveInputNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. -type StreamLiveInputUpdateParamsRecording struct { +type StreamLiveInputNewParamsRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. @@ -967,7 +959,7 @@ type StreamLiveInputUpdateParamsRecording struct { // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. - Mode param.Field[StreamLiveInputUpdateParamsRecordingMode] `json:"mode"` + Mode param.Field[StreamLiveInputNewParamsRecordingMode] `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. @@ -978,33 +970,33 @@ type StreamLiveInputUpdateParamsRecording struct { TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"` } -func (r StreamLiveInputUpdateParamsRecording) MarshalJSON() (data []byte, err error) { +func (r StreamLiveInputNewParamsRecording) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. -type StreamLiveInputUpdateParamsRecordingMode string +type StreamLiveInputNewParamsRecordingMode string const ( - StreamLiveInputUpdateParamsRecordingModeOff StreamLiveInputUpdateParamsRecordingMode = "off" - StreamLiveInputUpdateParamsRecordingModeAutomatic StreamLiveInputUpdateParamsRecordingMode = "automatic" + StreamLiveInputNewParamsRecordingModeOff StreamLiveInputNewParamsRecordingMode = "off" + StreamLiveInputNewParamsRecordingModeAutomatic StreamLiveInputNewParamsRecordingMode = "automatic" ) -type StreamLiveInputUpdateResponseEnvelope struct { - Errors []StreamLiveInputUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputUpdateResponseEnvelopeMessages `json:"messages,required"` +type StreamLiveInputNewResponseEnvelope struct { + Errors []StreamLiveInputNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputNewResponseEnvelopeMessages `json:"messages,required"` // Details about a live input. - Result StreamLiveInputUpdateResponse `json:"result,required"` + Result StreamLiveInputNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamLiveInputUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputUpdateResponseEnvelopeJSON `json:"-"` + Success StreamLiveInputNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputNewResponseEnvelopeJSON `json:"-"` } -// streamLiveInputUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [StreamLiveInputUpdateResponseEnvelope] -type streamLiveInputUpdateResponseEnvelopeJSON struct { +// streamLiveInputNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamLiveInputNewResponseEnvelope] +type streamLiveInputNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1013,53 +1005,137 @@ type streamLiveInputUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputUpdateResponseEnvelopeErrorsJSON `json:"-"` +type StreamLiveInputNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// streamLiveInputNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamLiveInputNewResponseEnvelopeErrors] +type streamLiveInputNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamLiveInputNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type StreamLiveInputNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// streamLiveInputNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamLiveInputNewResponseEnvelopeMessages] +type streamLiveInputNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamLiveInputNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type StreamLiveInputNewResponseEnvelopeSuccess bool + +const ( + StreamLiveInputNewResponseEnvelopeSuccessTrue StreamLiveInputNewResponseEnvelopeSuccess = true +) + +type StreamLiveInputListParams struct { + // Includes the total number of videos associated with the submitted query + // parameters. + IncludeCounts param.Field[bool] `query:"include_counts"` +} + +// URLQuery serializes [StreamLiveInputListParams]'s query parameters as +// `url.Values`. +func (r StreamLiveInputListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type StreamLiveInputListResponseEnvelope struct { + Errors []StreamLiveInputListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputListResponseEnvelopeMessages `json:"messages,required"` + Result StreamLiveInputListResponse `json:"result,required"` + // Whether the API call was successful + Success StreamLiveInputListResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputListResponseEnvelopeJSON `json:"-"` +} + +// streamLiveInputListResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamLiveInputListResponseEnvelope] +type streamLiveInputListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *StreamLiveInputListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type StreamLiveInputListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputListResponseEnvelopeErrorsJSON `json:"-"` } -// streamLiveInputUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [StreamLiveInputUpdateResponseEnvelopeErrors] -type streamLiveInputUpdateResponseEnvelopeErrorsJSON struct { +// streamLiveInputListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamLiveInputListResponseEnvelopeErrors] +type streamLiveInputListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputUpdateResponseEnvelopeMessagesJSON `json:"-"` +type StreamLiveInputListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputListResponseEnvelopeMessagesJSON `json:"-"` } -// streamLiveInputUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamLiveInputUpdateResponseEnvelopeMessages] -type streamLiveInputUpdateResponseEnvelopeMessagesJSON struct { +// streamLiveInputListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamLiveInputListResponseEnvelopeMessages] +type streamLiveInputListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamLiveInputUpdateResponseEnvelopeSuccess bool +type StreamLiveInputListResponseEnvelopeSuccess bool const ( - StreamLiveInputUpdateResponseEnvelopeSuccessTrue StreamLiveInputUpdateResponseEnvelopeSuccess = true + StreamLiveInputListResponseEnvelopeSuccessTrue StreamLiveInputListResponseEnvelopeSuccess = true ) type StreamLiveInputGetResponseEnvelope struct { @@ -1132,7 +1208,7 @@ const ( StreamLiveInputGetResponseEnvelopeSuccessTrue StreamLiveInputGetResponseEnvelopeSuccess = true ) -type StreamLiveInputStreamLiveInputsNewALiveInputParams struct { +type StreamLiveInputReplaceParams struct { // Sets the creator ID asssociated with this live input. DefaultCreator param.Field[string] `json:"defaultCreator"` // Indicates the number of days after which the live inputs recordings will be @@ -1147,17 +1223,17 @@ type StreamLiveInputStreamLiveInputsNewALiveInputParams struct { // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. - Recording param.Field[StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording] `json:"recording"` + Recording param.Field[StreamLiveInputReplaceParamsRecording] `json:"recording"` } -func (r StreamLiveInputStreamLiveInputsNewALiveInputParams) MarshalJSON() (data []byte, err error) { +func (r StreamLiveInputReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. -type StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording struct { +type StreamLiveInputReplaceParamsRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. @@ -1165,7 +1241,7 @@ type StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording struct { // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. - Mode param.Field[StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingMode] `json:"mode"` + Mode param.Field[StreamLiveInputReplaceParamsRecordingMode] `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. @@ -1176,121 +1252,33 @@ type StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording struct { TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"` } -func (r StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording) MarshalJSON() (data []byte, err error) { +func (r StreamLiveInputReplaceParamsRecording) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. -type StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingMode string +type StreamLiveInputReplaceParamsRecordingMode string const ( - StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingModeOff StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingMode = "off" - StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingModeAutomatic StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingMode = "automatic" + StreamLiveInputReplaceParamsRecordingModeOff StreamLiveInputReplaceParamsRecordingMode = "off" + StreamLiveInputReplaceParamsRecordingModeAutomatic StreamLiveInputReplaceParamsRecordingMode = "automatic" ) -type StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelope struct { - Errors []StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessages `json:"messages,required"` +type StreamLiveInputReplaceResponseEnvelope struct { + Errors []StreamLiveInputReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputReplaceResponseEnvelopeMessages `json:"messages,required"` // Details about a live input. - Result StreamLiveInputStreamLiveInputsNewALiveInputResponse `json:"result,required"` - // Whether the API call was successful - Success StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeJSON `json:"-"` -} - -// streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelope] -type streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrorsJSON `json:"-"` -} - -// streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrors] -type streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessagesJSON `json:"-"` -} - -// streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessages] -type streamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeSuccess bool - -const ( - StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeSuccessTrue StreamLiveInputStreamLiveInputsNewALiveInputResponseEnvelopeSuccess = true -) - -type StreamLiveInputStreamLiveInputsListLiveInputsParams struct { - // Includes the total number of videos associated with the submitted query - // parameters. - IncludeCounts param.Field[bool] `query:"include_counts"` -} - -// URLQuery serializes [StreamLiveInputStreamLiveInputsListLiveInputsParams]'s -// query parameters as `url.Values`. -func (r StreamLiveInputStreamLiveInputsListLiveInputsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelope struct { - Errors []StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessages `json:"messages,required"` - Result StreamLiveInputStreamLiveInputsListLiveInputsResponse `json:"result,required"` + Result StreamLiveInputReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeJSON `json:"-"` + Success StreamLiveInputReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputReplaceResponseEnvelopeJSON `json:"-"` } -// streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelope] -type streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeJSON struct { +// streamLiveInputReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamLiveInputReplaceResponseEnvelope] +type streamLiveInputReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1299,53 +1287,51 @@ type streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrorsJSON `json:"-"` +type StreamLiveInputReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrors] -type streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrorsJSON struct { +// streamLiveInputReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamLiveInputReplaceResponseEnvelopeErrors] +type streamLiveInputReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessagesJSON `json:"-"` +type StreamLiveInputReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessages] -type streamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessagesJSON struct { +// streamLiveInputReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [StreamLiveInputReplaceResponseEnvelopeMessages] +type streamLiveInputReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeSuccess bool +type StreamLiveInputReplaceResponseEnvelopeSuccess bool const ( - StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeSuccessTrue StreamLiveInputStreamLiveInputsListLiveInputsResponseEnvelopeSuccess = true + StreamLiveInputReplaceResponseEnvelopeSuccessTrue StreamLiveInputReplaceResponseEnvelopeSuccess = true ) diff --git a/streamliveinput_test.go b/streamliveinput_test.go index 43fe887f4fa..d3487662f72 100644 --- a/streamliveinput_test.go +++ b/streamliveinput_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamLiveInputUpdateWithOptionalParams(t *testing.T) { +func TestStreamLiveInputNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,19 +29,18 @@ func TestStreamLiveInputUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.Update( + _, err := client.Stream.LiveInputs.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "66be4bf738797e01e1fca35a7bdecdcd", - cloudflare.StreamLiveInputUpdateParams{ + cloudflare.StreamLiveInputNewParams{ DefaultCreator: cloudflare.F("string"), DeleteRecordingAfterDays: cloudflare.F(45.000000), Meta: cloudflare.F[any](map[string]interface{}{ "name": "test stream 1", }), - Recording: cloudflare.F(cloudflare.StreamLiveInputUpdateParamsRecording{ + Recording: cloudflare.F(cloudflare.StreamLiveInputNewParamsRecording{ AllowedOrigins: cloudflare.F([]string{"example.com"}), - Mode: cloudflare.F(cloudflare.StreamLiveInputUpdateParamsRecordingModeOff), + Mode: cloudflare.F(cloudflare.StreamLiveInputNewParamsRecordingModeOff), RequireSignedURLs: cloudflare.F(false), TimeoutSeconds: cloudflare.F(int64(0)), }), @@ -56,7 +55,7 @@ func TestStreamLiveInputUpdateWithOptionalParams(t *testing.T) { } } -func TestStreamLiveInputDelete(t *testing.T) { +func TestStreamLiveInputListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -72,10 +71,12 @@ func TestStreamLiveInputDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Stream.LiveInputs.Delete( + _, err := client.Stream.LiveInputs.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "66be4bf738797e01e1fca35a7bdecdcd", + cloudflare.StreamLiveInputListParams{ + IncludeCounts: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error @@ -86,7 +87,7 @@ func TestStreamLiveInputDelete(t *testing.T) { } } -func TestStreamLiveInputGet(t *testing.T) { +func TestStreamLiveInputDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -102,7 +103,7 @@ func TestStreamLiveInputGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.Get( + err := client.Stream.LiveInputs.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "66be4bf738797e01e1fca35a7bdecdcd", @@ -116,7 +117,7 @@ func TestStreamLiveInputGet(t *testing.T) { } } -func TestStreamLiveInputStreamLiveInputsNewALiveInputWithOptionalParams(t *testing.T) { +func TestStreamLiveInputGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -132,22 +133,10 @@ func TestStreamLiveInputStreamLiveInputsNewALiveInputWithOptionalParams(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.StreamLiveInputsNewALiveInput( + _, err := client.Stream.LiveInputs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputParams{ - DefaultCreator: cloudflare.F("string"), - DeleteRecordingAfterDays: cloudflare.F(45.000000), - Meta: cloudflare.F[any](map[string]interface{}{ - "name": "test stream 1", - }), - Recording: cloudflare.F(cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputParamsRecording{ - AllowedOrigins: cloudflare.F([]string{"example.com"}), - Mode: cloudflare.F(cloudflare.StreamLiveInputStreamLiveInputsNewALiveInputParamsRecordingModeOff), - RequireSignedURLs: cloudflare.F(false), - TimeoutSeconds: cloudflare.F(int64(0)), - }), - }, + "66be4bf738797e01e1fca35a7bdecdcd", ) if err != nil { var apierr *cloudflare.Error @@ -158,7 +147,7 @@ func TestStreamLiveInputStreamLiveInputsNewALiveInputWithOptionalParams(t *testi } } -func TestStreamLiveInputStreamLiveInputsListLiveInputsWithOptionalParams(t *testing.T) { +func TestStreamLiveInputReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -174,11 +163,22 @@ func TestStreamLiveInputStreamLiveInputsListLiveInputsWithOptionalParams(t *test option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.StreamLiveInputsListLiveInputs( + _, err := client.Stream.LiveInputs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamLiveInputStreamLiveInputsListLiveInputsParams{ - IncludeCounts: cloudflare.F(true), + "66be4bf738797e01e1fca35a7bdecdcd", + cloudflare.StreamLiveInputReplaceParams{ + DefaultCreator: cloudflare.F("string"), + DeleteRecordingAfterDays: cloudflare.F(45.000000), + Meta: cloudflare.F[any](map[string]interface{}{ + "name": "test stream 1", + }), + Recording: cloudflare.F(cloudflare.StreamLiveInputReplaceParamsRecording{ + AllowedOrigins: cloudflare.F([]string{"example.com"}), + Mode: cloudflare.F(cloudflare.StreamLiveInputReplaceParamsRecordingModeOff), + RequireSignedURLs: cloudflare.F(false), + TimeoutSeconds: cloudflare.F(int64(0)), + }), }, ) if err != nil { diff --git a/streamliveinputoutput.go b/streamliveinputoutput.go index 395ea8e3877..07cd5750078 100644 --- a/streamliveinputoutput.go +++ b/streamliveinputoutput.go @@ -31,12 +31,14 @@ func NewStreamLiveInputOutputService(opts ...option.RequestOption) (r *StreamLiv return } -// Updates the state of an output. -func (r *StreamLiveInputOutputService) Update(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, body StreamLiveInputOutputUpdateParams, opts ...option.RequestOption) (res *StreamLiveInputOutputUpdateResponse, err error) { +// Creates a new output that can be used to simulcast or restream live video to +// other RTMP or SRT destinations. Outputs are always linked to a specific live +// input — one live input can have many outputs. +func (r *StreamLiveInputOutputService) New(ctx context.Context, accountID string, liveInputIdentifier string, body StreamLiveInputOutputNewParams, opts ...option.RequestOption) (res *StreamLiveInputOutputNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamLiveInputOutputUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", accountID, liveInputIdentifier, outputIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env StreamLiveInputOutputNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", accountID, liveInputIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,23 +46,12 @@ func (r *StreamLiveInputOutputService) Update(ctx context.Context, accountID str return } -// Deletes an output and removes it from the associated live input. -func (r *StreamLiveInputOutputService) Delete(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, opts ...option.RequestOption) (err error) { - opts = append(r.Options[:], opts...) - opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", accountID, liveInputIdentifier, outputIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) - return -} - -// Creates a new output that can be used to simulcast or restream live video to -// other RTMP or SRT destinations. Outputs are always linked to a specific live -// input — one live input can have many outputs. -func (r *StreamLiveInputOutputService) StreamLiveInputsNewANewOutputConnectedToALiveInput(ctx context.Context, accountID string, liveInputIdentifier string, body StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputParams, opts ...option.RequestOption) (res *StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse, err error) { +// Retrieves all outputs associated with a specified live input. +func (r *StreamLiveInputOutputService) List(ctx context.Context, accountID string, liveInputIdentifier string, opts ...option.RequestOption) (res *[]StreamLiveInputOutputListResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelope + var env StreamLiveInputOutputListResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", accountID, liveInputIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -68,12 +59,21 @@ func (r *StreamLiveInputOutputService) StreamLiveInputsNewANewOutputConnectedToA return } -// Retrieves all outputs associated with a specified live input. -func (r *StreamLiveInputOutputService) StreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInput(ctx context.Context, accountID string, liveInputIdentifier string, opts ...option.RequestOption) (res *[]StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse, err error) { +// Deletes an output and removes it from the associated live input. +func (r *StreamLiveInputOutputService) Delete(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) - var env StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", accountID, liveInputIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", accountID, liveInputIdentifier, outputIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) + return +} + +// Updates the state of an output. +func (r *StreamLiveInputOutputService) Replace(ctx context.Context, accountID string, liveInputIdentifier string, outputIdentifier string, body StreamLiveInputOutputReplaceParams, opts ...option.RequestOption) (res *StreamLiveInputOutputReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env StreamLiveInputOutputReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", accountID, liveInputIdentifier, outputIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -81,7 +81,7 @@ func (r *StreamLiveInputOutputService) StreamLiveInputsListAllOutputsAssociatedW return } -type StreamLiveInputOutputUpdateResponse struct { +type StreamLiveInputOutputNewResponse struct { // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely @@ -93,13 +93,13 @@ type StreamLiveInputOutputUpdateResponse struct { // A unique identifier for the output. Uid string `json:"uid"` // The URL an output uses to restream. - URL string `json:"url"` - JSON streamLiveInputOutputUpdateResponseJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputOutputNewResponseJSON `json:"-"` } -// streamLiveInputOutputUpdateResponseJSON contains the JSON metadata for the -// struct [StreamLiveInputOutputUpdateResponse] -type streamLiveInputOutputUpdateResponseJSON struct { +// streamLiveInputOutputNewResponseJSON contains the JSON metadata for the struct +// [StreamLiveInputOutputNewResponse] +type streamLiveInputOutputNewResponseJSON struct { Enabled apijson.Field StreamKey apijson.Field Uid apijson.Field @@ -108,11 +108,11 @@ type streamLiveInputOutputUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse struct { +type StreamLiveInputOutputListResponse struct { // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely @@ -124,14 +124,13 @@ type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResp // A unique identifier for the output. Uid string `json:"uid"` // The URL an output uses to restream. - URL string `json:"url"` - JSON streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputOutputListResponseJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse] -type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseJSON struct { +// streamLiveInputOutputListResponseJSON contains the JSON metadata for the struct +// [StreamLiveInputOutputListResponse] +type streamLiveInputOutputListResponseJSON struct { Enabled apijson.Field StreamKey apijson.Field Uid apijson.Field @@ -140,11 +139,11 @@ type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResp ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse struct { +type StreamLiveInputOutputReplaceResponse struct { // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely @@ -156,14 +155,13 @@ type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecified // A unique identifier for the output. Uid string `json:"uid"` // The URL an output uses to restream. - URL string `json:"url"` - JSON streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseJSON `json:"-"` + URL string `json:"url"` + JSON streamLiveInputOutputReplaceResponseJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse] -type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseJSON struct { +// streamLiveInputOutputReplaceResponseJSON contains the JSON metadata for the +// struct [StreamLiveInputOutputReplaceResponse] +type streamLiveInputOutputReplaceResponseJSON struct { Enabled apijson.Field StreamKey apijson.Field Uid apijson.Field @@ -172,35 +170,39 @@ type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecified ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputUpdateParams struct { +type StreamLiveInputOutputNewParams struct { + // The streamKey used to authenticate against an output's target. + StreamKey param.Field[string] `json:"streamKey,required"` + // The URL an output uses to restream. + URL param.Field[string] `json:"url,required"` // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely // when you start and stop simulcasting to specific destinations like YouTube and // Twitch. - Enabled param.Field[bool] `json:"enabled,required"` + Enabled param.Field[bool] `json:"enabled"` } -func (r StreamLiveInputOutputUpdateParams) MarshalJSON() (data []byte, err error) { +func (r StreamLiveInputOutputNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type StreamLiveInputOutputUpdateResponseEnvelope struct { - Errors []StreamLiveInputOutputUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputOutputUpdateResponseEnvelopeMessages `json:"messages,required"` - Result StreamLiveInputOutputUpdateResponse `json:"result,required"` +type StreamLiveInputOutputNewResponseEnvelope struct { + Errors []StreamLiveInputOutputNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputOutputNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamLiveInputOutputNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamLiveInputOutputUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputOutputUpdateResponseEnvelopeJSON `json:"-"` + Success StreamLiveInputOutputNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputOutputNewResponseEnvelopeJSON `json:"-"` } -// streamLiveInputOutputUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [StreamLiveInputOutputUpdateResponseEnvelope] -type streamLiveInputOutputUpdateResponseEnvelopeJSON struct { +// streamLiveInputOutputNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamLiveInputOutputNewResponseEnvelope] +type streamLiveInputOutputNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -209,85 +211,67 @@ type streamLiveInputOutputUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputUpdateResponseEnvelopeErrorsJSON `json:"-"` +type StreamLiveInputOutputNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamLiveInputOutputUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [StreamLiveInputOutputUpdateResponseEnvelopeErrors] -type streamLiveInputOutputUpdateResponseEnvelopeErrorsJSON struct { +// streamLiveInputOutputNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [StreamLiveInputOutputNewResponseEnvelopeErrors] +type streamLiveInputOutputNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputUpdateResponseEnvelopeMessagesJSON `json:"-"` +type StreamLiveInputOutputNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamLiveInputOutputUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [StreamLiveInputOutputUpdateResponseEnvelopeMessages] -type streamLiveInputOutputUpdateResponseEnvelopeMessagesJSON struct { +// streamLiveInputOutputNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [StreamLiveInputOutputNewResponseEnvelopeMessages] +type streamLiveInputOutputNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamLiveInputOutputUpdateResponseEnvelopeSuccess bool +type StreamLiveInputOutputNewResponseEnvelopeSuccess bool const ( - StreamLiveInputOutputUpdateResponseEnvelopeSuccessTrue StreamLiveInputOutputUpdateResponseEnvelopeSuccess = true + StreamLiveInputOutputNewResponseEnvelopeSuccessTrue StreamLiveInputOutputNewResponseEnvelopeSuccess = true ) -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputParams struct { - // The streamKey used to authenticate against an output's target. - StreamKey param.Field[string] `json:"streamKey,required"` - // The URL an output uses to restream. - URL param.Field[string] `json:"url,required"` - // When enabled, live video streamed to the associated live input will be sent to - // the output URL. When disabled, live video will not be sent to the output URL, - // even when streaming to the associated live input. Use this to control precisely - // when you start and stop simulcasting to specific destinations like YouTube and - // Twitch. - Enabled param.Field[bool] `json:"enabled"` -} - -func (r StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelope struct { - Errors []StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessages `json:"messages,required"` - Result StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponse `json:"result,required"` +type StreamLiveInputOutputListResponseEnvelope struct { + Errors []StreamLiveInputOutputListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputOutputListResponseEnvelopeMessages `json:"messages,required"` + Result []StreamLiveInputOutputListResponse `json:"result,required"` // Whether the API call was successful - Success StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeJSON `json:"-"` + Success StreamLiveInputOutputListResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputOutputListResponseEnvelopeJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelope] -type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeJSON struct { +// streamLiveInputOutputListResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamLiveInputOutputListResponseEnvelope] +type streamLiveInputOutputListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -296,70 +280,80 @@ type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResp ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrorsJSON `json:"-"` +type StreamLiveInputOutputListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputListResponseEnvelopeErrorsJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrors] -type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrorsJSON struct { +// streamLiveInputOutputListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [StreamLiveInputOutputListResponseEnvelopeErrors] +type streamLiveInputOutputListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessagesJSON `json:"-"` +type StreamLiveInputOutputListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputListResponseEnvelopeMessagesJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessages] -type streamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessagesJSON struct { +// streamLiveInputOutputListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [StreamLiveInputOutputListResponseEnvelopeMessages] +type streamLiveInputOutputListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeSuccess bool +type StreamLiveInputOutputListResponseEnvelopeSuccess bool const ( - StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeSuccessTrue StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputResponseEnvelopeSuccess = true + StreamLiveInputOutputListResponseEnvelopeSuccessTrue StreamLiveInputOutputListResponseEnvelopeSuccess = true ) -type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelope struct { - Errors []StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessages `json:"messages,required"` - Result []StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponse `json:"result,required"` +type StreamLiveInputOutputReplaceParams struct { + // When enabled, live video streamed to the associated live input will be sent to + // the output URL. When disabled, live video will not be sent to the output URL, + // even when streaming to the associated live input. Use this to control precisely + // when you start and stop simulcasting to specific destinations like YouTube and + // Twitch. + Enabled param.Field[bool] `json:"enabled,required"` +} + +func (r StreamLiveInputOutputReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StreamLiveInputOutputReplaceResponseEnvelope struct { + Errors []StreamLiveInputOutputReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamLiveInputOutputReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StreamLiveInputOutputReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeSuccess `json:"success,required"` - JSON streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeJSON `json:"-"` + Success StreamLiveInputOutputReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON streamLiveInputOutputReplaceResponseEnvelopeJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelope] -type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeJSON struct { +// streamLiveInputOutputReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [StreamLiveInputOutputReplaceResponseEnvelope] +type streamLiveInputOutputReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -368,53 +362,51 @@ type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecified ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrorsJSON `json:"-"` +type StreamLiveInputOutputReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrors] -type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrorsJSON struct { +// streamLiveInputOutputReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [StreamLiveInputOutputReplaceResponseEnvelopeErrors] +type streamLiveInputOutputReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessagesJSON `json:"-"` +type StreamLiveInputOutputReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamLiveInputOutputReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessages] -type streamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessagesJSON struct { +// streamLiveInputOutputReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [StreamLiveInputOutputReplaceResponseEnvelopeMessages] +type streamLiveInputOutputReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamLiveInputOutputReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeSuccess bool +type StreamLiveInputOutputReplaceResponseEnvelopeSuccess bool const ( - StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeSuccessTrue StreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInputResponseEnvelopeSuccess = true + StreamLiveInputOutputReplaceResponseEnvelopeSuccessTrue StreamLiveInputOutputReplaceResponseEnvelopeSuccess = true ) diff --git a/streamliveinputoutput_test.go b/streamliveinputoutput_test.go index 5cce23e7377..d2fef1d507c 100644 --- a/streamliveinputoutput_test.go +++ b/streamliveinputoutput_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamLiveInputOutputUpdate(t *testing.T) { +func TestStreamLiveInputOutputNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,14 @@ func TestStreamLiveInputOutputUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.Outputs.Update( + _, err := client.Stream.LiveInputs.Outputs.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "66be4bf738797e01e1fca35a7bdecdcd", - "baea4d9c515887b80289d5c33cf01145", - cloudflare.StreamLiveInputOutputUpdateParams{ - Enabled: cloudflare.F(true), + cloudflare.StreamLiveInputOutputNewParams{ + StreamKey: cloudflare.F("uzya-f19y-g2g9-a2ee-51j2"), + URL: cloudflare.F("rtmp://a.rtmp.youtube.com/live2"), + Enabled: cloudflare.F(true), }, ) if err != nil { @@ -47,7 +48,7 @@ func TestStreamLiveInputOutputUpdate(t *testing.T) { } } -func TestStreamLiveInputOutputDelete(t *testing.T) { +func TestStreamLiveInputOutputList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +64,10 @@ func TestStreamLiveInputOutputDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Stream.LiveInputs.Outputs.Delete( + _, err := client.Stream.LiveInputs.Outputs.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "66be4bf738797e01e1fca35a7bdecdcd", - "baea4d9c515887b80289d5c33cf01145", ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +78,7 @@ func TestStreamLiveInputOutputDelete(t *testing.T) { } } -func TestStreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputWithOptionalParams(t *testing.T) { +func TestStreamLiveInputOutputDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,15 +94,11 @@ func TestStreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInput option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.Outputs.StreamLiveInputsNewANewOutputConnectedToALiveInput( + err := client.Stream.LiveInputs.Outputs.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "66be4bf738797e01e1fca35a7bdecdcd", - cloudflare.StreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInputParams{ - StreamKey: cloudflare.F("uzya-f19y-g2g9-a2ee-51j2"), - URL: cloudflare.F("rtmp://a.rtmp.youtube.com/live2"), - Enabled: cloudflare.F(true), - }, + "baea4d9c515887b80289d5c33cf01145", ) if err != nil { var apierr *cloudflare.Error @@ -113,7 +109,7 @@ func TestStreamLiveInputOutputStreamLiveInputsNewANewOutputConnectedToALiveInput } } -func TestStreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInput(t *testing.T) { +func TestStreamLiveInputOutputReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -129,10 +125,14 @@ func TestStreamLiveInputOutputStreamLiveInputsListAllOutputsAssociatedWithASpeci option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.LiveInputs.Outputs.StreamLiveInputsListAllOutputsAssociatedWithASpecifiedLiveInput( + _, err := client.Stream.LiveInputs.Outputs.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "66be4bf738797e01e1fca35a7bdecdcd", + "baea4d9c515887b80289d5c33cf01145", + cloudflare.StreamLiveInputOutputReplaceParams{ + Enabled: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/streamtoken.go b/streamtoken.go index f47ed509f12..b5ed57f766b 100644 --- a/streamtoken.go +++ b/streamtoken.go @@ -33,9 +33,9 @@ func NewStreamTokenService(opts ...option.RequestOption) (r *StreamTokenService) // Creates a signed URL token for a video. If a body is not provided in the // request, a token is created with default values. -func (r *StreamTokenService) StreamVideosNewSignedURLTokensForVideos(ctx context.Context, accountID string, identifier string, body StreamTokenStreamVideosNewSignedURLTokensForVideosParams, opts ...option.RequestOption) (res *StreamTokenStreamVideosNewSignedURLTokensForVideosResponse, err error) { +func (r *StreamTokenService) New(ctx context.Context, accountID string, identifier string, body StreamTokenNewParams, opts ...option.RequestOption) (res *StreamTokenNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelope + var env StreamTokenNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/%s/token", accountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -45,26 +45,25 @@ func (r *StreamTokenService) StreamVideosNewSignedURLTokensForVideos(ctx context return } -type StreamTokenStreamVideosNewSignedURLTokensForVideosResponse struct { +type StreamTokenNewResponse struct { // The signed token used with the signed URLs feature. - Token string `json:"token"` - JSON streamTokenStreamVideosNewSignedURLTokensForVideosResponseJSON `json:"-"` + Token string `json:"token"` + JSON streamTokenNewResponseJSON `json:"-"` } -// streamTokenStreamVideosNewSignedURLTokensForVideosResponseJSON contains the JSON -// metadata for the struct -// [StreamTokenStreamVideosNewSignedURLTokensForVideosResponse] -type streamTokenStreamVideosNewSignedURLTokensForVideosResponseJSON struct { +// streamTokenNewResponseJSON contains the JSON metadata for the struct +// [StreamTokenNewResponse] +type streamTokenNewResponseJSON struct { Token apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamTokenStreamVideosNewSignedURLTokensForVideosResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamTokenNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamTokenStreamVideosNewSignedURLTokensForVideosParams struct { +type StreamTokenNewParams struct { // The optional ID of a Stream signing key. If present, the `pem` field is also // required. ID param.Field[string] `json:"id"` @@ -72,7 +71,7 @@ type StreamTokenStreamVideosNewSignedURLTokensForVideosParams struct { // or allowed based on an IP, IP range, or by country. Access rules are evaluated // from first to last. If a rule matches, the associated action is applied and no // further rules are evaluated. - AccessRules param.Field[[]StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRule] `json:"accessRules"` + AccessRules param.Field[[]StreamTokenNewParamsAccessRule] `json:"accessRules"` // The optional boolean value that enables using signed tokens to access MP4 // download links for a video. Downloadable param.Field[bool] `json:"downloadable"` @@ -88,7 +87,7 @@ type StreamTokenStreamVideosNewSignedURLTokensForVideosParams struct { Pem param.Field[string] `json:"pem"` } -func (r StreamTokenStreamVideosNewSignedURLTokensForVideosParams) MarshalJSON() (data []byte, err error) { +func (r StreamTokenNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -96,10 +95,10 @@ func (r StreamTokenStreamVideosNewSignedURLTokensForVideosParams) MarshalJSON() // alone. Access rules primarily make tokens conditionally valid based on user // information. Access Rules are specified on token payloads as the `accessRules` // property containing an array of Rule objects. -type StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRule struct { +type StreamTokenNewParamsAccessRule struct { // The action to take when a request matches a rule. If the action is `block`, the // signed token blocks views for viewers matching the rule. - Action param.Field[StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesAction] `json:"action"` + Action param.Field[StreamTokenNewParamsAccessRulesAction] `json:"action"` // An array of 2-letter country codes in ISO 3166-1 Alpha-2 format used to match // requests. Country param.Field[[]string] `json:"country"` @@ -108,46 +107,45 @@ type StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRule struct { // Lists available rule types to match for requests. An `any` type matches all // requests and can be used as a wildcard to apply default actions after other // rules. - Type param.Field[StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesType] `json:"type"` + Type param.Field[StreamTokenNewParamsAccessRulesType] `json:"type"` } -func (r StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRule) MarshalJSON() (data []byte, err error) { +func (r StreamTokenNewParamsAccessRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to take when a request matches a rule. If the action is `block`, the // signed token blocks views for viewers matching the rule. -type StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesAction string +type StreamTokenNewParamsAccessRulesAction string const ( - StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesActionAllow StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesAction = "allow" - StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesActionBlock StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesAction = "block" + StreamTokenNewParamsAccessRulesActionAllow StreamTokenNewParamsAccessRulesAction = "allow" + StreamTokenNewParamsAccessRulesActionBlock StreamTokenNewParamsAccessRulesAction = "block" ) // Lists available rule types to match for requests. An `any` type matches all // requests and can be used as a wildcard to apply default actions after other // rules. -type StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesType string +type StreamTokenNewParamsAccessRulesType string const ( - StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeAny StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesType = "any" - StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeIPSrc StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesType = "ip.src" - StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeIPGeoipCountry StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesType = "ip.geoip.country" + StreamTokenNewParamsAccessRulesTypeAny StreamTokenNewParamsAccessRulesType = "any" + StreamTokenNewParamsAccessRulesTypeIPSrc StreamTokenNewParamsAccessRulesType = "ip.src" + StreamTokenNewParamsAccessRulesTypeIPGeoipCountry StreamTokenNewParamsAccessRulesType = "ip.geoip.country" ) -type StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelope struct { - Errors []StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessages `json:"messages,required"` - Result StreamTokenStreamVideosNewSignedURLTokensForVideosResponse `json:"result,required"` +type StreamTokenNewResponseEnvelope struct { + Errors []StreamTokenNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamTokenNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamTokenNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeSuccess `json:"success,required"` - JSON streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeJSON `json:"-"` + Success StreamTokenNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamTokenNewResponseEnvelopeJSON `json:"-"` } -// streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelope] -type streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeJSON struct { +// streamTokenNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamTokenNewResponseEnvelope] +type streamTokenNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -156,53 +154,51 @@ type streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeJSON stru ExtraFields map[string]apijson.Field } -func (r *StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamTokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrorsJSON `json:"-"` +type StreamTokenNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamTokenNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrors] -type streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrorsJSON struct { +// streamTokenNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamTokenNewResponseEnvelopeErrors] +type streamTokenNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamTokenNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessagesJSON `json:"-"` +type StreamTokenNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamTokenNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessages] -type streamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessagesJSON struct { +// streamTokenNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamTokenNewResponseEnvelopeMessages] +type streamTokenNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamTokenNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeSuccess bool +type StreamTokenNewResponseEnvelopeSuccess bool const ( - StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeSuccessTrue StreamTokenStreamVideosNewSignedURLTokensForVideosResponseEnvelopeSuccess = true + StreamTokenNewResponseEnvelopeSuccessTrue StreamTokenNewResponseEnvelopeSuccess = true ) diff --git a/streamtoken_test.go b/streamtoken_test.go index ff51cb1bd8a..81fe5310f6a 100644 --- a/streamtoken_test.go +++ b/streamtoken_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamTokenStreamVideosNewSignedURLTokensForVideosWithOptionalParams(t *testing.T) { +func TestStreamTokenNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,27 +29,27 @@ func TestStreamTokenStreamVideosNewSignedURLTokensForVideosWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Tokens.StreamVideosNewSignedURLTokensForVideos( + _, err := client.Stream.Tokens.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", - cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParams{ + cloudflare.StreamTokenNewParams{ ID: cloudflare.F("ab0d4ef71g4425f8dcba9041231813000"), - AccessRules: cloudflare.F([]cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRule{{ - Action: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesActionBlock), + AccessRules: cloudflare.F([]cloudflare.StreamTokenNewParamsAccessRule{{ + Action: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesActionBlock), Country: cloudflare.F([]string{"US", "MX"}), IP: cloudflare.F([]string{"string", "string", "string"}), - Type: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeIPGeoipCountry), + Type: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesTypeIPGeoipCountry), }, { - Action: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesActionAllow), + Action: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesActionAllow), Country: cloudflare.F([]string{"string", "string", "string"}), IP: cloudflare.F([]string{"93.184.216.0/24", "2400:cb00::/32"}), - Type: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeIPSrc), + Type: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesTypeIPSrc), }, { - Action: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesActionBlock), + Action: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesActionBlock), Country: cloudflare.F([]string{"string", "string", "string"}), IP: cloudflare.F([]string{"string", "string", "string"}), - Type: cloudflare.F(cloudflare.StreamTokenStreamVideosNewSignedURLTokensForVideosParamsAccessRulesTypeAny), + Type: cloudflare.F(cloudflare.StreamTokenNewParamsAccessRulesTypeAny), }}), Downloadable: cloudflare.F(true), Exp: cloudflare.F(int64(0)), diff --git a/streamwatermark.go b/streamwatermark.go index 86fcf2b9bd1..bc3da64ff44 100644 --- a/streamwatermark.go +++ b/streamwatermark.go @@ -35,12 +35,13 @@ func NewStreamWatermarkService(opts ...option.RequestOption) (r *StreamWatermark return } -// Deletes a watermark profile. -func (r *StreamWatermarkService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamWatermarkDeleteResponse, err error) { +// Creates watermark profiles using a single `HTTP POST multipart/form-data` +// request. +func (r *StreamWatermarkService) New(ctx context.Context, accountID string, body StreamWatermarkNewParams, opts ...option.RequestOption) (res *StreamWatermarkNewResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWatermarkDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", accountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env StreamWatermarkNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/watermarks", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -48,11 +49,11 @@ func (r *StreamWatermarkService) Delete(ctx context.Context, accountID string, i return } -// Retrieves details for a single watermark profile. -func (r *StreamWatermarkService) Get(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamWatermarkGetResponse, err error) { +// Lists all watermark profiles for an account. +func (r *StreamWatermarkService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]StreamWatermarkListResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWatermarkGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", accountID, identifier) + var env StreamWatermarkListResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/watermarks", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -61,13 +62,12 @@ func (r *StreamWatermarkService) Get(ctx context.Context, accountID string, iden return } -// Creates watermark profiles using a single `HTTP POST multipart/form-data` -// request. -func (r *StreamWatermarkService) StreamWatermarkProfileNewWatermarkProfilesViaBasicUpload(ctx context.Context, accountID string, body StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadParams, opts ...option.RequestOption) (res *StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse, err error) { +// Deletes a watermark profile. +func (r *StreamWatermarkService) Delete(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamWatermarkDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/watermarks", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env StreamWatermarkDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", accountID, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -75,11 +75,11 @@ func (r *StreamWatermarkService) StreamWatermarkProfileNewWatermarkProfilesViaBa return } -// Lists all watermark profiles for an account. -func (r *StreamWatermarkService) StreamWatermarkProfileListWatermarkProfiles(ctx context.Context, accountID string, opts ...option.RequestOption) (res *[]StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse, err error) { +// Retrieves details for a single watermark profile. +func (r *StreamWatermarkService) Get(ctx context.Context, accountID string, identifier string, opts ...option.RequestOption) (res *StreamWatermarkGetResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/watermarks", accountID) + var env StreamWatermarkGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", accountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -88,31 +88,14 @@ func (r *StreamWatermarkService) StreamWatermarkProfileListWatermarkProfiles(ctx return } -// Union satisfied by [StreamWatermarkDeleteResponseUnknown] or -// [shared.UnionString]. -type StreamWatermarkDeleteResponse interface { - ImplementsStreamWatermarkDeleteResponse() +// Union satisfied by [StreamWatermarkNewResponseUnknown] or [shared.UnionString]. +type StreamWatermarkNewResponse interface { + ImplementsStreamWatermarkNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamWatermarkDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -// Union satisfied by [StreamWatermarkGetResponseUnknown] or [shared.UnionString]. -type StreamWatermarkGetResponse interface { - ImplementsStreamWatermarkGetResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*StreamWatermarkGetResponse)(nil)).Elem(), + reflect.TypeOf((*StreamWatermarkNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -121,25 +104,7 @@ func init() { ) } -// Union satisfied by -// [StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseUnknown] -// or [shared.UnionString]. -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse interface { - ImplementsStreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse struct { +type StreamWatermarkListResponse struct { // The date and a time a watermark profile was created. Created time.Time `json:"created" format:"date-time"` // The source URL for a downloaded image. If the watermark profile was created via @@ -171,14 +136,13 @@ type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse struct { // The unique identifier for a watermark profile. Uid string `json:"uid"` // The width of the image in pixels. - Width int64 `json:"width"` - JSON streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseJSON `json:"-"` + Width int64 `json:"width"` + JSON streamWatermarkListResponseJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseJSON contains -// the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse] -type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseJSON struct { +// streamWatermarkListResponseJSON contains the JSON metadata for the struct +// [StreamWatermarkListResponse] +type streamWatermarkListResponseJSON struct { Created apijson.Field DownloadedFrom apijson.Field Height apijson.Field @@ -194,22 +158,83 @@ type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseJSON stru ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkDeleteResponseEnvelope struct { - Errors []StreamWatermarkDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWatermarkDeleteResponseEnvelopeMessages `json:"messages,required"` - Result StreamWatermarkDeleteResponse `json:"result,required"` +// Union satisfied by [StreamWatermarkDeleteResponseUnknown] or +// [shared.UnionString]. +type StreamWatermarkDeleteResponse interface { + ImplementsStreamWatermarkDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*StreamWatermarkDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +// Union satisfied by [StreamWatermarkGetResponseUnknown] or [shared.UnionString]. +type StreamWatermarkGetResponse interface { + ImplementsStreamWatermarkGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*StreamWatermarkGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type StreamWatermarkNewParams struct { + // The image file to upload. + File param.Field[string] `json:"file,required"` + // A short description of the watermark profile. + Name param.Field[string] `json:"name"` + // The translucency of the image. A value of `0.0` makes the image completely + // transparent, and `1.0` makes the image completely opaque. Note that if the image + // is already semi-transparent, setting this to `1.0` will not make the image + // completely opaque. + Opacity param.Field[float64] `json:"opacity"` + // The whitespace between the adjacent edges (determined by position) of the video + // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded + // video width or length, as determined by the algorithm. + Padding param.Field[float64] `json:"padding"` + // The location of the image. Valid positions are: `upperRight`, `upperLeft`, + // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the + // `padding` parameter. + Position param.Field[string] `json:"position"` + // The size of the image relative to the overall size of the video. This parameter + // will adapt to horizontal and vertical videos automatically. `0.0` indicates no + // scaling (use the size of the image as-is), and `1.0 `fills the entire video. + Scale param.Field[float64] `json:"scale"` +} + +func (r StreamWatermarkNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StreamWatermarkNewResponseEnvelope struct { + Errors []StreamWatermarkNewResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWatermarkNewResponseEnvelopeMessages `json:"messages,required"` + Result StreamWatermarkNewResponse `json:"result,required"` // Whether the API call was successful - Success StreamWatermarkDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON streamWatermarkDeleteResponseEnvelopeJSON `json:"-"` + Success StreamWatermarkNewResponseEnvelopeSuccess `json:"success,required"` + JSON streamWatermarkNewResponseEnvelopeJSON `json:"-"` } -// streamWatermarkDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [StreamWatermarkDeleteResponseEnvelope] -type streamWatermarkDeleteResponseEnvelopeJSON struct { +// streamWatermarkNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamWatermarkNewResponseEnvelope] +type streamWatermarkNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -218,67 +243,67 @@ type streamWatermarkDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkDeleteResponseEnvelopeErrorsJSON `json:"-"` +type StreamWatermarkNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkNewResponseEnvelopeErrorsJSON `json:"-"` } -// streamWatermarkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [StreamWatermarkDeleteResponseEnvelopeErrors] -type streamWatermarkDeleteResponseEnvelopeErrorsJSON struct { +// streamWatermarkNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamWatermarkNewResponseEnvelopeErrors] +type streamWatermarkNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkDeleteResponseEnvelopeMessagesJSON `json:"-"` +type StreamWatermarkNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkNewResponseEnvelopeMessagesJSON `json:"-"` } -// streamWatermarkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamWatermarkDeleteResponseEnvelopeMessages] -type streamWatermarkDeleteResponseEnvelopeMessagesJSON struct { +// streamWatermarkNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamWatermarkNewResponseEnvelopeMessages] +type streamWatermarkNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWatermarkDeleteResponseEnvelopeSuccess bool +type StreamWatermarkNewResponseEnvelopeSuccess bool const ( - StreamWatermarkDeleteResponseEnvelopeSuccessTrue StreamWatermarkDeleteResponseEnvelopeSuccess = true + StreamWatermarkNewResponseEnvelopeSuccessTrue StreamWatermarkNewResponseEnvelopeSuccess = true ) -type StreamWatermarkGetResponseEnvelope struct { - Errors []StreamWatermarkGetResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWatermarkGetResponseEnvelopeMessages `json:"messages,required"` - Result StreamWatermarkGetResponse `json:"result,required"` +type StreamWatermarkListResponseEnvelope struct { + Errors []StreamWatermarkListResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWatermarkListResponseEnvelopeMessages `json:"messages,required"` + Result []StreamWatermarkListResponse `json:"result,required"` // Whether the API call was successful - Success StreamWatermarkGetResponseEnvelopeSuccess `json:"success,required"` - JSON streamWatermarkGetResponseEnvelopeJSON `json:"-"` + Success StreamWatermarkListResponseEnvelopeSuccess `json:"success,required"` + JSON streamWatermarkListResponseEnvelopeJSON `json:"-"` } -// streamWatermarkGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [StreamWatermarkGetResponseEnvelope] -type streamWatermarkGetResponseEnvelopeJSON struct { +// streamWatermarkListResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamWatermarkListResponseEnvelope] +type streamWatermarkListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -287,96 +312,67 @@ type streamWatermarkGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkGetResponseEnvelopeErrorsJSON `json:"-"` +type StreamWatermarkListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkListResponseEnvelopeErrorsJSON `json:"-"` } -// streamWatermarkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [StreamWatermarkGetResponseEnvelopeErrors] -type streamWatermarkGetResponseEnvelopeErrorsJSON struct { +// streamWatermarkListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamWatermarkListResponseEnvelopeErrors] +type streamWatermarkListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkGetResponseEnvelopeMessagesJSON `json:"-"` +type StreamWatermarkListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkListResponseEnvelopeMessagesJSON `json:"-"` } -// streamWatermarkGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [StreamWatermarkGetResponseEnvelopeMessages] -type streamWatermarkGetResponseEnvelopeMessagesJSON struct { +// streamWatermarkListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamWatermarkListResponseEnvelopeMessages] +type streamWatermarkListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWatermarkGetResponseEnvelopeSuccess bool +type StreamWatermarkListResponseEnvelopeSuccess bool const ( - StreamWatermarkGetResponseEnvelopeSuccessTrue StreamWatermarkGetResponseEnvelopeSuccess = true + StreamWatermarkListResponseEnvelopeSuccessTrue StreamWatermarkListResponseEnvelopeSuccess = true ) -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadParams struct { - // The image file to upload. - File param.Field[string] `json:"file,required"` - // A short description of the watermark profile. - Name param.Field[string] `json:"name"` - // The translucency of the image. A value of `0.0` makes the image completely - // transparent, and `1.0` makes the image completely opaque. Note that if the image - // is already semi-transparent, setting this to `1.0` will not make the image - // completely opaque. - Opacity param.Field[float64] `json:"opacity"` - // The whitespace between the adjacent edges (determined by position) of the video - // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded - // video width or length, as determined by the algorithm. - Padding param.Field[float64] `json:"padding"` - // The location of the image. Valid positions are: `upperRight`, `upperLeft`, - // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the - // `padding` parameter. - Position param.Field[string] `json:"position"` - // The size of the image relative to the overall size of the video. This parameter - // will adapt to horizontal and vertical videos automatically. `0.0` indicates no - // scaling (use the size of the image as-is), and `1.0 `fills the entire video. - Scale param.Field[float64] `json:"scale"` -} - -func (r StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelope struct { - Errors []StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessages `json:"messages,required"` - Result StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponse `json:"result,required"` +type StreamWatermarkDeleteResponseEnvelope struct { + Errors []StreamWatermarkDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWatermarkDeleteResponseEnvelopeMessages `json:"messages,required"` + Result StreamWatermarkDeleteResponse `json:"result,required"` // Whether the API call was successful - Success StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeSuccess `json:"success,required"` - JSON streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeJSON `json:"-"` + Success StreamWatermarkDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON streamWatermarkDeleteResponseEnvelopeJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelope] -type streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeJSON struct { +// streamWatermarkDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamWatermarkDeleteResponseEnvelope] +type streamWatermarkDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -385,70 +381,67 @@ type streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResp ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrorsJSON `json:"-"` +type StreamWatermarkDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrors] -type streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrorsJSON struct { +// streamWatermarkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamWatermarkDeleteResponseEnvelopeErrors] +type streamWatermarkDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessagesJSON `json:"-"` +type StreamWatermarkDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessages] -type streamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessagesJSON struct { +// streamWatermarkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamWatermarkDeleteResponseEnvelopeMessages] +type streamWatermarkDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeSuccess bool +type StreamWatermarkDeleteResponseEnvelopeSuccess bool const ( - StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeSuccessTrue StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadResponseEnvelopeSuccess = true + StreamWatermarkDeleteResponseEnvelopeSuccessTrue StreamWatermarkDeleteResponseEnvelopeSuccess = true ) -type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelope struct { - Errors []StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessages `json:"messages,required"` - Result []StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponse `json:"result,required"` +type StreamWatermarkGetResponseEnvelope struct { + Errors []StreamWatermarkGetResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWatermarkGetResponseEnvelopeMessages `json:"messages,required"` + Result StreamWatermarkGetResponse `json:"result,required"` // Whether the API call was successful - Success StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeSuccess `json:"success,required"` - JSON streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeJSON `json:"-"` + Success StreamWatermarkGetResponseEnvelopeSuccess `json:"success,required"` + JSON streamWatermarkGetResponseEnvelopeJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelope] -type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeJSON struct { +// streamWatermarkGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamWatermarkGetResponseEnvelope] +type streamWatermarkGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -457,53 +450,51 @@ type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeJ ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrorsJSON `json:"-"` +type StreamWatermarkGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkGetResponseEnvelopeErrorsJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrors] -type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrorsJSON struct { +// streamWatermarkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamWatermarkGetResponseEnvelopeErrors] +type streamWatermarkGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessagesJSON `json:"-"` +type StreamWatermarkGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWatermarkGetResponseEnvelopeMessagesJSON `json:"-"` } -// streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessages] -type streamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessagesJSON struct { +// streamWatermarkGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamWatermarkGetResponseEnvelopeMessages] +type streamWatermarkGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWatermarkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeSuccess bool +type StreamWatermarkGetResponseEnvelopeSuccess bool const ( - StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeSuccessTrue StreamWatermarkStreamWatermarkProfileListWatermarkProfilesResponseEnvelopeSuccess = true + StreamWatermarkGetResponseEnvelopeSuccessTrue StreamWatermarkGetResponseEnvelopeSuccess = true ) diff --git a/streamwatermark_test.go b/streamwatermark_test.go index d08720b0f26..744f904ca77 100644 --- a/streamwatermark_test.go +++ b/streamwatermark_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestStreamWatermarkDelete(t *testing.T) { +func TestStreamWatermarkNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,17 @@ func TestStreamWatermarkDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Watermarks.Delete( + _, err := client.Stream.Watermarks.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", + cloudflare.StreamWatermarkNewParams{ + File: cloudflare.F("@/Users/rchen/Downloads/watermark.png"), + Name: cloudflare.F("Marketing Videos"), + Opacity: cloudflare.F(0.750000), + Padding: cloudflare.F(0.100000), + Position: cloudflare.F("center"), + Scale: cloudflare.F(0.100000), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +50,7 @@ func TestStreamWatermarkDelete(t *testing.T) { } } -func TestStreamWatermarkGet(t *testing.T) { +func TestStreamWatermarkList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,11 +66,7 @@ func TestStreamWatermarkGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Watermarks.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "ea95132c15732412d22c1476fa83f27a", - ) + _, err := client.Stream.Watermarks.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -73,7 +76,7 @@ func TestStreamWatermarkGet(t *testing.T) { } } -func TestStreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadWithOptionalParams(t *testing.T) { +func TestStreamWatermarkDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,17 +92,10 @@ func TestStreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUpload option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Watermarks.StreamWatermarkProfileNewWatermarkProfilesViaBasicUpload( + _, err := client.Stream.Watermarks.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUploadParams{ - File: cloudflare.F("@/Users/rchen/Downloads/watermark.png"), - Name: cloudflare.F("Marketing Videos"), - Opacity: cloudflare.F(0.750000), - Padding: cloudflare.F(0.100000), - Position: cloudflare.F("center"), - Scale: cloudflare.F(0.100000), - }, + "ea95132c15732412d22c1476fa83f27a", ) if err != nil { var apierr *cloudflare.Error @@ -110,7 +106,7 @@ func TestStreamWatermarkStreamWatermarkProfileNewWatermarkProfilesViaBasicUpload } } -func TestStreamWatermarkStreamWatermarkProfileListWatermarkProfiles(t *testing.T) { +func TestStreamWatermarkGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,7 +122,11 @@ func TestStreamWatermarkStreamWatermarkProfileListWatermarkProfiles(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Watermarks.StreamWatermarkProfileListWatermarkProfiles(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Stream.Watermarks.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "ea95132c15732412d22c1476fa83f27a", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/streamwebhook.go b/streamwebhook.go index 86edd6f155a..89fd08efbeb 100644 --- a/streamwebhook.go +++ b/streamwebhook.go @@ -47,12 +47,12 @@ func (r *StreamWebhookService) Delete(ctx context.Context, accountID string, opt return } -// Creates a webhook notification. -func (r *StreamWebhookService) StreamWebhookNewWebhooks(ctx context.Context, accountID string, body StreamWebhookStreamWebhookNewWebhooksParams, opts ...option.RequestOption) (res *StreamWebhookStreamWebhookNewWebhooksResponse, err error) { +// Retrieves a list of webhooks. +func (r *StreamWebhookService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *StreamWebhookGetResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWebhookStreamWebhookNewWebhooksResponseEnvelope + var env StreamWebhookGetResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/webhook", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -60,12 +60,12 @@ func (r *StreamWebhookService) StreamWebhookNewWebhooks(ctx context.Context, acc return } -// Retrieves a list of webhooks. -func (r *StreamWebhookService) StreamWebhookViewWebhooks(ctx context.Context, accountID string, opts ...option.RequestOption) (res *StreamWebhookStreamWebhookViewWebhooksResponse, err error) { +// Creates a webhook notification. +func (r *StreamWebhookService) Replace(ctx context.Context, accountID string, body StreamWebhookReplaceParams, opts ...option.RequestOption) (res *StreamWebhookReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env StreamWebhookStreamWebhookViewWebhooksResponseEnvelope + var env StreamWebhookReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/webhook", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -89,15 +89,14 @@ func init() { ) } -// Union satisfied by [StreamWebhookStreamWebhookNewWebhooksResponseUnknown] or -// [shared.UnionString]. -type StreamWebhookStreamWebhookNewWebhooksResponse interface { - ImplementsStreamWebhookStreamWebhookNewWebhooksResponse() +// Union satisfied by [StreamWebhookGetResponseUnknown] or [shared.UnionString]. +type StreamWebhookGetResponse interface { + ImplementsStreamWebhookGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamWebhookStreamWebhookNewWebhooksResponse)(nil)).Elem(), + reflect.TypeOf((*StreamWebhookGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -106,15 +105,15 @@ func init() { ) } -// Union satisfied by [StreamWebhookStreamWebhookViewWebhooksResponseUnknown] or +// Union satisfied by [StreamWebhookReplaceResponseUnknown] or // [shared.UnionString]. -type StreamWebhookStreamWebhookViewWebhooksResponse interface { - ImplementsStreamWebhookStreamWebhookViewWebhooksResponse() +type StreamWebhookReplaceResponse interface { + ImplementsStreamWebhookReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*StreamWebhookStreamWebhookViewWebhooksResponse)(nil)).Elem(), + reflect.TypeOf((*StreamWebhookReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -192,27 +191,18 @@ const ( StreamWebhookDeleteResponseEnvelopeSuccessTrue StreamWebhookDeleteResponseEnvelopeSuccess = true ) -type StreamWebhookStreamWebhookNewWebhooksParams struct { - // The URL where webhooks will be sent. - NotificationURL param.Field[string] `json:"notificationUrl,required" format:"uri"` -} - -func (r StreamWebhookStreamWebhookNewWebhooksParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type StreamWebhookStreamWebhookNewWebhooksResponseEnvelope struct { - Errors []StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessages `json:"messages,required"` - Result StreamWebhookStreamWebhookNewWebhooksResponse `json:"result,required"` +type StreamWebhookGetResponseEnvelope struct { + Errors []StreamWebhookGetResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWebhookGetResponseEnvelopeMessages `json:"messages,required"` + Result StreamWebhookGetResponse `json:"result,required"` // Whether the API call was successful - Success StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeSuccess `json:"success,required"` - JSON streamWebhookStreamWebhookNewWebhooksResponseEnvelopeJSON `json:"-"` + Success StreamWebhookGetResponseEnvelopeSuccess `json:"success,required"` + JSON streamWebhookGetResponseEnvelopeJSON `json:"-"` } -// streamWebhookStreamWebhookNewWebhooksResponseEnvelopeJSON contains the JSON -// metadata for the struct [StreamWebhookStreamWebhookNewWebhooksResponseEnvelope] -type streamWebhookStreamWebhookNewWebhooksResponseEnvelopeJSON struct { +// streamWebhookGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [StreamWebhookGetResponseEnvelope] +type streamWebhookGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -221,69 +211,76 @@ type streamWebhookStreamWebhookNewWebhooksResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookNewWebhooksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrorsJSON `json:"-"` +type StreamWebhookGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWebhookGetResponseEnvelopeErrorsJSON `json:"-"` } -// streamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrors] -type streamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrorsJSON struct { +// streamWebhookGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [StreamWebhookGetResponseEnvelopeErrors] +type streamWebhookGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessagesJSON `json:"-"` +type StreamWebhookGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWebhookGetResponseEnvelopeMessagesJSON `json:"-"` } -// streamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessages] -type streamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessagesJSON struct { +// streamWebhookGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [StreamWebhookGetResponseEnvelopeMessages] +type streamWebhookGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeSuccess bool +type StreamWebhookGetResponseEnvelopeSuccess bool const ( - StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeSuccessTrue StreamWebhookStreamWebhookNewWebhooksResponseEnvelopeSuccess = true + StreamWebhookGetResponseEnvelopeSuccessTrue StreamWebhookGetResponseEnvelopeSuccess = true ) -type StreamWebhookStreamWebhookViewWebhooksResponseEnvelope struct { - Errors []StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrors `json:"errors,required"` - Messages []StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessages `json:"messages,required"` - Result StreamWebhookStreamWebhookViewWebhooksResponse `json:"result,required"` +type StreamWebhookReplaceParams struct { + // The URL where webhooks will be sent. + NotificationURL param.Field[string] `json:"notificationUrl,required" format:"uri"` +} + +func (r StreamWebhookReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type StreamWebhookReplaceResponseEnvelope struct { + Errors []StreamWebhookReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []StreamWebhookReplaceResponseEnvelopeMessages `json:"messages,required"` + Result StreamWebhookReplaceResponse `json:"result,required"` // Whether the API call was successful - Success StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeSuccess `json:"success,required"` - JSON streamWebhookStreamWebhookViewWebhooksResponseEnvelopeJSON `json:"-"` + Success StreamWebhookReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON streamWebhookReplaceResponseEnvelopeJSON `json:"-"` } -// streamWebhookStreamWebhookViewWebhooksResponseEnvelopeJSON contains the JSON -// metadata for the struct [StreamWebhookStreamWebhookViewWebhooksResponseEnvelope] -type streamWebhookStreamWebhookViewWebhooksResponseEnvelopeJSON struct { +// streamWebhookReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [StreamWebhookReplaceResponseEnvelope] +type streamWebhookReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -292,53 +289,51 @@ type streamWebhookStreamWebhookViewWebhooksResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookViewWebhooksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrorsJSON `json:"-"` +type StreamWebhookReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWebhookReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// streamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrors] -type streamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrorsJSON struct { +// streamWebhookReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [StreamWebhookReplaceResponseEnvelopeErrors] +type streamWebhookReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON streamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessagesJSON `json:"-"` +type StreamWebhookReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON streamWebhookReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// streamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessages] -type streamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessagesJSON struct { +// streamWebhookReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [StreamWebhookReplaceResponseEnvelopeMessages] +type streamWebhookReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *StreamWebhookReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeSuccess bool +type StreamWebhookReplaceResponseEnvelopeSuccess bool const ( - StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeSuccessTrue StreamWebhookStreamWebhookViewWebhooksResponseEnvelopeSuccess = true + StreamWebhookReplaceResponseEnvelopeSuccessTrue StreamWebhookReplaceResponseEnvelopeSuccess = true ) diff --git a/streamwebhook_test.go b/streamwebhook_test.go index aceb81b701d..771f22b8759 100644 --- a/streamwebhook_test.go +++ b/streamwebhook_test.go @@ -39,7 +39,7 @@ func TestStreamWebhookDelete(t *testing.T) { } } -func TestStreamWebhookStreamWebhookNewWebhooks(t *testing.T) { +func TestStreamWebhookGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,13 +55,7 @@ func TestStreamWebhookStreamWebhookNewWebhooks(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Webhooks.StreamWebhookNewWebhooks( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.StreamWebhookStreamWebhookNewWebhooksParams{ - NotificationURL: cloudflare.F("https://example.com"), - }, - ) + _, err := client.Stream.Webhooks.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -71,7 +65,7 @@ func TestStreamWebhookStreamWebhookNewWebhooks(t *testing.T) { } } -func TestStreamWebhookStreamWebhookViewWebhooks(t *testing.T) { +func TestStreamWebhookReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -87,7 +81,13 @@ func TestStreamWebhookStreamWebhookViewWebhooks(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Stream.Webhooks.StreamWebhookViewWebhooks(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Stream.Webhooks.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.StreamWebhookReplaceParams{ + NotificationURL: cloudflare.F("https://example.com"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/subscription.go b/subscription.go index 6a9bcb362c4..118056eeb41 100644 --- a/subscription.go +++ b/subscription.go @@ -35,37 +35,11 @@ func NewSubscriptionService(opts ...option.RequestOption) (r *SubscriptionServic return } -// Updates an account subscription. -func (r *SubscriptionService) Update(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body SubscriptionUpdateParams, opts ...option.RequestOption) (res *SubscriptionUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env SubscriptionUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/subscriptions/%s", accountIdentifier, subscriptionIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Deletes an account's subscription. -func (r *SubscriptionService) Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { - opts = append(r.Options[:], opts...) - var env SubscriptionDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/subscriptions/%s", accountIdentifier, subscriptionIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Creates an account subscription. -func (r *SubscriptionService) AccountSubscriptionsNewSubscription(ctx context.Context, accountIdentifier string, body SubscriptionAccountSubscriptionsNewSubscriptionParams, opts ...option.RequestOption) (res *SubscriptionAccountSubscriptionsNewSubscriptionResponse, err error) { +// Create a zone subscription, either plan or add-ons. +func (r *SubscriptionService) New(ctx context.Context, identifier string, body SubscriptionNewParams, opts ...option.RequestOption) (res *SubscriptionNewResponse, err error) { opts = append(r.Options[:], opts...) - var env SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelope - path := fmt.Sprintf("accounts/%s/subscriptions", accountIdentifier) + var env SubscriptionNewResponseEnvelope + path := fmt.Sprintf("zones/%s/subscription", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return @@ -75,9 +49,9 @@ func (r *SubscriptionService) AccountSubscriptionsNewSubscription(ctx context.Co } // Lists all of an account's subscriptions. -func (r *SubscriptionService) AccountSubscriptionsListSubscriptions(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]SubscriptionAccountSubscriptionsListSubscriptionsResponse, err error) { +func (r *SubscriptionService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]SubscriptionListResponse, err error) { opts = append(r.Options[:], opts...) - var env SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelope + var env SubscriptionListResponseEnvelope path := fmt.Sprintf("accounts/%s/subscriptions", accountIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -87,12 +61,12 @@ func (r *SubscriptionService) AccountSubscriptionsListSubscriptions(ctx context. return } -// Create a zone subscription, either plan or add-ons. -func (r *SubscriptionService) ZoneSubscriptionNewZoneSubscription(ctx context.Context, identifier string, body SubscriptionZoneSubscriptionNewZoneSubscriptionParams, opts ...option.RequestOption) (res *SubscriptionZoneSubscriptionNewZoneSubscriptionResponse, err error) { +// Deletes an account's subscription. +func (r *SubscriptionService) Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelope - path := fmt.Sprintf("zones/%s/subscription", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env SubscriptionDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/subscriptions/%s", accountIdentifier, subscriptionIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -100,12 +74,12 @@ func (r *SubscriptionService) ZoneSubscriptionNewZoneSubscription(ctx context.Co return } -// Updates zone subscriptions, either plan or add-ons. -func (r *SubscriptionService) ZoneSubscriptionUpdateZoneSubscription(ctx context.Context, identifier string, body SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams, opts ...option.RequestOption) (res *SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse, err error) { +// Lists zone subscription details. +func (r *SubscriptionService) Get(ctx context.Context, identifier string, opts ...option.RequestOption) (res *SubscriptionGetResponse, err error) { opts = append(r.Options[:], opts...) - var env SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelope + var env SubscriptionGetResponseEnvelope path := fmt.Sprintf("zones/%s/subscription", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -113,12 +87,12 @@ func (r *SubscriptionService) ZoneSubscriptionUpdateZoneSubscription(ctx context return } -// Lists zone subscription details. -func (r *SubscriptionService) ZoneSubscriptionZoneSubscriptionDetails(ctx context.Context, identifier string, opts ...option.RequestOption) (res *SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse, err error) { +// Updates an account subscription. +func (r *SubscriptionService) Replace(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body SubscriptionReplaceParams, opts ...option.RequestOption) (res *SubscriptionReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelope - path := fmt.Sprintf("zones/%s/subscription", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env SubscriptionReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/subscriptions/%s", accountIdentifier, subscriptionIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -126,14 +100,14 @@ func (r *SubscriptionService) ZoneSubscriptionZoneSubscriptionDetails(ctx contex return } -// Union satisfied by [SubscriptionUpdateResponseUnknown] or [shared.UnionString]. -type SubscriptionUpdateResponse interface { - ImplementsSubscriptionUpdateResponse() +// Union satisfied by [SubscriptionNewResponseUnknown] or [shared.UnionString]. +type SubscriptionNewResponse interface { + ImplementsSubscriptionNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SubscriptionUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*SubscriptionNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -142,48 +116,12 @@ func init() { ) } -type SubscriptionDeleteResponse struct { +type SubscriptionListResponse struct { // Subscription identifier tag. - SubscriptionID string `json:"subscription_id"` - JSON subscriptionDeleteResponseJSON `json:"-"` -} - -// subscriptionDeleteResponseJSON contains the JSON metadata for the struct -// [SubscriptionDeleteResponse] -type subscriptionDeleteResponseJSON struct { - SubscriptionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by -// [SubscriptionAccountSubscriptionsNewSubscriptionResponseUnknown] or -// [shared.UnionString]. -type SubscriptionAccountSubscriptionsNewSubscriptionResponse interface { - ImplementsSubscriptionAccountSubscriptionsNewSubscriptionResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*SubscriptionAccountSubscriptionsNewSubscriptionResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type SubscriptionAccountSubscriptionsListSubscriptionsResponse struct { - // Subscription identifier tag. - ID string `json:"id"` - App SubscriptionAccountSubscriptionsListSubscriptionsResponseApp `json:"app"` + ID string `json:"id"` + App SubscriptionListResponseApp `json:"app"` // The list of add-ons subscribed to. - ComponentValues []SubscriptionAccountSubscriptionsListSubscriptionsResponseComponentValue `json:"component_values"` + ComponentValues []SubscriptionListResponseComponentValue `json:"component_values"` // The monetary unit in which pricing information is displayed. Currency string `json:"currency"` // The end of the current period and also when the next billing is due. @@ -192,22 +130,21 @@ type SubscriptionAccountSubscriptionsListSubscriptionsResponse struct { // is the first period. CurrentPeriodStart time.Time `json:"current_period_start" format:"date-time"` // How often the subscription is renewed automatically. - Frequency SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency `json:"frequency"` + Frequency SubscriptionListResponseFrequency `json:"frequency"` // The price of the subscription that will be billed, in US dollars. Price float64 `json:"price"` // The rate plan applied to the subscription. - RatePlan SubscriptionAccountSubscriptionsListSubscriptionsResponseRatePlan `json:"rate_plan"` + RatePlan SubscriptionListResponseRatePlan `json:"rate_plan"` // The state that the subscription is in. - State SubscriptionAccountSubscriptionsListSubscriptionsResponseState `json:"state"` + State SubscriptionListResponseState `json:"state"` // A simple zone object. May have null properties if not a zone subscription. - Zone SubscriptionAccountSubscriptionsListSubscriptionsResponseZone `json:"zone"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseJSON `json:"-"` + Zone SubscriptionListResponseZone `json:"zone"` + JSON subscriptionListResponseJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseJSON contains the JSON -// metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponse] -type subscriptionAccountSubscriptionsListSubscriptionsResponseJSON struct { +// subscriptionListResponseJSON contains the JSON metadata for the struct +// [SubscriptionListResponse] +type subscriptionListResponseJSON struct { ID apijson.Field App apijson.Field ComponentValues apijson.Field @@ -223,31 +160,30 @@ type subscriptionAccountSubscriptionsListSubscriptionsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionAccountSubscriptionsListSubscriptionsResponseApp struct { +type SubscriptionListResponseApp struct { // app install id. - InstallID string `json:"install_id"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseAppJSON `json:"-"` + InstallID string `json:"install_id"` + JSON subscriptionListResponseAppJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseAppJSON contains the -// JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseApp] -type subscriptionAccountSubscriptionsListSubscriptionsResponseAppJSON struct { +// subscriptionListResponseAppJSON contains the JSON metadata for the struct +// [SubscriptionListResponseApp] +type subscriptionListResponseAppJSON struct { InstallID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseApp) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseApp) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A component value for a subscription. -type SubscriptionAccountSubscriptionsListSubscriptionsResponseComponentValue struct { +type SubscriptionListResponseComponentValue struct { // The default amount assigned. Default float64 `json:"default"` // The name of the component value. @@ -255,14 +191,13 @@ type SubscriptionAccountSubscriptionsListSubscriptionsResponseComponentValue str // The unit price for the component value. Price float64 `json:"price"` // The amount of the component value assigned. - Value float64 `json:"value"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseComponentValueJSON `json:"-"` + Value float64 `json:"value"` + JSON subscriptionListResponseComponentValueJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseComponentValueJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseComponentValue] -type subscriptionAccountSubscriptionsListSubscriptionsResponseComponentValueJSON struct { +// subscriptionListResponseComponentValueJSON contains the JSON metadata for the +// struct [SubscriptionListResponseComponentValue] +type subscriptionListResponseComponentValueJSON struct { Default apijson.Field Name apijson.Field Price apijson.Field @@ -271,22 +206,22 @@ type subscriptionAccountSubscriptionsListSubscriptionsResponseComponentValueJSON ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseComponentValue) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseComponentValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // How often the subscription is renewed automatically. -type SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency string +type SubscriptionListResponseFrequency string const ( - SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequencyWeekly SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency = "weekly" - SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequencyMonthly SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency = "monthly" - SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequencyQuarterly SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency = "quarterly" - SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequencyYearly SubscriptionAccountSubscriptionsListSubscriptionsResponseFrequency = "yearly" + SubscriptionListResponseFrequencyWeekly SubscriptionListResponseFrequency = "weekly" + SubscriptionListResponseFrequencyMonthly SubscriptionListResponseFrequency = "monthly" + SubscriptionListResponseFrequencyQuarterly SubscriptionListResponseFrequency = "quarterly" + SubscriptionListResponseFrequencyYearly SubscriptionListResponseFrequency = "yearly" ) // The rate plan applied to the subscription. -type SubscriptionAccountSubscriptionsListSubscriptionsResponseRatePlan struct { +type SubscriptionListResponseRatePlan struct { // The ID of the rate plan. ID interface{} `json:"id"` // The currency applied to the rate plan subscription. @@ -300,14 +235,13 @@ type SubscriptionAccountSubscriptionsListSubscriptionsResponseRatePlan struct { // The scope that this rate plan applies to. Scope string `json:"scope"` // The list of sets this rate plan applies to. - Sets []string `json:"sets"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseRatePlanJSON `json:"-"` + Sets []string `json:"sets"` + JSON subscriptionListResponseRatePlanJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseRatePlanJSON contains -// the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseRatePlan] -type subscriptionAccountSubscriptionsListSubscriptionsResponseRatePlanJSON struct { +// subscriptionListResponseRatePlanJSON contains the JSON metadata for the struct +// [SubscriptionListResponseRatePlan] +type subscriptionListResponseRatePlanJSON struct { ID apijson.Field Currency apijson.Field ExternallyManaged apijson.Field @@ -319,74 +253,71 @@ type subscriptionAccountSubscriptionsListSubscriptionsResponseRatePlanJSON struc ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseRatePlan) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseRatePlan) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The state that the subscription is in. -type SubscriptionAccountSubscriptionsListSubscriptionsResponseState string +type SubscriptionListResponseState string const ( - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateTrial SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Trial" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateProvisioned SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Provisioned" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStatePaid SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Paid" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateAwaitingPayment SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "AwaitingPayment" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateCancelled SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Cancelled" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateFailed SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Failed" - SubscriptionAccountSubscriptionsListSubscriptionsResponseStateExpired SubscriptionAccountSubscriptionsListSubscriptionsResponseState = "Expired" + SubscriptionListResponseStateTrial SubscriptionListResponseState = "Trial" + SubscriptionListResponseStateProvisioned SubscriptionListResponseState = "Provisioned" + SubscriptionListResponseStatePaid SubscriptionListResponseState = "Paid" + SubscriptionListResponseStateAwaitingPayment SubscriptionListResponseState = "AwaitingPayment" + SubscriptionListResponseStateCancelled SubscriptionListResponseState = "Cancelled" + SubscriptionListResponseStateFailed SubscriptionListResponseState = "Failed" + SubscriptionListResponseStateExpired SubscriptionListResponseState = "Expired" ) // A simple zone object. May have null properties if not a zone subscription. -type SubscriptionAccountSubscriptionsListSubscriptionsResponseZone struct { +type SubscriptionListResponseZone struct { // Identifier ID string `json:"id"` // The domain name - Name string `json:"name"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseZoneJSON `json:"-"` + Name string `json:"name"` + JSON subscriptionListResponseZoneJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseZoneJSON contains the -// JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseZone] -type subscriptionAccountSubscriptionsListSubscriptionsResponseZoneJSON struct { +// subscriptionListResponseZoneJSON contains the JSON metadata for the struct +// [SubscriptionListResponseZone] +type subscriptionListResponseZoneJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseZone) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseZone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by -// [SubscriptionZoneSubscriptionNewZoneSubscriptionResponseUnknown] or -// [shared.UnionString]. -type SubscriptionZoneSubscriptionNewZoneSubscriptionResponse interface { - ImplementsSubscriptionZoneSubscriptionNewZoneSubscriptionResponse() +type SubscriptionDeleteResponse struct { + // Subscription identifier tag. + SubscriptionID string `json:"subscription_id"` + JSON subscriptionDeleteResponseJSON `json:"-"` } -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*SubscriptionZoneSubscriptionNewZoneSubscriptionResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// subscriptionDeleteResponseJSON contains the JSON metadata for the struct +// [SubscriptionDeleteResponse] +type subscriptionDeleteResponseJSON struct { + SubscriptionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *SubscriptionDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// Union satisfied by -// [SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseUnknown] or -// [shared.UnionString]. -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse interface { - ImplementsSubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse() +// Union satisfied by [SubscriptionGetResponseUnknown] or [shared.UnionString]. +type SubscriptionGetResponse interface { + ImplementsSubscriptionGetResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse)(nil)).Elem(), + reflect.TypeOf((*SubscriptionGetResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -395,16 +326,14 @@ func init() { ) } -// Union satisfied by -// [SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseUnknown] or -// [shared.UnionString]. -type SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse interface { - ImplementsSubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse() +// Union satisfied by [SubscriptionReplaceResponseUnknown] or [shared.UnionString]. +type SubscriptionReplaceResponse interface { + ImplementsSubscriptionReplaceResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse)(nil)).Elem(), + reflect.TypeOf((*SubscriptionReplaceResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -413,33 +342,33 @@ func init() { ) } -type SubscriptionUpdateParams struct { - App param.Field[SubscriptionUpdateParamsApp] `json:"app"` +type SubscriptionNewParams struct { + App param.Field[SubscriptionNewParamsApp] `json:"app"` // The list of add-ons subscribed to. - ComponentValues param.Field[[]SubscriptionUpdateParamsComponentValue] `json:"component_values"` + ComponentValues param.Field[[]SubscriptionNewParamsComponentValue] `json:"component_values"` // How often the subscription is renewed automatically. - Frequency param.Field[SubscriptionUpdateParamsFrequency] `json:"frequency"` + Frequency param.Field[SubscriptionNewParamsFrequency] `json:"frequency"` // The rate plan applied to the subscription. - RatePlan param.Field[SubscriptionUpdateParamsRatePlan] `json:"rate_plan"` + RatePlan param.Field[SubscriptionNewParamsRatePlan] `json:"rate_plan"` // A simple zone object. May have null properties if not a zone subscription. - Zone param.Field[SubscriptionUpdateParamsZone] `json:"zone"` + Zone param.Field[SubscriptionNewParamsZone] `json:"zone"` } -func (r SubscriptionUpdateParams) MarshalJSON() (data []byte, err error) { +func (r SubscriptionNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SubscriptionUpdateParamsApp struct { +type SubscriptionNewParamsApp struct { // app install id. InstallID param.Field[string] `json:"install_id"` } -func (r SubscriptionUpdateParamsApp) MarshalJSON() (data []byte, err error) { +func (r SubscriptionNewParamsApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A component value for a subscription. -type SubscriptionUpdateParamsComponentValue struct { +type SubscriptionNewParamsComponentValue struct { // The default amount assigned. Default param.Field[float64] `json:"default"` // The name of the component value. @@ -450,22 +379,22 @@ type SubscriptionUpdateParamsComponentValue struct { Value param.Field[float64] `json:"value"` } -func (r SubscriptionUpdateParamsComponentValue) MarshalJSON() (data []byte, err error) { +func (r SubscriptionNewParamsComponentValue) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // How often the subscription is renewed automatically. -type SubscriptionUpdateParamsFrequency string +type SubscriptionNewParamsFrequency string const ( - SubscriptionUpdateParamsFrequencyWeekly SubscriptionUpdateParamsFrequency = "weekly" - SubscriptionUpdateParamsFrequencyMonthly SubscriptionUpdateParamsFrequency = "monthly" - SubscriptionUpdateParamsFrequencyQuarterly SubscriptionUpdateParamsFrequency = "quarterly" - SubscriptionUpdateParamsFrequencyYearly SubscriptionUpdateParamsFrequency = "yearly" + SubscriptionNewParamsFrequencyWeekly SubscriptionNewParamsFrequency = "weekly" + SubscriptionNewParamsFrequencyMonthly SubscriptionNewParamsFrequency = "monthly" + SubscriptionNewParamsFrequencyQuarterly SubscriptionNewParamsFrequency = "quarterly" + SubscriptionNewParamsFrequencyYearly SubscriptionNewParamsFrequency = "yearly" ) // The rate plan applied to the subscription. -type SubscriptionUpdateParamsRatePlan struct { +type SubscriptionNewParamsRatePlan struct { // The ID of the rate plan. ID param.Field[interface{}] `json:"id"` // The currency applied to the rate plan subscription. @@ -482,30 +411,30 @@ type SubscriptionUpdateParamsRatePlan struct { Sets param.Field[[]string] `json:"sets"` } -func (r SubscriptionUpdateParamsRatePlan) MarshalJSON() (data []byte, err error) { +func (r SubscriptionNewParamsRatePlan) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A simple zone object. May have null properties if not a zone subscription. -type SubscriptionUpdateParamsZone struct { +type SubscriptionNewParamsZone struct { } -func (r SubscriptionUpdateParamsZone) MarshalJSON() (data []byte, err error) { +func (r SubscriptionNewParamsZone) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SubscriptionUpdateResponseEnvelope struct { - Errors []SubscriptionUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionUpdateResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionUpdateResponse `json:"result,required"` +type SubscriptionNewResponseEnvelope struct { + Errors []SubscriptionNewResponseEnvelopeErrors `json:"errors,required"` + Messages []SubscriptionNewResponseEnvelopeMessages `json:"messages,required"` + Result SubscriptionNewResponse `json:"result,required"` // Whether the API call was successful - Success SubscriptionUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionUpdateResponseEnvelopeJSON `json:"-"` + Success SubscriptionNewResponseEnvelopeSuccess `json:"success,required"` + JSON subscriptionNewResponseEnvelopeJSON `json:"-"` } -// subscriptionUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [SubscriptionUpdateResponseEnvelope] -type subscriptionUpdateResponseEnvelopeJSON struct { +// subscriptionNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [SubscriptionNewResponseEnvelope] +type subscriptionNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -514,473 +443,234 @@ type subscriptionUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *SubscriptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionUpdateResponseEnvelopeErrorsJSON `json:"-"` +type SubscriptionNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionNewResponseEnvelopeErrorsJSON `json:"-"` } -// subscriptionUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [SubscriptionUpdateResponseEnvelopeErrors] -type subscriptionUpdateResponseEnvelopeErrorsJSON struct { +// subscriptionNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SubscriptionNewResponseEnvelopeErrors] +type subscriptionNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionUpdateResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionNewResponseEnvelopeMessagesJSON `json:"-"` } -// subscriptionUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [SubscriptionUpdateResponseEnvelopeMessages] -type subscriptionUpdateResponseEnvelopeMessagesJSON struct { +// subscriptionNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SubscriptionNewResponseEnvelopeMessages] +type subscriptionNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SubscriptionUpdateResponseEnvelopeSuccess bool +type SubscriptionNewResponseEnvelopeSuccess bool const ( - SubscriptionUpdateResponseEnvelopeSuccessTrue SubscriptionUpdateResponseEnvelopeSuccess = true + SubscriptionNewResponseEnvelopeSuccessTrue SubscriptionNewResponseEnvelopeSuccess = true ) -type SubscriptionDeleteResponseEnvelope struct { - Errors []SubscriptionDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionDeleteResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionDeleteResponse `json:"result,required"` +type SubscriptionListResponseEnvelope struct { + Errors []SubscriptionListResponseEnvelopeErrors `json:"errors,required"` + Messages []SubscriptionListResponseEnvelopeMessages `json:"messages,required"` + Result []SubscriptionListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success SubscriptionDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionDeleteResponseEnvelopeJSON `json:"-"` + Success SubscriptionListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo SubscriptionListResponseEnvelopeResultInfo `json:"result_info"` + JSON subscriptionListResponseEnvelopeJSON `json:"-"` } -// subscriptionDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [SubscriptionDeleteResponseEnvelope] -type subscriptionDeleteResponseEnvelopeJSON struct { +// subscriptionListResponseEnvelopeJSON contains the JSON metadata for the struct +// [SubscriptionListResponseEnvelope] +type subscriptionListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionDeleteResponseEnvelopeErrorsJSON `json:"-"` +type SubscriptionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionListResponseEnvelopeErrorsJSON `json:"-"` } -// subscriptionDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [SubscriptionDeleteResponseEnvelopeErrors] -type subscriptionDeleteResponseEnvelopeErrorsJSON struct { +// subscriptionListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SubscriptionListResponseEnvelopeErrors] +type subscriptionListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionDeleteResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionListResponseEnvelopeMessagesJSON `json:"-"` } -// subscriptionDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [SubscriptionDeleteResponseEnvelopeMessages] -type subscriptionDeleteResponseEnvelopeMessagesJSON struct { +// subscriptionListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SubscriptionListResponseEnvelopeMessages] +type subscriptionListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SubscriptionDeleteResponseEnvelopeSuccess bool - -const ( - SubscriptionDeleteResponseEnvelopeSuccessTrue SubscriptionDeleteResponseEnvelopeSuccess = true -) - -type SubscriptionAccountSubscriptionsNewSubscriptionParams struct { - App param.Field[SubscriptionAccountSubscriptionsNewSubscriptionParamsApp] `json:"app"` - // The list of add-ons subscribed to. - ComponentValues param.Field[[]SubscriptionAccountSubscriptionsNewSubscriptionParamsComponentValue] `json:"component_values"` - // How often the subscription is renewed automatically. - Frequency param.Field[SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency] `json:"frequency"` - // The rate plan applied to the subscription. - RatePlan param.Field[SubscriptionAccountSubscriptionsNewSubscriptionParamsRatePlan] `json:"rate_plan"` - // A simple zone object. May have null properties if not a zone subscription. - Zone param.Field[SubscriptionAccountSubscriptionsNewSubscriptionParamsZone] `json:"zone"` -} - -func (r SubscriptionAccountSubscriptionsNewSubscriptionParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SubscriptionAccountSubscriptionsNewSubscriptionParamsApp struct { - // app install id. - InstallID param.Field[string] `json:"install_id"` -} - -func (r SubscriptionAccountSubscriptionsNewSubscriptionParamsApp) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A component value for a subscription. -type SubscriptionAccountSubscriptionsNewSubscriptionParamsComponentValue struct { - // The default amount assigned. - Default param.Field[float64] `json:"default"` - // The name of the component value. - Name param.Field[string] `json:"name"` - // The unit price for the component value. - Price param.Field[float64] `json:"price"` - // The amount of the component value assigned. - Value param.Field[float64] `json:"value"` -} - -func (r SubscriptionAccountSubscriptionsNewSubscriptionParamsComponentValue) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// How often the subscription is renewed automatically. -type SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency string +type SubscriptionListResponseEnvelopeSuccess bool const ( - SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequencyWeekly SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency = "weekly" - SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequencyMonthly SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency = "monthly" - SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequencyQuarterly SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency = "quarterly" - SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequencyYearly SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequency = "yearly" + SubscriptionListResponseEnvelopeSuccessTrue SubscriptionListResponseEnvelopeSuccess = true ) -// The rate plan applied to the subscription. -type SubscriptionAccountSubscriptionsNewSubscriptionParamsRatePlan struct { - // The ID of the rate plan. - ID param.Field[interface{}] `json:"id"` - // The currency applied to the rate plan subscription. - Currency param.Field[string] `json:"currency"` - // Whether this rate plan is managed externally from Cloudflare. - ExternallyManaged param.Field[bool] `json:"externally_managed"` - // Whether a rate plan is enterprise-based (or newly adopted term contract). - IsContract param.Field[bool] `json:"is_contract"` - // The full name of the rate plan. - PublicName param.Field[string] `json:"public_name"` - // The scope that this rate plan applies to. - Scope param.Field[string] `json:"scope"` - // The list of sets this rate plan applies to. - Sets param.Field[[]string] `json:"sets"` -} - -func (r SubscriptionAccountSubscriptionsNewSubscriptionParamsRatePlan) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A simple zone object. May have null properties if not a zone subscription. -type SubscriptionAccountSubscriptionsNewSubscriptionParamsZone struct { -} - -func (r SubscriptionAccountSubscriptionsNewSubscriptionParamsZone) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelope struct { - Errors []SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionAccountSubscriptionsNewSubscriptionResponse `json:"result,required"` - // Whether the API call was successful - Success SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeJSON `json:"-"` -} - -// subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelope] -type subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrorsJSON `json:"-"` -} - -// subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrors] -type subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON subscriptionListResponseEnvelopeResultInfoJSON `json:"-"` } -// subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessages] -type subscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field +// subscriptionListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [SubscriptionListResponseEnvelopeResultInfo] +type subscriptionListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeSuccess bool - -const ( - SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeSuccessTrue SubscriptionAccountSubscriptionsNewSubscriptionResponseEnvelopeSuccess = true -) - -type SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelope struct { - Errors []SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessages `json:"messages,required"` - Result []SubscriptionAccountSubscriptionsListSubscriptionsResponse `json:"result,required,nullable"` +type SubscriptionDeleteResponseEnvelope struct { + Errors []SubscriptionDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []SubscriptionDeleteResponseEnvelopeMessages `json:"messages,required"` + Result SubscriptionDeleteResponse `json:"result,required"` // Whether the API call was successful - Success SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfo `json:"result_info"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeJSON `json:"-"` + Success SubscriptionDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON subscriptionDeleteResponseEnvelopeJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelope] -type subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeJSON struct { +// subscriptionDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [SubscriptionDeleteResponseEnvelope] +type subscriptionDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrorsJSON `json:"-"` +type SubscriptionDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrors] -type subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrorsJSON struct { +// subscriptionDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SubscriptionDeleteResponseEnvelopeErrors] +type subscriptionDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessages] -type subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessagesJSON struct { +// subscriptionDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SubscriptionDeleteResponseEnvelopeMessages] +type subscriptionDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeSuccess bool - -const ( - SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeSuccessTrue SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeSuccess = true -) - -type SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfo] -type subscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionAccountSubscriptionsListSubscriptionsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SubscriptionZoneSubscriptionNewZoneSubscriptionParams struct { - App param.Field[SubscriptionZoneSubscriptionNewZoneSubscriptionParamsApp] `json:"app"` - // The list of add-ons subscribed to. - ComponentValues param.Field[[]SubscriptionZoneSubscriptionNewZoneSubscriptionParamsComponentValue] `json:"component_values"` - // How often the subscription is renewed automatically. - Frequency param.Field[SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency] `json:"frequency"` - // The rate plan applied to the subscription. - RatePlan param.Field[SubscriptionZoneSubscriptionNewZoneSubscriptionParamsRatePlan] `json:"rate_plan"` - // A simple zone object. May have null properties if not a zone subscription. - Zone param.Field[SubscriptionZoneSubscriptionNewZoneSubscriptionParamsZone] `json:"zone"` -} - -func (r SubscriptionZoneSubscriptionNewZoneSubscriptionParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SubscriptionZoneSubscriptionNewZoneSubscriptionParamsApp struct { - // app install id. - InstallID param.Field[string] `json:"install_id"` -} - -func (r SubscriptionZoneSubscriptionNewZoneSubscriptionParamsApp) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A component value for a subscription. -type SubscriptionZoneSubscriptionNewZoneSubscriptionParamsComponentValue struct { - // The default amount assigned. - Default param.Field[float64] `json:"default"` - // The name of the component value. - Name param.Field[string] `json:"name"` - // The unit price for the component value. - Price param.Field[float64] `json:"price"` - // The amount of the component value assigned. - Value param.Field[float64] `json:"value"` -} - -func (r SubscriptionZoneSubscriptionNewZoneSubscriptionParamsComponentValue) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// How often the subscription is renewed automatically. -type SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency string +type SubscriptionDeleteResponseEnvelopeSuccess bool const ( - SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequencyWeekly SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency = "weekly" - SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequencyMonthly SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency = "monthly" - SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequencyQuarterly SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency = "quarterly" - SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequencyYearly SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequency = "yearly" + SubscriptionDeleteResponseEnvelopeSuccessTrue SubscriptionDeleteResponseEnvelopeSuccess = true ) -// The rate plan applied to the subscription. -type SubscriptionZoneSubscriptionNewZoneSubscriptionParamsRatePlan struct { - // The ID of the rate plan. - ID param.Field[interface{}] `json:"id"` - // The currency applied to the rate plan subscription. - Currency param.Field[string] `json:"currency"` - // Whether this rate plan is managed externally from Cloudflare. - ExternallyManaged param.Field[bool] `json:"externally_managed"` - // Whether a rate plan is enterprise-based (or newly adopted term contract). - IsContract param.Field[bool] `json:"is_contract"` - // The full name of the rate plan. - PublicName param.Field[string] `json:"public_name"` - // The scope that this rate plan applies to. - Scope param.Field[string] `json:"scope"` - // The list of sets this rate plan applies to. - Sets param.Field[[]string] `json:"sets"` -} - -func (r SubscriptionZoneSubscriptionNewZoneSubscriptionParamsRatePlan) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// A simple zone object. May have null properties if not a zone subscription. -type SubscriptionZoneSubscriptionNewZoneSubscriptionParamsZone struct { -} - -func (r SubscriptionZoneSubscriptionNewZoneSubscriptionParamsZone) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelope struct { - Errors []SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionZoneSubscriptionNewZoneSubscriptionResponse `json:"result,required"` +type SubscriptionGetResponseEnvelope struct { + Errors []SubscriptionGetResponseEnvelopeErrors `json:"errors,required"` + Messages []SubscriptionGetResponseEnvelopeMessages `json:"messages,required"` + Result SubscriptionGetResponse `json:"result,required"` // Whether the API call was successful - Success SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeJSON `json:"-"` + Success SubscriptionGetResponseEnvelopeSuccess `json:"success,required"` + JSON subscriptionGetResponseEnvelopeJSON `json:"-"` } -// subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelope] -type subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeJSON struct { +// subscriptionGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [SubscriptionGetResponseEnvelope] +type subscriptionGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -989,84 +679,82 @@ type subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeJSON struct ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrorsJSON `json:"-"` +type SubscriptionGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionGetResponseEnvelopeErrorsJSON `json:"-"` } -// subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrors] -type subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrorsJSON struct { +// subscriptionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SubscriptionGetResponseEnvelopeErrors] +type subscriptionGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionGetResponseEnvelopeMessagesJSON `json:"-"` } -// subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessages] -type subscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessagesJSON struct { +// subscriptionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [SubscriptionGetResponseEnvelopeMessages] +type subscriptionGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeSuccess bool +type SubscriptionGetResponseEnvelopeSuccess bool const ( - SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeSuccessTrue SubscriptionZoneSubscriptionNewZoneSubscriptionResponseEnvelopeSuccess = true + SubscriptionGetResponseEnvelopeSuccessTrue SubscriptionGetResponseEnvelopeSuccess = true ) -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams struct { - App param.Field[SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsApp] `json:"app"` +type SubscriptionReplaceParams struct { + App param.Field[SubscriptionReplaceParamsApp] `json:"app"` // The list of add-ons subscribed to. - ComponentValues param.Field[[]SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsComponentValue] `json:"component_values"` + ComponentValues param.Field[[]SubscriptionReplaceParamsComponentValue] `json:"component_values"` // How often the subscription is renewed automatically. - Frequency param.Field[SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency] `json:"frequency"` + Frequency param.Field[SubscriptionReplaceParamsFrequency] `json:"frequency"` // The rate plan applied to the subscription. - RatePlan param.Field[SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsRatePlan] `json:"rate_plan"` + RatePlan param.Field[SubscriptionReplaceParamsRatePlan] `json:"rate_plan"` // A simple zone object. May have null properties if not a zone subscription. - Zone param.Field[SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsZone] `json:"zone"` + Zone param.Field[SubscriptionReplaceParamsZone] `json:"zone"` } -func (r SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams) MarshalJSON() (data []byte, err error) { +func (r SubscriptionReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsApp struct { +type SubscriptionReplaceParamsApp struct { // app install id. InstallID param.Field[string] `json:"install_id"` } -func (r SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsApp) MarshalJSON() (data []byte, err error) { +func (r SubscriptionReplaceParamsApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A component value for a subscription. -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsComponentValue struct { +type SubscriptionReplaceParamsComponentValue struct { // The default amount assigned. Default param.Field[float64] `json:"default"` // The name of the component value. @@ -1077,22 +765,22 @@ type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsComponentValue stru Value param.Field[float64] `json:"value"` } -func (r SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsComponentValue) MarshalJSON() (data []byte, err error) { +func (r SubscriptionReplaceParamsComponentValue) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // How often the subscription is renewed automatically. -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency string +type SubscriptionReplaceParamsFrequency string const ( - SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequencyWeekly SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency = "weekly" - SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequencyMonthly SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency = "monthly" - SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequencyQuarterly SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency = "quarterly" - SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequencyYearly SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequency = "yearly" + SubscriptionReplaceParamsFrequencyWeekly SubscriptionReplaceParamsFrequency = "weekly" + SubscriptionReplaceParamsFrequencyMonthly SubscriptionReplaceParamsFrequency = "monthly" + SubscriptionReplaceParamsFrequencyQuarterly SubscriptionReplaceParamsFrequency = "quarterly" + SubscriptionReplaceParamsFrequencyYearly SubscriptionReplaceParamsFrequency = "yearly" ) // The rate plan applied to the subscription. -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsRatePlan struct { +type SubscriptionReplaceParamsRatePlan struct { // The ID of the rate plan. ID param.Field[interface{}] `json:"id"` // The currency applied to the rate plan subscription. @@ -1109,103 +797,30 @@ type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsRatePlan struct { Sets param.Field[[]string] `json:"sets"` } -func (r SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsRatePlan) MarshalJSON() (data []byte, err error) { +func (r SubscriptionReplaceParamsRatePlan) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A simple zone object. May have null properties if not a zone subscription. -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsZone struct { +type SubscriptionReplaceParamsZone struct { } -func (r SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsZone) MarshalJSON() (data []byte, err error) { +func (r SubscriptionReplaceParamsZone) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelope struct { - Errors []SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponse `json:"result,required"` - // Whether the API call was successful - Success SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeJSON `json:"-"` -} - -// subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelope] -type subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrorsJSON `json:"-"` -} - -// subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrors] -type subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessagesJSON `json:"-"` -} - -// subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessages] -type subscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeSuccess bool - -const ( - SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeSuccessTrue SubscriptionZoneSubscriptionUpdateZoneSubscriptionResponseEnvelopeSuccess = true -) - -type SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelope struct { - Errors []SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessages `json:"messages,required"` - Result SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponse `json:"result,required"` +type SubscriptionReplaceResponseEnvelope struct { + Errors []SubscriptionReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []SubscriptionReplaceResponseEnvelopeMessages `json:"messages,required"` + Result SubscriptionReplaceResponse `json:"result,required"` // Whether the API call was successful - Success SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeJSON `json:"-"` + Success SubscriptionReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON subscriptionReplaceResponseEnvelopeJSON `json:"-"` } -// subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelope] -type subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeJSON struct { +// subscriptionReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [SubscriptionReplaceResponseEnvelope] +type subscriptionReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1214,53 +829,51 @@ type subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeJSON str ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrorsJSON `json:"-"` +type SubscriptionReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrors] -type subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrorsJSON struct { +// subscriptionReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [SubscriptionReplaceResponseEnvelopeErrors] +type subscriptionReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessagesJSON `json:"-"` +type SubscriptionReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON subscriptionReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessages] -type subscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessagesJSON struct { +// subscriptionReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [SubscriptionReplaceResponseEnvelopeMessages] +type subscriptionReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *SubscriptionReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeSuccess bool +type SubscriptionReplaceResponseEnvelopeSuccess bool const ( - SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeSuccessTrue SubscriptionZoneSubscriptionZoneSubscriptionDetailsResponseEnvelopeSuccess = true + SubscriptionReplaceResponseEnvelopeSuccessTrue SubscriptionReplaceResponseEnvelopeSuccess = true ) diff --git a/subscription_test.go b/subscription_test.go index 8860d4f9ae8..5007cc55015 100644 --- a/subscription_test.go +++ b/subscription_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestSubscriptionUpdateWithOptionalParams(t *testing.T) { +func TestSubscriptionNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,15 +29,14 @@ func TestSubscriptionUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Subscriptions.Update( + _, err := client.Subscriptions.New( context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", "506e3185e9c882d175a2d0cb0093d9f2", - cloudflare.SubscriptionUpdateParams{ - App: cloudflare.F(cloudflare.SubscriptionUpdateParamsApp{ + cloudflare.SubscriptionNewParams{ + App: cloudflare.F(cloudflare.SubscriptionNewParamsApp{ InstallID: cloudflare.F("string"), }), - ComponentValues: cloudflare.F([]cloudflare.SubscriptionUpdateParamsComponentValue{{ + ComponentValues: cloudflare.F([]cloudflare.SubscriptionNewParamsComponentValue{{ Default: cloudflare.F(5.000000), Name: cloudflare.F("page_rules"), Price: cloudflare.F(5.000000), @@ -53,8 +52,8 @@ func TestSubscriptionUpdateWithOptionalParams(t *testing.T) { Price: cloudflare.F(5.000000), Value: cloudflare.F(20.000000), }}), - Frequency: cloudflare.F(cloudflare.SubscriptionUpdateParamsFrequencyMonthly), - RatePlan: cloudflare.F(cloudflare.SubscriptionUpdateParamsRatePlan{ + Frequency: cloudflare.F(cloudflare.SubscriptionNewParamsFrequencyMonthly), + RatePlan: cloudflare.F(cloudflare.SubscriptionNewParamsRatePlan{ Currency: cloudflare.F("USD"), ExternallyManaged: cloudflare.F(false), ID: cloudflare.F[any]("free"), @@ -63,7 +62,7 @@ func TestSubscriptionUpdateWithOptionalParams(t *testing.T) { Scope: cloudflare.F("zone"), Sets: cloudflare.F([]string{"string", "string", "string"}), }), - Zone: cloudflare.F(cloudflare.SubscriptionUpdateParamsZone{}), + Zone: cloudflare.F(cloudflare.SubscriptionNewParamsZone{}), }, ) if err != nil { @@ -75,7 +74,7 @@ func TestSubscriptionUpdateWithOptionalParams(t *testing.T) { } } -func TestSubscriptionDelete(t *testing.T) { +func TestSubscriptionList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -91,11 +90,7 @@ func TestSubscriptionDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Subscriptions.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "506e3185e9c882d175a2d0cb0093d9f2", - ) + _, err := client.Subscriptions.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -105,7 +100,7 @@ func TestSubscriptionDelete(t *testing.T) { } } -func TestSubscriptionAccountSubscriptionsNewSubscriptionWithOptionalParams(t *testing.T) { +func TestSubscriptionDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -121,68 +116,11 @@ func TestSubscriptionAccountSubscriptionsNewSubscriptionWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Subscriptions.AccountSubscriptionsNewSubscription( + _, err := client.Subscriptions.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParams{ - App: cloudflare.F(cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParamsApp{ - InstallID: cloudflare.F("string"), - }), - ComponentValues: cloudflare.F([]cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParamsComponentValue{{ - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }}), - Frequency: cloudflare.F(cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParamsFrequencyMonthly), - RatePlan: cloudflare.F(cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParamsRatePlan{ - Currency: cloudflare.F("USD"), - ExternallyManaged: cloudflare.F(false), - ID: cloudflare.F[any]("free"), - IsContract: cloudflare.F(false), - PublicName: cloudflare.F("Business Plan"), - Scope: cloudflare.F("zone"), - Sets: cloudflare.F([]string{"string", "string", "string"}), - }), - Zone: cloudflare.F(cloudflare.SubscriptionAccountSubscriptionsNewSubscriptionParamsZone{}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestSubscriptionAccountSubscriptionsListSubscriptions(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), + "506e3185e9c882d175a2d0cb0093d9f2", ) - _, err := client.Subscriptions.AccountSubscriptionsListSubscriptions(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -192,7 +130,7 @@ func TestSubscriptionAccountSubscriptionsListSubscriptions(t *testing.T) { } } -func TestSubscriptionZoneSubscriptionNewZoneSubscriptionWithOptionalParams(t *testing.T) { +func TestSubscriptionGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -208,42 +146,7 @@ func TestSubscriptionZoneSubscriptionNewZoneSubscriptionWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Subscriptions.ZoneSubscriptionNewZoneSubscription( - context.TODO(), - "506e3185e9c882d175a2d0cb0093d9f2", - cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParams{ - App: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParamsApp{ - InstallID: cloudflare.F("string"), - }), - ComponentValues: cloudflare.F([]cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParamsComponentValue{{ - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }}), - Frequency: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParamsFrequencyMonthly), - RatePlan: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParamsRatePlan{ - Currency: cloudflare.F("USD"), - ExternallyManaged: cloudflare.F(false), - ID: cloudflare.F[any]("free"), - IsContract: cloudflare.F(false), - PublicName: cloudflare.F("Business Plan"), - Scope: cloudflare.F("zone"), - Sets: cloudflare.F([]string{"string", "string", "string"}), - }), - Zone: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionNewZoneSubscriptionParamsZone{}), - }, - ) + _, err := client.Subscriptions.Get(context.TODO(), "506e3185e9c882d175a2d0cb0093d9f2") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -253,7 +156,7 @@ func TestSubscriptionZoneSubscriptionNewZoneSubscriptionWithOptionalParams(t *te } } -func TestSubscriptionZoneSubscriptionUpdateZoneSubscriptionWithOptionalParams(t *testing.T) { +func TestSubscriptionReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -269,14 +172,15 @@ func TestSubscriptionZoneSubscriptionUpdateZoneSubscriptionWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Subscriptions.ZoneSubscriptionUpdateZoneSubscription( + _, err := client.Subscriptions.Replace( context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", "506e3185e9c882d175a2d0cb0093d9f2", - cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParams{ - App: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsApp{ + cloudflare.SubscriptionReplaceParams{ + App: cloudflare.F(cloudflare.SubscriptionReplaceParamsApp{ InstallID: cloudflare.F("string"), }), - ComponentValues: cloudflare.F([]cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsComponentValue{{ + ComponentValues: cloudflare.F([]cloudflare.SubscriptionReplaceParamsComponentValue{{ Default: cloudflare.F(5.000000), Name: cloudflare.F("page_rules"), Price: cloudflare.F(5.000000), @@ -292,8 +196,8 @@ func TestSubscriptionZoneSubscriptionUpdateZoneSubscriptionWithOptionalParams(t Price: cloudflare.F(5.000000), Value: cloudflare.F(20.000000), }}), - Frequency: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsFrequencyMonthly), - RatePlan: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsRatePlan{ + Frequency: cloudflare.F(cloudflare.SubscriptionReplaceParamsFrequencyMonthly), + RatePlan: cloudflare.F(cloudflare.SubscriptionReplaceParamsRatePlan{ Currency: cloudflare.F("USD"), ExternallyManaged: cloudflare.F(false), ID: cloudflare.F[any]("free"), @@ -302,7 +206,7 @@ func TestSubscriptionZoneSubscriptionUpdateZoneSubscriptionWithOptionalParams(t Scope: cloudflare.F("zone"), Sets: cloudflare.F([]string{"string", "string", "string"}), }), - Zone: cloudflare.F(cloudflare.SubscriptionZoneSubscriptionUpdateZoneSubscriptionParamsZone{}), + Zone: cloudflare.F(cloudflare.SubscriptionReplaceParamsZone{}), }, ) if err != nil { @@ -313,29 +217,3 @@ func TestSubscriptionZoneSubscriptionUpdateZoneSubscriptionWithOptionalParams(t t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestSubscriptionZoneSubscriptionZoneSubscriptionDetails(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Subscriptions.ZoneSubscriptionZoneSubscriptionDetails(context.TODO(), "506e3185e9c882d175a2d0cb0093d9f2") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/teamnetroute.go b/teamnetroute.go index e9d3c14ec6a..e0d9cbcdca0 100644 --- a/teamnetroute.go +++ b/teamnetroute.go @@ -13,6 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -39,19 +40,29 @@ func NewTeamnetRouteService(opts ...option.RequestOption) (r *TeamnetRouteServic } // Lists and filters private network routes in an account. -func (r *TeamnetRouteService) TunnelRouteListTunnelRoutes(ctx context.Context, accountID string, query TeamnetRouteTunnelRouteListTunnelRoutesParams, opts ...option.RequestOption) (res *[]TeamnetRouteTunnelRouteListTunnelRoutesResponse, err error) { - opts = append(r.Options[:], opts...) - var env TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelope +func (r *TeamnetRouteService) List(ctx context.Context, accountID string, query TeamnetRouteListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[TeamnetRouteListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/teamnet/routes", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Lists and filters private network routes in an account. +func (r *TeamnetRouteService) ListAutoPaging(ctx context.Context, accountID string, query TeamnetRouteListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[TeamnetRouteListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountID, query, opts...)) } -type TeamnetRouteTunnelRouteListTunnelRoutesResponse struct { +type TeamnetRouteListResponse struct { // UUID of the route. ID string `json:"id"` // Optional remark describing the route. @@ -64,7 +75,7 @@ type TeamnetRouteTunnelRouteListTunnelRoutesResponse struct { // The private IPv4 or IPv6 range connected by the route, in CIDR notation. Network string `json:"network"` // The type of tunnel. - TunType TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType `json:"tun_type"` + TunType TeamnetRouteListResponseTunType `json:"tun_type"` // UUID of the Cloudflare Tunnel serving the route. TunnelID interface{} `json:"tunnel_id"` // The user-friendly name of the Cloudflare Tunnel serving the route. @@ -74,13 +85,13 @@ type TeamnetRouteTunnelRouteListTunnelRoutesResponse struct { // account. VirtualNetworkID interface{} `json:"virtual_network_id"` // A user-friendly name for the virtual network. - VirtualNetworkName string `json:"virtual_network_name"` - JSON teamnetRouteTunnelRouteListTunnelRoutesResponseJSON `json:"-"` + VirtualNetworkName string `json:"virtual_network_name"` + JSON teamnetRouteListResponseJSON `json:"-"` } -// teamnetRouteTunnelRouteListTunnelRoutesResponseJSON contains the JSON metadata -// for the struct [TeamnetRouteTunnelRouteListTunnelRoutesResponse] -type teamnetRouteTunnelRouteListTunnelRoutesResponseJSON struct { +// teamnetRouteListResponseJSON contains the JSON metadata for the struct +// [TeamnetRouteListResponse] +type teamnetRouteListResponseJSON struct { ID apijson.Field Comment apijson.Field CreatedAt apijson.Field @@ -95,22 +106,22 @@ type teamnetRouteTunnelRouteListTunnelRoutesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *TeamnetRouteTunnelRouteListTunnelRoutesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetRouteListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of tunnel. -type TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType string +type TeamnetRouteListResponseTunType string const ( - TeamnetRouteTunnelRouteListTunnelRoutesResponseTunTypeCfdTunnel TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType = "cfd_tunnel" - TeamnetRouteTunnelRouteListTunnelRoutesResponseTunTypeWarpConnector TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType = "warp_connector" - TeamnetRouteTunnelRouteListTunnelRoutesResponseTunTypeIPSec TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType = "ip_sec" - TeamnetRouteTunnelRouteListTunnelRoutesResponseTunTypeGre TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType = "gre" - TeamnetRouteTunnelRouteListTunnelRoutesResponseTunTypeCni TeamnetRouteTunnelRouteListTunnelRoutesResponseTunType = "cni" + TeamnetRouteListResponseTunTypeCfdTunnel TeamnetRouteListResponseTunType = "cfd_tunnel" + TeamnetRouteListResponseTunTypeWarpConnector TeamnetRouteListResponseTunType = "warp_connector" + TeamnetRouteListResponseTunTypeIPSec TeamnetRouteListResponseTunType = "ip_sec" + TeamnetRouteListResponseTunTypeGre TeamnetRouteListResponseTunType = "gre" + TeamnetRouteListResponseTunTypeCni TeamnetRouteListResponseTunType = "cni" ) -type TeamnetRouteTunnelRouteListTunnelRoutesParams struct { +type TeamnetRouteListParams struct { // Optional remark describing the route. Comment param.Field[string] `query:"comment"` // If provided, include only routes that were created (and not deleted) before this @@ -137,113 +148,10 @@ type TeamnetRouteTunnelRouteListTunnelRoutesParams struct { VirtualNetworkID param.Field[interface{}] `query:"virtual_network_id"` } -// URLQuery serializes [TeamnetRouteTunnelRouteListTunnelRoutesParams]'s query -// parameters as `url.Values`. -func (r TeamnetRouteTunnelRouteListTunnelRoutesParams) URLQuery() (v url.Values) { +// URLQuery serializes [TeamnetRouteListParams]'s query parameters as `url.Values`. +func (r TeamnetRouteListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } - -type TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelope struct { - Errors []TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessages `json:"messages,required"` - Result []TeamnetRouteTunnelRouteListTunnelRoutesResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfo `json:"result_info"` - JSON teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeJSON `json:"-"` -} - -// teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelope] -type teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrorsJSON `json:"-"` -} - -// teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrors] -type teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessagesJSON `json:"-"` -} - -// teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessages] -type teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeSuccess bool - -const ( - TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeSuccessTrue TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeSuccess = true -) - -type TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfo] -type teamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TeamnetRouteTunnelRouteListTunnelRoutesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/teamnetroute_test.go b/teamnetroute_test.go index 2bd8cfcb8bc..ae2307d60d7 100644 --- a/teamnetroute_test.go +++ b/teamnetroute_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestTeamnetRouteTunnelRouteListTunnelRoutesWithOptionalParams(t *testing.T) { +func TestTeamnetRouteListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestTeamnetRouteTunnelRouteListTunnelRoutesWithOptionalParams(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.Routes.TunnelRouteListTunnelRoutes( + _, err := client.Teamnets.Routes.List( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.TeamnetRouteTunnelRouteListTunnelRoutesParams{ + cloudflare.TeamnetRouteListParams{ Comment: cloudflare.F("Example comment for this route."), ExistedAt: cloudflare.F[any](map[string]interface{}{}), IsDeleted: cloudflare.F[any](map[string]interface{}{}), diff --git a/teamnetroutenetwork.go b/teamnetroutenetwork.go index c8b97a8783f..a2452b434d2 100644 --- a/teamnetroutenetwork.go +++ b/teamnetroutenetwork.go @@ -36,9 +36,9 @@ func NewTeamnetRouteNetworkService(opts ...option.RequestOption) (r *TeamnetRout // Routes a private network through a Cloudflare Tunnel. The CIDR in // `ip_network_encoded` must be written in URL-encoded format. -func (r *TeamnetRouteNetworkService) Update(ctx context.Context, accountID string, ipNetworkEncoded string, body TeamnetRouteNetworkUpdateParams, opts ...option.RequestOption) (res *TeamnetRouteNetworkUpdateResponse, err error) { +func (r *TeamnetRouteNetworkService) New(ctx context.Context, accountID string, ipNetworkEncoded string, body TeamnetRouteNetworkNewParams, opts ...option.RequestOption) (res *TeamnetRouteNetworkNewResponse, err error) { opts = append(r.Options[:], opts...) - var env TeamnetRouteNetworkUpdateResponseEnvelope + var env TeamnetRouteNetworkNewResponseEnvelope path := fmt.Sprintf("accounts/%s/teamnet/routes/network/%s", accountID, ipNetworkEncoded) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -67,7 +67,7 @@ func (r *TeamnetRouteNetworkService) Delete(ctx context.Context, accountID strin return } -type TeamnetRouteNetworkUpdateResponse struct { +type TeamnetRouteNetworkNewResponse struct { // UUID of the route. ID string `json:"id"` // Optional remark describing the route. @@ -84,13 +84,13 @@ type TeamnetRouteNetworkUpdateResponse struct { // UUID of the Tunnel Virtual Network this route belongs to. If no virtual networks // are configured, the route is assigned to the default virtual network of the // account. - VirtualNetworkID interface{} `json:"virtual_network_id"` - JSON teamnetRouteNetworkUpdateResponseJSON `json:"-"` + VirtualNetworkID interface{} `json:"virtual_network_id"` + JSON teamnetRouteNetworkNewResponseJSON `json:"-"` } -// teamnetRouteNetworkUpdateResponseJSON contains the JSON metadata for the struct -// [TeamnetRouteNetworkUpdateResponse] -type teamnetRouteNetworkUpdateResponseJSON struct { +// teamnetRouteNetworkNewResponseJSON contains the JSON metadata for the struct +// [TeamnetRouteNetworkNewResponse] +type teamnetRouteNetworkNewResponseJSON struct { ID apijson.Field Comment apijson.Field CreatedAt apijson.Field @@ -102,7 +102,7 @@ type teamnetRouteNetworkUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *TeamnetRouteNetworkUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetRouteNetworkNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -145,7 +145,7 @@ func (r *TeamnetRouteNetworkDeleteResponse) UnmarshalJSON(data []byte) (err erro return apijson.UnmarshalRoot(data, r) } -type TeamnetRouteNetworkUpdateParams struct { +type TeamnetRouteNetworkNewParams struct { // Optional remark describing the route. Comment param.Field[string] `json:"comment"` // UUID of the Tunnel Virtual Network this route belongs to. If no virtual networks @@ -154,22 +154,22 @@ type TeamnetRouteNetworkUpdateParams struct { VirtualNetworkID param.Field[interface{}] `json:"virtual_network_id"` } -func (r TeamnetRouteNetworkUpdateParams) MarshalJSON() (data []byte, err error) { +func (r TeamnetRouteNetworkNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type TeamnetRouteNetworkUpdateResponseEnvelope struct { - Errors []TeamnetRouteNetworkUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetRouteNetworkUpdateResponseEnvelopeMessages `json:"messages,required"` - Result TeamnetRouteNetworkUpdateResponse `json:"result,required"` +type TeamnetRouteNetworkNewResponseEnvelope struct { + Errors []TeamnetRouteNetworkNewResponseEnvelopeErrors `json:"errors,required"` + Messages []TeamnetRouteNetworkNewResponseEnvelopeMessages `json:"messages,required"` + Result TeamnetRouteNetworkNewResponse `json:"result,required"` // Whether the API call was successful - Success TeamnetRouteNetworkUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON teamnetRouteNetworkUpdateResponseEnvelopeJSON `json:"-"` + Success TeamnetRouteNetworkNewResponseEnvelopeSuccess `json:"success,required"` + JSON teamnetRouteNetworkNewResponseEnvelopeJSON `json:"-"` } -// teamnetRouteNetworkUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [TeamnetRouteNetworkUpdateResponseEnvelope] -type teamnetRouteNetworkUpdateResponseEnvelopeJSON struct { +// teamnetRouteNetworkNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [TeamnetRouteNetworkNewResponseEnvelope] +type teamnetRouteNetworkNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -178,53 +178,53 @@ type teamnetRouteNetworkUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *TeamnetRouteNetworkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetRouteNetworkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetRouteNetworkUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetRouteNetworkUpdateResponseEnvelopeErrorsJSON `json:"-"` +type TeamnetRouteNetworkNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetRouteNetworkNewResponseEnvelopeErrorsJSON `json:"-"` } -// teamnetRouteNetworkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [TeamnetRouteNetworkUpdateResponseEnvelopeErrors] -type teamnetRouteNetworkUpdateResponseEnvelopeErrorsJSON struct { +// teamnetRouteNetworkNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [TeamnetRouteNetworkNewResponseEnvelopeErrors] +type teamnetRouteNetworkNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetRouteNetworkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetRouteNetworkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetRouteNetworkUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetRouteNetworkUpdateResponseEnvelopeMessagesJSON `json:"-"` +type TeamnetRouteNetworkNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetRouteNetworkNewResponseEnvelopeMessagesJSON `json:"-"` } -// teamnetRouteNetworkUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [TeamnetRouteNetworkUpdateResponseEnvelopeMessages] -type teamnetRouteNetworkUpdateResponseEnvelopeMessagesJSON struct { +// teamnetRouteNetworkNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [TeamnetRouteNetworkNewResponseEnvelopeMessages] +type teamnetRouteNetworkNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetRouteNetworkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetRouteNetworkNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TeamnetRouteNetworkUpdateResponseEnvelopeSuccess bool +type TeamnetRouteNetworkNewResponseEnvelopeSuccess bool const ( - TeamnetRouteNetworkUpdateResponseEnvelopeSuccessTrue TeamnetRouteNetworkUpdateResponseEnvelopeSuccess = true + TeamnetRouteNetworkNewResponseEnvelopeSuccessTrue TeamnetRouteNetworkNewResponseEnvelopeSuccess = true ) type TeamnetRouteNetworkDeleteParams struct { diff --git a/teamnetroutenetwork_test.go b/teamnetroutenetwork_test.go index 4de7d749e80..c2ce1fca6d9 100644 --- a/teamnetroutenetwork_test.go +++ b/teamnetroutenetwork_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestTeamnetRouteNetworkUpdateWithOptionalParams(t *testing.T) { +func TestTeamnetRouteNetworkNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestTeamnetRouteNetworkUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.Routes.Networks.Update( + _, err := client.Teamnets.Routes.Networks.New( context.TODO(), "699d98642c564d2e855e9661899b7252", "172.16.0.0%2F16", - cloudflare.TeamnetRouteNetworkUpdateParams{ + cloudflare.TeamnetRouteNetworkNewParams{ Comment: cloudflare.F("Example comment for this route."), VirtualNetworkID: cloudflare.F[any](map[string]interface{}{}), }, diff --git a/teamnetvirtualnetwork.go b/teamnetvirtualnetwork.go index cc87f42cd4a..6a0c8d83368 100644 --- a/teamnetvirtualnetwork.go +++ b/teamnetvirtualnetwork.go @@ -36,12 +36,12 @@ func NewTeamnetVirtualNetworkService(opts ...option.RequestOption) (r *TeamnetVi return } -// Updates an existing virtual network. -func (r *TeamnetVirtualNetworkService) Update(ctx context.Context, accountID string, virtualNetworkID string, body TeamnetVirtualNetworkUpdateParams, opts ...option.RequestOption) (res *TeamnetVirtualNetworkUpdateResponse, err error) { +// Adds a new virtual network to an account. +func (r *TeamnetVirtualNetworkService) New(ctx context.Context, accountID string, body TeamnetVirtualNetworkNewParams, opts ...option.RequestOption) (res *TeamnetVirtualNetworkNewResponse, err error) { opts = append(r.Options[:], opts...) - var env TeamnetVirtualNetworkUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks/%s", accountID, virtualNetworkID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env TeamnetVirtualNetworkNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -49,12 +49,12 @@ func (r *TeamnetVirtualNetworkService) Update(ctx context.Context, accountID str return } -// Deletes an existing virtual network. -func (r *TeamnetVirtualNetworkService) Delete(ctx context.Context, accountID string, virtualNetworkID string, opts ...option.RequestOption) (res *TeamnetVirtualNetworkDeleteResponse, err error) { +// Updates an existing virtual network. +func (r *TeamnetVirtualNetworkService) Update(ctx context.Context, accountID string, virtualNetworkID string, body TeamnetVirtualNetworkUpdateParams, opts ...option.RequestOption) (res *TeamnetVirtualNetworkUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env TeamnetVirtualNetworkDeleteResponseEnvelope + var env TeamnetVirtualNetworkUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks/%s", accountID, virtualNetworkID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -62,12 +62,12 @@ func (r *TeamnetVirtualNetworkService) Delete(ctx context.Context, accountID str return } -// Adds a new virtual network to an account. -func (r *TeamnetVirtualNetworkService) TunnelVirtualNetworkNewAVirtualNetwork(ctx context.Context, accountID string, body TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkParams, opts ...option.RequestOption) (res *TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse, err error) { +// Lists and filters virtual networks in an account. +func (r *TeamnetVirtualNetworkService) List(ctx context.Context, accountID string, query TeamnetVirtualNetworkListParams, opts ...option.RequestOption) (res *[]TeamnetVirtualNetworkListResponse, err error) { opts = append(r.Options[:], opts...) - var env TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelope + var env TeamnetVirtualNetworkListResponseEnvelope path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -75,12 +75,12 @@ func (r *TeamnetVirtualNetworkService) TunnelVirtualNetworkNewAVirtualNetwork(ct return } -// Lists and filters virtual networks in an account. -func (r *TeamnetVirtualNetworkService) TunnelVirtualNetworkListVirtualNetworks(ctx context.Context, accountID string, query TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams, opts ...option.RequestOption) (res *[]TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse, err error) { +// Deletes an existing virtual network. +func (r *TeamnetVirtualNetworkService) Delete(ctx context.Context, accountID string, virtualNetworkID string, opts ...option.RequestOption) (res *TeamnetVirtualNetworkDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelope - path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env TeamnetVirtualNetworkDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks/%s", accountID, virtualNetworkID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -88,15 +88,15 @@ func (r *TeamnetVirtualNetworkService) TunnelVirtualNetworkListVirtualNetworks(c return } -// Union satisfied by [TeamnetVirtualNetworkUpdateResponseUnknown], -// [TeamnetVirtualNetworkUpdateResponseArray] or [shared.UnionString]. -type TeamnetVirtualNetworkUpdateResponse interface { - ImplementsTeamnetVirtualNetworkUpdateResponse() +// Union satisfied by [TeamnetVirtualNetworkNewResponseUnknown], +// [TeamnetVirtualNetworkNewResponseArray] or [shared.UnionString]. +type TeamnetVirtualNetworkNewResponse interface { + ImplementsTeamnetVirtualNetworkNewResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*TeamnetVirtualNetworkUpdateResponse)(nil)).Elem(), + reflect.TypeOf((*TeamnetVirtualNetworkNewResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -105,42 +105,19 @@ func init() { ) } -type TeamnetVirtualNetworkUpdateResponseArray []interface{} +type TeamnetVirtualNetworkNewResponseArray []interface{} -func (r TeamnetVirtualNetworkUpdateResponseArray) ImplementsTeamnetVirtualNetworkUpdateResponse() {} +func (r TeamnetVirtualNetworkNewResponseArray) ImplementsTeamnetVirtualNetworkNewResponse() {} -// Union satisfied by [TeamnetVirtualNetworkDeleteResponseUnknown], -// [TeamnetVirtualNetworkDeleteResponseArray] or [shared.UnionString]. -type TeamnetVirtualNetworkDeleteResponse interface { - ImplementsTeamnetVirtualNetworkDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*TeamnetVirtualNetworkDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type TeamnetVirtualNetworkDeleteResponseArray []interface{} - -func (r TeamnetVirtualNetworkDeleteResponseArray) ImplementsTeamnetVirtualNetworkDeleteResponse() {} - -// Union satisfied by -// [TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseUnknown], -// [TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseArray] or -// [shared.UnionString]. -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse interface { - ImplementsTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse() +// Union satisfied by [TeamnetVirtualNetworkUpdateResponseUnknown], +// [TeamnetVirtualNetworkUpdateResponseArray] or [shared.UnionString]. +type TeamnetVirtualNetworkUpdateResponse interface { + ImplementsTeamnetVirtualNetworkUpdateResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse)(nil)).Elem(), + reflect.TypeOf((*TeamnetVirtualNetworkUpdateResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -149,12 +126,11 @@ func init() { ) } -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseArray []interface{} +type TeamnetVirtualNetworkUpdateResponseArray []interface{} -func (r TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseArray) ImplementsTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse() { -} +func (r TeamnetVirtualNetworkUpdateResponseArray) ImplementsTeamnetVirtualNetworkUpdateResponse() {} -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse struct { +type TeamnetVirtualNetworkListResponse struct { // UUID of the virtual network. ID string `json:"id,required"` // Optional remark describing the virtual network. @@ -167,14 +143,13 @@ type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse struct Name string `json:"name,required"` // Timestamp of when the virtual network was deleted. If `null`, the virtual // network has not been deleted. - DeletedAt interface{} `json:"deleted_at"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseJSON `json:"-"` + DeletedAt interface{} `json:"deleted_at"` + JSON teamnetVirtualNetworkListResponseJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse] -type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseJSON struct { +// teamnetVirtualNetworkListResponseJSON contains the JSON metadata for the struct +// [TeamnetVirtualNetworkListResponse] +type teamnetVirtualNetworkListResponseJSON struct { ID apijson.Field Comment apijson.Field CreatedAt apijson.Field @@ -185,35 +160,56 @@ type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseJSON st ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkUpdateParams struct { +// Union satisfied by [TeamnetVirtualNetworkDeleteResponseUnknown], +// [TeamnetVirtualNetworkDeleteResponseArray] or [shared.UnionString]. +type TeamnetVirtualNetworkDeleteResponse interface { + ImplementsTeamnetVirtualNetworkDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*TeamnetVirtualNetworkDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type TeamnetVirtualNetworkDeleteResponseArray []interface{} + +func (r TeamnetVirtualNetworkDeleteResponseArray) ImplementsTeamnetVirtualNetworkDeleteResponse() {} + +type TeamnetVirtualNetworkNewParams struct { + // A user-friendly name for the virtual network. + Name param.Field[string] `json:"name,required"` // Optional remark describing the virtual network. Comment param.Field[string] `json:"comment"` // If `true`, this virtual network is the default for the account. - IsDefaultNetwork param.Field[bool] `json:"is_default_network"` - // A user-friendly name for the virtual network. - Name param.Field[string] `json:"name"` + IsDefault param.Field[bool] `json:"is_default"` } -func (r TeamnetVirtualNetworkUpdateParams) MarshalJSON() (data []byte, err error) { +func (r TeamnetVirtualNetworkNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type TeamnetVirtualNetworkUpdateResponseEnvelope struct { - Errors []TeamnetVirtualNetworkUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetVirtualNetworkUpdateResponseEnvelopeMessages `json:"messages,required"` - Result TeamnetVirtualNetworkUpdateResponse `json:"result,required"` +type TeamnetVirtualNetworkNewResponseEnvelope struct { + Errors []TeamnetVirtualNetworkNewResponseEnvelopeErrors `json:"errors,required"` + Messages []TeamnetVirtualNetworkNewResponseEnvelopeMessages `json:"messages,required"` + Result TeamnetVirtualNetworkNewResponse `json:"result,required"` // Whether the API call was successful - Success TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON teamnetVirtualNetworkUpdateResponseEnvelopeJSON `json:"-"` + Success TeamnetVirtualNetworkNewResponseEnvelopeSuccess `json:"success,required"` + JSON teamnetVirtualNetworkNewResponseEnvelopeJSON `json:"-"` } -// teamnetVirtualNetworkUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [TeamnetVirtualNetworkUpdateResponseEnvelope] -type teamnetVirtualNetworkUpdateResponseEnvelopeJSON struct { +// teamnetVirtualNetworkNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [TeamnetVirtualNetworkNewResponseEnvelope] +type teamnetVirtualNetworkNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -222,67 +218,80 @@ type teamnetVirtualNetworkUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON `json:"-"` +type TeamnetVirtualNetworkNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkNewResponseEnvelopeErrorsJSON `json:"-"` } -// teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [TeamnetVirtualNetworkUpdateResponseEnvelopeErrors] -type teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON struct { +// teamnetVirtualNetworkNewResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkNewResponseEnvelopeErrors] +type teamnetVirtualNetworkNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON `json:"-"` +type TeamnetVirtualNetworkNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkNewResponseEnvelopeMessagesJSON `json:"-"` } -// teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [TeamnetVirtualNetworkUpdateResponseEnvelopeMessages] -type teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON struct { +// teamnetVirtualNetworkNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkNewResponseEnvelopeMessages] +type teamnetVirtualNetworkNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess bool +type TeamnetVirtualNetworkNewResponseEnvelopeSuccess bool const ( - TeamnetVirtualNetworkUpdateResponseEnvelopeSuccessTrue TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess = true + TeamnetVirtualNetworkNewResponseEnvelopeSuccessTrue TeamnetVirtualNetworkNewResponseEnvelopeSuccess = true ) -type TeamnetVirtualNetworkDeleteResponseEnvelope struct { - Errors []TeamnetVirtualNetworkDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetVirtualNetworkDeleteResponseEnvelopeMessages `json:"messages,required"` - Result TeamnetVirtualNetworkDeleteResponse `json:"result,required"` +type TeamnetVirtualNetworkUpdateParams struct { + // Optional remark describing the virtual network. + Comment param.Field[string] `json:"comment"` + // If `true`, this virtual network is the default for the account. + IsDefaultNetwork param.Field[bool] `json:"is_default_network"` + // A user-friendly name for the virtual network. + Name param.Field[string] `json:"name"` +} + +func (r TeamnetVirtualNetworkUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type TeamnetVirtualNetworkUpdateResponseEnvelope struct { + Errors []TeamnetVirtualNetworkUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []TeamnetVirtualNetworkUpdateResponseEnvelopeMessages `json:"messages,required"` + Result TeamnetVirtualNetworkUpdateResponse `json:"result,required"` // Whether the API call was successful - Success TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON teamnetVirtualNetworkDeleteResponseEnvelopeJSON `json:"-"` + Success TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON teamnetVirtualNetworkUpdateResponseEnvelopeJSON `json:"-"` } -// teamnetVirtualNetworkDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [TeamnetVirtualNetworkDeleteResponseEnvelope] -type teamnetVirtualNetworkDeleteResponseEnvelopeJSON struct { +// teamnetVirtualNetworkUpdateResponseEnvelopeJSON contains the JSON metadata for +// the struct [TeamnetVirtualNetworkUpdateResponseEnvelope] +type teamnetVirtualNetworkUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -291,261 +300,240 @@ type teamnetVirtualNetworkDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkDeleteResponseEnvelopeErrors struct { +type TeamnetVirtualNetworkUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON `json:"-"` + JSON teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [TeamnetVirtualNetworkDeleteResponseEnvelopeErrors] -type teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON struct { +// teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkUpdateResponseEnvelopeErrors] +type teamnetVirtualNetworkUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkDeleteResponseEnvelopeMessages struct { +type TeamnetVirtualNetworkUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON `json:"-"` + JSON teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [TeamnetVirtualNetworkDeleteResponseEnvelopeMessages] -type teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON struct { +// teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [TeamnetVirtualNetworkUpdateResponseEnvelopeMessages] +type teamnetVirtualNetworkUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess bool +type TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess bool const ( - TeamnetVirtualNetworkDeleteResponseEnvelopeSuccessTrue TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess = true + TeamnetVirtualNetworkUpdateResponseEnvelopeSuccessTrue TeamnetVirtualNetworkUpdateResponseEnvelopeSuccess = true ) -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkParams struct { +type TeamnetVirtualNetworkListParams struct { + // If `true`, only include the default virtual network. If `false`, exclude the + // default virtual network. If empty, all virtual networks will be included. + IsDefault param.Field[interface{}] `query:"is_default"` + // If `true`, only include deleted virtual networks. If `false`, exclude deleted + // virtual networks. If empty, all virtual networks will be included. + IsDeleted param.Field[interface{}] `query:"is_deleted"` // A user-friendly name for the virtual network. - Name param.Field[string] `json:"name,required"` - // Optional remark describing the virtual network. - Comment param.Field[string] `json:"comment"` - // If `true`, this virtual network is the default for the account. - IsDefault param.Field[bool] `json:"is_default"` + Name param.Field[string] `query:"name"` + // A user-friendly name for the virtual network. + VnetName param.Field[string] `query:"vnet_name"` } -func (r TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// URLQuery serializes [TeamnetVirtualNetworkListParams]'s query parameters as +// `url.Values`. +func (r TeamnetVirtualNetworkListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) } -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelope struct { - Errors []TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessages `json:"messages,required"` - Result TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponse `json:"result,required"` +type TeamnetVirtualNetworkListResponseEnvelope struct { + Errors []TeamnetVirtualNetworkListResponseEnvelopeErrors `json:"errors,required"` + Messages []TeamnetVirtualNetworkListResponseEnvelopeMessages `json:"messages,required"` + Result []TeamnetVirtualNetworkListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeSuccess `json:"success,required"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeJSON `json:"-"` + Success TeamnetVirtualNetworkListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo TeamnetVirtualNetworkListResponseEnvelopeResultInfo `json:"result_info"` + JSON teamnetVirtualNetworkListResponseEnvelopeJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelope] -type teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeJSON struct { +// teamnetVirtualNetworkListResponseEnvelopeJSON contains the JSON metadata for the +// struct [TeamnetVirtualNetworkListResponseEnvelope] +type teamnetVirtualNetworkListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrorsJSON `json:"-"` +type TeamnetVirtualNetworkListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkListResponseEnvelopeErrorsJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrors] -type teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrorsJSON struct { +// teamnetVirtualNetworkListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkListResponseEnvelopeErrors] +type teamnetVirtualNetworkListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessagesJSON `json:"-"` +type TeamnetVirtualNetworkListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkListResponseEnvelopeMessagesJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessages] -type teamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessagesJSON struct { +// teamnetVirtualNetworkListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkListResponseEnvelopeMessages] +type teamnetVirtualNetworkListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeSuccess bool +type TeamnetVirtualNetworkListResponseEnvelopeSuccess bool const ( - TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeSuccessTrue TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkResponseEnvelopeSuccess = true + TeamnetVirtualNetworkListResponseEnvelopeSuccessTrue TeamnetVirtualNetworkListResponseEnvelopeSuccess = true ) -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams struct { - // If `true`, only include the default virtual network. If `false`, exclude the - // default virtual network. If empty, all virtual networks will be included. - IsDefault param.Field[interface{}] `query:"is_default"` - // If `true`, only include deleted virtual networks. If `false`, exclude deleted - // virtual networks. If empty, all virtual networks will be included. - IsDeleted param.Field[interface{}] `query:"is_deleted"` - // A user-friendly name for the virtual network. - Name param.Field[string] `query:"name"` - // A user-friendly name for the virtual network. - VnetName param.Field[string] `query:"vnet_name"` +type TeamnetVirtualNetworkListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON teamnetVirtualNetworkListResponseEnvelopeResultInfoJSON `json:"-"` } -// URLQuery serializes -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams]'s query -// parameters as `url.Values`. -func (r TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +// teamnetVirtualNetworkListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [TeamnetVirtualNetworkListResponseEnvelopeResultInfo] +type teamnetVirtualNetworkListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field } -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelope struct { - Errors []TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrors `json:"errors,required"` - Messages []TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessages `json:"messages,required"` - Result []TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponse `json:"result,required,nullable"` +func (r *TeamnetVirtualNetworkListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TeamnetVirtualNetworkDeleteResponseEnvelope struct { + Errors []TeamnetVirtualNetworkDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []TeamnetVirtualNetworkDeleteResponseEnvelopeMessages `json:"messages,required"` + Result TeamnetVirtualNetworkDeleteResponse `json:"result,required"` // Whether the API call was successful - Success TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeSuccess `json:"success,required"` - ResultInfo TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfo `json:"result_info"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeJSON `json:"-"` + Success TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON teamnetVirtualNetworkDeleteResponseEnvelopeJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelope] -type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeJSON struct { +// teamnetVirtualNetworkDeleteResponseEnvelopeJSON contains the JSON metadata for +// the struct [TeamnetVirtualNetworkDeleteResponseEnvelope] +type teamnetVirtualNetworkDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrorsJSON `json:"-"` +type TeamnetVirtualNetworkDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrors] -type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrorsJSON struct { +// teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [TeamnetVirtualNetworkDeleteResponseEnvelopeErrors] +type teamnetVirtualNetworkDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessagesJSON `json:"-"` +type TeamnetVirtualNetworkDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessages] -type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessagesJSON struct { +// teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [TeamnetVirtualNetworkDeleteResponseEnvelopeMessages] +type teamnetVirtualNetworkDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TeamnetVirtualNetworkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeSuccess bool +type TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess bool const ( - TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeSuccessTrue TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeSuccess = true + TeamnetVirtualNetworkDeleteResponseEnvelopeSuccessTrue TeamnetVirtualNetworkDeleteResponseEnvelopeSuccess = true ) - -type TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfoJSON `json:"-"` -} - -// teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfo] -type teamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/teamnetvirtualnetwork_test.go b/teamnetvirtualnetwork_test.go index bddbe1eda82..ea3b2711d9b 100644 --- a/teamnetvirtualnetwork_test.go +++ b/teamnetvirtualnetwork_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestTeamnetVirtualNetworkUpdateWithOptionalParams(t *testing.T) { +func TestTeamnetVirtualNetworkNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,13 @@ func TestTeamnetVirtualNetworkUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.VirtualNetworks.Update( + _, err := client.Teamnets.VirtualNetworks.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.TeamnetVirtualNetworkUpdateParams{ - Comment: cloudflare.F("Staging VPC for data science"), - IsDefaultNetwork: cloudflare.F(true), - Name: cloudflare.F("us-east-1-vpc"), + cloudflare.TeamnetVirtualNetworkNewParams{ + Name: cloudflare.F("us-east-1-vpc"), + Comment: cloudflare.F("Staging VPC for data science"), + IsDefault: cloudflare.F(true), }, ) if err != nil { @@ -48,7 +47,7 @@ func TestTeamnetVirtualNetworkUpdateWithOptionalParams(t *testing.T) { } } -func TestTeamnetVirtualNetworkDelete(t *testing.T) { +func TestTeamnetVirtualNetworkUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -64,10 +63,15 @@ func TestTeamnetVirtualNetworkDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.VirtualNetworks.Delete( + _, err := client.Teamnets.VirtualNetworks.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + cloudflare.TeamnetVirtualNetworkUpdateParams{ + Comment: cloudflare.F("Staging VPC for data science"), + IsDefaultNetwork: cloudflare.F(true), + Name: cloudflare.F("us-east-1-vpc"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -78,7 +82,7 @@ func TestTeamnetVirtualNetworkDelete(t *testing.T) { } } -func TestTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkWithOptionalParams(t *testing.T) { +func TestTeamnetVirtualNetworkListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -94,13 +98,14 @@ func TestTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkWithOptional option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.VirtualNetworks.TunnelVirtualNetworkNewAVirtualNetwork( + _, err := client.Teamnets.VirtualNetworks.List( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkParams{ + cloudflare.TeamnetVirtualNetworkListParams{ + IsDefault: cloudflare.F[any](map[string]interface{}{}), + IsDeleted: cloudflare.F[any](map[string]interface{}{}), Name: cloudflare.F("us-east-1-vpc"), - Comment: cloudflare.F("Staging VPC for data science"), - IsDefault: cloudflare.F(true), + VnetName: cloudflare.F("us-east-1-vpc"), }, ) if err != nil { @@ -112,7 +117,7 @@ func TestTeamnetVirtualNetworkTunnelVirtualNetworkNewAVirtualNetworkWithOptional } } -func TestTeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksWithOptionalParams(t *testing.T) { +func TestTeamnetVirtualNetworkDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -128,15 +133,10 @@ func TestTeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksWithOptiona option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Teamnets.VirtualNetworks.TunnelVirtualNetworkListVirtualNetworks( + _, err := client.Teamnets.VirtualNetworks.Delete( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.TeamnetVirtualNetworkTunnelVirtualNetworkListVirtualNetworksParams{ - IsDefault: cloudflare.F[any](map[string]interface{}{}), - IsDeleted: cloudflare.F[any](map[string]interface{}{}), - Name: cloudflare.F("us-east-1-vpc"), - VnetName: cloudflare.F("us-east-1-vpc"), - }, + "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) if err != nil { var apierr *cloudflare.Error diff --git a/tunnel.go b/tunnel.go index fc594a393d3..158e6719f95 100644 --- a/tunnel.go +++ b/tunnel.go @@ -14,6 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -22,8 +23,12 @@ import ( // variables from the environment automatically. You should not instantiate this // service directly, and instead use the [NewTunnelService] method instead. type TunnelService struct { - Options []option.RequestOption - Connections *TunnelConnectionService + Options []option.RequestOption + Configurations *TunnelConfigurationService + Connections *TunnelConnectionService + Tokens *TunnelTokenService + Connectors *TunnelConnectorService + Management *TunnelManagementService } // NewTunnelService generates a new service that applies the given options to each @@ -32,16 +37,20 @@ type TunnelService struct { func NewTunnelService(opts ...option.RequestOption) (r *TunnelService) { r = &TunnelService{} r.Options = opts + r.Configurations = NewTunnelConfigurationService(opts...) r.Connections = NewTunnelConnectionService(opts...) + r.Tokens = NewTunnelTokenService(opts...) + r.Connectors = NewTunnelConnectorService(opts...) + r.Management = NewTunnelManagementService(opts...) return } -// Deletes an Argo Tunnel from an account. -func (r *TunnelService) Delete(ctx context.Context, accountID string, tunnelID string, body TunnelDeleteParams, opts ...option.RequestOption) (res *TunnelDeleteResponse, err error) { +// Creates a new Argo Tunnel in an account. +func (r *TunnelService) New(ctx context.Context, accountID string, body TunnelNewParams, opts ...option.RequestOption) (res *TunnelNewResponse, err error) { opts = append(r.Options[:], opts...) - var env TunnelDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/tunnels/%s", accountID, tunnelID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) + var env TunnelNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/tunnels", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -49,12 +58,12 @@ func (r *TunnelService) Delete(ctx context.Context, accountID string, tunnelID s return } -// Creates a new Argo Tunnel in an account. -func (r *TunnelService) ArgoTunnelNewAnArgoTunnel(ctx context.Context, accountID string, body TunnelArgoTunnelNewAnArgoTunnelParams, opts ...option.RequestOption) (res *TunnelArgoTunnelNewAnArgoTunnelResponse, err error) { +// Updates an existing Cloudflare Tunnel. +func (r *TunnelService) Update(ctx context.Context, accountID string, tunnelID string, body TunnelUpdateParams, opts ...option.RequestOption) (res *TunnelUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env TunnelArgoTunnelNewAnArgoTunnelResponseEnvelope - path := fmt.Sprintf("accounts/%s/tunnels", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env TunnelUpdateResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -63,11 +72,34 @@ func (r *TunnelService) ArgoTunnelNewAnArgoTunnel(ctx context.Context, accountID } // Lists and filters all types of Tunnels in an account. -func (r *TunnelService) ArgoTunnelListArgoTunnels(ctx context.Context, accountID string, query TunnelArgoTunnelListArgoTunnelsParams, opts ...option.RequestOption) (res *[]TunnelArgoTunnelListArgoTunnelsResponse, err error) { - opts = append(r.Options[:], opts...) - var env TunnelArgoTunnelListArgoTunnelsResponseEnvelope +func (r *TunnelService) List(ctx context.Context, accountID string, query TunnelListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[TunnelListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/tunnels", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Lists and filters all types of Tunnels in an account. +func (r *TunnelService) ListAutoPaging(ctx context.Context, accountID string, query TunnelListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[TunnelListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountID, query, opts...)) +} + +// Deletes an Argo Tunnel from an account. +func (r *TunnelService) Delete(ctx context.Context, accountID string, tunnelID string, body TunnelDeleteParams, opts ...option.RequestOption) (res *TunnelDeleteResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/tunnels/%s", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) if err != nil { return } @@ -88,24 +120,24 @@ func (r *TunnelService) Get(ctx context.Context, accountID string, tunnelID stri return } -type TunnelDeleteResponse struct { +type TunnelNewResponse struct { // UUID of the tunnel. ID string `json:"id,required"` // The tunnel connections between your origin and Cloudflare's edge. - Connections []TunnelDeleteResponseConnection `json:"connections,required"` + Connections []TunnelNewResponseConnection `json:"connections,required"` // Timestamp of when the tunnel was created. CreatedAt time.Time `json:"created_at,required" format:"date-time"` // A user-friendly name for the tunnel. Name string `json:"name,required"` // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - JSON tunnelDeleteResponseJSON `json:"-"` + DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` + JSON tunnelNewResponseJSON `json:"-"` } -// tunnelDeleteResponseJSON contains the JSON metadata for the struct -// [TunnelDeleteResponse] -type tunnelDeleteResponseJSON struct { +// tunnelNewResponseJSON contains the JSON metadata for the struct +// [TunnelNewResponse] +type tunnelNewResponseJSON struct { ID apijson.Field Connections apijson.Field CreatedAt apijson.Field @@ -115,11 +147,11 @@ type tunnelDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *TunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelDeleteResponseConnection struct { +type TunnelNewResponseConnection struct { // The Cloudflare data center used for this connection. ColoName string `json:"colo_name"` // Cloudflare continues to track connections for several minutes after they @@ -128,13 +160,13 @@ type TunnelDeleteResponseConnection struct { // tracked. If `false`, the connection is actively serving traffic. IsPendingReconnect bool `json:"is_pending_reconnect"` // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON tunnelDeleteResponseConnectionJSON `json:"-"` + Uuid string `json:"uuid"` + JSON tunnelNewResponseConnectionJSON `json:"-"` } -// tunnelDeleteResponseConnectionJSON contains the JSON metadata for the struct -// [TunnelDeleteResponseConnection] -type tunnelDeleteResponseConnectionJSON struct { +// tunnelNewResponseConnectionJSON contains the JSON metadata for the struct +// [TunnelNewResponseConnection] +type tunnelNewResponseConnectionJSON struct { ColoName apijson.Field IsPendingReconnect apijson.Field Uuid apijson.Field @@ -142,42 +174,200 @@ type tunnelDeleteResponseConnectionJSON struct { ExtraFields map[string]apijson.Field } -func (r *TunnelDeleteResponseConnection) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelNewResponseConnection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelNewAnArgoTunnelResponse struct { +// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. +// +// Union satisfied by [TunnelUpdateResponseTunnelCfdTunnel] or +// [TunnelUpdateResponseTunnelWarpConnectorTunnel]. +type TunnelUpdateResponse interface { + implementsTunnelUpdateResponse() +} + +func init() { + apijson.RegisterUnion(reflect.TypeOf((*TunnelUpdateResponse)(nil)).Elem(), "") +} + +// A Cloudflare Tunnel that connects your origin to Cloudflare's edge. +type TunnelUpdateResponseTunnelCfdTunnel struct { // UUID of the tunnel. - ID string `json:"id,required"` - // The tunnel connections between your origin and Cloudflare's edge. - Connections []TunnelArgoTunnelNewAnArgoTunnelResponseConnection `json:"connections,required"` + ID string `json:"id"` + // Cloudflare account ID + AccountTag string `json:"account_tag"` + // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. + Connections []TunnelUpdateResponseTunnelCfdTunnelConnection `json:"connections"` + // Timestamp of when the tunnel established at least one connection to Cloudflare's + // edge. If `null`, the tunnel is inactive. + ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` + // Timestamp of when the tunnel became inactive (no connections to Cloudflare's + // edge). If `null`, the tunnel is active. + ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` // Timestamp of when the tunnel was created. - CreatedAt time.Time `json:"created_at,required" format:"date-time"` + CreatedAt time.Time `json:"created_at" format:"date-time"` + // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been + // deleted. + DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` + // Metadata associated with the tunnel. + Metadata interface{} `json:"metadata"` // A user-friendly name for the tunnel. - Name string `json:"name,required"` + Name string `json:"name"` + // If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. + // If `false`, the tunnel must be configured locally on the origin machine. + RemoteConfig bool `json:"remote_config"` + // The status of the tunnel. Valid values are `inactive` (tunnel has never been + // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy + // state), `healthy` (tunnel is active and able to serve traffic), or `down` + // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + Status string `json:"status"` + // The type of tunnel. + TunType TunnelUpdateResponseTunnelCfdTunnelTunType `json:"tun_type"` + JSON tunnelUpdateResponseTunnelCfdTunnelJSON `json:"-"` +} + +// tunnelUpdateResponseTunnelCfdTunnelJSON contains the JSON metadata for the +// struct [TunnelUpdateResponseTunnelCfdTunnel] +type tunnelUpdateResponseTunnelCfdTunnelJSON struct { + ID apijson.Field + AccountTag apijson.Field + Connections apijson.Field + ConnsActiveAt apijson.Field + ConnsInactiveAt apijson.Field + CreatedAt apijson.Field + DeletedAt apijson.Field + Metadata apijson.Field + Name apijson.Field + RemoteConfig apijson.Field + Status apijson.Field + TunType apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelUpdateResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r TunnelUpdateResponseTunnelCfdTunnel) implementsTunnelUpdateResponse() {} + +type TunnelUpdateResponseTunnelCfdTunnelConnection struct { + // UUID of the Cloudflare Tunnel connection. + ID string `json:"id"` + // UUID of the cloudflared instance. + ClientID interface{} `json:"client_id"` + // The cloudflared version used to establish this connection. + ClientVersion string `json:"client_version"` + // The Cloudflare data center used for this connection. + ColoName string `json:"colo_name"` + // Cloudflare continues to track connections for several minutes after they + // disconnect. This is an optimization to improve latency and reliability of + // reconnecting. If `true`, the connection has disconnected but is still being + // tracked. If `false`, the connection is actively serving traffic. + IsPendingReconnect bool `json:"is_pending_reconnect"` + // Timestamp of when the connection was established. + OpenedAt time.Time `json:"opened_at" format:"date-time"` + // The public IP address of the host running cloudflared. + OriginIP string `json:"origin_ip"` + // UUID of the Cloudflare Tunnel connection. + Uuid string `json:"uuid"` + JSON tunnelUpdateResponseTunnelCfdTunnelConnectionJSON `json:"-"` +} + +// tunnelUpdateResponseTunnelCfdTunnelConnectionJSON contains the JSON metadata for +// the struct [TunnelUpdateResponseTunnelCfdTunnelConnection] +type tunnelUpdateResponseTunnelCfdTunnelConnectionJSON struct { + ID apijson.Field + ClientID apijson.Field + ClientVersion apijson.Field + ColoName apijson.Field + IsPendingReconnect apijson.Field + OpenedAt apijson.Field + OriginIP apijson.Field + Uuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelUpdateResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// The type of tunnel. +type TunnelUpdateResponseTunnelCfdTunnelTunType string + +const ( + TunnelUpdateResponseTunnelCfdTunnelTunTypeCfdTunnel TunnelUpdateResponseTunnelCfdTunnelTunType = "cfd_tunnel" + TunnelUpdateResponseTunnelCfdTunnelTunTypeWarpConnector TunnelUpdateResponseTunnelCfdTunnelTunType = "warp_connector" + TunnelUpdateResponseTunnelCfdTunnelTunTypeIPSec TunnelUpdateResponseTunnelCfdTunnelTunType = "ip_sec" + TunnelUpdateResponseTunnelCfdTunnelTunTypeGre TunnelUpdateResponseTunnelCfdTunnelTunType = "gre" + TunnelUpdateResponseTunnelCfdTunnelTunTypeCni TunnelUpdateResponseTunnelCfdTunnelTunType = "cni" +) + +// A Warp Connector Tunnel that connects your origin to Cloudflare's edge. +type TunnelUpdateResponseTunnelWarpConnectorTunnel struct { + // UUID of the tunnel. + ID string `json:"id"` + // Cloudflare account ID + AccountTag string `json:"account_tag"` + // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. + Connections []TunnelUpdateResponseTunnelWarpConnectorTunnelConnection `json:"connections"` + // Timestamp of when the tunnel established at least one connection to Cloudflare's + // edge. If `null`, the tunnel is inactive. + ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` + // Timestamp of when the tunnel became inactive (no connections to Cloudflare's + // edge). If `null`, the tunnel is active. + ConnsInactiveAt time.Time `json:"conns_inactive_at,nullable" format:"date-time"` + // Timestamp of when the tunnel was created. + CreatedAt time.Time `json:"created_at" format:"date-time"` // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been // deleted. - DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` - JSON tunnelArgoTunnelNewAnArgoTunnelResponseJSON `json:"-"` + DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` + // Metadata associated with the tunnel. + Metadata interface{} `json:"metadata"` + // A user-friendly name for the tunnel. + Name string `json:"name"` + // The status of the tunnel. Valid values are `inactive` (tunnel has never been + // run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy + // state), `healthy` (tunnel is active and able to serve traffic), or `down` + // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + Status string `json:"status"` + // The type of tunnel. + TunType TunnelUpdateResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` + JSON tunnelUpdateResponseTunnelWarpConnectorTunnelJSON `json:"-"` } -// tunnelArgoTunnelNewAnArgoTunnelResponseJSON contains the JSON metadata for the -// struct [TunnelArgoTunnelNewAnArgoTunnelResponse] -type tunnelArgoTunnelNewAnArgoTunnelResponseJSON struct { - ID apijson.Field - Connections apijson.Field - CreatedAt apijson.Field - Name apijson.Field - DeletedAt apijson.Field - raw string - ExtraFields map[string]apijson.Field +// tunnelUpdateResponseTunnelWarpConnectorTunnelJSON contains the JSON metadata for +// the struct [TunnelUpdateResponseTunnelWarpConnectorTunnel] +type tunnelUpdateResponseTunnelWarpConnectorTunnelJSON struct { + ID apijson.Field + AccountTag apijson.Field + Connections apijson.Field + ConnsActiveAt apijson.Field + ConnsInactiveAt apijson.Field + CreatedAt apijson.Field + DeletedAt apijson.Field + Metadata apijson.Field + Name apijson.Field + Status apijson.Field + TunType apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelNewAnArgoTunnelResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelUpdateResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelNewAnArgoTunnelResponseConnection struct { +func (r TunnelUpdateResponseTunnelWarpConnectorTunnel) implementsTunnelUpdateResponse() {} + +type TunnelUpdateResponseTunnelWarpConnectorTunnelConnection struct { + // UUID of the Cloudflare Tunnel connection. + ID string `json:"id"` + // UUID of the cloudflared instance. + ClientID interface{} `json:"client_id"` + // The cloudflared version used to establish this connection. + ClientVersion string `json:"client_version"` // The Cloudflare data center used for this connection. ColoName string `json:"colo_name"` // Cloudflare continues to track connections for several minutes after they @@ -185,45 +375,66 @@ type TunnelArgoTunnelNewAnArgoTunnelResponseConnection struct { // reconnecting. If `true`, the connection has disconnected but is still being // tracked. If `false`, the connection is actively serving traffic. IsPendingReconnect bool `json:"is_pending_reconnect"` + // Timestamp of when the connection was established. + OpenedAt time.Time `json:"opened_at" format:"date-time"` + // The public IP address of the host running cloudflared. + OriginIP string `json:"origin_ip"` // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON tunnelArgoTunnelNewAnArgoTunnelResponseConnectionJSON `json:"-"` + Uuid string `json:"uuid"` + JSON tunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` } -// tunnelArgoTunnelNewAnArgoTunnelResponseConnectionJSON contains the JSON metadata -// for the struct [TunnelArgoTunnelNewAnArgoTunnelResponseConnection] -type tunnelArgoTunnelNewAnArgoTunnelResponseConnectionJSON struct { +// tunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON contains the JSON +// metadata for the struct +// [TunnelUpdateResponseTunnelWarpConnectorTunnelConnection] +type tunnelUpdateResponseTunnelWarpConnectorTunnelConnectionJSON struct { + ID apijson.Field + ClientID apijson.Field + ClientVersion apijson.Field ColoName apijson.Field IsPendingReconnect apijson.Field + OpenedAt apijson.Field + OriginIP apijson.Field Uuid apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelNewAnArgoTunnelResponseConnection) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelUpdateResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +// The type of tunnel. +type TunnelUpdateResponseTunnelWarpConnectorTunnelTunType string + +const ( + TunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel TunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" + TunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeWarpConnector TunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "warp_connector" + TunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeIPSec TunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "ip_sec" + TunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeGre TunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "gre" + TunnelUpdateResponseTunnelWarpConnectorTunnelTunTypeCni TunnelUpdateResponseTunnelWarpConnectorTunnelTunType = "cni" +) + // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. // -// Union satisfied by [TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel] or -// [TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel]. -type TunnelArgoTunnelListArgoTunnelsResponse interface { - implementsTunnelArgoTunnelListArgoTunnelsResponse() +// Union satisfied by [TunnelListResponseTunnelCfdTunnel] or +// [TunnelListResponseTunnelWarpConnectorTunnel]. +type TunnelListResponse interface { + implementsTunnelListResponse() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*TunnelArgoTunnelListArgoTunnelsResponse)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*TunnelListResponse)(nil)).Elem(), "") } // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. -type TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel struct { +type TunnelListResponseTunnelCfdTunnel struct { // UUID of the tunnel. ID string `json:"id"` // Cloudflare account ID AccountTag string `json:"account_tag"` // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnection `json:"connections"` + Connections []TunnelListResponseTunnelCfdTunnelConnection `json:"connections"` // Timestamp of when the tunnel established at least one connection to Cloudflare's // edge. If `null`, the tunnel is inactive. ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` @@ -248,13 +459,13 @@ type TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel struct { // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). Status string `json:"status"` // The type of tunnel. - TunType TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType `json:"tun_type"` - JSON tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelJSON `json:"-"` + TunType TunnelListResponseTunnelCfdTunnelTunType `json:"tun_type"` + JSON tunnelListResponseTunnelCfdTunnelJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelJSON contains the JSON -// metadata for the struct [TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel] -type tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelJSON struct { +// tunnelListResponseTunnelCfdTunnelJSON contains the JSON metadata for the struct +// [TunnelListResponseTunnelCfdTunnel] +type tunnelListResponseTunnelCfdTunnelJSON struct { ID apijson.Field AccountTag apijson.Field Connections apijson.Field @@ -271,14 +482,13 @@ type tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelJSON struct { ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelListResponseTunnelCfdTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnel) implementsTunnelArgoTunnelListArgoTunnelsResponse() { -} +func (r TunnelListResponseTunnelCfdTunnel) implementsTunnelListResponse() {} -type TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnection struct { +type TunnelListResponseTunnelCfdTunnelConnection struct { // UUID of the Cloudflare Tunnel connection. ID string `json:"id"` // UUID of the cloudflared instance. @@ -297,14 +507,13 @@ type TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnection struct { // The public IP address of the host running cloudflared. OriginIP string `json:"origin_ip"` // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnectionJSON `json:"-"` + Uuid string `json:"uuid"` + JSON tunnelListResponseTunnelCfdTunnelConnectionJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnectionJSON contains -// the JSON metadata for the struct -// [TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnection] -type tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnectionJSON struct { +// tunnelListResponseTunnelCfdTunnelConnectionJSON contains the JSON metadata for +// the struct [TunnelListResponseTunnelCfdTunnelConnection] +type tunnelListResponseTunnelCfdTunnelConnectionJSON struct { ID apijson.Field ClientID apijson.Field ClientVersion apijson.Field @@ -317,29 +526,29 @@ type tunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnectionJSON struct ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelListResponseTunnelCfdTunnelConnection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of tunnel. -type TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType string +type TunnelListResponseTunnelCfdTunnelTunType string const ( - TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunTypeCfdTunnel TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType = "cfd_tunnel" - TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunTypeWarpConnector TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType = "warp_connector" - TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunTypeIPSec TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType = "ip_sec" - TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunTypeGre TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType = "gre" - TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunTypeCni TunnelArgoTunnelListArgoTunnelsResponseTunnelCfdTunnelTunType = "cni" + TunnelListResponseTunnelCfdTunnelTunTypeCfdTunnel TunnelListResponseTunnelCfdTunnelTunType = "cfd_tunnel" + TunnelListResponseTunnelCfdTunnelTunTypeWarpConnector TunnelListResponseTunnelCfdTunnelTunType = "warp_connector" + TunnelListResponseTunnelCfdTunnelTunTypeIPSec TunnelListResponseTunnelCfdTunnelTunType = "ip_sec" + TunnelListResponseTunnelCfdTunnelTunTypeGre TunnelListResponseTunnelCfdTunnelTunType = "gre" + TunnelListResponseTunnelCfdTunnelTunTypeCni TunnelListResponseTunnelCfdTunnelTunType = "cni" ) // A Warp Connector Tunnel that connects your origin to Cloudflare's edge. -type TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel struct { +type TunnelListResponseTunnelWarpConnectorTunnel struct { // UUID of the tunnel. ID string `json:"id"` // Cloudflare account ID AccountTag string `json:"account_tag"` // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Connections []TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnection `json:"connections"` + Connections []TunnelListResponseTunnelWarpConnectorTunnelConnection `json:"connections"` // Timestamp of when the tunnel established at least one connection to Cloudflare's // edge. If `null`, the tunnel is inactive. ConnsActiveAt time.Time `json:"conns_active_at,nullable" format:"date-time"` @@ -361,14 +570,13 @@ type TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel struct { // (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). Status string `json:"status"` // The type of tunnel. - TunType TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` - JSON tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelJSON `json:"-"` + TunType TunnelListResponseTunnelWarpConnectorTunnelTunType `json:"tun_type"` + JSON tunnelListResponseTunnelWarpConnectorTunnelJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelJSON contains -// the JSON metadata for the struct -// [TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel] -type tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelJSON struct { +// tunnelListResponseTunnelWarpConnectorTunnelJSON contains the JSON metadata for +// the struct [TunnelListResponseTunnelWarpConnectorTunnel] +type tunnelListResponseTunnelWarpConnectorTunnelJSON struct { ID apijson.Field AccountTag apijson.Field Connections apijson.Field @@ -384,14 +592,13 @@ type tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelJSON struct ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelListResponseTunnelWarpConnectorTunnel) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnel) implementsTunnelArgoTunnelListArgoTunnelsResponse() { -} +func (r TunnelListResponseTunnelWarpConnectorTunnel) implementsTunnelListResponse() {} -type TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnection struct { +type TunnelListResponseTunnelWarpConnectorTunnelConnection struct { // UUID of the Cloudflare Tunnel connection. ID string `json:"id"` // UUID of the cloudflared instance. @@ -410,14 +617,13 @@ type TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnection // The public IP address of the host running cloudflared. OriginIP string `json:"origin_ip"` // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` + Uuid string `json:"uuid"` + JSON tunnelListResponseTunnelWarpConnectorTunnelConnectionJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON -// contains the JSON metadata for the struct -// [TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnection] -type tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnectionJSON struct { +// tunnelListResponseTunnelWarpConnectorTunnelConnectionJSON contains the JSON +// metadata for the struct [TunnelListResponseTunnelWarpConnectorTunnelConnection] +type tunnelListResponseTunnelWarpConnectorTunnelConnectionJSON struct { ID apijson.Field ClientID apijson.Field ClientVersion apijson.Field @@ -430,21 +636,79 @@ type tunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnectionJ ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelListResponseTunnelWarpConnectorTunnelConnection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The type of tunnel. -type TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType string +type TunnelListResponseTunnelWarpConnectorTunnelTunType string const ( - TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" - TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunTypeWarpConnector TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType = "warp_connector" - TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunTypeIPSec TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType = "ip_sec" - TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunTypeGre TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType = "gre" - TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunTypeCni TunnelArgoTunnelListArgoTunnelsResponseTunnelWarpConnectorTunnelTunType = "cni" + TunnelListResponseTunnelWarpConnectorTunnelTunTypeCfdTunnel TunnelListResponseTunnelWarpConnectorTunnelTunType = "cfd_tunnel" + TunnelListResponseTunnelWarpConnectorTunnelTunTypeWarpConnector TunnelListResponseTunnelWarpConnectorTunnelTunType = "warp_connector" + TunnelListResponseTunnelWarpConnectorTunnelTunTypeIPSec TunnelListResponseTunnelWarpConnectorTunnelTunType = "ip_sec" + TunnelListResponseTunnelWarpConnectorTunnelTunTypeGre TunnelListResponseTunnelWarpConnectorTunnelTunType = "gre" + TunnelListResponseTunnelWarpConnectorTunnelTunTypeCni TunnelListResponseTunnelWarpConnectorTunnelTunType = "cni" ) +type TunnelDeleteResponse struct { + // UUID of the tunnel. + ID string `json:"id,required"` + // The tunnel connections between your origin and Cloudflare's edge. + Connections []TunnelDeleteResponseConnection `json:"connections,required"` + // Timestamp of when the tunnel was created. + CreatedAt time.Time `json:"created_at,required" format:"date-time"` + // A user-friendly name for the tunnel. + Name string `json:"name,required"` + // Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been + // deleted. + DeletedAt time.Time `json:"deleted_at,nullable" format:"date-time"` + JSON tunnelDeleteResponseJSON `json:"-"` +} + +// tunnelDeleteResponseJSON contains the JSON metadata for the struct +// [TunnelDeleteResponse] +type tunnelDeleteResponseJSON struct { + ID apijson.Field + Connections apijson.Field + CreatedAt apijson.Field + Name apijson.Field + DeletedAt apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelDeleteResponseConnection struct { + // The Cloudflare data center used for this connection. + ColoName string `json:"colo_name"` + // Cloudflare continues to track connections for several minutes after they + // disconnect. This is an optimization to improve latency and reliability of + // reconnecting. If `true`, the connection has disconnected but is still being + // tracked. If `false`, the connection is actively serving traffic. + IsPendingReconnect bool `json:"is_pending_reconnect"` + // UUID of the Cloudflare Tunnel connection. + Uuid string `json:"uuid"` + JSON tunnelDeleteResponseConnectionJSON `json:"-"` +} + +// tunnelDeleteResponseConnectionJSON contains the JSON metadata for the struct +// [TunnelDeleteResponseConnection] +type tunnelDeleteResponseConnectionJSON struct { + ColoName apijson.Field + IsPendingReconnect apijson.Field + Uuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelDeleteResponseConnection) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type TunnelGetResponse struct { // UUID of the tunnel. ID string `json:"id,required"` @@ -503,26 +767,30 @@ func (r *TunnelGetResponseConnection) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelDeleteParams struct { - Body param.Field[interface{}] `json:"body,required"` +type TunnelNewParams struct { + // A user-friendly name for the tunnel. + Name param.Field[string] `json:"name,required"` + // Sets the password required to run the tunnel. Must be at least 32 bytes and + // encoded as a base64 string. + TunnelSecret param.Field[interface{}] `json:"tunnel_secret,required"` } -func (r TunnelDeleteParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) +func (r TunnelNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type TunnelDeleteResponseEnvelope struct { - Errors []TunnelDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []TunnelDeleteResponseEnvelopeMessages `json:"messages,required"` - Result TunnelDeleteResponse `json:"result,required"` +type TunnelNewResponseEnvelope struct { + Errors []TunnelNewResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelNewResponseEnvelopeMessages `json:"messages,required"` + Result TunnelNewResponse `json:"result,required"` // Whether the API call was successful - Success TunnelDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON tunnelDeleteResponseEnvelopeJSON `json:"-"` + Success TunnelNewResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelNewResponseEnvelopeJSON `json:"-"` } -// tunnelDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [TunnelDeleteResponseEnvelope] -type tunnelDeleteResponseEnvelopeJSON struct { +// tunnelNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [TunnelNewResponseEnvelope] +type tunnelNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -531,79 +799,80 @@ type tunnelDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *TunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelDeleteResponseEnvelopeErrorsJSON `json:"-"` +type TunnelNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelNewResponseEnvelopeErrorsJSON `json:"-"` } -// tunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct -// [TunnelDeleteResponseEnvelopeErrors] -type tunnelDeleteResponseEnvelopeErrorsJSON struct { +// tunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [TunnelNewResponseEnvelopeErrors] +type tunnelNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelDeleteResponseEnvelopeMessagesJSON `json:"-"` +type TunnelNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelNewResponseEnvelopeMessagesJSON `json:"-"` } -// tunnelDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [TunnelDeleteResponseEnvelopeMessages] -type tunnelDeleteResponseEnvelopeMessagesJSON struct { +// tunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [TunnelNewResponseEnvelopeMessages] +type tunnelNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TunnelDeleteResponseEnvelopeSuccess bool +type TunnelNewResponseEnvelopeSuccess bool const ( - TunnelDeleteResponseEnvelopeSuccessTrue TunnelDeleteResponseEnvelopeSuccess = true + TunnelNewResponseEnvelopeSuccessTrue TunnelNewResponseEnvelopeSuccess = true ) -type TunnelArgoTunnelNewAnArgoTunnelParams struct { +type TunnelUpdateParams struct { // A user-friendly name for the tunnel. - Name param.Field[string] `json:"name,required"` - // Sets the password required to run the tunnel. Must be at least 32 bytes and - // encoded as a base64 string. - TunnelSecret param.Field[interface{}] `json:"tunnel_secret,required"` + Name param.Field[string] `json:"name"` + // Sets the password required to run a locally-managed tunnel. Must be at least 32 + // bytes and encoded as a base64 string. + TunnelSecret param.Field[string] `json:"tunnel_secret"` } -func (r TunnelArgoTunnelNewAnArgoTunnelParams) MarshalJSON() (data []byte, err error) { +func (r TunnelUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type TunnelArgoTunnelNewAnArgoTunnelResponseEnvelope struct { - Errors []TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrors `json:"errors,required"` - Messages []TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessages `json:"messages,required"` - Result TunnelArgoTunnelNewAnArgoTunnelResponse `json:"result,required"` +type TunnelUpdateResponseEnvelope struct { + Errors []TunnelUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelUpdateResponseEnvelopeMessages `json:"messages,required"` + // A Cloudflare Tunnel that connects your origin to Cloudflare's edge. + Result TunnelUpdateResponse `json:"result,required"` // Whether the API call was successful - Success TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeSuccess `json:"success,required"` - JSON tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeJSON `json:"-"` + Success TunnelUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelUpdateResponseEnvelopeJSON `json:"-"` } -// tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeJSON contains the JSON metadata -// for the struct [TunnelArgoTunnelNewAnArgoTunnelResponseEnvelope] -type tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeJSON struct { +// tunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [TunnelUpdateResponseEnvelope] +type tunnelUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -612,57 +881,56 @@ type tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelNewAnArgoTunnelResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrorsJSON `json:"-"` +type TunnelUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrors] -type tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrorsJSON struct { +// tunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [TunnelUpdateResponseEnvelopeErrors] +type tunnelUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessagesJSON `json:"-"` +type TunnelUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessages] -type tunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessagesJSON struct { +// tunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [TunnelUpdateResponseEnvelopeMessages] +type tunnelUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeSuccess bool +type TunnelUpdateResponseEnvelopeSuccess bool const ( - TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeSuccessTrue TunnelArgoTunnelNewAnArgoTunnelResponseEnvelopeSuccess = true + TunnelUpdateResponseEnvelopeSuccessTrue TunnelUpdateResponseEnvelopeSuccess = true ) -type TunnelArgoTunnelListArgoTunnelsParams struct { +type TunnelListParams struct { ExcludePrefix param.Field[string] `query:"exclude_prefix"` // If provided, include only tunnels that were created (and not deleted) before // this time. @@ -683,115 +951,91 @@ type TunnelArgoTunnelListArgoTunnelsParams struct { WasInactiveAt param.Field[time.Time] `query:"was_inactive_at" format:"date-time"` } -// URLQuery serializes [TunnelArgoTunnelListArgoTunnelsParams]'s query parameters -// as `url.Values`. -func (r TunnelArgoTunnelListArgoTunnelsParams) URLQuery() (v url.Values) { +// URLQuery serializes [TunnelListParams]'s query parameters as `url.Values`. +func (r TunnelListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type TunnelArgoTunnelListArgoTunnelsResponseEnvelope struct { - Errors []TunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrors `json:"errors,required"` - Messages []TunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessages `json:"messages,required"` - Result []TunnelArgoTunnelListArgoTunnelsResponse `json:"result,required,nullable"` +type TunnelDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r TunnelDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type TunnelDeleteResponseEnvelope struct { + Errors []TunnelDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelDeleteResponseEnvelopeMessages `json:"messages,required"` + Result TunnelDeleteResponse `json:"result,required"` // Whether the API call was successful - Success TunnelArgoTunnelListArgoTunnelsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo TunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfo `json:"result_info"` - JSON tunnelArgoTunnelListArgoTunnelsResponseEnvelopeJSON `json:"-"` + Success TunnelDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelDeleteResponseEnvelopeJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseEnvelopeJSON contains the JSON metadata -// for the struct [TunnelArgoTunnelListArgoTunnelsResponseEnvelope] -type tunnelArgoTunnelListArgoTunnelsResponseEnvelopeJSON struct { +// tunnelDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [TunnelDeleteResponseEnvelope] +type tunnelDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrorsJSON `json:"-"` +type TunnelDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [TunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrors] -type tunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrorsJSON struct { +// tunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [TunnelDeleteResponseEnvelopeErrors] +type tunnelDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type TunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON tunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessagesJSON `json:"-"` +type TunnelDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// tunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [TunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessages] -type tunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessagesJSON struct { +// tunnelDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [TunnelDeleteResponseEnvelopeMessages] +type tunnelDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *TunnelArgoTunnelListArgoTunnelsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type TunnelArgoTunnelListArgoTunnelsResponseEnvelopeSuccess bool +type TunnelDeleteResponseEnvelopeSuccess bool const ( - TunnelArgoTunnelListArgoTunnelsResponseEnvelopeSuccessTrue TunnelArgoTunnelListArgoTunnelsResponseEnvelopeSuccess = true + TunnelDeleteResponseEnvelopeSuccessTrue TunnelDeleteResponseEnvelopeSuccess = true ) -type TunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON tunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// tunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct -// [TunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfo] -type tunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *TunnelArgoTunnelListArgoTunnelsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type TunnelGetResponseEnvelope struct { Errors []TunnelGetResponseEnvelopeErrors `json:"errors,required"` Messages []TunnelGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/tunnel_test.go b/tunnel_test.go index 1eef06213d4..43689721a1b 100644 --- a/tunnel_test.go +++ b/tunnel_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestTunnelDelete(t *testing.T) { +func TestTunnelNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,12 +30,12 @@ func TestTunnelDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Tunnels.Delete( + _, err := client.Tunnels.New( context.TODO(), "699d98642c564d2e855e9661899b7252", - "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.TunnelDeleteParams{ - Body: cloudflare.F[any](map[string]interface{}{}), + cloudflare.TunnelNewParams{ + Name: cloudflare.F("blog"), + TunnelSecret: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -47,7 +47,7 @@ func TestTunnelDelete(t *testing.T) { } } -func TestTunnelArgoTunnelNewAnArgoTunnel(t *testing.T) { +func TestTunnelUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,12 +63,13 @@ func TestTunnelArgoTunnelNewAnArgoTunnel(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Tunnels.ArgoTunnelNewAnArgoTunnel( + _, err := client.Tunnels.Update( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.TunnelArgoTunnelNewAnArgoTunnelParams{ + "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + cloudflare.TunnelUpdateParams{ Name: cloudflare.F("blog"), - TunnelSecret: cloudflare.F[any](map[string]interface{}{}), + TunnelSecret: cloudflare.F("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="), }, ) if err != nil { @@ -80,7 +81,7 @@ func TestTunnelArgoTunnelNewAnArgoTunnel(t *testing.T) { } } -func TestTunnelArgoTunnelListArgoTunnelsWithOptionalParams(t *testing.T) { +func TestTunnelListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -96,10 +97,10 @@ func TestTunnelArgoTunnelListArgoTunnelsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Tunnels.ArgoTunnelListArgoTunnels( + _, err := client.Tunnels.List( context.TODO(), "699d98642c564d2e855e9661899b7252", - cloudflare.TunnelArgoTunnelListArgoTunnelsParams{ + cloudflare.TunnelListParams{ ExcludePrefix: cloudflare.F("vpc1-"), ExistedAt: cloudflare.F(time.Now()), IncludePrefix: cloudflare.F("vpc1-"), @@ -121,6 +122,39 @@ func TestTunnelArgoTunnelListArgoTunnelsWithOptionalParams(t *testing.T) { } } +func TestTunnelDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Tunnels.Delete( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + cloudflare.TunnelDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestTunnelGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" diff --git a/tunnelconfiguration.go b/tunnelconfiguration.go new file mode 100644 index 00000000000..0ba0815986d --- /dev/null +++ b/tunnelconfiguration.go @@ -0,0 +1,417 @@ +// File generated from our OpenAPI spec by Stainless. + +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" +) + +// TunnelConfigurationService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewTunnelConfigurationService] +// method instead. +type TunnelConfigurationService struct { + Options []option.RequestOption +} + +// NewTunnelConfigurationService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewTunnelConfigurationService(opts ...option.RequestOption) (r *TunnelConfigurationService) { + r = &TunnelConfigurationService{} + r.Options = opts + return +} + +// Gets the configuration for a remotely-managed tunnel +func (r *TunnelConfigurationService) List(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *TunnelConfigurationListResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelConfigurationListResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/configurations", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Adds or updates the configuration for a remotely-managed tunnel. +func (r *TunnelConfigurationService) Replace(ctx context.Context, accountID string, tunnelID string, body TunnelConfigurationReplaceParams, opts ...option.RequestOption) (res *TunnelConfigurationReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelConfigurationReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/configurations", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [TunnelConfigurationListResponseUnknown], +// [TunnelConfigurationListResponseArray] or [shared.UnionString]. +type TunnelConfigurationListResponse interface { + ImplementsTunnelConfigurationListResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*TunnelConfigurationListResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type TunnelConfigurationListResponseArray []interface{} + +func (r TunnelConfigurationListResponseArray) ImplementsTunnelConfigurationListResponse() {} + +// Union satisfied by [TunnelConfigurationReplaceResponseUnknown], +// [TunnelConfigurationReplaceResponseArray] or [shared.UnionString]. +type TunnelConfigurationReplaceResponse interface { + ImplementsTunnelConfigurationReplaceResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*TunnelConfigurationReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type TunnelConfigurationReplaceResponseArray []interface{} + +func (r TunnelConfigurationReplaceResponseArray) ImplementsTunnelConfigurationReplaceResponse() {} + +type TunnelConfigurationListResponseEnvelope struct { + Errors []TunnelConfigurationListResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelConfigurationListResponseEnvelopeMessages `json:"messages,required"` + Result TunnelConfigurationListResponse `json:"result,required"` + // Whether the API call was successful + Success TunnelConfigurationListResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelConfigurationListResponseEnvelopeJSON `json:"-"` +} + +// tunnelConfigurationListResponseEnvelopeJSON contains the JSON metadata for the +// struct [TunnelConfigurationListResponseEnvelope] +type tunnelConfigurationListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConfigurationListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConfigurationListResponseEnvelopeErrorsJSON `json:"-"` +} + +// tunnelConfigurationListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [TunnelConfigurationListResponseEnvelopeErrors] +type tunnelConfigurationListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConfigurationListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConfigurationListResponseEnvelopeMessagesJSON `json:"-"` +} + +// tunnelConfigurationListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [TunnelConfigurationListResponseEnvelopeMessages] +type tunnelConfigurationListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type TunnelConfigurationListResponseEnvelopeSuccess bool + +const ( + TunnelConfigurationListResponseEnvelopeSuccessTrue TunnelConfigurationListResponseEnvelopeSuccess = true +) + +type TunnelConfigurationReplaceParams struct { + // The tunnel configuration and ingress rules. + Config param.Field[TunnelConfigurationReplaceParamsConfig] `json:"config"` +} + +func (r TunnelConfigurationReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The tunnel configuration and ingress rules. +type TunnelConfigurationReplaceParamsConfig struct { + // List of public hostname definitions + Ingress param.Field[[]TunnelConfigurationReplaceParamsConfigIngress] `json:"ingress"` + // Configuration parameters of connection between cloudflared and origin server. + OriginRequest param.Field[TunnelConfigurationReplaceParamsConfigOriginRequest] `json:"originRequest"` + // Enable private network access from WARP users to private network routes + WarpRouting param.Field[TunnelConfigurationReplaceParamsConfigWarpRouting] `json:"warp-routing"` +} + +func (r TunnelConfigurationReplaceParamsConfig) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Public hostname +type TunnelConfigurationReplaceParamsConfigIngress struct { + // Public hostname for this service. + Hostname param.Field[string] `json:"hostname,required"` + // Protocol and address of destination server. Supported protocols: http://, + // https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively + // can return a HTTP status code http_status:[code] e.g. 'http_status:404'. + Service param.Field[string] `json:"service,required"` + // Configuration parameters of connection between cloudflared and origin server. + OriginRequest param.Field[TunnelConfigurationReplaceParamsConfigIngressOriginRequest] `json:"originRequest"` + // Requests with this path route to this public hostname. + Path param.Field[string] `json:"path"` +} + +func (r TunnelConfigurationReplaceParamsConfigIngress) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Configuration parameters of connection between cloudflared and origin server. +type TunnelConfigurationReplaceParamsConfigIngressOriginRequest struct { + // For all L7 requests to this hostname, cloudflared will validate each request's + // Cf-Access-Jwt-Assertion request header. + Access param.Field[TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess] `json:"access"` + // Path to the certificate authority (CA) for the certificate of your origin. This + // option should be used only if your certificate is not signed by Cloudflare. + CaPool param.Field[string] `json:"caPool"` + // Timeout for establishing a new TCP connection to your origin server. This + // excludes the time taken to establish TLS, which is controlled by tlsTimeout. + ConnectTimeout param.Field[int64] `json:"connectTimeout"` + // Disables chunked transfer encoding. Useful if you are running a WSGI server. + DisableChunkedEncoding param.Field[bool] `json:"disableChunkedEncoding"` + // Attempt to connect to origin using HTTP2. Origin must be configured as https. + HTTP2Origin param.Field[bool] `json:"http2Origin"` + // Sets the HTTP Host header on requests sent to the local service. + HTTPHostHeader param.Field[string] `json:"httpHostHeader"` + // Maximum number of idle keepalive connections between Tunnel and your origin. + // This does not restrict the total number of concurrent connections. + KeepAliveConnections param.Field[int64] `json:"keepAliveConnections"` + // Timeout after which an idle keepalive connection can be discarded. + KeepAliveTimeout param.Field[int64] `json:"keepAliveTimeout"` + // Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local + // network has misconfigured one of the protocols. + NoHappyEyeballs param.Field[bool] `json:"noHappyEyeballs"` + // Disables TLS verification of the certificate presented by your origin. Will + // allow any certificate from the origin to be accepted. + NoTLSVerify param.Field[bool] `json:"noTLSVerify"` + // Hostname that cloudflared should expect from your origin server certificate. + OriginServerName param.Field[string] `json:"originServerName"` + // cloudflared starts a proxy server to translate HTTP traffic into TCP when + // proxying, for example, SSH or RDP. This configures what type of proxy will be + // started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 + // proxy. + ProxyType param.Field[string] `json:"proxyType"` + // The timeout after which a TCP keepalive packet is sent on a connection between + // Tunnel and the origin server. + TcpKeepAlive param.Field[int64] `json:"tcpKeepAlive"` + // Timeout for completing a TLS handshake to your origin server, if you have chosen + // to connect Tunnel to an HTTPS server. + TLSTimeout param.Field[int64] `json:"tlsTimeout"` +} + +func (r TunnelConfigurationReplaceParamsConfigIngressOriginRequest) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// For all L7 requests to this hostname, cloudflared will validate each request's +// Cf-Access-Jwt-Assertion request header. +type TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess struct { + // Access applications that are allowed to reach this hostname for this Tunnel. + // Audience tags can be identified in the dashboard or via the List Access policies + // API. + AudTag param.Field[[]string] `json:"audTag,required"` + TeamName param.Field[string] `json:"teamName,required"` + // Deny traffic that has not fulfilled Access authorization. + Required param.Field[bool] `json:"required"` +} + +func (r TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Configuration parameters of connection between cloudflared and origin server. +type TunnelConfigurationReplaceParamsConfigOriginRequest struct { + // For all L7 requests to this hostname, cloudflared will validate each request's + // Cf-Access-Jwt-Assertion request header. + Access param.Field[TunnelConfigurationReplaceParamsConfigOriginRequestAccess] `json:"access"` + // Path to the certificate authority (CA) for the certificate of your origin. This + // option should be used only if your certificate is not signed by Cloudflare. + CaPool param.Field[string] `json:"caPool"` + // Timeout for establishing a new TCP connection to your origin server. This + // excludes the time taken to establish TLS, which is controlled by tlsTimeout. + ConnectTimeout param.Field[int64] `json:"connectTimeout"` + // Disables chunked transfer encoding. Useful if you are running a WSGI server. + DisableChunkedEncoding param.Field[bool] `json:"disableChunkedEncoding"` + // Attempt to connect to origin using HTTP2. Origin must be configured as https. + HTTP2Origin param.Field[bool] `json:"http2Origin"` + // Sets the HTTP Host header on requests sent to the local service. + HTTPHostHeader param.Field[string] `json:"httpHostHeader"` + // Maximum number of idle keepalive connections between Tunnel and your origin. + // This does not restrict the total number of concurrent connections. + KeepAliveConnections param.Field[int64] `json:"keepAliveConnections"` + // Timeout after which an idle keepalive connection can be discarded. + KeepAliveTimeout param.Field[int64] `json:"keepAliveTimeout"` + // Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local + // network has misconfigured one of the protocols. + NoHappyEyeballs param.Field[bool] `json:"noHappyEyeballs"` + // Disables TLS verification of the certificate presented by your origin. Will + // allow any certificate from the origin to be accepted. + NoTLSVerify param.Field[bool] `json:"noTLSVerify"` + // Hostname that cloudflared should expect from your origin server certificate. + OriginServerName param.Field[string] `json:"originServerName"` + // cloudflared starts a proxy server to translate HTTP traffic into TCP when + // proxying, for example, SSH or RDP. This configures what type of proxy will be + // started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 + // proxy. + ProxyType param.Field[string] `json:"proxyType"` + // The timeout after which a TCP keepalive packet is sent on a connection between + // Tunnel and the origin server. + TcpKeepAlive param.Field[int64] `json:"tcpKeepAlive"` + // Timeout for completing a TLS handshake to your origin server, if you have chosen + // to connect Tunnel to an HTTPS server. + TLSTimeout param.Field[int64] `json:"tlsTimeout"` +} + +func (r TunnelConfigurationReplaceParamsConfigOriginRequest) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// For all L7 requests to this hostname, cloudflared will validate each request's +// Cf-Access-Jwt-Assertion request header. +type TunnelConfigurationReplaceParamsConfigOriginRequestAccess struct { + // Access applications that are allowed to reach this hostname for this Tunnel. + // Audience tags can be identified in the dashboard or via the List Access policies + // API. + AudTag param.Field[[]string] `json:"audTag,required"` + TeamName param.Field[string] `json:"teamName,required"` + // Deny traffic that has not fulfilled Access authorization. + Required param.Field[bool] `json:"required"` +} + +func (r TunnelConfigurationReplaceParamsConfigOriginRequestAccess) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Enable private network access from WARP users to private network routes +type TunnelConfigurationReplaceParamsConfigWarpRouting struct { + Enabled param.Field[bool] `json:"enabled"` +} + +func (r TunnelConfigurationReplaceParamsConfigWarpRouting) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type TunnelConfigurationReplaceResponseEnvelope struct { + Errors []TunnelConfigurationReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelConfigurationReplaceResponseEnvelopeMessages `json:"messages,required"` + Result TunnelConfigurationReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success TunnelConfigurationReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelConfigurationReplaceResponseEnvelopeJSON `json:"-"` +} + +// tunnelConfigurationReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [TunnelConfigurationReplaceResponseEnvelope] +type tunnelConfigurationReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConfigurationReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConfigurationReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// tunnelConfigurationReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [TunnelConfigurationReplaceResponseEnvelopeErrors] +type tunnelConfigurationReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConfigurationReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConfigurationReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// tunnelConfigurationReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [TunnelConfigurationReplaceResponseEnvelopeMessages] +type tunnelConfigurationReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConfigurationReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type TunnelConfigurationReplaceResponseEnvelopeSuccess bool + +const ( + TunnelConfigurationReplaceResponseEnvelopeSuccessTrue TunnelConfigurationReplaceResponseEnvelopeSuccess = true +) diff --git a/cfdtunnelconfiguration_test.go b/tunnelconfiguration_test.go similarity index 74% rename from cfdtunnelconfiguration_test.go rename to tunnelconfiguration_test.go index 73f80c011a8..c45b6795c71 100644 --- a/cfdtunnelconfiguration_test.go +++ b/tunnelconfiguration_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfiguration(t *testing.T) { +func TestTunnelConfigurationList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfiguration(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Configurations.CloudflareTunnelConfigurationGetConfiguration( + _, err := client.Tunnels.Configurations.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -43,7 +43,7 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfiguration(t * } } -func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWithOptionalParams(t *testing.T) { +func TestTunnelConfigurationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,16 +59,16 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWith option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Configurations.CloudflareTunnelConfigurationPutConfiguration( + _, err := client.Tunnels.Configurations.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParams{ - Config: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfig{ - Ingress: cloudflare.F([]cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngress{{ + cloudflare.TunnelConfigurationReplaceParams{ + Config: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfig{ + Ingress: cloudflare.F([]cloudflare.TunnelConfigurationReplaceParamsConfigIngress{{ Hostname: cloudflare.F("tunnel.example.com"), - OriginRequest: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest{ - Access: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess{ + OriginRequest: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequest{ + Access: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess{ AudTag: cloudflare.F([]string{"string", "string", "string"}), Required: cloudflare.F(true), TeamName: cloudflare.F("string"), @@ -91,8 +91,8 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWith Service: cloudflare.F("https://localhost:8001"), }, { Hostname: cloudflare.F("tunnel.example.com"), - OriginRequest: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest{ - Access: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess{ + OriginRequest: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequest{ + Access: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess{ AudTag: cloudflare.F([]string{"string", "string", "string"}), Required: cloudflare.F(true), TeamName: cloudflare.F("string"), @@ -115,8 +115,8 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWith Service: cloudflare.F("https://localhost:8001"), }, { Hostname: cloudflare.F("tunnel.example.com"), - OriginRequest: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequest{ - Access: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigIngressOriginRequestAccess{ + OriginRequest: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequest{ + Access: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigIngressOriginRequestAccess{ AudTag: cloudflare.F([]string{"string", "string", "string"}), Required: cloudflare.F(true), TeamName: cloudflare.F("string"), @@ -138,8 +138,8 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWith Path: cloudflare.F("subpath"), Service: cloudflare.F("https://localhost:8001"), }}), - OriginRequest: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequest{ - Access: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigOriginRequestAccess{ + OriginRequest: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigOriginRequest{ + Access: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigOriginRequestAccess{ AudTag: cloudflare.F([]string{"string", "string", "string"}), Required: cloudflare.F(true), TeamName: cloudflare.F("string"), @@ -158,7 +158,7 @@ func TestCfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationWith TcpKeepAlive: cloudflare.F(int64(0)), TLSTimeout: cloudflare.F(int64(0)), }), - WarpRouting: cloudflare.F(cloudflare.CfdTunnelConfigurationCloudflareTunnelConfigurationPutConfigurationParamsConfigWarpRouting{ + WarpRouting: cloudflare.F(cloudflare.TunnelConfigurationReplaceParamsConfigWarpRouting{ Enabled: cloudflare.F(true), }), }), diff --git a/tunnelconnection.go b/tunnelconnection.go index 8aff98e0462..aa39de9be8b 100644 --- a/tunnelconnection.go +++ b/tunnelconnection.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" "reflect" + "time" "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" "github.com/cloudflare/cloudflare-sdk-go/internal/param" @@ -34,6 +35,19 @@ func NewTunnelConnectionService(opts ...option.RequestOption) (r *TunnelConnecti return } +// Fetches connection details for a Cloudflare Tunnel. +func (r *TunnelConnectionService) List(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *[]TunnelConnectionListResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelConnectionListResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/connections", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Removes connections that are in a disconnected or pending reconnect state. We // recommend running this command after shutting down a tunnel. func (r *TunnelConnectionService) Delete(ctx context.Context, accountID string, tunnelID string, body TunnelConnectionDeleteParams, opts ...option.RequestOption) (res *TunnelConnectionDeleteResponse, err error) { @@ -48,6 +62,87 @@ func (r *TunnelConnectionService) Delete(ctx context.Context, accountID string, return } +// A client (typically cloudflared) that maintains connections to a Cloudflare data +// center. +type TunnelConnectionListResponse struct { + // UUID of the Cloudflare Tunnel connection. + ID string `json:"id"` + // The cloudflared OS architecture used to establish this connection. + Arch string `json:"arch"` + // The version of the remote tunnel configuration. Used internally to sync + // cloudflared with the Zero Trust dashboard. + ConfigVersion int64 `json:"config_version"` + // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. + Conns []TunnelConnectionListResponseConn `json:"conns"` + // Features enabled for the Cloudflare Tunnel. + Features []string `json:"features"` + // Timestamp of when the tunnel connection was started. + RunAt time.Time `json:"run_at" format:"date-time"` + // The cloudflared version used to establish this connection. + Version string `json:"version"` + JSON tunnelConnectionListResponseJSON `json:"-"` +} + +// tunnelConnectionListResponseJSON contains the JSON metadata for the struct +// [TunnelConnectionListResponse] +type tunnelConnectionListResponseJSON struct { + ID apijson.Field + Arch apijson.Field + ConfigVersion apijson.Field + Conns apijson.Field + Features apijson.Field + RunAt apijson.Field + Version apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConnectionListResponseConn struct { + // UUID of the Cloudflare Tunnel connection. + ID string `json:"id"` + // UUID of the cloudflared instance. + ClientID interface{} `json:"client_id"` + // The cloudflared version used to establish this connection. + ClientVersion string `json:"client_version"` + // The Cloudflare data center used for this connection. + ColoName string `json:"colo_name"` + // Cloudflare continues to track connections for several minutes after they + // disconnect. This is an optimization to improve latency and reliability of + // reconnecting. If `true`, the connection has disconnected but is still being + // tracked. If `false`, the connection is actively serving traffic. + IsPendingReconnect bool `json:"is_pending_reconnect"` + // Timestamp of when the connection was established. + OpenedAt time.Time `json:"opened_at" format:"date-time"` + // The public IP address of the host running cloudflared. + OriginIP string `json:"origin_ip"` + // UUID of the Cloudflare Tunnel connection. + Uuid string `json:"uuid"` + JSON tunnelConnectionListResponseConnJSON `json:"-"` +} + +// tunnelConnectionListResponseConnJSON contains the JSON metadata for the struct +// [TunnelConnectionListResponseConn] +type tunnelConnectionListResponseConnJSON struct { + ID apijson.Field + ClientID apijson.Field + ClientVersion apijson.Field + ColoName apijson.Field + IsPendingReconnect apijson.Field + OpenedAt apijson.Field + OriginIP apijson.Field + Uuid apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponseConn) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // Union satisfied by [TunnelConnectionDeleteResponseUnknown], // [TunnelConnectionDeleteResponseArray] or [shared.UnionString]. type TunnelConnectionDeleteResponse interface { @@ -69,6 +164,104 @@ type TunnelConnectionDeleteResponseArray []interface{} func (r TunnelConnectionDeleteResponseArray) ImplementsTunnelConnectionDeleteResponse() {} +type TunnelConnectionListResponseEnvelope struct { + Errors []TunnelConnectionListResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelConnectionListResponseEnvelopeMessages `json:"messages,required"` + Result []TunnelConnectionListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success TunnelConnectionListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo TunnelConnectionListResponseEnvelopeResultInfo `json:"result_info"` + JSON tunnelConnectionListResponseEnvelopeJSON `json:"-"` +} + +// tunnelConnectionListResponseEnvelopeJSON contains the JSON metadata for the +// struct [TunnelConnectionListResponseEnvelope] +type tunnelConnectionListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConnectionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConnectionListResponseEnvelopeErrorsJSON `json:"-"` +} + +// tunnelConnectionListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [TunnelConnectionListResponseEnvelopeErrors] +type tunnelConnectionListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelConnectionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConnectionListResponseEnvelopeMessagesJSON `json:"-"` +} + +// tunnelConnectionListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [TunnelConnectionListResponseEnvelopeMessages] +type tunnelConnectionListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type TunnelConnectionListResponseEnvelopeSuccess bool + +const ( + TunnelConnectionListResponseEnvelopeSuccessTrue TunnelConnectionListResponseEnvelopeSuccess = true +) + +type TunnelConnectionListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON tunnelConnectionListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// tunnelConnectionListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [TunnelConnectionListResponseEnvelopeResultInfo] +type tunnelConnectionListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelConnectionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type TunnelConnectionDeleteParams struct { Body param.Field[interface{}] `json:"body,required"` } diff --git a/tunnelconnection_test.go b/tunnelconnection_test.go index d442943ac94..5ff5324c552 100644 --- a/tunnelconnection_test.go +++ b/tunnelconnection_test.go @@ -13,6 +13,36 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) +func TestTunnelConnectionList(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Tunnels.Connections.List( + context.TODO(), + "699d98642c564d2e855e9661899b7252", + "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestTunnelConnectionDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" diff --git a/cfdtunnelconnector.go b/tunnelconnector.go similarity index 52% rename from cfdtunnelconnector.go rename to tunnelconnector.go index ff046aaa808..ba983de33fd 100644 --- a/cfdtunnelconnector.go +++ b/tunnelconnector.go @@ -13,28 +13,28 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -// CfdTunnelConnectorService contains methods and other services that help with +// TunnelConnectorService contains methods and other services that help with // interacting with the cloudflare API. Note, unlike clients, this service does not // read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewCfdTunnelConnectorService] method +// this service directly, and instead use the [NewTunnelConnectorService] method // instead. -type CfdTunnelConnectorService struct { +type TunnelConnectorService struct { Options []option.RequestOption } -// NewCfdTunnelConnectorService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewCfdTunnelConnectorService(opts ...option.RequestOption) (r *CfdTunnelConnectorService) { - r = &CfdTunnelConnectorService{} +// NewTunnelConnectorService generates a new service that applies the given options +// to each request. These options are applied after the parent client's options (if +// there is one), and before any request-specific options. +func NewTunnelConnectorService(opts ...option.RequestOption) (r *TunnelConnectorService) { + r = &TunnelConnectorService{} r.Options = opts return } // Fetches connector and connection details for a Cloudflare Tunnel. -func (r *CfdTunnelConnectorService) Get(ctx context.Context, accountID string, tunnelID string, connectorID string, opts ...option.RequestOption) (res *CfdTunnelConnectorGetResponse, err error) { +func (r *TunnelConnectorService) Get(ctx context.Context, accountID string, tunnelID string, connectorID string, opts ...option.RequestOption) (res *TunnelConnectorGetResponse, err error) { opts = append(r.Options[:], opts...) - var env CfdTunnelConnectorGetResponseEnvelope + var env TunnelConnectorGetResponseEnvelope path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/connectors/%s", accountID, tunnelID, connectorID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,7 +46,7 @@ func (r *CfdTunnelConnectorService) Get(ctx context.Context, accountID string, t // A client (typically cloudflared) that maintains connections to a Cloudflare data // center. -type CfdTunnelConnectorGetResponse struct { +type TunnelConnectorGetResponse struct { // UUID of the Cloudflare Tunnel connection. ID string `json:"id"` // The cloudflared OS architecture used to establish this connection. @@ -55,19 +55,19 @@ type CfdTunnelConnectorGetResponse struct { // cloudflared with the Zero Trust dashboard. ConfigVersion int64 `json:"config_version"` // The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - Conns []CfdTunnelConnectorGetResponseConn `json:"conns"` + Conns []TunnelConnectorGetResponseConn `json:"conns"` // Features enabled for the Cloudflare Tunnel. Features []string `json:"features"` // Timestamp of when the tunnel connection was started. RunAt time.Time `json:"run_at" format:"date-time"` // The cloudflared version used to establish this connection. - Version string `json:"version"` - JSON cfdTunnelConnectorGetResponseJSON `json:"-"` + Version string `json:"version"` + JSON tunnelConnectorGetResponseJSON `json:"-"` } -// cfdTunnelConnectorGetResponseJSON contains the JSON metadata for the struct -// [CfdTunnelConnectorGetResponse] -type cfdTunnelConnectorGetResponseJSON struct { +// tunnelConnectorGetResponseJSON contains the JSON metadata for the struct +// [TunnelConnectorGetResponse] +type tunnelConnectorGetResponseJSON struct { ID apijson.Field Arch apijson.Field ConfigVersion apijson.Field @@ -79,11 +79,11 @@ type cfdTunnelConnectorGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *CfdTunnelConnectorGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelConnectorGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CfdTunnelConnectorGetResponseConn struct { +type TunnelConnectorGetResponseConn struct { // UUID of the Cloudflare Tunnel connection. ID string `json:"id"` // UUID of the cloudflared instance. @@ -102,13 +102,13 @@ type CfdTunnelConnectorGetResponseConn struct { // The public IP address of the host running cloudflared. OriginIP string `json:"origin_ip"` // UUID of the Cloudflare Tunnel connection. - Uuid string `json:"uuid"` - JSON cfdTunnelConnectorGetResponseConnJSON `json:"-"` + Uuid string `json:"uuid"` + JSON tunnelConnectorGetResponseConnJSON `json:"-"` } -// cfdTunnelConnectorGetResponseConnJSON contains the JSON metadata for the struct -// [CfdTunnelConnectorGetResponseConn] -type cfdTunnelConnectorGetResponseConnJSON struct { +// tunnelConnectorGetResponseConnJSON contains the JSON metadata for the struct +// [TunnelConnectorGetResponseConn] +type tunnelConnectorGetResponseConnJSON struct { ID apijson.Field ClientID apijson.Field ClientVersion apijson.Field @@ -121,24 +121,24 @@ type cfdTunnelConnectorGetResponseConnJSON struct { ExtraFields map[string]apijson.Field } -func (r *CfdTunnelConnectorGetResponseConn) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelConnectorGetResponseConn) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CfdTunnelConnectorGetResponseEnvelope struct { - Errors []CfdTunnelConnectorGetResponseEnvelopeErrors `json:"errors,required"` - Messages []CfdTunnelConnectorGetResponseEnvelopeMessages `json:"messages,required"` +type TunnelConnectorGetResponseEnvelope struct { + Errors []TunnelConnectorGetResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelConnectorGetResponseEnvelopeMessages `json:"messages,required"` // A client (typically cloudflared) that maintains connections to a Cloudflare data // center. - Result CfdTunnelConnectorGetResponse `json:"result,required"` + Result TunnelConnectorGetResponse `json:"result,required"` // Whether the API call was successful - Success CfdTunnelConnectorGetResponseEnvelopeSuccess `json:"success,required"` - JSON cfdTunnelConnectorGetResponseEnvelopeJSON `json:"-"` + Success TunnelConnectorGetResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelConnectorGetResponseEnvelopeJSON `json:"-"` } -// cfdTunnelConnectorGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [CfdTunnelConnectorGetResponseEnvelope] -type cfdTunnelConnectorGetResponseEnvelopeJSON struct { +// tunnelConnectorGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [TunnelConnectorGetResponseEnvelope] +type tunnelConnectorGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -147,51 +147,51 @@ type cfdTunnelConnectorGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *CfdTunnelConnectorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelConnectorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CfdTunnelConnectorGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectorGetResponseEnvelopeErrorsJSON `json:"-"` +type TunnelConnectorGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConnectorGetResponseEnvelopeErrorsJSON `json:"-"` } -// cfdTunnelConnectorGetResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [CfdTunnelConnectorGetResponseEnvelopeErrors] -type cfdTunnelConnectorGetResponseEnvelopeErrorsJSON struct { +// tunnelConnectorGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [TunnelConnectorGetResponseEnvelopeErrors] +type tunnelConnectorGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CfdTunnelConnectorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelConnectorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type CfdTunnelConnectorGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON cfdTunnelConnectorGetResponseEnvelopeMessagesJSON `json:"-"` +type TunnelConnectorGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelConnectorGetResponseEnvelopeMessagesJSON `json:"-"` } -// cfdTunnelConnectorGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [CfdTunnelConnectorGetResponseEnvelopeMessages] -type cfdTunnelConnectorGetResponseEnvelopeMessagesJSON struct { +// tunnelConnectorGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [TunnelConnectorGetResponseEnvelopeMessages] +type tunnelConnectorGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *CfdTunnelConnectorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *TunnelConnectorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type CfdTunnelConnectorGetResponseEnvelopeSuccess bool +type TunnelConnectorGetResponseEnvelopeSuccess bool const ( - CfdTunnelConnectorGetResponseEnvelopeSuccessTrue CfdTunnelConnectorGetResponseEnvelopeSuccess = true + TunnelConnectorGetResponseEnvelopeSuccessTrue TunnelConnectorGetResponseEnvelopeSuccess = true ) diff --git a/cfdtunnelconnector_test.go b/tunnelconnector_test.go similarity index 92% rename from cfdtunnelconnector_test.go rename to tunnelconnector_test.go index 4f4578e141b..730442e1b2c 100644 --- a/cfdtunnelconnector_test.go +++ b/tunnelconnector_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelConnectorGet(t *testing.T) { +func TestTunnelConnectorGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestCfdTunnelConnectorGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Connectors.Get( + _, err := client.Tunnels.Connectors.Get( context.TODO(), "699d98642c564d2e855e9661899b7252", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", diff --git a/tunnelmanagement.go b/tunnelmanagement.go new file mode 100644 index 00000000000..d2ebbc0d091 --- /dev/null +++ b/tunnelmanagement.go @@ -0,0 +1,154 @@ +// File generated from our OpenAPI spec by Stainless. + +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" +) + +// TunnelManagementService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewTunnelManagementService] method +// instead. +type TunnelManagementService struct { + Options []option.RequestOption +} + +// NewTunnelManagementService generates a new service that applies the given +// options to each request. These options are applied after the parent client's +// options (if there is one), and before any request-specific options. +func NewTunnelManagementService(opts ...option.RequestOption) (r *TunnelManagementService) { + r = &TunnelManagementService{} + r.Options = opts + return +} + +// Gets a management token used to access the management resources (i.e. Streaming +// Logs) of a tunnel. +func (r *TunnelManagementService) New(ctx context.Context, accountID string, tunnelID string, body TunnelManagementNewParams, opts ...option.RequestOption) (res *TunnelManagementNewResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelManagementNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/management", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [TunnelManagementNewResponseUnknown], +// [TunnelManagementNewResponseArray] or [shared.UnionString]. +type TunnelManagementNewResponse interface { + ImplementsTunnelManagementNewResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*TunnelManagementNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type TunnelManagementNewResponseArray []interface{} + +func (r TunnelManagementNewResponseArray) ImplementsTunnelManagementNewResponse() {} + +type TunnelManagementNewParams struct { + Resources param.Field[[]TunnelManagementNewParamsResource] `json:"resources,required"` +} + +func (r TunnelManagementNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Management resources the token will have access to. +type TunnelManagementNewParamsResource string + +const ( + TunnelManagementNewParamsResourceLogs TunnelManagementNewParamsResource = "logs" +) + +type TunnelManagementNewResponseEnvelope struct { + Errors []TunnelManagementNewResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelManagementNewResponseEnvelopeMessages `json:"messages,required"` + Result TunnelManagementNewResponse `json:"result,required"` + // Whether the API call was successful + Success TunnelManagementNewResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelManagementNewResponseEnvelopeJSON `json:"-"` +} + +// tunnelManagementNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [TunnelManagementNewResponseEnvelope] +type tunnelManagementNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelManagementNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelManagementNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelManagementNewResponseEnvelopeErrorsJSON `json:"-"` +} + +// tunnelManagementNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [TunnelManagementNewResponseEnvelopeErrors] +type tunnelManagementNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelManagementNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelManagementNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelManagementNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// tunnelManagementNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [TunnelManagementNewResponseEnvelopeMessages] +type tunnelManagementNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelManagementNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type TunnelManagementNewResponseEnvelopeSuccess bool + +const ( + TunnelManagementNewResponseEnvelopeSuccessTrue TunnelManagementNewResponseEnvelopeSuccess = true +) diff --git a/cfdtunnelmanagement_test.go b/tunnelmanagement_test.go similarity index 80% rename from cfdtunnelmanagement_test.go rename to tunnelmanagement_test.go index f0e3836ad0b..ffbc32a5f05 100644 --- a/cfdtunnelmanagement_test.go +++ b/tunnelmanagement_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelManagementNew(t *testing.T) { +func TestTunnelManagementNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,12 @@ func TestCfdTunnelManagementNew(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Management.New( + _, err := client.Tunnels.Management.New( context.TODO(), "699d98642c564d2e855e9661899b7252", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - cloudflare.CfdTunnelManagementNewParams{ - Resources: cloudflare.F([]cloudflare.CfdTunnelManagementNewParamsResource{cloudflare.CfdTunnelManagementNewParamsResourceLogs}), + cloudflare.TunnelManagementNewParams{ + Resources: cloudflare.F([]cloudflare.TunnelManagementNewParamsResource{cloudflare.TunnelManagementNewParamsResourceLogs}), }, ) if err != nil { diff --git a/tunneltoken.go b/tunneltoken.go new file mode 100644 index 00000000000..3cf2c85ed96 --- /dev/null +++ b/tunneltoken.go @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec by Stainless. + +package cloudflare + +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" +) + +// TunnelTokenService contains methods and other services that help with +// interacting with the cloudflare API. Note, unlike clients, this service does not +// read variables from the environment automatically. You should not instantiate +// this service directly, and instead use the [NewTunnelTokenService] method +// instead. +type TunnelTokenService struct { + Options []option.RequestOption +} + +// NewTunnelTokenService generates a new service that applies the given options to +// each request. These options are applied after the parent client's options (if +// there is one), and before any request-specific options. +func NewTunnelTokenService(opts ...option.RequestOption) (r *TunnelTokenService) { + r = &TunnelTokenService{} + r.Options = opts + return +} + +// Gets the token used to associate cloudflared with a specific tunnel. +func (r *TunnelTokenService) Get(ctx context.Context, accountID string, tunnelID string, opts ...option.RequestOption) (res *TunnelTokenGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env TunnelTokenGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/cfd_tunnel/%s/token", accountID, tunnelID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Union satisfied by [TunnelTokenGetResponseUnknown], +// [TunnelTokenGetResponseArray] or [shared.UnionString]. +type TunnelTokenGetResponse interface { + ImplementsTunnelTokenGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*TunnelTokenGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type TunnelTokenGetResponseArray []interface{} + +func (r TunnelTokenGetResponseArray) ImplementsTunnelTokenGetResponse() {} + +type TunnelTokenGetResponseEnvelope struct { + Errors []TunnelTokenGetResponseEnvelopeErrors `json:"errors,required"` + Messages []TunnelTokenGetResponseEnvelopeMessages `json:"messages,required"` + Result TunnelTokenGetResponse `json:"result,required"` + // Whether the API call was successful + Success TunnelTokenGetResponseEnvelopeSuccess `json:"success,required"` + JSON tunnelTokenGetResponseEnvelopeJSON `json:"-"` +} + +// tunnelTokenGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [TunnelTokenGetResponseEnvelope] +type tunnelTokenGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelTokenGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelTokenGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelTokenGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// tunnelTokenGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [TunnelTokenGetResponseEnvelopeErrors] +type tunnelTokenGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelTokenGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type TunnelTokenGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON tunnelTokenGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// tunnelTokenGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [TunnelTokenGetResponseEnvelopeMessages] +type tunnelTokenGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *TunnelTokenGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type TunnelTokenGetResponseEnvelopeSuccess bool + +const ( + TunnelTokenGetResponseEnvelopeSuccessTrue TunnelTokenGetResponseEnvelopeSuccess = true +) diff --git a/cfdtunneltoken_test.go b/tunneltoken_test.go similarity index 87% rename from cfdtunneltoken_test.go rename to tunneltoken_test.go index 4468c275294..297478b785e 100644 --- a/cfdtunneltoken_test.go +++ b/tunneltoken_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestCfdTunnelTokenCloudflareTunnelGetACloudflareTunnelToken(t *testing.T) { +func TestTunnelTokenGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestCfdTunnelTokenCloudflareTunnelGetACloudflareTunnelToken(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.CfdTunnels.Tokens.CloudflareTunnelGetACloudflareTunnelToken( + _, err := client.Tunnels.Tokens.Get( context.TODO(), "699d98642c564d2e855e9661899b7252", "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", diff --git a/urlnormalization.go b/urlnormalization.go index 4cb94c46c01..f00edfaae62 100644 --- a/urlnormalization.go +++ b/urlnormalization.go @@ -32,7 +32,7 @@ func NewURLNormalizationService(opts ...option.RequestOption) (r *URLNormalizati } // Fetches the current URL normalization settings. -func (r *URLNormalizationService) URLNormalizationGetURLNormalizationSettings(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse, err error) { +func (r *URLNormalizationService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *URLNormalizationGetResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/url_normalization", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) @@ -40,64 +40,62 @@ func (r *URLNormalizationService) URLNormalizationGetURLNormalizationSettings(ct } // Updates the URL normalization settings. -func (r *URLNormalizationService) URLNormalizationUpdateURLNormalizationSettings(ctx context.Context, zoneID string, body URLNormalizationURLNormalizationUpdateURLNormalizationSettingsParams, opts ...option.RequestOption) (res *URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse, err error) { +func (r *URLNormalizationService) Replace(ctx context.Context, zoneID string, body URLNormalizationReplaceParams, opts ...option.RequestOption) (res *URLNormalizationReplaceResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("zones/%s/url_normalization", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...) return } -type URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse struct { +type URLNormalizationGetResponse struct { // The scope of the URL normalization. Scope string `json:"scope"` // The type of URL normalization performed by Cloudflare. - Type string `json:"type"` - JSON urlNormalizationURLNormalizationGetURLNormalizationSettingsResponseJSON `json:"-"` + Type string `json:"type"` + JSON urlNormalizationGetResponseJSON `json:"-"` } -// urlNormalizationURLNormalizationGetURLNormalizationSettingsResponseJSON contains -// the JSON metadata for the struct -// [URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse] -type urlNormalizationURLNormalizationGetURLNormalizationSettingsResponseJSON struct { +// urlNormalizationGetResponseJSON contains the JSON metadata for the struct +// [URLNormalizationGetResponse] +type urlNormalizationGetResponseJSON struct { Scope apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *URLNormalizationURLNormalizationGetURLNormalizationSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *URLNormalizationGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse struct { +type URLNormalizationReplaceResponse struct { // The scope of the URL normalization. Scope string `json:"scope"` // The type of URL normalization performed by Cloudflare. - Type string `json:"type"` - JSON urlNormalizationURLNormalizationUpdateURLNormalizationSettingsResponseJSON `json:"-"` + Type string `json:"type"` + JSON urlNormalizationReplaceResponseJSON `json:"-"` } -// urlNormalizationURLNormalizationUpdateURLNormalizationSettingsResponseJSON -// contains the JSON metadata for the struct -// [URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse] -type urlNormalizationURLNormalizationUpdateURLNormalizationSettingsResponseJSON struct { +// urlNormalizationReplaceResponseJSON contains the JSON metadata for the struct +// [URLNormalizationReplaceResponse] +type urlNormalizationReplaceResponseJSON struct { Scope apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *URLNormalizationURLNormalizationUpdateURLNormalizationSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *URLNormalizationReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type URLNormalizationURLNormalizationUpdateURLNormalizationSettingsParams struct { +type URLNormalizationReplaceParams struct { // The scope of the URL normalization. Scope param.Field[string] `json:"scope"` // The type of URL normalization performed by Cloudflare. Type param.Field[string] `json:"type"` } -func (r URLNormalizationURLNormalizationUpdateURLNormalizationSettingsParams) MarshalJSON() (data []byte, err error) { +func (r URLNormalizationReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } diff --git a/urlnormalization_test.go b/urlnormalization_test.go index 37831dc7844..1231b8e5c23 100644 --- a/urlnormalization_test.go +++ b/urlnormalization_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestURLNormalizationURLNormalizationGetURLNormalizationSettings(t *testing.T) { +func TestURLNormalizationGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestURLNormalizationURLNormalizationGetURLNormalizationSettings(t *testing. option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.URLNormalizations.URLNormalizationGetURLNormalizationSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.URLNormalizations.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +39,7 @@ func TestURLNormalizationURLNormalizationGetURLNormalizationSettings(t *testing. } } -func TestURLNormalizationURLNormalizationUpdateURLNormalizationSettingsWithOptionalParams(t *testing.T) { +func TestURLNormalizationReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,10 +55,10 @@ func TestURLNormalizationURLNormalizationUpdateURLNormalizationSettingsWithOptio option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.URLNormalizations.URLNormalizationUpdateURLNormalizationSettings( + _, err := client.URLNormalizations.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.URLNormalizationURLNormalizationUpdateURLNormalizationSettingsParams{ + cloudflare.URLNormalizationReplaceParams{ Scope: cloudflare.F("incoming"), Type: cloudflare.F("cloudflare"), }, diff --git a/user.go b/user.go index 84cb4c1c4f4..7a86003313e 100644 --- a/user.go +++ b/user.go @@ -23,7 +23,7 @@ type UserService struct { Options []option.RequestOption AuditLogs *UserAuditLogService Billings *UserBillingService - Firewalls *UserFirewallService + Firewall *UserFirewallService Invites *UserInviteService LoadBalancers *UserLoadBalancerService LoadBalancingAnalytics *UserLoadBalancingAnalyticService @@ -40,7 +40,7 @@ func NewUserService(opts ...option.RequestOption) (r *UserService) { r.Options = opts r.AuditLogs = NewUserAuditLogService(opts...) r.Billings = NewUserBillingService(opts...) - r.Firewalls = NewUserFirewallService(opts...) + r.Firewall = NewUserFirewallService(opts...) r.Invites = NewUserInviteService(opts...) r.LoadBalancers = NewUserLoadBalancerService(opts...) r.LoadBalancingAnalytics = NewUserLoadBalancingAnalyticService(opts...) @@ -51,9 +51,9 @@ func NewUserService(opts ...option.RequestOption) (r *UserService) { } // Edit part of your user details. -func (r *UserService) UserEditUser(ctx context.Context, body UserUserEditUserParams, opts ...option.RequestOption) (res *UserUserEditUserResponse, err error) { +func (r *UserService) Update(ctx context.Context, body UserUpdateParams, opts ...option.RequestOption) (res *UserUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env UserUserEditUserResponseEnvelope + var env UserUpdateResponseEnvelope path := "user" err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { @@ -64,9 +64,9 @@ func (r *UserService) UserEditUser(ctx context.Context, body UserUserEditUserPar } // User Details -func (r *UserService) UserUserDetails(ctx context.Context, opts ...option.RequestOption) (res *UserUserUserDetailsResponse, err error) { +func (r *UserService) List(ctx context.Context, opts ...option.RequestOption) (res *UserListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserUserUserDetailsResponseEnvelope + var env UserListResponseEnvelope path := "user" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -76,14 +76,14 @@ func (r *UserService) UserUserDetails(ctx context.Context, opts ...option.Reques return } -// Union satisfied by [UserUserEditUserResponseUnknown] or [shared.UnionString]. -type UserUserEditUserResponse interface { - ImplementsUserUserEditUserResponse() +// Union satisfied by [UserUpdateResponseUnknown] or [shared.UnionString]. +type UserUpdateResponse interface { + ImplementsUserUpdateResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*UserUserEditUserResponse)(nil)).Elem(), + reflect.TypeOf((*UserUpdateResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -92,14 +92,14 @@ func init() { ) } -// Union satisfied by [UserUserUserDetailsResponseUnknown] or [shared.UnionString]. -type UserUserUserDetailsResponse interface { - ImplementsUserUserUserDetailsResponse() +// Union satisfied by [UserListResponseUnknown] or [shared.UnionString]. +type UserListResponse interface { + ImplementsUserListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*UserUserUserDetailsResponse)(nil)).Elem(), + reflect.TypeOf((*UserListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -108,7 +108,7 @@ func init() { ) } -type UserUserEditUserParams struct { +type UserUpdateParams struct { // The country in which the user lives. Country param.Field[string] `json:"country"` // User's first name @@ -121,22 +121,22 @@ type UserUserEditUserParams struct { Zipcode param.Field[string] `json:"zipcode"` } -func (r UserUserEditUserParams) MarshalJSON() (data []byte, err error) { +func (r UserUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserUserEditUserResponseEnvelope struct { - Errors []UserUserEditUserResponseEnvelopeErrors `json:"errors,required"` - Messages []UserUserEditUserResponseEnvelopeMessages `json:"messages,required"` - Result UserUserEditUserResponse `json:"result,required"` +type UserUpdateResponseEnvelope struct { + Errors []UserUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []UserUpdateResponseEnvelopeMessages `json:"messages,required"` + Result UserUpdateResponse `json:"result,required"` // Whether the API call was successful - Success UserUserEditUserResponseEnvelopeSuccess `json:"success,required"` - JSON userUserEditUserResponseEnvelopeJSON `json:"-"` + Success UserUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON userUpdateResponseEnvelopeJSON `json:"-"` } -// userUserEditUserResponseEnvelopeJSON contains the JSON metadata for the struct -// [UserUserEditUserResponseEnvelope] -type userUserEditUserResponseEnvelopeJSON struct { +// userUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserUpdateResponseEnvelope] +type userUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -145,67 +145,67 @@ type userUserEditUserResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserUserEditUserResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserUserEditUserResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userUserEditUserResponseEnvelopeErrorsJSON `json:"-"` +type UserUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// userUserEditUserResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [UserUserEditUserResponseEnvelopeErrors] -type userUserEditUserResponseEnvelopeErrorsJSON struct { +// userUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [UserUpdateResponseEnvelopeErrors] +type userUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserUserEditUserResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserUserEditUserResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userUserEditUserResponseEnvelopeMessagesJSON `json:"-"` +type UserUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// userUserEditUserResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [UserUserEditUserResponseEnvelopeMessages] -type userUserEditUserResponseEnvelopeMessagesJSON struct { +// userUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [UserUpdateResponseEnvelopeMessages] +type userUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserUserEditUserResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserUserEditUserResponseEnvelopeSuccess bool +type UserUpdateResponseEnvelopeSuccess bool const ( - UserUserEditUserResponseEnvelopeSuccessTrue UserUserEditUserResponseEnvelopeSuccess = true + UserUpdateResponseEnvelopeSuccessTrue UserUpdateResponseEnvelopeSuccess = true ) -type UserUserUserDetailsResponseEnvelope struct { - Errors []UserUserUserDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserUserUserDetailsResponseEnvelopeMessages `json:"messages,required"` - Result UserUserUserDetailsResponse `json:"result,required"` +type UserListResponseEnvelope struct { + Errors []UserListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserListResponseEnvelopeMessages `json:"messages,required"` + Result UserListResponse `json:"result,required"` // Whether the API call was successful - Success UserUserUserDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON userUserUserDetailsResponseEnvelopeJSON `json:"-"` + Success UserListResponseEnvelopeSuccess `json:"success,required"` + JSON userListResponseEnvelopeJSON `json:"-"` } -// userUserUserDetailsResponseEnvelopeJSON contains the JSON metadata for the -// struct [UserUserUserDetailsResponseEnvelope] -type userUserUserDetailsResponseEnvelopeJSON struct { +// userListResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserListResponseEnvelope] +type userListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -214,51 +214,51 @@ type userUserUserDetailsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserUserUserDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserUserUserDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userUserUserDetailsResponseEnvelopeErrorsJSON `json:"-"` +type UserListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userListResponseEnvelopeErrorsJSON `json:"-"` } -// userUserUserDetailsResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [UserUserUserDetailsResponseEnvelopeErrors] -type userUserUserDetailsResponseEnvelopeErrorsJSON struct { +// userListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [UserListResponseEnvelopeErrors] +type userListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserUserUserDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserUserUserDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userUserUserDetailsResponseEnvelopeMessagesJSON `json:"-"` +type UserListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userListResponseEnvelopeMessagesJSON `json:"-"` } -// userUserUserDetailsResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [UserUserUserDetailsResponseEnvelopeMessages] -type userUserUserDetailsResponseEnvelopeMessagesJSON struct { +// userListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct +// [UserListResponseEnvelopeMessages] +type userListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserUserUserDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserUserUserDetailsResponseEnvelopeSuccess bool +type UserListResponseEnvelopeSuccess bool const ( - UserUserUserDetailsResponseEnvelopeSuccessTrue UserUserUserDetailsResponseEnvelopeSuccess = true + UserListResponseEnvelopeSuccessTrue UserListResponseEnvelopeSuccess = true ) diff --git a/user_test.go b/user_test.go index 921ae960820..7d6c17fcf51 100644 --- a/user_test.go +++ b/user_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserUserEditUserWithOptionalParams(t *testing.T) { +func TestUserUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserUserEditUserWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.UserEditUser(context.TODO(), cloudflare.UserUserEditUserParams{ + _, err := client.Users.Update(context.TODO(), cloudflare.UserUpdateParams{ Country: cloudflare.F("US"), FirstName: cloudflare.F("John"), LastName: cloudflare.F("Appleseed"), @@ -45,7 +45,7 @@ func TestUserUserEditUserWithOptionalParams(t *testing.T) { } } -func TestUserUserUserDetails(t *testing.T) { +func TestUserList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +61,7 @@ func TestUserUserUserDetails(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.UserUserDetails(context.TODO()) + _, err := client.Users.List(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userbilling.go b/userbilling.go index b98fb2d4091..ecb916a2824 100644 --- a/userbilling.go +++ b/userbilling.go @@ -12,9 +12,9 @@ import ( // this service directly, and instead use the [NewUserBillingService] method // instead. type UserBillingService struct { - Options []option.RequestOption - Histories *UserBillingHistoryService - Profiles *UserBillingProfileService + Options []option.RequestOption + History *UserBillingHistoryService + Profiles *UserBillingProfileService } // NewUserBillingService generates a new service that applies the given options to @@ -23,7 +23,7 @@ type UserBillingService struct { func NewUserBillingService(opts ...option.RequestOption) (r *UserBillingService) { r = &UserBillingService{} r.Options = opts - r.Histories = NewUserBillingHistoryService(opts...) + r.History = NewUserBillingHistoryService(opts...) r.Profiles = NewUserBillingProfileService(opts...) return } diff --git a/userbillinghistory.go b/userbillinghistory.go index 617ba7bb306..304bedccc22 100644 --- a/userbillinghistory.go +++ b/userbillinghistory.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -34,19 +35,29 @@ func NewUserBillingHistoryService(opts ...option.RequestOption) (r *UserBillingH } // Accesses your billing history object. -func (r *UserBillingHistoryService) UserBillingHistoryBillingHistoryDetails(ctx context.Context, query UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams, opts ...option.RequestOption) (res *[]UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse, err error) { - opts = append(r.Options[:], opts...) - var env UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelope +func (r *UserBillingHistoryService) List(ctx context.Context, query UserBillingHistoryListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[UserBillingHistoryListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := "user/billing/history" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Accesses your billing history object. +func (r *UserBillingHistoryService) ListAutoPaging(ctx context.Context, query UserBillingHistoryListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[UserBillingHistoryListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...)) } -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse struct { +type UserBillingHistoryListResponse struct { // Billing item identifier tag. ID string `json:"id,required"` // The billing item action. @@ -60,15 +71,14 @@ type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse struct { // When the billing item was created. OccurredAt time.Time `json:"occurred_at,required" format:"date-time"` // The billing item type. - Type string `json:"type,required"` - Zone UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZone `json:"zone,required"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseJSON `json:"-"` + Type string `json:"type,required"` + Zone UserBillingHistoryListResponseZone `json:"zone,required"` + JSON userBillingHistoryListResponseJSON `json:"-"` } -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseJSON contains -// the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseJSON struct { +// userBillingHistoryListResponseJSON contains the JSON metadata for the struct +// [UserBillingHistoryListResponse] +type userBillingHistoryListResponseJSON struct { ID apijson.Field Action apijson.Field Amount apijson.Field @@ -81,41 +91,39 @@ type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseJSON struc ExtraFields map[string]apijson.Field } -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserBillingHistoryListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZone struct { - Name interface{} `json:"name"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZoneJSON `json:"-"` +type UserBillingHistoryListResponseZone struct { + Name interface{} `json:"name"` + JSON userBillingHistoryListResponseZoneJSON `json:"-"` } -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZoneJSON -// contains the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZone] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZoneJSON struct { +// userBillingHistoryListResponseZoneJSON contains the JSON metadata for the struct +// [UserBillingHistoryListResponseZone] +type userBillingHistoryListResponseZoneJSON struct { Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseZone) UnmarshalJSON(data []byte) (err error) { +func (r *UserBillingHistoryListResponseZone) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams struct { +type UserBillingHistoryListParams struct { // Field to order billing history by. - Order param.Field[UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrder] `query:"order"` + Order param.Field[UserBillingHistoryListParamsOrder] `query:"order"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of items per page. PerPage param.Field[float64] `query:"per_page"` } -// URLQuery serializes -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams]'s query -// parameters as `url.Values`. -func (r UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams) URLQuery() (v url.Values) { +// URLQuery serializes [UserBillingHistoryListParams]'s query parameters as +// `url.Values`. +func (r UserBillingHistoryListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -123,112 +131,10 @@ func (r UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams) URLQuer } // Field to order billing history by. -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrder string - -const ( - UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrderType UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrder = "type" - UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrderOccuredAt UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrder = "occured_at" - UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrderAction UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrder = "action" -) - -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelope struct { - Errors []UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessages `json:"messages,required"` - Result []UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfo `json:"result_info"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeJSON `json:"-"` -} - -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelope] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrorsJSON `json:"-"` -} - -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrors] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessagesJSON `json:"-"` -} - -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessages] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeSuccess bool +type UserBillingHistoryListParamsOrder string const ( - UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeSuccessTrue UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeSuccess = true + UserBillingHistoryListParamsOrderType UserBillingHistoryListParamsOrder = "type" + UserBillingHistoryListParamsOrderOccuredAt UserBillingHistoryListParamsOrder = "occured_at" + UserBillingHistoryListParamsOrderAction UserBillingHistoryListParamsOrder = "action" ) - -type UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfo] -type userBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserBillingHistoryUserBillingHistoryBillingHistoryDetailsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/userbillinghistory_test.go b/userbillinghistory_test.go index 4075cbb5f6d..a6d7f13120a 100644 --- a/userbillinghistory_test.go +++ b/userbillinghistory_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserBillingHistoryUserBillingHistoryBillingHistoryDetailsWithOptionalParams(t *testing.T) { +func TestUserBillingHistoryListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,8 +29,8 @@ func TestUserBillingHistoryUserBillingHistoryBillingHistoryDetailsWithOptionalPa option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Billings.Histories.UserBillingHistoryBillingHistoryDetails(context.TODO(), cloudflare.UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParams{ - Order: cloudflare.F(cloudflare.UserBillingHistoryUserBillingHistoryBillingHistoryDetailsParamsOrderOccuredAt), + _, err := client.Users.Billings.History.List(context.TODO(), cloudflare.UserBillingHistoryListParams{ + Order: cloudflare.F(cloudflare.UserBillingHistoryListParamsOrderOccuredAt), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(5.000000), }) diff --git a/userbillingprofile.go b/userbillingprofile.go index 4317564250b..713ceb4aa75 100644 --- a/userbillingprofile.go +++ b/userbillingprofile.go @@ -33,9 +33,9 @@ func NewUserBillingProfileService(opts ...option.RequestOption) (r *UserBillingP } // Accesses your billing profile object. -func (r *UserBillingProfileService) UserBillingProfileBillingProfileDetails(ctx context.Context, opts ...option.RequestOption) (res *UserBillingProfileUserBillingProfileBillingProfileDetailsResponse, err error) { +func (r *UserBillingProfileService) List(ctx context.Context, opts ...option.RequestOption) (res *UserBillingProfileListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelope + var env UserBillingProfileListResponseEnvelope path := "user/billing/profile" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,16 +45,15 @@ func (r *UserBillingProfileService) UserBillingProfileBillingProfileDetails(ctx return } -// Union satisfied by -// [UserBillingProfileUserBillingProfileBillingProfileDetailsResponseUnknown] or +// Union satisfied by [UserBillingProfileListResponseUnknown] or // [shared.UnionString]. -type UserBillingProfileUserBillingProfileBillingProfileDetailsResponse interface { - ImplementsUserBillingProfileUserBillingProfileBillingProfileDetailsResponse() +type UserBillingProfileListResponse interface { + ImplementsUserBillingProfileListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*UserBillingProfileUserBillingProfileBillingProfileDetailsResponse)(nil)).Elem(), + reflect.TypeOf((*UserBillingProfileListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -63,19 +62,18 @@ func init() { ) } -type UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelope struct { - Errors []UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessages `json:"messages,required"` - Result UserBillingProfileUserBillingProfileBillingProfileDetailsResponse `json:"result,required"` +type UserBillingProfileListResponseEnvelope struct { + Errors []UserBillingProfileListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserBillingProfileListResponseEnvelopeMessages `json:"messages,required"` + Result UserBillingProfileListResponse `json:"result,required"` // Whether the API call was successful - Success UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeJSON `json:"-"` + Success UserBillingProfileListResponseEnvelopeSuccess `json:"success,required"` + JSON userBillingProfileListResponseEnvelopeJSON `json:"-"` } -// userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelope] -type userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeJSON struct { +// userBillingProfileListResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserBillingProfileListResponseEnvelope] +type userBillingProfileListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -84,53 +82,51 @@ type userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeJS ExtraFields map[string]apijson.Field } -func (r *UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserBillingProfileListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON `json:"-"` +type UserBillingProfileListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userBillingProfileListResponseEnvelopeErrorsJSON `json:"-"` } -// userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrors] -type userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrorsJSON struct { +// userBillingProfileListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [UserBillingProfileListResponseEnvelopeErrors] +type userBillingProfileListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserBillingProfileListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON `json:"-"` +type UserBillingProfileListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userBillingProfileListResponseEnvelopeMessagesJSON `json:"-"` } -// userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessages] -type userBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessagesJSON struct { +// userBillingProfileListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [UserBillingProfileListResponseEnvelopeMessages] +type userBillingProfileListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserBillingProfileListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeSuccess bool +type UserBillingProfileListResponseEnvelopeSuccess bool const ( - UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeSuccessTrue UserBillingProfileUserBillingProfileBillingProfileDetailsResponseEnvelopeSuccess = true + UserBillingProfileListResponseEnvelopeSuccessTrue UserBillingProfileListResponseEnvelopeSuccess = true ) diff --git a/userbillingprofile_test.go b/userbillingprofile_test.go index 6116f9f5c51..21b611a88e1 100644 --- a/userbillingprofile_test.go +++ b/userbillingprofile_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserBillingProfileUserBillingProfileBillingProfileDetails(t *testing.T) { +func TestUserBillingProfileList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserBillingProfileUserBillingProfileBillingProfileDetails(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Billings.Profiles.UserBillingProfileBillingProfileDetails(context.TODO()) + _, err := client.Users.Billings.Profiles.List(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userfirewallaccessrulerule.go b/userfirewallaccessrulerule.go index a97d282ea8d..1efd1c32226 100644 --- a/userfirewallaccessrulerule.go +++ b/userfirewallaccessrulerule.go @@ -14,6 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) @@ -35,13 +36,15 @@ func NewUserFirewallAccessRuleRuleService(opts ...option.RequestOption) (r *User return } -// Updates an IP Access rule defined at the user level. You can only update the -// rule action (`mode` parameter) and notes. -func (r *UserFirewallAccessRuleRuleService) Update(ctx context.Context, identifier string, body UserFirewallAccessRuleRuleUpdateParams, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleUpdateResponse, err error) { +// Creates a new IP Access rule for all zones owned by the current user. +// +// Note: To create an IP Access rule that applies to a specific zone, refer to the +// [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints. +func (r *UserFirewallAccessRuleRuleService) New(ctx context.Context, body UserFirewallAccessRuleRuleNewParams, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env UserFirewallAccessRuleRuleUpdateResponseEnvelope - path := fmt.Sprintf("user/firewall/access_rules/rules/%s", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env UserFirewallAccessRuleRuleNewResponseEnvelope + path := "user/firewall/access_rules/rules" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -49,14 +52,13 @@ func (r *UserFirewallAccessRuleRuleService) Update(ctx context.Context, identifi return } -// Deletes an IP Access rule at the user level. -// -// Note: Deleting a user-level rule will affect all zones owned by the user. -func (r *UserFirewallAccessRuleRuleService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleDeleteResponse, err error) { +// Updates an IP Access rule defined at the user level. You can only update the +// rule action (`mode` parameter) and notes. +func (r *UserFirewallAccessRuleRuleService) Update(ctx context.Context, identifier string, body UserFirewallAccessRuleRuleUpdateParams, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env UserFirewallAccessRuleRuleDeleteResponseEnvelope + var env UserFirewallAccessRuleRuleUpdateResponseEnvelope path := fmt.Sprintf("user/firewall/access_rules/rules/%s", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -64,29 +66,39 @@ func (r *UserFirewallAccessRuleRuleService) Delete(ctx context.Context, identifi return } -// Creates a new IP Access rule for all zones owned by the current user. -// -// Note: To create an IP Access rule that applies to a specific zone, refer to the -// [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints. -func (r *UserFirewallAccessRuleRuleService) IPAccessRulesForAUserNewAnIPAccessRule(ctx context.Context, body UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParams, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse, err error) { - opts = append(r.Options[:], opts...) - var env UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelope +// Fetches IP Access rules of the user. You can filter the results using several +// optional parameters. +func (r *UserFirewallAccessRuleRuleService) List(ctx context.Context, query UserFirewallAccessRuleRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[UserFirewallAccessRuleRuleListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := "user/firewall/access_rules/rules" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) if err != nil { - return + return nil, err } - res = &env.Result - return + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil } // Fetches IP Access rules of the user. You can filter the results using several // optional parameters. -func (r *UserFirewallAccessRuleRuleService) IPAccessRulesForAUserListIPAccessRules(ctx context.Context, query UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams, opts ...option.RequestOption) (res *[]UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse, err error) { +func (r *UserFirewallAccessRuleRuleService) ListAutoPaging(ctx context.Context, query UserFirewallAccessRuleRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[UserFirewallAccessRuleRuleListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...)) +} + +// Deletes an IP Access rule at the user level. +// +// Note: Deleting a user-level rule will affect all zones owned by the user. +func (r *UserFirewallAccessRuleRuleService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *UserFirewallAccessRuleRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelope - path := "user/firewall/access_rules/rules" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env UserFirewallAccessRuleRuleDeleteResponseEnvelope + path := fmt.Sprintf("user/firewall/access_rules/rules/%s", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -94,27 +106,27 @@ func (r *UserFirewallAccessRuleRuleService) IPAccessRulesForAUserListIPAccessRul return } -type UserFirewallAccessRuleRuleUpdateResponse struct { +type UserFirewallAccessRuleRuleNewResponse struct { // The unique identifier of the IP Access rule. ID string `json:"id,required"` // The available actions that a rule can apply to a matched request. - AllowedModes []UserFirewallAccessRuleRuleUpdateResponseAllowedMode `json:"allowed_modes,required"` + AllowedModes []UserFirewallAccessRuleRuleNewResponseAllowedMode `json:"allowed_modes,required"` // The rule configuration. - Configuration UserFirewallAccessRuleRuleUpdateResponseConfiguration `json:"configuration,required"` + Configuration UserFirewallAccessRuleRuleNewResponseConfiguration `json:"configuration,required"` // The action to apply to a matched request. - Mode UserFirewallAccessRuleRuleUpdateResponseMode `json:"mode,required"` + Mode UserFirewallAccessRuleRuleNewResponseMode `json:"mode,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // The timestamp of when the rule was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // An informative summary of the rule, typically used as a reminder or explanation. - Notes string `json:"notes"` - JSON userFirewallAccessRuleRuleUpdateResponseJSON `json:"-"` + Notes string `json:"notes"` + JSON userFirewallAccessRuleRuleNewResponseJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseJSON contains the JSON metadata for the -// struct [UserFirewallAccessRuleRuleUpdateResponse] -type userFirewallAccessRuleRuleUpdateResponseJSON struct { +// userFirewallAccessRuleRuleNewResponseJSON contains the JSON metadata for the +// struct [UserFirewallAccessRuleRuleNewResponse] +type userFirewallAccessRuleRuleNewResponseJSON struct { ID apijson.Field AllowedModes apijson.Field Configuration apijson.Field @@ -126,262 +138,242 @@ type userFirewallAccessRuleRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. -type UserFirewallAccessRuleRuleUpdateResponseAllowedMode string +type UserFirewallAccessRuleRuleNewResponseAllowedMode string const ( - UserFirewallAccessRuleRuleUpdateResponseAllowedModeBlock UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "block" - UserFirewallAccessRuleRuleUpdateResponseAllowedModeChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "challenge" - UserFirewallAccessRuleRuleUpdateResponseAllowedModeWhitelist UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "whitelist" - UserFirewallAccessRuleRuleUpdateResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "js_challenge" - UserFirewallAccessRuleRuleUpdateResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "managed_challenge" + UserFirewallAccessRuleRuleNewResponseAllowedModeBlock UserFirewallAccessRuleRuleNewResponseAllowedMode = "block" + UserFirewallAccessRuleRuleNewResponseAllowedModeChallenge UserFirewallAccessRuleRuleNewResponseAllowedMode = "challenge" + UserFirewallAccessRuleRuleNewResponseAllowedModeWhitelist UserFirewallAccessRuleRuleNewResponseAllowedMode = "whitelist" + UserFirewallAccessRuleRuleNewResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleNewResponseAllowedMode = "js_challenge" + UserFirewallAccessRuleRuleNewResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleNewResponseAllowedMode = "managed_challenge" ) // The rule configuration. // // Union satisfied by -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration], -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration], -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration], -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration] -// or -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration]. -type UserFirewallAccessRuleRuleUpdateResponseConfiguration interface { - implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfiguration], +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6Configuration], +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfiguration], +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfiguration] or +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfiguration]. +type UserFirewallAccessRuleRuleNewResponseConfiguration interface { + implementsUserFirewallAccessRuleRuleNewResponseConfiguration() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleUpdateResponseConfiguration)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleNewResponseConfiguration)(nil)).Elem(), "") } -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration struct { +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. - Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON +// userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration] -type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON struct { +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfiguration] +type userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { +func (r UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleNewResponseConfiguration() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget string +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationTarget string const ( - UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" + UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" ) -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration struct { +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6Configuration struct { // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. - Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` // The IPv6 address to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON +// userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration] -type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6Configuration] +type userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { +func (r UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleNewResponseConfiguration() { } // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget string +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationTarget string const ( - UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" + UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" ) -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration struct { +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. - Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24` // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON +// userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration] -type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON struct { +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfiguration] +type userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { +func (r UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleNewResponseConfiguration() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget string +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationTarget string const ( - UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" + UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" ) -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration struct { +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfiguration struct { // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. - Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` // The AS number to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON +// userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration] -type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON struct { +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfiguration] +type userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { +func (r UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleNewResponseConfiguration() { } // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget string +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationTarget string const ( - UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" + UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" ) -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration struct { +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfiguration struct { // The configuration target. You must set the target to `country` when specifying a // country code in the rule. - Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). - Value string `json:"value"` - JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON +// userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration] -type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON struct { +// [UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfiguration] +type userFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { +func (r UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleNewResponseConfiguration() { } // The configuration target. You must set the target to `country` when specifying a // country code in the rule. -type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget string +type UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationTarget string const ( - UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" + UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleNewResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" ) // The action to apply to a matched request. -type UserFirewallAccessRuleRuleUpdateResponseMode string +type UserFirewallAccessRuleRuleNewResponseMode string const ( - UserFirewallAccessRuleRuleUpdateResponseModeBlock UserFirewallAccessRuleRuleUpdateResponseMode = "block" - UserFirewallAccessRuleRuleUpdateResponseModeChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "challenge" - UserFirewallAccessRuleRuleUpdateResponseModeWhitelist UserFirewallAccessRuleRuleUpdateResponseMode = "whitelist" - UserFirewallAccessRuleRuleUpdateResponseModeJsChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "js_challenge" - UserFirewallAccessRuleRuleUpdateResponseModeManagedChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "managed_challenge" + UserFirewallAccessRuleRuleNewResponseModeBlock UserFirewallAccessRuleRuleNewResponseMode = "block" + UserFirewallAccessRuleRuleNewResponseModeChallenge UserFirewallAccessRuleRuleNewResponseMode = "challenge" + UserFirewallAccessRuleRuleNewResponseModeWhitelist UserFirewallAccessRuleRuleNewResponseMode = "whitelist" + UserFirewallAccessRuleRuleNewResponseModeJsChallenge UserFirewallAccessRuleRuleNewResponseMode = "js_challenge" + UserFirewallAccessRuleRuleNewResponseModeManagedChallenge UserFirewallAccessRuleRuleNewResponseMode = "managed_challenge" ) -type UserFirewallAccessRuleRuleDeleteResponse struct { - // The unique identifier of the IP Access rule. - ID string `json:"id"` - JSON userFirewallAccessRuleRuleDeleteResponseJSON `json:"-"` -} - -// userFirewallAccessRuleRuleDeleteResponseJSON contains the JSON metadata for the -// struct [UserFirewallAccessRuleRuleDeleteResponse] -type userFirewallAccessRuleRuleDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse struct { +type UserFirewallAccessRuleRuleUpdateResponse struct { // The unique identifier of the IP Access rule. ID string `json:"id,required"` // The available actions that a rule can apply to a matched request. - AllowedModes []UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode `json:"allowed_modes,required"` + AllowedModes []UserFirewallAccessRuleRuleUpdateResponseAllowedMode `json:"allowed_modes,required"` // The rule configuration. - Configuration UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration `json:"configuration,required"` + Configuration UserFirewallAccessRuleRuleUpdateResponseConfiguration `json:"configuration,required"` // The action to apply to a matched request. - Mode UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode `json:"mode,required"` + Mode UserFirewallAccessRuleRuleUpdateResponseMode `json:"mode,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // The timestamp of when the rule was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // An informative summary of the rule, typically used as a reminder or explanation. - Notes string `json:"notes"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseJSON `json:"-"` + Notes string `json:"notes"` + JSON userFirewallAccessRuleRuleUpdateResponseJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseJSON struct { +// userFirewallAccessRuleRuleUpdateResponseJSON contains the JSON metadata for the +// struct [UserFirewallAccessRuleRuleUpdateResponse] +type userFirewallAccessRuleRuleUpdateResponseJSON struct { ID apijson.Field AllowedModes apijson.Field Configuration apijson.Field @@ -393,244 +385,243 @@ type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseJSO ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode string +type UserFirewallAccessRuleRuleUpdateResponseAllowedMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseAllowedMode = "managed_challenge" + UserFirewallAccessRuleRuleUpdateResponseAllowedModeBlock UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "block" + UserFirewallAccessRuleRuleUpdateResponseAllowedModeChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "challenge" + UserFirewallAccessRuleRuleUpdateResponseAllowedModeWhitelist UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "whitelist" + UserFirewallAccessRuleRuleUpdateResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "js_challenge" + UserFirewallAccessRuleRuleUpdateResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleUpdateResponseAllowedMode = "managed_challenge" ) // The rule configuration. // // Union satisfied by -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6Configuration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfiguration] +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration], +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration], +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration], +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration] // or -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfiguration]. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration interface { - implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration]. +type UserFirewallAccessRuleRuleUpdateResponseConfiguration interface { + implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleUpdateResponseConfiguration)(nil)).Elem(), "") } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfiguration struct { +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationJSON +// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationJSON struct { +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration] +type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() { +func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationTarget string +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" + UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6Configuration struct { +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration struct { // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` // The IPv6 address to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationJSON +// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6Configuration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration] +type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() { +func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { } // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationTarget string +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" + UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfiguration struct { +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24` // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationJSON +// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationJSON struct { +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration] +type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() { +func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationTarget string +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" + UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfiguration struct { +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration struct { // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` // The AS number to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationJSON +// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationJSON struct { +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration] +type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() { +func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { } // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationTarget string +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" + UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfiguration struct { +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration struct { // The configuration target. You must set the target to `country` when specifying a // country code in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationJSON +// userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationJSON struct { +// [UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration] +type userFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfiguration() { +func (r UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleUpdateResponseConfiguration() { } // The configuration target. You must set the target to `country` when specifying a // country code in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationTarget string +type UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" + UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleUpdateResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" ) // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode string +type UserFirewallAccessRuleRuleUpdateResponseMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseMode = "managed_challenge" + UserFirewallAccessRuleRuleUpdateResponseModeBlock UserFirewallAccessRuleRuleUpdateResponseMode = "block" + UserFirewallAccessRuleRuleUpdateResponseModeChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "challenge" + UserFirewallAccessRuleRuleUpdateResponseModeWhitelist UserFirewallAccessRuleRuleUpdateResponseMode = "whitelist" + UserFirewallAccessRuleRuleUpdateResponseModeJsChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "js_challenge" + UserFirewallAccessRuleRuleUpdateResponseModeManagedChallenge UserFirewallAccessRuleRuleUpdateResponseMode = "managed_challenge" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse struct { +type UserFirewallAccessRuleRuleListResponse struct { // The unique identifier of the IP Access rule. ID string `json:"id,required"` // The available actions that a rule can apply to a matched request. - AllowedModes []UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode `json:"allowed_modes,required"` + AllowedModes []UserFirewallAccessRuleRuleListResponseAllowedMode `json:"allowed_modes,required"` // The rule configuration. - Configuration UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration `json:"configuration,required"` + Configuration UserFirewallAccessRuleRuleListResponseConfiguration `json:"configuration,required"` // The action to apply to a matched request. - Mode UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode `json:"mode,required"` + Mode UserFirewallAccessRuleRuleListResponseMode `json:"mode,required"` // The timestamp of when the rule was created. CreatedOn time.Time `json:"created_on" format:"date-time"` // The timestamp of when the rule was last modified. ModifiedOn time.Time `json:"modified_on" format:"date-time"` // An informative summary of the rule, typically used as a reminder or explanation. - Notes string `json:"notes"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseJSON `json:"-"` + Notes string `json:"notes"` + JSON userFirewallAccessRuleRuleListResponseJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseJSON struct { +// userFirewallAccessRuleRuleListResponseJSON contains the JSON metadata for the +// struct [UserFirewallAccessRuleRuleListResponse] +type userFirewallAccessRuleRuleListResponseJSON struct { ID apijson.Field AllowedModes apijson.Field Configuration apijson.Field @@ -642,551 +633,406 @@ type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseJSO ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode string +type UserFirewallAccessRuleRuleListResponseAllowedMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseAllowedMode = "managed_challenge" + UserFirewallAccessRuleRuleListResponseAllowedModeBlock UserFirewallAccessRuleRuleListResponseAllowedMode = "block" + UserFirewallAccessRuleRuleListResponseAllowedModeChallenge UserFirewallAccessRuleRuleListResponseAllowedMode = "challenge" + UserFirewallAccessRuleRuleListResponseAllowedModeWhitelist UserFirewallAccessRuleRuleListResponseAllowedMode = "whitelist" + UserFirewallAccessRuleRuleListResponseAllowedModeJsChallenge UserFirewallAccessRuleRuleListResponseAllowedMode = "js_challenge" + UserFirewallAccessRuleRuleListResponseAllowedModeManagedChallenge UserFirewallAccessRuleRuleListResponseAllowedMode = "managed_challenge" ) // The rule configuration. // // Union satisfied by -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6Configuration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfiguration] +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfiguration], +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6Configuration], +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfiguration], +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfiguration] // or -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfiguration]. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration interface { - implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfiguration]. +type UserFirewallAccessRuleRuleListResponseConfiguration interface { + implementsUserFirewallAccessRuleRuleListResponseConfiguration() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*UserFirewallAccessRuleRuleListResponseConfiguration)(nil)).Elem(), "") } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfiguration struct { +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationTarget `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationJSON +// userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationJSON struct { +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfiguration] +type userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() { +func (r UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleListResponseConfiguration() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationTarget string +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" + UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPConfigurationTarget = "ip" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6Configuration struct { +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6Configuration struct { // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"` // The IPv6 address to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationJSON +// userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6Configuration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6Configuration] +type userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() { +func (r UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleListResponseConfiguration() { } // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationTarget string +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" + UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfiguration struct { +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationTarget `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24` // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationJSON +// userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationJSON struct { +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfiguration] +type userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() { +func (r UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleListResponseConfiguration() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationTarget string +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" + UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfiguration struct { +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfiguration struct { // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationTarget `json:"target"` // The AS number to match. - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationJSON +// userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationJSON struct { +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfiguration] +type userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() { +func (r UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleListResponseConfiguration() { } // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationTarget string +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" + UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsAsnConfigurationTarget = "asn" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfiguration struct { +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfiguration struct { // The configuration target. You must set the target to `country` when specifying a // country code in the rule. - Target UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` + Target UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationTarget `json:"target"` // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). - Value string `json:"value"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` + Value string `json:"value"` + JSON userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationJSON +// userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationJSON // contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfiguration] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationJSON struct { +// [UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfiguration] +type userFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationJSON struct { Target apijson.Field Value apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfiguration() { +func (r UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleListResponseConfiguration() { } // The configuration target. You must set the target to `country` when specifying a // country code in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationTarget string +type UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" + UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleListResponseConfigurationLegacyJhsCountryConfigurationTarget = "country" ) // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode string +type UserFirewallAccessRuleRuleListResponseMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseMode = "managed_challenge" + UserFirewallAccessRuleRuleListResponseModeBlock UserFirewallAccessRuleRuleListResponseMode = "block" + UserFirewallAccessRuleRuleListResponseModeChallenge UserFirewallAccessRuleRuleListResponseMode = "challenge" + UserFirewallAccessRuleRuleListResponseModeWhitelist UserFirewallAccessRuleRuleListResponseMode = "whitelist" + UserFirewallAccessRuleRuleListResponseModeJsChallenge UserFirewallAccessRuleRuleListResponseMode = "js_challenge" + UserFirewallAccessRuleRuleListResponseModeManagedChallenge UserFirewallAccessRuleRuleListResponseMode = "managed_challenge" ) -type UserFirewallAccessRuleRuleUpdateParams struct { - // The action to apply to a matched request. - Mode param.Field[UserFirewallAccessRuleRuleUpdateParamsMode] `json:"mode"` - // An informative summary of the rule, typically used as a reminder or explanation. - Notes param.Field[string] `json:"notes"` -} - -func (r UserFirewallAccessRuleRuleUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +type UserFirewallAccessRuleRuleDeleteResponse struct { + // The unique identifier of the IP Access rule. + ID string `json:"id"` + JSON userFirewallAccessRuleRuleDeleteResponseJSON `json:"-"` } -// The action to apply to a matched request. -type UserFirewallAccessRuleRuleUpdateParamsMode string - -const ( - UserFirewallAccessRuleRuleUpdateParamsModeBlock UserFirewallAccessRuleRuleUpdateParamsMode = "block" - UserFirewallAccessRuleRuleUpdateParamsModeChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "challenge" - UserFirewallAccessRuleRuleUpdateParamsModeWhitelist UserFirewallAccessRuleRuleUpdateParamsMode = "whitelist" - UserFirewallAccessRuleRuleUpdateParamsModeJsChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "js_challenge" - UserFirewallAccessRuleRuleUpdateParamsModeManagedChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "managed_challenge" -) - -type UserFirewallAccessRuleRuleUpdateResponseEnvelope struct { - Errors []UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result UserFirewallAccessRuleRuleUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON `json:"-"` -} - -// userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON contains the JSON metadata -// for the struct [UserFirewallAccessRuleRuleUpdateResponseEnvelope] -type userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors] -type userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages] -type userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess bool - -const ( - UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess = true -) - -type UserFirewallAccessRuleRuleDeleteResponseEnvelope struct { - Errors []UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages `json:"messages,required"` - Result UserFirewallAccessRuleRuleDeleteResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON `json:"-"` -} - -// userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON contains the JSON metadata -// for the struct [UserFirewallAccessRuleRuleDeleteResponseEnvelope] -type userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` -} - -// userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors] -type userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` -} - -// userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages] -type userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field +// userFirewallAccessRuleRuleDeleteResponseJSON contains the JSON metadata for the +// struct [UserFirewallAccessRuleRuleDeleteResponse] +type userFirewallAccessRuleRuleDeleteResponseJSON struct { + ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess bool - -const ( - UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess = true -) - -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParams struct { +type UserFirewallAccessRuleRuleNewParams struct { // The rule configuration. - Configuration param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration] `json:"configuration,required"` + Configuration param.Field[UserFirewallAccessRuleRuleNewParamsConfiguration] `json:"configuration,required"` // The action to apply to a matched request. - Mode param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode] `json:"mode,required"` + Mode param.Field[UserFirewallAccessRuleRuleNewParamsMode] `json:"mode,required"` // An informative summary of the rule, typically used as a reminder or explanation. Notes param.Field[string] `json:"notes"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParams) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The rule configuration. // // Satisfied by -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6Configuration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfiguration], -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfiguration]. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration interface { - implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() +// [UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration], +// [UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6Configuration], +// [UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfiguration], +// [UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfiguration], +// [UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfiguration]. +type UserFirewallAccessRuleRuleNewParamsConfiguration interface { + implementsUserFirewallAccessRuleRuleNewParamsConfiguration() } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration struct { +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration struct { // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. - Target param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"` + Target param.Field[UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"` // The IP address to match. This address will be compared to the IP address of // incoming requests. Value param.Field[string] `json:"value"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration) implementsUserFirewallAccessRuleRuleNewParamsConfiguration() { } // The configuration target. You must set the target to `ip` when specifying an IP // address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfigurationTarget string +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfigurationTarget = "ip" + UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget = "ip" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6Configuration struct { +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6Configuration struct { // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. - Target param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"` + Target param.Field[UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"` // The IPv6 address to match. Value param.Field[string] `json:"value"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6Configuration) implementsUserFirewallAccessRuleRuleNewParamsConfiguration() { } // The configuration target. You must set the target to `ip6` when specifying an // IPv6 address in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6ConfigurationTarget string +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" + UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfiguration struct { +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfiguration struct { // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. - Target param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"` + Target param.Field[UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"` // The IP address range to match. You can only use prefix lengths `/16` and `/24` // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges. Value param.Field[string] `json:"value"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfiguration) implementsUserFirewallAccessRuleRuleNewParamsConfiguration() { } // The configuration target. You must set the target to `ip_range` when specifying // an IP address range in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfigurationTarget string +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" + UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfiguration struct { +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfiguration struct { // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. - Target param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfigurationTarget] `json:"target"` + Target param.Field[UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfigurationTarget] `json:"target"` // The AS number to match. Value param.Field[string] `json:"value"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfiguration) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfiguration) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfiguration) implementsUserFirewallAccessRuleRuleNewParamsConfiguration() { } // The configuration target. You must set the target to `asn` when specifying an // Autonomous System Number (ASN) in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfigurationTarget string +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsAsnConfigurationTarget = "asn" + UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfigurationTargetAsn UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsAsnConfigurationTarget = "asn" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfiguration struct { +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfiguration struct { // The configuration target. You must set the target to `country` when specifying a // country code in the rule. - Target param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"` + Target param.Field[UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"` // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). Value param.Field[string] `json:"value"` } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration() { +func (r UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfiguration) implementsUserFirewallAccessRuleRuleNewParamsConfiguration() { } // The configuration target. You must set the target to `country` when specifying a // country code in the rule. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfigurationTarget string +type UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsCountryConfigurationTarget = "country" + UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfigurationTargetCountry UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget = "country" ) // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode string +type UserFirewallAccessRuleRuleNewParamsMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsMode = "managed_challenge" + UserFirewallAccessRuleRuleNewParamsModeBlock UserFirewallAccessRuleRuleNewParamsMode = "block" + UserFirewallAccessRuleRuleNewParamsModeChallenge UserFirewallAccessRuleRuleNewParamsMode = "challenge" + UserFirewallAccessRuleRuleNewParamsModeWhitelist UserFirewallAccessRuleRuleNewParamsMode = "whitelist" + UserFirewallAccessRuleRuleNewParamsModeJsChallenge UserFirewallAccessRuleRuleNewParamsMode = "js_challenge" + UserFirewallAccessRuleRuleNewParamsModeManagedChallenge UserFirewallAccessRuleRuleNewParamsMode = "managed_challenge" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelope struct { - Errors []UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessages `json:"messages,required"` - Result UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponse `json:"result,required,nullable"` +type UserFirewallAccessRuleRuleNewResponseEnvelope struct { + Errors []UserFirewallAccessRuleRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []UserFirewallAccessRuleRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result UserFirewallAccessRuleRuleNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeSuccess `json:"success,required"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeJSON `json:"-"` + Success UserFirewallAccessRuleRuleNewResponseEnvelopeSuccess `json:"success,required"` + JSON userFirewallAccessRuleRuleNewResponseEnvelopeJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelope] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeJSON struct { +// userFirewallAccessRuleRuleNewResponseEnvelopeJSON contains the JSON metadata for +// the struct [UserFirewallAccessRuleRuleNewResponseEnvelope] +type userFirewallAccessRuleRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1195,74 +1041,163 @@ type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnv ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrorsJSON `json:"-"` +type UserFirewallAccessRuleRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrors] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrorsJSON struct { +// userFirewallAccessRuleRuleNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserFirewallAccessRuleRuleNewResponseEnvelopeErrors] +type userFirewallAccessRuleRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessagesJSON `json:"-"` +type UserFirewallAccessRuleRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessages] -type userFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessagesJSON struct { +// userFirewallAccessRuleRuleNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [UserFirewallAccessRuleRuleNewResponseEnvelopeMessages] +type userFirewallAccessRuleRuleNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserFirewallAccessRuleRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type UserFirewallAccessRuleRuleNewResponseEnvelopeSuccess bool + +const ( + UserFirewallAccessRuleRuleNewResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleNewResponseEnvelopeSuccess = true +) + +type UserFirewallAccessRuleRuleUpdateParams struct { + // The action to apply to a matched request. + Mode param.Field[UserFirewallAccessRuleRuleUpdateParamsMode] `json:"mode"` + // An informative summary of the rule, typically used as a reminder or explanation. + Notes param.Field[string] `json:"notes"` +} + +func (r UserFirewallAccessRuleRuleUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The action to apply to a matched request. +type UserFirewallAccessRuleRuleUpdateParamsMode string + +const ( + UserFirewallAccessRuleRuleUpdateParamsModeBlock UserFirewallAccessRuleRuleUpdateParamsMode = "block" + UserFirewallAccessRuleRuleUpdateParamsModeChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "challenge" + UserFirewallAccessRuleRuleUpdateParamsModeWhitelist UserFirewallAccessRuleRuleUpdateParamsMode = "whitelist" + UserFirewallAccessRuleRuleUpdateParamsModeJsChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "js_challenge" + UserFirewallAccessRuleRuleUpdateParamsModeManagedChallenge UserFirewallAccessRuleRuleUpdateParamsMode = "managed_challenge" +) + +type UserFirewallAccessRuleRuleUpdateResponseEnvelope struct { + Errors []UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages `json:"messages,required"` + Result UserFirewallAccessRuleRuleUpdateResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON `json:"-"` +} + +// userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserFirewallAccessRuleRuleUpdateResponseEnvelope] +type userFirewallAccessRuleRuleUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +} + +// userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors] +type userFirewallAccessRuleRuleUpdateResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +} + +// userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages] +type userFirewallAccessRuleRuleUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeSuccess bool +type UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess bool const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleResponseEnvelopeSuccess = true + UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleUpdateResponseEnvelopeSuccess = true ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams struct { +type UserFirewallAccessRuleRuleListParams struct { // The direction used to sort returned rules. - Direction param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirection] `query:"direction"` - EgsPagination param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPagination] `query:"egs-pagination"` - Filters param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilters] `query:"filters"` + Direction param.Field[UserFirewallAccessRuleRuleListParamsDirection] `query:"direction"` + EgsPagination param.Field[UserFirewallAccessRuleRuleListParamsEgsPagination] `query:"egs-pagination"` + Filters param.Field[UserFirewallAccessRuleRuleListParamsFilters] `query:"filters"` // The field used to sort returned rules. - Order param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrder] `query:"order"` + Order param.Field[UserFirewallAccessRuleRuleListParamsOrder] `query:"order"` // Requested page within paginated list of results. Page param.Field[float64] `query:"page"` // Maximum number of results requested. PerPage param.Field[float64] `query:"per_page"` } -// URLQuery serializes -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams]'s query -// parameters as `url.Values`. -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams) URLQuery() (v url.Values) { +// URLQuery serializes [UserFirewallAccessRuleRuleListParams]'s query parameters as +// `url.Values`. +func (r UserFirewallAccessRuleRuleListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -1270,28 +1205,27 @@ func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams) } // The direction used to sort returned rules. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirection string +type UserFirewallAccessRuleRuleListParamsDirection string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirectionAsc UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirection = "asc" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirectionDesc UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirection = "desc" + UserFirewallAccessRuleRuleListParamsDirectionAsc UserFirewallAccessRuleRuleListParamsDirection = "asc" + UserFirewallAccessRuleRuleListParamsDirectionDesc UserFirewallAccessRuleRuleListParamsDirection = "desc" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPagination struct { - Json param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPaginationJson] `query:"json"` +type UserFirewallAccessRuleRuleListParamsEgsPagination struct { + Json param.Field[UserFirewallAccessRuleRuleListParamsEgsPaginationJson] `query:"json"` } -// URLQuery serializes -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPagination]'s -// query parameters as `url.Values`. -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPagination) URLQuery() (v url.Values) { +// URLQuery serializes [UserFirewallAccessRuleRuleListParamsEgsPagination]'s query +// parameters as `url.Values`. +func (r UserFirewallAccessRuleRuleListParamsEgsPagination) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPaginationJson struct { +type UserFirewallAccessRuleRuleListParamsEgsPaginationJson struct { // The page number of paginated results. Page param.Field[float64] `query:"page"` // The maximum number of results per page. You can only set the value to `1` or to @@ -1299,19 +1233,18 @@ type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPa PerPage param.Field[float64] `query:"per_page"` } -// URLQuery serializes -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPaginationJson]'s +// URLQuery serializes [UserFirewallAccessRuleRuleListParamsEgsPaginationJson]'s // query parameters as `url.Values`. -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPaginationJson) URLQuery() (v url.Values) { +func (r UserFirewallAccessRuleRuleListParamsEgsPaginationJson) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilters struct { +type UserFirewallAccessRuleRuleListParamsFilters struct { // The target to search in existing rules. - ConfigurationTarget param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget] `query:"configuration.target"` + ConfigurationTarget param.Field[UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget] `query:"configuration.target"` // The target value to search for in existing rules: an IP address, an IP address // range, or a country code, depending on the provided `configuration.target`. // Notes: You can search for a single IPv4 address, an IP address range with a @@ -1319,19 +1252,18 @@ type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilte ConfigurationValue param.Field[string] `query:"configuration.value"` // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. - Match param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatch] `query:"match"` + Match param.Field[UserFirewallAccessRuleRuleListParamsFiltersMatch] `query:"match"` // The action to apply to a matched request. - Mode param.Field[UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode] `query:"mode"` + Mode param.Field[UserFirewallAccessRuleRuleListParamsFiltersMode] `query:"mode"` // The string to search for in the notes of existing IP Access rules. Notes: For // example, the string 'attack' would match IP Access rules with notes 'Attack // 26/02' and 'Attack 27/02'. The search is case insensitive. Notes param.Field[string] `query:"notes"` } -// URLQuery serializes -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilters]'s -// query parameters as `url.Values`. -func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilters) URLQuery() (v url.Values) { +// URLQuery serializes [UserFirewallAccessRuleRuleListParamsFilters]'s query +// parameters as `url.Values`. +func (r UserFirewallAccessRuleRuleListParamsFilters) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -1339,142 +1271,110 @@ func (r UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFi } // The target to search in existing rules. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget string +type UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTargetIP UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget = "ip" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTargetIPRange UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget = "ip_range" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTargetAsn UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget = "asn" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTargetCountry UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTarget = "country" + UserFirewallAccessRuleRuleListParamsFiltersConfigurationTargetIP UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget = "ip" + UserFirewallAccessRuleRuleListParamsFiltersConfigurationTargetIPRange UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget = "ip_range" + UserFirewallAccessRuleRuleListParamsFiltersConfigurationTargetAsn UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget = "asn" + UserFirewallAccessRuleRuleListParamsFiltersConfigurationTargetCountry UserFirewallAccessRuleRuleListParamsFiltersConfigurationTarget = "country" ) // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatch string +type UserFirewallAccessRuleRuleListParamsFiltersMatch string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatchAny UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatch = "any" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatchAll UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatch = "all" + UserFirewallAccessRuleRuleListParamsFiltersMatchAny UserFirewallAccessRuleRuleListParamsFiltersMatch = "any" + UserFirewallAccessRuleRuleListParamsFiltersMatchAll UserFirewallAccessRuleRuleListParamsFiltersMatch = "all" ) // The action to apply to a matched request. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode string +type UserFirewallAccessRuleRuleListParamsFiltersMode string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeBlock UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode = "block" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode = "challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeWhitelist UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode = "whitelist" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeJsChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode = "js_challenge" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeManagedChallenge UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMode = "managed_challenge" + UserFirewallAccessRuleRuleListParamsFiltersModeBlock UserFirewallAccessRuleRuleListParamsFiltersMode = "block" + UserFirewallAccessRuleRuleListParamsFiltersModeChallenge UserFirewallAccessRuleRuleListParamsFiltersMode = "challenge" + UserFirewallAccessRuleRuleListParamsFiltersModeWhitelist UserFirewallAccessRuleRuleListParamsFiltersMode = "whitelist" + UserFirewallAccessRuleRuleListParamsFiltersModeJsChallenge UserFirewallAccessRuleRuleListParamsFiltersMode = "js_challenge" + UserFirewallAccessRuleRuleListParamsFiltersModeManagedChallenge UserFirewallAccessRuleRuleListParamsFiltersMode = "managed_challenge" ) // The field used to sort returned rules. -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrder string +type UserFirewallAccessRuleRuleListParamsOrder string const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrderConfigurationTarget UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrder = "configuration.target" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrderConfigurationValue UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrder = "configuration.value" - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrderMode UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrder = "mode" + UserFirewallAccessRuleRuleListParamsOrderConfigurationTarget UserFirewallAccessRuleRuleListParamsOrder = "configuration.target" + UserFirewallAccessRuleRuleListParamsOrderConfigurationValue UserFirewallAccessRuleRuleListParamsOrder = "configuration.value" + UserFirewallAccessRuleRuleListParamsOrderMode UserFirewallAccessRuleRuleListParamsOrder = "mode" ) -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelope struct { - Errors []UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessages `json:"messages,required"` - Result []UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponse `json:"result,required,nullable"` +type UserFirewallAccessRuleRuleDeleteResponseEnvelope struct { + Errors []UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages `json:"messages,required"` + Result UserFirewallAccessRuleRuleDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeJSON `json:"-"` + Success UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelope] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeJSON struct { +// userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserFirewallAccessRuleRuleDeleteResponseEnvelope] +type userFirewallAccessRuleRuleDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrorsJSON `json:"-"` +type UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrors] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrorsJSON struct { +// userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors] +type userFirewallAccessRuleRuleDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessagesJSON `json:"-"` +type UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessages] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessagesJSON struct { +// userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages] +type userFirewallAccessRuleRuleDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserFirewallAccessRuleRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeSuccess bool +type UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess bool const ( - UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeSuccess = true + UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccessTrue UserFirewallAccessRuleRuleDeleteResponseEnvelopeSuccess = true ) - -type UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfo] -type userFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/userfirewallaccessrulerule_test.go b/userfirewallaccessrulerule_test.go index 017d785ea96..6815a6bd829 100644 --- a/userfirewallaccessrulerule_test.go +++ b/userfirewallaccessrulerule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserFirewallAccessRuleRuleUpdateWithOptionalParams(t *testing.T) { +func TestUserFirewallAccessRuleRuleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,14 @@ func TestUserFirewallAccessRuleRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Firewalls.AccessRules.Rules.Update( - context.TODO(), - "92f17202ed8bd63d69a66b86a49a8f6b", - cloudflare.UserFirewallAccessRuleRuleUpdateParams{ - Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleUpdateParamsModeChallenge), - Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."), - }, - ) + _, err := client.Users.Firewall.AccessRules.Rules.New(context.TODO(), cloudflare.UserFirewallAccessRuleRuleNewParams{ + Configuration: cloudflare.F[cloudflare.UserFirewallAccessRuleRuleNewParamsConfiguration](cloudflare.UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration(cloudflare.UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfiguration{ + Target: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP), + Value: cloudflare.F("198.51.100.4"), + })), + Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleNewParamsModeChallenge), + Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -46,7 +46,7 @@ func TestUserFirewallAccessRuleRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestUserFirewallAccessRuleRuleDelete(t *testing.T) { +func TestUserFirewallAccessRuleRuleUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -62,7 +62,14 @@ func TestUserFirewallAccessRuleRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Firewalls.AccessRules.Rules.Delete(context.TODO(), "92f17202ed8bd63d69a66b86a49a8f6b") + _, err := client.Users.Firewall.AccessRules.Rules.Update( + context.TODO(), + "92f17202ed8bd63d69a66b86a49a8f6b", + cloudflare.UserFirewallAccessRuleRuleUpdateParams{ + Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleUpdateParamsModeChallenge), + Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -72,7 +79,7 @@ func TestUserFirewallAccessRuleRuleDelete(t *testing.T) { } } -func TestUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleWithOptionalParams(t *testing.T) { +func TestUserFirewallAccessRuleRuleListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -88,13 +95,24 @@ func TestUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleWithOpt option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Firewalls.AccessRules.Rules.IPAccessRulesForAUserNewAnIPAccessRule(context.TODO(), cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParams{ - Configuration: cloudflare.F[cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfiguration](cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfiguration{ - Target: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsConfigurationLegacyJhsIPConfigurationTargetIP), - Value: cloudflare.F("198.51.100.4"), - })), - Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleParamsModeChallenge), - Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."), + _, err := client.Users.Firewall.AccessRules.Rules.List(context.TODO(), cloudflare.UserFirewallAccessRuleRuleListParams{ + Direction: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsDirectionDesc), + EgsPagination: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsEgsPagination{ + Json: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsEgsPaginationJson{ + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(1.000000), + }), + }), + Filters: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsFilters{ + ConfigurationTarget: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsFiltersConfigurationTargetIP), + ConfigurationValue: cloudflare.F("198.51.100.4"), + Match: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsFiltersMatchAny), + Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsFiltersModeChallenge), + Notes: cloudflare.F("my note"), + }), + Order: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleListParamsOrderMode), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(20.000000), }) if err != nil { var apierr *cloudflare.Error @@ -105,7 +123,7 @@ func TestUserFirewallAccessRuleRuleIPAccessRulesForAUserNewAnIPAccessRuleWithOpt } } -func TestUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesWithOptionalParams(t *testing.T) { +func TestUserFirewallAccessRuleRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -121,25 +139,7 @@ func TestUserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesWithOpt option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Firewalls.AccessRules.Rules.IPAccessRulesForAUserListIPAccessRules(context.TODO(), cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParams{ - Direction: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsDirectionDesc), - EgsPagination: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPagination{ - Json: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsEgsPaginationJson{ - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(1.000000), - }), - }), - Filters: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFilters{ - ConfigurationTarget: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersConfigurationTargetIP), - ConfigurationValue: cloudflare.F("198.51.100.4"), - Match: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersMatchAny), - Mode: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsFiltersModeChallenge), - Notes: cloudflare.F("my note"), - }), - Order: cloudflare.F(cloudflare.UserFirewallAccessRuleRuleIPAccessRulesForAUserListIPAccessRulesParamsOrderMode), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(20.000000), - }) + _, err := client.Users.Firewall.AccessRules.Rules.Delete(context.TODO(), "92f17202ed8bd63d69a66b86a49a8f6b") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userinvite.go b/userinvite.go index be3e63d27bc..9a2cdee32b6 100644 --- a/userinvite.go +++ b/userinvite.go @@ -47,11 +47,11 @@ func (r *UserInviteService) Update(ctx context.Context, inviteID string, body Us return } -// Gets the details of an invitation. -func (r *UserInviteService) Get(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *UserInviteGetResponse, err error) { +// Lists all invitations associated with my user. +func (r *UserInviteService) List(ctx context.Context, opts ...option.RequestOption) (res *[]UserInviteListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserInviteGetResponseEnvelope - path := fmt.Sprintf("user/invites/%s", inviteID) + var env UserInviteListResponseEnvelope + path := "user/invites" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -60,11 +60,11 @@ func (r *UserInviteService) Get(ctx context.Context, inviteID string, opts ...op return } -// Lists all invitations associated with my user. -func (r *UserInviteService) UserSInvitesListInvitations(ctx context.Context, opts ...option.RequestOption) (res *[]UserInviteUserSInvitesListInvitationsResponse, err error) { +// Gets the details of an invitation. +func (r *UserInviteService) Get(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *UserInviteGetResponse, err error) { opts = append(r.Options[:], opts...) - var env UserInviteUserSInvitesListInvitationsResponseEnvelope - path := "user/invites" + var env UserInviteGetResponseEnvelope + path := fmt.Sprintf("user/invites/%s", inviteID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -89,23 +89,7 @@ func init() { ) } -// Union satisfied by [UserInviteGetResponseUnknown] or [shared.UnionString]. -type UserInviteGetResponse interface { - ImplementsUserInviteGetResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*UserInviteGetResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type UserInviteUserSInvitesListInvitationsResponse struct { +type UserInviteListResponse struct { // ID of the user to add to the organization. InvitedMemberID string `json:"invited_member_id,required,nullable"` // ID of the organization the user will be added to. @@ -123,15 +107,15 @@ type UserInviteUserSInvitesListInvitationsResponse struct { // Organization name. OrganizationName string `json:"organization_name"` // Roles to be assigned to this user. - Roles []UserInviteUserSInvitesListInvitationsResponseRole `json:"roles"` + Roles []UserInviteListResponseRole `json:"roles"` // Current status of the invitation. - Status UserInviteUserSInvitesListInvitationsResponseStatus `json:"status"` - JSON userInviteUserSInvitesListInvitationsResponseJSON `json:"-"` + Status UserInviteListResponseStatus `json:"status"` + JSON userInviteListResponseJSON `json:"-"` } -// userInviteUserSInvitesListInvitationsResponseJSON contains the JSON metadata for -// the struct [UserInviteUserSInvitesListInvitationsResponse] -type userInviteUserSInvitesListInvitationsResponseJSON struct { +// userInviteListResponseJSON contains the JSON metadata for the struct +// [UserInviteListResponse] +type userInviteListResponseJSON struct { InvitedMemberID apijson.Field OrganizationID apijson.Field ID apijson.Field @@ -146,11 +130,11 @@ type userInviteUserSInvitesListInvitationsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserInviteUserSInvitesListInvitationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserInviteUserSInvitesListInvitationsResponseRole struct { +type UserInviteListResponseRole struct { // Role identifier tag. ID string `json:"id,required"` // Description of role's permissions. @@ -158,13 +142,13 @@ type UserInviteUserSInvitesListInvitationsResponseRole struct { // Role Name. Name string `json:"name,required"` // Access permissions for this User. - Permissions []string `json:"permissions,required"` - JSON userInviteUserSInvitesListInvitationsResponseRoleJSON `json:"-"` + Permissions []string `json:"permissions,required"` + JSON userInviteListResponseRoleJSON `json:"-"` } -// userInviteUserSInvitesListInvitationsResponseRoleJSON contains the JSON metadata -// for the struct [UserInviteUserSInvitesListInvitationsResponseRole] -type userInviteUserSInvitesListInvitationsResponseRoleJSON struct { +// userInviteListResponseRoleJSON contains the JSON metadata for the struct +// [UserInviteListResponseRole] +type userInviteListResponseRoleJSON struct { ID apijson.Field Description apijson.Field Name apijson.Field @@ -173,20 +157,36 @@ type userInviteUserSInvitesListInvitationsResponseRoleJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserInviteUserSInvitesListInvitationsResponseRole) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteListResponseRole) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Current status of the invitation. -type UserInviteUserSInvitesListInvitationsResponseStatus string +type UserInviteListResponseStatus string const ( - UserInviteUserSInvitesListInvitationsResponseStatusPending UserInviteUserSInvitesListInvitationsResponseStatus = "pending" - UserInviteUserSInvitesListInvitationsResponseStatusAccepted UserInviteUserSInvitesListInvitationsResponseStatus = "accepted" - UserInviteUserSInvitesListInvitationsResponseStatusRejected UserInviteUserSInvitesListInvitationsResponseStatus = "rejected" - UserInviteUserSInvitesListInvitationsResponseStatusExpired UserInviteUserSInvitesListInvitationsResponseStatus = "expired" + UserInviteListResponseStatusPending UserInviteListResponseStatus = "pending" + UserInviteListResponseStatusAccepted UserInviteListResponseStatus = "accepted" + UserInviteListResponseStatusRejected UserInviteListResponseStatus = "rejected" + UserInviteListResponseStatusExpired UserInviteListResponseStatus = "expired" ) +// Union satisfied by [UserInviteGetResponseUnknown] or [shared.UnionString]. +type UserInviteGetResponse interface { + ImplementsUserInviteGetResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*UserInviteGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + type UserInviteUpdateParams struct { // Status of your response to the invitation (rejected or accepted). Status param.Field[UserInviteUpdateParamsStatus] `json:"status,required"` @@ -273,172 +273,169 @@ const ( UserInviteUpdateResponseEnvelopeSuccessTrue UserInviteUpdateResponseEnvelopeSuccess = true ) -type UserInviteGetResponseEnvelope struct { - Errors []UserInviteGetResponseEnvelopeErrors `json:"errors,required"` - Messages []UserInviteGetResponseEnvelopeMessages `json:"messages,required"` - Result UserInviteGetResponse `json:"result,required"` +type UserInviteListResponseEnvelope struct { + Errors []UserInviteListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserInviteListResponseEnvelopeMessages `json:"messages,required"` + Result []UserInviteListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserInviteGetResponseEnvelopeSuccess `json:"success,required"` - JSON userInviteGetResponseEnvelopeJSON `json:"-"` + Success UserInviteListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserInviteListResponseEnvelopeResultInfo `json:"result_info"` + JSON userInviteListResponseEnvelopeJSON `json:"-"` } -// userInviteGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [UserInviteGetResponseEnvelope] -type userInviteGetResponseEnvelopeJSON struct { +// userInviteListResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserInviteListResponseEnvelope] +type userInviteListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserInviteGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userInviteGetResponseEnvelopeErrorsJSON `json:"-"` +type UserInviteListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userInviteListResponseEnvelopeErrorsJSON `json:"-"` } -// userInviteGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [UserInviteGetResponseEnvelopeErrors] -type userInviteGetResponseEnvelopeErrorsJSON struct { +// userInviteListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [UserInviteListResponseEnvelopeErrors] +type userInviteListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserInviteGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userInviteGetResponseEnvelopeMessagesJSON `json:"-"` +type UserInviteListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userInviteListResponseEnvelopeMessagesJSON `json:"-"` } -// userInviteGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [UserInviteGetResponseEnvelopeMessages] -type userInviteGetResponseEnvelopeMessagesJSON struct { +// userInviteListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [UserInviteListResponseEnvelopeMessages] +type userInviteListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserInviteGetResponseEnvelopeSuccess bool +type UserInviteListResponseEnvelopeSuccess bool const ( - UserInviteGetResponseEnvelopeSuccessTrue UserInviteGetResponseEnvelopeSuccess = true + UserInviteListResponseEnvelopeSuccessTrue UserInviteListResponseEnvelopeSuccess = true ) -type UserInviteUserSInvitesListInvitationsResponseEnvelope struct { - Errors []UserInviteUserSInvitesListInvitationsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserInviteUserSInvitesListInvitationsResponseEnvelopeMessages `json:"messages,required"` - Result []UserInviteUserSInvitesListInvitationsResponse `json:"result,required,nullable"` +type UserInviteListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON userInviteListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// userInviteListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [UserInviteListResponseEnvelopeResultInfo] +type userInviteListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserInviteListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserInviteGetResponseEnvelope struct { + Errors []UserInviteGetResponseEnvelopeErrors `json:"errors,required"` + Messages []UserInviteGetResponseEnvelopeMessages `json:"messages,required"` + Result UserInviteGetResponse `json:"result,required"` // Whether the API call was successful - Success UserInviteUserSInvitesListInvitationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserInviteUserSInvitesListInvitationsResponseEnvelopeResultInfo `json:"result_info"` - JSON userInviteUserSInvitesListInvitationsResponseEnvelopeJSON `json:"-"` + Success UserInviteGetResponseEnvelopeSuccess `json:"success,required"` + JSON userInviteGetResponseEnvelopeJSON `json:"-"` } -// userInviteUserSInvitesListInvitationsResponseEnvelopeJSON contains the JSON -// metadata for the struct [UserInviteUserSInvitesListInvitationsResponseEnvelope] -type userInviteUserSInvitesListInvitationsResponseEnvelopeJSON struct { +// userInviteGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserInviteGetResponseEnvelope] +type userInviteGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteUserSInvitesListInvitationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserInviteUserSInvitesListInvitationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userInviteUserSInvitesListInvitationsResponseEnvelopeErrorsJSON `json:"-"` +type UserInviteGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userInviteGetResponseEnvelopeErrorsJSON `json:"-"` } -// userInviteUserSInvitesListInvitationsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [UserInviteUserSInvitesListInvitationsResponseEnvelopeErrors] -type userInviteUserSInvitesListInvitationsResponseEnvelopeErrorsJSON struct { +// userInviteGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [UserInviteGetResponseEnvelopeErrors] +type userInviteGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteUserSInvitesListInvitationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserInviteUserSInvitesListInvitationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userInviteUserSInvitesListInvitationsResponseEnvelopeMessagesJSON `json:"-"` +type UserInviteGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userInviteGetResponseEnvelopeMessagesJSON `json:"-"` } -// userInviteUserSInvitesListInvitationsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [UserInviteUserSInvitesListInvitationsResponseEnvelopeMessages] -type userInviteUserSInvitesListInvitationsResponseEnvelopeMessagesJSON struct { +// userInviteGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [UserInviteGetResponseEnvelopeMessages] +type userInviteGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserInviteUserSInvitesListInvitationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserInviteGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserInviteUserSInvitesListInvitationsResponseEnvelopeSuccess bool +type UserInviteGetResponseEnvelopeSuccess bool const ( - UserInviteUserSInvitesListInvitationsResponseEnvelopeSuccessTrue UserInviteUserSInvitesListInvitationsResponseEnvelopeSuccess = true + UserInviteGetResponseEnvelopeSuccessTrue UserInviteGetResponseEnvelopeSuccess = true ) - -type UserInviteUserSInvitesListInvitationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userInviteUserSInvitesListInvitationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userInviteUserSInvitesListInvitationsResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [UserInviteUserSInvitesListInvitationsResponseEnvelopeResultInfo] -type userInviteUserSInvitesListInvitationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserInviteUserSInvitesListInvitationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/userinvite_test.go b/userinvite_test.go index 1d618ef74cb..cbadedb94e2 100644 --- a/userinvite_test.go +++ b/userinvite_test.go @@ -45,7 +45,7 @@ func TestUserInviteUpdate(t *testing.T) { } } -func TestUserInviteGet(t *testing.T) { +func TestUserInviteList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +61,7 @@ func TestUserInviteGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Invites.Get(context.TODO(), "4f5f0c14a2a41d5063dd301b2f829f04") + _, err := client.Users.Invites.List(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -71,7 +71,7 @@ func TestUserInviteGet(t *testing.T) { } } -func TestUserInviteUserSInvitesListInvitations(t *testing.T) { +func TestUserInviteGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -87,7 +87,7 @@ func TestUserInviteUserSInvitesListInvitations(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Invites.UserSInvitesListInvitations(context.TODO()) + _, err := client.Users.Invites.Get(context.TODO(), "4f5f0c14a2a41d5063dd301b2f829f04") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userloadbalancermonitorpreview.go b/userloadbalancermonitorpreview.go index 2d2f33c6183..8def3c6471a 100644 --- a/userloadbalancermonitorpreview.go +++ b/userloadbalancermonitorpreview.go @@ -33,9 +33,9 @@ func NewUserLoadBalancerMonitorPreviewService(opts ...option.RequestOption) (r * // Preview pools using the specified monitor with provided monitor details. The // returned preview_id can be used in the preview endpoint to retrieve the results. -func (r *UserLoadBalancerMonitorPreviewService) LoadBalancerMonitorsPreviewMonitor(ctx context.Context, monitorID string, body UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams, opts ...option.RequestOption) (res *UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse, err error) { +func (r *UserLoadBalancerMonitorPreviewService) New(ctx context.Context, monitorID string, body UserLoadBalancerMonitorPreviewNewParams, opts ...option.RequestOption) (res *UserLoadBalancerMonitorPreviewNewResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelope + var env UserLoadBalancerMonitorPreviewNewResponseEnvelope path := fmt.Sprintf("user/load_balancers/monitors/%s/preview", monitorID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -45,28 +45,27 @@ func (r *UserLoadBalancerMonitorPreviewService) LoadBalancerMonitorsPreviewMonit return } -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse struct { +type UserLoadBalancerMonitorPreviewNewResponse struct { // Monitored pool IDs mapped to their respective names. - Pools map[string]string `json:"pools"` - PreviewID string `json:"preview_id"` - JSON userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseJSON `json:"-"` + Pools map[string]string `json:"pools"` + PreviewID string `json:"preview_id"` + JSON userLoadBalancerMonitorPreviewNewResponseJSON `json:"-"` } -// userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse] -type userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseJSON struct { +// userLoadBalancerMonitorPreviewNewResponseJSON contains the JSON metadata for the +// struct [UserLoadBalancerMonitorPreviewNewResponse] +type userLoadBalancerMonitorPreviewNewResponseJSON struct { Pools apijson.Field PreviewID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerMonitorPreviewNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams struct { +type UserLoadBalancerMonitorPreviewNewParams struct { // The expected HTTP response code or code range of the health check. This // parameter is only valid for HTTP and HTTPS monitors. ExpectedCodes param.Field[string] `json:"expected_codes,required"` @@ -115,39 +114,38 @@ type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams stru Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - Type param.Field[UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType] `json:"type"` + Type param.Field[UserLoadBalancerMonitorPreviewNewParamsType] `json:"type"` } -func (r UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams) MarshalJSON() (data []byte, err error) { +func (r UserLoadBalancerMonitorPreviewNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType string +type UserLoadBalancerMonitorPreviewNewParamsType string const ( - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeHTTP UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "http" - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeHTTPS UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "https" - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeTcp UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "tcp" - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeUdpIcmp UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "udp_icmp" - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeIcmpPing UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "icmp_ping" - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeSmtp UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsType = "smtp" + UserLoadBalancerMonitorPreviewNewParamsTypeHTTP UserLoadBalancerMonitorPreviewNewParamsType = "http" + UserLoadBalancerMonitorPreviewNewParamsTypeHTTPS UserLoadBalancerMonitorPreviewNewParamsType = "https" + UserLoadBalancerMonitorPreviewNewParamsTypeTcp UserLoadBalancerMonitorPreviewNewParamsType = "tcp" + UserLoadBalancerMonitorPreviewNewParamsTypeUdpIcmp UserLoadBalancerMonitorPreviewNewParamsType = "udp_icmp" + UserLoadBalancerMonitorPreviewNewParamsTypeIcmpPing UserLoadBalancerMonitorPreviewNewParamsType = "icmp_ping" + UserLoadBalancerMonitorPreviewNewParamsTypeSmtp UserLoadBalancerMonitorPreviewNewParamsType = "smtp" ) -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelope struct { - Errors []UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages `json:"messages,required"` - Result UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponse `json:"result,required"` +type UserLoadBalancerMonitorPreviewNewResponseEnvelope struct { + Errors []UserLoadBalancerMonitorPreviewNewResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerMonitorPreviewNewResponseEnvelopeMessages `json:"messages,required"` + Result UserLoadBalancerMonitorPreviewNewResponse `json:"result,required"` // Whether the API call was successful - Success UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess `json:"success,required"` - JSON userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON `json:"-"` + Success UserLoadBalancerMonitorPreviewNewResponseEnvelopeSuccess `json:"success,required"` + JSON userLoadBalancerMonitorPreviewNewResponseEnvelopeJSON `json:"-"` } -// userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelope] -type userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeJSON struct { +// userLoadBalancerMonitorPreviewNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserLoadBalancerMonitorPreviewNewResponseEnvelope] +type userLoadBalancerMonitorPreviewNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -156,53 +154,53 @@ type userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnv ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerMonitorPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON `json:"-"` +type UserLoadBalancerMonitorPreviewNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors] -type userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrorsJSON struct { +// userLoadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerMonitorPreviewNewResponseEnvelopeErrors] +type userLoadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerMonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON `json:"-"` +type UserLoadBalancerMonitorPreviewNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON `json:"-"` } -// userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages] -type userLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessagesJSON struct { +// userLoadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerMonitorPreviewNewResponseEnvelopeMessages] +type userLoadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerMonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess bool +type UserLoadBalancerMonitorPreviewNewResponseEnvelopeSuccess bool const ( - UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccessTrue UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorResponseEnvelopeSuccess = true + UserLoadBalancerMonitorPreviewNewResponseEnvelopeSuccessTrue UserLoadBalancerMonitorPreviewNewResponseEnvelopeSuccess = true ) diff --git a/userloadbalancermonitorpreview_test.go b/userloadbalancermonitorpreview_test.go index 7e1f8d99afe..5d12976da94 100644 --- a/userloadbalancermonitorpreview_test.go +++ b/userloadbalancermonitorpreview_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorWithOptionalParams(t *testing.T) { +func TestUserLoadBalancerMonitorPreviewNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestUserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorWithOpt option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Monitors.Previews.LoadBalancerMonitorsPreviewMonitor( + _, err := client.Users.LoadBalancers.Monitors.Previews.New( context.TODO(), "f1aba936b94213e5b8dca0c0dbf1f9cc", - cloudflare.UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParams{ + cloudflare.UserLoadBalancerMonitorPreviewNewParams{ ExpectedCodes: cloudflare.F("2xx"), AllowInsecure: cloudflare.F(true), ConsecutiveDown: cloudflare.F(int64(0)), @@ -55,7 +55,7 @@ func TestUserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorWithOpt ProbeZone: cloudflare.F("example.com"), Retries: cloudflare.F(int64(0)), Timeout: cloudflare.F(int64(0)), - Type: cloudflare.F(cloudflare.UserLoadBalancerMonitorPreviewLoadBalancerMonitorsPreviewMonitorParamsTypeHTTPS), + Type: cloudflare.F(cloudflare.UserLoadBalancerMonitorPreviewNewParamsTypeHTTPS), }, ) if err != nil { diff --git a/userloadbalancerpool.go b/userloadbalancerpool.go index a11157790eb..19bcfb9fb21 100644 --- a/userloadbalancerpool.go +++ b/userloadbalancerpool.go @@ -40,25 +40,12 @@ func NewUserLoadBalancerPoolService(opts ...option.RequestOption) (r *UserLoadBa return } -// Apply changes to an existing pool, overwriting the supplied properties. -func (r *UserLoadBalancerPoolService) Update(ctx context.Context, poolID string, body UserLoadBalancerPoolUpdateParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolUpdateResponseEnvelope - path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Delete a configured pool. -func (r *UserLoadBalancerPoolService) Delete(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolDeleteResponse, err error) { +// Create a new pool. +func (r *UserLoadBalancerPoolService) New(ctx context.Context, body UserLoadBalancerPoolNewParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolNewResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolDeleteResponseEnvelope - path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env UserLoadBalancerPoolNewResponseEnvelope + path := "user/load_balancers/pools" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -66,12 +53,12 @@ func (r *UserLoadBalancerPoolService) Delete(ctx context.Context, poolID string, return } -// Fetch a single configured pool. -func (r *UserLoadBalancerPoolService) Get(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolGetResponse, err error) { +// Apply changes to an existing pool, overwriting the supplied properties. +func (r *UserLoadBalancerPoolService) Update(ctx context.Context, poolID string, body UserLoadBalancerPoolUpdateParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolGetResponseEnvelope + var env UserLoadBalancerPoolUpdateResponseEnvelope path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -79,12 +66,12 @@ func (r *UserLoadBalancerPoolService) Get(ctx context.Context, poolID string, op return } -// Create a new pool. -func (r *UserLoadBalancerPoolService) LoadBalancerPoolsNewPool(ctx context.Context, body UserLoadBalancerPoolLoadBalancerPoolsNewPoolParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse, err error) { +// List configured pools. +func (r *UserLoadBalancerPoolService) List(ctx context.Context, query UserLoadBalancerPoolListParams, opts ...option.RequestOption) (res *[]UserLoadBalancerPoolListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelope + var env UserLoadBalancerPoolListResponseEnvelope path := "user/load_balancers/pools" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -92,12 +79,12 @@ func (r *UserLoadBalancerPoolService) LoadBalancerPoolsNewPool(ctx context.Conte return } -// List configured pools. -func (r *UserLoadBalancerPoolService) LoadBalancerPoolsListPools(ctx context.Context, query UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams, opts ...option.RequestOption) (res *[]UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse, err error) { +// Delete a configured pool. +func (r *UserLoadBalancerPoolService) Delete(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelope - path := "user/load_balancers/pools" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env UserLoadBalancerPoolDeleteResponseEnvelope + path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -105,15 +92,12 @@ func (r *UserLoadBalancerPoolService) LoadBalancerPoolsListPools(ctx context.Con return } -// Apply changes to a number of existing pools, overwriting the supplied -// properties. Pools are ordered by ascending `name`. Returns the list of affected -// pools. Supports the standard pagination query parameters, either -// `limit`/`offset` or `per_page`/`page`. -func (r *UserLoadBalancerPoolService) LoadBalancerPoolsPatchPools(ctx context.Context, body UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParams, opts ...option.RequestOption) (res *[]UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse, err error) { +// Fetch a single configured pool. +func (r *UserLoadBalancerPoolService) Get(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolGetResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelope - path := "user/load_balancers/pools" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env UserLoadBalancerPoolGetResponseEnvelope + path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -121,12 +105,12 @@ func (r *UserLoadBalancerPoolService) LoadBalancerPoolsPatchPools(ctx context.Co return } -type UserLoadBalancerPoolUpdateResponse struct { +type UserLoadBalancerPoolNewResponse struct { ID string `json:"id"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - CheckRegions []UserLoadBalancerPoolUpdateResponseCheckRegion `json:"check_regions,nullable"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + CheckRegions []UserLoadBalancerPoolNewResponseCheckRegion `json:"check_regions,nullable"` + CreatedOn time.Time `json:"created_on" format:"date-time"` // A human-readable description of the pool. Description string `json:"description"` // This field shows up only if the pool is disabled. This field is set with the @@ -140,7 +124,7 @@ type UserLoadBalancerPoolUpdateResponse struct { // decimal degrees. If this is set, longitude must also be set. Latitude float64 `json:"latitude"` // Configures load shedding policies and percentages for the pool. - LoadShedding UserLoadBalancerPoolUpdateResponseLoadShedding `json:"load_shedding"` + LoadShedding UserLoadBalancerPoolNewResponseLoadShedding `json:"load_shedding"` // The longitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, latitude must also be set. Longitude float64 `json:"longitude"` @@ -163,19 +147,19 @@ type UserLoadBalancerPoolUpdateResponse struct { NotificationEmail string `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. - NotificationFilter UserLoadBalancerPoolUpdateResponseNotificationFilter `json:"notification_filter,nullable"` + NotificationFilter UserLoadBalancerPoolNewResponseNotificationFilter `json:"notification_filter,nullable"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. - OriginSteering UserLoadBalancerPoolUpdateResponseOriginSteering `json:"origin_steering"` + OriginSteering UserLoadBalancerPoolNewResponseOriginSteering `json:"origin_steering"` // The list of origins within this pool. Traffic directed at this pool is balanced // across all currently healthy origins, provided the pool itself is healthy. - Origins []UserLoadBalancerPoolUpdateResponseOrigin `json:"origins"` - JSON userLoadBalancerPoolUpdateResponseJSON `json:"-"` + Origins []UserLoadBalancerPoolNewResponseOrigin `json:"origins"` + JSON userLoadBalancerPoolNewResponseJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseJSON contains the JSON metadata for the struct -// [UserLoadBalancerPoolUpdateResponse] -type userLoadBalancerPoolUpdateResponseJSON struct { +// userLoadBalancerPoolNewResponseJSON contains the JSON metadata for the struct +// [UserLoadBalancerPoolNewResponse] +type userLoadBalancerPoolNewResponseJSON struct { ID apijson.Field CheckRegions apijson.Field CreatedOn apijson.Field @@ -197,7 +181,7 @@ type userLoadBalancerPoolUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -206,27 +190,27 @@ func (r *UserLoadBalancerPoolUpdateResponse) UnmarshalJSON(data []byte) (err err // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: // Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all // regions (ENTERPRISE customers only). -type UserLoadBalancerPoolUpdateResponseCheckRegion string +type UserLoadBalancerPoolNewResponseCheckRegion string const ( - UserLoadBalancerPoolUpdateResponseCheckRegionWnam UserLoadBalancerPoolUpdateResponseCheckRegion = "WNAM" - UserLoadBalancerPoolUpdateResponseCheckRegionEnam UserLoadBalancerPoolUpdateResponseCheckRegion = "ENAM" - UserLoadBalancerPoolUpdateResponseCheckRegionWeu UserLoadBalancerPoolUpdateResponseCheckRegion = "WEU" - UserLoadBalancerPoolUpdateResponseCheckRegionEeu UserLoadBalancerPoolUpdateResponseCheckRegion = "EEU" - UserLoadBalancerPoolUpdateResponseCheckRegionNsam UserLoadBalancerPoolUpdateResponseCheckRegion = "NSAM" - UserLoadBalancerPoolUpdateResponseCheckRegionSsam UserLoadBalancerPoolUpdateResponseCheckRegion = "SSAM" - UserLoadBalancerPoolUpdateResponseCheckRegionOc UserLoadBalancerPoolUpdateResponseCheckRegion = "OC" - UserLoadBalancerPoolUpdateResponseCheckRegionMe UserLoadBalancerPoolUpdateResponseCheckRegion = "ME" - UserLoadBalancerPoolUpdateResponseCheckRegionNaf UserLoadBalancerPoolUpdateResponseCheckRegion = "NAF" - UserLoadBalancerPoolUpdateResponseCheckRegionSaf UserLoadBalancerPoolUpdateResponseCheckRegion = "SAF" - UserLoadBalancerPoolUpdateResponseCheckRegionSas UserLoadBalancerPoolUpdateResponseCheckRegion = "SAS" - UserLoadBalancerPoolUpdateResponseCheckRegionSeas UserLoadBalancerPoolUpdateResponseCheckRegion = "SEAS" - UserLoadBalancerPoolUpdateResponseCheckRegionNeas UserLoadBalancerPoolUpdateResponseCheckRegion = "NEAS" - UserLoadBalancerPoolUpdateResponseCheckRegionAllRegions UserLoadBalancerPoolUpdateResponseCheckRegion = "ALL_REGIONS" + UserLoadBalancerPoolNewResponseCheckRegionWnam UserLoadBalancerPoolNewResponseCheckRegion = "WNAM" + UserLoadBalancerPoolNewResponseCheckRegionEnam UserLoadBalancerPoolNewResponseCheckRegion = "ENAM" + UserLoadBalancerPoolNewResponseCheckRegionWeu UserLoadBalancerPoolNewResponseCheckRegion = "WEU" + UserLoadBalancerPoolNewResponseCheckRegionEeu UserLoadBalancerPoolNewResponseCheckRegion = "EEU" + UserLoadBalancerPoolNewResponseCheckRegionNsam UserLoadBalancerPoolNewResponseCheckRegion = "NSAM" + UserLoadBalancerPoolNewResponseCheckRegionSsam UserLoadBalancerPoolNewResponseCheckRegion = "SSAM" + UserLoadBalancerPoolNewResponseCheckRegionOc UserLoadBalancerPoolNewResponseCheckRegion = "OC" + UserLoadBalancerPoolNewResponseCheckRegionMe UserLoadBalancerPoolNewResponseCheckRegion = "ME" + UserLoadBalancerPoolNewResponseCheckRegionNaf UserLoadBalancerPoolNewResponseCheckRegion = "NAF" + UserLoadBalancerPoolNewResponseCheckRegionSaf UserLoadBalancerPoolNewResponseCheckRegion = "SAF" + UserLoadBalancerPoolNewResponseCheckRegionSas UserLoadBalancerPoolNewResponseCheckRegion = "SAS" + UserLoadBalancerPoolNewResponseCheckRegionSeas UserLoadBalancerPoolNewResponseCheckRegion = "SEAS" + UserLoadBalancerPoolNewResponseCheckRegionNeas UserLoadBalancerPoolNewResponseCheckRegion = "NEAS" + UserLoadBalancerPoolNewResponseCheckRegionAllRegions UserLoadBalancerPoolNewResponseCheckRegion = "ALL_REGIONS" ) // Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolUpdateResponseLoadShedding struct { +type UserLoadBalancerPoolNewResponseLoadShedding struct { // The percent of traffic to shed from the pool, according to the default policy. // Applies to new sessions and traffic without session affinity. DefaultPercent float64 `json:"default_percent"` @@ -234,19 +218,19 @@ type UserLoadBalancerPoolUpdateResponseLoadShedding struct { // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. - DefaultPolicy UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy `json:"default_policy"` + DefaultPolicy UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicy `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. SessionPercent float64 `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). - SessionPolicy UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy `json:"session_policy"` - JSON userLoadBalancerPoolUpdateResponseLoadSheddingJSON `json:"-"` + SessionPolicy UserLoadBalancerPoolNewResponseLoadSheddingSessionPolicy `json:"session_policy"` + JSON userLoadBalancerPoolNewResponseLoadSheddingJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseLoadSheddingJSON contains the JSON metadata -// for the struct [UserLoadBalancerPoolUpdateResponseLoadShedding] -type userLoadBalancerPoolUpdateResponseLoadSheddingJSON struct { +// userLoadBalancerPoolNewResponseLoadSheddingJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolNewResponseLoadShedding] +type userLoadBalancerPoolNewResponseLoadSheddingJSON struct { DefaultPercent apijson.Field DefaultPolicy apijson.Field SessionPercent apijson.Field @@ -255,7 +239,7 @@ type userLoadBalancerPoolUpdateResponseLoadSheddingJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -263,99 +247,98 @@ func (r *UserLoadBalancerPoolUpdateResponseLoadShedding) UnmarshalJSON(data []by // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. -type UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy string +type UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicy string const ( - UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "hash" + UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicy = "random" + UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolNewResponseLoadSheddingDefaultPolicy = "hash" ) // Only the hash policy is supported for existing sessions (to avoid exponential // decay). -type UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy string +type UserLoadBalancerPoolNewResponseLoadSheddingSessionPolicy string const ( - UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy = "hash" + UserLoadBalancerPoolNewResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolNewResponseLoadSheddingSessionPolicy = "hash" ) // Filter pool and origin health notifications by resource type or health status. // Use null to reset. -type UserLoadBalancerPoolUpdateResponseNotificationFilter struct { +type UserLoadBalancerPoolNewResponseNotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. - Origin UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin `json:"origin,nullable"` + Origin UserLoadBalancerPoolNewResponseNotificationFilterOrigin `json:"origin,nullable"` // Filter options for a particular resource type (pool or origin). Use null to // reset. - Pool UserLoadBalancerPoolUpdateResponseNotificationFilterPool `json:"pool,nullable"` - JSON userLoadBalancerPoolUpdateResponseNotificationFilterJSON `json:"-"` + Pool UserLoadBalancerPoolNewResponseNotificationFilterPool `json:"pool,nullable"` + JSON userLoadBalancerPoolNewResponseNotificationFilterJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseNotificationFilterJSON contains the JSON -// metadata for the struct [UserLoadBalancerPoolUpdateResponseNotificationFilter] -type userLoadBalancerPoolUpdateResponseNotificationFilterJSON struct { +// userLoadBalancerPoolNewResponseNotificationFilterJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolNewResponseNotificationFilter] +type userLoadBalancerPoolNewResponseNotificationFilterJSON struct { Origin apijson.Field Pool apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin struct { +type UserLoadBalancerPoolNewResponseNotificationFilterOrigin struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolNewResponseNotificationFilterOriginJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON contains the JSON +// userLoadBalancerPoolNewResponseNotificationFilterOriginJSON contains the JSON // metadata for the struct -// [UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin] -type userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON struct { +// [UserLoadBalancerPoolNewResponseNotificationFilterOrigin] +type userLoadBalancerPoolNewResponseNotificationFilterOriginJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolUpdateResponseNotificationFilterPool struct { +type UserLoadBalancerPoolNewResponseNotificationFilterPool struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolNewResponseNotificationFilterPoolJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON contains the JSON -// metadata for the struct -// [UserLoadBalancerPoolUpdateResponseNotificationFilterPool] -type userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON struct { +// userLoadBalancerPoolNewResponseNotificationFilterPoolJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolNewResponseNotificationFilterPool] +type userLoadBalancerPoolNewResponseNotificationFilterPoolJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. -type UserLoadBalancerPoolUpdateResponseOriginSteering struct { +type UserLoadBalancerPoolNewResponseOriginSteering struct { // The type of origin steering policy to use. // // - `"random"`: Select an origin randomly. @@ -369,19 +352,19 @@ type UserLoadBalancerPoolUpdateResponseOriginSteering struct { // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. - Policy UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy `json:"policy"` - JSON userLoadBalancerPoolUpdateResponseOriginSteeringJSON `json:"-"` + Policy UserLoadBalancerPoolNewResponseOriginSteeringPolicy `json:"policy"` + JSON userLoadBalancerPoolNewResponseOriginSteeringJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseOriginSteeringJSON contains the JSON metadata -// for the struct [UserLoadBalancerPoolUpdateResponseOriginSteering] -type userLoadBalancerPoolUpdateResponseOriginSteeringJSON struct { +// userLoadBalancerPoolNewResponseOriginSteeringJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolNewResponseOriginSteering] +type userLoadBalancerPoolNewResponseOriginSteeringJSON struct { Policy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -398,16 +381,16 @@ func (r *UserLoadBalancerPoolUpdateResponseOriginSteering) UnmarshalJSON(data [] // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy string +type UserLoadBalancerPoolNewResponseOriginSteeringPolicy string const ( - UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyRandom UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "random" - UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyHash UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "hash" - UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_connections" + UserLoadBalancerPoolNewResponseOriginSteeringPolicyRandom UserLoadBalancerPoolNewResponseOriginSteeringPolicy = "random" + UserLoadBalancerPoolNewResponseOriginSteeringPolicyHash UserLoadBalancerPoolNewResponseOriginSteeringPolicy = "hash" + UserLoadBalancerPoolNewResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolNewResponseOriginSteeringPolicy = "least_outstanding_requests" + UserLoadBalancerPoolNewResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolNewResponseOriginSteeringPolicy = "least_connections" ) -type UserLoadBalancerPoolUpdateResponseOrigin struct { +type UserLoadBalancerPoolNewResponseOrigin struct { // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable // hostname. Hostnames entered here should resolve directly to the origin, and not // be a hostname proxied by Cloudflare. To set an internal/reserved address, @@ -422,7 +405,7 @@ type UserLoadBalancerPoolUpdateResponseOrigin struct { Enabled bool `json:"enabled"` // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. - Header UserLoadBalancerPoolUpdateResponseOriginsHeader `json:"header"` + Header UserLoadBalancerPoolNewResponseOriginsHeader `json:"header"` // A human-identifiable name for the origin. Name string `json:"name"` // The virtual network subnet ID the origin belongs in. Virtual network must also @@ -436,13 +419,13 @@ type UserLoadBalancerPoolUpdateResponseOrigin struct { // origin's outstanding requests. // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's // open connections. - Weight float64 `json:"weight"` - JSON userLoadBalancerPoolUpdateResponseOriginJSON `json:"-"` + Weight float64 `json:"weight"` + JSON userLoadBalancerPoolNewResponseOriginJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseOriginJSON contains the JSON metadata for the -// struct [UserLoadBalancerPoolUpdateResponseOrigin] -type userLoadBalancerPoolUpdateResponseOriginJSON struct { +// userLoadBalancerPoolNewResponseOriginJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolNewResponseOrigin] +type userLoadBalancerPoolNewResponseOriginJSON struct { Address apijson.Field DisabledAt apijson.Field Enabled apijson.Field @@ -454,54 +437,37 @@ type userLoadBalancerPoolUpdateResponseOriginJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. -type UserLoadBalancerPoolUpdateResponseOriginsHeader struct { +type UserLoadBalancerPoolNewResponseOriginsHeader struct { // The 'Host' header allows to override the hostname set in the HTTP request. // Current support is 1 'Host' header override per origin. - Host []string `json:"Host"` - JSON userLoadBalancerPoolUpdateResponseOriginsHeaderJSON `json:"-"` + Host []string `json:"Host"` + JSON userLoadBalancerPoolNewResponseOriginsHeaderJSON `json:"-"` } -// userLoadBalancerPoolUpdateResponseOriginsHeaderJSON contains the JSON metadata -// for the struct [UserLoadBalancerPoolUpdateResponseOriginsHeader] -type userLoadBalancerPoolUpdateResponseOriginsHeaderJSON struct { +// userLoadBalancerPoolNewResponseOriginsHeaderJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolNewResponseOriginsHeader] +type userLoadBalancerPoolNewResponseOriginsHeaderJSON struct { Host apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolUpdateResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolDeleteResponse struct { - ID string `json:"id"` - JSON userLoadBalancerPoolDeleteResponseJSON `json:"-"` -} - -// userLoadBalancerPoolDeleteResponseJSON contains the JSON metadata for the struct -// [UserLoadBalancerPoolDeleteResponse] -type userLoadBalancerPoolDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolGetResponse struct { +type UserLoadBalancerPoolUpdateResponse struct { ID string `json:"id"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - CheckRegions []UserLoadBalancerPoolGetResponseCheckRegion `json:"check_regions,nullable"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + CheckRegions []UserLoadBalancerPoolUpdateResponseCheckRegion `json:"check_regions,nullable"` + CreatedOn time.Time `json:"created_on" format:"date-time"` // A human-readable description of the pool. Description string `json:"description"` // This field shows up only if the pool is disabled. This field is set with the @@ -515,7 +481,7 @@ type UserLoadBalancerPoolGetResponse struct { // decimal degrees. If this is set, longitude must also be set. Latitude float64 `json:"latitude"` // Configures load shedding policies and percentages for the pool. - LoadShedding UserLoadBalancerPoolGetResponseLoadShedding `json:"load_shedding"` + LoadShedding UserLoadBalancerPoolUpdateResponseLoadShedding `json:"load_shedding"` // The longitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, latitude must also be set. Longitude float64 `json:"longitude"` @@ -538,19 +504,19 @@ type UserLoadBalancerPoolGetResponse struct { NotificationEmail string `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. - NotificationFilter UserLoadBalancerPoolGetResponseNotificationFilter `json:"notification_filter,nullable"` + NotificationFilter UserLoadBalancerPoolUpdateResponseNotificationFilter `json:"notification_filter,nullable"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. - OriginSteering UserLoadBalancerPoolGetResponseOriginSteering `json:"origin_steering"` + OriginSteering UserLoadBalancerPoolUpdateResponseOriginSteering `json:"origin_steering"` // The list of origins within this pool. Traffic directed at this pool is balanced // across all currently healthy origins, provided the pool itself is healthy. - Origins []UserLoadBalancerPoolGetResponseOrigin `json:"origins"` - JSON userLoadBalancerPoolGetResponseJSON `json:"-"` + Origins []UserLoadBalancerPoolUpdateResponseOrigin `json:"origins"` + JSON userLoadBalancerPoolUpdateResponseJSON `json:"-"` } -// userLoadBalancerPoolGetResponseJSON contains the JSON metadata for the struct -// [UserLoadBalancerPoolGetResponse] -type userLoadBalancerPoolGetResponseJSON struct { +// userLoadBalancerPoolUpdateResponseJSON contains the JSON metadata for the struct +// [UserLoadBalancerPoolUpdateResponse] +type userLoadBalancerPoolUpdateResponseJSON struct { ID apijson.Field CheckRegions apijson.Field CreatedOn apijson.Field @@ -572,7 +538,7 @@ type userLoadBalancerPoolGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -581,27 +547,27 @@ func (r *UserLoadBalancerPoolGetResponse) UnmarshalJSON(data []byte) (err error) // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: // Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all // regions (ENTERPRISE customers only). -type UserLoadBalancerPoolGetResponseCheckRegion string +type UserLoadBalancerPoolUpdateResponseCheckRegion string const ( - UserLoadBalancerPoolGetResponseCheckRegionWnam UserLoadBalancerPoolGetResponseCheckRegion = "WNAM" - UserLoadBalancerPoolGetResponseCheckRegionEnam UserLoadBalancerPoolGetResponseCheckRegion = "ENAM" - UserLoadBalancerPoolGetResponseCheckRegionWeu UserLoadBalancerPoolGetResponseCheckRegion = "WEU" - UserLoadBalancerPoolGetResponseCheckRegionEeu UserLoadBalancerPoolGetResponseCheckRegion = "EEU" - UserLoadBalancerPoolGetResponseCheckRegionNsam UserLoadBalancerPoolGetResponseCheckRegion = "NSAM" - UserLoadBalancerPoolGetResponseCheckRegionSsam UserLoadBalancerPoolGetResponseCheckRegion = "SSAM" - UserLoadBalancerPoolGetResponseCheckRegionOc UserLoadBalancerPoolGetResponseCheckRegion = "OC" - UserLoadBalancerPoolGetResponseCheckRegionMe UserLoadBalancerPoolGetResponseCheckRegion = "ME" - UserLoadBalancerPoolGetResponseCheckRegionNaf UserLoadBalancerPoolGetResponseCheckRegion = "NAF" - UserLoadBalancerPoolGetResponseCheckRegionSaf UserLoadBalancerPoolGetResponseCheckRegion = "SAF" - UserLoadBalancerPoolGetResponseCheckRegionSas UserLoadBalancerPoolGetResponseCheckRegion = "SAS" - UserLoadBalancerPoolGetResponseCheckRegionSeas UserLoadBalancerPoolGetResponseCheckRegion = "SEAS" - UserLoadBalancerPoolGetResponseCheckRegionNeas UserLoadBalancerPoolGetResponseCheckRegion = "NEAS" - UserLoadBalancerPoolGetResponseCheckRegionAllRegions UserLoadBalancerPoolGetResponseCheckRegion = "ALL_REGIONS" + UserLoadBalancerPoolUpdateResponseCheckRegionWnam UserLoadBalancerPoolUpdateResponseCheckRegion = "WNAM" + UserLoadBalancerPoolUpdateResponseCheckRegionEnam UserLoadBalancerPoolUpdateResponseCheckRegion = "ENAM" + UserLoadBalancerPoolUpdateResponseCheckRegionWeu UserLoadBalancerPoolUpdateResponseCheckRegion = "WEU" + UserLoadBalancerPoolUpdateResponseCheckRegionEeu UserLoadBalancerPoolUpdateResponseCheckRegion = "EEU" + UserLoadBalancerPoolUpdateResponseCheckRegionNsam UserLoadBalancerPoolUpdateResponseCheckRegion = "NSAM" + UserLoadBalancerPoolUpdateResponseCheckRegionSsam UserLoadBalancerPoolUpdateResponseCheckRegion = "SSAM" + UserLoadBalancerPoolUpdateResponseCheckRegionOc UserLoadBalancerPoolUpdateResponseCheckRegion = "OC" + UserLoadBalancerPoolUpdateResponseCheckRegionMe UserLoadBalancerPoolUpdateResponseCheckRegion = "ME" + UserLoadBalancerPoolUpdateResponseCheckRegionNaf UserLoadBalancerPoolUpdateResponseCheckRegion = "NAF" + UserLoadBalancerPoolUpdateResponseCheckRegionSaf UserLoadBalancerPoolUpdateResponseCheckRegion = "SAF" + UserLoadBalancerPoolUpdateResponseCheckRegionSas UserLoadBalancerPoolUpdateResponseCheckRegion = "SAS" + UserLoadBalancerPoolUpdateResponseCheckRegionSeas UserLoadBalancerPoolUpdateResponseCheckRegion = "SEAS" + UserLoadBalancerPoolUpdateResponseCheckRegionNeas UserLoadBalancerPoolUpdateResponseCheckRegion = "NEAS" + UserLoadBalancerPoolUpdateResponseCheckRegionAllRegions UserLoadBalancerPoolUpdateResponseCheckRegion = "ALL_REGIONS" ) // Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolGetResponseLoadShedding struct { +type UserLoadBalancerPoolUpdateResponseLoadShedding struct { // The percent of traffic to shed from the pool, according to the default policy. // Applies to new sessions and traffic without session affinity. DefaultPercent float64 `json:"default_percent"` @@ -609,19 +575,19 @@ type UserLoadBalancerPoolGetResponseLoadShedding struct { // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. - DefaultPolicy UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy `json:"default_policy"` + DefaultPolicy UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. SessionPercent float64 `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). - SessionPolicy UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy `json:"session_policy"` - JSON userLoadBalancerPoolGetResponseLoadSheddingJSON `json:"-"` + SessionPolicy UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy `json:"session_policy"` + JSON userLoadBalancerPoolUpdateResponseLoadSheddingJSON `json:"-"` } -// userLoadBalancerPoolGetResponseLoadSheddingJSON contains the JSON metadata for -// the struct [UserLoadBalancerPoolGetResponseLoadShedding] -type userLoadBalancerPoolGetResponseLoadSheddingJSON struct { +// userLoadBalancerPoolUpdateResponseLoadSheddingJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolUpdateResponseLoadShedding] +type userLoadBalancerPoolUpdateResponseLoadSheddingJSON struct { DefaultPercent apijson.Field DefaultPolicy apijson.Field SessionPercent apijson.Field @@ -630,7 +596,7 @@ type userLoadBalancerPoolGetResponseLoadSheddingJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -638,98 +604,99 @@ func (r *UserLoadBalancerPoolGetResponseLoadShedding) UnmarshalJSON(data []byte) // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. -type UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy string +type UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy string const ( - UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "hash" + UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "random" + UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "hash" ) // Only the hash policy is supported for existing sessions (to avoid exponential // decay). -type UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy string +type UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy string const ( - UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy = "hash" + UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy = "hash" ) // Filter pool and origin health notifications by resource type or health status. // Use null to reset. -type UserLoadBalancerPoolGetResponseNotificationFilter struct { +type UserLoadBalancerPoolUpdateResponseNotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. - Origin UserLoadBalancerPoolGetResponseNotificationFilterOrigin `json:"origin,nullable"` + Origin UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin `json:"origin,nullable"` // Filter options for a particular resource type (pool or origin). Use null to // reset. - Pool UserLoadBalancerPoolGetResponseNotificationFilterPool `json:"pool,nullable"` - JSON userLoadBalancerPoolGetResponseNotificationFilterJSON `json:"-"` + Pool UserLoadBalancerPoolUpdateResponseNotificationFilterPool `json:"pool,nullable"` + JSON userLoadBalancerPoolUpdateResponseNotificationFilterJSON `json:"-"` } -// userLoadBalancerPoolGetResponseNotificationFilterJSON contains the JSON metadata -// for the struct [UserLoadBalancerPoolGetResponseNotificationFilter] -type userLoadBalancerPoolGetResponseNotificationFilterJSON struct { +// userLoadBalancerPoolUpdateResponseNotificationFilterJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolUpdateResponseNotificationFilter] +type userLoadBalancerPoolUpdateResponseNotificationFilterJSON struct { Origin apijson.Field Pool apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolGetResponseNotificationFilterOrigin struct { +type UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolGetResponseNotificationFilterOriginJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON `json:"-"` } -// userLoadBalancerPoolGetResponseNotificationFilterOriginJSON contains the JSON +// userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON contains the JSON // metadata for the struct -// [UserLoadBalancerPoolGetResponseNotificationFilterOrigin] -type userLoadBalancerPoolGetResponseNotificationFilterOriginJSON struct { +// [UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin] +type userLoadBalancerPoolUpdateResponseNotificationFilterOriginJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolGetResponseNotificationFilterPool struct { +type UserLoadBalancerPoolUpdateResponseNotificationFilterPool struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolGetResponseNotificationFilterPoolJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON `json:"-"` } -// userLoadBalancerPoolGetResponseNotificationFilterPoolJSON contains the JSON -// metadata for the struct [UserLoadBalancerPoolGetResponseNotificationFilterPool] -type userLoadBalancerPoolGetResponseNotificationFilterPoolJSON struct { +// userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerPoolUpdateResponseNotificationFilterPool] +type userLoadBalancerPoolUpdateResponseNotificationFilterPoolJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. -type UserLoadBalancerPoolGetResponseOriginSteering struct { +type UserLoadBalancerPoolUpdateResponseOriginSteering struct { // The type of origin steering policy to use. // // - `"random"`: Select an origin randomly. @@ -743,19 +710,19 @@ type UserLoadBalancerPoolGetResponseOriginSteering struct { // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. - Policy UserLoadBalancerPoolGetResponseOriginSteeringPolicy `json:"policy"` - JSON userLoadBalancerPoolGetResponseOriginSteeringJSON `json:"-"` + Policy UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy `json:"policy"` + JSON userLoadBalancerPoolUpdateResponseOriginSteeringJSON `json:"-"` } -// userLoadBalancerPoolGetResponseOriginSteeringJSON contains the JSON metadata for -// the struct [UserLoadBalancerPoolGetResponseOriginSteering] -type userLoadBalancerPoolGetResponseOriginSteeringJSON struct { +// userLoadBalancerPoolUpdateResponseOriginSteeringJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolUpdateResponseOriginSteering] +type userLoadBalancerPoolUpdateResponseOriginSteeringJSON struct { Policy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -772,16 +739,16 @@ func (r *UserLoadBalancerPoolGetResponseOriginSteering) UnmarshalJSON(data []byt // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolGetResponseOriginSteeringPolicy string +type UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy string const ( - UserLoadBalancerPoolGetResponseOriginSteeringPolicyRandom UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "random" - UserLoadBalancerPoolGetResponseOriginSteeringPolicyHash UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "hash" - UserLoadBalancerPoolGetResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolGetResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "least_connections" + UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyRandom UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "random" + UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyHash UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "hash" + UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_outstanding_requests" + UserLoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_connections" ) -type UserLoadBalancerPoolGetResponseOrigin struct { +type UserLoadBalancerPoolUpdateResponseOrigin struct { // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable // hostname. Hostnames entered here should resolve directly to the origin, and not // be a hostname proxied by Cloudflare. To set an internal/reserved address, @@ -796,7 +763,7 @@ type UserLoadBalancerPoolGetResponseOrigin struct { Enabled bool `json:"enabled"` // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. - Header UserLoadBalancerPoolGetResponseOriginsHeader `json:"header"` + Header UserLoadBalancerPoolUpdateResponseOriginsHeader `json:"header"` // A human-identifiable name for the origin. Name string `json:"name"` // The virtual network subnet ID the origin belongs in. Virtual network must also @@ -810,13 +777,13 @@ type UserLoadBalancerPoolGetResponseOrigin struct { // origin's outstanding requests. // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's // open connections. - Weight float64 `json:"weight"` - JSON userLoadBalancerPoolGetResponseOriginJSON `json:"-"` + Weight float64 `json:"weight"` + JSON userLoadBalancerPoolUpdateResponseOriginJSON `json:"-"` } -// userLoadBalancerPoolGetResponseOriginJSON contains the JSON metadata for the -// struct [UserLoadBalancerPoolGetResponseOrigin] -type userLoadBalancerPoolGetResponseOriginJSON struct { +// userLoadBalancerPoolUpdateResponseOriginJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolUpdateResponseOrigin] +type userLoadBalancerPoolUpdateResponseOriginJSON struct { Address apijson.Field DisabledAt apijson.Field Enabled apijson.Field @@ -828,37 +795,37 @@ type userLoadBalancerPoolGetResponseOriginJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. -type UserLoadBalancerPoolGetResponseOriginsHeader struct { +type UserLoadBalancerPoolUpdateResponseOriginsHeader struct { // The 'Host' header allows to override the hostname set in the HTTP request. // Current support is 1 'Host' header override per origin. - Host []string `json:"Host"` - JSON userLoadBalancerPoolGetResponseOriginsHeaderJSON `json:"-"` + Host []string `json:"Host"` + JSON userLoadBalancerPoolUpdateResponseOriginsHeaderJSON `json:"-"` } -// userLoadBalancerPoolGetResponseOriginsHeaderJSON contains the JSON metadata for -// the struct [UserLoadBalancerPoolGetResponseOriginsHeader] -type userLoadBalancerPoolGetResponseOriginsHeaderJSON struct { +// userLoadBalancerPoolUpdateResponseOriginsHeaderJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolUpdateResponseOriginsHeader] +type userLoadBalancerPoolUpdateResponseOriginsHeaderJSON struct { Host apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolGetResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolUpdateResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse struct { +type UserLoadBalancerPoolListResponse struct { ID string `json:"id"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - CheckRegions []UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion `json:"check_regions,nullable"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + CheckRegions []UserLoadBalancerPoolListResponseCheckRegion `json:"check_regions,nullable"` + CreatedOn time.Time `json:"created_on" format:"date-time"` // A human-readable description of the pool. Description string `json:"description"` // This field shows up only if the pool is disabled. This field is set with the @@ -872,7 +839,7 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse struct { // decimal degrees. If this is set, longitude must also be set. Latitude float64 `json:"latitude"` // Configures load shedding policies and percentages for the pool. - LoadShedding UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding `json:"load_shedding"` + LoadShedding UserLoadBalancerPoolListResponseLoadShedding `json:"load_shedding"` // The longitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, latitude must also be set. Longitude float64 `json:"longitude"` @@ -895,19 +862,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse struct { NotificationEmail string `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. - NotificationFilter UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilter `json:"notification_filter,nullable"` + NotificationFilter UserLoadBalancerPoolListResponseNotificationFilter `json:"notification_filter,nullable"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. - OriginSteering UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering `json:"origin_steering"` + OriginSteering UserLoadBalancerPoolListResponseOriginSteering `json:"origin_steering"` // The list of origins within this pool. Traffic directed at this pool is balanced // across all currently healthy origins, provided the pool itself is healthy. - Origins []UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin `json:"origins"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseJSON `json:"-"` + Origins []UserLoadBalancerPoolListResponseOrigin `json:"origins"` + JSON userLoadBalancerPoolListResponseJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseJSON contains the JSON -// metadata for the struct [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseJSON struct { +// userLoadBalancerPoolListResponseJSON contains the JSON metadata for the struct +// [UserLoadBalancerPoolListResponse] +type userLoadBalancerPoolListResponseJSON struct { ID apijson.Field CheckRegions apijson.Field CreatedOn apijson.Field @@ -929,7 +896,7 @@ type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -938,27 +905,27 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse) UnmarshalJSON(dat // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: // Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all // regions (ENTERPRISE customers only). -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion string +type UserLoadBalancerPoolListResponseCheckRegion string const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionWnam UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "WNAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionEnam UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "ENAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionWeu UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "WEU" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionEeu UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "EEU" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionNsam UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "NSAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionSsam UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "SSAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionOc UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "OC" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionMe UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "ME" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionNaf UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "NAF" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionSaf UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "SAF" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionSas UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "SAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionSeas UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "SEAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionNeas UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "NEAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegionAllRegions UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseCheckRegion = "ALL_REGIONS" + UserLoadBalancerPoolListResponseCheckRegionWnam UserLoadBalancerPoolListResponseCheckRegion = "WNAM" + UserLoadBalancerPoolListResponseCheckRegionEnam UserLoadBalancerPoolListResponseCheckRegion = "ENAM" + UserLoadBalancerPoolListResponseCheckRegionWeu UserLoadBalancerPoolListResponseCheckRegion = "WEU" + UserLoadBalancerPoolListResponseCheckRegionEeu UserLoadBalancerPoolListResponseCheckRegion = "EEU" + UserLoadBalancerPoolListResponseCheckRegionNsam UserLoadBalancerPoolListResponseCheckRegion = "NSAM" + UserLoadBalancerPoolListResponseCheckRegionSsam UserLoadBalancerPoolListResponseCheckRegion = "SSAM" + UserLoadBalancerPoolListResponseCheckRegionOc UserLoadBalancerPoolListResponseCheckRegion = "OC" + UserLoadBalancerPoolListResponseCheckRegionMe UserLoadBalancerPoolListResponseCheckRegion = "ME" + UserLoadBalancerPoolListResponseCheckRegionNaf UserLoadBalancerPoolListResponseCheckRegion = "NAF" + UserLoadBalancerPoolListResponseCheckRegionSaf UserLoadBalancerPoolListResponseCheckRegion = "SAF" + UserLoadBalancerPoolListResponseCheckRegionSas UserLoadBalancerPoolListResponseCheckRegion = "SAS" + UserLoadBalancerPoolListResponseCheckRegionSeas UserLoadBalancerPoolListResponseCheckRegion = "SEAS" + UserLoadBalancerPoolListResponseCheckRegionNeas UserLoadBalancerPoolListResponseCheckRegion = "NEAS" + UserLoadBalancerPoolListResponseCheckRegionAllRegions UserLoadBalancerPoolListResponseCheckRegion = "ALL_REGIONS" ) // Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding struct { +type UserLoadBalancerPoolListResponseLoadShedding struct { // The percent of traffic to shed from the pool, according to the default policy. // Applies to new sessions and traffic without session affinity. DefaultPercent float64 `json:"default_percent"` @@ -966,20 +933,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding struct { // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. - DefaultPolicy UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicy `json:"default_policy"` + DefaultPolicy UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicy `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. SessionPercent float64 `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). - SessionPolicy UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingSessionPolicy `json:"session_policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingJSON `json:"-"` + SessionPolicy UserLoadBalancerPoolListResponseLoadSheddingSessionPolicy `json:"session_policy"` + JSON userLoadBalancerPoolListResponseLoadSheddingJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingJSON struct { +// userLoadBalancerPoolListResponseLoadSheddingJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolListResponseLoadShedding] +type userLoadBalancerPoolListResponseLoadSheddingJSON struct { DefaultPercent apijson.Field DefaultPolicy apijson.Field SessionPercent apijson.Field @@ -988,7 +954,7 @@ type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingJSON struct ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -996,100 +962,98 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadShedding) Unmar // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicy string +type UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingDefaultPolicy = "hash" + UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicy = "random" + UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolListResponseLoadSheddingDefaultPolicy = "hash" ) // Only the hash policy is supported for existing sessions (to avoid exponential // decay). -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingSessionPolicy string +type UserLoadBalancerPoolListResponseLoadSheddingSessionPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseLoadSheddingSessionPolicy = "hash" + UserLoadBalancerPoolListResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolListResponseLoadSheddingSessionPolicy = "hash" ) // Filter pool and origin health notifications by resource type or health status. // Use null to reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilter struct { +type UserLoadBalancerPoolListResponseNotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. - Origin UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOrigin `json:"origin,nullable"` + Origin UserLoadBalancerPoolListResponseNotificationFilterOrigin `json:"origin,nullable"` // Filter options for a particular resource type (pool or origin). Use null to // reset. - Pool UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPool `json:"pool,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterJSON `json:"-"` + Pool UserLoadBalancerPoolListResponseNotificationFilterPool `json:"pool,nullable"` + JSON userLoadBalancerPoolListResponseNotificationFilterJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilter] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterJSON struct { +// userLoadBalancerPoolListResponseNotificationFilterJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolListResponseNotificationFilter] +type userLoadBalancerPoolListResponseNotificationFilterJSON struct { Origin apijson.Field Pool apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOrigin struct { +type UserLoadBalancerPoolListResponseNotificationFilterOrigin struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOriginJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolListResponseNotificationFilterOriginJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOriginJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOrigin] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOriginJSON struct { +// userLoadBalancerPoolListResponseNotificationFilterOriginJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerPoolListResponseNotificationFilterOrigin] +type userLoadBalancerPoolListResponseNotificationFilterOriginJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPool struct { +type UserLoadBalancerPoolListResponseNotificationFilterPool struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPoolJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolListResponseNotificationFilterPoolJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPoolJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPool] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPoolJSON struct { +// userLoadBalancerPoolListResponseNotificationFilterPoolJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolListResponseNotificationFilterPool] +type userLoadBalancerPoolListResponseNotificationFilterPoolJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering struct { +type UserLoadBalancerPoolListResponseOriginSteering struct { // The type of origin steering policy to use. // // - `"random"`: Select an origin randomly. @@ -1103,20 +1067,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering struct { // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. - Policy UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy `json:"policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringJSON `json:"-"` + Policy UserLoadBalancerPoolListResponseOriginSteeringPolicy `json:"policy"` + JSON userLoadBalancerPoolListResponseOriginSteeringJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringJSON struct { +// userLoadBalancerPoolListResponseOriginSteeringJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolListResponseOriginSteering] +type userLoadBalancerPoolListResponseOriginSteeringJSON struct { Policy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1133,16 +1096,16 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteering) Unm // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy string +type UserLoadBalancerPoolListResponseOriginSteeringPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy = "hash" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginSteeringPolicy = "least_connections" + UserLoadBalancerPoolListResponseOriginSteeringPolicyRandom UserLoadBalancerPoolListResponseOriginSteeringPolicy = "random" + UserLoadBalancerPoolListResponseOriginSteeringPolicyHash UserLoadBalancerPoolListResponseOriginSteeringPolicy = "hash" + UserLoadBalancerPoolListResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolListResponseOriginSteeringPolicy = "least_outstanding_requests" + UserLoadBalancerPoolListResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolListResponseOriginSteeringPolicy = "least_connections" ) -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin struct { +type UserLoadBalancerPoolListResponseOrigin struct { // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable // hostname. Hostnames entered here should resolve directly to the origin, and not // be a hostname proxied by Cloudflare. To set an internal/reserved address, @@ -1157,7 +1120,7 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin struct { Enabled bool `json:"enabled"` // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. - Header UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeader `json:"header"` + Header UserLoadBalancerPoolListResponseOriginsHeader `json:"header"` // A human-identifiable name for the origin. Name string `json:"name"` // The virtual network subnet ID the origin belongs in. Virtual network must also @@ -1171,14 +1134,13 @@ type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin struct { // origin's outstanding requests. // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's // open connections. - Weight float64 `json:"weight"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginJSON `json:"-"` + Weight float64 `json:"weight"` + JSON userLoadBalancerPoolListResponseOriginJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginJSON contains the JSON -// metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginJSON struct { +// userLoadBalancerPoolListResponseOriginJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolListResponseOrigin] +type userLoadBalancerPoolListResponseOriginJSON struct { Address apijson.Field DisabledAt apijson.Field Enabled apijson.Field @@ -1190,38 +1152,54 @@ type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeader struct { +type UserLoadBalancerPoolListResponseOriginsHeader struct { // The 'Host' header allows to override the hostname set in the HTTP request. // Current support is 1 'Host' header override per origin. - Host []string `json:"Host"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeaderJSON `json:"-"` + Host []string `json:"Host"` + JSON userLoadBalancerPoolListResponseOriginsHeaderJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeaderJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeader] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeaderJSON struct { +// userLoadBalancerPoolListResponseOriginsHeaderJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolListResponseOriginsHeader] +type userLoadBalancerPoolListResponseOriginsHeaderJSON struct { Host apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolListResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserLoadBalancerPoolDeleteResponse struct { + ID string `json:"id"` + JSON userLoadBalancerPoolDeleteResponseJSON `json:"-"` +} + +// userLoadBalancerPoolDeleteResponseJSON contains the JSON metadata for the struct +// [UserLoadBalancerPoolDeleteResponse] +type userLoadBalancerPoolDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse struct { +type UserLoadBalancerPoolGetResponse struct { ID string `json:"id"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - CheckRegions []UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion `json:"check_regions,nullable"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + CheckRegions []UserLoadBalancerPoolGetResponseCheckRegion `json:"check_regions,nullable"` + CreatedOn time.Time `json:"created_on" format:"date-time"` // A human-readable description of the pool. Description string `json:"description"` // This field shows up only if the pool is disabled. This field is set with the @@ -1235,7 +1213,7 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse struct { // decimal degrees. If this is set, longitude must also be set. Latitude float64 `json:"latitude"` // Configures load shedding policies and percentages for the pool. - LoadShedding UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding `json:"load_shedding"` + LoadShedding UserLoadBalancerPoolGetResponseLoadShedding `json:"load_shedding"` // The longitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, latitude must also be set. Longitude float64 `json:"longitude"` @@ -1258,19 +1236,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse struct { NotificationEmail string `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. - NotificationFilter UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilter `json:"notification_filter,nullable"` + NotificationFilter UserLoadBalancerPoolGetResponseNotificationFilter `json:"notification_filter,nullable"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. - OriginSteering UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering `json:"origin_steering"` + OriginSteering UserLoadBalancerPoolGetResponseOriginSteering `json:"origin_steering"` // The list of origins within this pool. Traffic directed at this pool is balanced // across all currently healthy origins, provided the pool itself is healthy. - Origins []UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin `json:"origins"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseJSON `json:"-"` + Origins []UserLoadBalancerPoolGetResponseOrigin `json:"origins"` + JSON userLoadBalancerPoolGetResponseJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseJSON contains the JSON -// metadata for the struct [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseJSON struct { +// userLoadBalancerPoolGetResponseJSON contains the JSON metadata for the struct +// [UserLoadBalancerPoolGetResponse] +type userLoadBalancerPoolGetResponseJSON struct { ID apijson.Field CheckRegions apijson.Field CreatedOn apijson.Field @@ -1292,7 +1270,7 @@ type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1301,27 +1279,27 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse) UnmarshalJSON(d // OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: // Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all // regions (ENTERPRISE customers only). -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion string +type UserLoadBalancerPoolGetResponseCheckRegion string const ( - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionWnam UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "WNAM" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionEnam UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "ENAM" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionWeu UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "WEU" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionEeu UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "EEU" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionNsam UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "NSAM" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionSsam UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "SSAM" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionOc UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "OC" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionMe UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "ME" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionNaf UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "NAF" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionSaf UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "SAF" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionSas UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "SAS" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionSeas UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "SEAS" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionNeas UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "NEAS" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegionAllRegions UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseCheckRegion = "ALL_REGIONS" + UserLoadBalancerPoolGetResponseCheckRegionWnam UserLoadBalancerPoolGetResponseCheckRegion = "WNAM" + UserLoadBalancerPoolGetResponseCheckRegionEnam UserLoadBalancerPoolGetResponseCheckRegion = "ENAM" + UserLoadBalancerPoolGetResponseCheckRegionWeu UserLoadBalancerPoolGetResponseCheckRegion = "WEU" + UserLoadBalancerPoolGetResponseCheckRegionEeu UserLoadBalancerPoolGetResponseCheckRegion = "EEU" + UserLoadBalancerPoolGetResponseCheckRegionNsam UserLoadBalancerPoolGetResponseCheckRegion = "NSAM" + UserLoadBalancerPoolGetResponseCheckRegionSsam UserLoadBalancerPoolGetResponseCheckRegion = "SSAM" + UserLoadBalancerPoolGetResponseCheckRegionOc UserLoadBalancerPoolGetResponseCheckRegion = "OC" + UserLoadBalancerPoolGetResponseCheckRegionMe UserLoadBalancerPoolGetResponseCheckRegion = "ME" + UserLoadBalancerPoolGetResponseCheckRegionNaf UserLoadBalancerPoolGetResponseCheckRegion = "NAF" + UserLoadBalancerPoolGetResponseCheckRegionSaf UserLoadBalancerPoolGetResponseCheckRegion = "SAF" + UserLoadBalancerPoolGetResponseCheckRegionSas UserLoadBalancerPoolGetResponseCheckRegion = "SAS" + UserLoadBalancerPoolGetResponseCheckRegionSeas UserLoadBalancerPoolGetResponseCheckRegion = "SEAS" + UserLoadBalancerPoolGetResponseCheckRegionNeas UserLoadBalancerPoolGetResponseCheckRegion = "NEAS" + UserLoadBalancerPoolGetResponseCheckRegionAllRegions UserLoadBalancerPoolGetResponseCheckRegion = "ALL_REGIONS" ) // Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding struct { +type UserLoadBalancerPoolGetResponseLoadShedding struct { // The percent of traffic to shed from the pool, according to the default policy. // Applies to new sessions and traffic without session affinity. DefaultPercent float64 `json:"default_percent"` @@ -1329,20 +1307,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding struct { // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. - DefaultPolicy UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicy `json:"default_policy"` + DefaultPolicy UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. SessionPercent float64 `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). - SessionPolicy UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingSessionPolicy `json:"session_policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingJSON `json:"-"` + SessionPolicy UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy `json:"session_policy"` + JSON userLoadBalancerPoolGetResponseLoadSheddingJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingJSON struct { +// userLoadBalancerPoolGetResponseLoadSheddingJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolGetResponseLoadShedding] +type userLoadBalancerPoolGetResponseLoadSheddingJSON struct { DefaultPercent apijson.Field DefaultPolicy apijson.Field SessionPercent apijson.Field @@ -1351,7 +1328,7 @@ type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingJSON stru ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1359,100 +1336,98 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadShedding) Unm // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicy string +type UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingDefaultPolicy = "hash" + UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "random" + UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "hash" ) // Only the hash policy is supported for existing sessions (to avoid exponential // decay). -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingSessionPolicy string +type UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseLoadSheddingSessionPolicy = "hash" + UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolGetResponseLoadSheddingSessionPolicy = "hash" ) // Filter pool and origin health notifications by resource type or health status. // Use null to reset. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilter struct { +type UserLoadBalancerPoolGetResponseNotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. - Origin UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOrigin `json:"origin,nullable"` + Origin UserLoadBalancerPoolGetResponseNotificationFilterOrigin `json:"origin,nullable"` // Filter options for a particular resource type (pool or origin). Use null to // reset. - Pool UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPool `json:"pool,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterJSON `json:"-"` + Pool UserLoadBalancerPoolGetResponseNotificationFilterPool `json:"pool,nullable"` + JSON userLoadBalancerPoolGetResponseNotificationFilterJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilter] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterJSON struct { +// userLoadBalancerPoolGetResponseNotificationFilterJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolGetResponseNotificationFilter] +type userLoadBalancerPoolGetResponseNotificationFilterJSON struct { Origin apijson.Field Pool apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOrigin struct { +type UserLoadBalancerPoolGetResponseNotificationFilterOrigin struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOriginJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolGetResponseNotificationFilterOriginJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOriginJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOrigin] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOriginJSON struct { +// userLoadBalancerPoolGetResponseNotificationFilterOriginJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerPoolGetResponseNotificationFilterOrigin] +type userLoadBalancerPoolGetResponseNotificationFilterOriginJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPool struct { +type UserLoadBalancerPoolGetResponseNotificationFilterPool struct { // If set true, disable notifications for this type of resource (pool or origin). Disable bool `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPoolJSON `json:"-"` + Healthy bool `json:"healthy,nullable"` + JSON userLoadBalancerPoolGetResponseNotificationFilterPoolJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPoolJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPool] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPoolJSON struct { +// userLoadBalancerPoolGetResponseNotificationFilterPoolJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolGetResponseNotificationFilterPool] +type userLoadBalancerPoolGetResponseNotificationFilterPoolJSON struct { Disable apijson.Field Healthy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering struct { +type UserLoadBalancerPoolGetResponseOriginSteering struct { // The type of origin steering policy to use. // // - `"random"`: Select an origin randomly. @@ -1466,20 +1441,19 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering struct // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. - Policy UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy `json:"policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringJSON `json:"-"` + Policy UserLoadBalancerPoolGetResponseOriginSteeringPolicy `json:"policy"` + JSON userLoadBalancerPoolGetResponseOriginSteeringJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringJSON struct { +// userLoadBalancerPoolGetResponseOriginSteeringJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolGetResponseOriginSteering] +type userLoadBalancerPoolGetResponseOriginSteeringJSON struct { Policy apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1496,16 +1470,16 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteering) U // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy string +type UserLoadBalancerPoolGetResponseOriginSteeringPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicyHash UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy = "hash" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginSteeringPolicy = "least_connections" + UserLoadBalancerPoolGetResponseOriginSteeringPolicyRandom UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "random" + UserLoadBalancerPoolGetResponseOriginSteeringPolicyHash UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "hash" + UserLoadBalancerPoolGetResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "least_outstanding_requests" + UserLoadBalancerPoolGetResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolGetResponseOriginSteeringPolicy = "least_connections" ) -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin struct { +type UserLoadBalancerPoolGetResponseOrigin struct { // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable // hostname. Hostnames entered here should resolve directly to the origin, and not // be a hostname proxied by Cloudflare. To set an internal/reserved address, @@ -1520,7 +1494,7 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin struct { Enabled bool `json:"enabled"` // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. - Header UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeader `json:"header"` + Header UserLoadBalancerPoolGetResponseOriginsHeader `json:"header"` // A human-identifiable name for the origin. Name string `json:"name"` // The virtual network subnet ID the origin belongs in. Virtual network must also @@ -1534,14 +1508,13 @@ type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin struct { // origin's outstanding requests. // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's // open connections. - Weight float64 `json:"weight"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginJSON `json:"-"` + Weight float64 `json:"weight"` + JSON userLoadBalancerPoolGetResponseOriginJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginJSON struct { +// userLoadBalancerPoolGetResponseOriginJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolGetResponseOrigin] +type userLoadBalancerPoolGetResponseOriginJSON struct { Address apijson.Field DisabledAt apijson.Field Enabled apijson.Field @@ -1553,270 +1526,236 @@ type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseOrigin) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeader struct { +type UserLoadBalancerPoolGetResponseOriginsHeader struct { // The 'Host' header allows to override the hostname set in the HTTP request. // Current support is 1 'Host' header override per origin. - Host []string `json:"Host"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeaderJSON `json:"-"` + Host []string `json:"Host"` + JSON userLoadBalancerPoolGetResponseOriginsHeaderJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeaderJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeader] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeaderJSON struct { +// userLoadBalancerPoolGetResponseOriginsHeaderJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolGetResponseOriginsHeader] +type userLoadBalancerPoolGetResponseOriginsHeaderJSON struct { Host apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolGetResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse struct { - ID string `json:"id"` +type UserLoadBalancerPoolNewParams struct { + // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and + // underscores are allowed. + Name param.Field[string] `json:"name,required"` + // The list of origins within this pool. Traffic directed at this pool is balanced + // across all currently healthy origins, provided the pool itself is healthy. + Origins param.Field[[]UserLoadBalancerPoolNewParamsOrigin] `json:"origins,required"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - CheckRegions []UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion `json:"check_regions,nullable"` - CreatedOn time.Time `json:"created_on" format:"date-time"` + CheckRegions param.Field[[]UserLoadBalancerPoolNewParamsCheckRegion] `json:"check_regions"` // A human-readable description of the pool. - Description string `json:"description"` - // This field shows up only if the pool is disabled. This field is set with the - // time the pool was disabled at. - DisabledAt time.Time `json:"disabled_at" format:"date-time"` + Description param.Field[string] `json:"description"` // Whether to enable (the default) or disable this pool. Disabled pools will not // receive traffic and are excluded from health checks. Disabling a pool will cause // any load balancers using it to failover to the next pool (if any). - Enabled bool `json:"enabled"` + Enabled param.Field[bool] `json:"enabled"` // The latitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, longitude must also be set. - Latitude float64 `json:"latitude"` + Latitude param.Field[float64] `json:"latitude"` // Configures load shedding policies and percentages for the pool. - LoadShedding UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadShedding `json:"load_shedding"` + LoadShedding param.Field[UserLoadBalancerPoolNewParamsLoadShedding] `json:"load_shedding"` // The longitude of the data center containing the origins used in this pool in // decimal degrees. If this is set, latitude must also be set. - Longitude float64 `json:"longitude"` + Longitude param.Field[float64] `json:"longitude"` // The minimum number of origins that must be healthy for this pool to serve // traffic. If the number of healthy origins falls below this number, the pool will // be marked unhealthy and will failover to the next available pool. - MinimumOrigins int64 `json:"minimum_origins"` - ModifiedOn time.Time `json:"modified_on" format:"date-time"` + MinimumOrigins param.Field[int64] `json:"minimum_origins"` // The ID of the Monitor to use for checking the health of origins within this // pool. - Monitor interface{} `json:"monitor"` - // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - // underscores are allowed. - Name string `json:"name"` + Monitor param.Field[interface{}] `json:"monitor"` // This field is now deprecated. It has been moved to Cloudflare's Centralized // Notification service // https://developers.cloudflare.com/fundamentals/notifications/. The email address // to send health status notifications to. This can be an individual mailbox or a // mailing list. Multiple emails can be supplied as a comma delimited list. - NotificationEmail string `json:"notification_email"` + NotificationEmail param.Field[string] `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. - NotificationFilter UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilter `json:"notification_filter,nullable"` + NotificationFilter param.Field[UserLoadBalancerPoolNewParamsNotificationFilter] `json:"notification_filter"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. - OriginSteering UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering `json:"origin_steering"` - // The list of origins within this pool. Traffic directed at this pool is balanced - // across all currently healthy origins, provided the pool itself is healthy. - Origins []UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOrigin `json:"origins"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseJSON contains the JSON -// metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseJSON struct { - ID apijson.Field - CheckRegions apijson.Field - CreatedOn apijson.Field - Description apijson.Field - DisabledAt apijson.Field - Enabled apijson.Field - Latitude apijson.Field - LoadShedding apijson.Field - Longitude apijson.Field - MinimumOrigins apijson.Field - ModifiedOn apijson.Field - Monitor apijson.Field - Name apijson.Field - NotificationEmail apijson.Field - NotificationFilter apijson.Field - OriginSteering apijson.Field - Origins apijson.Field - raw string - ExtraFields map[string]apijson.Field + OriginSteering param.Field[UserLoadBalancerPoolNewParamsOriginSteering] `json:"origin_steering"` } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, -// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, -// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: -// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all -// regions (ENTERPRISE customers only). -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionWnam UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "WNAM" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionEnam UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "ENAM" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionWeu UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "WEU" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionEeu UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "EEU" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionNsam UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "NSAM" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionSsam UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "SSAM" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionOc UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "OC" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionMe UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "ME" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionNaf UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "NAF" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionSaf UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "SAF" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionSas UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "SAS" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionSeas UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "SEAS" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionNeas UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "NEAS" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegionAllRegions UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseCheckRegion = "ALL_REGIONS" -) - -// Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadShedding struct { +type UserLoadBalancerPoolNewParamsOrigin struct { + // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable + // hostname. Hostnames entered here should resolve directly to the origin, and not + // be a hostname proxied by Cloudflare. To set an internal/reserved address, + // virtual_network_id must also be set. + Address param.Field[string] `json:"address"` + // Whether to enable (the default) this origin within the pool. Disabled origins + // will not receive traffic and are excluded from health checks. The origin will + // only be disabled for the current pool. + Enabled param.Field[bool] `json:"enabled"` + // The request header is used to pass additional information with an HTTP request. + // Currently supported header is 'Host'. + Header param.Field[UserLoadBalancerPoolNewParamsOriginsHeader] `json:"header"` + // A human-identifiable name for the origin. + Name param.Field[string] `json:"name"` + // The virtual network subnet ID the origin belongs in. Virtual network must also + // belong to the account. + VirtualNetworkID param.Field[string] `json:"virtual_network_id"` + // The weight of this origin relative to other origins in the pool. Based on the + // configured weight the total traffic is distributed among origins within the + // pool. + // + // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the + // origin's outstanding requests. + // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's + // open connections. + Weight param.Field[float64] `json:"weight"` +} + +func (r UserLoadBalancerPoolNewParamsOrigin) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The request header is used to pass additional information with an HTTP request. +// Currently supported header is 'Host'. +type UserLoadBalancerPoolNewParamsOriginsHeader struct { + // The 'Host' header allows to override the hostname set in the HTTP request. + // Current support is 1 'Host' header override per origin. + Host param.Field[[]string] `json:"Host"` +} + +func (r UserLoadBalancerPoolNewParamsOriginsHeader) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, +// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, +// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: +// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all +// regions (ENTERPRISE customers only). +type UserLoadBalancerPoolNewParamsCheckRegion string + +const ( + UserLoadBalancerPoolNewParamsCheckRegionWnam UserLoadBalancerPoolNewParamsCheckRegion = "WNAM" + UserLoadBalancerPoolNewParamsCheckRegionEnam UserLoadBalancerPoolNewParamsCheckRegion = "ENAM" + UserLoadBalancerPoolNewParamsCheckRegionWeu UserLoadBalancerPoolNewParamsCheckRegion = "WEU" + UserLoadBalancerPoolNewParamsCheckRegionEeu UserLoadBalancerPoolNewParamsCheckRegion = "EEU" + UserLoadBalancerPoolNewParamsCheckRegionNsam UserLoadBalancerPoolNewParamsCheckRegion = "NSAM" + UserLoadBalancerPoolNewParamsCheckRegionSsam UserLoadBalancerPoolNewParamsCheckRegion = "SSAM" + UserLoadBalancerPoolNewParamsCheckRegionOc UserLoadBalancerPoolNewParamsCheckRegion = "OC" + UserLoadBalancerPoolNewParamsCheckRegionMe UserLoadBalancerPoolNewParamsCheckRegion = "ME" + UserLoadBalancerPoolNewParamsCheckRegionNaf UserLoadBalancerPoolNewParamsCheckRegion = "NAF" + UserLoadBalancerPoolNewParamsCheckRegionSaf UserLoadBalancerPoolNewParamsCheckRegion = "SAF" + UserLoadBalancerPoolNewParamsCheckRegionSas UserLoadBalancerPoolNewParamsCheckRegion = "SAS" + UserLoadBalancerPoolNewParamsCheckRegionSeas UserLoadBalancerPoolNewParamsCheckRegion = "SEAS" + UserLoadBalancerPoolNewParamsCheckRegionNeas UserLoadBalancerPoolNewParamsCheckRegion = "NEAS" + UserLoadBalancerPoolNewParamsCheckRegionAllRegions UserLoadBalancerPoolNewParamsCheckRegion = "ALL_REGIONS" +) + +// Configures load shedding policies and percentages for the pool. +type UserLoadBalancerPoolNewParamsLoadShedding struct { // The percent of traffic to shed from the pool, according to the default policy. // Applies to new sessions and traffic without session affinity. - DefaultPercent float64 `json:"default_percent"` + DefaultPercent param.Field[float64] `json:"default_percent"` // The default policy to use when load shedding. A random policy randomly sheds a // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. - DefaultPolicy UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicy `json:"default_policy"` + DefaultPolicy param.Field[UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicy] `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. - SessionPercent float64 `json:"session_percent"` + SessionPercent param.Field[float64] `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). - SessionPolicy UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingSessionPolicy `json:"session_policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadShedding] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingJSON struct { - DefaultPercent apijson.Field - DefaultPolicy apijson.Field - SessionPercent apijson.Field - SessionPolicy apijson.Field - raw string - ExtraFields map[string]apijson.Field + SessionPolicy param.Field[UserLoadBalancerPoolNewParamsLoadSheddingSessionPolicy] `json:"session_policy"` } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadShedding) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParamsLoadShedding) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // The default policy to use when load shedding. A random policy randomly sheds a // given percent of requests. A hash policy computes a hash over the // CF-Connecting-IP address and sheds all requests originating from a percent of // IPs. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicy string +type UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicyHash UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingDefaultPolicy = "hash" + UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "random" + UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicyHash UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "hash" ) // Only the hash policy is supported for existing sessions (to avoid exponential // decay). -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingSessionPolicy string +type UserLoadBalancerPoolNewParamsLoadSheddingSessionPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingSessionPolicyHash UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseLoadSheddingSessionPolicy = "hash" + UserLoadBalancerPoolNewParamsLoadSheddingSessionPolicyHash UserLoadBalancerPoolNewParamsLoadSheddingSessionPolicy = "hash" ) // Filter pool and origin health notifications by resource type or health status. // Use null to reset. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilter struct { +type UserLoadBalancerPoolNewParamsNotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. - Origin UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOrigin `json:"origin,nullable"` + Origin param.Field[UserLoadBalancerPoolNewParamsNotificationFilterOrigin] `json:"origin"` // Filter options for a particular resource type (pool or origin). Use null to // reset. - Pool UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPool `json:"pool,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterJSON `json:"-"` + Pool param.Field[UserLoadBalancerPoolNewParamsNotificationFilterPool] `json:"pool"` } -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilter] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterJSON struct { - Origin apijson.Field - Pool apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParamsNotificationFilter) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOrigin struct { +type UserLoadBalancerPoolNewParamsNotificationFilterOrigin struct { // If set true, disable notifications for this type of resource (pool or origin). - Disable bool `json:"disable"` + Disable param.Field[bool] `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOriginJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOriginJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOrigin] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOriginJSON struct { - Disable apijson.Field - Healthy apijson.Field - raw string - ExtraFields map[string]apijson.Field + Healthy param.Field[bool] `json:"healthy"` } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // Filter options for a particular resource type (pool or origin). Use null to // reset. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPool struct { +type UserLoadBalancerPoolNewParamsNotificationFilterPool struct { // If set true, disable notifications for this type of resource (pool or origin). - Disable bool `json:"disable"` + Disable param.Field[bool] `json:"disable"` // If present, send notifications only for this health status (e.g. false for only // DOWN events). Use null to reset (all events). - Healthy bool `json:"healthy,nullable"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPoolJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPoolJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPool] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPoolJSON struct { - Disable apijson.Field - Healthy apijson.Field - raw string - ExtraFields map[string]apijson.Field + Healthy param.Field[bool] `json:"healthy"` } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering struct { +type UserLoadBalancerPoolNewParamsOriginSteering struct { // The type of origin steering policy to use. // // - `"random"`: Select an origin randomly. @@ -1830,21 +1769,11 @@ type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering struc // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. - Policy UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy `json:"policy"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringJSON struct { - Policy apijson.Field - raw string - ExtraFields map[string]apijson.Field + Policy param.Field[UserLoadBalancerPoolNewParamsOriginSteeringPolicy] `json:"policy"` } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func (r UserLoadBalancerPoolNewParamsOriginSteering) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } // The type of origin steering policy to use. @@ -1860,89 +1789,84 @@ func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteering) // weights, as well as each origin's number of open connections. Origins with // more open connections are weighted proportionately less relative to others. // Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy string +type UserLoadBalancerPoolNewParamsOriginSteeringPolicy string const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicyHash UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy = "hash" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicyLeastConnections UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginSteeringPolicy = "least_connections" + UserLoadBalancerPoolNewParamsOriginSteeringPolicyRandom UserLoadBalancerPoolNewParamsOriginSteeringPolicy = "random" + UserLoadBalancerPoolNewParamsOriginSteeringPolicyHash UserLoadBalancerPoolNewParamsOriginSteeringPolicy = "hash" + UserLoadBalancerPoolNewParamsOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolNewParamsOriginSteeringPolicy = "least_outstanding_requests" + UserLoadBalancerPoolNewParamsOriginSteeringPolicyLeastConnections UserLoadBalancerPoolNewParamsOriginSteeringPolicy = "least_connections" ) -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOrigin struct { - // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable - // hostname. Hostnames entered here should resolve directly to the origin, and not - // be a hostname proxied by Cloudflare. To set an internal/reserved address, - // virtual_network_id must also be set. - Address string `json:"address"` - // This field shows up only if the origin is disabled. This field is set with the - // time the origin was disabled. - DisabledAt time.Time `json:"disabled_at" format:"date-time"` - // Whether to enable (the default) this origin within the pool. Disabled origins - // will not receive traffic and are excluded from health checks. The origin will - // only be disabled for the current pool. - Enabled bool `json:"enabled"` - // The request header is used to pass additional information with an HTTP request. - // Currently supported header is 'Host'. - Header UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeader `json:"header"` - // A human-identifiable name for the origin. - Name string `json:"name"` - // The virtual network subnet ID the origin belongs in. Virtual network must also - // belong to the account. - VirtualNetworkID string `json:"virtual_network_id"` - // The weight of this origin relative to other origins in the pool. Based on the - // configured weight the total traffic is distributed among origins within the - // pool. - // - // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the - // origin's outstanding requests. - // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's - // open connections. - Weight float64 `json:"weight"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginJSON `json:"-"` +type UserLoadBalancerPoolNewResponseEnvelope struct { + Errors []UserLoadBalancerPoolNewResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerPoolNewResponseEnvelopeMessages `json:"messages,required"` + Result UserLoadBalancerPoolNewResponse `json:"result,required"` + // Whether the API call was successful + Success UserLoadBalancerPoolNewResponseEnvelopeSuccess `json:"success,required"` + JSON userLoadBalancerPoolNewResponseEnvelopeJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOrigin] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginJSON struct { - Address apijson.Field - DisabledAt apijson.Field - Enabled apijson.Field - Header apijson.Field - Name apijson.Field - VirtualNetworkID apijson.Field - Weight apijson.Field - raw string - ExtraFields map[string]apijson.Field +// userLoadBalancerPoolNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolNewResponseEnvelope] +type userLoadBalancerPoolNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOrigin) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// The request header is used to pass additional information with an HTTP request. -// Currently supported header is 'Host'. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeader struct { - // The 'Host' header allows to override the hostname set in the HTTP request. - // Current support is 1 'Host' header override per origin. - Host []string `json:"Host"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeaderJSON `json:"-"` +type UserLoadBalancerPoolNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolNewResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeaderJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeader] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeaderJSON struct { - Host apijson.Field +// userLoadBalancerPoolNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [UserLoadBalancerPoolNewResponseEnvelopeErrors] +type userLoadBalancerPoolNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserLoadBalancerPoolNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// userLoadBalancerPoolNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolNewResponseEnvelopeMessages] +type userLoadBalancerPoolNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +// Whether the API call was successful +type UserLoadBalancerPoolNewResponseEnvelopeSuccess bool + +const ( + UserLoadBalancerPoolNewResponseEnvelopeSuccessTrue UserLoadBalancerPoolNewResponseEnvelopeSuccess = true +) + type UserLoadBalancerPoolUpdateParams struct { // A list of regions from which to run health checks. Null means every Cloudflare // data center. @@ -2259,6 +2183,119 @@ const ( UserLoadBalancerPoolUpdateResponseEnvelopeSuccessTrue UserLoadBalancerPoolUpdateResponseEnvelopeSuccess = true ) +type UserLoadBalancerPoolListParams struct { + // The ID of the Monitor to use for checking the health of origins within this + // pool. + Monitor param.Field[interface{}] `query:"monitor"` +} + +// URLQuery serializes [UserLoadBalancerPoolListParams]'s query parameters as +// `url.Values`. +func (r UserLoadBalancerPoolListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type UserLoadBalancerPoolListResponseEnvelope struct { + Errors []UserLoadBalancerPoolListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerPoolListResponseEnvelopeMessages `json:"messages,required"` + Result []UserLoadBalancerPoolListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success UserLoadBalancerPoolListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserLoadBalancerPoolListResponseEnvelopeResultInfo `json:"result_info"` + JSON userLoadBalancerPoolListResponseEnvelopeJSON `json:"-"` +} + +// userLoadBalancerPoolListResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolListResponseEnvelope] +type userLoadBalancerPoolListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserLoadBalancerPoolListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolListResponseEnvelopeErrorsJSON `json:"-"` +} + +// userLoadBalancerPoolListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolListResponseEnvelopeErrors] +type userLoadBalancerPoolListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserLoadBalancerPoolListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolListResponseEnvelopeMessagesJSON `json:"-"` +} + +// userLoadBalancerPoolListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolListResponseEnvelopeMessages] +type userLoadBalancerPoolListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type UserLoadBalancerPoolListResponseEnvelopeSuccess bool + +const ( + UserLoadBalancerPoolListResponseEnvelopeSuccessTrue UserLoadBalancerPoolListResponseEnvelopeSuccess = true +) + +type UserLoadBalancerPoolListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON userLoadBalancerPoolListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// userLoadBalancerPoolListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolListResponseEnvelopeResultInfo] +type userLoadBalancerPoolListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserLoadBalancerPoolListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type UserLoadBalancerPoolDeleteResponseEnvelope struct { Errors []UserLoadBalancerPoolDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []UserLoadBalancerPoolDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -2396,561 +2433,3 @@ type UserLoadBalancerPoolGetResponseEnvelopeSuccess bool const ( UserLoadBalancerPoolGetResponseEnvelopeSuccessTrue UserLoadBalancerPoolGetResponseEnvelopeSuccess = true ) - -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParams struct { - // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - // underscores are allowed. - Name param.Field[string] `json:"name,required"` - // The list of origins within this pool. Traffic directed at this pool is balanced - // across all currently healthy origins, provided the pool itself is healthy. - Origins param.Field[[]UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOrigin] `json:"origins,required"` - // A list of regions from which to run health checks. Null means every Cloudflare - // data center. - CheckRegions param.Field[[]UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion] `json:"check_regions"` - // A human-readable description of the pool. - Description param.Field[string] `json:"description"` - // Whether to enable (the default) or disable this pool. Disabled pools will not - // receive traffic and are excluded from health checks. Disabling a pool will cause - // any load balancers using it to failover to the next pool (if any). - Enabled param.Field[bool] `json:"enabled"` - // The latitude of the data center containing the origins used in this pool in - // decimal degrees. If this is set, longitude must also be set. - Latitude param.Field[float64] `json:"latitude"` - // Configures load shedding policies and percentages for the pool. - LoadShedding param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadShedding] `json:"load_shedding"` - // The longitude of the data center containing the origins used in this pool in - // decimal degrees. If this is set, latitude must also be set. - Longitude param.Field[float64] `json:"longitude"` - // The minimum number of origins that must be healthy for this pool to serve - // traffic. If the number of healthy origins falls below this number, the pool will - // be marked unhealthy and will failover to the next available pool. - MinimumOrigins param.Field[int64] `json:"minimum_origins"` - // The ID of the Monitor to use for checking the health of origins within this - // pool. - Monitor param.Field[interface{}] `json:"monitor"` - // This field is now deprecated. It has been moved to Cloudflare's Centralized - // Notification service - // https://developers.cloudflare.com/fundamentals/notifications/. The email address - // to send health status notifications to. This can be an individual mailbox or a - // mailing list. Multiple emails can be supplied as a comma delimited list. - NotificationEmail param.Field[string] `json:"notification_email"` - // Filter pool and origin health notifications by resource type or health status. - // Use null to reset. - NotificationFilter param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilter] `json:"notification_filter"` - // Configures origin steering for the pool. Controls how origins are selected for - // new sessions and traffic without session affinity. - OriginSteering param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteering] `json:"origin_steering"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOrigin struct { - // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable - // hostname. Hostnames entered here should resolve directly to the origin, and not - // be a hostname proxied by Cloudflare. To set an internal/reserved address, - // virtual_network_id must also be set. - Address param.Field[string] `json:"address"` - // Whether to enable (the default) this origin within the pool. Disabled origins - // will not receive traffic and are excluded from health checks. The origin will - // only be disabled for the current pool. - Enabled param.Field[bool] `json:"enabled"` - // The request header is used to pass additional information with an HTTP request. - // Currently supported header is 'Host'. - Header param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader] `json:"header"` - // A human-identifiable name for the origin. - Name param.Field[string] `json:"name"` - // The virtual network subnet ID the origin belongs in. Virtual network must also - // belong to the account. - VirtualNetworkID param.Field[string] `json:"virtual_network_id"` - // The weight of this origin relative to other origins in the pool. Based on the - // configured weight the total traffic is distributed among origins within the - // pool. - // - // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the - // origin's outstanding requests. - // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's - // open connections. - Weight param.Field[float64] `json:"weight"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOrigin) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The request header is used to pass additional information with an HTTP request. -// Currently supported header is 'Host'. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader struct { - // The 'Host' header allows to override the hostname set in the HTTP request. - // Current support is 1 'Host' header override per origin. - Host param.Field[[]string] `json:"Host"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, -// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, -// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: -// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all -// regions (ENTERPRISE customers only). -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionWnam UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "WNAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionEnam UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "ENAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionWeu UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "WEU" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionEeu UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "EEU" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionNsam UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "NSAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionSsam UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "SSAM" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionOc UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "OC" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionMe UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "ME" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionNaf UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "NAF" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionSaf UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "SAF" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionSas UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "SAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionSeas UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "SEAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionNeas UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "NEAS" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionAllRegions UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion = "ALL_REGIONS" -) - -// Configures load shedding policies and percentages for the pool. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadShedding struct { - // The percent of traffic to shed from the pool, according to the default policy. - // Applies to new sessions and traffic without session affinity. - DefaultPercent param.Field[float64] `json:"default_percent"` - // The default policy to use when load shedding. A random policy randomly sheds a - // given percent of requests. A hash policy computes a hash over the - // CF-Connecting-IP address and sheds all requests originating from a percent of - // IPs. - DefaultPolicy param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicy] `json:"default_policy"` - // The percent of existing sessions to shed from the pool, according to the session - // policy. - SessionPercent param.Field[float64] `json:"session_percent"` - // Only the hash policy is supported for existing sessions (to avoid exponential - // decay). - SessionPolicy param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingSessionPolicy] `json:"session_policy"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadShedding) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The default policy to use when load shedding. A random policy randomly sheds a -// given percent of requests. A hash policy computes a hash over the -// CF-Connecting-IP address and sheds all requests originating from a percent of -// IPs. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicy string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicy = "hash" -) - -// Only the hash policy is supported for existing sessions (to avoid exponential -// decay). -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingSessionPolicy string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingSessionPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingSessionPolicy = "hash" -) - -// Filter pool and origin health notifications by resource type or health status. -// Use null to reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilter struct { - // Filter options for a particular resource type (pool or origin). Use null to - // reset. - Origin param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterOrigin] `json:"origin"` - // Filter options for a particular resource type (pool or origin). Use null to - // reset. - Pool param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterPool] `json:"pool"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilter) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Filter options for a particular resource type (pool or origin). Use null to -// reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterOrigin struct { - // If set true, disable notifications for this type of resource (pool or origin). - Disable param.Field[bool] `json:"disable"` - // If present, send notifications only for this health status (e.g. false for only - // DOWN events). Use null to reset (all events). - Healthy param.Field[bool] `json:"healthy"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Filter options for a particular resource type (pool or origin). Use null to -// reset. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterPool struct { - // If set true, disable notifications for this type of resource (pool or origin). - Disable param.Field[bool] `json:"disable"` - // If present, send notifications only for this health status (e.g. false for only - // DOWN events). Use null to reset (all events). - Healthy param.Field[bool] `json:"healthy"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// Configures origin steering for the pool. Controls how origins are selected for -// new sessions and traffic without session affinity. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteering struct { - // The type of origin steering policy to use. - // - // - `"random"`: Select an origin randomly. - // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP - // address. - // - `"least_outstanding_requests"`: Select an origin by taking into consideration - // origin weights, as well as each origin's number of outstanding requests. - // Origins with more pending requests are weighted proportionately less relative - // to others. - // - `"least_connections"`: Select an origin by taking into consideration origin - // weights, as well as each origin's number of open connections. Origins with - // more open connections are weighted proportionately less relative to others. - // Supported for HTTP/1 and HTTP/2 connections. - Policy param.Field[UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy] `json:"policy"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteering) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The type of origin steering policy to use. -// -// - `"random"`: Select an origin randomly. -// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP -// address. -// - `"least_outstanding_requests"`: Select an origin by taking into consideration -// origin weights, as well as each origin's number of outstanding requests. -// Origins with more pending requests are weighted proportionately less relative -// to others. -// - `"least_connections"`: Select an origin by taking into consideration origin -// weights, as well as each origin's number of open connections. Origins with -// more open connections are weighted proportionately less relative to others. -// Supported for HTTP/1 and HTTP/2 connections. -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicyRandom UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy = "random" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicyHash UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy = "hash" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicyLeastOutstandingRequests UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy = "least_outstanding_requests" - UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicyLeastConnections UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicy = "least_connections" -) - -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelope struct { - Errors []UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessages `json:"messages,required"` - Result UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponse `json:"result,required"` - // Whether the API call was successful - Success UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeSuccess `json:"success,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelope] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrorsJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrors] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessagesJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessages] -type userLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeSuccess bool - -const ( - UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeSuccessTrue UserLoadBalancerPoolLoadBalancerPoolsNewPoolResponseEnvelopeSuccess = true -) - -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams struct { - // The ID of the Monitor to use for checking the health of origins within this - // pool. - Monitor param.Field[interface{}] `query:"monitor"` -} - -// URLQuery serializes [UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams]'s -// query parameters as `url.Values`. -func (r UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelope struct { - Errors []UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessages `json:"messages,required"` - Result []UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfo `json:"result_info"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelope] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrorsJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrors] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessagesJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessages] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeSuccess bool - -const ( - UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeSuccessTrue UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeSuccess = true -) - -type UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfo] -type userLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsListPoolsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParams struct { - // The email address to send health status notifications to. This field is now - // deprecated in favor of Cloudflare Notifications for Load Balancing, so only - // resetting this field with an empty string `""` is accepted. - NotificationEmail param.Field[UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParamsNotificationEmail] `json:"notification_email"` -} - -func (r UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The email address to send health status notifications to. This field is now -// deprecated in favor of Cloudflare Notifications for Load Balancing, so only -// resetting this field with an empty string `""` is accepted. -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParamsNotificationEmail string - -const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParamsNotificationEmailEmpty UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParamsNotificationEmail = "\"\"" -) - -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelope struct { - Errors []UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessages `json:"messages,required"` - Result []UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfo `json:"result_info"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelope] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrorsJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrors] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessagesJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessages] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeSuccess bool - -const ( - UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeSuccessTrue UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeSuccess = true -) - -type UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfo] -type userLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/userloadbalancerpool_test.go b/userloadbalancerpool_test.go index 4c1930d85d7..0bd3fd24346 100644 --- a/userloadbalancerpool_test.go +++ b/userloadbalancerpool_test.go @@ -13,6 +13,89 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) +func TestUserLoadBalancerPoolNewWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Users.LoadBalancers.Pools.New(context.TODO(), cloudflare.UserLoadBalancerPoolNewParams{ + Name: cloudflare.F("primary-dc-1"), + Origins: cloudflare.F([]cloudflare.UserLoadBalancerPoolNewParamsOrigin{{ + Address: cloudflare.F("0.0.0.0"), + Enabled: cloudflare.F(true), + Header: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsOriginsHeader{ + Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), + }), + Name: cloudflare.F("app-server-1"), + VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), + Weight: cloudflare.F(0.600000), + }, { + Address: cloudflare.F("0.0.0.0"), + Enabled: cloudflare.F(true), + Header: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsOriginsHeader{ + Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), + }), + Name: cloudflare.F("app-server-1"), + VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), + Weight: cloudflare.F(0.600000), + }, { + Address: cloudflare.F("0.0.0.0"), + Enabled: cloudflare.F(true), + Header: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsOriginsHeader{ + Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), + }), + Name: cloudflare.F("app-server-1"), + VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), + Weight: cloudflare.F(0.600000), + }}), + CheckRegions: cloudflare.F([]cloudflare.UserLoadBalancerPoolNewParamsCheckRegion{cloudflare.UserLoadBalancerPoolNewParamsCheckRegionWeu, cloudflare.UserLoadBalancerPoolNewParamsCheckRegionEnam}), + Description: cloudflare.F("Primary data center - Provider XYZ"), + Enabled: cloudflare.F(false), + Latitude: cloudflare.F(0.000000), + LoadShedding: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsLoadShedding{ + DefaultPercent: cloudflare.F(0.000000), + DefaultPolicy: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsLoadSheddingDefaultPolicyRandom), + SessionPercent: cloudflare.F(0.000000), + SessionPolicy: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsLoadSheddingSessionPolicyHash), + }), + Longitude: cloudflare.F(0.000000), + MinimumOrigins: cloudflare.F(int64(0)), + Monitor: cloudflare.F[any](map[string]interface{}{}), + NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"), + NotificationFilter: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsNotificationFilter{ + Origin: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsNotificationFilterOrigin{ + Disable: cloudflare.F(true), + Healthy: cloudflare.F(true), + }), + Pool: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsNotificationFilterPool{ + Disable: cloudflare.F(true), + Healthy: cloudflare.F(false), + }), + }), + OriginSteering: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsOriginSteering{ + Policy: cloudflare.F(cloudflare.UserLoadBalancerPoolNewParamsOriginSteeringPolicyRandom), + }), + }) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestUserLoadBalancerPoolUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -100,7 +183,7 @@ func TestUserLoadBalancerPoolUpdateWithOptionalParams(t *testing.T) { } } -func TestUserLoadBalancerPoolDelete(t *testing.T) { +func TestUserLoadBalancerPoolListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -116,115 +199,8 @@ func TestUserLoadBalancerPoolDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.Delete(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestUserLoadBalancerPoolGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Users.LoadBalancers.Pools.Get(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestUserLoadBalancerPoolLoadBalancerPoolsNewPoolWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Users.LoadBalancers.Pools.LoadBalancerPoolsNewPool(context.TODO(), cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParams{ - Name: cloudflare.F("primary-dc-1"), - Origins: cloudflare.F([]cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOrigin{{ - Address: cloudflare.F("0.0.0.0"), - Enabled: cloudflare.F(true), - Header: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader{ - Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), - }), - Name: cloudflare.F("app-server-1"), - VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), - Weight: cloudflare.F(0.600000), - }, { - Address: cloudflare.F("0.0.0.0"), - Enabled: cloudflare.F(true), - Header: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader{ - Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), - }), - Name: cloudflare.F("app-server-1"), - VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), - Weight: cloudflare.F(0.600000), - }, { - Address: cloudflare.F("0.0.0.0"), - Enabled: cloudflare.F(true), - Header: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginsHeader{ - Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}), - }), - Name: cloudflare.F("app-server-1"), - VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"), - Weight: cloudflare.F(0.600000), - }}), - CheckRegions: cloudflare.F([]cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegion{cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionWeu, cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsCheckRegionEnam}), - Description: cloudflare.F("Primary data center - Provider XYZ"), - Enabled: cloudflare.F(false), - Latitude: cloudflare.F(0.000000), - LoadShedding: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadShedding{ - DefaultPercent: cloudflare.F(0.000000), - DefaultPolicy: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingDefaultPolicyRandom), - SessionPercent: cloudflare.F(0.000000), - SessionPolicy: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsLoadSheddingSessionPolicyHash), - }), - Longitude: cloudflare.F(0.000000), - MinimumOrigins: cloudflare.F(int64(0)), - Monitor: cloudflare.F[any](map[string]interface{}{}), - NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"), - NotificationFilter: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilter{ - Origin: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterOrigin{ - Disable: cloudflare.F(true), - Healthy: cloudflare.F(true), - }), - Pool: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsNotificationFilterPool{ - Disable: cloudflare.F(true), - Healthy: cloudflare.F(false), - }), - }), - OriginSteering: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteering{ - Policy: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsNewPoolParamsOriginSteeringPolicyRandom), - }), + _, err := client.Users.LoadBalancers.Pools.List(context.TODO(), cloudflare.UserLoadBalancerPoolListParams{ + Monitor: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -235,7 +211,7 @@ func TestUserLoadBalancerPoolLoadBalancerPoolsNewPoolWithOptionalParams(t *testi } } -func TestUserLoadBalancerPoolLoadBalancerPoolsListPoolsWithOptionalParams(t *testing.T) { +func TestUserLoadBalancerPoolDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -251,9 +227,7 @@ func TestUserLoadBalancerPoolLoadBalancerPoolsListPoolsWithOptionalParams(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.LoadBalancerPoolsListPools(context.TODO(), cloudflare.UserLoadBalancerPoolLoadBalancerPoolsListPoolsParams{ - Monitor: cloudflare.F[any](map[string]interface{}{}), - }) + _, err := client.Users.LoadBalancers.Pools.Delete(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -263,7 +237,7 @@ func TestUserLoadBalancerPoolLoadBalancerPoolsListPoolsWithOptionalParams(t *tes } } -func TestUserLoadBalancerPoolLoadBalancerPoolsPatchPoolsWithOptionalParams(t *testing.T) { +func TestUserLoadBalancerPoolGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -279,9 +253,7 @@ func TestUserLoadBalancerPoolLoadBalancerPoolsPatchPoolsWithOptionalParams(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.LoadBalancerPoolsPatchPools(context.TODO(), cloudflare.UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParams{ - NotificationEmail: cloudflare.F(cloudflare.UserLoadBalancerPoolLoadBalancerPoolsPatchPoolsParamsNotificationEmailEmpty), - }) + _, err := client.Users.LoadBalancers.Pools.Get(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userloadbalancerpoolhealth.go b/userloadbalancerpoolhealth.go index 1d76ca01bfa..9163bfaecd7 100644 --- a/userloadbalancerpoolhealth.go +++ b/userloadbalancerpoolhealth.go @@ -34,9 +34,9 @@ func NewUserLoadBalancerPoolHealthService(opts ...option.RequestOption) (r *User } // Fetch the latest pool health status for a single pool. -func (r *UserLoadBalancerPoolHealthService) LoadBalancerPoolsPoolHealthDetails(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse, err error) { +func (r *UserLoadBalancerPoolHealthService) List(ctx context.Context, poolID string, opts ...option.RequestOption) (res *UserLoadBalancerPoolHealthListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelope + var env UserLoadBalancerPoolHealthListResponseEnvelope path := fmt.Sprintf("user/load_balancers/pools/%s/health", poolID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -49,16 +49,15 @@ func (r *UserLoadBalancerPoolHealthService) LoadBalancerPoolsPoolHealthDetails(c // A list of regions from which to run health checks. Null means every Cloudflare // data center. // -// Union satisfied by -// [UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseUnknown] or +// Union satisfied by [UserLoadBalancerPoolHealthListResponseUnknown] or // [shared.UnionString]. -type UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse interface { - ImplementsUserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse() +type UserLoadBalancerPoolHealthListResponse interface { + ImplementsUserLoadBalancerPoolHealthListResponse() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse)(nil)).Elem(), + reflect.TypeOf((*UserLoadBalancerPoolHealthListResponse)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -67,21 +66,20 @@ func init() { ) } -type UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelope struct { - Errors []UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessages `json:"messages,required"` +type UserLoadBalancerPoolHealthListResponseEnvelope struct { + Errors []UserLoadBalancerPoolHealthListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerPoolHealthListResponseEnvelopeMessages `json:"messages,required"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. - Result UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponse `json:"result,required"` + Result UserLoadBalancerPoolHealthListResponse `json:"result,required"` // Whether the API call was successful - Success UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeJSON `json:"-"` + Success UserLoadBalancerPoolHealthListResponseEnvelopeSuccess `json:"success,required"` + JSON userLoadBalancerPoolHealthListResponseEnvelopeJSON `json:"-"` } -// userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelope] -type userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeJSON struct { +// userLoadBalancerPoolHealthListResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolHealthListResponseEnvelope] +type userLoadBalancerPoolHealthListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -90,53 +88,51 @@ type userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelop ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolHealthListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrorsJSON `json:"-"` +type UserLoadBalancerPoolHealthListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolHealthListResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrors] -type userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrorsJSON struct { +// userLoadBalancerPoolHealthListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolHealthListResponseEnvelopeErrors] +type userLoadBalancerPoolHealthListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolHealthListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessagesJSON `json:"-"` +type UserLoadBalancerPoolHealthListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolHealthListResponseEnvelopeMessagesJSON `json:"-"` } -// userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessages] -type userLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessagesJSON struct { +// userLoadBalancerPoolHealthListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolHealthListResponseEnvelopeMessages] +type userLoadBalancerPoolHealthListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolHealthListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeSuccess bool +type UserLoadBalancerPoolHealthListResponseEnvelopeSuccess bool const ( - UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeSuccessTrue UserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetailsResponseEnvelopeSuccess = true + UserLoadBalancerPoolHealthListResponseEnvelopeSuccessTrue UserLoadBalancerPoolHealthListResponseEnvelopeSuccess = true ) diff --git a/userloadbalancerpoolhealth_test.go b/userloadbalancerpoolhealth_test.go index d6b753f1299..98389dff0ed 100644 --- a/userloadbalancerpoolhealth_test.go +++ b/userloadbalancerpoolhealth_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetails(t *testing.T) { +func TestUserLoadBalancerPoolHealthList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserLoadBalancerPoolHealthLoadBalancerPoolsPoolHealthDetails(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.Health.LoadBalancerPoolsPoolHealthDetails(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") + _, err := client.Users.LoadBalancers.Pools.Health.List(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userloadbalancerpoolpreview.go b/userloadbalancerpoolpreview.go index a5ca25bd5a3..025ea7e900d 100644 --- a/userloadbalancerpoolpreview.go +++ b/userloadbalancerpoolpreview.go @@ -33,9 +33,9 @@ func NewUserLoadBalancerPoolPreviewService(opts ...option.RequestOption) (r *Use // Preview pool health using provided monitor details. The returned preview_id can // be used in the preview endpoint to retrieve the results. -func (r *UserLoadBalancerPoolPreviewService) LoadBalancerPoolsPreviewPool(ctx context.Context, poolID string, body UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse, err error) { +func (r *UserLoadBalancerPoolPreviewService) New(ctx context.Context, poolID string, body UserLoadBalancerPoolPreviewNewParams, opts ...option.RequestOption) (res *UserLoadBalancerPoolPreviewNewResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelope + var env UserLoadBalancerPoolPreviewNewResponseEnvelope path := fmt.Sprintf("user/load_balancers/pools/%s/preview", poolID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -45,28 +45,27 @@ func (r *UserLoadBalancerPoolPreviewService) LoadBalancerPoolsPreviewPool(ctx co return } -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse struct { +type UserLoadBalancerPoolPreviewNewResponse struct { // Monitored pool IDs mapped to their respective names. - Pools map[string]string `json:"pools"` - PreviewID string `json:"preview_id"` - JSON userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseJSON `json:"-"` + Pools map[string]string `json:"pools"` + PreviewID string `json:"preview_id"` + JSON userLoadBalancerPoolPreviewNewResponseJSON `json:"-"` } -// userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseJSON contains the -// JSON metadata for the struct -// [UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse] -type userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseJSON struct { +// userLoadBalancerPoolPreviewNewResponseJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolPreviewNewResponse] +type userLoadBalancerPoolPreviewNewResponseJSON struct { Pools apijson.Field PreviewID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolPreviewNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams struct { +type UserLoadBalancerPoolPreviewNewParams struct { // The expected HTTP response code or code range of the health check. This // parameter is only valid for HTTP and HTTPS monitors. ExpectedCodes param.Field[string] `json:"expected_codes,required"` @@ -115,39 +114,38 @@ type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams struct { Timeout param.Field[int64] `json:"timeout"` // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - Type param.Field[UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType] `json:"type"` + Type param.Field[UserLoadBalancerPoolPreviewNewParamsType] `json:"type"` } -func (r UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams) MarshalJSON() (data []byte, err error) { +func (r UserLoadBalancerPoolPreviewNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The protocol to use for the health check. Currently supported protocols are // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType string +type UserLoadBalancerPoolPreviewNewParamsType string const ( - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeHTTP UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "http" - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeHTTPS UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "https" - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeTcp UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "tcp" - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeUdpIcmp UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "udp_icmp" - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeIcmpPing UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "icmp_ping" - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeSmtp UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsType = "smtp" + UserLoadBalancerPoolPreviewNewParamsTypeHTTP UserLoadBalancerPoolPreviewNewParamsType = "http" + UserLoadBalancerPoolPreviewNewParamsTypeHTTPS UserLoadBalancerPoolPreviewNewParamsType = "https" + UserLoadBalancerPoolPreviewNewParamsTypeTcp UserLoadBalancerPoolPreviewNewParamsType = "tcp" + UserLoadBalancerPoolPreviewNewParamsTypeUdpIcmp UserLoadBalancerPoolPreviewNewParamsType = "udp_icmp" + UserLoadBalancerPoolPreviewNewParamsTypeIcmpPing UserLoadBalancerPoolPreviewNewParamsType = "icmp_ping" + UserLoadBalancerPoolPreviewNewParamsTypeSmtp UserLoadBalancerPoolPreviewNewParamsType = "smtp" ) -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelope struct { - Errors []UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessages `json:"messages,required"` - Result UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponse `json:"result,required"` +type UserLoadBalancerPoolPreviewNewResponseEnvelope struct { + Errors []UserLoadBalancerPoolPreviewNewResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerPoolPreviewNewResponseEnvelopeMessages `json:"messages,required"` + Result UserLoadBalancerPoolPreviewNewResponse `json:"result,required"` // Whether the API call was successful - Success UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeSuccess `json:"success,required"` - JSON userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeJSON `json:"-"` + Success UserLoadBalancerPoolPreviewNewResponseEnvelopeSuccess `json:"success,required"` + JSON userLoadBalancerPoolPreviewNewResponseEnvelopeJSON `json:"-"` } -// userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelope] -type userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeJSON struct { +// userLoadBalancerPoolPreviewNewResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolPreviewNewResponseEnvelope] +type userLoadBalancerPoolPreviewNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -156,53 +154,51 @@ type userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrorsJSON `json:"-"` +type UserLoadBalancerPoolPreviewNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolPreviewNewResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrors] -type userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrorsJSON struct { +// userLoadBalancerPoolPreviewNewResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolPreviewNewResponseEnvelopeErrors] +type userLoadBalancerPoolPreviewNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessagesJSON `json:"-"` +type UserLoadBalancerPoolPreviewNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolPreviewNewResponseEnvelopeMessagesJSON `json:"-"` } -// userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessages] -type userLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessagesJSON struct { +// userLoadBalancerPoolPreviewNewResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [UserLoadBalancerPoolPreviewNewResponseEnvelopeMessages] +type userLoadBalancerPoolPreviewNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeSuccess bool +type UserLoadBalancerPoolPreviewNewResponseEnvelopeSuccess bool const ( - UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeSuccessTrue UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolResponseEnvelopeSuccess = true + UserLoadBalancerPoolPreviewNewResponseEnvelopeSuccessTrue UserLoadBalancerPoolPreviewNewResponseEnvelopeSuccess = true ) diff --git a/userloadbalancerpoolpreview_test.go b/userloadbalancerpoolpreview_test.go index cda54ae0da4..3e8bde64b26 100644 --- a/userloadbalancerpoolpreview_test.go +++ b/userloadbalancerpoolpreview_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolWithOptionalParams(t *testing.T) { +func TestUserLoadBalancerPoolPreviewNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestUserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolWithOptionalPara option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.Previews.LoadBalancerPoolsPreviewPool( + _, err := client.Users.LoadBalancers.Pools.Previews.New( context.TODO(), "17b5962d775c646f3f9725cbc7a53df4", - cloudflare.UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParams{ + cloudflare.UserLoadBalancerPoolPreviewNewParams{ ExpectedCodes: cloudflare.F("2xx"), AllowInsecure: cloudflare.F(true), ConsecutiveDown: cloudflare.F(int64(0)), @@ -55,7 +55,7 @@ func TestUserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolWithOptionalPara ProbeZone: cloudflare.F("example.com"), Retries: cloudflare.F(int64(0)), Timeout: cloudflare.F(int64(0)), - Type: cloudflare.F(cloudflare.UserLoadBalancerPoolPreviewLoadBalancerPoolsPreviewPoolParamsTypeHTTPS), + Type: cloudflare.F(cloudflare.UserLoadBalancerPoolPreviewNewParamsTypeHTTPS), }, ) if err != nil { diff --git a/userloadbalancerpoolreference.go b/userloadbalancerpoolreference.go index 2bad73e0ec1..26ed31eb1fc 100644 --- a/userloadbalancerpoolreference.go +++ b/userloadbalancerpoolreference.go @@ -31,9 +31,9 @@ func NewUserLoadBalancerPoolReferenceService(opts ...option.RequestOption) (r *U } // Get the list of resources that reference the provided pool. -func (r *UserLoadBalancerPoolReferenceService) LoadBalancerPoolsListPoolReferences(ctx context.Context, poolID string, opts ...option.RequestOption) (res *[]UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse, err error) { +func (r *UserLoadBalancerPoolReferenceService) List(ctx context.Context, poolID string, opts ...option.RequestOption) (res *[]UserLoadBalancerPoolReferenceListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelope + var env UserLoadBalancerPoolReferenceListResponseEnvelope path := fmt.Sprintf("user/load_balancers/pools/%s/references", poolID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -43,18 +43,17 @@ func (r *UserLoadBalancerPoolReferenceService) LoadBalancerPoolsListPoolReferenc return } -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse struct { - ReferenceType UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceType `json:"reference_type"` - ResourceID string `json:"resource_id"` - ResourceName string `json:"resource_name"` - ResourceType string `json:"resource_type"` - JSON userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseJSON `json:"-"` +type UserLoadBalancerPoolReferenceListResponse struct { + ReferenceType UserLoadBalancerPoolReferenceListResponseReferenceType `json:"reference_type"` + ResourceID string `json:"resource_id"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + JSON userLoadBalancerPoolReferenceListResponseJSON `json:"-"` } -// userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse] -type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseJSON struct { +// userLoadBalancerPoolReferenceListResponseJSON contains the JSON metadata for the +// struct [UserLoadBalancerPoolReferenceListResponse] +type userLoadBalancerPoolReferenceListResponseJSON struct { ReferenceType apijson.Field ResourceID apijson.Field ResourceName apijson.Field @@ -63,33 +62,32 @@ type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseJSO ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolReferenceListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceType string +type UserLoadBalancerPoolReferenceListResponseReferenceType string const ( - UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceTypeStar UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceType = "*" - UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceTypeReferral UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceType = "referral" - UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceTypeReferrer UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseReferenceType = "referrer" + UserLoadBalancerPoolReferenceListResponseReferenceTypeStar UserLoadBalancerPoolReferenceListResponseReferenceType = "*" + UserLoadBalancerPoolReferenceListResponseReferenceTypeReferral UserLoadBalancerPoolReferenceListResponseReferenceType = "referral" + UserLoadBalancerPoolReferenceListResponseReferenceTypeReferrer UserLoadBalancerPoolReferenceListResponseReferenceType = "referrer" ) -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelope struct { - Errors []UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessages `json:"messages,required"` +type UserLoadBalancerPoolReferenceListResponseEnvelope struct { + Errors []UserLoadBalancerPoolReferenceListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancerPoolReferenceListResponseEnvelopeMessages `json:"messages,required"` // List of resources that reference a given pool. - Result []UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponse `json:"result,required,nullable"` + Result []UserLoadBalancerPoolReferenceListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfo `json:"result_info"` - JSON userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeJSON `json:"-"` + Success UserLoadBalancerPoolReferenceListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserLoadBalancerPoolReferenceListResponseEnvelopeResultInfo `json:"result_info"` + JSON userLoadBalancerPoolReferenceListResponseEnvelopeJSON `json:"-"` } -// userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelope] -type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeJSON struct { +// userLoadBalancerPoolReferenceListResponseEnvelopeJSON contains the JSON metadata +// for the struct [UserLoadBalancerPoolReferenceListResponseEnvelope] +type userLoadBalancerPoolReferenceListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -99,58 +97,58 @@ type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnv ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolReferenceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrorsJSON `json:"-"` +type UserLoadBalancerPoolReferenceListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolReferenceListResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrors] -type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrorsJSON struct { +// userLoadBalancerPoolReferenceListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerPoolReferenceListResponseEnvelopeErrors] +type userLoadBalancerPoolReferenceListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolReferenceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessagesJSON `json:"-"` +type UserLoadBalancerPoolReferenceListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancerPoolReferenceListResponseEnvelopeMessagesJSON `json:"-"` } -// userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessages] -type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessagesJSON struct { +// userLoadBalancerPoolReferenceListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [UserLoadBalancerPoolReferenceListResponseEnvelopeMessages] +type userLoadBalancerPoolReferenceListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolReferenceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeSuccess bool +type UserLoadBalancerPoolReferenceListResponseEnvelopeSuccess bool const ( - UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeSuccessTrue UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeSuccess = true + UserLoadBalancerPoolReferenceListResponseEnvelopeSuccessTrue UserLoadBalancerPoolReferenceListResponseEnvelopeSuccess = true ) -type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfo struct { +type UserLoadBalancerPoolReferenceListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -158,14 +156,14 @@ type UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnv // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON userLoadBalancerPoolReferenceListResponseEnvelopeResultInfoJSON `json:"-"` } -// userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfo] -type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfoJSON struct { +// userLoadBalancerPoolReferenceListResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [UserLoadBalancerPoolReferenceListResponseEnvelopeResultInfo] +type userLoadBalancerPoolReferenceListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -174,6 +172,6 @@ type userLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnv ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferencesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancerPoolReferenceListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/userloadbalancerpoolreference_test.go b/userloadbalancerpoolreference_test.go index 68bb61f4563..26586d4bec6 100644 --- a/userloadbalancerpoolreference_test.go +++ b/userloadbalancerpoolreference_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferences(t *testing.T) { +func TestUserLoadBalancerPoolReferenceList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserLoadBalancerPoolReferenceLoadBalancerPoolsListPoolReferences(t *tes option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancers.Pools.References.LoadBalancerPoolsListPoolReferences(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") + _, err := client.Users.LoadBalancers.Pools.References.List(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/userloadbalancinganalyticevent.go b/userloadbalancinganalyticevent.go index d0a85689ae8..9b776b6af83 100644 --- a/userloadbalancinganalyticevent.go +++ b/userloadbalancinganalyticevent.go @@ -34,9 +34,9 @@ func NewUserLoadBalancingAnalyticEventService(opts ...option.RequestOption) (r * } // List origin health changes. -func (r *UserLoadBalancingAnalyticEventService) LoadBalancerHealthcheckEventsListHealthcheckEvents(ctx context.Context, query UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams, opts ...option.RequestOption) (res *[]UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse, err error) { +func (r *UserLoadBalancingAnalyticEventService) List(ctx context.Context, query UserLoadBalancingAnalyticEventListParams, opts ...option.RequestOption) (res *[]UserLoadBalancingAnalyticEventListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelope + var env UserLoadBalancingAnalyticEventListResponseEnvelope path := "user/load_balancing_analytics/events" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { @@ -46,18 +46,17 @@ func (r *UserLoadBalancingAnalyticEventService) LoadBalancerHealthcheckEventsLis return } -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse struct { - ID int64 `json:"id"` - Origins []interface{} `json:"origins"` - Pool interface{} `json:"pool"` - Timestamp time.Time `json:"timestamp" format:"date-time"` - JSON userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseJSON `json:"-"` +type UserLoadBalancingAnalyticEventListResponse struct { + ID int64 `json:"id"` + Origins []interface{} `json:"origins"` + Pool interface{} `json:"pool"` + Timestamp time.Time `json:"timestamp" format:"date-time"` + JSON userLoadBalancingAnalyticEventListResponseJSON `json:"-"` } -// userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseJSON -// contains the JSON metadata for the struct -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse] -type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseJSON struct { +// userLoadBalancingAnalyticEventListResponseJSON contains the JSON metadata for +// the struct [UserLoadBalancingAnalyticEventListResponse] +type userLoadBalancingAnalyticEventListResponseJSON struct { ID apijson.Field Origins apijson.Field Pool apijson.Field @@ -66,11 +65,11 @@ type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckE ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancingAnalyticEventListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams struct { +type UserLoadBalancingAnalyticEventListParams struct { // If true, filter events where the origin status is healthy. If false, filter // events where the origin status is unhealthy. OriginHealthy param.Field[bool] `query:"origin_healthy"` @@ -88,30 +87,28 @@ type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckE Until param.Field[time.Time] `query:"until" format:"date-time"` } -// URLQuery serializes -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams]'s -// query parameters as `url.Values`. -func (r UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams) URLQuery() (v url.Values) { +// URLQuery serializes [UserLoadBalancingAnalyticEventListParams]'s query +// parameters as `url.Values`. +func (r UserLoadBalancingAnalyticEventListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelope struct { - Errors []UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessages `json:"messages,required"` - Result []UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponse `json:"result,required,nullable"` +type UserLoadBalancingAnalyticEventListResponseEnvelope struct { + Errors []UserLoadBalancingAnalyticEventListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserLoadBalancingAnalyticEventListResponseEnvelopeMessages `json:"messages,required"` + Result []UserLoadBalancingAnalyticEventListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfo `json:"result_info"` - JSON userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeJSON `json:"-"` + Success UserLoadBalancingAnalyticEventListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserLoadBalancingAnalyticEventListResponseEnvelopeResultInfo `json:"result_info"` + JSON userLoadBalancingAnalyticEventListResponseEnvelopeJSON `json:"-"` } -// userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelope] -type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeJSON struct { +// userLoadBalancingAnalyticEventListResponseEnvelopeJSON contains the JSON +// metadata for the struct [UserLoadBalancingAnalyticEventListResponseEnvelope] +type userLoadBalancingAnalyticEventListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -121,58 +118,58 @@ type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckE ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancingAnalyticEventListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrorsJSON `json:"-"` +type UserLoadBalancingAnalyticEventListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancingAnalyticEventListResponseEnvelopeErrorsJSON `json:"-"` } -// userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrors] -type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrorsJSON struct { +// userLoadBalancingAnalyticEventListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [UserLoadBalancingAnalyticEventListResponseEnvelopeErrors] +type userLoadBalancingAnalyticEventListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancingAnalyticEventListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessagesJSON `json:"-"` +type UserLoadBalancingAnalyticEventListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userLoadBalancingAnalyticEventListResponseEnvelopeMessagesJSON `json:"-"` } -// userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessages] -type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessagesJSON struct { +// userLoadBalancingAnalyticEventListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [UserLoadBalancingAnalyticEventListResponseEnvelopeMessages] +type userLoadBalancingAnalyticEventListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancingAnalyticEventListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeSuccess bool +type UserLoadBalancingAnalyticEventListResponseEnvelopeSuccess bool const ( - UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeSuccessTrue UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeSuccess = true + UserLoadBalancingAnalyticEventListResponseEnvelopeSuccessTrue UserLoadBalancingAnalyticEventListResponseEnvelopeSuccess = true ) -type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfo struct { +type UserLoadBalancingAnalyticEventListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -180,14 +177,14 @@ type UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckE // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON userLoadBalancingAnalyticEventListResponseEnvelopeResultInfoJSON `json:"-"` } -// userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfo] -type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfoJSON struct { +// userLoadBalancingAnalyticEventListResponseEnvelopeResultInfoJSON contains the +// JSON metadata for the struct +// [UserLoadBalancingAnalyticEventListResponseEnvelopeResultInfo] +type userLoadBalancingAnalyticEventListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -196,6 +193,6 @@ type userLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckE ExtraFields map[string]apijson.Field } -func (r *UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *UserLoadBalancingAnalyticEventListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/userloadbalancinganalyticevent_test.go b/userloadbalancinganalyticevent_test.go index 6e5eee6a5cb..fe29034844e 100644 --- a/userloadbalancinganalyticevent_test.go +++ b/userloadbalancinganalyticevent_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsWithOptionalParams(t *testing.T) { +func TestUserLoadBalancingAnalyticEventListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,7 +30,7 @@ func TestUserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthch option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.LoadBalancingAnalytics.Events.LoadBalancerHealthcheckEventsListHealthcheckEvents(context.TODO(), cloudflare.UserLoadBalancingAnalyticEventLoadBalancerHealthcheckEventsListHealthcheckEventsParams{ + _, err := client.Users.LoadBalancingAnalytics.Events.List(context.TODO(), cloudflare.UserLoadBalancingAnalyticEventListParams{ OriginHealthy: cloudflare.F(true), OriginName: cloudflare.F("primary-dc-1"), PoolHealthy: cloudflare.F(true), diff --git a/userorganization.go b/userorganization.go index 208a9a4a110..d2d0ab2b037 100644 --- a/userorganization.go +++ b/userorganization.go @@ -36,6 +36,29 @@ func NewUserOrganizationService(opts ...option.RequestOption) (r *UserOrganizati return } +// Lists organizations the user is associated with. +func (r *UserOrganizationService) List(ctx context.Context, query UserOrganizationListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[UserOrganizationListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := "user/organizations" + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// Lists organizations the user is associated with. +func (r *UserOrganizationService) ListAutoPaging(ctx context.Context, query UserOrganizationListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[UserOrganizationListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...)) +} + // Removes association to an organization. func (r *UserOrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *UserOrganizationDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -57,54 +80,7 @@ func (r *UserOrganizationService) Get(ctx context.Context, organizationID string return } -// Lists organizations the user is associated with. -func (r *UserOrganizationService) UserSOrganizationsListOrganizations(ctx context.Context, query UserOrganizationUserSOrganizationsListOrganizationsParams, opts ...option.RequestOption) (res *[]UserOrganizationUserSOrganizationsListOrganizationsResponse, err error) { - opts = append(r.Options[:], opts...) - var env UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelope - path := "user/organizations" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type UserOrganizationDeleteResponse struct { - // Identifier - ID string `json:"id"` - JSON userOrganizationDeleteResponseJSON `json:"-"` -} - -// userOrganizationDeleteResponseJSON contains the JSON metadata for the struct -// [UserOrganizationDeleteResponse] -type userOrganizationDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserOrganizationDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Union satisfied by [UserOrganizationGetResponseUnknown] or [shared.UnionString]. -type UserOrganizationGetResponse interface { - ImplementsUserOrganizationGetResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*UserOrganizationGetResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type UserOrganizationUserSOrganizationsListOrganizationsResponse struct { +type UserOrganizationListResponse struct { // Identifier ID string `json:"id"` // Organization name. @@ -114,14 +90,13 @@ type UserOrganizationUserSOrganizationsListOrganizationsResponse struct { // List of roles that a user has within an organization. Roles []string `json:"roles"` // Whether the user is a member of the organization or has an inivitation pending. - Status UserOrganizationUserSOrganizationsListOrganizationsResponseStatus `json:"status"` - JSON userOrganizationUserSOrganizationsListOrganizationsResponseJSON `json:"-"` + Status UserOrganizationListResponseStatus `json:"status"` + JSON userOrganizationListResponseJSON `json:"-"` } -// userOrganizationUserSOrganizationsListOrganizationsResponseJSON contains the -// JSON metadata for the struct -// [UserOrganizationUserSOrganizationsListOrganizationsResponse] -type userOrganizationUserSOrganizationsListOrganizationsResponseJSON struct { +// userOrganizationListResponseJSON contains the JSON metadata for the struct +// [UserOrganizationListResponse] +type userOrganizationListResponseJSON struct { ID apijson.Field Name apijson.Field Permissions apijson.Field @@ -131,108 +106,72 @@ type userOrganizationUserSOrganizationsListOrganizationsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserOrganizationUserSOrganizationsListOrganizationsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserOrganizationListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the user is a member of the organization or has an inivitation pending. -type UserOrganizationUserSOrganizationsListOrganizationsResponseStatus string +type UserOrganizationListResponseStatus string const ( - UserOrganizationUserSOrganizationsListOrganizationsResponseStatusMember UserOrganizationUserSOrganizationsListOrganizationsResponseStatus = "member" - UserOrganizationUserSOrganizationsListOrganizationsResponseStatusInvited UserOrganizationUserSOrganizationsListOrganizationsResponseStatus = "invited" + UserOrganizationListResponseStatusMember UserOrganizationListResponseStatus = "member" + UserOrganizationListResponseStatusInvited UserOrganizationListResponseStatus = "invited" ) -type UserOrganizationGetResponseEnvelope struct { - Errors []UserOrganizationGetResponseEnvelopeErrors `json:"errors,required"` - Messages []UserOrganizationGetResponseEnvelopeMessages `json:"messages,required"` - Result UserOrganizationGetResponse `json:"result,required"` - // Whether the API call was successful - Success UserOrganizationGetResponseEnvelopeSuccess `json:"success,required"` - JSON userOrganizationGetResponseEnvelopeJSON `json:"-"` -} - -// userOrganizationGetResponseEnvelopeJSON contains the JSON metadata for the -// struct [UserOrganizationGetResponseEnvelope] -type userOrganizationGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserOrganizationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserOrganizationGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userOrganizationGetResponseEnvelopeErrorsJSON `json:"-"` +type UserOrganizationDeleteResponse struct { + // Identifier + ID string `json:"id"` + JSON userOrganizationDeleteResponseJSON `json:"-"` } -// userOrganizationGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [UserOrganizationGetResponseEnvelopeErrors] -type userOrganizationGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field +// userOrganizationDeleteResponseJSON contains the JSON metadata for the struct +// [UserOrganizationDeleteResponse] +type userOrganizationDeleteResponseJSON struct { + ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserOrganizationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserOrganizationDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserOrganizationGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userOrganizationGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// userOrganizationGetResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [UserOrganizationGetResponseEnvelopeMessages] -type userOrganizationGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field +// Union satisfied by [UserOrganizationGetResponseUnknown] or [shared.UnionString]. +type UserOrganizationGetResponse interface { + ImplementsUserOrganizationGetResponse() } -func (r *UserOrganizationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*UserOrganizationGetResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) } -// Whether the API call was successful -type UserOrganizationGetResponseEnvelopeSuccess bool - -const ( - UserOrganizationGetResponseEnvelopeSuccessTrue UserOrganizationGetResponseEnvelopeSuccess = true -) - -type UserOrganizationUserSOrganizationsListOrganizationsParams struct { +type UserOrganizationListParams struct { // Direction to order organizations. - Direction param.Field[UserOrganizationUserSOrganizationsListOrganizationsParamsDirection] `query:"direction"` + Direction param.Field[UserOrganizationListParamsDirection] `query:"direction"` // Whether to match all search requirements or at least one (any). - Match param.Field[UserOrganizationUserSOrganizationsListOrganizationsParamsMatch] `query:"match"` + Match param.Field[UserOrganizationListParamsMatch] `query:"match"` // Organization name. Name param.Field[string] `query:"name"` // Field to order organizations by. - Order param.Field[UserOrganizationUserSOrganizationsListOrganizationsParamsOrder] `query:"order"` + Order param.Field[UserOrganizationListParamsOrder] `query:"order"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of organizations per page. PerPage param.Field[float64] `query:"per_page"` // Whether the user is a member of the organization or has an inivitation pending. - Status param.Field[UserOrganizationUserSOrganizationsListOrganizationsParamsStatus] `query:"status"` + Status param.Field[UserOrganizationListParamsStatus] `query:"status"` } -// URLQuery serializes -// [UserOrganizationUserSOrganizationsListOrganizationsParams]'s query parameters -// as `url.Values`. -func (r UserOrganizationUserSOrganizationsListOrganizationsParams) URLQuery() (v url.Values) { +// URLQuery serializes [UserOrganizationListParams]'s query parameters as +// `url.Values`. +func (r UserOrganizationListParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, @@ -240,136 +179,103 @@ func (r UserOrganizationUserSOrganizationsListOrganizationsParams) URLQuery() (v } // Direction to order organizations. -type UserOrganizationUserSOrganizationsListOrganizationsParamsDirection string +type UserOrganizationListParamsDirection string const ( - UserOrganizationUserSOrganizationsListOrganizationsParamsDirectionAsc UserOrganizationUserSOrganizationsListOrganizationsParamsDirection = "asc" - UserOrganizationUserSOrganizationsListOrganizationsParamsDirectionDesc UserOrganizationUserSOrganizationsListOrganizationsParamsDirection = "desc" + UserOrganizationListParamsDirectionAsc UserOrganizationListParamsDirection = "asc" + UserOrganizationListParamsDirectionDesc UserOrganizationListParamsDirection = "desc" ) // Whether to match all search requirements or at least one (any). -type UserOrganizationUserSOrganizationsListOrganizationsParamsMatch string +type UserOrganizationListParamsMatch string const ( - UserOrganizationUserSOrganizationsListOrganizationsParamsMatchAny UserOrganizationUserSOrganizationsListOrganizationsParamsMatch = "any" - UserOrganizationUserSOrganizationsListOrganizationsParamsMatchAll UserOrganizationUserSOrganizationsListOrganizationsParamsMatch = "all" + UserOrganizationListParamsMatchAny UserOrganizationListParamsMatch = "any" + UserOrganizationListParamsMatchAll UserOrganizationListParamsMatch = "all" ) // Field to order organizations by. -type UserOrganizationUserSOrganizationsListOrganizationsParamsOrder string +type UserOrganizationListParamsOrder string const ( - UserOrganizationUserSOrganizationsListOrganizationsParamsOrderID UserOrganizationUserSOrganizationsListOrganizationsParamsOrder = "id" - UserOrganizationUserSOrganizationsListOrganizationsParamsOrderName UserOrganizationUserSOrganizationsListOrganizationsParamsOrder = "name" - UserOrganizationUserSOrganizationsListOrganizationsParamsOrderStatus UserOrganizationUserSOrganizationsListOrganizationsParamsOrder = "status" + UserOrganizationListParamsOrderID UserOrganizationListParamsOrder = "id" + UserOrganizationListParamsOrderName UserOrganizationListParamsOrder = "name" + UserOrganizationListParamsOrderStatus UserOrganizationListParamsOrder = "status" ) // Whether the user is a member of the organization or has an inivitation pending. -type UserOrganizationUserSOrganizationsListOrganizationsParamsStatus string +type UserOrganizationListParamsStatus string const ( - UserOrganizationUserSOrganizationsListOrganizationsParamsStatusMember UserOrganizationUserSOrganizationsListOrganizationsParamsStatus = "member" - UserOrganizationUserSOrganizationsListOrganizationsParamsStatusInvited UserOrganizationUserSOrganizationsListOrganizationsParamsStatus = "invited" + UserOrganizationListParamsStatusMember UserOrganizationListParamsStatus = "member" + UserOrganizationListParamsStatusInvited UserOrganizationListParamsStatus = "invited" ) -type UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelope struct { - Errors []UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessages `json:"messages,required"` - Result []UserOrganizationUserSOrganizationsListOrganizationsResponse `json:"result,required,nullable"` +type UserOrganizationGetResponseEnvelope struct { + Errors []UserOrganizationGetResponseEnvelopeErrors `json:"errors,required"` + Messages []UserOrganizationGetResponseEnvelopeMessages `json:"messages,required"` + Result UserOrganizationGetResponse `json:"result,required"` // Whether the API call was successful - Success UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfo `json:"result_info"` - JSON userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeJSON `json:"-"` + Success UserOrganizationGetResponseEnvelopeSuccess `json:"success,required"` + JSON userOrganizationGetResponseEnvelopeJSON `json:"-"` } -// userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelope] -type userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeJSON struct { +// userOrganizationGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserOrganizationGetResponseEnvelope] +type userOrganizationGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserOrganizationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrorsJSON `json:"-"` +type UserOrganizationGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userOrganizationGetResponseEnvelopeErrorsJSON `json:"-"` } -// userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrors] -type userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrorsJSON struct { +// userOrganizationGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [UserOrganizationGetResponseEnvelopeErrors] +type userOrganizationGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserOrganizationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessagesJSON `json:"-"` +type UserOrganizationGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userOrganizationGetResponseEnvelopeMessagesJSON `json:"-"` } -// userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessages] -type userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessagesJSON struct { +// userOrganizationGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [UserOrganizationGetResponseEnvelopeMessages] +type userOrganizationGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserOrganizationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeSuccess bool +type UserOrganizationGetResponseEnvelopeSuccess bool const ( - UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeSuccessTrue UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeSuccess = true + UserOrganizationGetResponseEnvelopeSuccessTrue UserOrganizationGetResponseEnvelopeSuccess = true ) - -type UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfo] -type userOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserOrganizationUserSOrganizationsListOrganizationsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/userorganization_test.go b/userorganization_test.go index 9ca99549baf..be27cd7f420 100644 --- a/userorganization_test.go +++ b/userorganization_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserOrganizationDelete(t *testing.T) { +func TestUserOrganizationListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,15 @@ func TestUserOrganizationDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Organizations.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Users.Organizations.List(context.TODO(), cloudflare.UserOrganizationListParams{ + Direction: cloudflare.F(cloudflare.UserOrganizationListParamsDirectionDesc), + Match: cloudflare.F(cloudflare.UserOrganizationListParamsMatchAny), + Name: cloudflare.F("Cloudflare, Inc."), + Order: cloudflare.F(cloudflare.UserOrganizationListParamsOrderStatus), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Status: cloudflare.F(cloudflare.UserOrganizationListParamsStatusMember), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -39,7 +47,7 @@ func TestUserOrganizationDelete(t *testing.T) { } } -func TestUserOrganizationGet(t *testing.T) { +func TestUserOrganizationDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -55,7 +63,7 @@ func TestUserOrganizationGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Organizations.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Users.Organizations.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -65,7 +73,7 @@ func TestUserOrganizationGet(t *testing.T) { } } -func TestUserOrganizationUserSOrganizationsListOrganizationsWithOptionalParams(t *testing.T) { +func TestUserOrganizationGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -81,15 +89,7 @@ func TestUserOrganizationUserSOrganizationsListOrganizationsWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Organizations.UserSOrganizationsListOrganizations(context.TODO(), cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParams{ - Direction: cloudflare.F(cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParamsDirectionDesc), - Match: cloudflare.F(cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParamsMatchAny), - Name: cloudflare.F("Cloudflare, Inc."), - Order: cloudflare.F(cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParamsOrderStatus), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - Status: cloudflare.F(cloudflare.UserOrganizationUserSOrganizationsListOrganizationsParamsStatusMember), - }) + _, err := client.Users.Organizations.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/usersubscription.go b/usersubscription.go index bd75d18269b..8e3bf5836b3 100644 --- a/usersubscription.go +++ b/usersubscription.go @@ -35,12 +35,12 @@ func NewUserSubscriptionService(opts ...option.RequestOption) (r *UserSubscripti return } -// Updates a user's subscriptions. -func (r *UserSubscriptionService) Update(ctx context.Context, identifier string, body UserSubscriptionUpdateParams, opts ...option.RequestOption) (res *UserSubscriptionUpdateResponse, err error) { +// Lists all of a user's subscriptions. +func (r *UserSubscriptionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]UserSubscriptionListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserSubscriptionUpdateResponseEnvelope - path := fmt.Sprintf("user/subscriptions/%s", identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env UserSubscriptionListResponseEnvelope + path := "user/subscriptions" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -56,12 +56,12 @@ func (r *UserSubscriptionService) Delete(ctx context.Context, identifier string, return } -// Lists all of a user's subscriptions. -func (r *UserSubscriptionService) UserSubscriptionGetUserSubscriptions(ctx context.Context, opts ...option.RequestOption) (res *[]UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse, err error) { +// Updates a user's subscriptions. +func (r *UserSubscriptionService) Replace(ctx context.Context, identifier string, body UserSubscriptionReplaceParams, opts ...option.RequestOption) (res *UserSubscriptionReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelope - path := "user/subscriptions" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env UserSubscriptionReplaceResponseEnvelope + path := fmt.Sprintf("user/subscriptions/%s", identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -69,47 +69,12 @@ func (r *UserSubscriptionService) UserSubscriptionGetUserSubscriptions(ctx conte return } -// Union satisfied by [UserSubscriptionUpdateResponseUnknown] or -// [shared.UnionString]. -type UserSubscriptionUpdateResponse interface { - ImplementsUserSubscriptionUpdateResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*UserSubscriptionUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type UserSubscriptionDeleteResponse struct { +type UserSubscriptionListResponse struct { // Subscription identifier tag. - SubscriptionID string `json:"subscription_id"` - JSON userSubscriptionDeleteResponseJSON `json:"-"` -} - -// userSubscriptionDeleteResponseJSON contains the JSON metadata for the struct -// [UserSubscriptionDeleteResponse] -type userSubscriptionDeleteResponseJSON struct { - SubscriptionID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserSubscriptionDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse struct { - // Subscription identifier tag. - ID string `json:"id"` - App UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseApp `json:"app"` + ID string `json:"id"` + App UserSubscriptionListResponseApp `json:"app"` // The list of add-ons subscribed to. - ComponentValues []UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValue `json:"component_values"` + ComponentValues []UserSubscriptionListResponseComponentValue `json:"component_values"` // The monetary unit in which pricing information is displayed. Currency string `json:"currency"` // The end of the current period and also when the next billing is due. @@ -118,22 +83,21 @@ type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse struct { // is the first period. CurrentPeriodStart time.Time `json:"current_period_start" format:"date-time"` // How often the subscription is renewed automatically. - Frequency UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency `json:"frequency"` + Frequency UserSubscriptionListResponseFrequency `json:"frequency"` // The price of the subscription that will be billed, in US dollars. Price float64 `json:"price"` // The rate plan applied to the subscription. - RatePlan UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlan `json:"rate_plan"` + RatePlan UserSubscriptionListResponseRatePlan `json:"rate_plan"` // The state that the subscription is in. - State UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState `json:"state"` + State UserSubscriptionListResponseState `json:"state"` // A simple zone object. May have null properties if not a zone subscription. - Zone UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseZone `json:"zone"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseJSON `json:"-"` + Zone UserSubscriptionListResponseZone `json:"zone"` + JSON userSubscriptionListResponseJSON `json:"-"` } -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseJSON contains the -// JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseJSON struct { +// userSubscriptionListResponseJSON contains the JSON metadata for the struct +// [UserSubscriptionListResponse] +type userSubscriptionListResponseJSON struct { ID apijson.Field App apijson.Field ComponentValues apijson.Field @@ -149,31 +113,30 @@ type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseApp struct { +type UserSubscriptionListResponseApp struct { // app install id. - InstallID string `json:"install_id"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseAppJSON `json:"-"` + InstallID string `json:"install_id"` + JSON userSubscriptionListResponseAppJSON `json:"-"` } -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseAppJSON contains the -// JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseApp] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseAppJSON struct { +// userSubscriptionListResponseAppJSON contains the JSON metadata for the struct +// [UserSubscriptionListResponseApp] +type userSubscriptionListResponseAppJSON struct { InstallID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseApp) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionListResponseApp) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A component value for a subscription. -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValue struct { +type UserSubscriptionListResponseComponentValue struct { // The default amount assigned. Default float64 `json:"default"` // The name of the component value. @@ -181,14 +144,13 @@ type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValue // The unit price for the component value. Price float64 `json:"price"` // The amount of the component value assigned. - Value float64 `json:"value"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValueJSON `json:"-"` + Value float64 `json:"value"` + JSON userSubscriptionListResponseComponentValueJSON `json:"-"` } -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValueJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValue] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValueJSON struct { +// userSubscriptionListResponseComponentValueJSON contains the JSON metadata for +// the struct [UserSubscriptionListResponseComponentValue] +type userSubscriptionListResponseComponentValueJSON struct { Default apijson.Field Name apijson.Field Price apijson.Field @@ -197,22 +159,22 @@ type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValueJ ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseComponentValue) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionListResponseComponentValue) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // How often the subscription is renewed automatically. -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency string +type UserSubscriptionListResponseFrequency string const ( - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequencyWeekly UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency = "weekly" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequencyMonthly UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency = "monthly" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequencyQuarterly UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency = "quarterly" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequencyYearly UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseFrequency = "yearly" + UserSubscriptionListResponseFrequencyWeekly UserSubscriptionListResponseFrequency = "weekly" + UserSubscriptionListResponseFrequencyMonthly UserSubscriptionListResponseFrequency = "monthly" + UserSubscriptionListResponseFrequencyQuarterly UserSubscriptionListResponseFrequency = "quarterly" + UserSubscriptionListResponseFrequencyYearly UserSubscriptionListResponseFrequency = "yearly" ) // The rate plan applied to the subscription. -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlan struct { +type UserSubscriptionListResponseRatePlan struct { // The ID of the rate plan. ID interface{} `json:"id"` // The currency applied to the rate plan subscription. @@ -226,14 +188,13 @@ type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlan struct // The scope that this rate plan applies to. Scope string `json:"scope"` // The list of sets this rate plan applies to. - Sets []string `json:"sets"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlanJSON `json:"-"` + Sets []string `json:"sets"` + JSON userSubscriptionListResponseRatePlanJSON `json:"-"` } -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlanJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlan] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlanJSON struct { +// userSubscriptionListResponseRatePlanJSON contains the JSON metadata for the +// struct [UserSubscriptionListResponseRatePlan] +type userSubscriptionListResponseRatePlanJSON struct { ID apijson.Field Currency apijson.Field ExternallyManaged apijson.Field @@ -245,73 +206,205 @@ type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlanJSON st ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseRatePlan) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionListResponseRatePlan) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The state that the subscription is in. -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState string +type UserSubscriptionListResponseState string const ( - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateTrial UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Trial" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateProvisioned UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Provisioned" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStatePaid UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Paid" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateAwaitingPayment UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "AwaitingPayment" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateCancelled UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Cancelled" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateFailed UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Failed" - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseStateExpired UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseState = "Expired" + UserSubscriptionListResponseStateTrial UserSubscriptionListResponseState = "Trial" + UserSubscriptionListResponseStateProvisioned UserSubscriptionListResponseState = "Provisioned" + UserSubscriptionListResponseStatePaid UserSubscriptionListResponseState = "Paid" + UserSubscriptionListResponseStateAwaitingPayment UserSubscriptionListResponseState = "AwaitingPayment" + UserSubscriptionListResponseStateCancelled UserSubscriptionListResponseState = "Cancelled" + UserSubscriptionListResponseStateFailed UserSubscriptionListResponseState = "Failed" + UserSubscriptionListResponseStateExpired UserSubscriptionListResponseState = "Expired" ) // A simple zone object. May have null properties if not a zone subscription. -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseZone struct { +type UserSubscriptionListResponseZone struct { // Identifier ID string `json:"id"` // The domain name - Name string `json:"name"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseZoneJSON `json:"-"` + Name string `json:"name"` + JSON userSubscriptionListResponseZoneJSON `json:"-"` } -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseZoneJSON contains -// the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseZone] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseZoneJSON struct { +// userSubscriptionListResponseZoneJSON contains the JSON metadata for the struct +// [UserSubscriptionListResponseZone] +type userSubscriptionListResponseZoneJSON struct { ID apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseZone) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionListResponseZone) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserSubscriptionDeleteResponse struct { + // Subscription identifier tag. + SubscriptionID string `json:"subscription_id"` + JSON userSubscriptionDeleteResponseJSON `json:"-"` +} + +// userSubscriptionDeleteResponseJSON contains the JSON metadata for the struct +// [UserSubscriptionDeleteResponse] +type userSubscriptionDeleteResponseJSON struct { + SubscriptionID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserSubscriptionDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Union satisfied by [UserSubscriptionReplaceResponseUnknown] or +// [shared.UnionString]. +type UserSubscriptionReplaceResponse interface { + ImplementsUserSubscriptionReplaceResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*UserSubscriptionReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type UserSubscriptionListResponseEnvelope struct { + Errors []UserSubscriptionListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserSubscriptionListResponseEnvelopeMessages `json:"messages,required"` + Result []UserSubscriptionListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success UserSubscriptionListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserSubscriptionListResponseEnvelopeResultInfo `json:"result_info"` + JSON userSubscriptionListResponseEnvelopeJSON `json:"-"` +} + +// userSubscriptionListResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserSubscriptionListResponseEnvelope] +type userSubscriptionListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserSubscriptionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserSubscriptionListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userSubscriptionListResponseEnvelopeErrorsJSON `json:"-"` +} + +// userSubscriptionListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [UserSubscriptionListResponseEnvelopeErrors] +type userSubscriptionListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserSubscriptionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserSubscriptionListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userSubscriptionListResponseEnvelopeMessagesJSON `json:"-"` +} + +// userSubscriptionListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [UserSubscriptionListResponseEnvelopeMessages] +type userSubscriptionListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserSubscriptionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserSubscriptionUpdateParams struct { - App param.Field[UserSubscriptionUpdateParamsApp] `json:"app"` +// Whether the API call was successful +type UserSubscriptionListResponseEnvelopeSuccess bool + +const ( + UserSubscriptionListResponseEnvelopeSuccessTrue UserSubscriptionListResponseEnvelopeSuccess = true +) + +type UserSubscriptionListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON userSubscriptionListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// userSubscriptionListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [UserSubscriptionListResponseEnvelopeResultInfo] +type userSubscriptionListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *UserSubscriptionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserSubscriptionReplaceParams struct { + App param.Field[UserSubscriptionReplaceParamsApp] `json:"app"` // The list of add-ons subscribed to. - ComponentValues param.Field[[]UserSubscriptionUpdateParamsComponentValue] `json:"component_values"` + ComponentValues param.Field[[]UserSubscriptionReplaceParamsComponentValue] `json:"component_values"` // How often the subscription is renewed automatically. - Frequency param.Field[UserSubscriptionUpdateParamsFrequency] `json:"frequency"` + Frequency param.Field[UserSubscriptionReplaceParamsFrequency] `json:"frequency"` // The rate plan applied to the subscription. - RatePlan param.Field[UserSubscriptionUpdateParamsRatePlan] `json:"rate_plan"` + RatePlan param.Field[UserSubscriptionReplaceParamsRatePlan] `json:"rate_plan"` // A simple zone object. May have null properties if not a zone subscription. - Zone param.Field[UserSubscriptionUpdateParamsZone] `json:"zone"` + Zone param.Field[UserSubscriptionReplaceParamsZone] `json:"zone"` } -func (r UserSubscriptionUpdateParams) MarshalJSON() (data []byte, err error) { +func (r UserSubscriptionReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserSubscriptionUpdateParamsApp struct { +type UserSubscriptionReplaceParamsApp struct { // app install id. InstallID param.Field[string] `json:"install_id"` } -func (r UserSubscriptionUpdateParamsApp) MarshalJSON() (data []byte, err error) { +func (r UserSubscriptionReplaceParamsApp) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A component value for a subscription. -type UserSubscriptionUpdateParamsComponentValue struct { +type UserSubscriptionReplaceParamsComponentValue struct { // The default amount assigned. Default param.Field[float64] `json:"default"` // The name of the component value. @@ -322,22 +415,22 @@ type UserSubscriptionUpdateParamsComponentValue struct { Value param.Field[float64] `json:"value"` } -func (r UserSubscriptionUpdateParamsComponentValue) MarshalJSON() (data []byte, err error) { +func (r UserSubscriptionReplaceParamsComponentValue) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // How often the subscription is renewed automatically. -type UserSubscriptionUpdateParamsFrequency string +type UserSubscriptionReplaceParamsFrequency string const ( - UserSubscriptionUpdateParamsFrequencyWeekly UserSubscriptionUpdateParamsFrequency = "weekly" - UserSubscriptionUpdateParamsFrequencyMonthly UserSubscriptionUpdateParamsFrequency = "monthly" - UserSubscriptionUpdateParamsFrequencyQuarterly UserSubscriptionUpdateParamsFrequency = "quarterly" - UserSubscriptionUpdateParamsFrequencyYearly UserSubscriptionUpdateParamsFrequency = "yearly" + UserSubscriptionReplaceParamsFrequencyWeekly UserSubscriptionReplaceParamsFrequency = "weekly" + UserSubscriptionReplaceParamsFrequencyMonthly UserSubscriptionReplaceParamsFrequency = "monthly" + UserSubscriptionReplaceParamsFrequencyQuarterly UserSubscriptionReplaceParamsFrequency = "quarterly" + UserSubscriptionReplaceParamsFrequencyYearly UserSubscriptionReplaceParamsFrequency = "yearly" ) // The rate plan applied to the subscription. -type UserSubscriptionUpdateParamsRatePlan struct { +type UserSubscriptionReplaceParamsRatePlan struct { // The ID of the rate plan. ID param.Field[interface{}] `json:"id"` // The currency applied to the rate plan subscription. @@ -354,30 +447,30 @@ type UserSubscriptionUpdateParamsRatePlan struct { Sets param.Field[[]string] `json:"sets"` } -func (r UserSubscriptionUpdateParamsRatePlan) MarshalJSON() (data []byte, err error) { +func (r UserSubscriptionReplaceParamsRatePlan) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A simple zone object. May have null properties if not a zone subscription. -type UserSubscriptionUpdateParamsZone struct { +type UserSubscriptionReplaceParamsZone struct { } -func (r UserSubscriptionUpdateParamsZone) MarshalJSON() (data []byte, err error) { +func (r UserSubscriptionReplaceParamsZone) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserSubscriptionUpdateResponseEnvelope struct { - Errors []UserSubscriptionUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []UserSubscriptionUpdateResponseEnvelopeMessages `json:"messages,required"` - Result UserSubscriptionUpdateResponse `json:"result,required"` +type UserSubscriptionReplaceResponseEnvelope struct { + Errors []UserSubscriptionReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []UserSubscriptionReplaceResponseEnvelopeMessages `json:"messages,required"` + Result UserSubscriptionReplaceResponse `json:"result,required"` // Whether the API call was successful - Success UserSubscriptionUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON userSubscriptionUpdateResponseEnvelopeJSON `json:"-"` + Success UserSubscriptionReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON userSubscriptionReplaceResponseEnvelopeJSON `json:"-"` } -// userSubscriptionUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [UserSubscriptionUpdateResponseEnvelope] -type userSubscriptionUpdateResponseEnvelopeJSON struct { +// userSubscriptionReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserSubscriptionReplaceResponseEnvelope] +type userSubscriptionReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -386,153 +479,51 @@ type userSubscriptionUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserSubscriptionUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userSubscriptionUpdateResponseEnvelopeErrorsJSON `json:"-"` +type UserSubscriptionReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userSubscriptionReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// userSubscriptionUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [UserSubscriptionUpdateResponseEnvelopeErrors] -type userSubscriptionUpdateResponseEnvelopeErrorsJSON struct { +// userSubscriptionReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [UserSubscriptionReplaceResponseEnvelopeErrors] +type userSubscriptionReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserSubscriptionUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userSubscriptionUpdateResponseEnvelopeMessagesJSON `json:"-"` +type UserSubscriptionReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userSubscriptionReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// userSubscriptionUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [UserSubscriptionUpdateResponseEnvelopeMessages] -type userSubscriptionUpdateResponseEnvelopeMessagesJSON struct { +// userSubscriptionReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [UserSubscriptionReplaceResponseEnvelopeMessages] +type userSubscriptionReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserSubscriptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserSubscriptionReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserSubscriptionUpdateResponseEnvelopeSuccess bool +type UserSubscriptionReplaceResponseEnvelopeSuccess bool const ( - UserSubscriptionUpdateResponseEnvelopeSuccessTrue UserSubscriptionUpdateResponseEnvelopeSuccess = true + UserSubscriptionReplaceResponseEnvelopeSuccessTrue UserSubscriptionReplaceResponseEnvelopeSuccess = true ) - -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelope struct { - Errors []UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessages `json:"messages,required"` - Result []UserSubscriptionUserSubscriptionGetUserSubscriptionsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfo `json:"result_info"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeJSON `json:"-"` -} - -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelope] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrorsJSON `json:"-"` -} - -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrors] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessagesJSON `json:"-"` -} - -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessages] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeSuccess bool - -const ( - UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeSuccessTrue UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeSuccess = true -) - -type UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfo] -type userSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserSubscriptionUserSubscriptionGetUserSubscriptionsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/usersubscription_test.go b/usersubscription_test.go index 6365b67a1f3..ef5f32cf2ba 100644 --- a/usersubscription_test.go +++ b/usersubscription_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserSubscriptionUpdateWithOptionalParams(t *testing.T) { +func TestUserSubscriptionList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,42 +29,7 @@ func TestUserSubscriptionUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Subscriptions.Update( - context.TODO(), - "506e3185e9c882d175a2d0cb0093d9f2", - cloudflare.UserSubscriptionUpdateParams{ - App: cloudflare.F(cloudflare.UserSubscriptionUpdateParamsApp{ - InstallID: cloudflare.F("string"), - }), - ComponentValues: cloudflare.F([]cloudflare.UserSubscriptionUpdateParamsComponentValue{{ - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }, { - Default: cloudflare.F(5.000000), - Name: cloudflare.F("page_rules"), - Price: cloudflare.F(5.000000), - Value: cloudflare.F(20.000000), - }}), - Frequency: cloudflare.F(cloudflare.UserSubscriptionUpdateParamsFrequencyMonthly), - RatePlan: cloudflare.F(cloudflare.UserSubscriptionUpdateParamsRatePlan{ - Currency: cloudflare.F("USD"), - ExternallyManaged: cloudflare.F(false), - ID: cloudflare.F[any]("free"), - IsContract: cloudflare.F(false), - PublicName: cloudflare.F("Business Plan"), - Scope: cloudflare.F("zone"), - Sets: cloudflare.F([]string{"string", "string", "string"}), - }), - Zone: cloudflare.F(cloudflare.UserSubscriptionUpdateParamsZone{}), - }, - ) + _, err := client.Users.Subscriptions.List(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -100,7 +65,7 @@ func TestUserSubscriptionDelete(t *testing.T) { } } -func TestUserSubscriptionUserSubscriptionGetUserSubscriptions(t *testing.T) { +func TestUserSubscriptionReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -116,7 +81,42 @@ func TestUserSubscriptionUserSubscriptionGetUserSubscriptions(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Subscriptions.UserSubscriptionGetUserSubscriptions(context.TODO()) + _, err := client.Users.Subscriptions.Replace( + context.TODO(), + "506e3185e9c882d175a2d0cb0093d9f2", + cloudflare.UserSubscriptionReplaceParams{ + App: cloudflare.F(cloudflare.UserSubscriptionReplaceParamsApp{ + InstallID: cloudflare.F("string"), + }), + ComponentValues: cloudflare.F([]cloudflare.UserSubscriptionReplaceParamsComponentValue{{ + Default: cloudflare.F(5.000000), + Name: cloudflare.F("page_rules"), + Price: cloudflare.F(5.000000), + Value: cloudflare.F(20.000000), + }, { + Default: cloudflare.F(5.000000), + Name: cloudflare.F("page_rules"), + Price: cloudflare.F(5.000000), + Value: cloudflare.F(20.000000), + }, { + Default: cloudflare.F(5.000000), + Name: cloudflare.F("page_rules"), + Price: cloudflare.F(5.000000), + Value: cloudflare.F(20.000000), + }}), + Frequency: cloudflare.F(cloudflare.UserSubscriptionReplaceParamsFrequencyMonthly), + RatePlan: cloudflare.F(cloudflare.UserSubscriptionReplaceParamsRatePlan{ + Currency: cloudflare.F("USD"), + ExternallyManaged: cloudflare.F(false), + ID: cloudflare.F[any]("free"), + IsContract: cloudflare.F(false), + PublicName: cloudflare.F("Business Plan"), + Scope: cloudflare.F("zone"), + Sets: cloudflare.F([]string{"string", "string", "string"}), + }), + Zone: cloudflare.F(cloudflare.UserSubscriptionReplaceParamsZone{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/usertoken.go b/usertoken.go index 8537acd4887..b1d00381d4c 100644 --- a/usertoken.go +++ b/usertoken.go @@ -26,7 +26,6 @@ import ( type UserTokenService struct { Options []option.RequestOption PermissionGroups *UserTokenPermissionGroupService - Verifies *UserTokenVerifyService Values *UserTokenValueService } @@ -37,17 +36,16 @@ func NewUserTokenService(opts ...option.RequestOption) (r *UserTokenService) { r = &UserTokenService{} r.Options = opts r.PermissionGroups = NewUserTokenPermissionGroupService(opts...) - r.Verifies = NewUserTokenVerifyService(opts...) r.Values = NewUserTokenValueService(opts...) return } -// Update an existing token. -func (r *UserTokenService) Update(ctx context.Context, tokenID interface{}, body UserTokenUpdateParams, opts ...option.RequestOption) (res *UserTokenUpdateResponse, err error) { +// Create a new access token. +func (r *UserTokenService) New(ctx context.Context, body UserTokenNewParams, opts ...option.RequestOption) (res *UserTokenNewResponse, err error) { opts = append(r.Options[:], opts...) - var env UserTokenUpdateResponseEnvelope - path := fmt.Sprintf("user/tokens/%v", tokenID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env UserTokenNewResponseEnvelope + path := "user/tokens" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -55,6 +53,29 @@ func (r *UserTokenService) Update(ctx context.Context, tokenID interface{}, body return } +// List all access tokens you created. +func (r *UserTokenService) List(ctx context.Context, query UserTokenListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[UserTokenListResponse], err error) { + var raw *http.Response + opts = append(r.Options, opts...) + opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) + path := "user/tokens" + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + if err != nil { + return nil, err + } + err = cfg.Execute() + if err != nil { + return nil, err + } + res.SetPageConfig(cfg, raw) + return res, nil +} + +// List all access tokens you created. +func (r *UserTokenService) ListAutoPaging(ctx context.Context, query UserTokenListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[UserTokenListResponse] { + return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...)) +} + // Destroy a token. func (r *UserTokenService) Delete(ctx context.Context, tokenID interface{}, opts ...option.RequestOption) (res *UserTokenDeleteResponse, err error) { opts = append(r.Options[:], opts...) @@ -81,12 +102,12 @@ func (r *UserTokenService) Get(ctx context.Context, tokenID interface{}, opts .. return } -// Create a new access token. -func (r *UserTokenService) UserAPITokensNewToken(ctx context.Context, body UserTokenUserAPITokensNewTokenParams, opts ...option.RequestOption) (res *UserTokenUserAPITokensNewTokenResponse, err error) { +// Update an existing token. +func (r *UserTokenService) Replace(ctx context.Context, tokenID interface{}, body UserTokenReplaceParams, opts ...option.RequestOption) (res *UserTokenReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env UserTokenUserAPITokensNewTokenResponseEnvelope - path := "user/tokens" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env UserTokenReplaceResponseEnvelope + path := fmt.Sprintf("user/tokens/%v", tokenID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -94,12 +115,12 @@ func (r *UserTokenService) UserAPITokensNewToken(ctx context.Context, body UserT return } -// List all access tokens you created. -func (r *UserTokenService) UserAPITokensListTokens(ctx context.Context, query UserTokenUserAPITokensListTokensParams, opts ...option.RequestOption) (res *[]UserTokenUserAPITokensListTokensResponse, err error) { +// Test whether a token works. +func (r *UserTokenService) Verify(ctx context.Context, opts ...option.RequestOption) (res *UserTokenVerifyResponse, err error) { opts = append(r.Options[:], opts...) - var env UserTokenUserAPITokensListTokensResponseEnvelope - path := "user/tokens" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + var env UserTokenVerifyResponseEnvelope + path := "user/tokens/verify" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -107,22 +128,26 @@ func (r *UserTokenService) UserAPITokensListTokens(ctx context.Context, query Us return } -// Union satisfied by [UserTokenUpdateResponseUnknown] or [shared.UnionString]. -type UserTokenUpdateResponse interface { - ImplementsUserTokenUpdateResponse() +type UserTokenNewResponse struct { + // The token value. + Value string `json:"value"` + JSON userTokenNewResponseJSON `json:"-"` } -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*UserTokenUpdateResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// userTokenNewResponseJSON contains the JSON metadata for the struct +// [UserTokenNewResponse] +type userTokenNewResponseJSON struct { + Value apijson.Field + raw string + ExtraFields map[string]apijson.Field } +func (r *UserTokenNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type UserTokenListResponse = interface{} + type UserTokenDeleteResponse struct { // Identifier ID string `json:"id,required"` @@ -157,34 +182,65 @@ func init() { ) } -type UserTokenUserAPITokensNewTokenResponse struct { - // The token value. - Value string `json:"value"` - JSON userTokenUserAPITokensNewTokenResponseJSON `json:"-"` +// Union satisfied by [UserTokenReplaceResponseUnknown] or [shared.UnionString]. +type UserTokenReplaceResponse interface { + ImplementsUserTokenReplaceResponse() } -// userTokenUserAPITokensNewTokenResponseJSON contains the JSON metadata for the -// struct [UserTokenUserAPITokensNewTokenResponse] -type userTokenUserAPITokensNewTokenResponseJSON struct { - Value apijson.Field +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*UserTokenReplaceResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type UserTokenVerifyResponse struct { + // Token identifier tag. + ID string `json:"id,required"` + // Status of the token. + Status UserTokenVerifyResponseStatus `json:"status,required"` + // The expiration time on or after which the JWT MUST NOT be accepted for + // processing. + ExpiresOn time.Time `json:"expires_on" format:"date-time"` + // The time before which the token MUST NOT be accepted for processing. + NotBefore time.Time `json:"not_before" format:"date-time"` + JSON userTokenVerifyResponseJSON `json:"-"` +} + +// userTokenVerifyResponseJSON contains the JSON metadata for the struct +// [UserTokenVerifyResponse] +type userTokenVerifyResponseJSON struct { + ID apijson.Field + Status apijson.Field + ExpiresOn apijson.Field + NotBefore apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensNewTokenResponse) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenVerifyResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUserAPITokensListTokensResponse = interface{} +// Status of the token. +type UserTokenVerifyResponseStatus string + +const ( + UserTokenVerifyResponseStatusActive UserTokenVerifyResponseStatus = "active" + UserTokenVerifyResponseStatusDisabled UserTokenVerifyResponseStatus = "disabled" + UserTokenVerifyResponseStatusExpired UserTokenVerifyResponseStatus = "expired" +) -type UserTokenUpdateParams struct { +type UserTokenNewParams struct { // Token name. Name param.Field[string] `json:"name,required"` // List of access policies assigned to the token. - Policies param.Field[[]UserTokenUpdateParamsPolicy] `json:"policies,required"` - // Status of the token. - Status param.Field[UserTokenUpdateParamsStatus] `json:"status,required"` - Condition param.Field[UserTokenUpdateParamsCondition] `json:"condition"` + Policies param.Field[[]UserTokenNewParamsPolicy] `json:"policies,required"` + Condition param.Field[UserTokenNewParamsCondition] `json:"condition"` // The expiration time on or after which the JWT MUST NOT be accepted for // processing. ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"` @@ -192,82 +248,73 @@ type UserTokenUpdateParams struct { NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"` } -func (r UserTokenUpdateParams) MarshalJSON() (data []byte, err error) { +func (r UserTokenNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserTokenUpdateParamsPolicy struct { +type UserTokenNewParamsPolicy struct { // Allow or deny operations against the resources. - Effect param.Field[UserTokenUpdateParamsPoliciesEffect] `json:"effect,required"` + Effect param.Field[UserTokenNewParamsPoliciesEffect] `json:"effect,required"` // A set of permission groups that are specified to the policy. - PermissionGroups param.Field[[]UserTokenUpdateParamsPoliciesPermissionGroup] `json:"permission_groups,required"` + PermissionGroups param.Field[[]UserTokenNewParamsPoliciesPermissionGroup] `json:"permission_groups,required"` // A list of resource names that the policy applies to. Resources param.Field[interface{}] `json:"resources,required"` } -func (r UserTokenUpdateParamsPolicy) MarshalJSON() (data []byte, err error) { +func (r UserTokenNewParamsPolicy) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Allow or deny operations against the resources. -type UserTokenUpdateParamsPoliciesEffect string +type UserTokenNewParamsPoliciesEffect string const ( - UserTokenUpdateParamsPoliciesEffectAllow UserTokenUpdateParamsPoliciesEffect = "allow" - UserTokenUpdateParamsPoliciesEffectDeny UserTokenUpdateParamsPoliciesEffect = "deny" + UserTokenNewParamsPoliciesEffectAllow UserTokenNewParamsPoliciesEffect = "allow" + UserTokenNewParamsPoliciesEffectDeny UserTokenNewParamsPoliciesEffect = "deny" ) // A named group of permissions that map to a group of operations against // resources. -type UserTokenUpdateParamsPoliciesPermissionGroup struct { +type UserTokenNewParamsPoliciesPermissionGroup struct { } -func (r UserTokenUpdateParamsPoliciesPermissionGroup) MarshalJSON() (data []byte, err error) { +func (r UserTokenNewParamsPoliciesPermissionGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Status of the token. -type UserTokenUpdateParamsStatus string - -const ( - UserTokenUpdateParamsStatusActive UserTokenUpdateParamsStatus = "active" - UserTokenUpdateParamsStatusDisabled UserTokenUpdateParamsStatus = "disabled" - UserTokenUpdateParamsStatusExpired UserTokenUpdateParamsStatus = "expired" -) - -type UserTokenUpdateParamsCondition struct { +type UserTokenNewParamsCondition struct { // Client IP restrictions. - RequestIP param.Field[UserTokenUpdateParamsConditionRequestIP] `json:"request_ip"` + RequestIP param.Field[UserTokenNewParamsConditionRequestIP] `json:"request_ip"` } -func (r UserTokenUpdateParamsCondition) MarshalJSON() (data []byte, err error) { +func (r UserTokenNewParamsCondition) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Client IP restrictions. -type UserTokenUpdateParamsConditionRequestIP struct { +type UserTokenNewParamsConditionRequestIP struct { // List of IPv4/IPv6 CIDR addresses. In param.Field[[]string] `json:"in"` // List of IPv4/IPv6 CIDR addresses. NotIn param.Field[[]string] `json:"not_in"` } -func (r UserTokenUpdateParamsConditionRequestIP) MarshalJSON() (data []byte, err error) { +func (r UserTokenNewParamsConditionRequestIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserTokenUpdateResponseEnvelope struct { - Errors []UserTokenUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenUpdateResponseEnvelopeMessages `json:"messages,required"` - Result UserTokenUpdateResponse `json:"result,required"` +type UserTokenNewResponseEnvelope struct { + Errors []UserTokenNewResponseEnvelopeErrors `json:"errors,required"` + Messages []UserTokenNewResponseEnvelopeMessages `json:"messages,required"` + Result UserTokenNewResponse `json:"result,required"` // Whether the API call was successful - Success UserTokenUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON userTokenUpdateResponseEnvelopeJSON `json:"-"` + Success UserTokenNewResponseEnvelopeSuccess `json:"success,required"` + JSON userTokenNewResponseEnvelopeJSON `json:"-"` } -// userTokenUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [UserTokenUpdateResponseEnvelope] -type userTokenUpdateResponseEnvelopeJSON struct { +// userTokenNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserTokenNewResponseEnvelope] +type userTokenNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -276,53 +323,78 @@ type userTokenUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserTokenUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUpdateResponseEnvelopeErrorsJSON `json:"-"` +type UserTokenNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenNewResponseEnvelopeErrorsJSON `json:"-"` } -// userTokenUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [UserTokenUpdateResponseEnvelopeErrors] -type userTokenUpdateResponseEnvelopeErrorsJSON struct { +// userTokenNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [UserTokenNewResponseEnvelopeErrors] +type userTokenNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUpdateResponseEnvelopeMessagesJSON `json:"-"` +type UserTokenNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenNewResponseEnvelopeMessagesJSON `json:"-"` } -// userTokenUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [UserTokenUpdateResponseEnvelopeMessages] -type userTokenUpdateResponseEnvelopeMessagesJSON struct { +// userTokenNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [UserTokenNewResponseEnvelopeMessages] +type userTokenNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserTokenUpdateResponseEnvelopeSuccess bool +type UserTokenNewResponseEnvelopeSuccess bool const ( - UserTokenUpdateResponseEnvelopeSuccessTrue UserTokenUpdateResponseEnvelopeSuccess = true + UserTokenNewResponseEnvelopeSuccessTrue UserTokenNewResponseEnvelopeSuccess = true +) + +type UserTokenListParams struct { + // Direction to order results. + Direction param.Field[UserTokenListParamsDirection] `query:"direction"` + // Page number of paginated results. + Page param.Field[float64] `query:"page"` + // Maximum number of results per page. + PerPage param.Field[float64] `query:"per_page"` +} + +// URLQuery serializes [UserTokenListParams]'s query parameters as `url.Values`. +func (r UserTokenListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +// Direction to order results. +type UserTokenListParamsDirection string + +const ( + UserTokenListParamsDirectionAsc UserTokenListParamsDirection = "asc" + UserTokenListParamsDirectionDesc UserTokenListParamsDirection = "desc" ) type UserTokenDeleteResponseEnvelope struct { @@ -463,12 +535,14 @@ const ( UserTokenGetResponseEnvelopeSuccessTrue UserTokenGetResponseEnvelopeSuccess = true ) -type UserTokenUserAPITokensNewTokenParams struct { +type UserTokenReplaceParams struct { // Token name. Name param.Field[string] `json:"name,required"` // List of access policies assigned to the token. - Policies param.Field[[]UserTokenUserAPITokensNewTokenParamsPolicy] `json:"policies,required"` - Condition param.Field[UserTokenUserAPITokensNewTokenParamsCondition] `json:"condition"` + Policies param.Field[[]UserTokenReplaceParamsPolicy] `json:"policies,required"` + // Status of the token. + Status param.Field[UserTokenReplaceParamsStatus] `json:"status,required"` + Condition param.Field[UserTokenReplaceParamsCondition] `json:"condition"` // The expiration time on or after which the JWT MUST NOT be accepted for // processing. ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"` @@ -476,73 +550,82 @@ type UserTokenUserAPITokensNewTokenParams struct { NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"` } -func (r UserTokenUserAPITokensNewTokenParams) MarshalJSON() (data []byte, err error) { +func (r UserTokenReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserTokenUserAPITokensNewTokenParamsPolicy struct { +type UserTokenReplaceParamsPolicy struct { // Allow or deny operations against the resources. - Effect param.Field[UserTokenUserAPITokensNewTokenParamsPoliciesEffect] `json:"effect,required"` + Effect param.Field[UserTokenReplaceParamsPoliciesEffect] `json:"effect,required"` // A set of permission groups that are specified to the policy. - PermissionGroups param.Field[[]UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup] `json:"permission_groups,required"` + PermissionGroups param.Field[[]UserTokenReplaceParamsPoliciesPermissionGroup] `json:"permission_groups,required"` // A list of resource names that the policy applies to. Resources param.Field[interface{}] `json:"resources,required"` } -func (r UserTokenUserAPITokensNewTokenParamsPolicy) MarshalJSON() (data []byte, err error) { +func (r UserTokenReplaceParamsPolicy) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Allow or deny operations against the resources. -type UserTokenUserAPITokensNewTokenParamsPoliciesEffect string +type UserTokenReplaceParamsPoliciesEffect string const ( - UserTokenUserAPITokensNewTokenParamsPoliciesEffectAllow UserTokenUserAPITokensNewTokenParamsPoliciesEffect = "allow" - UserTokenUserAPITokensNewTokenParamsPoliciesEffectDeny UserTokenUserAPITokensNewTokenParamsPoliciesEffect = "deny" + UserTokenReplaceParamsPoliciesEffectAllow UserTokenReplaceParamsPoliciesEffect = "allow" + UserTokenReplaceParamsPoliciesEffectDeny UserTokenReplaceParamsPoliciesEffect = "deny" ) // A named group of permissions that map to a group of operations against // resources. -type UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup struct { +type UserTokenReplaceParamsPoliciesPermissionGroup struct { } -func (r UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup) MarshalJSON() (data []byte, err error) { +func (r UserTokenReplaceParamsPoliciesPermissionGroup) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserTokenUserAPITokensNewTokenParamsCondition struct { +// Status of the token. +type UserTokenReplaceParamsStatus string + +const ( + UserTokenReplaceParamsStatusActive UserTokenReplaceParamsStatus = "active" + UserTokenReplaceParamsStatusDisabled UserTokenReplaceParamsStatus = "disabled" + UserTokenReplaceParamsStatusExpired UserTokenReplaceParamsStatus = "expired" +) + +type UserTokenReplaceParamsCondition struct { // Client IP restrictions. - RequestIP param.Field[UserTokenUserAPITokensNewTokenParamsConditionRequestIP] `json:"request_ip"` + RequestIP param.Field[UserTokenReplaceParamsConditionRequestIP] `json:"request_ip"` } -func (r UserTokenUserAPITokensNewTokenParamsCondition) MarshalJSON() (data []byte, err error) { +func (r UserTokenReplaceParamsCondition) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Client IP restrictions. -type UserTokenUserAPITokensNewTokenParamsConditionRequestIP struct { +type UserTokenReplaceParamsConditionRequestIP struct { // List of IPv4/IPv6 CIDR addresses. In param.Field[[]string] `json:"in"` // List of IPv4/IPv6 CIDR addresses. NotIn param.Field[[]string] `json:"not_in"` } -func (r UserTokenUserAPITokensNewTokenParamsConditionRequestIP) MarshalJSON() (data []byte, err error) { +func (r UserTokenReplaceParamsConditionRequestIP) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type UserTokenUserAPITokensNewTokenResponseEnvelope struct { - Errors []UserTokenUserAPITokensNewTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenUserAPITokensNewTokenResponseEnvelopeMessages `json:"messages,required"` - Result UserTokenUserAPITokensNewTokenResponse `json:"result,required"` +type UserTokenReplaceResponseEnvelope struct { + Errors []UserTokenReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []UserTokenReplaceResponseEnvelopeMessages `json:"messages,required"` + Result UserTokenReplaceResponse `json:"result,required"` // Whether the API call was successful - Success UserTokenUserAPITokensNewTokenResponseEnvelopeSuccess `json:"success,required"` - JSON userTokenUserAPITokensNewTokenResponseEnvelopeJSON `json:"-"` + Success UserTokenReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON userTokenReplaceResponseEnvelopeJSON `json:"-"` } -// userTokenUserAPITokensNewTokenResponseEnvelopeJSON contains the JSON metadata -// for the struct [UserTokenUserAPITokensNewTokenResponseEnvelope] -type userTokenUserAPITokensNewTokenResponseEnvelopeJSON struct { +// userTokenReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserTokenReplaceResponseEnvelope] +type userTokenReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -551,177 +634,120 @@ type userTokenUserAPITokensNewTokenResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensNewTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUserAPITokensNewTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUserAPITokensNewTokenResponseEnvelopeErrorsJSON `json:"-"` +type UserTokenReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// userTokenUserAPITokensNewTokenResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [UserTokenUserAPITokensNewTokenResponseEnvelopeErrors] -type userTokenUserAPITokensNewTokenResponseEnvelopeErrorsJSON struct { +// userTokenReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [UserTokenReplaceResponseEnvelopeErrors] +type userTokenReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensNewTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUserAPITokensNewTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUserAPITokensNewTokenResponseEnvelopeMessagesJSON `json:"-"` +type UserTokenReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// userTokenUserAPITokensNewTokenResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct [UserTokenUserAPITokensNewTokenResponseEnvelopeMessages] -type userTokenUserAPITokensNewTokenResponseEnvelopeMessagesJSON struct { +// userTokenReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [UserTokenReplaceResponseEnvelopeMessages] +type userTokenReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensNewTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserTokenUserAPITokensNewTokenResponseEnvelopeSuccess bool +type UserTokenReplaceResponseEnvelopeSuccess bool const ( - UserTokenUserAPITokensNewTokenResponseEnvelopeSuccessTrue UserTokenUserAPITokensNewTokenResponseEnvelopeSuccess = true + UserTokenReplaceResponseEnvelopeSuccessTrue UserTokenReplaceResponseEnvelopeSuccess = true ) -type UserTokenUserAPITokensListTokensParams struct { - // Direction to order results. - Direction param.Field[UserTokenUserAPITokensListTokensParamsDirection] `query:"direction"` - // Page number of paginated results. - Page param.Field[float64] `query:"page"` - // Maximum number of results per page. - PerPage param.Field[float64] `query:"per_page"` -} - -// URLQuery serializes [UserTokenUserAPITokensListTokensParams]'s query parameters -// as `url.Values`. -func (r UserTokenUserAPITokensListTokensParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Direction to order results. -type UserTokenUserAPITokensListTokensParamsDirection string - -const ( - UserTokenUserAPITokensListTokensParamsDirectionAsc UserTokenUserAPITokensListTokensParamsDirection = "asc" - UserTokenUserAPITokensListTokensParamsDirectionDesc UserTokenUserAPITokensListTokensParamsDirection = "desc" -) - -type UserTokenUserAPITokensListTokensResponseEnvelope struct { - Errors []UserTokenUserAPITokensListTokensResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenUserAPITokensListTokensResponseEnvelopeMessages `json:"messages,required"` - Result []UserTokenUserAPITokensListTokensResponse `json:"result,required,nullable"` +type UserTokenVerifyResponseEnvelope struct { + Errors []UserTokenVerifyResponseEnvelopeErrors `json:"errors,required"` + Messages []UserTokenVerifyResponseEnvelopeMessages `json:"messages,required"` + Result UserTokenVerifyResponse `json:"result,required"` // Whether the API call was successful - Success UserTokenUserAPITokensListTokensResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserTokenUserAPITokensListTokensResponseEnvelopeResultInfo `json:"result_info"` - JSON userTokenUserAPITokensListTokensResponseEnvelopeJSON `json:"-"` + Success UserTokenVerifyResponseEnvelopeSuccess `json:"success,required"` + JSON userTokenVerifyResponseEnvelopeJSON `json:"-"` } -// userTokenUserAPITokensListTokensResponseEnvelopeJSON contains the JSON metadata -// for the struct [UserTokenUserAPITokensListTokensResponseEnvelope] -type userTokenUserAPITokensListTokensResponseEnvelopeJSON struct { +// userTokenVerifyResponseEnvelopeJSON contains the JSON metadata for the struct +// [UserTokenVerifyResponseEnvelope] +type userTokenVerifyResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensListTokensResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenVerifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUserAPITokensListTokensResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUserAPITokensListTokensResponseEnvelopeErrorsJSON `json:"-"` +type UserTokenVerifyResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenVerifyResponseEnvelopeErrorsJSON `json:"-"` } -// userTokenUserAPITokensListTokensResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [UserTokenUserAPITokensListTokensResponseEnvelopeErrors] -type userTokenUserAPITokensListTokensResponseEnvelopeErrorsJSON struct { +// userTokenVerifyResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [UserTokenVerifyResponseEnvelopeErrors] +type userTokenVerifyResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensListTokensResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenVerifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenUserAPITokensListTokensResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenUserAPITokensListTokensResponseEnvelopeMessagesJSON `json:"-"` +type UserTokenVerifyResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenVerifyResponseEnvelopeMessagesJSON `json:"-"` } -// userTokenUserAPITokensListTokensResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [UserTokenUserAPITokensListTokensResponseEnvelopeMessages] -type userTokenUserAPITokensListTokensResponseEnvelopeMessagesJSON struct { +// userTokenVerifyResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [UserTokenVerifyResponseEnvelopeMessages] +type userTokenVerifyResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenUserAPITokensListTokensResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenVerifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserTokenUserAPITokensListTokensResponseEnvelopeSuccess bool +type UserTokenVerifyResponseEnvelopeSuccess bool const ( - UserTokenUserAPITokensListTokensResponseEnvelopeSuccessTrue UserTokenUserAPITokensListTokensResponseEnvelopeSuccess = true + UserTokenVerifyResponseEnvelopeSuccessTrue UserTokenVerifyResponseEnvelopeSuccess = true ) - -type UserTokenUserAPITokensListTokensResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userTokenUserAPITokensListTokensResponseEnvelopeResultInfoJSON `json:"-"` -} - -// userTokenUserAPITokensListTokensResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct -// [UserTokenUserAPITokensListTokensResponseEnvelopeResultInfo] -type userTokenUserAPITokensListTokensResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserTokenUserAPITokensListTokensResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/usertoken_test.go b/usertoken_test.go index dc8aca93514..7d98a1e420b 100644 --- a/usertoken_test.go +++ b/usertoken_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserTokenUpdateWithOptionalParams(t *testing.T) { +func TestUserTokenNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,44 +30,69 @@ func TestUserTokenUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.Update( - context.TODO(), - map[string]interface{}{}, - cloudflare.UserTokenUpdateParams{ - Name: cloudflare.F("readonly token"), - Policies: cloudflare.F([]cloudflare.UserTokenUpdateParamsPolicy{{ - Effect: cloudflare.F(cloudflare.UserTokenUpdateParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUpdateParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }, { - Effect: cloudflare.F(cloudflare.UserTokenUpdateParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUpdateParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }, { - Effect: cloudflare.F(cloudflare.UserTokenUpdateParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUpdateParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }}), - Status: cloudflare.F(cloudflare.UserTokenUpdateParamsStatusActive), - Condition: cloudflare.F(cloudflare.UserTokenUpdateParamsCondition{ - RequestIP: cloudflare.F(cloudflare.UserTokenUpdateParamsConditionRequestIP{ - In: cloudflare.F([]string{"123.123.123.0/24", "2606:4700::/32"}), - NotIn: cloudflare.F([]string{"123.123.123.100/24", "2606:4700:4700::/48"}), - }), + _, err := client.Users.Tokens.New(context.TODO(), cloudflare.UserTokenNewParams{ + Name: cloudflare.F("readonly token"), + Policies: cloudflare.F([]cloudflare.UserTokenNewParamsPolicy{{ + Effect: cloudflare.F(cloudflare.UserTokenNewParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenNewParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }), - ExpiresOn: cloudflare.F(time.Now()), - NotBefore: cloudflare.F(time.Now()), - }, + }, { + Effect: cloudflare.F(cloudflare.UserTokenNewParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenNewParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }), + }, { + Effect: cloudflare.F(cloudflare.UserTokenNewParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenNewParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }), + }}), + Condition: cloudflare.F(cloudflare.UserTokenNewParamsCondition{ + RequestIP: cloudflare.F(cloudflare.UserTokenNewParamsConditionRequestIP{ + In: cloudflare.F([]string{"123.123.123.0/24", "2606:4700::/32"}), + NotIn: cloudflare.F([]string{"123.123.123.100/24", "2606:4700:4700::/48"}), + }), + }), + ExpiresOn: cloudflare.F(time.Now()), + NotBefore: cloudflare.F(time.Now()), + }) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestUserTokenListWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), ) + _, err := client.Users.Tokens.List(context.TODO(), cloudflare.UserTokenListParams{ + Direction: cloudflare.F(cloudflare.UserTokenListParamsDirectionDesc), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -129,7 +154,7 @@ func TestUserTokenGet(t *testing.T) { } } -func TestUserTokenUserAPITokensNewTokenWithOptionalParams(t *testing.T) { +func TestUserTokenReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -145,39 +170,44 @@ func TestUserTokenUserAPITokensNewTokenWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.UserAPITokensNewToken(context.TODO(), cloudflare.UserTokenUserAPITokensNewTokenParams{ - Name: cloudflare.F("readonly token"), - Policies: cloudflare.F([]cloudflare.UserTokenUserAPITokensNewTokenParamsPolicy{{ - Effect: cloudflare.F(cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }, { - Effect: cloudflare.F(cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }, { - Effect: cloudflare.F(cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesEffectAllow), - PermissionGroups: cloudflare.F([]cloudflare.UserTokenUserAPITokensNewTokenParamsPoliciesPermissionGroup{{}, {}}), - Resources: cloudflare.F[any](map[string]interface{}{ - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }), - }}), - Condition: cloudflare.F(cloudflare.UserTokenUserAPITokensNewTokenParamsCondition{ - RequestIP: cloudflare.F(cloudflare.UserTokenUserAPITokensNewTokenParamsConditionRequestIP{ - In: cloudflare.F([]string{"123.123.123.0/24", "2606:4700::/32"}), - NotIn: cloudflare.F([]string{"123.123.123.100/24", "2606:4700:4700::/48"}), + _, err := client.Users.Tokens.Replace( + context.TODO(), + map[string]interface{}{}, + cloudflare.UserTokenReplaceParams{ + Name: cloudflare.F("readonly token"), + Policies: cloudflare.F([]cloudflare.UserTokenReplaceParamsPolicy{{ + Effect: cloudflare.F(cloudflare.UserTokenReplaceParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenReplaceParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }), + }, { + Effect: cloudflare.F(cloudflare.UserTokenReplaceParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenReplaceParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }), + }, { + Effect: cloudflare.F(cloudflare.UserTokenReplaceParamsPoliciesEffectAllow), + PermissionGroups: cloudflare.F([]cloudflare.UserTokenReplaceParamsPoliciesPermissionGroup{{}, {}}), + Resources: cloudflare.F[any](map[string]interface{}{ + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }), + }}), + Status: cloudflare.F(cloudflare.UserTokenReplaceParamsStatusActive), + Condition: cloudflare.F(cloudflare.UserTokenReplaceParamsCondition{ + RequestIP: cloudflare.F(cloudflare.UserTokenReplaceParamsConditionRequestIP{ + In: cloudflare.F([]string{"123.123.123.0/24", "2606:4700::/32"}), + NotIn: cloudflare.F([]string{"123.123.123.100/24", "2606:4700:4700::/48"}), + }), }), - }), - ExpiresOn: cloudflare.F(time.Now()), - NotBefore: cloudflare.F(time.Now()), - }) + ExpiresOn: cloudflare.F(time.Now()), + NotBefore: cloudflare.F(time.Now()), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -187,7 +217,7 @@ func TestUserTokenUserAPITokensNewTokenWithOptionalParams(t *testing.T) { } } -func TestUserTokenUserAPITokensListTokensWithOptionalParams(t *testing.T) { +func TestUserTokenVerify(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -203,11 +233,7 @@ func TestUserTokenUserAPITokensListTokensWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.UserAPITokensListTokens(context.TODO(), cloudflare.UserTokenUserAPITokensListTokensParams{ - Direction: cloudflare.F(cloudflare.UserTokenUserAPITokensListTokensParamsDirectionDesc), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), - }) + _, err := client.Users.Tokens.Verify(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/usertokenpermissiongroup.go b/usertokenpermissiongroup.go index edd11f4fb42..63175049fb8 100644 --- a/usertokenpermissiongroup.go +++ b/usertokenpermissiongroup.go @@ -30,9 +30,9 @@ func NewUserTokenPermissionGroupService(opts ...option.RequestOption) (r *UserTo } // Find all available permission groups. -func (r *UserTokenPermissionGroupService) PermissionGroupsListPermissionGroups(ctx context.Context, opts ...option.RequestOption) (res *[]UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponse, err error) { +func (r *UserTokenPermissionGroupService) List(ctx context.Context, opts ...option.RequestOption) (res *[]UserTokenPermissionGroupListResponse, err error) { opts = append(r.Options[:], opts...) - var env UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelope + var env UserTokenPermissionGroupListResponseEnvelope path := "user/tokens/permission_groups" err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -42,22 +42,21 @@ func (r *UserTokenPermissionGroupService) PermissionGroupsListPermissionGroups(c return } -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponse = interface{} +type UserTokenPermissionGroupListResponse = interface{} -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelope struct { - Errors []UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessages `json:"messages,required"` - Result []UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponse `json:"result,required,nullable"` +type UserTokenPermissionGroupListResponseEnvelope struct { + Errors []UserTokenPermissionGroupListResponseEnvelopeErrors `json:"errors,required"` + Messages []UserTokenPermissionGroupListResponseEnvelopeMessages `json:"messages,required"` + Result []UserTokenPermissionGroupListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfo `json:"result_info"` - JSON userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeJSON `json:"-"` + Success UserTokenPermissionGroupListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo UserTokenPermissionGroupListResponseEnvelopeResultInfo `json:"result_info"` + JSON userTokenPermissionGroupListResponseEnvelopeJSON `json:"-"` } -// userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelope] -type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeJSON struct { +// userTokenPermissionGroupListResponseEnvelopeJSON contains the JSON metadata for +// the struct [UserTokenPermissionGroupListResponseEnvelope] +type userTokenPermissionGroupListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -67,58 +66,56 @@ type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelop ExtraFields map[string]apijson.Field } -func (r *UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenPermissionGroupListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrorsJSON `json:"-"` +type UserTokenPermissionGroupListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenPermissionGroupListResponseEnvelopeErrorsJSON `json:"-"` } -// userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrors] -type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrorsJSON struct { +// userTokenPermissionGroupListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [UserTokenPermissionGroupListResponseEnvelopeErrors] +type userTokenPermissionGroupListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenPermissionGroupListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessagesJSON `json:"-"` +type UserTokenPermissionGroupListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenPermissionGroupListResponseEnvelopeMessagesJSON `json:"-"` } -// userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessages] -type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessagesJSON struct { +// userTokenPermissionGroupListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [UserTokenPermissionGroupListResponseEnvelopeMessages] +type userTokenPermissionGroupListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenPermissionGroupListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeSuccess bool +type UserTokenPermissionGroupListResponseEnvelopeSuccess bool const ( - UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeSuccessTrue UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeSuccess = true + UserTokenPermissionGroupListResponseEnvelopeSuccessTrue UserTokenPermissionGroupListResponseEnvelopeSuccess = true ) -type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfo struct { +type UserTokenPermissionGroupListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -126,14 +123,13 @@ type UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelop // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON userTokenPermissionGroupListResponseEnvelopeResultInfoJSON `json:"-"` } -// userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfo] -type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfoJSON struct { +// userTokenPermissionGroupListResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [UserTokenPermissionGroupListResponseEnvelopeResultInfo] +type userTokenPermissionGroupListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -142,6 +138,6 @@ type userTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelop ExtraFields map[string]apijson.Field } -func (r *UserTokenPermissionGroupPermissionGroupsListPermissionGroupsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenPermissionGroupListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/usertokenpermissiongroup_test.go b/usertokenpermissiongroup_test.go index 1d3e3818c6e..6707378cc0a 100644 --- a/usertokenpermissiongroup_test.go +++ b/usertokenpermissiongroup_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserTokenPermissionGroupPermissionGroupsListPermissionGroups(t *testing.T) { +func TestUserTokenPermissionGroupList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestUserTokenPermissionGroupPermissionGroupsListPermissionGroups(t *testing option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.PermissionGroups.PermissionGroupsListPermissionGroups(context.TODO()) + _, err := client.Users.Tokens.PermissionGroups.List(context.TODO()) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/usertokenvalue.go b/usertokenvalue.go index 93c307b6317..ae38bdffba8 100644 --- a/usertokenvalue.go +++ b/usertokenvalue.go @@ -32,9 +32,9 @@ func NewUserTokenValueService(opts ...option.RequestOption) (r *UserTokenValueSe } // Roll the token secret. -func (r *UserTokenValueService) UserAPITokensRollToken(ctx context.Context, tokenID interface{}, body UserTokenValueUserAPITokensRollTokenParams, opts ...option.RequestOption) (res *string, err error) { +func (r *UserTokenValueService) Replace(ctx context.Context, tokenID interface{}, body UserTokenValueReplaceParams, opts ...option.RequestOption) (res *string, err error) { opts = append(r.Options[:], opts...) - var env UserTokenValueUserAPITokensRollTokenResponseEnvelope + var env UserTokenValueReplaceResponseEnvelope path := fmt.Sprintf("user/tokens/%v/value", tokenID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -44,27 +44,27 @@ func (r *UserTokenValueService) UserAPITokensRollToken(ctx context.Context, toke return } -type UserTokenValueUserAPITokensRollTokenParams struct { +type UserTokenValueReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r UserTokenValueUserAPITokensRollTokenParams) MarshalJSON() (data []byte, err error) { +func (r UserTokenValueReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type UserTokenValueUserAPITokensRollTokenResponseEnvelope struct { - Errors []UserTokenValueUserAPITokensRollTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenValueUserAPITokensRollTokenResponseEnvelopeMessages `json:"messages,required"` +type UserTokenValueReplaceResponseEnvelope struct { + Errors []UserTokenValueReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []UserTokenValueReplaceResponseEnvelopeMessages `json:"messages,required"` // The token value. Result string `json:"result,required"` // Whether the API call was successful - Success UserTokenValueUserAPITokensRollTokenResponseEnvelopeSuccess `json:"success,required"` - JSON userTokenValueUserAPITokensRollTokenResponseEnvelopeJSON `json:"-"` + Success UserTokenValueReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON userTokenValueReplaceResponseEnvelopeJSON `json:"-"` } -// userTokenValueUserAPITokensRollTokenResponseEnvelopeJSON contains the JSON -// metadata for the struct [UserTokenValueUserAPITokensRollTokenResponseEnvelope] -type userTokenValueUserAPITokensRollTokenResponseEnvelopeJSON struct { +// userTokenValueReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [UserTokenValueReplaceResponseEnvelope] +type userTokenValueReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -73,53 +73,51 @@ type userTokenValueUserAPITokensRollTokenResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *UserTokenValueUserAPITokensRollTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenValueReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenValueUserAPITokensRollTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenValueUserAPITokensRollTokenResponseEnvelopeErrorsJSON `json:"-"` +type UserTokenValueReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenValueReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// userTokenValueUserAPITokensRollTokenResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [UserTokenValueUserAPITokensRollTokenResponseEnvelopeErrors] -type userTokenValueUserAPITokensRollTokenResponseEnvelopeErrorsJSON struct { +// userTokenValueReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [UserTokenValueReplaceResponseEnvelopeErrors] +type userTokenValueReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenValueUserAPITokensRollTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenValueReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type UserTokenValueUserAPITokensRollTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenValueUserAPITokensRollTokenResponseEnvelopeMessagesJSON `json:"-"` +type UserTokenValueReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON userTokenValueReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// userTokenValueUserAPITokensRollTokenResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [UserTokenValueUserAPITokensRollTokenResponseEnvelopeMessages] -type userTokenValueUserAPITokensRollTokenResponseEnvelopeMessagesJSON struct { +// userTokenValueReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [UserTokenValueReplaceResponseEnvelopeMessages] +type userTokenValueReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *UserTokenValueUserAPITokensRollTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *UserTokenValueReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type UserTokenValueUserAPITokensRollTokenResponseEnvelopeSuccess bool +type UserTokenValueReplaceResponseEnvelopeSuccess bool const ( - UserTokenValueUserAPITokensRollTokenResponseEnvelopeSuccessTrue UserTokenValueUserAPITokensRollTokenResponseEnvelopeSuccess = true + UserTokenValueReplaceResponseEnvelopeSuccessTrue UserTokenValueReplaceResponseEnvelopeSuccess = true ) diff --git a/usertokenvalue_test.go b/usertokenvalue_test.go index e6b0c3cf89d..016a44db2c6 100644 --- a/usertokenvalue_test.go +++ b/usertokenvalue_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestUserTokenValueUserAPITokensRollToken(t *testing.T) { +func TestUserTokenValueReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestUserTokenValueUserAPITokensRollToken(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Users.Tokens.Values.UserAPITokensRollToken( + _, err := client.Users.Tokens.Values.Replace( context.TODO(), map[string]interface{}{}, - cloudflare.UserTokenValueUserAPITokensRollTokenParams{ + cloudflare.UserTokenValueReplaceParams{ Body: cloudflare.F[any](map[string]interface{}{}), }, ) diff --git a/usertokenverify.go b/usertokenverify.go deleted file mode 100644 index 22acb5bbf6e..00000000000 --- a/usertokenverify.go +++ /dev/null @@ -1,153 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "net/http" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// UserTokenVerifyService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewUserTokenVerifyService] method -// instead. -type UserTokenVerifyService struct { - Options []option.RequestOption -} - -// NewUserTokenVerifyService generates a new service that applies the given options -// to each request. These options are applied after the parent client's options (if -// there is one), and before any request-specific options. -func NewUserTokenVerifyService(opts ...option.RequestOption) (r *UserTokenVerifyService) { - r = &UserTokenVerifyService{} - r.Options = opts - return -} - -// Test whether a token works. -func (r *UserTokenVerifyService) UserAPITokensVerifyToken(ctx context.Context, opts ...option.RequestOption) (res *UserTokenVerifyUserAPITokensVerifyTokenResponse, err error) { - opts = append(r.Options[:], opts...) - var env UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelope - path := "user/tokens/verify" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type UserTokenVerifyUserAPITokensVerifyTokenResponse struct { - // Token identifier tag. - ID string `json:"id,required"` - // Status of the token. - Status UserTokenVerifyUserAPITokensVerifyTokenResponseStatus `json:"status,required"` - // The expiration time on or after which the JWT MUST NOT be accepted for - // processing. - ExpiresOn time.Time `json:"expires_on" format:"date-time"` - // The time before which the token MUST NOT be accepted for processing. - NotBefore time.Time `json:"not_before" format:"date-time"` - JSON userTokenVerifyUserAPITokensVerifyTokenResponseJSON `json:"-"` -} - -// userTokenVerifyUserAPITokensVerifyTokenResponseJSON contains the JSON metadata -// for the struct [UserTokenVerifyUserAPITokensVerifyTokenResponse] -type userTokenVerifyUserAPITokensVerifyTokenResponseJSON struct { - ID apijson.Field - Status apijson.Field - ExpiresOn apijson.Field - NotBefore apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserTokenVerifyUserAPITokensVerifyTokenResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Status of the token. -type UserTokenVerifyUserAPITokensVerifyTokenResponseStatus string - -const ( - UserTokenVerifyUserAPITokensVerifyTokenResponseStatusActive UserTokenVerifyUserAPITokensVerifyTokenResponseStatus = "active" - UserTokenVerifyUserAPITokensVerifyTokenResponseStatusDisabled UserTokenVerifyUserAPITokensVerifyTokenResponseStatus = "disabled" - UserTokenVerifyUserAPITokensVerifyTokenResponseStatusExpired UserTokenVerifyUserAPITokensVerifyTokenResponseStatus = "expired" -) - -type UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelope struct { - Errors []UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrors `json:"errors,required"` - Messages []UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessages `json:"messages,required"` - Result UserTokenVerifyUserAPITokensVerifyTokenResponse `json:"result,required"` - // Whether the API call was successful - Success UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeSuccess `json:"success,required"` - JSON userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeJSON `json:"-"` -} - -// userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelope] -type userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrorsJSON `json:"-"` -} - -// userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrors] -type userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessagesJSON `json:"-"` -} - -// userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessages] -type userTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeSuccess bool - -const ( - UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeSuccessTrue UserTokenVerifyUserAPITokensVerifyTokenResponseEnvelopeSuccess = true -) diff --git a/vectorizeindex.go b/vectorizeindex.go index ca903563c18..ccfb338687f 100644 --- a/vectorizeindex.go +++ b/vectorizeindex.go @@ -47,19 +47,6 @@ func (r *VectorizeIndexService) New(ctx context.Context, accountIdentifier strin return } -// Updates and returns the specified Vectorize Index. -func (r *VectorizeIndexService) Update(ctx context.Context, accountIdentifier string, indexName string, body VectorizeIndexUpdateParams, opts ...option.RequestOption) (res *VectorizeIndexUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env VectorizeIndexUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s", accountIdentifier, indexName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Returns a list of Vectorize Indexes func (r *VectorizeIndexService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]VectorizeIndexListResponse, err error) { opts = append(r.Options[:], opts...) @@ -86,19 +73,6 @@ func (r *VectorizeIndexService) Delete(ctx context.Context, accountIdentifier st return } -// Delete a set of vectors from an index by their vector identifiers. -func (r *VectorizeIndexService) DeleteByIDs(ctx context.Context, accountIdentifier string, indexName string, body VectorizeIndexDeleteByIDsParams, opts ...option.RequestOption) (res *VectorizeIndexDeleteByIDsResponse, err error) { - opts = append(r.Options[:], opts...) - var env VectorizeIndexDeleteByIDsResponseEnvelope - path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s/delete-by-ids", accountIdentifier, indexName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Returns the specified Vectorize Index. func (r *VectorizeIndexService) Get(ctx context.Context, accountIdentifier string, indexName string, opts ...option.RequestOption) (res *VectorizeIndexGetResponse, err error) { opts = append(r.Options[:], opts...) @@ -112,19 +86,6 @@ func (r *VectorizeIndexService) Get(ctx context.Context, accountIdentifier strin return } -// Get a set of vectors from an index by their vector identifiers. -func (r *VectorizeIndexService) GetByIDs(ctx context.Context, accountIdentifier string, indexName string, body VectorizeIndexGetByIDsParams, opts ...option.RequestOption) (res *VectorizeIndexGetByIDsResponse, err error) { - opts = append(r.Options[:], opts...) - var env VectorizeIndexGetByIDsResponseEnvelope - path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s/get-by-ids", accountIdentifier, indexName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Inserts vectors into the specified index and returns the count of the vectors // successfully inserted. func (r *VectorizeIndexService) Insert(ctx context.Context, accountIdentifier string, indexName string, opts ...option.RequestOption) (res *VectorizeIndexInsertResponse, err error) { @@ -152,6 +113,19 @@ func (r *VectorizeIndexService) Query(ctx context.Context, accountIdentifier str return } +// Updates and returns the specified Vectorize Index. +func (r *VectorizeIndexService) Replace(ctx context.Context, accountIdentifier string, indexName string, body VectorizeIndexReplaceParams, opts ...option.RequestOption) (res *VectorizeIndexReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env VectorizeIndexReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s", accountIdentifier, indexName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Upserts vectors into the specified index, creating them if they do not exist and // returns the count of values and ids successfully inserted. func (r *VectorizeIndexService) Upsert(ctx context.Context, accountIdentifier string, indexName string, opts ...option.RequestOption) (res *VectorizeIndexUpsertResponse, err error) { @@ -224,64 +198,6 @@ const ( VectorizeIndexNewResponseConfigMetricDotProduct VectorizeIndexNewResponseConfigMetric = "dot-product" ) -type VectorizeIndexUpdateResponse struct { - Config VectorizeIndexUpdateResponseConfig `json:"config"` - // Specifies the timestamp the resource was created as an ISO8601 string. - CreatedOn interface{} `json:"created_on"` - // Specifies the description of the index. - Description string `json:"description"` - // Specifies the timestamp the resource was modified as an ISO8601 string. - ModifiedOn interface{} `json:"modified_on"` - Name string `json:"name"` - JSON vectorizeIndexUpdateResponseJSON `json:"-"` -} - -// vectorizeIndexUpdateResponseJSON contains the JSON metadata for the struct -// [VectorizeIndexUpdateResponse] -type vectorizeIndexUpdateResponseJSON struct { - Config apijson.Field - CreatedOn apijson.Field - Description apijson.Field - ModifiedOn apijson.Field - Name apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexUpdateResponseConfig struct { - // Specifies the number of dimensions for the index - Dimensions int64 `json:"dimensions,required"` - // Specifies the type of metric to use calculating distance. - Metric VectorizeIndexUpdateResponseConfigMetric `json:"metric,required"` - JSON vectorizeIndexUpdateResponseConfigJSON `json:"-"` -} - -// vectorizeIndexUpdateResponseConfigJSON contains the JSON metadata for the struct -// [VectorizeIndexUpdateResponseConfig] -type vectorizeIndexUpdateResponseConfigJSON struct { - Dimensions apijson.Field - Metric apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexUpdateResponseConfig) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Specifies the type of metric to use calculating distance. -type VectorizeIndexUpdateResponseConfigMetric string - -const ( - VectorizeIndexUpdateResponseConfigMetricCosine VectorizeIndexUpdateResponseConfigMetric = "cosine" - VectorizeIndexUpdateResponseConfigMetricEuclidean VectorizeIndexUpdateResponseConfigMetric = "euclidean" - VectorizeIndexUpdateResponseConfigMetricDotProduct VectorizeIndexUpdateResponseConfigMetric = "dot-product" -) - type VectorizeIndexListResponse struct { Config VectorizeIndexListResponseConfig `json:"config"` // Specifies the timestamp the resource was created as an ISO8601 string. @@ -357,28 +273,6 @@ func init() { ) } -type VectorizeIndexDeleteByIDsResponse struct { - // The count of the vectors successfully deleted. - Count int64 `json:"count"` - // Array of vector identifiers of the vectors that were successfully processed for - // deletion. - IDs []string `json:"ids"` - JSON vectorizeIndexDeleteByIDsResponseJSON `json:"-"` -} - -// vectorizeIndexDeleteByIDsResponseJSON contains the JSON metadata for the struct -// [VectorizeIndexDeleteByIDsResponse] -type vectorizeIndexDeleteByIDsResponseJSON struct { - Count apijson.Field - IDs apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexDeleteByIDsResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - type VectorizeIndexGetResponse struct { Config VectorizeIndexGetResponseConfig `json:"config"` // Specifies the timestamp the resource was created as an ISO8601 string. @@ -437,8 +331,6 @@ const ( VectorizeIndexGetResponseConfigMetricDotProduct VectorizeIndexGetResponseConfigMetric = "dot-product" ) -type VectorizeIndexGetByIDsResponse = interface{} - type VectorizeIndexInsertResponse struct { // Specifies the count of the vectors successfully inserted. Count int64 `json:"count"` @@ -506,6 +398,64 @@ func (r *VectorizeIndexQueryResponseMatch) UnmarshalJSON(data []byte) (err error return apijson.UnmarshalRoot(data, r) } +type VectorizeIndexReplaceResponse struct { + Config VectorizeIndexReplaceResponseConfig `json:"config"` + // Specifies the timestamp the resource was created as an ISO8601 string. + CreatedOn interface{} `json:"created_on"` + // Specifies the description of the index. + Description string `json:"description"` + // Specifies the timestamp the resource was modified as an ISO8601 string. + ModifiedOn interface{} `json:"modified_on"` + Name string `json:"name"` + JSON vectorizeIndexReplaceResponseJSON `json:"-"` +} + +// vectorizeIndexReplaceResponseJSON contains the JSON metadata for the struct +// [VectorizeIndexReplaceResponse] +type vectorizeIndexReplaceResponseJSON struct { + Config apijson.Field + CreatedOn apijson.Field + Description apijson.Field + ModifiedOn apijson.Field + Name apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *VectorizeIndexReplaceResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type VectorizeIndexReplaceResponseConfig struct { + // Specifies the number of dimensions for the index + Dimensions int64 `json:"dimensions,required"` + // Specifies the type of metric to use calculating distance. + Metric VectorizeIndexReplaceResponseConfigMetric `json:"metric,required"` + JSON vectorizeIndexReplaceResponseConfigJSON `json:"-"` +} + +// vectorizeIndexReplaceResponseConfigJSON contains the JSON metadata for the +// struct [VectorizeIndexReplaceResponseConfig] +type vectorizeIndexReplaceResponseConfigJSON struct { + Dimensions apijson.Field + Metric apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *VectorizeIndexReplaceResponseConfig) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Specifies the type of metric to use calculating distance. +type VectorizeIndexReplaceResponseConfigMetric string + +const ( + VectorizeIndexReplaceResponseConfigMetricCosine VectorizeIndexReplaceResponseConfigMetric = "cosine" + VectorizeIndexReplaceResponseConfigMetricEuclidean VectorizeIndexReplaceResponseConfigMetric = "euclidean" + VectorizeIndexReplaceResponseConfigMetricDotProduct VectorizeIndexReplaceResponseConfigMetric = "dot-product" +) + type VectorizeIndexUpsertResponse struct { // Specifies the count of the vectors successfully inserted. Count int64 `json:"count"` @@ -662,84 +612,6 @@ const ( VectorizeIndexNewResponseEnvelopeSuccessTrue VectorizeIndexNewResponseEnvelopeSuccess = true ) -type VectorizeIndexUpdateParams struct { - // Specifies the description of the index. - Description param.Field[string] `json:"description,required"` -} - -func (r VectorizeIndexUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type VectorizeIndexUpdateResponseEnvelope struct { - Errors []VectorizeIndexUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []VectorizeIndexUpdateResponseEnvelopeMessages `json:"messages,required"` - Result VectorizeIndexUpdateResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success VectorizeIndexUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON vectorizeIndexUpdateResponseEnvelopeJSON `json:"-"` -} - -// vectorizeIndexUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [VectorizeIndexUpdateResponseEnvelope] -type vectorizeIndexUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// vectorizeIndexUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [VectorizeIndexUpdateResponseEnvelopeErrors] -type vectorizeIndexUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// vectorizeIndexUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [VectorizeIndexUpdateResponseEnvelopeMessages] -type vectorizeIndexUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type VectorizeIndexUpdateResponseEnvelopeSuccess bool - -const ( - VectorizeIndexUpdateResponseEnvelopeSuccessTrue VectorizeIndexUpdateResponseEnvelopeSuccess = true -) - type VectorizeIndexListResponseEnvelope struct { Errors []VectorizeIndexListResponseEnvelopeErrors `json:"errors,required"` Messages []VectorizeIndexListResponseEnvelopeMessages `json:"messages,required"` @@ -878,84 +750,6 @@ const ( VectorizeIndexDeleteResponseEnvelopeSuccessTrue VectorizeIndexDeleteResponseEnvelopeSuccess = true ) -type VectorizeIndexDeleteByIDsParams struct { - // A list of vector identifiers to delete from the index indicated by the path. - IDs param.Field[[]string] `json:"ids"` -} - -func (r VectorizeIndexDeleteByIDsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type VectorizeIndexDeleteByIDsResponseEnvelope struct { - Errors []VectorizeIndexDeleteByIDsResponseEnvelopeErrors `json:"errors,required"` - Messages []VectorizeIndexDeleteByIDsResponseEnvelopeMessages `json:"messages,required"` - Result VectorizeIndexDeleteByIDsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success VectorizeIndexDeleteByIDsResponseEnvelopeSuccess `json:"success,required"` - JSON vectorizeIndexDeleteByIDsResponseEnvelopeJSON `json:"-"` -} - -// vectorizeIndexDeleteByIDsResponseEnvelopeJSON contains the JSON metadata for the -// struct [VectorizeIndexDeleteByIDsResponseEnvelope] -type vectorizeIndexDeleteByIDsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexDeleteByIDsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexDeleteByIDsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexDeleteByIDsResponseEnvelopeErrorsJSON `json:"-"` -} - -// vectorizeIndexDeleteByIDsResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [VectorizeIndexDeleteByIDsResponseEnvelopeErrors] -type vectorizeIndexDeleteByIDsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexDeleteByIDsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexDeleteByIDsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexDeleteByIDsResponseEnvelopeMessagesJSON `json:"-"` -} - -// vectorizeIndexDeleteByIDsResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [VectorizeIndexDeleteByIDsResponseEnvelopeMessages] -type vectorizeIndexDeleteByIDsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexDeleteByIDsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type VectorizeIndexDeleteByIDsResponseEnvelopeSuccess bool - -const ( - VectorizeIndexDeleteByIDsResponseEnvelopeSuccessTrue VectorizeIndexDeleteByIDsResponseEnvelopeSuccess = true -) - type VectorizeIndexGetResponseEnvelope struct { Errors []VectorizeIndexGetResponseEnvelopeErrors `json:"errors,required"` Messages []VectorizeIndexGetResponseEnvelopeMessages `json:"messages,required"` @@ -1025,85 +819,6 @@ const ( VectorizeIndexGetResponseEnvelopeSuccessTrue VectorizeIndexGetResponseEnvelopeSuccess = true ) -type VectorizeIndexGetByIDsParams struct { - // A list of vector identifiers to retrieve from the index indicated by the path. - IDs param.Field[[]string] `json:"ids"` -} - -func (r VectorizeIndexGetByIDsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type VectorizeIndexGetByIDsResponseEnvelope struct { - Errors []VectorizeIndexGetByIDsResponseEnvelopeErrors `json:"errors,required"` - Messages []VectorizeIndexGetByIDsResponseEnvelopeMessages `json:"messages,required"` - // Array of vectors with matching ids. - Result VectorizeIndexGetByIDsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success VectorizeIndexGetByIDsResponseEnvelopeSuccess `json:"success,required"` - JSON vectorizeIndexGetByIDsResponseEnvelopeJSON `json:"-"` -} - -// vectorizeIndexGetByIDsResponseEnvelopeJSON contains the JSON metadata for the -// struct [VectorizeIndexGetByIDsResponseEnvelope] -type vectorizeIndexGetByIDsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexGetByIDsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexGetByIDsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexGetByIDsResponseEnvelopeErrorsJSON `json:"-"` -} - -// vectorizeIndexGetByIDsResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [VectorizeIndexGetByIDsResponseEnvelopeErrors] -type vectorizeIndexGetByIDsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexGetByIDsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type VectorizeIndexGetByIDsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON vectorizeIndexGetByIDsResponseEnvelopeMessagesJSON `json:"-"` -} - -// vectorizeIndexGetByIDsResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [VectorizeIndexGetByIDsResponseEnvelopeMessages] -type vectorizeIndexGetByIDsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *VectorizeIndexGetByIDsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type VectorizeIndexGetByIDsResponseEnvelopeSuccess bool - -const ( - VectorizeIndexGetByIDsResponseEnvelopeSuccessTrue VectorizeIndexGetByIDsResponseEnvelopeSuccess = true -) - type VectorizeIndexInsertResponseEnvelope struct { Errors []VectorizeIndexInsertResponseEnvelopeErrors `json:"errors,required"` Messages []VectorizeIndexInsertResponseEnvelopeMessages `json:"messages,required"` @@ -1257,6 +972,84 @@ const ( VectorizeIndexQueryResponseEnvelopeSuccessTrue VectorizeIndexQueryResponseEnvelopeSuccess = true ) +type VectorizeIndexReplaceParams struct { + // Specifies the description of the index. + Description param.Field[string] `json:"description,required"` +} + +func (r VectorizeIndexReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type VectorizeIndexReplaceResponseEnvelope struct { + Errors []VectorizeIndexReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []VectorizeIndexReplaceResponseEnvelopeMessages `json:"messages,required"` + Result VectorizeIndexReplaceResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success VectorizeIndexReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON vectorizeIndexReplaceResponseEnvelopeJSON `json:"-"` +} + +// vectorizeIndexReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [VectorizeIndexReplaceResponseEnvelope] +type vectorizeIndexReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *VectorizeIndexReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type VectorizeIndexReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON vectorizeIndexReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// vectorizeIndexReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [VectorizeIndexReplaceResponseEnvelopeErrors] +type vectorizeIndexReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *VectorizeIndexReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type VectorizeIndexReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON vectorizeIndexReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// vectorizeIndexReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [VectorizeIndexReplaceResponseEnvelopeMessages] +type vectorizeIndexReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *VectorizeIndexReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type VectorizeIndexReplaceResponseEnvelopeSuccess bool + +const ( + VectorizeIndexReplaceResponseEnvelopeSuccessTrue VectorizeIndexReplaceResponseEnvelopeSuccess = true +) + type VectorizeIndexUpsertResponseEnvelope struct { Errors []VectorizeIndexUpsertResponseEnvelopeErrors `json:"errors,required"` Messages []VectorizeIndexUpsertResponseEnvelopeMessages `json:"messages,required"` diff --git a/vectorizeindex_test.go b/vectorizeindex_test.go index e3244169464..e189b54f147 100644 --- a/vectorizeindex_test.go +++ b/vectorizeindex_test.go @@ -49,39 +49,6 @@ func TestVectorizeIndexNewWithOptionalParams(t *testing.T) { } } -func TestVectorizeIndexUpdate(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Vectorize.Indexes.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example-index", - cloudflare.VectorizeIndexUpdateParams{ - Description: cloudflare.F("This is my example index."), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - func TestVectorizeIndexList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -138,39 +105,6 @@ func TestVectorizeIndexDelete(t *testing.T) { } } -func TestVectorizeIndexDeleteByIDsWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Vectorize.Indexes.DeleteByIDs( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "example-index", - cloudflare.VectorizeIndexDeleteByIDsParams{ - IDs: cloudflare.F([]string{"5121db81354a40c6aedc3fe1ace51c59", "f90eb49c2107486abdfd78c67e853430"}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - func TestVectorizeIndexGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" @@ -201,7 +135,7 @@ func TestVectorizeIndexGet(t *testing.T) { } } -func TestVectorizeIndexGetByIDsWithOptionalParams(t *testing.T) { +func TestVectorizeIndexInsert(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -217,13 +151,10 @@ func TestVectorizeIndexGetByIDsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Vectorize.Indexes.GetByIDs( + _, err := client.Vectorize.Indexes.Insert( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-index", - cloudflare.VectorizeIndexGetByIDsParams{ - IDs: cloudflare.F([]string{"5121db81354a40c6aedc3fe1ace51c59", "f90eb49c2107486abdfd78c67e853430"}), - }, ) if err != nil { var apierr *cloudflare.Error @@ -234,7 +165,7 @@ func TestVectorizeIndexGetByIDsWithOptionalParams(t *testing.T) { } } -func TestVectorizeIndexInsert(t *testing.T) { +func TestVectorizeIndexQueryWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -250,10 +181,16 @@ func TestVectorizeIndexInsert(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Vectorize.Indexes.Insert( + _, err := client.Vectorize.Indexes.Query( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-index", + cloudflare.VectorizeIndexQueryParams{ + ReturnMetadata: cloudflare.F(true), + ReturnValues: cloudflare.F(true), + TopK: cloudflare.F(5.000000), + Vector: cloudflare.F([]float64{0.500000, 0.500000, 0.500000}), + }, ) if err != nil { var apierr *cloudflare.Error @@ -264,7 +201,7 @@ func TestVectorizeIndexInsert(t *testing.T) { } } -func TestVectorizeIndexQueryWithOptionalParams(t *testing.T) { +func TestVectorizeIndexReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -280,15 +217,12 @@ func TestVectorizeIndexQueryWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Vectorize.Indexes.Query( + _, err := client.Vectorize.Indexes.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-index", - cloudflare.VectorizeIndexQueryParams{ - ReturnMetadata: cloudflare.F(true), - ReturnValues: cloudflare.F(true), - TopK: cloudflare.F(5.000000), - Vector: cloudflare.F([]float64{0.500000, 0.500000, 0.500000}), + cloudflare.VectorizeIndexReplaceParams{ + Description: cloudflare.F("This is my example index."), }, ) if err != nil { diff --git a/waitingroom.go b/waitingroom.go index 844e3a1ee10..2f579968709 100644 --- a/waitingroom.go +++ b/waitingroom.go @@ -21,7 +21,6 @@ import ( // instead. type WaitingRoomService struct { Options []option.RequestOption - Previews *WaitingRoomPreviewService Events *WaitingRoomEventService Rules *WaitingRoomRuleService Statuses *WaitingRoomStatusService @@ -34,7 +33,6 @@ type WaitingRoomService struct { func NewWaitingRoomService(opts ...option.RequestOption) (r *WaitingRoomService) { r = &WaitingRoomService{} r.Options = opts - r.Previews = NewWaitingRoomPreviewService(opts...) r.Events = NewWaitingRoomEventService(opts...) r.Rules = NewWaitingRoomRuleService(opts...) r.Statuses = NewWaitingRoomStatusService(opts...) @@ -55,19 +53,6 @@ func (r *WaitingRoomService) New(ctx context.Context, zoneIdentifier string, bod return } -// Updates a configured waiting room. -func (r *WaitingRoomService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomUpdateParams, opts ...option.RequestOption) (res *WaitingRoomUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env WaitingRoomUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v", zoneIdentifier, waitingRoomID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - // Lists waiting rooms. func (r *WaitingRoomService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]WaitingRoomListResponse, err error) { opts = append(r.Options[:], opts...) @@ -107,6 +92,67 @@ func (r *WaitingRoomService) Get(ctx context.Context, zoneIdentifier string, wai return } +// Creates a waiting room page preview. Upload a custom waiting room page for +// preview. You will receive a preview URL in the form +// `http://waitingrooms.dev/preview/`. You can use the following query +// parameters to change the state of the preview: +// +// 1. `force_queue`: Boolean indicating if all users will be queued in the waiting +// room and no one will be let into the origin website (also known as queueAll). +// 2. `queue_is_full`: Boolean indicating if the waiting room's queue is currently +// full and not accepting new users at the moment. +// 3. `queueing_method`: The queueing method currently used by the waiting room. +// - **fifo** indicates a FIFO queue. +// - **random** indicates a Random queue. +// - **passthrough** indicates a Passthrough queue. Keep in mind that the +// waiting room page will only be displayed if `force_queue=true` or +// `event=prequeueing` — for other cases the request will pass through to the +// origin. For our preview, this will be a fake origin website returning +// "Welcome". +// - **reject** indicates a Reject queue. +// 4. `event`: Used to preview a waiting room event. +// - **none** indicates no event is occurring. +// - **prequeueing** indicates that an event is prequeueing (between +// `prequeue_start_time` and `event_start_time`). +// - **started** indicates that an event has started (between `event_start_time` +// and `event_end_time`). +// 5. `shuffle_at_event_start`: Boolean indicating if the event will shuffle users +// in the prequeue when it starts. This can only be set to **true** if an event +// is active (`event` is not **none**). +// +// For example, you can make a request to +// `http://waitingrooms.dev/preview/?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6. +// `waitTime`: Non-zero, positive integer indicating the estimated wait time in +// minutes. The default value is 10 minutes. +// +// For example, you can make a request to +// `http://waitingrooms.dev/preview/?waitTime=50` to configure the estimated +// wait time as 50 minutes. +func (r *WaitingRoomService) Preview(ctx context.Context, zoneIdentifier string, body WaitingRoomPreviewParams, opts ...option.RequestOption) (res *WaitingRoomPreviewResponse, err error) { + opts = append(r.Options[:], opts...) + var env WaitingRoomPreviewResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/preview", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Updates a configured waiting room. +func (r *WaitingRoomService) Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomReplaceParams, opts ...option.RequestOption) (res *WaitingRoomReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env WaitingRoomReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v", zoneIdentifier, waitingRoomID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + type WaitingRoomNewResponse struct { ID interface{} `json:"id"` // Only available for the Waiting Room Advanced subscription. Additional hostname @@ -557,16 +603,16 @@ const ( WaitingRoomNewResponseQueueingStatusCode429 WaitingRoomNewResponseQueueingStatusCode = 429 ) -type WaitingRoomUpdateResponse struct { +type WaitingRoomListResponse struct { ID interface{} `json:"id"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. - AdditionalRoutes []WaitingRoomUpdateResponseAdditionalRoute `json:"additional_routes"` + AdditionalRoutes []WaitingRoomListResponseAdditionalRoute `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. - CookieAttributes WaitingRoomUpdateResponseCookieAttributes `json:"cookie_attributes"` + CookieAttributes WaitingRoomListResponseCookieAttributes `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. @@ -596,7 +642,7 @@ type WaitingRoomUpdateResponse struct { CustomPageHTML string `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. - DefaultTemplateLanguage WaitingRoomUpdateResponseDefaultTemplateLanguage `json:"default_template_language"` + DefaultTemplateLanguage WaitingRoomListResponseDefaultTemplateLanguage `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description string `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic @@ -804,9 +850,9 @@ type WaitingRoomUpdateResponse struct { // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. - QueueingMethod WaitingRoomUpdateResponseQueueingMethod `json:"queueing_method"` + QueueingMethod WaitingRoomListResponseQueueingMethod `json:"queueing_method"` // HTTP status code returned to a user while in the queue. - QueueingStatusCode WaitingRoomUpdateResponseQueueingStatusCode `json:"queueing_status_code"` + QueueingStatusCode WaitingRoomListResponseQueueingStatusCode `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. @@ -820,13 +866,13 @@ type WaitingRoomUpdateResponse struct { // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. - TotalActiveUsers int64 `json:"total_active_users"` - JSON waitingRoomUpdateResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users"` + JSON waitingRoomListResponseJSON `json:"-"` } -// waitingRoomUpdateResponseJSON contains the JSON metadata for the struct -// [WaitingRoomUpdateResponse] -type waitingRoomUpdateResponseJSON struct { +// waitingRoomListResponseJSON contains the JSON metadata for the struct +// [WaitingRoomListResponse] +type waitingRoomListResponseJSON struct { ID apijson.Field AdditionalRoutes apijson.Field CookieAttributes apijson.Field @@ -854,11 +900,11 @@ type waitingRoomUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomUpdateResponseAdditionalRoute struct { +type WaitingRoomListResponseAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). @@ -867,49 +913,49 @@ type WaitingRoomUpdateResponseAdditionalRoute struct { // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. - Path string `json:"path"` - JSON waitingRoomUpdateResponseAdditionalRouteJSON `json:"-"` + Path string `json:"path"` + JSON waitingRoomListResponseAdditionalRouteJSON `json:"-"` } -// waitingRoomUpdateResponseAdditionalRouteJSON contains the JSON metadata for the -// struct [WaitingRoomUpdateResponseAdditionalRoute] -type waitingRoomUpdateResponseAdditionalRouteJSON struct { +// waitingRoomListResponseAdditionalRouteJSON contains the JSON metadata for the +// struct [WaitingRoomListResponseAdditionalRoute] +type waitingRoomListResponseAdditionalRouteJSON struct { Host apijson.Field Path apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomUpdateResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomListResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. -type WaitingRoomUpdateResponseCookieAttributes struct { +type WaitingRoomListResponseCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. - Samesite WaitingRoomUpdateResponseCookieAttributesSamesite `json:"samesite"` + Samesite WaitingRoomListResponseCookieAttributesSamesite `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. - Secure WaitingRoomUpdateResponseCookieAttributesSecure `json:"secure"` - JSON waitingRoomUpdateResponseCookieAttributesJSON `json:"-"` + Secure WaitingRoomListResponseCookieAttributesSecure `json:"secure"` + JSON waitingRoomListResponseCookieAttributesJSON `json:"-"` } -// waitingRoomUpdateResponseCookieAttributesJSON contains the JSON metadata for the -// struct [WaitingRoomUpdateResponseCookieAttributes] -type waitingRoomUpdateResponseCookieAttributesJSON struct { +// waitingRoomListResponseCookieAttributesJSON contains the JSON metadata for the +// struct [WaitingRoomListResponseCookieAttributes] +type waitingRoomListResponseCookieAttributesJSON struct { Samesite apijson.Field Secure apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomUpdateResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomListResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -917,49 +963,49 @@ func (r *WaitingRoomUpdateResponseCookieAttributes) UnmarshalJSON(data []byte) ( // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. -type WaitingRoomUpdateResponseCookieAttributesSamesite string +type WaitingRoomListResponseCookieAttributesSamesite string const ( - WaitingRoomUpdateResponseCookieAttributesSamesiteAuto WaitingRoomUpdateResponseCookieAttributesSamesite = "auto" - WaitingRoomUpdateResponseCookieAttributesSamesiteLax WaitingRoomUpdateResponseCookieAttributesSamesite = "lax" - WaitingRoomUpdateResponseCookieAttributesSamesiteNone WaitingRoomUpdateResponseCookieAttributesSamesite = "none" - WaitingRoomUpdateResponseCookieAttributesSamesiteStrict WaitingRoomUpdateResponseCookieAttributesSamesite = "strict" + WaitingRoomListResponseCookieAttributesSamesiteAuto WaitingRoomListResponseCookieAttributesSamesite = "auto" + WaitingRoomListResponseCookieAttributesSamesiteLax WaitingRoomListResponseCookieAttributesSamesite = "lax" + WaitingRoomListResponseCookieAttributesSamesiteNone WaitingRoomListResponseCookieAttributesSamesite = "none" + WaitingRoomListResponseCookieAttributesSamesiteStrict WaitingRoomListResponseCookieAttributesSamesite = "strict" ) // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. -type WaitingRoomUpdateResponseCookieAttributesSecure string +type WaitingRoomListResponseCookieAttributesSecure string const ( - WaitingRoomUpdateResponseCookieAttributesSecureAuto WaitingRoomUpdateResponseCookieAttributesSecure = "auto" - WaitingRoomUpdateResponseCookieAttributesSecureAlways WaitingRoomUpdateResponseCookieAttributesSecure = "always" - WaitingRoomUpdateResponseCookieAttributesSecureNever WaitingRoomUpdateResponseCookieAttributesSecure = "never" + WaitingRoomListResponseCookieAttributesSecureAuto WaitingRoomListResponseCookieAttributesSecure = "auto" + WaitingRoomListResponseCookieAttributesSecureAlways WaitingRoomListResponseCookieAttributesSecure = "always" + WaitingRoomListResponseCookieAttributesSecureNever WaitingRoomListResponseCookieAttributesSecure = "never" ) // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. -type WaitingRoomUpdateResponseDefaultTemplateLanguage string +type WaitingRoomListResponseDefaultTemplateLanguage string const ( - WaitingRoomUpdateResponseDefaultTemplateLanguageEnUs WaitingRoomUpdateResponseDefaultTemplateLanguage = "en-US" - WaitingRoomUpdateResponseDefaultTemplateLanguageEsEs WaitingRoomUpdateResponseDefaultTemplateLanguage = "es-ES" - WaitingRoomUpdateResponseDefaultTemplateLanguageDeDe WaitingRoomUpdateResponseDefaultTemplateLanguage = "de-DE" - WaitingRoomUpdateResponseDefaultTemplateLanguageFrFr WaitingRoomUpdateResponseDefaultTemplateLanguage = "fr-FR" - WaitingRoomUpdateResponseDefaultTemplateLanguageItIt WaitingRoomUpdateResponseDefaultTemplateLanguage = "it-IT" - WaitingRoomUpdateResponseDefaultTemplateLanguageJaJp WaitingRoomUpdateResponseDefaultTemplateLanguage = "ja-JP" - WaitingRoomUpdateResponseDefaultTemplateLanguageKoKr WaitingRoomUpdateResponseDefaultTemplateLanguage = "ko-KR" - WaitingRoomUpdateResponseDefaultTemplateLanguagePtBr WaitingRoomUpdateResponseDefaultTemplateLanguage = "pt-BR" - WaitingRoomUpdateResponseDefaultTemplateLanguageZhCn WaitingRoomUpdateResponseDefaultTemplateLanguage = "zh-CN" - WaitingRoomUpdateResponseDefaultTemplateLanguageZhTw WaitingRoomUpdateResponseDefaultTemplateLanguage = "zh-TW" - WaitingRoomUpdateResponseDefaultTemplateLanguageNlNl WaitingRoomUpdateResponseDefaultTemplateLanguage = "nl-NL" - WaitingRoomUpdateResponseDefaultTemplateLanguagePlPl WaitingRoomUpdateResponseDefaultTemplateLanguage = "pl-PL" - WaitingRoomUpdateResponseDefaultTemplateLanguageIDID WaitingRoomUpdateResponseDefaultTemplateLanguage = "id-ID" - WaitingRoomUpdateResponseDefaultTemplateLanguageTrTr WaitingRoomUpdateResponseDefaultTemplateLanguage = "tr-TR" - WaitingRoomUpdateResponseDefaultTemplateLanguageArEg WaitingRoomUpdateResponseDefaultTemplateLanguage = "ar-EG" - WaitingRoomUpdateResponseDefaultTemplateLanguageRuRu WaitingRoomUpdateResponseDefaultTemplateLanguage = "ru-RU" - WaitingRoomUpdateResponseDefaultTemplateLanguageFaIr WaitingRoomUpdateResponseDefaultTemplateLanguage = "fa-IR" + WaitingRoomListResponseDefaultTemplateLanguageEnUs WaitingRoomListResponseDefaultTemplateLanguage = "en-US" + WaitingRoomListResponseDefaultTemplateLanguageEsEs WaitingRoomListResponseDefaultTemplateLanguage = "es-ES" + WaitingRoomListResponseDefaultTemplateLanguageDeDe WaitingRoomListResponseDefaultTemplateLanguage = "de-DE" + WaitingRoomListResponseDefaultTemplateLanguageFrFr WaitingRoomListResponseDefaultTemplateLanguage = "fr-FR" + WaitingRoomListResponseDefaultTemplateLanguageItIt WaitingRoomListResponseDefaultTemplateLanguage = "it-IT" + WaitingRoomListResponseDefaultTemplateLanguageJaJp WaitingRoomListResponseDefaultTemplateLanguage = "ja-JP" + WaitingRoomListResponseDefaultTemplateLanguageKoKr WaitingRoomListResponseDefaultTemplateLanguage = "ko-KR" + WaitingRoomListResponseDefaultTemplateLanguagePtBr WaitingRoomListResponseDefaultTemplateLanguage = "pt-BR" + WaitingRoomListResponseDefaultTemplateLanguageZhCn WaitingRoomListResponseDefaultTemplateLanguage = "zh-CN" + WaitingRoomListResponseDefaultTemplateLanguageZhTw WaitingRoomListResponseDefaultTemplateLanguage = "zh-TW" + WaitingRoomListResponseDefaultTemplateLanguageNlNl WaitingRoomListResponseDefaultTemplateLanguage = "nl-NL" + WaitingRoomListResponseDefaultTemplateLanguagePlPl WaitingRoomListResponseDefaultTemplateLanguage = "pl-PL" + WaitingRoomListResponseDefaultTemplateLanguageIDID WaitingRoomListResponseDefaultTemplateLanguage = "id-ID" + WaitingRoomListResponseDefaultTemplateLanguageTrTr WaitingRoomListResponseDefaultTemplateLanguage = "tr-TR" + WaitingRoomListResponseDefaultTemplateLanguageArEg WaitingRoomListResponseDefaultTemplateLanguage = "ar-EG" + WaitingRoomListResponseDefaultTemplateLanguageRuRu WaitingRoomListResponseDefaultTemplateLanguage = "ru-RU" + WaitingRoomListResponseDefaultTemplateLanguageFaIr WaitingRoomListResponseDefaultTemplateLanguage = "fa-IR" ) // Sets the queueing method used by the waiting room. Changing this parameter from @@ -989,34 +1035,51 @@ const ( // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. -type WaitingRoomUpdateResponseQueueingMethod string +type WaitingRoomListResponseQueueingMethod string const ( - WaitingRoomUpdateResponseQueueingMethodFifo WaitingRoomUpdateResponseQueueingMethod = "fifo" - WaitingRoomUpdateResponseQueueingMethodRandom WaitingRoomUpdateResponseQueueingMethod = "random" - WaitingRoomUpdateResponseQueueingMethodPassthrough WaitingRoomUpdateResponseQueueingMethod = "passthrough" - WaitingRoomUpdateResponseQueueingMethodReject WaitingRoomUpdateResponseQueueingMethod = "reject" + WaitingRoomListResponseQueueingMethodFifo WaitingRoomListResponseQueueingMethod = "fifo" + WaitingRoomListResponseQueueingMethodRandom WaitingRoomListResponseQueueingMethod = "random" + WaitingRoomListResponseQueueingMethodPassthrough WaitingRoomListResponseQueueingMethod = "passthrough" + WaitingRoomListResponseQueueingMethodReject WaitingRoomListResponseQueueingMethod = "reject" ) // HTTP status code returned to a user while in the queue. -type WaitingRoomUpdateResponseQueueingStatusCode int64 +type WaitingRoomListResponseQueueingStatusCode int64 const ( - WaitingRoomUpdateResponseQueueingStatusCode200 WaitingRoomUpdateResponseQueueingStatusCode = 200 - WaitingRoomUpdateResponseQueueingStatusCode202 WaitingRoomUpdateResponseQueueingStatusCode = 202 - WaitingRoomUpdateResponseQueueingStatusCode429 WaitingRoomUpdateResponseQueueingStatusCode = 429 + WaitingRoomListResponseQueueingStatusCode200 WaitingRoomListResponseQueueingStatusCode = 200 + WaitingRoomListResponseQueueingStatusCode202 WaitingRoomListResponseQueueingStatusCode = 202 + WaitingRoomListResponseQueueingStatusCode429 WaitingRoomListResponseQueueingStatusCode = 429 ) -type WaitingRoomListResponse struct { +type WaitingRoomDeleteResponse struct { + ID interface{} `json:"id"` + JSON waitingRoomDeleteResponseJSON `json:"-"` +} + +// waitingRoomDeleteResponseJSON contains the JSON metadata for the struct +// [WaitingRoomDeleteResponse] +type waitingRoomDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomGetResponse struct { ID interface{} `json:"id"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. - AdditionalRoutes []WaitingRoomListResponseAdditionalRoute `json:"additional_routes"` + AdditionalRoutes []WaitingRoomGetResponseAdditionalRoute `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. - CookieAttributes WaitingRoomListResponseCookieAttributes `json:"cookie_attributes"` + CookieAttributes WaitingRoomGetResponseCookieAttributes `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. @@ -1046,7 +1109,7 @@ type WaitingRoomListResponse struct { CustomPageHTML string `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. - DefaultTemplateLanguage WaitingRoomListResponseDefaultTemplateLanguage `json:"default_template_language"` + DefaultTemplateLanguage WaitingRoomGetResponseDefaultTemplateLanguage `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description string `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic @@ -1254,9 +1317,9 @@ type WaitingRoomListResponse struct { // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. - QueueingMethod WaitingRoomListResponseQueueingMethod `json:"queueing_method"` + QueueingMethod WaitingRoomGetResponseQueueingMethod `json:"queueing_method"` // HTTP status code returned to a user while in the queue. - QueueingStatusCode WaitingRoomListResponseQueueingStatusCode `json:"queueing_status_code"` + QueueingStatusCode WaitingRoomGetResponseQueueingStatusCode `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. @@ -1270,13 +1333,13 @@ type WaitingRoomListResponse struct { // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. - TotalActiveUsers int64 `json:"total_active_users"` - JSON waitingRoomListResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users"` + JSON waitingRoomGetResponseJSON `json:"-"` } -// waitingRoomListResponseJSON contains the JSON metadata for the struct -// [WaitingRoomListResponse] -type waitingRoomListResponseJSON struct { +// waitingRoomGetResponseJSON contains the JSON metadata for the struct +// [WaitingRoomGetResponse] +type waitingRoomGetResponseJSON struct { ID apijson.Field AdditionalRoutes apijson.Field CookieAttributes apijson.Field @@ -1304,11 +1367,11 @@ type waitingRoomListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomListResponseAdditionalRoute struct { +type WaitingRoomGetResponseAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). @@ -1317,49 +1380,49 @@ type WaitingRoomListResponseAdditionalRoute struct { // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. - Path string `json:"path"` - JSON waitingRoomListResponseAdditionalRouteJSON `json:"-"` + Path string `json:"path"` + JSON waitingRoomGetResponseAdditionalRouteJSON `json:"-"` } -// waitingRoomListResponseAdditionalRouteJSON contains the JSON metadata for the -// struct [WaitingRoomListResponseAdditionalRoute] -type waitingRoomListResponseAdditionalRouteJSON struct { +// waitingRoomGetResponseAdditionalRouteJSON contains the JSON metadata for the +// struct [WaitingRoomGetResponseAdditionalRoute] +type waitingRoomGetResponseAdditionalRouteJSON struct { Host apijson.Field Path apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomListResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomGetResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. -type WaitingRoomListResponseCookieAttributes struct { +type WaitingRoomGetResponseCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. - Samesite WaitingRoomListResponseCookieAttributesSamesite `json:"samesite"` + Samesite WaitingRoomGetResponseCookieAttributesSamesite `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. - Secure WaitingRoomListResponseCookieAttributesSecure `json:"secure"` - JSON waitingRoomListResponseCookieAttributesJSON `json:"-"` + Secure WaitingRoomGetResponseCookieAttributesSecure `json:"secure"` + JSON waitingRoomGetResponseCookieAttributesJSON `json:"-"` } -// waitingRoomListResponseCookieAttributesJSON contains the JSON metadata for the -// struct [WaitingRoomListResponseCookieAttributes] -type waitingRoomListResponseCookieAttributesJSON struct { +// waitingRoomGetResponseCookieAttributesJSON contains the JSON metadata for the +// struct [WaitingRoomGetResponseCookieAttributes] +type waitingRoomGetResponseCookieAttributesJSON struct { Samesite apijson.Field Secure apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomListResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomGetResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1367,49 +1430,49 @@ func (r *WaitingRoomListResponseCookieAttributes) UnmarshalJSON(data []byte) (er // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. -type WaitingRoomListResponseCookieAttributesSamesite string +type WaitingRoomGetResponseCookieAttributesSamesite string const ( - WaitingRoomListResponseCookieAttributesSamesiteAuto WaitingRoomListResponseCookieAttributesSamesite = "auto" - WaitingRoomListResponseCookieAttributesSamesiteLax WaitingRoomListResponseCookieAttributesSamesite = "lax" - WaitingRoomListResponseCookieAttributesSamesiteNone WaitingRoomListResponseCookieAttributesSamesite = "none" - WaitingRoomListResponseCookieAttributesSamesiteStrict WaitingRoomListResponseCookieAttributesSamesite = "strict" + WaitingRoomGetResponseCookieAttributesSamesiteAuto WaitingRoomGetResponseCookieAttributesSamesite = "auto" + WaitingRoomGetResponseCookieAttributesSamesiteLax WaitingRoomGetResponseCookieAttributesSamesite = "lax" + WaitingRoomGetResponseCookieAttributesSamesiteNone WaitingRoomGetResponseCookieAttributesSamesite = "none" + WaitingRoomGetResponseCookieAttributesSamesiteStrict WaitingRoomGetResponseCookieAttributesSamesite = "strict" ) // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. -type WaitingRoomListResponseCookieAttributesSecure string +type WaitingRoomGetResponseCookieAttributesSecure string const ( - WaitingRoomListResponseCookieAttributesSecureAuto WaitingRoomListResponseCookieAttributesSecure = "auto" - WaitingRoomListResponseCookieAttributesSecureAlways WaitingRoomListResponseCookieAttributesSecure = "always" - WaitingRoomListResponseCookieAttributesSecureNever WaitingRoomListResponseCookieAttributesSecure = "never" + WaitingRoomGetResponseCookieAttributesSecureAuto WaitingRoomGetResponseCookieAttributesSecure = "auto" + WaitingRoomGetResponseCookieAttributesSecureAlways WaitingRoomGetResponseCookieAttributesSecure = "always" + WaitingRoomGetResponseCookieAttributesSecureNever WaitingRoomGetResponseCookieAttributesSecure = "never" ) // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. -type WaitingRoomListResponseDefaultTemplateLanguage string +type WaitingRoomGetResponseDefaultTemplateLanguage string const ( - WaitingRoomListResponseDefaultTemplateLanguageEnUs WaitingRoomListResponseDefaultTemplateLanguage = "en-US" - WaitingRoomListResponseDefaultTemplateLanguageEsEs WaitingRoomListResponseDefaultTemplateLanguage = "es-ES" - WaitingRoomListResponseDefaultTemplateLanguageDeDe WaitingRoomListResponseDefaultTemplateLanguage = "de-DE" - WaitingRoomListResponseDefaultTemplateLanguageFrFr WaitingRoomListResponseDefaultTemplateLanguage = "fr-FR" - WaitingRoomListResponseDefaultTemplateLanguageItIt WaitingRoomListResponseDefaultTemplateLanguage = "it-IT" - WaitingRoomListResponseDefaultTemplateLanguageJaJp WaitingRoomListResponseDefaultTemplateLanguage = "ja-JP" - WaitingRoomListResponseDefaultTemplateLanguageKoKr WaitingRoomListResponseDefaultTemplateLanguage = "ko-KR" - WaitingRoomListResponseDefaultTemplateLanguagePtBr WaitingRoomListResponseDefaultTemplateLanguage = "pt-BR" - WaitingRoomListResponseDefaultTemplateLanguageZhCn WaitingRoomListResponseDefaultTemplateLanguage = "zh-CN" - WaitingRoomListResponseDefaultTemplateLanguageZhTw WaitingRoomListResponseDefaultTemplateLanguage = "zh-TW" - WaitingRoomListResponseDefaultTemplateLanguageNlNl WaitingRoomListResponseDefaultTemplateLanguage = "nl-NL" - WaitingRoomListResponseDefaultTemplateLanguagePlPl WaitingRoomListResponseDefaultTemplateLanguage = "pl-PL" - WaitingRoomListResponseDefaultTemplateLanguageIDID WaitingRoomListResponseDefaultTemplateLanguage = "id-ID" - WaitingRoomListResponseDefaultTemplateLanguageTrTr WaitingRoomListResponseDefaultTemplateLanguage = "tr-TR" - WaitingRoomListResponseDefaultTemplateLanguageArEg WaitingRoomListResponseDefaultTemplateLanguage = "ar-EG" - WaitingRoomListResponseDefaultTemplateLanguageRuRu WaitingRoomListResponseDefaultTemplateLanguage = "ru-RU" - WaitingRoomListResponseDefaultTemplateLanguageFaIr WaitingRoomListResponseDefaultTemplateLanguage = "fa-IR" + WaitingRoomGetResponseDefaultTemplateLanguageEnUs WaitingRoomGetResponseDefaultTemplateLanguage = "en-US" + WaitingRoomGetResponseDefaultTemplateLanguageEsEs WaitingRoomGetResponseDefaultTemplateLanguage = "es-ES" + WaitingRoomGetResponseDefaultTemplateLanguageDeDe WaitingRoomGetResponseDefaultTemplateLanguage = "de-DE" + WaitingRoomGetResponseDefaultTemplateLanguageFrFr WaitingRoomGetResponseDefaultTemplateLanguage = "fr-FR" + WaitingRoomGetResponseDefaultTemplateLanguageItIt WaitingRoomGetResponseDefaultTemplateLanguage = "it-IT" + WaitingRoomGetResponseDefaultTemplateLanguageJaJp WaitingRoomGetResponseDefaultTemplateLanguage = "ja-JP" + WaitingRoomGetResponseDefaultTemplateLanguageKoKr WaitingRoomGetResponseDefaultTemplateLanguage = "ko-KR" + WaitingRoomGetResponseDefaultTemplateLanguagePtBr WaitingRoomGetResponseDefaultTemplateLanguage = "pt-BR" + WaitingRoomGetResponseDefaultTemplateLanguageZhCn WaitingRoomGetResponseDefaultTemplateLanguage = "zh-CN" + WaitingRoomGetResponseDefaultTemplateLanguageZhTw WaitingRoomGetResponseDefaultTemplateLanguage = "zh-TW" + WaitingRoomGetResponseDefaultTemplateLanguageNlNl WaitingRoomGetResponseDefaultTemplateLanguage = "nl-NL" + WaitingRoomGetResponseDefaultTemplateLanguagePlPl WaitingRoomGetResponseDefaultTemplateLanguage = "pl-PL" + WaitingRoomGetResponseDefaultTemplateLanguageIDID WaitingRoomGetResponseDefaultTemplateLanguage = "id-ID" + WaitingRoomGetResponseDefaultTemplateLanguageTrTr WaitingRoomGetResponseDefaultTemplateLanguage = "tr-TR" + WaitingRoomGetResponseDefaultTemplateLanguageArEg WaitingRoomGetResponseDefaultTemplateLanguage = "ar-EG" + WaitingRoomGetResponseDefaultTemplateLanguageRuRu WaitingRoomGetResponseDefaultTemplateLanguage = "ru-RU" + WaitingRoomGetResponseDefaultTemplateLanguageFaIr WaitingRoomGetResponseDefaultTemplateLanguage = "fa-IR" ) // Sets the queueing method used by the waiting room. Changing this parameter from @@ -1439,51 +1502,52 @@ const ( // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. -type WaitingRoomListResponseQueueingMethod string +type WaitingRoomGetResponseQueueingMethod string const ( - WaitingRoomListResponseQueueingMethodFifo WaitingRoomListResponseQueueingMethod = "fifo" - WaitingRoomListResponseQueueingMethodRandom WaitingRoomListResponseQueueingMethod = "random" - WaitingRoomListResponseQueueingMethodPassthrough WaitingRoomListResponseQueueingMethod = "passthrough" - WaitingRoomListResponseQueueingMethodReject WaitingRoomListResponseQueueingMethod = "reject" + WaitingRoomGetResponseQueueingMethodFifo WaitingRoomGetResponseQueueingMethod = "fifo" + WaitingRoomGetResponseQueueingMethodRandom WaitingRoomGetResponseQueueingMethod = "random" + WaitingRoomGetResponseQueueingMethodPassthrough WaitingRoomGetResponseQueueingMethod = "passthrough" + WaitingRoomGetResponseQueueingMethodReject WaitingRoomGetResponseQueueingMethod = "reject" ) // HTTP status code returned to a user while in the queue. -type WaitingRoomListResponseQueueingStatusCode int64 +type WaitingRoomGetResponseQueueingStatusCode int64 const ( - WaitingRoomListResponseQueueingStatusCode200 WaitingRoomListResponseQueueingStatusCode = 200 - WaitingRoomListResponseQueueingStatusCode202 WaitingRoomListResponseQueueingStatusCode = 202 - WaitingRoomListResponseQueueingStatusCode429 WaitingRoomListResponseQueueingStatusCode = 429 + WaitingRoomGetResponseQueueingStatusCode200 WaitingRoomGetResponseQueueingStatusCode = 200 + WaitingRoomGetResponseQueueingStatusCode202 WaitingRoomGetResponseQueueingStatusCode = 202 + WaitingRoomGetResponseQueueingStatusCode429 WaitingRoomGetResponseQueueingStatusCode = 429 ) -type WaitingRoomDeleteResponse struct { - ID interface{} `json:"id"` - JSON waitingRoomDeleteResponseJSON `json:"-"` +type WaitingRoomPreviewResponse struct { + // URL where the custom waiting room page can temporarily be previewed. + PreviewURL string `json:"preview_url"` + JSON waitingRoomPreviewResponseJSON `json:"-"` } -// waitingRoomDeleteResponseJSON contains the JSON metadata for the struct -// [WaitingRoomDeleteResponse] -type waitingRoomDeleteResponseJSON struct { - ID apijson.Field +// waitingRoomPreviewResponseJSON contains the JSON metadata for the struct +// [WaitingRoomPreviewResponse] +type waitingRoomPreviewResponseJSON struct { + PreviewURL apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomPreviewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomGetResponse struct { +type WaitingRoomReplaceResponse struct { ID interface{} `json:"id"` // Only available for the Waiting Room Advanced subscription. Additional hostname // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. - AdditionalRoutes []WaitingRoomGetResponseAdditionalRoute `json:"additional_routes"` + AdditionalRoutes []WaitingRoomReplaceResponseAdditionalRoute `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. - CookieAttributes WaitingRoomGetResponseCookieAttributes `json:"cookie_attributes"` + CookieAttributes WaitingRoomReplaceResponseCookieAttributes `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. @@ -1513,7 +1577,7 @@ type WaitingRoomGetResponse struct { CustomPageHTML string `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. - DefaultTemplateLanguage WaitingRoomGetResponseDefaultTemplateLanguage `json:"default_template_language"` + DefaultTemplateLanguage WaitingRoomReplaceResponseDefaultTemplateLanguage `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description string `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic @@ -1721,9 +1785,9 @@ type WaitingRoomGetResponse struct { // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. - QueueingMethod WaitingRoomGetResponseQueueingMethod `json:"queueing_method"` + QueueingMethod WaitingRoomReplaceResponseQueueingMethod `json:"queueing_method"` // HTTP status code returned to a user while in the queue. - QueueingStatusCode WaitingRoomGetResponseQueueingStatusCode `json:"queueing_status_code"` + QueueingStatusCode WaitingRoomReplaceResponseQueueingStatusCode `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. @@ -1737,13 +1801,13 @@ type WaitingRoomGetResponse struct { // the route. It is possible to have a situation where there are more or less // active users sessions on the route based on the traffic patterns at that time // around the world. - TotalActiveUsers int64 `json:"total_active_users"` - JSON waitingRoomGetResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users"` + JSON waitingRoomReplaceResponseJSON `json:"-"` } -// waitingRoomGetResponseJSON contains the JSON metadata for the struct -// [WaitingRoomGetResponse] -type waitingRoomGetResponseJSON struct { +// waitingRoomReplaceResponseJSON contains the JSON metadata for the struct +// [WaitingRoomReplaceResponse] +type waitingRoomReplaceResponseJSON struct { ID apijson.Field AdditionalRoutes apijson.Field CookieAttributes apijson.Field @@ -1771,11 +1835,11 @@ type waitingRoomGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomGetResponseAdditionalRoute struct { +type WaitingRoomReplaceResponseAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). @@ -1784,49 +1848,49 @@ type WaitingRoomGetResponseAdditionalRoute struct { // will be enabled for all subpaths as well. If there are two waiting rooms on the // same subpath, the waiting room for the most specific path will be chosen. // Wildcards and query parameters are not supported. - Path string `json:"path"` - JSON waitingRoomGetResponseAdditionalRouteJSON `json:"-"` + Path string `json:"path"` + JSON waitingRoomReplaceResponseAdditionalRouteJSON `json:"-"` } -// waitingRoomGetResponseAdditionalRouteJSON contains the JSON metadata for the -// struct [WaitingRoomGetResponseAdditionalRoute] -type waitingRoomGetResponseAdditionalRouteJSON struct { +// waitingRoomReplaceResponseAdditionalRouteJSON contains the JSON metadata for the +// struct [WaitingRoomReplaceResponseAdditionalRoute] +type waitingRoomReplaceResponseAdditionalRouteJSON struct { Host apijson.Field Path apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomGetResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomReplaceResponseAdditionalRoute) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. -type WaitingRoomGetResponseCookieAttributes struct { +type WaitingRoomReplaceResponseCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. - Samesite WaitingRoomGetResponseCookieAttributesSamesite `json:"samesite"` + Samesite WaitingRoomReplaceResponseCookieAttributesSamesite `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. - Secure WaitingRoomGetResponseCookieAttributesSecure `json:"secure"` - JSON waitingRoomGetResponseCookieAttributesJSON `json:"-"` + Secure WaitingRoomReplaceResponseCookieAttributesSecure `json:"secure"` + JSON waitingRoomReplaceResponseCookieAttributesJSON `json:"-"` } -// waitingRoomGetResponseCookieAttributesJSON contains the JSON metadata for the -// struct [WaitingRoomGetResponseCookieAttributes] -type waitingRoomGetResponseCookieAttributesJSON struct { +// waitingRoomReplaceResponseCookieAttributesJSON contains the JSON metadata for +// the struct [WaitingRoomReplaceResponseCookieAttributes] +type waitingRoomReplaceResponseCookieAttributesJSON struct { Samesite apijson.Field Secure apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomGetResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomReplaceResponseCookieAttributes) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1834,49 +1898,49 @@ func (r *WaitingRoomGetResponseCookieAttributes) UnmarshalJSON(data []byte) (err // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. -type WaitingRoomGetResponseCookieAttributesSamesite string +type WaitingRoomReplaceResponseCookieAttributesSamesite string const ( - WaitingRoomGetResponseCookieAttributesSamesiteAuto WaitingRoomGetResponseCookieAttributesSamesite = "auto" - WaitingRoomGetResponseCookieAttributesSamesiteLax WaitingRoomGetResponseCookieAttributesSamesite = "lax" - WaitingRoomGetResponseCookieAttributesSamesiteNone WaitingRoomGetResponseCookieAttributesSamesite = "none" - WaitingRoomGetResponseCookieAttributesSamesiteStrict WaitingRoomGetResponseCookieAttributesSamesite = "strict" + WaitingRoomReplaceResponseCookieAttributesSamesiteAuto WaitingRoomReplaceResponseCookieAttributesSamesite = "auto" + WaitingRoomReplaceResponseCookieAttributesSamesiteLax WaitingRoomReplaceResponseCookieAttributesSamesite = "lax" + WaitingRoomReplaceResponseCookieAttributesSamesiteNone WaitingRoomReplaceResponseCookieAttributesSamesite = "none" + WaitingRoomReplaceResponseCookieAttributesSamesiteStrict WaitingRoomReplaceResponseCookieAttributesSamesite = "strict" ) // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. -type WaitingRoomGetResponseCookieAttributesSecure string +type WaitingRoomReplaceResponseCookieAttributesSecure string const ( - WaitingRoomGetResponseCookieAttributesSecureAuto WaitingRoomGetResponseCookieAttributesSecure = "auto" - WaitingRoomGetResponseCookieAttributesSecureAlways WaitingRoomGetResponseCookieAttributesSecure = "always" - WaitingRoomGetResponseCookieAttributesSecureNever WaitingRoomGetResponseCookieAttributesSecure = "never" + WaitingRoomReplaceResponseCookieAttributesSecureAuto WaitingRoomReplaceResponseCookieAttributesSecure = "auto" + WaitingRoomReplaceResponseCookieAttributesSecureAlways WaitingRoomReplaceResponseCookieAttributesSecure = "always" + WaitingRoomReplaceResponseCookieAttributesSecureNever WaitingRoomReplaceResponseCookieAttributesSecure = "never" ) // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. -type WaitingRoomGetResponseDefaultTemplateLanguage string +type WaitingRoomReplaceResponseDefaultTemplateLanguage string const ( - WaitingRoomGetResponseDefaultTemplateLanguageEnUs WaitingRoomGetResponseDefaultTemplateLanguage = "en-US" - WaitingRoomGetResponseDefaultTemplateLanguageEsEs WaitingRoomGetResponseDefaultTemplateLanguage = "es-ES" - WaitingRoomGetResponseDefaultTemplateLanguageDeDe WaitingRoomGetResponseDefaultTemplateLanguage = "de-DE" - WaitingRoomGetResponseDefaultTemplateLanguageFrFr WaitingRoomGetResponseDefaultTemplateLanguage = "fr-FR" - WaitingRoomGetResponseDefaultTemplateLanguageItIt WaitingRoomGetResponseDefaultTemplateLanguage = "it-IT" - WaitingRoomGetResponseDefaultTemplateLanguageJaJp WaitingRoomGetResponseDefaultTemplateLanguage = "ja-JP" - WaitingRoomGetResponseDefaultTemplateLanguageKoKr WaitingRoomGetResponseDefaultTemplateLanguage = "ko-KR" - WaitingRoomGetResponseDefaultTemplateLanguagePtBr WaitingRoomGetResponseDefaultTemplateLanguage = "pt-BR" - WaitingRoomGetResponseDefaultTemplateLanguageZhCn WaitingRoomGetResponseDefaultTemplateLanguage = "zh-CN" - WaitingRoomGetResponseDefaultTemplateLanguageZhTw WaitingRoomGetResponseDefaultTemplateLanguage = "zh-TW" - WaitingRoomGetResponseDefaultTemplateLanguageNlNl WaitingRoomGetResponseDefaultTemplateLanguage = "nl-NL" - WaitingRoomGetResponseDefaultTemplateLanguagePlPl WaitingRoomGetResponseDefaultTemplateLanguage = "pl-PL" - WaitingRoomGetResponseDefaultTemplateLanguageIDID WaitingRoomGetResponseDefaultTemplateLanguage = "id-ID" - WaitingRoomGetResponseDefaultTemplateLanguageTrTr WaitingRoomGetResponseDefaultTemplateLanguage = "tr-TR" - WaitingRoomGetResponseDefaultTemplateLanguageArEg WaitingRoomGetResponseDefaultTemplateLanguage = "ar-EG" - WaitingRoomGetResponseDefaultTemplateLanguageRuRu WaitingRoomGetResponseDefaultTemplateLanguage = "ru-RU" - WaitingRoomGetResponseDefaultTemplateLanguageFaIr WaitingRoomGetResponseDefaultTemplateLanguage = "fa-IR" + WaitingRoomReplaceResponseDefaultTemplateLanguageEnUs WaitingRoomReplaceResponseDefaultTemplateLanguage = "en-US" + WaitingRoomReplaceResponseDefaultTemplateLanguageEsEs WaitingRoomReplaceResponseDefaultTemplateLanguage = "es-ES" + WaitingRoomReplaceResponseDefaultTemplateLanguageDeDe WaitingRoomReplaceResponseDefaultTemplateLanguage = "de-DE" + WaitingRoomReplaceResponseDefaultTemplateLanguageFrFr WaitingRoomReplaceResponseDefaultTemplateLanguage = "fr-FR" + WaitingRoomReplaceResponseDefaultTemplateLanguageItIt WaitingRoomReplaceResponseDefaultTemplateLanguage = "it-IT" + WaitingRoomReplaceResponseDefaultTemplateLanguageJaJp WaitingRoomReplaceResponseDefaultTemplateLanguage = "ja-JP" + WaitingRoomReplaceResponseDefaultTemplateLanguageKoKr WaitingRoomReplaceResponseDefaultTemplateLanguage = "ko-KR" + WaitingRoomReplaceResponseDefaultTemplateLanguagePtBr WaitingRoomReplaceResponseDefaultTemplateLanguage = "pt-BR" + WaitingRoomReplaceResponseDefaultTemplateLanguageZhCn WaitingRoomReplaceResponseDefaultTemplateLanguage = "zh-CN" + WaitingRoomReplaceResponseDefaultTemplateLanguageZhTw WaitingRoomReplaceResponseDefaultTemplateLanguage = "zh-TW" + WaitingRoomReplaceResponseDefaultTemplateLanguageNlNl WaitingRoomReplaceResponseDefaultTemplateLanguage = "nl-NL" + WaitingRoomReplaceResponseDefaultTemplateLanguagePlPl WaitingRoomReplaceResponseDefaultTemplateLanguage = "pl-PL" + WaitingRoomReplaceResponseDefaultTemplateLanguageIDID WaitingRoomReplaceResponseDefaultTemplateLanguage = "id-ID" + WaitingRoomReplaceResponseDefaultTemplateLanguageTrTr WaitingRoomReplaceResponseDefaultTemplateLanguage = "tr-TR" + WaitingRoomReplaceResponseDefaultTemplateLanguageArEg WaitingRoomReplaceResponseDefaultTemplateLanguage = "ar-EG" + WaitingRoomReplaceResponseDefaultTemplateLanguageRuRu WaitingRoomReplaceResponseDefaultTemplateLanguage = "ru-RU" + WaitingRoomReplaceResponseDefaultTemplateLanguageFaIr WaitingRoomReplaceResponseDefaultTemplateLanguage = "fa-IR" ) // Sets the queueing method used by the waiting room. Changing this parameter from @@ -1906,22 +1970,22 @@ const ( // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. -type WaitingRoomGetResponseQueueingMethod string +type WaitingRoomReplaceResponseQueueingMethod string const ( - WaitingRoomGetResponseQueueingMethodFifo WaitingRoomGetResponseQueueingMethod = "fifo" - WaitingRoomGetResponseQueueingMethodRandom WaitingRoomGetResponseQueueingMethod = "random" - WaitingRoomGetResponseQueueingMethodPassthrough WaitingRoomGetResponseQueueingMethod = "passthrough" - WaitingRoomGetResponseQueueingMethodReject WaitingRoomGetResponseQueueingMethod = "reject" + WaitingRoomReplaceResponseQueueingMethodFifo WaitingRoomReplaceResponseQueueingMethod = "fifo" + WaitingRoomReplaceResponseQueueingMethodRandom WaitingRoomReplaceResponseQueueingMethod = "random" + WaitingRoomReplaceResponseQueueingMethodPassthrough WaitingRoomReplaceResponseQueueingMethod = "passthrough" + WaitingRoomReplaceResponseQueueingMethodReject WaitingRoomReplaceResponseQueueingMethod = "reject" ) // HTTP status code returned to a user while in the queue. -type WaitingRoomGetResponseQueueingStatusCode int64 +type WaitingRoomReplaceResponseQueueingStatusCode int64 const ( - WaitingRoomGetResponseQueueingStatusCode200 WaitingRoomGetResponseQueueingStatusCode = 200 - WaitingRoomGetResponseQueueingStatusCode202 WaitingRoomGetResponseQueueingStatusCode = 202 - WaitingRoomGetResponseQueueingStatusCode429 WaitingRoomGetResponseQueueingStatusCode = 429 + WaitingRoomReplaceResponseQueueingStatusCode200 WaitingRoomReplaceResponseQueueingStatusCode = 200 + WaitingRoomReplaceResponseQueueingStatusCode202 WaitingRoomReplaceResponseQueueingStatusCode = 202 + WaitingRoomReplaceResponseQueueingStatusCode429 WaitingRoomReplaceResponseQueueingStatusCode = 429 ) type WaitingRoomNewParams struct { @@ -2333,7 +2397,185 @@ func (r *WaitingRoomNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) return apijson.UnmarshalRoot(data, r) } -type WaitingRoomUpdateParams struct { +type WaitingRoomListResponseEnvelope struct { + Errors []WaitingRoomListResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomListResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success WaitingRoomListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomListResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomListResponseEnvelopeJSON `json:"-"` +} + +// waitingRoomListResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomListResponseEnvelope] +type waitingRoomListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomListResponseEnvelopeErrorsJSON `json:"-"` +} + +// waitingRoomListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WaitingRoomListResponseEnvelopeErrors] +type waitingRoomListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomListResponseEnvelopeMessagesJSON `json:"-"` +} + +// waitingRoomListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WaitingRoomListResponseEnvelopeMessages] +type waitingRoomListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type WaitingRoomListResponseEnvelopeSuccess bool + +const ( + WaitingRoomListResponseEnvelopeSuccessTrue WaitingRoomListResponseEnvelopeSuccess = true +) + +type WaitingRoomListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON waitingRoomListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// waitingRoomListResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [WaitingRoomListResponseEnvelopeResultInfo] +type waitingRoomListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomDeleteResponseEnvelope struct { + Result WaitingRoomDeleteResponse `json:"result,required"` + JSON waitingRoomDeleteResponseEnvelopeJSON `json:"-"` +} + +// waitingRoomDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomDeleteResponseEnvelope] +type waitingRoomDeleteResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomGetResponseEnvelope struct { + Result WaitingRoomGetResponse `json:"result,required"` + JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` +} + +// waitingRoomGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomGetResponseEnvelope] +type waitingRoomGetResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomPreviewParams struct { + // Only available for the Waiting Room Advanced subscription. This is a template + // html file that will be rendered at the edge. If no custom_page_html is provided, + // the default waiting room will be used. The template is based on mustache ( + // https://mustache.github.io/ ). There are several variables that are evaluated by + // the Cloudflare edge: + // + // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to + // take when wait time is not available, for instance when queue_all is + // **true**. + // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five + // minutes. Alternatively, you can use: + // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. + // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user + // (`Math.floor(waitTime/60)`). + // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value + // (`waitTime%60`). + // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the + // queue. + // + // To view the full list of variables, look at the `cfWaitingRoom` object described + // under the `json_response_enabled` property in other Waiting Room API calls. + CustomHTML param.Field[string] `json:"custom_html,required"` +} + +func (r WaitingRoomPreviewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type WaitingRoomPreviewResponseEnvelope struct { + Result WaitingRoomPreviewResponse `json:"result,required"` + JSON waitingRoomPreviewResponseEnvelopeJSON `json:"-"` +} + +// waitingRoomPreviewResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomPreviewResponseEnvelope] +type waitingRoomPreviewResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomPreviewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomReplaceParams struct { // The host name to which the waiting room will be applied (no wildcards). Please // do not include the scheme (http:// or https://). The host and path combination // must be unique. @@ -2357,10 +2599,10 @@ type WaitingRoomUpdateParams struct { // and path combinations to which this waiting room will be applied. There is an // implied wildcard at the end of the path. The hostname and path combination must // be unique to this and all other waiting rooms. - AdditionalRoutes param.Field[[]WaitingRoomUpdateParamsAdditionalRoute] `json:"additional_routes"` + AdditionalRoutes param.Field[[]WaitingRoomReplaceParamsAdditionalRoute] `json:"additional_routes"` // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. - CookieAttributes param.Field[WaitingRoomUpdateParamsCookieAttributes] `json:"cookie_attributes"` + CookieAttributes param.Field[WaitingRoomReplaceParamsCookieAttributes] `json:"cookie_attributes"` // Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie // name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be // `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. @@ -2389,7 +2631,7 @@ type WaitingRoomUpdateParams struct { CustomPageHTML param.Field[string] `json:"custom_page_html"` // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. - DefaultTemplateLanguage param.Field[WaitingRoomUpdateParamsDefaultTemplateLanguage] `json:"default_template_language"` + DefaultTemplateLanguage param.Field[WaitingRoomReplaceParamsDefaultTemplateLanguage] `json:"default_template_language"` // A note that you can use to add more details about the waiting room. Description param.Field[string] `json:"description"` // Only available for the Waiting Room Advanced subscription. Disables automatic @@ -2580,9 +2822,9 @@ type WaitingRoomUpdateParams struct { // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. - QueueingMethod param.Field[WaitingRoomUpdateParamsQueueingMethod] `json:"queueing_method"` + QueueingMethod param.Field[WaitingRoomReplaceParamsQueueingMethod] `json:"queueing_method"` // HTTP status code returned to a user while in the queue. - QueueingStatusCode param.Field[WaitingRoomUpdateParamsQueueingStatusCode] `json:"queueing_status_code"` + QueueingStatusCode param.Field[WaitingRoomReplaceParamsQueueingStatusCode] `json:"queueing_status_code"` // Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to // the route. If a user is not seen by Cloudflare again in that time period, they // will be treated as a new user that visits the route. @@ -2592,11 +2834,11 @@ type WaitingRoomUpdateParams struct { Suspended param.Field[bool] `json:"suspended"` } -func (r WaitingRoomUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WaitingRoomUpdateParamsAdditionalRoute struct { +type WaitingRoomReplaceParamsAdditionalRoute struct { // The hostname to which this waiting room will be applied (no wildcards). The // hostname must be the primary domain, subdomain, or custom hostname (if using SSL // for SaaS) of this zone. Please do not include the scheme (http:// or https://). @@ -2608,26 +2850,26 @@ type WaitingRoomUpdateParamsAdditionalRoute struct { Path param.Field[string] `json:"path"` } -func (r WaitingRoomUpdateParamsAdditionalRoute) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomReplaceParamsAdditionalRoute) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Configures cookie attributes for the waiting room cookie. This encrypted cookie // stores a user's status in the waiting room, such as queue position. -type WaitingRoomUpdateParamsCookieAttributes struct { +type WaitingRoomReplaceParamsCookieAttributes struct { // Configures the SameSite attribute on the waiting room cookie. Value `auto` will // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. - Samesite param.Field[WaitingRoomUpdateParamsCookieAttributesSamesite] `json:"samesite"` + Samesite param.Field[WaitingRoomReplaceParamsCookieAttributesSamesite] `json:"samesite"` // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. - Secure param.Field[WaitingRoomUpdateParamsCookieAttributesSecure] `json:"secure"` + Secure param.Field[WaitingRoomReplaceParamsCookieAttributesSecure] `json:"secure"` } -func (r WaitingRoomUpdateParamsCookieAttributes) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomReplaceParamsCookieAttributes) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } @@ -2635,49 +2877,49 @@ func (r WaitingRoomUpdateParamsCookieAttributes) MarshalJSON() (data []byte, err // be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. // Note that when using value `none`, the secure attribute cannot be set to // `never`. -type WaitingRoomUpdateParamsCookieAttributesSamesite string +type WaitingRoomReplaceParamsCookieAttributesSamesite string const ( - WaitingRoomUpdateParamsCookieAttributesSamesiteAuto WaitingRoomUpdateParamsCookieAttributesSamesite = "auto" - WaitingRoomUpdateParamsCookieAttributesSamesiteLax WaitingRoomUpdateParamsCookieAttributesSamesite = "lax" - WaitingRoomUpdateParamsCookieAttributesSamesiteNone WaitingRoomUpdateParamsCookieAttributesSamesite = "none" - WaitingRoomUpdateParamsCookieAttributesSamesiteStrict WaitingRoomUpdateParamsCookieAttributesSamesite = "strict" + WaitingRoomReplaceParamsCookieAttributesSamesiteAuto WaitingRoomReplaceParamsCookieAttributesSamesite = "auto" + WaitingRoomReplaceParamsCookieAttributesSamesiteLax WaitingRoomReplaceParamsCookieAttributesSamesite = "lax" + WaitingRoomReplaceParamsCookieAttributesSamesiteNone WaitingRoomReplaceParamsCookieAttributesSamesite = "none" + WaitingRoomReplaceParamsCookieAttributesSamesiteStrict WaitingRoomReplaceParamsCookieAttributesSamesite = "strict" ) // Configures the Secure attribute on the waiting room cookie. Value `always` // indicates that the Secure attribute will be set in the Set-Cookie header, // `never` indicates that the Secure attribute will not be set, and `auto` will set // the Secure attribute depending if **Always Use HTTPS** is enabled. -type WaitingRoomUpdateParamsCookieAttributesSecure string +type WaitingRoomReplaceParamsCookieAttributesSecure string const ( - WaitingRoomUpdateParamsCookieAttributesSecureAuto WaitingRoomUpdateParamsCookieAttributesSecure = "auto" - WaitingRoomUpdateParamsCookieAttributesSecureAlways WaitingRoomUpdateParamsCookieAttributesSecure = "always" - WaitingRoomUpdateParamsCookieAttributesSecureNever WaitingRoomUpdateParamsCookieAttributesSecure = "never" + WaitingRoomReplaceParamsCookieAttributesSecureAuto WaitingRoomReplaceParamsCookieAttributesSecure = "auto" + WaitingRoomReplaceParamsCookieAttributesSecureAlways WaitingRoomReplaceParamsCookieAttributesSecure = "always" + WaitingRoomReplaceParamsCookieAttributesSecureNever WaitingRoomReplaceParamsCookieAttributesSecure = "never" ) // The language of the default page template. If no default_template_language is // provided, then `en-US` (English) will be used. -type WaitingRoomUpdateParamsDefaultTemplateLanguage string +type WaitingRoomReplaceParamsDefaultTemplateLanguage string const ( - WaitingRoomUpdateParamsDefaultTemplateLanguageEnUs WaitingRoomUpdateParamsDefaultTemplateLanguage = "en-US" - WaitingRoomUpdateParamsDefaultTemplateLanguageEsEs WaitingRoomUpdateParamsDefaultTemplateLanguage = "es-ES" - WaitingRoomUpdateParamsDefaultTemplateLanguageDeDe WaitingRoomUpdateParamsDefaultTemplateLanguage = "de-DE" - WaitingRoomUpdateParamsDefaultTemplateLanguageFrFr WaitingRoomUpdateParamsDefaultTemplateLanguage = "fr-FR" - WaitingRoomUpdateParamsDefaultTemplateLanguageItIt WaitingRoomUpdateParamsDefaultTemplateLanguage = "it-IT" - WaitingRoomUpdateParamsDefaultTemplateLanguageJaJp WaitingRoomUpdateParamsDefaultTemplateLanguage = "ja-JP" - WaitingRoomUpdateParamsDefaultTemplateLanguageKoKr WaitingRoomUpdateParamsDefaultTemplateLanguage = "ko-KR" - WaitingRoomUpdateParamsDefaultTemplateLanguagePtBr WaitingRoomUpdateParamsDefaultTemplateLanguage = "pt-BR" - WaitingRoomUpdateParamsDefaultTemplateLanguageZhCn WaitingRoomUpdateParamsDefaultTemplateLanguage = "zh-CN" - WaitingRoomUpdateParamsDefaultTemplateLanguageZhTw WaitingRoomUpdateParamsDefaultTemplateLanguage = "zh-TW" - WaitingRoomUpdateParamsDefaultTemplateLanguageNlNl WaitingRoomUpdateParamsDefaultTemplateLanguage = "nl-NL" - WaitingRoomUpdateParamsDefaultTemplateLanguagePlPl WaitingRoomUpdateParamsDefaultTemplateLanguage = "pl-PL" - WaitingRoomUpdateParamsDefaultTemplateLanguageIDID WaitingRoomUpdateParamsDefaultTemplateLanguage = "id-ID" - WaitingRoomUpdateParamsDefaultTemplateLanguageTrTr WaitingRoomUpdateParamsDefaultTemplateLanguage = "tr-TR" - WaitingRoomUpdateParamsDefaultTemplateLanguageArEg WaitingRoomUpdateParamsDefaultTemplateLanguage = "ar-EG" - WaitingRoomUpdateParamsDefaultTemplateLanguageRuRu WaitingRoomUpdateParamsDefaultTemplateLanguage = "ru-RU" - WaitingRoomUpdateParamsDefaultTemplateLanguageFaIr WaitingRoomUpdateParamsDefaultTemplateLanguage = "fa-IR" + WaitingRoomReplaceParamsDefaultTemplateLanguageEnUs WaitingRoomReplaceParamsDefaultTemplateLanguage = "en-US" + WaitingRoomReplaceParamsDefaultTemplateLanguageEsEs WaitingRoomReplaceParamsDefaultTemplateLanguage = "es-ES" + WaitingRoomReplaceParamsDefaultTemplateLanguageDeDe WaitingRoomReplaceParamsDefaultTemplateLanguage = "de-DE" + WaitingRoomReplaceParamsDefaultTemplateLanguageFrFr WaitingRoomReplaceParamsDefaultTemplateLanguage = "fr-FR" + WaitingRoomReplaceParamsDefaultTemplateLanguageItIt WaitingRoomReplaceParamsDefaultTemplateLanguage = "it-IT" + WaitingRoomReplaceParamsDefaultTemplateLanguageJaJp WaitingRoomReplaceParamsDefaultTemplateLanguage = "ja-JP" + WaitingRoomReplaceParamsDefaultTemplateLanguageKoKr WaitingRoomReplaceParamsDefaultTemplateLanguage = "ko-KR" + WaitingRoomReplaceParamsDefaultTemplateLanguagePtBr WaitingRoomReplaceParamsDefaultTemplateLanguage = "pt-BR" + WaitingRoomReplaceParamsDefaultTemplateLanguageZhCn WaitingRoomReplaceParamsDefaultTemplateLanguage = "zh-CN" + WaitingRoomReplaceParamsDefaultTemplateLanguageZhTw WaitingRoomReplaceParamsDefaultTemplateLanguage = "zh-TW" + WaitingRoomReplaceParamsDefaultTemplateLanguageNlNl WaitingRoomReplaceParamsDefaultTemplateLanguage = "nl-NL" + WaitingRoomReplaceParamsDefaultTemplateLanguagePlPl WaitingRoomReplaceParamsDefaultTemplateLanguage = "pl-PL" + WaitingRoomReplaceParamsDefaultTemplateLanguageIDID WaitingRoomReplaceParamsDefaultTemplateLanguage = "id-ID" + WaitingRoomReplaceParamsDefaultTemplateLanguageTrTr WaitingRoomReplaceParamsDefaultTemplateLanguage = "tr-TR" + WaitingRoomReplaceParamsDefaultTemplateLanguageArEg WaitingRoomReplaceParamsDefaultTemplateLanguage = "ar-EG" + WaitingRoomReplaceParamsDefaultTemplateLanguageRuRu WaitingRoomReplaceParamsDefaultTemplateLanguage = "ru-RU" + WaitingRoomReplaceParamsDefaultTemplateLanguageFaIr WaitingRoomReplaceParamsDefaultTemplateLanguage = "fa-IR" ) // Sets the queueing method used by the waiting room. Changing this parameter from @@ -2707,169 +2949,37 @@ const ( // events override this with `fifo`, `random`, or `passthrough`. When this // queueing method is enabled and neither `queueAll` is enabled nor an event is // prequeueing, the waiting room page **will not refresh automatically**. -type WaitingRoomUpdateParamsQueueingMethod string +type WaitingRoomReplaceParamsQueueingMethod string const ( - WaitingRoomUpdateParamsQueueingMethodFifo WaitingRoomUpdateParamsQueueingMethod = "fifo" - WaitingRoomUpdateParamsQueueingMethodRandom WaitingRoomUpdateParamsQueueingMethod = "random" - WaitingRoomUpdateParamsQueueingMethodPassthrough WaitingRoomUpdateParamsQueueingMethod = "passthrough" - WaitingRoomUpdateParamsQueueingMethodReject WaitingRoomUpdateParamsQueueingMethod = "reject" + WaitingRoomReplaceParamsQueueingMethodFifo WaitingRoomReplaceParamsQueueingMethod = "fifo" + WaitingRoomReplaceParamsQueueingMethodRandom WaitingRoomReplaceParamsQueueingMethod = "random" + WaitingRoomReplaceParamsQueueingMethodPassthrough WaitingRoomReplaceParamsQueueingMethod = "passthrough" + WaitingRoomReplaceParamsQueueingMethodReject WaitingRoomReplaceParamsQueueingMethod = "reject" ) // HTTP status code returned to a user while in the queue. -type WaitingRoomUpdateParamsQueueingStatusCode int64 +type WaitingRoomReplaceParamsQueueingStatusCode int64 const ( - WaitingRoomUpdateParamsQueueingStatusCode200 WaitingRoomUpdateParamsQueueingStatusCode = 200 - WaitingRoomUpdateParamsQueueingStatusCode202 WaitingRoomUpdateParamsQueueingStatusCode = 202 - WaitingRoomUpdateParamsQueueingStatusCode429 WaitingRoomUpdateParamsQueueingStatusCode = 429 + WaitingRoomReplaceParamsQueueingStatusCode200 WaitingRoomReplaceParamsQueueingStatusCode = 200 + WaitingRoomReplaceParamsQueueingStatusCode202 WaitingRoomReplaceParamsQueueingStatusCode = 202 + WaitingRoomReplaceParamsQueueingStatusCode429 WaitingRoomReplaceParamsQueueingStatusCode = 429 ) -type WaitingRoomUpdateResponseEnvelope struct { - Result WaitingRoomUpdateResponse `json:"result,required"` - JSON waitingRoomUpdateResponseEnvelopeJSON `json:"-"` +type WaitingRoomReplaceResponseEnvelope struct { + Result WaitingRoomReplaceResponse `json:"result,required"` + JSON waitingRoomReplaceResponseEnvelopeJSON `json:"-"` } -// waitingRoomUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [WaitingRoomUpdateResponseEnvelope] -type waitingRoomUpdateResponseEnvelopeJSON struct { +// waitingRoomReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomReplaceResponseEnvelope] +type waitingRoomReplaceResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomListResponseEnvelope struct { - Errors []WaitingRoomListResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomListResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomListResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success WaitingRoomListResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomListResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomListResponseEnvelopeJSON `json:"-"` -} - -// waitingRoomListResponseEnvelopeJSON contains the JSON metadata for the struct -// [WaitingRoomListResponseEnvelope] -type waitingRoomListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomListResponseEnvelopeErrorsJSON `json:"-"` -} - -// waitingRoomListResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WaitingRoomListResponseEnvelopeErrors] -type waitingRoomListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomListResponseEnvelopeMessagesJSON `json:"-"` -} - -// waitingRoomListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WaitingRoomListResponseEnvelopeMessages] -type waitingRoomListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type WaitingRoomListResponseEnvelopeSuccess bool - -const ( - WaitingRoomListResponseEnvelopeSuccessTrue WaitingRoomListResponseEnvelopeSuccess = true -) - -type WaitingRoomListResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomListResponseEnvelopeResultInfoJSON `json:"-"` -} - -// waitingRoomListResponseEnvelopeResultInfoJSON contains the JSON metadata for the -// struct [WaitingRoomListResponseEnvelopeResultInfo] -type waitingRoomListResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomDeleteResponseEnvelope struct { - Result WaitingRoomDeleteResponse `json:"result,required"` - JSON waitingRoomDeleteResponseEnvelopeJSON `json:"-"` -} - -// waitingRoomDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [WaitingRoomDeleteResponseEnvelope] -type waitingRoomDeleteResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomGetResponseEnvelope struct { - Result WaitingRoomGetResponse `json:"result,required"` - JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` -} - -// waitingRoomGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [WaitingRoomGetResponseEnvelope] -type waitingRoomGetResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/waitingroom_test.go b/waitingroom_test.go index f3026d859ba..d4d3d629957 100644 --- a/waitingroom_test.go +++ b/waitingroom_test.go @@ -74,7 +74,7 @@ func TestWaitingRoomNewWithOptionalParams(t *testing.T) { } } -func TestWaitingRoomUpdateWithOptionalParams(t *testing.T) { +func TestWaitingRoomList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -90,42 +90,36 @@ func TestWaitingRoomUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Update( + _, err := client.WaitingRooms.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestWaitingRoomDelete(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.WaitingRooms.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - cloudflare.WaitingRoomUpdateParams{ - Host: cloudflare.F("shop.example.com"), - Name: cloudflare.F("production_webinar"), - NewUsersPerMinute: cloudflare.F(int64(200)), - TotalActiveUsers: cloudflare.F(int64(200)), - AdditionalRoutes: cloudflare.F([]cloudflare.WaitingRoomUpdateParamsAdditionalRoute{{ - Host: cloudflare.F("shop2.example.com"), - Path: cloudflare.F("/shop2/checkout"), - }, { - Host: cloudflare.F("shop2.example.com"), - Path: cloudflare.F("/shop2/checkout"), - }, { - Host: cloudflare.F("shop2.example.com"), - Path: cloudflare.F("/shop2/checkout"), - }}), - CookieAttributes: cloudflare.F(cloudflare.WaitingRoomUpdateParamsCookieAttributes{ - Samesite: cloudflare.F(cloudflare.WaitingRoomUpdateParamsCookieAttributesSamesiteAuto), - Secure: cloudflare.F(cloudflare.WaitingRoomUpdateParamsCookieAttributesSecureAuto), - }), - CookieSuffix: cloudflare.F("abcd"), - CustomPageHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}"), - DefaultTemplateLanguage: cloudflare.F(cloudflare.WaitingRoomUpdateParamsDefaultTemplateLanguageEsEs), - Description: cloudflare.F("Production - DO NOT MODIFY"), - DisableSessionRenewal: cloudflare.F(false), - JsonResponseEnabled: cloudflare.F(false), - Path: cloudflare.F("/shop/checkout"), - QueueAll: cloudflare.F(true), - QueueingMethod: cloudflare.F(cloudflare.WaitingRoomUpdateParamsQueueingMethodFifo), - QueueingStatusCode: cloudflare.F(cloudflare.WaitingRoomUpdateParamsQueueingStatusCode202), - SessionDuration: cloudflare.F(int64(1)), - Suspended: cloudflare.F(true), - }, ) if err != nil { var apierr *cloudflare.Error @@ -136,7 +130,7 @@ func TestWaitingRoomUpdateWithOptionalParams(t *testing.T) { } } -func TestWaitingRoomList(t *testing.T) { +func TestWaitingRoomGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -152,7 +146,11 @@ func TestWaitingRoomList(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.WaitingRooms.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "699d98642c564d2e855e9661899b7252", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -162,7 +160,7 @@ func TestWaitingRoomList(t *testing.T) { } } -func TestWaitingRoomDelete(t *testing.T) { +func TestWaitingRoomPreview(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -178,10 +176,12 @@ func TestWaitingRoomDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Delete( + _, err := client.WaitingRooms.Preview( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "699d98642c564d2e855e9661899b7252", + cloudflare.WaitingRoomPreviewParams{ + CustomHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -192,7 +192,7 @@ func TestWaitingRoomDelete(t *testing.T) { } } -func TestWaitingRoomGet(t *testing.T) { +func TestWaitingRoomReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -208,10 +208,42 @@ func TestWaitingRoomGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Get( + _, err := client.WaitingRooms.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", + cloudflare.WaitingRoomReplaceParams{ + Host: cloudflare.F("shop.example.com"), + Name: cloudflare.F("production_webinar"), + NewUsersPerMinute: cloudflare.F(int64(200)), + TotalActiveUsers: cloudflare.F(int64(200)), + AdditionalRoutes: cloudflare.F([]cloudflare.WaitingRoomReplaceParamsAdditionalRoute{{ + Host: cloudflare.F("shop2.example.com"), + Path: cloudflare.F("/shop2/checkout"), + }, { + Host: cloudflare.F("shop2.example.com"), + Path: cloudflare.F("/shop2/checkout"), + }, { + Host: cloudflare.F("shop2.example.com"), + Path: cloudflare.F("/shop2/checkout"), + }}), + CookieAttributes: cloudflare.F(cloudflare.WaitingRoomReplaceParamsCookieAttributes{ + Samesite: cloudflare.F(cloudflare.WaitingRoomReplaceParamsCookieAttributesSamesiteAuto), + Secure: cloudflare.F(cloudflare.WaitingRoomReplaceParamsCookieAttributesSecureAuto), + }), + CookieSuffix: cloudflare.F("abcd"), + CustomPageHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}"), + DefaultTemplateLanguage: cloudflare.F(cloudflare.WaitingRoomReplaceParamsDefaultTemplateLanguageEsEs), + Description: cloudflare.F("Production - DO NOT MODIFY"), + DisableSessionRenewal: cloudflare.F(false), + JsonResponseEnabled: cloudflare.F(false), + Path: cloudflare.F("/shop/checkout"), + QueueAll: cloudflare.F(true), + QueueingMethod: cloudflare.F(cloudflare.WaitingRoomReplaceParamsQueueingMethodFifo), + QueueingStatusCode: cloudflare.F(cloudflare.WaitingRoomReplaceParamsQueueingStatusCode202), + SessionDuration: cloudflare.F(int64(1)), + Suspended: cloudflare.F(true), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/waitingroomevent.go b/waitingroomevent.go index bcf21c7dc66..ae371c0b989 100644 --- a/waitingroomevent.go +++ b/waitingroomevent.go @@ -34,12 +34,30 @@ func NewWaitingRoomEventService(opts ...option.RequestOption) (r *WaitingRoomEve return } -// Updates a configured event for a waiting room. -func (r *WaitingRoomEventService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body WaitingRoomEventUpdateParams, opts ...option.RequestOption) (res *WaitingRoomEventUpdateResponse, err error) { +// Only available for the Waiting Room Advanced subscription. Creates an event for +// a waiting room. An event takes place during a specified period of time, +// temporarily changing the behavior of a waiting room. While the event is active, +// some of the properties in the event's configuration may either override or +// inherit from the waiting room's configuration. Note that events cannot overlap +// with each other, so only one event can be active at a time. +func (r *WaitingRoomEventService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomEventNewParams, opts ...option.RequestOption) (res *WaitingRoomEventNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomEventUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events/%v", zoneIdentifier, waitingRoomID, eventID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env WaitingRoomEventNewResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events", zoneIdentifier, waitingRoomID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Lists events for a waiting room. +func (r *WaitingRoomEventService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingRoomEventListResponse, err error) { + opts = append(r.Options[:], opts...) + var env WaitingRoomEventListResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events", zoneIdentifier, waitingRoomID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,30 +91,12 @@ func (r *WaitingRoomEventService) Get(ctx context.Context, zoneIdentifier string return } -// Only available for the Waiting Room Advanced subscription. Creates an event for -// a waiting room. An event takes place during a specified period of time, -// temporarily changing the behavior of a waiting room. While the event is active, -// some of the properties in the event's configuration may either override or -// inherit from the waiting room's configuration. Note that events cannot overlap -// with each other, so only one event can be active at a time. -func (r *WaitingRoomEventService) WaitingRoomNewEvent(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomEventWaitingRoomNewEventParams, opts ...option.RequestOption) (res *WaitingRoomEventWaitingRoomNewEventResponse, err error) { - opts = append(r.Options[:], opts...) - var env WaitingRoomEventWaitingRoomNewEventResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events", zoneIdentifier, waitingRoomID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Lists events for a waiting room. -func (r *WaitingRoomEventService) WaitingRoomListEvents(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingRoomEventWaitingRoomListEventsResponse, err error) { +// Updates a configured event for a waiting room. +func (r *WaitingRoomEventService) Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body WaitingRoomEventReplaceParams, opts ...option.RequestOption) (res *WaitingRoomEventReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomEventWaitingRoomListEventsResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events", zoneIdentifier, waitingRoomID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env WaitingRoomEventReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events/%v", zoneIdentifier, waitingRoomID, eventID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -104,7 +104,7 @@ func (r *WaitingRoomEventService) WaitingRoomListEvents(ctx context.Context, zon return } -type WaitingRoomEventUpdateResponse struct { +type WaitingRoomEventNewResponse struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` // If set, the event will override the waiting room's `custom_page_html` property @@ -152,13 +152,13 @@ type WaitingRoomEventUpdateResponse struct { // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. - TotalActiveUsers int64 `json:"total_active_users,nullable"` - JSON waitingRoomEventUpdateResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users,nullable"` + JSON waitingRoomEventNewResponseJSON `json:"-"` } -// waitingRoomEventUpdateResponseJSON contains the JSON metadata for the struct -// [WaitingRoomEventUpdateResponse] -type waitingRoomEventUpdateResponseJSON struct { +// waitingRoomEventNewResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventNewResponse] +type waitingRoomEventNewResponseJSON struct { ID apijson.Field CreatedOn apijson.Field CustomPageHTML apijson.Field @@ -179,28 +179,11 @@ type waitingRoomEventUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventDeleteResponse struct { - ID interface{} `json:"id"` - JSON waitingRoomEventDeleteResponseJSON `json:"-"` -} - -// waitingRoomEventDeleteResponseJSON contains the JSON metadata for the struct -// [WaitingRoomEventDeleteResponse] -type waitingRoomEventDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomEventDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomEventGetResponse struct { +type WaitingRoomEventListResponse struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` // If set, the event will override the waiting room's `custom_page_html` property @@ -248,13 +231,13 @@ type WaitingRoomEventGetResponse struct { // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. - TotalActiveUsers int64 `json:"total_active_users,nullable"` - JSON waitingRoomEventGetResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users,nullable"` + JSON waitingRoomEventListResponseJSON `json:"-"` } -// waitingRoomEventGetResponseJSON contains the JSON metadata for the struct -// [WaitingRoomEventGetResponse] -type waitingRoomEventGetResponseJSON struct { +// waitingRoomEventListResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventListResponse] +type waitingRoomEventListResponseJSON struct { ID apijson.Field CreatedOn apijson.Field CustomPageHTML apijson.Field @@ -275,11 +258,28 @@ type waitingRoomEventGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomEventDeleteResponse struct { + ID interface{} `json:"id"` + JSON waitingRoomEventDeleteResponseJSON `json:"-"` +} + +// waitingRoomEventDeleteResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventDeleteResponse] +type waitingRoomEventDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomEventDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventWaitingRoomNewEventResponse struct { +type WaitingRoomEventGetResponse struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` // If set, the event will override the waiting room's `custom_page_html` property @@ -327,13 +327,13 @@ type WaitingRoomEventWaitingRoomNewEventResponse struct { // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. - TotalActiveUsers int64 `json:"total_active_users,nullable"` - JSON waitingRoomEventWaitingRoomNewEventResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users,nullable"` + JSON waitingRoomEventGetResponseJSON `json:"-"` } -// waitingRoomEventWaitingRoomNewEventResponseJSON contains the JSON metadata for -// the struct [WaitingRoomEventWaitingRoomNewEventResponse] -type waitingRoomEventWaitingRoomNewEventResponseJSON struct { +// waitingRoomEventGetResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventGetResponse] +type waitingRoomEventGetResponseJSON struct { ID apijson.Field CreatedOn apijson.Field CustomPageHTML apijson.Field @@ -354,11 +354,11 @@ type waitingRoomEventWaitingRoomNewEventResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventWaitingRoomNewEventResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventWaitingRoomListEventsResponse struct { +type WaitingRoomEventReplaceResponse struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` // If set, the event will override the waiting room's `custom_page_html` property @@ -406,13 +406,13 @@ type WaitingRoomEventWaitingRoomListEventsResponse struct { // If set, the event will override the waiting room's `total_active_users` property // while it is active. If null, the event will inherit it. This can only be set if // the event's `new_users_per_minute` property is also set. - TotalActiveUsers int64 `json:"total_active_users,nullable"` - JSON waitingRoomEventWaitingRoomListEventsResponseJSON `json:"-"` + TotalActiveUsers int64 `json:"total_active_users,nullable"` + JSON waitingRoomEventReplaceResponseJSON `json:"-"` } -// waitingRoomEventWaitingRoomListEventsResponseJSON contains the JSON metadata for -// the struct [WaitingRoomEventWaitingRoomListEventsResponse] -type waitingRoomEventWaitingRoomListEventsResponseJSON struct { +// waitingRoomEventReplaceResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventReplaceResponse] +type waitingRoomEventReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field CustomPageHTML apijson.Field @@ -433,11 +433,11 @@ type waitingRoomEventWaitingRoomListEventsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventWaitingRoomListEventsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventUpdateParams struct { +type WaitingRoomEventNewParams struct { // An ISO 8601 timestamp that marks the end of the event. EventEndTime param.Field[string] `json:"event_end_time,required"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued @@ -485,24 +485,122 @@ type WaitingRoomEventUpdateParams struct { TotalActiveUsers param.Field[int64] `json:"total_active_users"` } -func (r WaitingRoomEventUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomEventNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WaitingRoomEventUpdateResponseEnvelope struct { - Result WaitingRoomEventUpdateResponse `json:"result,required"` - JSON waitingRoomEventUpdateResponseEnvelopeJSON `json:"-"` +type WaitingRoomEventNewResponseEnvelope struct { + Result WaitingRoomEventNewResponse `json:"result,required"` + JSON waitingRoomEventNewResponseEnvelopeJSON `json:"-"` } -// waitingRoomEventUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [WaitingRoomEventUpdateResponseEnvelope] -type waitingRoomEventUpdateResponseEnvelopeJSON struct { +// waitingRoomEventNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomEventNewResponseEnvelope] +type waitingRoomEventNewResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomEventListResponseEnvelope struct { + Errors []WaitingRoomEventListResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomEventListResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomEventListResponse `json:"result,required,nullable"` + // Whether the API call was successful + Success WaitingRoomEventListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomEventListResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomEventListResponseEnvelopeJSON `json:"-"` +} + +// waitingRoomEventListResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomEventListResponseEnvelope] +type waitingRoomEventListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomEventListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomEventListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomEventListResponseEnvelopeErrorsJSON `json:"-"` +} + +// waitingRoomEventListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WaitingRoomEventListResponseEnvelopeErrors] +type waitingRoomEventListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomEventListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WaitingRoomEventListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomEventListResponseEnvelopeMessagesJSON `json:"-"` +} + +// waitingRoomEventListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WaitingRoomEventListResponseEnvelopeMessages] +type waitingRoomEventListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomEventListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type WaitingRoomEventListResponseEnvelopeSuccess bool + +const ( + WaitingRoomEventListResponseEnvelopeSuccessTrue WaitingRoomEventListResponseEnvelopeSuccess = true +) + +type WaitingRoomEventListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON waitingRoomEventListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// waitingRoomEventListResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [WaitingRoomEventListResponseEnvelopeResultInfo] +type waitingRoomEventListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WaitingRoomEventListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -540,7 +638,7 @@ func (r *WaitingRoomEventGetResponseEnvelope) UnmarshalJSON(data []byte) (err er return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventWaitingRoomNewEventParams struct { +type WaitingRoomEventReplaceParams struct { // An ISO 8601 timestamp that marks the end of the event. EventEndTime param.Field[string] `json:"event_end_time,required"` // An ISO 8601 timestamp that marks the start of the event. At this time, queued @@ -588,124 +686,23 @@ type WaitingRoomEventWaitingRoomNewEventParams struct { TotalActiveUsers param.Field[int64] `json:"total_active_users"` } -func (r WaitingRoomEventWaitingRoomNewEventParams) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomEventReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WaitingRoomEventWaitingRoomNewEventResponseEnvelope struct { - Result WaitingRoomEventWaitingRoomNewEventResponse `json:"result,required"` - JSON waitingRoomEventWaitingRoomNewEventResponseEnvelopeJSON `json:"-"` -} - -// waitingRoomEventWaitingRoomNewEventResponseEnvelopeJSON contains the JSON -// metadata for the struct [WaitingRoomEventWaitingRoomNewEventResponseEnvelope] -type waitingRoomEventWaitingRoomNewEventResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomEventWaitingRoomNewEventResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomEventWaitingRoomListEventsResponseEnvelope struct { - Errors []WaitingRoomEventWaitingRoomListEventsResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomEventWaitingRoomListEventsResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomEventWaitingRoomListEventsResponse `json:"result,required,nullable"` - // Whether the API call was successful - Success WaitingRoomEventWaitingRoomListEventsResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomEventWaitingRoomListEventsResponseEnvelopeJSON `json:"-"` +type WaitingRoomEventReplaceResponseEnvelope struct { + Result WaitingRoomEventReplaceResponse `json:"result,required"` + JSON waitingRoomEventReplaceResponseEnvelopeJSON `json:"-"` } -// waitingRoomEventWaitingRoomListEventsResponseEnvelopeJSON contains the JSON -// metadata for the struct [WaitingRoomEventWaitingRoomListEventsResponseEnvelope] -type waitingRoomEventWaitingRoomListEventsResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field +// waitingRoomEventReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomEventReplaceResponseEnvelope] +type waitingRoomEventReplaceResponseEnvelopeJSON struct { Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomEventWaitingRoomListEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomEventWaitingRoomListEventsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomEventWaitingRoomListEventsResponseEnvelopeErrorsJSON `json:"-"` -} - -// waitingRoomEventWaitingRoomListEventsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [WaitingRoomEventWaitingRoomListEventsResponseEnvelopeErrors] -type waitingRoomEventWaitingRoomListEventsResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomEventWaitingRoomListEventsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomEventWaitingRoomListEventsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomEventWaitingRoomListEventsResponseEnvelopeMessagesJSON `json:"-"` -} - -// waitingRoomEventWaitingRoomListEventsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [WaitingRoomEventWaitingRoomListEventsResponseEnvelopeMessages] -type waitingRoomEventWaitingRoomListEventsResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomEventWaitingRoomListEventsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type WaitingRoomEventWaitingRoomListEventsResponseEnvelopeSuccess bool - -const ( - WaitingRoomEventWaitingRoomListEventsResponseEnvelopeSuccessTrue WaitingRoomEventWaitingRoomListEventsResponseEnvelopeSuccess = true -) - -type WaitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfoJSON `json:"-"` -} - -// waitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfoJSON contains the -// JSON metadata for the struct -// [WaitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfo] -type waitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventWaitingRoomListEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/waitingroomevent_test.go b/waitingroomevent_test.go index f85ddf84a7b..96f0603ccd8 100644 --- a/waitingroomevent_test.go +++ b/waitingroomevent_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWaitingRoomEventUpdateWithOptionalParams(t *testing.T) { +func TestWaitingRoomEventNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,12 +29,11 @@ func TestWaitingRoomEventUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.Update( + _, err := client.WaitingRooms.Events.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - "25756b2dfe6e378a06b033b670413757", - cloudflare.WaitingRoomEventUpdateParams{ + cloudflare.WaitingRoomEventNewParams{ EventEndTime: cloudflare.F("2021-09-28T17:00:00.000Z"), EventStartTime: cloudflare.F("2021-09-28T15:30:00.000Z"), Name: cloudflare.F("production_webinar_event"), @@ -59,7 +58,7 @@ func TestWaitingRoomEventUpdateWithOptionalParams(t *testing.T) { } } -func TestWaitingRoomEventDelete(t *testing.T) { +func TestWaitingRoomEventList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -75,11 +74,10 @@ func TestWaitingRoomEventDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.Delete( + _, err := client.WaitingRooms.Events.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - "25756b2dfe6e378a06b033b670413757", ) if err != nil { var apierr *cloudflare.Error @@ -90,7 +88,7 @@ func TestWaitingRoomEventDelete(t *testing.T) { } } -func TestWaitingRoomEventGet(t *testing.T) { +func TestWaitingRoomEventDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -106,7 +104,7 @@ func TestWaitingRoomEventGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.Get( + _, err := client.WaitingRooms.Events.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", @@ -121,7 +119,7 @@ func TestWaitingRoomEventGet(t *testing.T) { } } -func TestWaitingRoomEventWaitingRoomNewEventWithOptionalParams(t *testing.T) { +func TestWaitingRoomEventGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -137,25 +135,11 @@ func TestWaitingRoomEventWaitingRoomNewEventWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.WaitingRoomNewEvent( + _, err := client.WaitingRooms.Events.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - cloudflare.WaitingRoomEventWaitingRoomNewEventParams{ - EventEndTime: cloudflare.F("2021-09-28T17:00:00.000Z"), - EventStartTime: cloudflare.F("2021-09-28T15:30:00.000Z"), - Name: cloudflare.F("production_webinar_event"), - CustomPageHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}"), - Description: cloudflare.F("Production event - DO NOT MODIFY"), - DisableSessionRenewal: cloudflare.F(true), - NewUsersPerMinute: cloudflare.F(int64(200)), - PrequeueStartTime: cloudflare.F("2021-09-28T15:00:00.000Z"), - QueueingMethod: cloudflare.F("random"), - SessionDuration: cloudflare.F(int64(1)), - ShuffleAtEventStart: cloudflare.F(true), - Suspended: cloudflare.F(true), - TotalActiveUsers: cloudflare.F(int64(200)), - }, + "25756b2dfe6e378a06b033b670413757", ) if err != nil { var apierr *cloudflare.Error @@ -166,7 +150,7 @@ func TestWaitingRoomEventWaitingRoomNewEventWithOptionalParams(t *testing.T) { } } -func TestWaitingRoomEventWaitingRoomListEvents(t *testing.T) { +func TestWaitingRoomEventReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -182,10 +166,26 @@ func TestWaitingRoomEventWaitingRoomListEvents(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.WaitingRoomListEvents( + _, err := client.WaitingRooms.Events.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", + "25756b2dfe6e378a06b033b670413757", + cloudflare.WaitingRoomEventReplaceParams{ + EventEndTime: cloudflare.F("2021-09-28T17:00:00.000Z"), + EventStartTime: cloudflare.F("2021-09-28T15:30:00.000Z"), + Name: cloudflare.F("production_webinar_event"), + CustomPageHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}"), + Description: cloudflare.F("Production event - DO NOT MODIFY"), + DisableSessionRenewal: cloudflare.F(true), + NewUsersPerMinute: cloudflare.F(int64(200)), + PrequeueStartTime: cloudflare.F("2021-09-28T15:00:00.000Z"), + QueueingMethod: cloudflare.F("random"), + SessionDuration: cloudflare.F(int64(1)), + ShuffleAtEventStart: cloudflare.F(true), + Suspended: cloudflare.F(true), + TotalActiveUsers: cloudflare.F(int64(200)), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/waitingroomeventdetail.go b/waitingroomeventdetail.go index b8b97f5a6f1..c5315c3d84f 100644 --- a/waitingroomeventdetail.go +++ b/waitingroomeventdetail.go @@ -33,9 +33,9 @@ func NewWaitingRoomEventDetailService(opts ...option.RequestOption) (r *WaitingR // Previews an event's configuration as if it was active. Inherited fields from the // waiting room will be displayed with their current values. -func (r *WaitingRoomEventDetailService) WaitingRoomPreviewActiveEventDetails(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, opts ...option.RequestOption) (res *WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse, err error) { +func (r *WaitingRoomEventDetailService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, opts ...option.RequestOption) (res *WaitingRoomEventDetailGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelope + var env WaitingRoomEventDetailGetResponseEnvelope path := fmt.Sprintf("zones/%s/waiting_rooms/%v/events/%v/details", zoneIdentifier, waitingRoomID, eventID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,7 +45,7 @@ func (r *WaitingRoomEventDetailService) WaitingRoomPreviewActiveEventDetails(ctx return } -type WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse struct { +type WaitingRoomEventDetailGetResponse struct { ID interface{} `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` CustomPageHTML string `json:"custom_page_html"` @@ -78,15 +78,14 @@ type WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse struct { ShuffleAtEventStart bool `json:"shuffle_at_event_start"` // Suspends or allows an event. If set to `true`, the event is ignored and traffic // will be handled based on the waiting room configuration. - Suspended bool `json:"suspended"` - TotalActiveUsers int64 `json:"total_active_users"` - JSON waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseJSON `json:"-"` + Suspended bool `json:"suspended"` + TotalActiveUsers int64 `json:"total_active_users"` + JSON waitingRoomEventDetailGetResponseJSON `json:"-"` } -// waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseJSON contains -// the JSON metadata for the struct -// [WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse] -type waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseJSON struct { +// waitingRoomEventDetailGetResponseJSON contains the JSON metadata for the struct +// [WaitingRoomEventDetailGetResponse] +type waitingRoomEventDetailGetResponseJSON struct { ID apijson.Field CreatedOn apijson.Field CustomPageHTML apijson.Field @@ -107,24 +106,23 @@ type waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseJSON stru ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventDetailGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelope struct { - Result WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponse `json:"result,required"` - JSON waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelopeJSON `json:"-"` +type WaitingRoomEventDetailGetResponseEnvelope struct { + Result WaitingRoomEventDetailGetResponse `json:"result,required"` + JSON waitingRoomEventDetailGetResponseEnvelopeJSON `json:"-"` } -// waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelope] -type waitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelopeJSON struct { +// waitingRoomEventDetailGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomEventDetailGetResponseEnvelope] +type waitingRoomEventDetailGetResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomEventDetailWaitingRoomPreviewActiveEventDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomEventDetailGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/waitingroomeventdetail_test.go b/waitingroomeventdetail_test.go index eddf98e6466..cdbfc2698f1 100644 --- a/waitingroomeventdetail_test.go +++ b/waitingroomeventdetail_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWaitingRoomEventDetailWaitingRoomPreviewActiveEventDetails(t *testing.T) { +func TestWaitingRoomEventDetailGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWaitingRoomEventDetailWaitingRoomPreviewActiveEventDetails(t *testing.T option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Events.Details.WaitingRoomPreviewActiveEventDetails( + _, err := client.WaitingRooms.Events.Details.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", diff --git a/waitingroompreview.go b/waitingroompreview.go deleted file mode 100644 index 7848b2acf25..00000000000 --- a/waitingroompreview.go +++ /dev/null @@ -1,144 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "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/option" -) - -// WaitingRoomPreviewService contains methods and other services that help with -// interacting with the cloudflare API. Note, unlike clients, this service does not -// read variables from the environment automatically. You should not instantiate -// this service directly, and instead use the [NewWaitingRoomPreviewService] method -// instead. -type WaitingRoomPreviewService struct { - Options []option.RequestOption -} - -// NewWaitingRoomPreviewService generates a new service that applies the given -// options to each request. These options are applied after the parent client's -// options (if there is one), and before any request-specific options. -func NewWaitingRoomPreviewService(opts ...option.RequestOption) (r *WaitingRoomPreviewService) { - r = &WaitingRoomPreviewService{} - r.Options = opts - return -} - -// Creates a waiting room page preview. Upload a custom waiting room page for -// preview. You will receive a preview URL in the form -// `http://waitingrooms.dev/preview/`. You can use the following query -// parameters to change the state of the preview: -// -// 1. `force_queue`: Boolean indicating if all users will be queued in the waiting -// room and no one will be let into the origin website (also known as queueAll). -// 2. `queue_is_full`: Boolean indicating if the waiting room's queue is currently -// full and not accepting new users at the moment. -// 3. `queueing_method`: The queueing method currently used by the waiting room. -// - **fifo** indicates a FIFO queue. -// - **random** indicates a Random queue. -// - **passthrough** indicates a Passthrough queue. Keep in mind that the -// waiting room page will only be displayed if `force_queue=true` or -// `event=prequeueing` — for other cases the request will pass through to the -// origin. For our preview, this will be a fake origin website returning -// "Welcome". -// - **reject** indicates a Reject queue. -// 4. `event`: Used to preview a waiting room event. -// - **none** indicates no event is occurring. -// - **prequeueing** indicates that an event is prequeueing (between -// `prequeue_start_time` and `event_start_time`). -// - **started** indicates that an event has started (between `event_start_time` -// and `event_end_time`). -// 5. `shuffle_at_event_start`: Boolean indicating if the event will shuffle users -// in the prequeue when it starts. This can only be set to **true** if an event -// is active (`event` is not **none**). -// -// For example, you can make a request to -// `http://waitingrooms.dev/preview/?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6. -// `waitTime`: Non-zero, positive integer indicating the estimated wait time in -// minutes. The default value is 10 minutes. -// -// For example, you can make a request to -// `http://waitingrooms.dev/preview/?waitTime=50` to configure the estimated -// wait time as 50 minutes. -func (r *WaitingRoomPreviewService) New(ctx context.Context, zoneIdentifier string, body WaitingRoomPreviewNewParams, opts ...option.RequestOption) (res *WaitingRoomPreviewNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env WaitingRoomPreviewNewResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/preview", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type WaitingRoomPreviewNewResponse struct { - // URL where the custom waiting room page can temporarily be previewed. - PreviewURL string `json:"preview_url"` - JSON waitingRoomPreviewNewResponseJSON `json:"-"` -} - -// waitingRoomPreviewNewResponseJSON contains the JSON metadata for the struct -// [WaitingRoomPreviewNewResponse] -type waitingRoomPreviewNewResponseJSON struct { - PreviewURL apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomPreviewNewResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WaitingRoomPreviewNewParams struct { - // Only available for the Waiting Room Advanced subscription. This is a template - // html file that will be rendered at the edge. If no custom_page_html is provided, - // the default waiting room will be used. The template is based on mustache ( - // https://mustache.github.io/ ). There are several variables that are evaluated by - // the Cloudflare edge: - // - // 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to - // take when wait time is not available, for instance when queue_all is - // **true**. - // 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five - // minutes. Alternatively, you can use: - // 3. {{`waitTime`}} Number of minutes of estimated wait for a user. - // 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user - // (`Math.floor(waitTime/60)`). - // 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value - // (`waitTime%60`). - // 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the - // queue. - // - // To view the full list of variables, look at the `cfWaitingRoom` object described - // under the `json_response_enabled` property in other Waiting Room API calls. - CustomHTML param.Field[string] `json:"custom_html,required"` -} - -func (r WaitingRoomPreviewNewParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type WaitingRoomPreviewNewResponseEnvelope struct { - Result WaitingRoomPreviewNewResponse `json:"result,required"` - JSON waitingRoomPreviewNewResponseEnvelopeJSON `json:"-"` -} - -// waitingRoomPreviewNewResponseEnvelopeJSON contains the JSON metadata for the -// struct [WaitingRoomPreviewNewResponseEnvelope] -type waitingRoomPreviewNewResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WaitingRoomPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/waitingroompreview_test.go b/waitingroompreview_test.go deleted file mode 100644 index 031f0ce5671..00000000000 --- a/waitingroompreview_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestWaitingRoomPreviewNew(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.WaitingRooms.Previews.New( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WaitingRoomPreviewNewParams{ - CustomHTML: cloudflare.F("{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/waitingroomrule.go b/waitingroomrule.go index a90f16223bd..c8142dd0d73 100644 --- a/waitingroomrule.go +++ b/waitingroomrule.go @@ -32,12 +32,13 @@ func NewWaitingRoomRuleService(opts ...option.RequestOption) (r *WaitingRoomRule return } -// Patches a rule for a waiting room. -func (r *WaitingRoomRuleService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body WaitingRoomRuleUpdateParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleUpdateResponse, err error) { +// Only available for the Waiting Room Advanced subscription. Creates a rule for a +// waiting room. +func (r *WaitingRoomRuleService) New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomRuleNewParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomRuleUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules/%s", zoneIdentifier, waitingRoomID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env WaitingRoomRuleNewResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules", zoneIdentifier, waitingRoomID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -45,12 +46,12 @@ func (r *WaitingRoomRuleService) Update(ctx context.Context, zoneIdentifier stri return } -// Deletes a rule for a waiting room. -func (r *WaitingRoomRuleService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, opts ...option.RequestOption) (res *[]WaitingRoomRuleDeleteResponse, err error) { +// Patches a rule for a waiting room. +func (r *WaitingRoomRuleService) Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body WaitingRoomRuleUpdateParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomRuleDeleteResponseEnvelope + var env WaitingRoomRuleUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules/%s", zoneIdentifier, waitingRoomID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -58,13 +59,12 @@ func (r *WaitingRoomRuleService) Delete(ctx context.Context, zoneIdentifier stri return } -// Only available for the Waiting Room Advanced subscription. Creates a rule for a -// waiting room. -func (r *WaitingRoomRuleService) WaitingRoomNewWaitingRoomRule(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse, err error) { +// Lists rules for a waiting room. +func (r *WaitingRoomRuleService) List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingRoomRuleListResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelope + var env WaitingRoomRuleListResponseEnvelope path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules", zoneIdentifier, waitingRoomID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -72,12 +72,12 @@ func (r *WaitingRoomRuleService) WaitingRoomNewWaitingRoomRule(ctx context.Conte return } -// Lists rules for a waiting room. -func (r *WaitingRoomRuleService) WaitingRoomListWaitingRoomRules(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *[]WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse, err error) { +// Deletes a rule for a waiting room. +func (r *WaitingRoomRuleService) Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, opts ...option.RequestOption) (res *[]WaitingRoomRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules", zoneIdentifier, waitingRoomID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env WaitingRoomRuleDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules/%s", zoneIdentifier, waitingRoomID, ruleID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -87,9 +87,9 @@ func (r *WaitingRoomRuleService) WaitingRoomListWaitingRoomRules(ctx context.Con // Only available for the Waiting Room Advanced subscription. Replaces all rules // for a waiting room. -func (r *WaitingRoomRuleService) WaitingRoomReplaceWaitingRoomRules(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse, err error) { +func (r *WaitingRoomRuleService) Replace(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body WaitingRoomRuleReplaceParams, opts ...option.RequestOption) (res *[]WaitingRoomRuleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelope + var env WaitingRoomRuleReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/waiting_rooms/%v/rules", zoneIdentifier, waitingRoomID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -99,11 +99,11 @@ func (r *WaitingRoomRuleService) WaitingRoomReplaceWaitingRoomRules(ctx context. return } -type WaitingRoomRuleUpdateResponse struct { +type WaitingRoomRuleNewResponse struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. - Action WaitingRoomRuleUpdateResponseAction `json:"action"` + Action WaitingRoomRuleNewResponseAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. @@ -112,13 +112,13 @@ type WaitingRoomRuleUpdateResponse struct { Expression string `json:"expression"` LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. - Version string `json:"version"` - JSON waitingRoomRuleUpdateResponseJSON `json:"-"` + Version string `json:"version"` + JSON waitingRoomRuleNewResponseJSON `json:"-"` } -// waitingRoomRuleUpdateResponseJSON contains the JSON metadata for the struct -// [WaitingRoomRuleUpdateResponse] -type waitingRoomRuleUpdateResponseJSON struct { +// waitingRoomRuleNewResponseJSON contains the JSON metadata for the struct +// [WaitingRoomRuleNewResponse] +type waitingRoomRuleNewResponseJSON struct { ID apijson.Field Action apijson.Field Description apijson.Field @@ -130,22 +130,22 @@ type waitingRoomRuleUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to take when the expression matches. -type WaitingRoomRuleUpdateResponseAction string +type WaitingRoomRuleNewResponseAction string const ( - WaitingRoomRuleUpdateResponseActionBypassWaitingRoom WaitingRoomRuleUpdateResponseAction = "bypass_waiting_room" + WaitingRoomRuleNewResponseActionBypassWaitingRoom WaitingRoomRuleNewResponseAction = "bypass_waiting_room" ) -type WaitingRoomRuleDeleteResponse struct { +type WaitingRoomRuleUpdateResponse struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. - Action WaitingRoomRuleDeleteResponseAction `json:"action"` + Action WaitingRoomRuleUpdateResponseAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. @@ -155,12 +155,12 @@ type WaitingRoomRuleDeleteResponse struct { LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. Version string `json:"version"` - JSON waitingRoomRuleDeleteResponseJSON `json:"-"` + JSON waitingRoomRuleUpdateResponseJSON `json:"-"` } -// waitingRoomRuleDeleteResponseJSON contains the JSON metadata for the struct -// [WaitingRoomRuleDeleteResponse] -type waitingRoomRuleDeleteResponseJSON struct { +// waitingRoomRuleUpdateResponseJSON contains the JSON metadata for the struct +// [WaitingRoomRuleUpdateResponse] +type waitingRoomRuleUpdateResponseJSON struct { ID apijson.Field Action apijson.Field Description apijson.Field @@ -172,22 +172,22 @@ type waitingRoomRuleDeleteResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to take when the expression matches. -type WaitingRoomRuleDeleteResponseAction string +type WaitingRoomRuleUpdateResponseAction string const ( - WaitingRoomRuleDeleteResponseActionBypassWaitingRoom WaitingRoomRuleDeleteResponseAction = "bypass_waiting_room" + WaitingRoomRuleUpdateResponseActionBypassWaitingRoom WaitingRoomRuleUpdateResponseAction = "bypass_waiting_room" ) -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse struct { +type WaitingRoomRuleListResponse struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. - Action WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseAction `json:"action"` + Action WaitingRoomRuleListResponseAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. @@ -196,13 +196,13 @@ type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse struct { Expression string `json:"expression"` LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. - Version string `json:"version"` - JSON waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseJSON `json:"-"` + Version string `json:"version"` + JSON waitingRoomRuleListResponseJSON `json:"-"` } -// waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseJSON contains the JSON -// metadata for the struct [WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse] -type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseJSON struct { +// waitingRoomRuleListResponseJSON contains the JSON metadata for the struct +// [WaitingRoomRuleListResponse] +type waitingRoomRuleListResponseJSON struct { ID apijson.Field Action apijson.Field Description apijson.Field @@ -214,22 +214,22 @@ type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to take when the expression matches. -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseAction string +type WaitingRoomRuleListResponseAction string const ( - WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseActionBypassWaitingRoom WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseAction = "bypass_waiting_room" + WaitingRoomRuleListResponseActionBypassWaitingRoom WaitingRoomRuleListResponseAction = "bypass_waiting_room" ) -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse struct { +type WaitingRoomRuleDeleteResponse struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. - Action WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseAction `json:"action"` + Action WaitingRoomRuleDeleteResponseAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. @@ -238,13 +238,13 @@ type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse struct { Expression string `json:"expression"` LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. - Version string `json:"version"` - JSON waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseJSON `json:"-"` + Version string `json:"version"` + JSON waitingRoomRuleDeleteResponseJSON `json:"-"` } -// waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseJSON contains the JSON -// metadata for the struct [WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse] -type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseJSON struct { +// waitingRoomRuleDeleteResponseJSON contains the JSON metadata for the struct +// [WaitingRoomRuleDeleteResponse] +type waitingRoomRuleDeleteResponseJSON struct { ID apijson.Field Action apijson.Field Description apijson.Field @@ -256,22 +256,22 @@ type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to take when the expression matches. -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseAction string +type WaitingRoomRuleDeleteResponseAction string const ( - WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseActionBypassWaitingRoom WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseAction = "bypass_waiting_room" + WaitingRoomRuleDeleteResponseActionBypassWaitingRoom WaitingRoomRuleDeleteResponseAction = "bypass_waiting_room" ) -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse struct { +type WaitingRoomRuleReplaceResponse struct { // The ID of the rule. ID string `json:"id"` // The action to take when the expression matches. - Action WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseAction `json:"action"` + Action WaitingRoomRuleReplaceResponseAction `json:"action"` // The description of the rule. Description string `json:"description"` // When set to true, the rule is enabled. @@ -280,14 +280,13 @@ type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse struct { Expression string `json:"expression"` LastUpdated time.Time `json:"last_updated" format:"date-time"` // The version of the rule. - Version string `json:"version"` - JSON waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseJSON `json:"-"` + Version string `json:"version"` + JSON waitingRoomRuleReplaceResponseJSON `json:"-"` } -// waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseJSON contains the JSON -// metadata for the struct -// [WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse] -type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseJSON struct { +// waitingRoomRuleReplaceResponseJSON contains the JSON metadata for the struct +// [WaitingRoomRuleReplaceResponse] +type waitingRoomRuleReplaceResponseJSON struct { ID apijson.Field Action apijson.Field Description apijson.Field @@ -299,77 +298,52 @@ type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // The action to take when the expression matches. -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseAction string +type WaitingRoomRuleReplaceResponseAction string const ( - WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseActionBypassWaitingRoom WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseAction = "bypass_waiting_room" + WaitingRoomRuleReplaceResponseActionBypassWaitingRoom WaitingRoomRuleReplaceResponseAction = "bypass_waiting_room" ) -type WaitingRoomRuleUpdateParams struct { +type WaitingRoomRuleNewParams struct { // The action to take when the expression matches. - Action param.Field[WaitingRoomRuleUpdateParamsAction] `json:"action,required"` + Action param.Field[WaitingRoomRuleNewParamsAction] `json:"action,required"` // Criteria defining when there is a match for the current rule. Expression param.Field[string] `json:"expression,required"` // The description of the rule. Description param.Field[string] `json:"description"` // When set to true, the rule is enabled. Enabled param.Field[bool] `json:"enabled"` - // Reorder the position of a rule - Position param.Field[WaitingRoomRuleUpdateParamsPosition] `json:"position"` } -func (r WaitingRoomRuleUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomRuleNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to take when the expression matches. -type WaitingRoomRuleUpdateParamsAction string +type WaitingRoomRuleNewParamsAction string const ( - WaitingRoomRuleUpdateParamsActionBypassWaitingRoom WaitingRoomRuleUpdateParamsAction = "bypass_waiting_room" + WaitingRoomRuleNewParamsActionBypassWaitingRoom WaitingRoomRuleNewParamsAction = "bypass_waiting_room" ) -// Reorder the position of a rule -// -// Satisfied by [WaitingRoomRuleUpdateParamsPositionObject], -// [WaitingRoomRuleUpdateParamsPositionObject], -// [WaitingRoomRuleUpdateParamsPositionObject]. -type WaitingRoomRuleUpdateParamsPosition interface { - implementsWaitingRoomRuleUpdateParamsPosition() -} - -type WaitingRoomRuleUpdateParamsPositionObject struct { - // Places the rule in the exact position specified by the integer number - // . Position numbers start with 1. Existing rules in the ruleset - // from the specified position number onward are shifted one position (no rule is - // overwritten). - Index param.Field[int64] `json:"index"` -} - -func (r WaitingRoomRuleUpdateParamsPositionObject) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -func (r WaitingRoomRuleUpdateParamsPositionObject) implementsWaitingRoomRuleUpdateParamsPosition() {} - -type WaitingRoomRuleUpdateResponseEnvelope struct { - Errors []WaitingRoomRuleUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomRuleUpdateResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomRuleUpdateResponse `json:"result,required,nullable"` +type WaitingRoomRuleNewResponseEnvelope struct { + Errors []WaitingRoomRuleNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomRuleNewResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomRuleNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WaitingRoomRuleUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomRuleUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomRuleUpdateResponseEnvelopeJSON `json:"-"` + Success WaitingRoomRuleNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomRuleNewResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomRuleNewResponseEnvelopeJSON `json:"-"` } -// waitingRoomRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [WaitingRoomRuleUpdateResponseEnvelope] -type waitingRoomRuleUpdateResponseEnvelopeJSON struct { +// waitingRoomRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [WaitingRoomRuleNewResponseEnvelope] +type waitingRoomRuleNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -379,56 +353,56 @@ type waitingRoomRuleUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WaitingRoomRuleNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleNewResponseEnvelopeErrorsJSON `json:"-"` } -// waitingRoomRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [WaitingRoomRuleUpdateResponseEnvelopeErrors] -type waitingRoomRuleUpdateResponseEnvelopeErrorsJSON struct { +// waitingRoomRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WaitingRoomRuleNewResponseEnvelopeErrors] +type waitingRoomRuleNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WaitingRoomRuleNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleNewResponseEnvelopeMessagesJSON `json:"-"` } -// waitingRoomRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [WaitingRoomRuleUpdateResponseEnvelopeMessages] -type waitingRoomRuleUpdateResponseEnvelopeMessagesJSON struct { +// waitingRoomRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WaitingRoomRuleNewResponseEnvelopeMessages] +type waitingRoomRuleNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WaitingRoomRuleUpdateResponseEnvelopeSuccess bool +type WaitingRoomRuleNewResponseEnvelopeSuccess bool const ( - WaitingRoomRuleUpdateResponseEnvelopeSuccessTrue WaitingRoomRuleUpdateResponseEnvelopeSuccess = true + WaitingRoomRuleNewResponseEnvelopeSuccessTrue WaitingRoomRuleNewResponseEnvelopeSuccess = true ) -type WaitingRoomRuleUpdateResponseEnvelopeResultInfo struct { +type WaitingRoomRuleNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -436,13 +410,13 @@ type WaitingRoomRuleUpdateResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON waitingRoomRuleNewResponseEnvelopeResultInfoJSON `json:"-"` } -// waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [WaitingRoomRuleUpdateResponseEnvelopeResultInfo] -type waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON struct { +// waitingRoomRuleNewResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [WaitingRoomRuleNewResponseEnvelopeResultInfo] +type waitingRoomRuleNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -451,23 +425,70 @@ type waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleDeleteResponseEnvelope struct { - Errors []WaitingRoomRuleDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomRuleDeleteResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomRuleDeleteResponse `json:"result,required,nullable"` +type WaitingRoomRuleUpdateParams struct { + // The action to take when the expression matches. + Action param.Field[WaitingRoomRuleUpdateParamsAction] `json:"action,required"` + // Criteria defining when there is a match for the current rule. + Expression param.Field[string] `json:"expression,required"` + // The description of the rule. + Description param.Field[string] `json:"description"` + // When set to true, the rule is enabled. + Enabled param.Field[bool] `json:"enabled"` + // Reorder the position of a rule + Position param.Field[WaitingRoomRuleUpdateParamsPosition] `json:"position"` +} + +func (r WaitingRoomRuleUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The action to take when the expression matches. +type WaitingRoomRuleUpdateParamsAction string + +const ( + WaitingRoomRuleUpdateParamsActionBypassWaitingRoom WaitingRoomRuleUpdateParamsAction = "bypass_waiting_room" +) + +// Reorder the position of a rule +// +// Satisfied by [WaitingRoomRuleUpdateParamsPositionObject], +// [WaitingRoomRuleUpdateParamsPositionObject], +// [WaitingRoomRuleUpdateParamsPositionObject]. +type WaitingRoomRuleUpdateParamsPosition interface { + implementsWaitingRoomRuleUpdateParamsPosition() +} + +type WaitingRoomRuleUpdateParamsPositionObject struct { + // Places the rule in the exact position specified by the integer number + // . Position numbers start with 1. Existing rules in the ruleset + // from the specified position number onward are shifted one position (no rule is + // overwritten). + Index param.Field[int64] `json:"index"` +} + +func (r WaitingRoomRuleUpdateParamsPositionObject) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +func (r WaitingRoomRuleUpdateParamsPositionObject) implementsWaitingRoomRuleUpdateParamsPosition() {} + +type WaitingRoomRuleUpdateResponseEnvelope struct { + Errors []WaitingRoomRuleUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomRuleUpdateResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomRuleUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WaitingRoomRuleDeleteResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomRuleDeleteResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomRuleDeleteResponseEnvelopeJSON `json:"-"` + Success WaitingRoomRuleUpdateResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomRuleUpdateResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomRuleUpdateResponseEnvelopeJSON `json:"-"` } -// waitingRoomRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [WaitingRoomRuleDeleteResponseEnvelope] -type waitingRoomRuleDeleteResponseEnvelopeJSON struct { +// waitingRoomRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomRuleUpdateResponseEnvelope] +type waitingRoomRuleUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -477,56 +498,56 @@ type waitingRoomRuleDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleDeleteResponseEnvelopeErrors struct { +type WaitingRoomRuleUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON waitingRoomRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` + JSON waitingRoomRuleUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// waitingRoomRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [WaitingRoomRuleDeleteResponseEnvelopeErrors] -type waitingRoomRuleDeleteResponseEnvelopeErrorsJSON struct { +// waitingRoomRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WaitingRoomRuleUpdateResponseEnvelopeErrors] +type waitingRoomRuleUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleDeleteResponseEnvelopeMessages struct { +type WaitingRoomRuleUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON waitingRoomRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` + JSON waitingRoomRuleUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// waitingRoomRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [WaitingRoomRuleDeleteResponseEnvelopeMessages] -type waitingRoomRuleDeleteResponseEnvelopeMessagesJSON struct { +// waitingRoomRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WaitingRoomRuleUpdateResponseEnvelopeMessages] +type waitingRoomRuleUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WaitingRoomRuleDeleteResponseEnvelopeSuccess bool +type WaitingRoomRuleUpdateResponseEnvelopeSuccess bool const ( - WaitingRoomRuleDeleteResponseEnvelopeSuccessTrue WaitingRoomRuleDeleteResponseEnvelopeSuccess = true + WaitingRoomRuleUpdateResponseEnvelopeSuccessTrue WaitingRoomRuleUpdateResponseEnvelopeSuccess = true ) -type WaitingRoomRuleDeleteResponseEnvelopeResultInfo struct { +type WaitingRoomRuleUpdateResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -535,12 +556,12 @@ type WaitingRoomRuleDeleteResponseEnvelopeResultInfo struct { PerPage float64 `json:"per_page"` // Total results available without any search parameters TotalCount float64 `json:"total_count"` - JSON waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON `json:"-"` + JSON waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON `json:"-"` } -// waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata -// for the struct [WaitingRoomRuleDeleteResponseEnvelopeResultInfo] -type waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON struct { +// waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [WaitingRoomRuleUpdateResponseEnvelopeResultInfo] +type waitingRoomRuleUpdateResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -549,46 +570,23 @@ type waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParams struct { - // The action to take when the expression matches. - Action param.Field[WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParamsAction] `json:"action,required"` - // Criteria defining when there is a match for the current rule. - Expression param.Field[string] `json:"expression,required"` - // The description of the rule. - Description param.Field[string] `json:"description"` - // When set to true, the rule is enabled. - Enabled param.Field[bool] `json:"enabled"` -} - -func (r WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -// The action to take when the expression matches. -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParamsAction string - -const ( - WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParamsActionBypassWaitingRoom WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParamsAction = "bypass_waiting_room" -) - -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelope struct { - Errors []WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponse `json:"result,required,nullable"` +type WaitingRoomRuleListResponseEnvelope struct { + Errors []WaitingRoomRuleListResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomRuleListResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomRuleListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeJSON `json:"-"` + Success WaitingRoomRuleListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomRuleListResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomRuleListResponseEnvelopeJSON `json:"-"` } -// waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelope] -type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeJSON struct { +// waitingRoomRuleListResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomRuleListResponseEnvelope] +type waitingRoomRuleListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -598,58 +596,56 @@ type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrorsJSON `json:"-"` +type WaitingRoomRuleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleListResponseEnvelopeErrorsJSON `json:"-"` } -// waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrors] -type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrorsJSON struct { +// waitingRoomRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WaitingRoomRuleListResponseEnvelopeErrors] +type waitingRoomRuleListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessagesJSON `json:"-"` +type WaitingRoomRuleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleListResponseEnvelopeMessagesJSON `json:"-"` } -// waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessages] -type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessagesJSON struct { +// waitingRoomRuleListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WaitingRoomRuleListResponseEnvelopeMessages] +type waitingRoomRuleListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeSuccess bool +type WaitingRoomRuleListResponseEnvelopeSuccess bool const ( - WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeSuccessTrue WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeSuccess = true + WaitingRoomRuleListResponseEnvelopeSuccessTrue WaitingRoomRuleListResponseEnvelopeSuccess = true ) -type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfo struct { +type WaitingRoomRuleListResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -657,14 +653,13 @@ type WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfo stru // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON waitingRoomRuleListResponseEnvelopeResultInfoJSON `json:"-"` } -// waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfo] -type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfoJSON struct { +// waitingRoomRuleListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [WaitingRoomRuleListResponseEnvelopeResultInfo] +type waitingRoomRuleListResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -673,24 +668,23 @@ type waitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfoJSON ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomNewWaitingRoomRuleResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelope struct { - Errors []WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponse `json:"result,required,nullable"` +type WaitingRoomRuleDeleteResponseEnvelope struct { + Errors []WaitingRoomRuleDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomRuleDeleteResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomRuleDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeJSON `json:"-"` + Success WaitingRoomRuleDeleteResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomRuleDeleteResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomRuleDeleteResponseEnvelopeJSON `json:"-"` } -// waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelope] -type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeJSON struct { +// waitingRoomRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomRuleDeleteResponseEnvelope] +type waitingRoomRuleDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -700,58 +694,56 @@ type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrorsJSON `json:"-"` +type WaitingRoomRuleDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrors] -type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrorsJSON struct { +// waitingRoomRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WaitingRoomRuleDeleteResponseEnvelopeErrors] +type waitingRoomRuleDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessagesJSON `json:"-"` +type WaitingRoomRuleDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessages] -type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessagesJSON struct { +// waitingRoomRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WaitingRoomRuleDeleteResponseEnvelopeMessages] +type waitingRoomRuleDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeSuccess bool +type WaitingRoomRuleDeleteResponseEnvelopeSuccess bool const ( - WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeSuccessTrue WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeSuccess = true + WaitingRoomRuleDeleteResponseEnvelopeSuccessTrue WaitingRoomRuleDeleteResponseEnvelopeSuccess = true ) -type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfo struct { +type WaitingRoomRuleDeleteResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -759,14 +751,13 @@ type WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfo st // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON `json:"-"` } -// waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfo] -type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfoJSON struct { +// waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [WaitingRoomRuleDeleteResponseEnvelopeResultInfo] +type waitingRoomRuleDeleteResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -775,21 +766,21 @@ type waitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfoJSO ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomListWaitingRoomRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParams struct { - Body param.Field[[]WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBody] `json:"body,required"` +type WaitingRoomRuleReplaceParams struct { + Body param.Field[[]WaitingRoomRuleReplaceParamsBody] `json:"body,required"` } -func (r WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParams) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomRuleReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBody struct { +type WaitingRoomRuleReplaceParamsBody struct { // The action to take when the expression matches. - Action param.Field[WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyAction] `json:"action,required"` + Action param.Field[WaitingRoomRuleReplaceParamsBodyAction] `json:"action,required"` // Criteria defining when there is a match for the current rule. Expression param.Field[string] `json:"expression,required"` // The description of the rule. @@ -798,31 +789,30 @@ type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBody struct { Enabled param.Field[bool] `json:"enabled"` } -func (r WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBody) MarshalJSON() (data []byte, err error) { +func (r WaitingRoomRuleReplaceParamsBody) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // The action to take when the expression matches. -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyAction string +type WaitingRoomRuleReplaceParamsBodyAction string const ( - WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyActionBypassWaitingRoom WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyAction = "bypass_waiting_room" + WaitingRoomRuleReplaceParamsBodyActionBypassWaitingRoom WaitingRoomRuleReplaceParamsBodyAction = "bypass_waiting_room" ) -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelope struct { - Errors []WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrors `json:"errors,required"` - Messages []WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessages `json:"messages,required"` - Result []WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponse `json:"result,required,nullable"` +type WaitingRoomRuleReplaceResponseEnvelope struct { + Errors []WaitingRoomRuleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WaitingRoomRuleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result []WaitingRoomRuleReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo `json:"result_info"` - JSON waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeJSON `json:"-"` + Success WaitingRoomRuleReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WaitingRoomRuleReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON waitingRoomRuleReplaceResponseEnvelopeJSON `json:"-"` } -// waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelope] -type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeJSON struct { +// waitingRoomRuleReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomRuleReplaceResponseEnvelope] +type waitingRoomRuleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -832,58 +822,56 @@ type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrorsJSON `json:"-"` +type WaitingRoomRuleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrors] -type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrorsJSON struct { +// waitingRoomRuleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WaitingRoomRuleReplaceResponseEnvelopeErrors] +type waitingRoomRuleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessagesJSON `json:"-"` +type WaitingRoomRuleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON waitingRoomRuleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessages] -type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessagesJSON struct { +// waitingRoomRuleReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WaitingRoomRuleReplaceResponseEnvelopeMessages] +type waitingRoomRuleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeSuccess bool +type WaitingRoomRuleReplaceResponseEnvelopeSuccess bool const ( - WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeSuccessTrue WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeSuccess = true + WaitingRoomRuleReplaceResponseEnvelopeSuccessTrue WaitingRoomRuleReplaceResponseEnvelopeSuccess = true ) -type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo struct { +type WaitingRoomRuleReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -891,14 +879,13 @@ type WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON waitingRoomRuleReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo] -type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfoJSON struct { +// waitingRoomRuleReplaceResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [WaitingRoomRuleReplaceResponseEnvelopeResultInfo] +type waitingRoomRuleReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -907,6 +894,6 @@ type waitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo ExtraFields map[string]apijson.Field } -func (r *WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomRuleReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/waitingroomrule_test.go b/waitingroomrule_test.go index da5e827e5f9..37b8fa3cb6a 100644 --- a/waitingroomrule_test.go +++ b/waitingroomrule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWaitingRoomRuleUpdateWithOptionalParams(t *testing.T) { +func TestWaitingRoomRuleNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,19 +29,15 @@ func TestWaitingRoomRuleUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Rules.Update( + _, err := client.WaitingRooms.Rules.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - "25756b2dfe6e378a06b033b670413757", - cloudflare.WaitingRoomRuleUpdateParams{ - Action: cloudflare.F(cloudflare.WaitingRoomRuleUpdateParamsActionBypassWaitingRoom), + cloudflare.WaitingRoomRuleNewParams{ + Action: cloudflare.F(cloudflare.WaitingRoomRuleNewParamsActionBypassWaitingRoom), Expression: cloudflare.F("ip.src in {10.20.30.40}"), Description: cloudflare.F("allow all traffic from 10.20.30.40"), Enabled: cloudflare.F(true), - Position: cloudflare.F[cloudflare.WaitingRoomRuleUpdateParamsPosition](cloudflare.WaitingRoomRuleUpdateParamsPositionObject(cloudflare.WaitingRoomRuleUpdateParamsPositionObject{ - Index: cloudflare.F(int64(0)), - })), }, ) if err != nil { @@ -53,7 +49,7 @@ func TestWaitingRoomRuleUpdateWithOptionalParams(t *testing.T) { } } -func TestWaitingRoomRuleDelete(t *testing.T) { +func TestWaitingRoomRuleUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -69,11 +65,20 @@ func TestWaitingRoomRuleDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Rules.Delete( + _, err := client.WaitingRooms.Rules.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", "25756b2dfe6e378a06b033b670413757", + cloudflare.WaitingRoomRuleUpdateParams{ + Action: cloudflare.F(cloudflare.WaitingRoomRuleUpdateParamsActionBypassWaitingRoom), + Expression: cloudflare.F("ip.src in {10.20.30.40}"), + Description: cloudflare.F("allow all traffic from 10.20.30.40"), + Enabled: cloudflare.F(true), + Position: cloudflare.F[cloudflare.WaitingRoomRuleUpdateParamsPosition](cloudflare.WaitingRoomRuleUpdateParamsPositionObject(cloudflare.WaitingRoomRuleUpdateParamsPositionObject{ + Index: cloudflare.F(int64(0)), + })), + }, ) if err != nil { var apierr *cloudflare.Error @@ -84,7 +89,7 @@ func TestWaitingRoomRuleDelete(t *testing.T) { } } -func TestWaitingRoomRuleWaitingRoomNewWaitingRoomRuleWithOptionalParams(t *testing.T) { +func TestWaitingRoomRuleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -100,16 +105,10 @@ func TestWaitingRoomRuleWaitingRoomNewWaitingRoomRuleWithOptionalParams(t *testi option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Rules.WaitingRoomNewWaitingRoomRule( + _, err := client.WaitingRooms.Rules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - cloudflare.WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParams{ - Action: cloudflare.F(cloudflare.WaitingRoomRuleWaitingRoomNewWaitingRoomRuleParamsActionBypassWaitingRoom), - Expression: cloudflare.F("ip.src in {10.20.30.40}"), - Description: cloudflare.F("allow all traffic from 10.20.30.40"), - Enabled: cloudflare.F(true), - }, ) if err != nil { var apierr *cloudflare.Error @@ -120,7 +119,7 @@ func TestWaitingRoomRuleWaitingRoomNewWaitingRoomRuleWithOptionalParams(t *testi } } -func TestWaitingRoomRuleWaitingRoomListWaitingRoomRules(t *testing.T) { +func TestWaitingRoomRuleDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -136,10 +135,11 @@ func TestWaitingRoomRuleWaitingRoomListWaitingRoomRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Rules.WaitingRoomListWaitingRoomRules( + _, err := client.WaitingRooms.Rules.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", + "25756b2dfe6e378a06b033b670413757", ) if err != nil { var apierr *cloudflare.Error @@ -150,7 +150,7 @@ func TestWaitingRoomRuleWaitingRoomListWaitingRoomRules(t *testing.T) { } } -func TestWaitingRoomRuleWaitingRoomReplaceWaitingRoomRules(t *testing.T) { +func TestWaitingRoomRuleReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -166,23 +166,23 @@ func TestWaitingRoomRuleWaitingRoomReplaceWaitingRoomRules(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Rules.WaitingRoomReplaceWaitingRoomRules( + _, err := client.WaitingRooms.Rules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", - cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParams{ - Body: cloudflare.F([]cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBody{{ - Action: cloudflare.F(cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyActionBypassWaitingRoom), + cloudflare.WaitingRoomRuleReplaceParams{ + Body: cloudflare.F([]cloudflare.WaitingRoomRuleReplaceParamsBody{{ + Action: cloudflare.F(cloudflare.WaitingRoomRuleReplaceParamsBodyActionBypassWaitingRoom), Description: cloudflare.F("allow all traffic from 10.20.30.40"), Enabled: cloudflare.F(true), Expression: cloudflare.F("ip.src in {10.20.30.40}"), }, { - Action: cloudflare.F(cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyActionBypassWaitingRoom), + Action: cloudflare.F(cloudflare.WaitingRoomRuleReplaceParamsBodyActionBypassWaitingRoom), Description: cloudflare.F("allow all traffic from 10.20.30.40"), Enabled: cloudflare.F(true), Expression: cloudflare.F("ip.src in {10.20.30.40}"), }, { - Action: cloudflare.F(cloudflare.WaitingRoomRuleWaitingRoomReplaceWaitingRoomRulesParamsBodyActionBypassWaitingRoom), + Action: cloudflare.F(cloudflare.WaitingRoomRuleReplaceParamsBodyActionBypassWaitingRoom), Description: cloudflare.F("allow all traffic from 10.20.30.40"), Enabled: cloudflare.F(true), Expression: cloudflare.F("ip.src in {10.20.30.40}"), diff --git a/waitingroomstatus.go b/waitingroomstatus.go index b194581b913..ff1ddc5fde9 100644 --- a/waitingroomstatus.go +++ b/waitingroomstatus.go @@ -48,9 +48,9 @@ func NewWaitingRoomStatusService(opts ...option.RequestOption) (r *WaitingRoomSt // currently active on the origin. // 5. `max_estimated_time_minutes`: Integer of the maximum estimated time currently // presented to the users. -func (r *WaitingRoomStatusService) WaitingRoomGetWaitingRoomStatus(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse, err error) { +func (r *WaitingRoomStatusService) Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, opts ...option.RequestOption) (res *WaitingRoomStatusGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelope + var env WaitingRoomStatusGetResponseEnvelope path := fmt.Sprintf("zones/%s/waiting_rooms/%v/status", zoneIdentifier, waitingRoomID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -60,19 +60,18 @@ func (r *WaitingRoomStatusService) WaitingRoomGetWaitingRoomStatus(ctx context.C return } -type WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse struct { - EstimatedQueuedUsers int64 `json:"estimated_queued_users"` - EstimatedTotalActiveUsers int64 `json:"estimated_total_active_users"` - EventID string `json:"event_id"` - MaxEstimatedTimeMinutes int64 `json:"max_estimated_time_minutes"` - Status WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatus `json:"status"` - JSON waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseJSON `json:"-"` +type WaitingRoomStatusGetResponse struct { + EstimatedQueuedUsers int64 `json:"estimated_queued_users"` + EstimatedTotalActiveUsers int64 `json:"estimated_total_active_users"` + EventID string `json:"event_id"` + MaxEstimatedTimeMinutes int64 `json:"max_estimated_time_minutes"` + Status WaitingRoomStatusGetResponseStatus `json:"status"` + JSON waitingRoomStatusGetResponseJSON `json:"-"` } -// waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseJSON contains the JSON -// metadata for the struct -// [WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse] -type waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseJSON struct { +// waitingRoomStatusGetResponseJSON contains the JSON metadata for the struct +// [WaitingRoomStatusGetResponse] +type waitingRoomStatusGetResponseJSON struct { EstimatedQueuedUsers apijson.Field EstimatedTotalActiveUsers apijson.Field EventID apijson.Field @@ -82,32 +81,31 @@ type waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomStatusGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatus string +type WaitingRoomStatusGetResponseStatus string const ( - WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatusEventPrequeueing WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatus = "event_prequeueing" - WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatusNotQueueing WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatus = "not_queueing" - WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatusQueueing WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseStatus = "queueing" + WaitingRoomStatusGetResponseStatusEventPrequeueing WaitingRoomStatusGetResponseStatus = "event_prequeueing" + WaitingRoomStatusGetResponseStatusNotQueueing WaitingRoomStatusGetResponseStatus = "not_queueing" + WaitingRoomStatusGetResponseStatusQueueing WaitingRoomStatusGetResponseStatus = "queueing" ) -type WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelope struct { - Result WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponse `json:"result,required"` - JSON waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelopeJSON `json:"-"` +type WaitingRoomStatusGetResponseEnvelope struct { + Result WaitingRoomStatusGetResponse `json:"result,required"` + JSON waitingRoomStatusGetResponseEnvelopeJSON `json:"-"` } -// waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelope] -type waitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelopeJSON struct { +// waitingRoomStatusGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [WaitingRoomStatusGetResponseEnvelope] +type waitingRoomStatusGetResponseEnvelopeJSON struct { Result apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WaitingRoomStatusWaitingRoomGetWaitingRoomStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WaitingRoomStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/waitingroomstatus_test.go b/waitingroomstatus_test.go index 21e6095757b..3ebbd2e5c51 100644 --- a/waitingroomstatus_test.go +++ b/waitingroomstatus_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWaitingRoomStatusWaitingRoomGetWaitingRoomStatus(t *testing.T) { +func TestWaitingRoomStatusGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWaitingRoomStatusWaitingRoomGetWaitingRoomStatus(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WaitingRooms.Statuses.WaitingRoomGetWaitingRoomStatus( + _, err := client.WaitingRooms.Statuses.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "699d98642c564d2e855e9661899b7252", diff --git a/web3hostname.go b/web3hostname.go index 79e268749b8..dceae3a9e94 100644 --- a/web3hostname.go +++ b/web3hostname.go @@ -34,12 +34,12 @@ func NewWeb3HostnameService(opts ...option.RequestOption) (r *Web3HostnameServic return } -// Edit Web3 Hostname -func (r *Web3HostnameService) Update(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameUpdateParams, opts ...option.RequestOption) (res *Web3HostnameUpdateResponse, err error) { +// Create Web3 Hostname +func (r *Web3HostnameService) New(ctx context.Context, zoneIdentifier string, body Web3HostnameNewParams, opts ...option.RequestOption) (res *Web3HostnameNewResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + var env Web3HostnameNewResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames", zoneIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -47,12 +47,12 @@ func (r *Web3HostnameService) Update(ctx context.Context, zoneIdentifier string, return } -// Delete Web3 Hostname -func (r *Web3HostnameService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameDeleteResponse, err error) { +// Edit Web3 Hostname +func (r *Web3HostnameService) Update(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameUpdateParams, opts ...option.RequestOption) (res *Web3HostnameUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameDeleteResponseEnvelope + var env Web3HostnameUpdateResponseEnvelope path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -60,11 +60,11 @@ func (r *Web3HostnameService) Delete(ctx context.Context, zoneIdentifier string, return } -// Web3 Hostname Details -func (r *Web3HostnameService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameGetResponse, err error) { +// List Web3 Hostnames +func (r *Web3HostnameService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]Web3HostnameListResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameGetResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) + var env Web3HostnameListResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames", zoneIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -73,12 +73,12 @@ func (r *Web3HostnameService) Get(ctx context.Context, zoneIdentifier string, id return } -// Create Web3 Hostname -func (r *Web3HostnameService) Web3HostnameNewWeb3Hostname(ctx context.Context, zoneIdentifier string, body Web3HostnameWeb3HostnameNewWeb3HostnameParams, opts ...option.RequestOption) (res *Web3HostnameWeb3HostnameNewWeb3HostnameResponse, err error) { +// Delete Web3 Hostname +func (r *Web3HostnameService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env Web3HostnameDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -86,11 +86,11 @@ func (r *Web3HostnameService) Web3HostnameNewWeb3Hostname(ctx context.Context, z return } -// List Web3 Hostnames -func (r *Web3HostnameService) Web3HostnameListWeb3Hostnames(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]Web3HostnameWeb3HostnameListWeb3HostnamesResponse, err error) { +// Web3 Hostname Details +func (r *Web3HostnameService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameGetResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames", zoneIdentifier) + var env Web3HostnameGetResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -99,7 +99,7 @@ func (r *Web3HostnameService) Web3HostnameListWeb3Hostnames(ctx context.Context, return } -type Web3HostnameUpdateResponse struct { +type Web3HostnameNewResponse struct { // Identifier ID string `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` @@ -111,15 +111,15 @@ type Web3HostnameUpdateResponse struct { // The hostname that will point to the target gateway via CNAME. Name string `json:"name"` // Status of the hostname's activation. - Status Web3HostnameUpdateResponseStatus `json:"status"` + Status Web3HostnameNewResponseStatus `json:"status"` // Target gateway of the hostname. - Target Web3HostnameUpdateResponseTarget `json:"target"` - JSON web3HostnameUpdateResponseJSON `json:"-"` + Target Web3HostnameNewResponseTarget `json:"target"` + JSON web3HostnameNewResponseJSON `json:"-"` } -// web3HostnameUpdateResponseJSON contains the JSON metadata for the struct -// [Web3HostnameUpdateResponse] -type web3HostnameUpdateResponseJSON struct { +// web3HostnameNewResponseJSON contains the JSON metadata for the struct +// [Web3HostnameNewResponse] +type web3HostnameNewResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Description apijson.Field @@ -132,48 +132,30 @@ type web3HostnameUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the hostname's activation. -type Web3HostnameUpdateResponseStatus string +type Web3HostnameNewResponseStatus string const ( - Web3HostnameUpdateResponseStatusActive Web3HostnameUpdateResponseStatus = "active" - Web3HostnameUpdateResponseStatusPending Web3HostnameUpdateResponseStatus = "pending" - Web3HostnameUpdateResponseStatusDeleting Web3HostnameUpdateResponseStatus = "deleting" - Web3HostnameUpdateResponseStatusError Web3HostnameUpdateResponseStatus = "error" + Web3HostnameNewResponseStatusActive Web3HostnameNewResponseStatus = "active" + Web3HostnameNewResponseStatusPending Web3HostnameNewResponseStatus = "pending" + Web3HostnameNewResponseStatusDeleting Web3HostnameNewResponseStatus = "deleting" + Web3HostnameNewResponseStatusError Web3HostnameNewResponseStatus = "error" ) // Target gateway of the hostname. -type Web3HostnameUpdateResponseTarget string +type Web3HostnameNewResponseTarget string const ( - Web3HostnameUpdateResponseTargetEthereum Web3HostnameUpdateResponseTarget = "ethereum" - Web3HostnameUpdateResponseTargetIpfs Web3HostnameUpdateResponseTarget = "ipfs" - Web3HostnameUpdateResponseTargetIpfsUniversalPath Web3HostnameUpdateResponseTarget = "ipfs_universal_path" + Web3HostnameNewResponseTargetEthereum Web3HostnameNewResponseTarget = "ethereum" + Web3HostnameNewResponseTargetIpfs Web3HostnameNewResponseTarget = "ipfs" + Web3HostnameNewResponseTargetIpfsUniversalPath Web3HostnameNewResponseTarget = "ipfs_universal_path" ) -type Web3HostnameDeleteResponse struct { - // Identifier - ID string `json:"id,required"` - JSON web3HostnameDeleteResponseJSON `json:"-"` -} - -// web3HostnameDeleteResponseJSON contains the JSON metadata for the struct -// [Web3HostnameDeleteResponse] -type web3HostnameDeleteResponseJSON struct { - ID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type Web3HostnameGetResponse struct { +type Web3HostnameUpdateResponse struct { // Identifier ID string `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` @@ -185,15 +167,15 @@ type Web3HostnameGetResponse struct { // The hostname that will point to the target gateway via CNAME. Name string `json:"name"` // Status of the hostname's activation. - Status Web3HostnameGetResponseStatus `json:"status"` + Status Web3HostnameUpdateResponseStatus `json:"status"` // Target gateway of the hostname. - Target Web3HostnameGetResponseTarget `json:"target"` - JSON web3HostnameGetResponseJSON `json:"-"` + Target Web3HostnameUpdateResponseTarget `json:"target"` + JSON web3HostnameUpdateResponseJSON `json:"-"` } -// web3HostnameGetResponseJSON contains the JSON metadata for the struct -// [Web3HostnameGetResponse] -type web3HostnameGetResponseJSON struct { +// web3HostnameUpdateResponseJSON contains the JSON metadata for the struct +// [Web3HostnameUpdateResponse] +type web3HostnameUpdateResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Description apijson.Field @@ -206,30 +188,30 @@ type web3HostnameGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the hostname's activation. -type Web3HostnameGetResponseStatus string +type Web3HostnameUpdateResponseStatus string const ( - Web3HostnameGetResponseStatusActive Web3HostnameGetResponseStatus = "active" - Web3HostnameGetResponseStatusPending Web3HostnameGetResponseStatus = "pending" - Web3HostnameGetResponseStatusDeleting Web3HostnameGetResponseStatus = "deleting" - Web3HostnameGetResponseStatusError Web3HostnameGetResponseStatus = "error" + Web3HostnameUpdateResponseStatusActive Web3HostnameUpdateResponseStatus = "active" + Web3HostnameUpdateResponseStatusPending Web3HostnameUpdateResponseStatus = "pending" + Web3HostnameUpdateResponseStatusDeleting Web3HostnameUpdateResponseStatus = "deleting" + Web3HostnameUpdateResponseStatusError Web3HostnameUpdateResponseStatus = "error" ) // Target gateway of the hostname. -type Web3HostnameGetResponseTarget string +type Web3HostnameUpdateResponseTarget string const ( - Web3HostnameGetResponseTargetEthereum Web3HostnameGetResponseTarget = "ethereum" - Web3HostnameGetResponseTargetIpfs Web3HostnameGetResponseTarget = "ipfs" - Web3HostnameGetResponseTargetIpfsUniversalPath Web3HostnameGetResponseTarget = "ipfs_universal_path" + Web3HostnameUpdateResponseTargetEthereum Web3HostnameUpdateResponseTarget = "ethereum" + Web3HostnameUpdateResponseTargetIpfs Web3HostnameUpdateResponseTarget = "ipfs" + Web3HostnameUpdateResponseTargetIpfsUniversalPath Web3HostnameUpdateResponseTarget = "ipfs_universal_path" ) -type Web3HostnameWeb3HostnameNewWeb3HostnameResponse struct { +type Web3HostnameListResponse struct { // Identifier ID string `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` @@ -241,15 +223,15 @@ type Web3HostnameWeb3HostnameNewWeb3HostnameResponse struct { // The hostname that will point to the target gateway via CNAME. Name string `json:"name"` // Status of the hostname's activation. - Status Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus `json:"status"` + Status Web3HostnameListResponseStatus `json:"status"` // Target gateway of the hostname. - Target Web3HostnameWeb3HostnameNewWeb3HostnameResponseTarget `json:"target"` - JSON web3HostnameWeb3HostnameNewWeb3HostnameResponseJSON `json:"-"` + Target Web3HostnameListResponseTarget `json:"target"` + JSON web3HostnameListResponseJSON `json:"-"` } -// web3HostnameWeb3HostnameNewWeb3HostnameResponseJSON contains the JSON metadata -// for the struct [Web3HostnameWeb3HostnameNewWeb3HostnameResponse] -type web3HostnameWeb3HostnameNewWeb3HostnameResponseJSON struct { +// web3HostnameListResponseJSON contains the JSON metadata for the struct +// [Web3HostnameListResponse] +type web3HostnameListResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Description apijson.Field @@ -262,30 +244,48 @@ type web3HostnameWeb3HostnameNewWeb3HostnameResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameNewWeb3HostnameResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the hostname's activation. -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus string +type Web3HostnameListResponseStatus string const ( - Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatusActive Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus = "active" - Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatusPending Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus = "pending" - Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatusDeleting Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus = "deleting" - Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatusError Web3HostnameWeb3HostnameNewWeb3HostnameResponseStatus = "error" + Web3HostnameListResponseStatusActive Web3HostnameListResponseStatus = "active" + Web3HostnameListResponseStatusPending Web3HostnameListResponseStatus = "pending" + Web3HostnameListResponseStatusDeleting Web3HostnameListResponseStatus = "deleting" + Web3HostnameListResponseStatusError Web3HostnameListResponseStatus = "error" ) // Target gateway of the hostname. -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseTarget string +type Web3HostnameListResponseTarget string const ( - Web3HostnameWeb3HostnameNewWeb3HostnameResponseTargetEthereum Web3HostnameWeb3HostnameNewWeb3HostnameResponseTarget = "ethereum" - Web3HostnameWeb3HostnameNewWeb3HostnameResponseTargetIpfs Web3HostnameWeb3HostnameNewWeb3HostnameResponseTarget = "ipfs" - Web3HostnameWeb3HostnameNewWeb3HostnameResponseTargetIpfsUniversalPath Web3HostnameWeb3HostnameNewWeb3HostnameResponseTarget = "ipfs_universal_path" + Web3HostnameListResponseTargetEthereum Web3HostnameListResponseTarget = "ethereum" + Web3HostnameListResponseTargetIpfs Web3HostnameListResponseTarget = "ipfs" + Web3HostnameListResponseTargetIpfsUniversalPath Web3HostnameListResponseTarget = "ipfs_universal_path" ) -type Web3HostnameWeb3HostnameListWeb3HostnamesResponse struct { +type Web3HostnameDeleteResponse struct { + // Identifier + ID string `json:"id,required"` + JSON web3HostnameDeleteResponseJSON `json:"-"` +} + +// web3HostnameDeleteResponseJSON contains the JSON metadata for the struct +// [Web3HostnameDeleteResponse] +type web3HostnameDeleteResponseJSON struct { + ID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *Web3HostnameDeleteResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type Web3HostnameGetResponse struct { // Identifier ID string `json:"id"` CreatedOn time.Time `json:"created_on" format:"date-time"` @@ -297,15 +297,15 @@ type Web3HostnameWeb3HostnameListWeb3HostnamesResponse struct { // The hostname that will point to the target gateway via CNAME. Name string `json:"name"` // Status of the hostname's activation. - Status Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus `json:"status"` + Status Web3HostnameGetResponseStatus `json:"status"` // Target gateway of the hostname. - Target Web3HostnameWeb3HostnameListWeb3HostnamesResponseTarget `json:"target"` - JSON web3HostnameWeb3HostnameListWeb3HostnamesResponseJSON `json:"-"` + Target Web3HostnameGetResponseTarget `json:"target"` + JSON web3HostnameGetResponseJSON `json:"-"` } -// web3HostnameWeb3HostnameListWeb3HostnamesResponseJSON contains the JSON metadata -// for the struct [Web3HostnameWeb3HostnameListWeb3HostnamesResponse] -type web3HostnameWeb3HostnameListWeb3HostnamesResponseJSON struct { +// web3HostnameGetResponseJSON contains the JSON metadata for the struct +// [Web3HostnameGetResponse] +type web3HostnameGetResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Description apijson.Field @@ -318,52 +318,63 @@ type web3HostnameWeb3HostnameListWeb3HostnamesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameListWeb3HostnamesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Status of the hostname's activation. -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus string +type Web3HostnameGetResponseStatus string const ( - Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatusActive Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus = "active" - Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatusPending Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus = "pending" - Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatusDeleting Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus = "deleting" - Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatusError Web3HostnameWeb3HostnameListWeb3HostnamesResponseStatus = "error" + Web3HostnameGetResponseStatusActive Web3HostnameGetResponseStatus = "active" + Web3HostnameGetResponseStatusPending Web3HostnameGetResponseStatus = "pending" + Web3HostnameGetResponseStatusDeleting Web3HostnameGetResponseStatus = "deleting" + Web3HostnameGetResponseStatusError Web3HostnameGetResponseStatus = "error" ) // Target gateway of the hostname. -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseTarget string +type Web3HostnameGetResponseTarget string const ( - Web3HostnameWeb3HostnameListWeb3HostnamesResponseTargetEthereum Web3HostnameWeb3HostnameListWeb3HostnamesResponseTarget = "ethereum" - Web3HostnameWeb3HostnameListWeb3HostnamesResponseTargetIpfs Web3HostnameWeb3HostnameListWeb3HostnamesResponseTarget = "ipfs" - Web3HostnameWeb3HostnameListWeb3HostnamesResponseTargetIpfsUniversalPath Web3HostnameWeb3HostnameListWeb3HostnamesResponseTarget = "ipfs_universal_path" + Web3HostnameGetResponseTargetEthereum Web3HostnameGetResponseTarget = "ethereum" + Web3HostnameGetResponseTargetIpfs Web3HostnameGetResponseTarget = "ipfs" + Web3HostnameGetResponseTargetIpfsUniversalPath Web3HostnameGetResponseTarget = "ipfs_universal_path" ) -type Web3HostnameUpdateParams struct { +type Web3HostnameNewParams struct { + // Target gateway of the hostname. + Target param.Field[Web3HostnameNewParamsTarget] `json:"target,required"` // An optional description of the hostname. Description param.Field[string] `json:"description"` // DNSLink value used if the target is ipfs. Dnslink param.Field[string] `json:"dnslink"` } -func (r Web3HostnameUpdateParams) MarshalJSON() (data []byte, err error) { +func (r Web3HostnameNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type Web3HostnameUpdateResponseEnvelope struct { - Errors []Web3HostnameUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameUpdateResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameUpdateResponse `json:"result,required"` +// Target gateway of the hostname. +type Web3HostnameNewParamsTarget string + +const ( + Web3HostnameNewParamsTargetEthereum Web3HostnameNewParamsTarget = "ethereum" + Web3HostnameNewParamsTargetIpfs Web3HostnameNewParamsTarget = "ipfs" + Web3HostnameNewParamsTargetIpfsUniversalPath Web3HostnameNewParamsTarget = "ipfs_universal_path" +) + +type Web3HostnameNewResponseEnvelope struct { + Errors []Web3HostnameNewResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameNewResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameNewResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameUpdateResponseEnvelopeJSON `json:"-"` + Success Web3HostnameNewResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameNewResponseEnvelopeJSON `json:"-"` } -// web3HostnameUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [Web3HostnameUpdateResponseEnvelope] -type web3HostnameUpdateResponseEnvelopeJSON struct { +// web3HostnameNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [Web3HostnameNewResponseEnvelope] +type web3HostnameNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -372,67 +383,78 @@ type web3HostnameUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameUpdateResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameNewResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [Web3HostnameUpdateResponseEnvelopeErrors] -type web3HostnameUpdateResponseEnvelopeErrorsJSON struct { +// web3HostnameNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [Web3HostnameNewResponseEnvelopeErrors] +type web3HostnameNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameUpdateResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameNewResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [Web3HostnameUpdateResponseEnvelopeMessages] -type web3HostnameUpdateResponseEnvelopeMessagesJSON struct { +// web3HostnameNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [Web3HostnameNewResponseEnvelopeMessages] +type web3HostnameNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameUpdateResponseEnvelopeSuccess bool +type Web3HostnameNewResponseEnvelopeSuccess bool const ( - Web3HostnameUpdateResponseEnvelopeSuccessTrue Web3HostnameUpdateResponseEnvelopeSuccess = true + Web3HostnameNewResponseEnvelopeSuccessTrue Web3HostnameNewResponseEnvelopeSuccess = true ) -type Web3HostnameDeleteResponseEnvelope struct { - Errors []Web3HostnameDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameDeleteResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameDeleteResponse `json:"result,required,nullable"` +type Web3HostnameUpdateParams struct { + // An optional description of the hostname. + Description param.Field[string] `json:"description"` + // DNSLink value used if the target is ipfs. + Dnslink param.Field[string] `json:"dnslink"` +} + +func (r Web3HostnameUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type Web3HostnameUpdateResponseEnvelope struct { + Errors []Web3HostnameUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameUpdateResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameUpdateResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameDeleteResponseEnvelopeJSON `json:"-"` + Success Web3HostnameUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameUpdateResponseEnvelopeJSON `json:"-"` } -// web3HostnameDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [Web3HostnameDeleteResponseEnvelope] -type web3HostnameDeleteResponseEnvelopeJSON struct { +// web3HostnameUpdateResponseEnvelopeJSON contains the JSON metadata for the struct +// [Web3HostnameUpdateResponseEnvelope] +type web3HostnameUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -441,159 +463,165 @@ type web3HostnameDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameDeleteResponseEnvelopeErrors struct { +type Web3HostnameUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON web3HostnameDeleteResponseEnvelopeErrorsJSON `json:"-"` + JSON web3HostnameUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [Web3HostnameDeleteResponseEnvelopeErrors] -type web3HostnameDeleteResponseEnvelopeErrorsJSON struct { +// web3HostnameUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [Web3HostnameUpdateResponseEnvelopeErrors] +type web3HostnameUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameDeleteResponseEnvelopeMessages struct { +type Web3HostnameUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON web3HostnameDeleteResponseEnvelopeMessagesJSON `json:"-"` + JSON web3HostnameUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [Web3HostnameDeleteResponseEnvelopeMessages] -type web3HostnameDeleteResponseEnvelopeMessagesJSON struct { +// web3HostnameUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [Web3HostnameUpdateResponseEnvelopeMessages] +type web3HostnameUpdateResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameDeleteResponseEnvelopeSuccess bool +type Web3HostnameUpdateResponseEnvelopeSuccess bool const ( - Web3HostnameDeleteResponseEnvelopeSuccessTrue Web3HostnameDeleteResponseEnvelopeSuccess = true + Web3HostnameUpdateResponseEnvelopeSuccessTrue Web3HostnameUpdateResponseEnvelopeSuccess = true ) -type Web3HostnameGetResponseEnvelope struct { - Errors []Web3HostnameGetResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameGetResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameGetResponse `json:"result,required"` +type Web3HostnameListResponseEnvelope struct { + Errors []Web3HostnameListResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameListResponseEnvelopeMessages `json:"messages,required"` + Result []Web3HostnameListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success Web3HostnameGetResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameGetResponseEnvelopeJSON `json:"-"` + Success Web3HostnameListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo Web3HostnameListResponseEnvelopeResultInfo `json:"result_info"` + JSON web3HostnameListResponseEnvelopeJSON `json:"-"` } -// web3HostnameGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [Web3HostnameGetResponseEnvelope] -type web3HostnameGetResponseEnvelopeJSON struct { +// web3HostnameListResponseEnvelopeJSON contains the JSON metadata for the struct +// [Web3HostnameListResponseEnvelope] +type web3HostnameListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameGetResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameListResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [Web3HostnameGetResponseEnvelopeErrors] -type web3HostnameGetResponseEnvelopeErrorsJSON struct { +// web3HostnameListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [Web3HostnameListResponseEnvelopeErrors] +type web3HostnameListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameGetResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameListResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [Web3HostnameGetResponseEnvelopeMessages] -type web3HostnameGetResponseEnvelopeMessagesJSON struct { +// web3HostnameListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [Web3HostnameListResponseEnvelopeMessages] +type web3HostnameListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameGetResponseEnvelopeSuccess bool +type Web3HostnameListResponseEnvelopeSuccess bool const ( - Web3HostnameGetResponseEnvelopeSuccessTrue Web3HostnameGetResponseEnvelopeSuccess = true + Web3HostnameListResponseEnvelopeSuccessTrue Web3HostnameListResponseEnvelopeSuccess = true ) -type Web3HostnameWeb3HostnameNewWeb3HostnameParams struct { - // Target gateway of the hostname. - Target param.Field[Web3HostnameWeb3HostnameNewWeb3HostnameParamsTarget] `json:"target,required"` - // An optional description of the hostname. - Description param.Field[string] `json:"description"` - // DNSLink value used if the target is ipfs. - Dnslink param.Field[string] `json:"dnslink"` +type Web3HostnameListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON web3HostnameListResponseEnvelopeResultInfoJSON `json:"-"` } -func (r Web3HostnameWeb3HostnameNewWeb3HostnameParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +// web3HostnameListResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [Web3HostnameListResponseEnvelopeResultInfo] +type web3HostnameListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field } -// Target gateway of the hostname. -type Web3HostnameWeb3HostnameNewWeb3HostnameParamsTarget string - -const ( - Web3HostnameWeb3HostnameNewWeb3HostnameParamsTargetEthereum Web3HostnameWeb3HostnameNewWeb3HostnameParamsTarget = "ethereum" - Web3HostnameWeb3HostnameNewWeb3HostnameParamsTargetIpfs Web3HostnameWeb3HostnameNewWeb3HostnameParamsTarget = "ipfs" - Web3HostnameWeb3HostnameNewWeb3HostnameParamsTargetIpfsUniversalPath Web3HostnameWeb3HostnameNewWeb3HostnameParamsTarget = "ipfs_universal_path" -) +func (r *Web3HostnameListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelope struct { - Errors []Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameWeb3HostnameNewWeb3HostnameResponse `json:"result,required"` +type Web3HostnameDeleteResponseEnvelope struct { + Errors []Web3HostnameDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameDeleteResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeJSON `json:"-"` + Success Web3HostnameDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameDeleteResponseEnvelopeJSON `json:"-"` } -// web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelope] -type web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeJSON struct { +// web3HostnameDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [Web3HostnameDeleteResponseEnvelope] +type web3HostnameDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -602,155 +630,120 @@ type web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrors] -type web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrorsJSON struct { +// web3HostnameDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [Web3HostnameDeleteResponseEnvelopeErrors] +type web3HostnameDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessages] -type web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessagesJSON struct { +// web3HostnameDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [Web3HostnameDeleteResponseEnvelopeMessages] +type web3HostnameDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeSuccess bool +type Web3HostnameDeleteResponseEnvelopeSuccess bool const ( - Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeSuccessTrue Web3HostnameWeb3HostnameNewWeb3HostnameResponseEnvelopeSuccess = true + Web3HostnameDeleteResponseEnvelopeSuccessTrue Web3HostnameDeleteResponseEnvelopeSuccess = true ) -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelope struct { - Errors []Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessages `json:"messages,required"` - Result []Web3HostnameWeb3HostnameListWeb3HostnamesResponse `json:"result,required,nullable"` +type Web3HostnameGetResponseEnvelope struct { + Errors []Web3HostnameGetResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameGetResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameGetResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfo `json:"result_info"` - JSON web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeJSON `json:"-"` + Success Web3HostnameGetResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameGetResponseEnvelopeJSON `json:"-"` } -// web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelope] -type web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeJSON struct { +// web3HostnameGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [Web3HostnameGetResponseEnvelope] +type web3HostnameGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameGetResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrors] -type web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrorsJSON struct { +// web3HostnameGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [Web3HostnameGetResponseEnvelopeErrors] +type web3HostnameGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameGetResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessages] -type web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessagesJSON struct { +// web3HostnameGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [Web3HostnameGetResponseEnvelopeMessages] +type web3HostnameGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeSuccess bool +type Web3HostnameGetResponseEnvelopeSuccess bool const ( - Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeSuccessTrue Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeSuccess = true + Web3HostnameGetResponseEnvelopeSuccessTrue Web3HostnameGetResponseEnvelopeSuccess = true ) - -type Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfo] -type web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameWeb3HostnameListWeb3HostnamesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/web3hostname_test.go b/web3hostname_test.go index 7348c4e9ede..7d997ba22f9 100644 --- a/web3hostname_test.go +++ b/web3hostname_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWeb3HostnameUpdateWithOptionalParams(t *testing.T) { +func TestWeb3HostnameNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestWeb3HostnameUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.Update( + _, err := client.Web3.Hostnames.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.Web3HostnameUpdateParams{ + cloudflare.Web3HostnameNewParams{ + Target: cloudflare.F(cloudflare.Web3HostnameNewParamsTargetIpfs), Description: cloudflare.F("This is my IPFS gateway."), Dnslink: cloudflare.F("/ipns/onboarding.ipfs.cloudflare.com"), }, @@ -47,7 +47,7 @@ func TestWeb3HostnameUpdateWithOptionalParams(t *testing.T) { } } -func TestWeb3HostnameDelete(t *testing.T) { +func TestWeb3HostnameUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,10 +63,14 @@ func TestWeb3HostnameDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.Delete( + _, err := client.Web3.Hostnames.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.Web3HostnameUpdateParams{ + Description: cloudflare.F("This is my IPFS gateway."), + Dnslink: cloudflare.F("/ipns/onboarding.ipfs.cloudflare.com"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -77,7 +81,7 @@ func TestWeb3HostnameDelete(t *testing.T) { } } -func TestWeb3HostnameGet(t *testing.T) { +func TestWeb3HostnameList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,11 +97,7 @@ func TestWeb3HostnameGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Web3.Hostnames.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -107,7 +107,7 @@ func TestWeb3HostnameGet(t *testing.T) { } } -func TestWeb3HostnameWeb3HostnameNewWeb3HostnameWithOptionalParams(t *testing.T) { +func TestWeb3HostnameDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -123,14 +123,10 @@ func TestWeb3HostnameWeb3HostnameNewWeb3HostnameWithOptionalParams(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.Web3HostnameNewWeb3Hostname( + _, err := client.Web3.Hostnames.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.Web3HostnameWeb3HostnameNewWeb3HostnameParams{ - Target: cloudflare.F(cloudflare.Web3HostnameWeb3HostnameNewWeb3HostnameParamsTargetIpfs), - Description: cloudflare.F("This is my IPFS gateway."), - Dnslink: cloudflare.F("/ipns/onboarding.ipfs.cloudflare.com"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -141,7 +137,7 @@ func TestWeb3HostnameWeb3HostnameNewWeb3HostnameWithOptionalParams(t *testing.T) } } -func TestWeb3HostnameWeb3HostnameListWeb3Hostnames(t *testing.T) { +func TestWeb3HostnameGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -157,7 +153,11 @@ func TestWeb3HostnameWeb3HostnameListWeb3Hostnames(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.Web3HostnameListWeb3Hostnames(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Web3.Hostnames.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/web3hostnameipfsuniversalpathcontentlist.go b/web3hostnameipfsuniversalpathcontentlist.go index 9c755d07489..e118aa51b06 100644 --- a/web3hostnameipfsuniversalpathcontentlist.go +++ b/web3hostnameipfsuniversalpathcontentlist.go @@ -35,9 +35,9 @@ func NewWeb3HostnameIpfsUniversalPathContentListService(opts ...option.RequestOp } // IPFS Universal Path Gateway Content List Details -func (r *Web3HostnameIpfsUniversalPathContentListService) Web3HostnameIpfsUniversalPathGatewayContentListDetails(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse, err error) { +func (r *Web3HostnameIpfsUniversalPathContentListService) List(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListListResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelope + var env Web3HostnameIpfsUniversalPathContentListListResponseEnvelope path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list", zoneIdentifier, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -48,9 +48,9 @@ func (r *Web3HostnameIpfsUniversalPathContentListService) Web3HostnameIpfsUniver } // Update IPFS Universal Path Gateway Content List -func (r *Web3HostnameIpfsUniversalPathContentListService) Web3HostnameUpdateIpfsUniversalPathGatewayContentList(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse, err error) { +func (r *Web3HostnameIpfsUniversalPathContentListService) Replace(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameIpfsUniversalPathContentListReplaceParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelope + var env Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list", zoneIdentifier, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -60,71 +60,70 @@ func (r *Web3HostnameIpfsUniversalPathContentListService) Web3HostnameUpdateIpfs return } -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse struct { +type Web3HostnameIpfsUniversalPathContentListListResponse struct { // Behavior of the content list. - Action Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseAction `json:"action"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseJSON `json:"-"` + Action Web3HostnameIpfsUniversalPathContentListListResponseAction `json:"action"` + JSON web3HostnameIpfsUniversalPathContentListListResponseJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseJSON struct { +// web3HostnameIpfsUniversalPathContentListListResponseJSON contains the JSON +// metadata for the struct [Web3HostnameIpfsUniversalPathContentListListResponse] +type web3HostnameIpfsUniversalPathContentListListResponseJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Behavior of the content list. -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseAction string +type Web3HostnameIpfsUniversalPathContentListListResponseAction string const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseActionBlock Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseAction = "block" + Web3HostnameIpfsUniversalPathContentListListResponseActionBlock Web3HostnameIpfsUniversalPathContentListListResponseAction = "block" ) -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse struct { +type Web3HostnameIpfsUniversalPathContentListReplaceResponse struct { // Behavior of the content list. - Action Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseAction `json:"action"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseJSON `json:"-"` + Action Web3HostnameIpfsUniversalPathContentListReplaceResponseAction `json:"action"` + JSON web3HostnameIpfsUniversalPathContentListReplaceResponseJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseJSON struct { +// web3HostnameIpfsUniversalPathContentListReplaceResponseJSON contains the JSON +// metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListReplaceResponse] +type web3HostnameIpfsUniversalPathContentListReplaceResponseJSON struct { Action apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Behavior of the content list. -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseAction string +type Web3HostnameIpfsUniversalPathContentListReplaceResponseAction string const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseActionBlock Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseAction = "block" + Web3HostnameIpfsUniversalPathContentListReplaceResponseActionBlock Web3HostnameIpfsUniversalPathContentListReplaceResponseAction = "block" ) -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelope struct { - Errors []Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponse `json:"result,required"` +type Web3HostnameIpfsUniversalPathContentListListResponseEnvelope struct { + Errors []Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameIpfsUniversalPathContentListListResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeJSON `json:"-"` + Success Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameIpfsUniversalPathContentListListResponseEnvelopeJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelope] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeJSON struct { +// web3HostnameIpfsUniversalPathContentListListResponseEnvelopeJSON contains the +// JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListListResponseEnvelope] +type web3HostnameIpfsUniversalPathContentListListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -133,110 +132,110 @@ type web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewa ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrors] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrorsJSON struct { +// web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrorsJSON contains +// the JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrors] +type web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessagesJSON +// web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessages] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessagesJSON struct { +// [Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessages] +type web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeSuccess bool +type Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeSuccess bool const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetailsResponseEnvelopeSuccess = true + Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListListResponseEnvelopeSuccess = true ) -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParams struct { +type Web3HostnameIpfsUniversalPathContentListReplaceParams struct { // Behavior of the content list. - Action param.Field[Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsAction] `json:"action,required"` + Action param.Field[Web3HostnameIpfsUniversalPathContentListReplaceParamsAction] `json:"action,required"` // Content list entries. - Entries param.Field[[]Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntry] `json:"entries,required"` + Entries param.Field[[]Web3HostnameIpfsUniversalPathContentListReplaceParamsEntry] `json:"entries,required"` } -func (r Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParams) MarshalJSON() (data []byte, err error) { +func (r Web3HostnameIpfsUniversalPathContentListReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Behavior of the content list. -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsAction string +type Web3HostnameIpfsUniversalPathContentListReplaceParamsAction string const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsActionBlock Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsAction = "block" + Web3HostnameIpfsUniversalPathContentListReplaceParamsActionBlock Web3HostnameIpfsUniversalPathContentListReplaceParamsAction = "block" ) // Content list entry to be blocked. -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntry struct { +type Web3HostnameIpfsUniversalPathContentListReplaceParamsEntry struct { // CID or content path of content to block. Content param.Field[string] `json:"content"` // An optional description of the content list entry. Description param.Field[string] `json:"description"` // Type of content list entry to block. - Type param.Field[Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesType] `json:"type"` + Type param.Field[Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesType] `json:"type"` } -func (r Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntry) MarshalJSON() (data []byte, err error) { +func (r Web3HostnameIpfsUniversalPathContentListReplaceParamsEntry) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesType string +type Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesType string const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesTypeCid Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesType = "cid" - Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesTypeContentPath Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesType = "content_path" + Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesTypeCid Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesType = "cid" + Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesTypeContentPath Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesType = "content_path" ) -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelope struct { - Errors []Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponse `json:"result,required"` +type Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelope struct { + Errors []Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameIpfsUniversalPathContentListReplaceResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeJSON `json:"-"` + Success Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelope] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeJSON struct { +// web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeJSON contains the +// JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelope] +type web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -245,53 +244,53 @@ type web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPath ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrorsJSON +// web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrors] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrorsJSON struct { +// [Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrors] +type web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessagesJSON +// web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessages] -type web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessagesJSON struct { +// [Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessages] +type web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeSuccess bool +type Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeSuccess bool const ( - Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListResponseEnvelopeSuccess = true + Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListReplaceResponseEnvelopeSuccess = true ) diff --git a/web3hostnameipfsuniversalpathcontentlist_test.go b/web3hostnameipfsuniversalpathcontentlist_test.go index 1aa1f3fbdb2..efa8383ee2b 100644 --- a/web3hostnameipfsuniversalpathcontentlist_test.go +++ b/web3hostnameipfsuniversalpathcontentlist_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWeb3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGatewayContentListDetails(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGa option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Web3HostnameIpfsUniversalPathGatewayContentListDetails( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -43,7 +43,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListWeb3HostnameIpfsUniversalPathGa } } -func TestWeb3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentList(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,24 +59,24 @@ func TestWeb3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversal option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Web3HostnameUpdateIpfsUniversalPathGatewayContentList( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParams{ - Action: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsActionBlock), - Entries: cloudflare.F([]cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntry{{ + cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParams{ + Action: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParamsActionBlock), + Entries: cloudflare.F([]cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParamsEntry{{ Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), Description: cloudflare.F("this is my content list entry"), - Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesTypeCid), + Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesTypeCid), }, { Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), Description: cloudflare.F("this is my content list entry"), - Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesTypeCid), + Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesTypeCid), }, { Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), Description: cloudflare.F("this is my content list entry"), - Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListWeb3HostnameUpdateIpfsUniversalPathGatewayContentListParamsEntriesTypeCid), + Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListReplaceParamsEntriesTypeCid), }}), }, ) diff --git a/web3hostnameipfsuniversalpathcontentlistentry.go b/web3hostnameipfsuniversalpathcontentlistentry.go index 1224b1740f9..a4a3c15006f 100644 --- a/web3hostnameipfsuniversalpathcontentlistentry.go +++ b/web3hostnameipfsuniversalpathcontentlistentry.go @@ -33,12 +33,25 @@ func NewWeb3HostnameIpfsUniversalPathContentListEntryService(opts ...option.Requ return } -// Edit IPFS Universal Path Gateway Content List Entry -func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Update(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body Web3HostnameIpfsUniversalPathContentListEntryUpdateParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse, err error) { +// Create IPFS Universal Path Gateway Content List Entry +func (r *Web3HostnameIpfsUniversalPathContentListEntryService) New(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameIpfsUniversalPathContentListEntryNewParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryNewResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries/%s", zoneIdentifier, identifier, contentListEntryIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries", zoneIdentifier, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// List IPFS Universal Path Gateway Content List Entries +func (r *Web3HostnameIpfsUniversalPathContentListEntryService) List(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryListResponse, err error) { + opts = append(r.Options[:], opts...) + var env Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries", zoneIdentifier, identifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -72,12 +85,12 @@ func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Get(ctx context.C return } -// Create IPFS Universal Path Gateway Content List Entry -func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Web3HostnameNewIpfsUniversalPathGatewayContentListEntry(ctx context.Context, zoneIdentifier string, identifier string, body Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse, err error) { +// Edit IPFS Universal Path Gateway Content List Entry +func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Replace(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body Web3HostnameIpfsUniversalPathContentListEntryReplaceParams, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries", zoneIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries/%s", zoneIdentifier, identifier, contentListEntryIdentifier) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -85,21 +98,68 @@ func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Web3HostnameNewIp return } -// List IPFS Universal Path Gateway Content List Entries -func (r *Web3HostnameIpfsUniversalPathContentListEntryService) Web3HostnameListIpfsUniversalPathGatewayContentListEntries(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse, err error) { - opts = append(r.Options[:], opts...) - var env Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelope - path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries", zoneIdentifier, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +// Content list entry to be blocked. +type Web3HostnameIpfsUniversalPathContentListEntryNewResponse struct { + // Identifier + ID string `json:"id"` + // CID or content path of content to block. + Content string `json:"content"` + CreatedOn time.Time `json:"created_on" format:"date-time"` + // An optional description of the content list entry. + Description string `json:"description"` + ModifiedOn time.Time `json:"modified_on" format:"date-time"` + // Type of content list entry to block. + Type Web3HostnameIpfsUniversalPathContentListEntryNewResponseType `json:"type"` + JSON web3HostnameIpfsUniversalPathContentListEntryNewResponseJSON `json:"-"` +} + +// web3HostnameIpfsUniversalPathContentListEntryNewResponseJSON contains the JSON +// metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryNewResponse] +type web3HostnameIpfsUniversalPathContentListEntryNewResponseJSON struct { + ID apijson.Field + Content apijson.Field + CreatedOn apijson.Field + Description apijson.Field + ModifiedOn apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *Web3HostnameIpfsUniversalPathContentListEntryNewResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Type of content list entry to block. +type Web3HostnameIpfsUniversalPathContentListEntryNewResponseType string + +const ( + Web3HostnameIpfsUniversalPathContentListEntryNewResponseTypeCid Web3HostnameIpfsUniversalPathContentListEntryNewResponseType = "cid" + Web3HostnameIpfsUniversalPathContentListEntryNewResponseTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryNewResponseType = "content_path" +) + +type Web3HostnameIpfsUniversalPathContentListEntryListResponse struct { + // Content list entries. + Entries []Web3HostnameIpfsUniversalPathContentListEntryListResponseEntry `json:"entries"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseJSON `json:"-"` +} + +// web3HostnameIpfsUniversalPathContentListEntryListResponseJSON contains the JSON +// metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryListResponse] +type web3HostnameIpfsUniversalPathContentListEntryListResponseJSON struct { + Entries apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } // Content list entry to be blocked. -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse struct { +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEntry struct { // Identifier ID string `json:"id"` // CID or content path of content to block. @@ -109,14 +169,14 @@ type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse struct { Description string `json:"description"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Type of content list entry to block. - Type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseType `json:"type"` - JSON web3HostnameIpfsUniversalPathContentListEntryUpdateResponseJSON `json:"-"` + Type Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesType `json:"type"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseEntryJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryUpdateResponseJSON contains the +// web3HostnameIpfsUniversalPathContentListEntryListResponseEntryJSON contains the // JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse] -type web3HostnameIpfsUniversalPathContentListEntryUpdateResponseJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryListResponseEntry] +type web3HostnameIpfsUniversalPathContentListEntryListResponseEntryJSON struct { ID apijson.Field Content apijson.Field CreatedOn apijson.Field @@ -127,16 +187,16 @@ type web3HostnameIpfsUniversalPathContentListEntryUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponseEntry) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseType string +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesType string const ( - Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseTypeCid Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseType = "cid" - Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseType = "content_path" + Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesTypeCid Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesType = "cid" + Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryListResponseEntriesType = "content_path" ) type Web3HostnameIpfsUniversalPathContentListEntryDeleteResponse struct { @@ -200,7 +260,7 @@ const ( ) // Content list entry to be blocked. -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse struct { +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse struct { // Identifier ID string `json:"id"` // CID or content path of content to block. @@ -210,14 +270,14 @@ type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPa Description string `json:"description"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // Type of content list entry to block. - Type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseType `json:"type"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseJSON `json:"-"` + Type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseType `json:"type"` + JSON web3HostnameIpfsUniversalPathContentListEntryReplaceResponseJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseJSON struct { +// web3HostnameIpfsUniversalPathContentListEntryReplaceResponseJSON contains the +// JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse] +type web3HostnameIpfsUniversalPathContentListEntryReplaceResponseJSON struct { ID apijson.Field Content apijson.Field CreatedOn apijson.Field @@ -228,172 +288,214 @@ type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPa ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseType string +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseType string const ( - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseTypeCid Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseType = "cid" - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseType = "content_path" + Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseTypeCid Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseType = "cid" + Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseType = "content_path" ) -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse struct { - // Content list entries. - Entries []Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntry `json:"entries"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryNewParams struct { + // CID or content path of content to block. + Content param.Field[string] `json:"content,required"` + // Type of content list entry to block. + Type param.Field[Web3HostnameIpfsUniversalPathContentListEntryNewParamsType] `json:"type,required"` + // An optional description of the content list entry. + Description param.Field[string] `json:"description"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseJSON struct { - Entries apijson.Field +func (r Web3HostnameIpfsUniversalPathContentListEntryNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// Type of content list entry to block. +type Web3HostnameIpfsUniversalPathContentListEntryNewParamsType string + +const ( + Web3HostnameIpfsUniversalPathContentListEntryNewParamsTypeCid Web3HostnameIpfsUniversalPathContentListEntryNewParamsType = "cid" + Web3HostnameIpfsUniversalPathContentListEntryNewParamsTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryNewParamsType = "content_path" +) + +type Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelope struct { + Errors []Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessages `json:"messages,required"` + // Content list entry to be blocked. + Result Web3HostnameIpfsUniversalPathContentListEntryNewResponse `json:"result,required"` + // Whether the API call was successful + Success Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeJSON `json:"-"` +} + +// web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeJSON contains +// the JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelope] +type web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Content list entry to be blocked. -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntry struct { - // Identifier - ID string `json:"id"` - // CID or content path of content to block. - Content string `json:"content"` - CreatedOn time.Time `json:"created_on" format:"date-time"` - // An optional description of the content list entry. - Description string `json:"description"` - ModifiedOn time.Time `json:"modified_on" format:"date-time"` - // Type of content list entry to block. - Type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesType `json:"type"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntryJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntryJSON +// web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntry] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntryJSON struct { - ID apijson.Field - Content apijson.Field - CreatedOn apijson.Field - Description apijson.Field - ModifiedOn apijson.Field - Type apijson.Field +// [Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrors] +type web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntry) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesType string - -const ( - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesTypeCid Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesType = "cid" - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEntriesType = "content_path" -) +type Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessagesJSON `json:"-"` +} -type Web3HostnameIpfsUniversalPathContentListEntryUpdateParams struct { - // CID or content path of content to block. - Content param.Field[string] `json:"content,required"` - // Type of content list entry to block. - Type param.Field[Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsType] `json:"type,required"` - // An optional description of the content list entry. - Description param.Field[string] `json:"description"` +// web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessagesJSON +// contains the JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessages] +type web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field } -func (r Web3HostnameIpfsUniversalPathContentListEntryUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) +func (r *Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) } -// Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsType string +// Whether the API call was successful +type Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeSuccess bool const ( - Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsTypeCid Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsType = "cid" - Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsType = "content_path" + Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryNewResponseEnvelopeSuccess = true ) -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelope struct { - Errors []Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessages `json:"messages,required"` - // Content list entry to be blocked. - Result Web3HostnameIpfsUniversalPathContentListEntryUpdateResponse `json:"result,required"` +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelope struct { + Errors []Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessages `json:"messages,required"` + Result Web3HostnameIpfsUniversalPathContentListEntryListResponse `json:"result,required,nullable"` // Whether the API call was successful - Success Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeJSON `json:"-"` + Success Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeSuccess `json:"success,required"` + ResultInfo Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfo `json:"result_info"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeJSON contains +// web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeJSON contains // the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelope] -type web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelope] +type web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field + ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrorsJSON +// web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrors] -type web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrorsJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrors] +type web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessagesJSON +// web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessages] -type web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessagesJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessages] +type web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeSuccess bool +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeSuccess bool const ( - Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryUpdateResponseEnvelopeSuccess = true + Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeSuccess = true ) +type Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfo struct { + // Total number of results for the requested service + Count float64 `json:"count"` + // Current page within paginated list of results + Page float64 `json:"page"` + // Number of results per page of results + PerPage float64 `json:"per_page"` + // Total results available without any search parameters + TotalCount float64 `json:"total_count"` + JSON web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfoJSON `json:"-"` +} + +// web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfoJSON +// contains the JSON metadata for the struct +// [Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfo] +type web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfoJSON struct { + Count apijson.Field + Page apijson.Field + PerPage apijson.Field + TotalCount apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *Web3HostnameIpfsUniversalPathContentListEntryListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type Web3HostnameIpfsUniversalPathContentListEntryDeleteResponseEnvelope struct { Errors []Web3HostnameIpfsUniversalPathContentListEntryDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []Web3HostnameIpfsUniversalPathContentListEntryDeleteResponseEnvelopeMessages `json:"messages,required"` @@ -539,198 +641,96 @@ const ( Web3HostnameIpfsUniversalPathContentListEntryGetResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryGetResponseEnvelopeSuccess = true ) -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParams struct { +type Web3HostnameIpfsUniversalPathContentListEntryReplaceParams struct { // CID or content path of content to block. Content param.Field[string] `json:"content,required"` // Type of content list entry to block. - Type param.Field[Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsType] `json:"type,required"` + Type param.Field[Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsType] `json:"type,required"` // An optional description of the content list entry. Description param.Field[string] `json:"description"` } -func (r Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParams) MarshalJSON() (data []byte, err error) { +func (r Web3HostnameIpfsUniversalPathContentListEntryReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Type of content list entry to block. -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsType string +type Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsType string const ( - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsTypeCid Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsType = "cid" - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsType = "content_path" + Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsTypeCid Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsType = "cid" + Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsTypeContentPath Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsType = "content_path" ) -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelope struct { - Errors []Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessages `json:"messages,required"` +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelope struct { + Errors []Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessages `json:"messages,required"` // Content list entry to be blocked. - Result Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponse `json:"result,required"` - // Whether the API call was successful - Success Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeSuccess `json:"success,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeJSON `json:"-"` -} - -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelope] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrorsJSON `json:"-"` -} - -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrors] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessagesJSON `json:"-"` -} - -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessages] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeSuccess bool - -const ( - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryResponseEnvelopeSuccess = true -) - -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelope struct { - Errors []Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrors `json:"errors,required"` - Messages []Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessages `json:"messages,required"` - Result Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponse `json:"result,required,nullable"` + Result Web3HostnameIpfsUniversalPathContentListEntryReplaceResponse `json:"result,required"` // Whether the API call was successful - Success Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeSuccess `json:"success,required"` - ResultInfo Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfo `json:"result_info"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeJSON `json:"-"` + Success Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeJSON +// web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelope] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelope] +type web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field Success apijson.Field - ResultInfo apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrorsJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrorsJSON +// web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrors] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrorsJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrors] +type web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessagesJSON `json:"-"` +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessagesJSON +// web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessages] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessagesJSON struct { +// [Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessages] +type web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeSuccess bool +type Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeSuccess bool const ( - Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeSuccess = true + Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeSuccessTrue Web3HostnameIpfsUniversalPathContentListEntryReplaceResponseEnvelopeSuccess = true ) - -type Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfo struct { - // Total number of results for the requested service - Count float64 `json:"count"` - // Current page within paginated list of results - Page float64 `json:"page"` - // Number of results per page of results - PerPage float64 `json:"per_page"` - // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfoJSON `json:"-"` -} - -// web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfoJSON -// contains the JSON metadata for the struct -// [Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfo] -type web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfoJSON struct { - Count apijson.Field - Page apijson.Field - PerPage apijson.Field - TotalCount apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntriesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/web3hostnameipfsuniversalpathcontentlistentry_test.go b/web3hostnameipfsuniversalpathcontentlistentry_test.go index 0e58699f620..67e625ffadc 100644 --- a/web3hostnameipfsuniversalpathcontentlistentry_test.go +++ b/web3hostnameipfsuniversalpathcontentlistentry_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWeb3HostnameIpfsUniversalPathContentListEntryUpdateWithOptionalParams(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListEntryNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,14 +29,13 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryUpdateWithOptionalParams(t option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Update( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.Web3HostnameIpfsUniversalPathContentListEntryUpdateParams{ + cloudflare.Web3HostnameIpfsUniversalPathContentListEntryNewParams{ Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), - Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListEntryUpdateParamsTypeCid), + Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListEntryNewParamsTypeCid), Description: cloudflare.F("this is my content list entry"), }, ) @@ -49,7 +48,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryUpdateWithOptionalParams(t } } -func TestWeb3HostnameIpfsUniversalPathContentListEntryDelete(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListEntryList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -65,11 +64,10 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Delete( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -80,7 +78,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryDelete(t *testing.T) { } } -func TestWeb3HostnameIpfsUniversalPathContentListEntryGet(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListEntryDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -96,7 +94,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Get( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -111,7 +109,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryGet(t *testing.T) { } } -func TestWeb3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryWithOptionalParams(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListEntryGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -127,15 +125,11 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUnivers option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Web3HostnameNewIpfsUniversalPathGatewayContentListEntry( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParams{ - Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), - Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUniversalPathGatewayContentListEntryParamsTypeCid), - Description: cloudflare.F("this is my content list entry"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -146,7 +140,7 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryWeb3HostnameNewIpfsUnivers } } -func TestWeb3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniversalPathGatewayContentListEntries(t *testing.T) { +func TestWeb3HostnameIpfsUniversalPathContentListEntryReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -162,10 +156,16 @@ func TestWeb3HostnameIpfsUniversalPathContentListEntryWeb3HostnameListIpfsUniver option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Web3s.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Web3HostnameListIpfsUniversalPathGatewayContentListEntries( + _, err := client.Web3.Hostnames.IpfsUniversalPaths.ContentLists.Entries.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.Web3HostnameIpfsUniversalPathContentListEntryReplaceParams{ + Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), + Type: cloudflare.F(cloudflare.Web3HostnameIpfsUniversalPathContentListEntryReplaceParamsTypeCid), + Description: cloudflare.F("this is my content list entry"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/workeraccountsetting.go b/workeraccountsetting.go index 05181386065..307b306f410 100644 --- a/workeraccountsetting.go +++ b/workeraccountsetting.go @@ -31,12 +31,12 @@ func NewWorkerAccountSettingService(opts ...option.RequestOption) (r *WorkerAcco return } -// Creates Worker account settings for an account. -func (r *WorkerAccountSettingService) WorkerAccountSettingsNewWorkerAccountSettings(ctx context.Context, accountID string, body WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsParams, opts ...option.RequestOption) (res *WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse, err error) { +// Fetches Worker account settings for an account. +func (r *WorkerAccountSettingService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *WorkerAccountSettingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelope + var env WorkerAccountSettingGetResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/account-settings", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *WorkerAccountSettingService) WorkerAccountSettingsNewWorkerAccountSetti return } -// Fetches Worker account settings for an account. -func (r *WorkerAccountSettingService) WorkerAccountSettingsFetchWorkerAccountSettings(ctx context.Context, accountID string, opts ...option.RequestOption) (res *WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse, err error) { +// Creates Worker account settings for an account. +func (r *WorkerAccountSettingService) Replace(ctx context.Context, accountID string, body WorkerAccountSettingReplaceParams, opts ...option.RequestOption) (res *WorkerAccountSettingReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelope + var env WorkerAccountSettingReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/account-settings", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -57,67 +57,56 @@ func (r *WorkerAccountSettingService) WorkerAccountSettingsFetchWorkerAccountSet return } -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse struct { - DefaultUsageModel interface{} `json:"default_usage_model"` - GreenCompute interface{} `json:"green_compute"` - JSON workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseJSON `json:"-"` +type WorkerAccountSettingGetResponse struct { + DefaultUsageModel interface{} `json:"default_usage_model"` + GreenCompute interface{} `json:"green_compute"` + JSON workerAccountSettingGetResponseJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse] -type workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseJSON struct { +// workerAccountSettingGetResponseJSON contains the JSON metadata for the struct +// [WorkerAccountSettingGetResponse] +type workerAccountSettingGetResponseJSON struct { DefaultUsageModel apijson.Field GreenCompute apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse struct { - DefaultUsageModel interface{} `json:"default_usage_model"` - GreenCompute interface{} `json:"green_compute"` - JSON workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseJSON `json:"-"` +type WorkerAccountSettingReplaceResponse struct { + DefaultUsageModel interface{} `json:"default_usage_model"` + GreenCompute interface{} `json:"green_compute"` + JSON workerAccountSettingReplaceResponseJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse] -type workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseJSON struct { +// workerAccountSettingReplaceResponseJSON contains the JSON metadata for the +// struct [WorkerAccountSettingReplaceResponse] +type workerAccountSettingReplaceResponseJSON struct { DefaultUsageModel apijson.Field GreenCompute apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelope struct { - Errors []WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessages `json:"messages,required"` - Result WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponse `json:"result,required"` +type WorkerAccountSettingGetResponseEnvelope struct { + Errors []WorkerAccountSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerAccountSettingGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerAccountSettingGetResponse `json:"result,required"` // Whether the API call was successful - Success WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeJSON `json:"-"` + Success WorkerAccountSettingGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerAccountSettingGetResponseEnvelopeJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelope] -type workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeJSON struct { +// workerAccountSettingGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerAccountSettingGetResponseEnvelope] +type workerAccountSettingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -126,70 +115,75 @@ type workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEn ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrorsJSON `json:"-"` +type WorkerAccountSettingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerAccountSettingGetResponseEnvelopeErrorsJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrors] -type workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrorsJSON struct { +// workerAccountSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WorkerAccountSettingGetResponseEnvelopeErrors] +type workerAccountSettingGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessagesJSON `json:"-"` +type WorkerAccountSettingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerAccountSettingGetResponseEnvelopeMessagesJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessages] -type workerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessagesJSON struct { +// workerAccountSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerAccountSettingGetResponseEnvelopeMessages] +type workerAccountSettingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeSuccess bool +type WorkerAccountSettingGetResponseEnvelopeSuccess bool const ( - WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeSuccessTrue WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsResponseEnvelopeSuccess = true + WorkerAccountSettingGetResponseEnvelopeSuccessTrue WorkerAccountSettingGetResponseEnvelopeSuccess = true ) -type WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelope struct { - Errors []WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessages `json:"messages,required"` - Result WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse `json:"result,required"` +type WorkerAccountSettingReplaceParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WorkerAccountSettingReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type WorkerAccountSettingReplaceResponseEnvelope struct { + Errors []WorkerAccountSettingReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerAccountSettingReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerAccountSettingReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeSuccess `json:"success,required"` - JSON workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeJSON `json:"-"` + Success WorkerAccountSettingReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerAccountSettingReplaceResponseEnvelopeJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelope] -type workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeJSON struct { +// workerAccountSettingReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerAccountSettingReplaceResponseEnvelope] +type workerAccountSettingReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -198,53 +192,51 @@ type workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponse ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrorsJSON `json:"-"` +type WorkerAccountSettingReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerAccountSettingReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrors] -type workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrorsJSON struct { +// workerAccountSettingReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerAccountSettingReplaceResponseEnvelopeErrors] +type workerAccountSettingReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessagesJSON `json:"-"` +type WorkerAccountSettingReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerAccountSettingReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessages] -type workerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessagesJSON struct { +// workerAccountSettingReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerAccountSettingReplaceResponseEnvelopeMessages] +type workerAccountSettingReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerAccountSettingReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeSuccess bool +type WorkerAccountSettingReplaceResponseEnvelopeSuccess bool const ( - WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeSuccessTrue WorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettingsResponseEnvelopeSuccess = true + WorkerAccountSettingReplaceResponseEnvelopeSuccessTrue WorkerAccountSettingReplaceResponseEnvelopeSuccess = true ) diff --git a/workeraccountsetting_test.go b/workeraccountsetting_test.go index bc225fb63f8..303a1727e1a 100644 --- a/workeraccountsetting_test.go +++ b/workeraccountsetting_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettings(t *testing.T) { +func TestWorkerAccountSettingGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,7 @@ func TestWorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettings(t *te option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.AccountSettings.WorkerAccountSettingsNewWorkerAccountSettings( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettingsParams{ - Body: cloudflare.F[any]("{'default_usage_model': 'unbound'}"), - }, - ) + _, err := client.Workers.AccountSettings.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -45,7 +39,7 @@ func TestWorkerAccountSettingWorkerAccountSettingsNewWorkerAccountSettings(t *te } } -func TestWorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettings(t *testing.T) { +func TestWorkerAccountSettingReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +55,13 @@ func TestWorkerAccountSettingWorkerAccountSettingsFetchWorkerAccountSettings(t * option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.AccountSettings.WorkerAccountSettingsFetchWorkerAccountSettings(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Workers.AccountSettings.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.WorkerAccountSettingReplaceParams{ + Body: cloudflare.F[any]("{'default_usage_model': 'unbound'}"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/workerdeploymentbyscript.go b/workerdeploymentbyscript.go index 03b44b328b1..e726fc7a5fa 100644 --- a/workerdeploymentbyscript.go +++ b/workerdeploymentbyscript.go @@ -19,7 +19,6 @@ import ( // [NewWorkerDeploymentByScriptService] method instead. type WorkerDeploymentByScriptService struct { Options []option.RequestOption - Details *WorkerDeploymentByScriptDetailService } // NewWorkerDeploymentByScriptService generates a new service that applies the @@ -28,14 +27,13 @@ type WorkerDeploymentByScriptService struct { func NewWorkerDeploymentByScriptService(opts ...option.RequestOption) (r *WorkerDeploymentByScriptService) { r = &WorkerDeploymentByScriptService{} r.Options = opts - r.Details = NewWorkerDeploymentByScriptDetailService(opts...) return } // List Deployments -func (r *WorkerDeploymentByScriptService) WorkerDeploymentsListDeployments(ctx context.Context, accountID string, scriptID string, opts ...option.RequestOption) (res *WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse, err error) { +func (r *WorkerDeploymentByScriptService) List(ctx context.Context, accountID string, scriptID string, opts ...option.RequestOption) (res *WorkerDeploymentByScriptListResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelope + var env WorkerDeploymentByScriptListResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/deployments/by-script/%s", accountID, scriptID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,39 +43,142 @@ func (r *WorkerDeploymentByScriptService) WorkerDeploymentsListDeployments(ctx c return } -type WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse struct { - Items []interface{} `json:"items"` - Latest interface{} `json:"latest"` - JSON workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseJSON `json:"-"` +// Get Deployment Detail +func (r *WorkerDeploymentByScriptService) Get(ctx context.Context, accountID string, scriptID string, deploymentID string, opts ...option.RequestOption) (res *WorkerDeploymentByScriptGetResponse, err error) { + opts = append(r.Options[:], opts...) + var env WorkerDeploymentByScriptGetResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/deployments/by-script/%s/detail/%s", accountID, scriptID, deploymentID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } -// workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseJSON contains -// the JSON metadata for the struct -// [WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse] -type workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseJSON struct { +type WorkerDeploymentByScriptListResponse struct { + Items []interface{} `json:"items"` + Latest interface{} `json:"latest"` + JSON workerDeploymentByScriptListResponseJSON `json:"-"` +} + +// workerDeploymentByScriptListResponseJSON contains the JSON metadata for the +// struct [WorkerDeploymentByScriptListResponse] +type workerDeploymentByScriptListResponseJSON struct { Items apijson.Field Latest apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDeploymentByScriptListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerDeploymentByScriptGetResponse struct { + ID string `json:"id"` + Metadata interface{} `json:"metadata"` + Number float64 `json:"number"` + Resources interface{} `json:"resources"` + JSON workerDeploymentByScriptGetResponseJSON `json:"-"` +} + +// workerDeploymentByScriptGetResponseJSON contains the JSON metadata for the +// struct [WorkerDeploymentByScriptGetResponse] +type workerDeploymentByScriptGetResponseJSON struct { + ID apijson.Field + Metadata apijson.Field + Number apijson.Field + Resources apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerDeploymentByScriptGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelope struct { - Errors []WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessages `json:"messages,required"` - Result WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponse `json:"result,required"` +type WorkerDeploymentByScriptListResponseEnvelope struct { + Errors []WorkerDeploymentByScriptListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerDeploymentByScriptListResponseEnvelopeMessages `json:"messages,required"` + Result WorkerDeploymentByScriptListResponse `json:"result,required"` + // Whether the API call was successful + Success WorkerDeploymentByScriptListResponseEnvelopeSuccess `json:"success,required"` + JSON workerDeploymentByScriptListResponseEnvelopeJSON `json:"-"` +} + +// workerDeploymentByScriptListResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerDeploymentByScriptListResponseEnvelope] +type workerDeploymentByScriptListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerDeploymentByScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerDeploymentByScriptListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDeploymentByScriptListResponseEnvelopeErrorsJSON `json:"-"` +} + +// workerDeploymentByScriptListResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [WorkerDeploymentByScriptListResponseEnvelopeErrors] +type workerDeploymentByScriptListResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerDeploymentByScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerDeploymentByScriptListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDeploymentByScriptListResponseEnvelopeMessagesJSON `json:"-"` +} + +// workerDeploymentByScriptListResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerDeploymentByScriptListResponseEnvelopeMessages] +type workerDeploymentByScriptListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerDeploymentByScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type WorkerDeploymentByScriptListResponseEnvelopeSuccess bool + +const ( + WorkerDeploymentByScriptListResponseEnvelopeSuccessTrue WorkerDeploymentByScriptListResponseEnvelopeSuccess = true +) + +type WorkerDeploymentByScriptGetResponseEnvelope struct { + Errors []WorkerDeploymentByScriptGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerDeploymentByScriptGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerDeploymentByScriptGetResponse `json:"result,required"` // Whether the API call was successful - Success WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeSuccess `json:"success,required"` - JSON workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeJSON `json:"-"` + Success WorkerDeploymentByScriptGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerDeploymentByScriptGetResponseEnvelopeJSON `json:"-"` } -// workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelope] -type workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeJSON struct { +// workerDeploymentByScriptGetResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerDeploymentByScriptGetResponseEnvelope] +type workerDeploymentByScriptGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -86,53 +187,51 @@ type workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeJSO ExtraFields map[string]apijson.Field } -func (r *WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDeploymentByScriptGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrorsJSON `json:"-"` +type WorkerDeploymentByScriptGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDeploymentByScriptGetResponseEnvelopeErrorsJSON `json:"-"` } -// workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrors] -type workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrorsJSON struct { +// workerDeploymentByScriptGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerDeploymentByScriptGetResponseEnvelopeErrors] +type workerDeploymentByScriptGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDeploymentByScriptGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessagesJSON `json:"-"` +type WorkerDeploymentByScriptGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDeploymentByScriptGetResponseEnvelopeMessagesJSON `json:"-"` } -// workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessages] -type workerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessagesJSON struct { +// workerDeploymentByScriptGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerDeploymentByScriptGetResponseEnvelopeMessages] +type workerDeploymentByScriptGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDeploymentByScriptGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeSuccess bool +type WorkerDeploymentByScriptGetResponseEnvelopeSuccess bool const ( - WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeSuccessTrue WorkerDeploymentByScriptWorkerDeploymentsListDeploymentsResponseEnvelopeSuccess = true + WorkerDeploymentByScriptGetResponseEnvelopeSuccessTrue WorkerDeploymentByScriptGetResponseEnvelopeSuccess = true ) diff --git a/workerdeploymentbyscript_test.go b/workerdeploymentbyscript_test.go index 0e3a7e9ef90..f2299ab4a61 100644 --- a/workerdeploymentbyscript_test.go +++ b/workerdeploymentbyscript_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerDeploymentByScriptWorkerDeploymentsListDeployments(t *testing.T) { +func TestWorkerDeploymentByScriptList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWorkerDeploymentByScriptWorkerDeploymentsListDeployments(t *testing.T) option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Deployments.ByScripts.WorkerDeploymentsListDeployments( + _, err := client.Workers.Deployments.ByScripts.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "8ee82b3a2c0f42928b8f14dae4a97121", @@ -42,3 +42,34 @@ func TestWorkerDeploymentByScriptWorkerDeploymentsListDeployments(t *testing.T) t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestWorkerDeploymentByScriptGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Workers.Deployments.ByScripts.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "8ee82b3a2c0f42928b8f14dae4a97121", + "bcf48806-b317-4351-9ee7-36e7d557d4de", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/workerdeploymentbyscriptdetail.go b/workerdeploymentbyscriptdetail.go deleted file mode 100644 index 81350222b66..00000000000 --- a/workerdeploymentbyscriptdetail.go +++ /dev/null @@ -1,138 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare - -import ( - "context" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -// WorkerDeploymentByScriptDetailService contains methods and other services that -// help with interacting with the cloudflare API. Note, unlike clients, this -// service does not read variables from the environment automatically. You should -// not instantiate this service directly, and instead use the -// [NewWorkerDeploymentByScriptDetailService] method instead. -type WorkerDeploymentByScriptDetailService struct { - Options []option.RequestOption -} - -// NewWorkerDeploymentByScriptDetailService generates a new service that applies -// the given options to each request. These options are applied after the parent -// client's options (if there is one), and before any request-specific options. -func NewWorkerDeploymentByScriptDetailService(opts ...option.RequestOption) (r *WorkerDeploymentByScriptDetailService) { - r = &WorkerDeploymentByScriptDetailService{} - r.Options = opts - return -} - -// Get Deployment Detail -func (r *WorkerDeploymentByScriptDetailService) Get(ctx context.Context, accountID string, scriptID string, deploymentID string, opts ...option.RequestOption) (res *WorkerDeploymentByScriptDetailGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env WorkerDeploymentByScriptDetailGetResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/deployments/by-script/%s/detail/%s", accountID, scriptID, deploymentID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type WorkerDeploymentByScriptDetailGetResponse struct { - ID string `json:"id"` - Metadata interface{} `json:"metadata"` - Number float64 `json:"number"` - Resources interface{} `json:"resources"` - JSON workerDeploymentByScriptDetailGetResponseJSON `json:"-"` -} - -// workerDeploymentByScriptDetailGetResponseJSON contains the JSON metadata for the -// struct [WorkerDeploymentByScriptDetailGetResponse] -type workerDeploymentByScriptDetailGetResponseJSON struct { - ID apijson.Field - Metadata apijson.Field - Number apijson.Field - Resources apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerDeploymentByScriptDetailGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerDeploymentByScriptDetailGetResponseEnvelope struct { - Errors []WorkerDeploymentByScriptDetailGetResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerDeploymentByScriptDetailGetResponseEnvelopeMessages `json:"messages,required"` - Result WorkerDeploymentByScriptDetailGetResponse `json:"result,required"` - // Whether the API call was successful - Success WorkerDeploymentByScriptDetailGetResponseEnvelopeSuccess `json:"success,required"` - JSON workerDeploymentByScriptDetailGetResponseEnvelopeJSON `json:"-"` -} - -// workerDeploymentByScriptDetailGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [WorkerDeploymentByScriptDetailGetResponseEnvelope] -type workerDeploymentByScriptDetailGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerDeploymentByScriptDetailGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerDeploymentByScriptDetailGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDeploymentByScriptDetailGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// workerDeploymentByScriptDetailGetResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [WorkerDeploymentByScriptDetailGetResponseEnvelopeErrors] -type workerDeploymentByScriptDetailGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerDeploymentByScriptDetailGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerDeploymentByScriptDetailGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDeploymentByScriptDetailGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// workerDeploymentByScriptDetailGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [WorkerDeploymentByScriptDetailGetResponseEnvelopeMessages] -type workerDeploymentByScriptDetailGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerDeploymentByScriptDetailGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type WorkerDeploymentByScriptDetailGetResponseEnvelopeSuccess bool - -const ( - WorkerDeploymentByScriptDetailGetResponseEnvelopeSuccessTrue WorkerDeploymentByScriptDetailGetResponseEnvelopeSuccess = true -) diff --git a/workerdomain.go b/workerdomain.go index a50b294ada5..5d8cfafb109 100644 --- a/workerdomain.go +++ b/workerdomain.go @@ -33,6 +33,19 @@ func NewWorkerDomainService(opts ...option.RequestOption) (r *WorkerDomainServic return } +// Lists all Worker Domains for an account. +func (r *WorkerDomainService) List(ctx context.Context, accountID interface{}, query WorkerDomainListParams, opts ...option.RequestOption) (res *[]WorkerDomainListResponse, err error) { + opts = append(r.Options[:], opts...) + var env WorkerDomainListResponseEnvelope + path := fmt.Sprintf("accounts/%v/workers/domains", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + // Detaches a Worker from a zone and hostname. func (r *WorkerDomainService) Delete(ctx context.Context, accountID interface{}, domainID interface{}, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) @@ -56,9 +69,9 @@ func (r *WorkerDomainService) Get(ctx context.Context, accountID interface{}, do } // Attaches a Worker to a zone and hostname. -func (r *WorkerDomainService) WorkerDomainAttachToDomain(ctx context.Context, accountID interface{}, body WorkerDomainWorkerDomainAttachToDomainParams, opts ...option.RequestOption) (res *WorkerDomainWorkerDomainAttachToDomainResponse, err error) { +func (r *WorkerDomainService) Replace(ctx context.Context, accountID interface{}, body WorkerDomainReplaceParams, opts ...option.RequestOption) (res *WorkerDomainReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerDomainWorkerDomainAttachToDomainResponseEnvelope + var env WorkerDomainReplaceResponseEnvelope path := fmt.Sprintf("accounts/%v/workers/domains", accountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -68,20 +81,7 @@ func (r *WorkerDomainService) WorkerDomainAttachToDomain(ctx context.Context, ac return } -// Lists all Worker Domains for an account. -func (r *WorkerDomainService) WorkerDomainListDomains(ctx context.Context, accountID interface{}, query WorkerDomainWorkerDomainListDomainsParams, opts ...option.RequestOption) (res *[]WorkerDomainWorkerDomainListDomainsResponse, err error) { - opts = append(r.Options[:], opts...) - var env WorkerDomainWorkerDomainListDomainsResponseEnvelope - path := fmt.Sprintf("accounts/%v/workers/domains", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type WorkerDomainGetResponse struct { +type WorkerDomainListResponse struct { // Identifer of the Worker Domain. ID interface{} `json:"id"` // Worker environment associated with the zone and hostname. @@ -93,13 +93,13 @@ type WorkerDomainGetResponse struct { // Identifier of the zone. ZoneID interface{} `json:"zone_id"` // Name of the zone. - ZoneName string `json:"zone_name"` - JSON workerDomainGetResponseJSON `json:"-"` + ZoneName string `json:"zone_name"` + JSON workerDomainListResponseJSON `json:"-"` } -// workerDomainGetResponseJSON contains the JSON metadata for the struct -// [WorkerDomainGetResponse] -type workerDomainGetResponseJSON struct { +// workerDomainListResponseJSON contains the JSON metadata for the struct +// [WorkerDomainListResponse] +type workerDomainListResponseJSON struct { ID apijson.Field Environment apijson.Field Hostname apijson.Field @@ -110,11 +110,11 @@ type workerDomainGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainAttachToDomainResponse struct { +type WorkerDomainGetResponse struct { // Identifer of the Worker Domain. ID interface{} `json:"id"` // Worker environment associated with the zone and hostname. @@ -126,13 +126,13 @@ type WorkerDomainWorkerDomainAttachToDomainResponse struct { // Identifier of the zone. ZoneID interface{} `json:"zone_id"` // Name of the zone. - ZoneName string `json:"zone_name"` - JSON workerDomainWorkerDomainAttachToDomainResponseJSON `json:"-"` + ZoneName string `json:"zone_name"` + JSON workerDomainGetResponseJSON `json:"-"` } -// workerDomainWorkerDomainAttachToDomainResponseJSON contains the JSON metadata -// for the struct [WorkerDomainWorkerDomainAttachToDomainResponse] -type workerDomainWorkerDomainAttachToDomainResponseJSON struct { +// workerDomainGetResponseJSON contains the JSON metadata for the struct +// [WorkerDomainGetResponse] +type workerDomainGetResponseJSON struct { ID apijson.Field Environment apijson.Field Hostname apijson.Field @@ -143,11 +143,11 @@ type workerDomainWorkerDomainAttachToDomainResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainAttachToDomainResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainListDomainsResponse struct { +type WorkerDomainReplaceResponse struct { // Identifer of the Worker Domain. ID interface{} `json:"id"` // Worker environment associated with the zone and hostname. @@ -159,13 +159,13 @@ type WorkerDomainWorkerDomainListDomainsResponse struct { // Identifier of the zone. ZoneID interface{} `json:"zone_id"` // Name of the zone. - ZoneName string `json:"zone_name"` - JSON workerDomainWorkerDomainListDomainsResponseJSON `json:"-"` + ZoneName string `json:"zone_name"` + JSON workerDomainReplaceResponseJSON `json:"-"` } -// workerDomainWorkerDomainListDomainsResponseJSON contains the JSON metadata for -// the struct [WorkerDomainWorkerDomainListDomainsResponse] -type workerDomainWorkerDomainListDomainsResponseJSON struct { +// workerDomainReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerDomainReplaceResponse] +type workerDomainReplaceResponseJSON struct { ID apijson.Field Environment apijson.Field Hostname apijson.Field @@ -176,22 +176,43 @@ type workerDomainWorkerDomainListDomainsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainListDomainsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainGetResponseEnvelope struct { - Errors []WorkerDomainGetResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerDomainGetResponseEnvelopeMessages `json:"messages,required"` - Result WorkerDomainGetResponse `json:"result,required"` +type WorkerDomainListParams struct { + // Worker environment associated with the zone and hostname. + Environment param.Field[string] `query:"environment"` + // Hostname of the Worker Domain. + Hostname param.Field[string] `query:"hostname"` + // Worker service associated with the zone and hostname. + Service param.Field[string] `query:"service"` + // Identifier of the zone. + ZoneID param.Field[interface{}] `query:"zone_id"` + // Name of the zone. + ZoneName param.Field[string] `query:"zone_name"` +} + +// URLQuery serializes [WorkerDomainListParams]'s query parameters as `url.Values`. +func (r WorkerDomainListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type WorkerDomainListResponseEnvelope struct { + Errors []WorkerDomainListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerDomainListResponseEnvelopeMessages `json:"messages,required"` + Result []WorkerDomainListResponse `json:"result,required"` // Whether the API call was successful - Success WorkerDomainGetResponseEnvelopeSuccess `json:"success,required"` - JSON workerDomainGetResponseEnvelopeJSON `json:"-"` + Success WorkerDomainListResponseEnvelopeSuccess `json:"success,required"` + JSON workerDomainListResponseEnvelopeJSON `json:"-"` } -// workerDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerDomainGetResponseEnvelope] -type workerDomainGetResponseEnvelopeJSON struct { +// workerDomainListResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerDomainListResponseEnvelope] +type workerDomainListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -200,82 +221,67 @@ type workerDomainGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainGetResponseEnvelopeErrorsJSON `json:"-"` +type WorkerDomainListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainListResponseEnvelopeErrorsJSON `json:"-"` } -// workerDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerDomainGetResponseEnvelopeErrors] -type workerDomainGetResponseEnvelopeErrorsJSON struct { +// workerDomainListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerDomainListResponseEnvelopeErrors] +type workerDomainListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainGetResponseEnvelopeMessagesJSON `json:"-"` +type WorkerDomainListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainListResponseEnvelopeMessagesJSON `json:"-"` } -// workerDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WorkerDomainGetResponseEnvelopeMessages] -type workerDomainGetResponseEnvelopeMessagesJSON struct { +// workerDomainListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerDomainListResponseEnvelopeMessages] +type workerDomainListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerDomainGetResponseEnvelopeSuccess bool +type WorkerDomainListResponseEnvelopeSuccess bool const ( - WorkerDomainGetResponseEnvelopeSuccessTrue WorkerDomainGetResponseEnvelopeSuccess = true + WorkerDomainListResponseEnvelopeSuccessTrue WorkerDomainListResponseEnvelopeSuccess = true ) -type WorkerDomainWorkerDomainAttachToDomainParams struct { - // Worker environment associated with the zone and hostname. - Environment param.Field[string] `json:"environment,required"` - // Hostname of the Worker Domain. - Hostname param.Field[string] `json:"hostname,required"` - // Worker service associated with the zone and hostname. - Service param.Field[string] `json:"service,required"` - // Identifier of the zone. - ZoneID param.Field[interface{}] `json:"zone_id,required"` -} - -func (r WorkerDomainWorkerDomainAttachToDomainParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type WorkerDomainWorkerDomainAttachToDomainResponseEnvelope struct { - Errors []WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeMessages `json:"messages,required"` - Result WorkerDomainWorkerDomainAttachToDomainResponse `json:"result,required"` +type WorkerDomainGetResponseEnvelope struct { + Errors []WorkerDomainGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerDomainGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerDomainGetResponse `json:"result,required"` // Whether the API call was successful - Success WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeSuccess `json:"success,required"` - JSON workerDomainWorkerDomainAttachToDomainResponseEnvelopeJSON `json:"-"` + Success WorkerDomainGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerDomainGetResponseEnvelopeJSON `json:"-"` } -// workerDomainWorkerDomainAttachToDomainResponseEnvelopeJSON contains the JSON -// metadata for the struct [WorkerDomainWorkerDomainAttachToDomainResponseEnvelope] -type workerDomainWorkerDomainAttachToDomainResponseEnvelopeJSON struct { +// workerDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerDomainGetResponseEnvelope] +type workerDomainGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -284,91 +290,82 @@ type workerDomainWorkerDomainAttachToDomainResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainAttachToDomainResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainWorkerDomainAttachToDomainResponseEnvelopeErrorsJSON `json:"-"` +type WorkerDomainGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainGetResponseEnvelopeErrorsJSON `json:"-"` } -// workerDomainWorkerDomainAttachToDomainResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeErrors] -type workerDomainWorkerDomainAttachToDomainResponseEnvelopeErrorsJSON struct { +// workerDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerDomainGetResponseEnvelopeErrors] +type workerDomainGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainWorkerDomainAttachToDomainResponseEnvelopeMessagesJSON `json:"-"` +type WorkerDomainGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainGetResponseEnvelopeMessagesJSON `json:"-"` } -// workerDomainWorkerDomainAttachToDomainResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeMessages] -type workerDomainWorkerDomainAttachToDomainResponseEnvelopeMessagesJSON struct { +// workerDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerDomainGetResponseEnvelopeMessages] +type workerDomainGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeSuccess bool +type WorkerDomainGetResponseEnvelopeSuccess bool const ( - WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeSuccessTrue WorkerDomainWorkerDomainAttachToDomainResponseEnvelopeSuccess = true + WorkerDomainGetResponseEnvelopeSuccessTrue WorkerDomainGetResponseEnvelopeSuccess = true ) -type WorkerDomainWorkerDomainListDomainsParams struct { +type WorkerDomainReplaceParams struct { // Worker environment associated with the zone and hostname. - Environment param.Field[string] `query:"environment"` + Environment param.Field[string] `json:"environment,required"` // Hostname of the Worker Domain. - Hostname param.Field[string] `query:"hostname"` + Hostname param.Field[string] `json:"hostname,required"` // Worker service associated with the zone and hostname. - Service param.Field[string] `query:"service"` + Service param.Field[string] `json:"service,required"` // Identifier of the zone. - ZoneID param.Field[interface{}] `query:"zone_id"` - // Name of the zone. - ZoneName param.Field[string] `query:"zone_name"` + ZoneID param.Field[interface{}] `json:"zone_id,required"` } -// URLQuery serializes [WorkerDomainWorkerDomainListDomainsParams]'s query -// parameters as `url.Values`. -func (r WorkerDomainWorkerDomainListDomainsParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) +func (r WorkerDomainReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) } -type WorkerDomainWorkerDomainListDomainsResponseEnvelope struct { - Errors []WorkerDomainWorkerDomainListDomainsResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerDomainWorkerDomainListDomainsResponseEnvelopeMessages `json:"messages,required"` - Result []WorkerDomainWorkerDomainListDomainsResponse `json:"result,required"` +type WorkerDomainReplaceResponseEnvelope struct { + Errors []WorkerDomainReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerDomainReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerDomainReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerDomainWorkerDomainListDomainsResponseEnvelopeSuccess `json:"success,required"` - JSON workerDomainWorkerDomainListDomainsResponseEnvelopeJSON `json:"-"` + Success WorkerDomainReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerDomainReplaceResponseEnvelopeJSON `json:"-"` } -// workerDomainWorkerDomainListDomainsResponseEnvelopeJSON contains the JSON -// metadata for the struct [WorkerDomainWorkerDomainListDomainsResponseEnvelope] -type workerDomainWorkerDomainListDomainsResponseEnvelopeJSON struct { +// workerDomainReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerDomainReplaceResponseEnvelope] +type workerDomainReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -377,53 +374,51 @@ type workerDomainWorkerDomainListDomainsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainListDomainsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainListDomainsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainWorkerDomainListDomainsResponseEnvelopeErrorsJSON `json:"-"` +type WorkerDomainReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerDomainWorkerDomainListDomainsResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [WorkerDomainWorkerDomainListDomainsResponseEnvelopeErrors] -type workerDomainWorkerDomainListDomainsResponseEnvelopeErrorsJSON struct { +// workerDomainReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerDomainReplaceResponseEnvelopeErrors] +type workerDomainReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainListDomainsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerDomainWorkerDomainListDomainsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerDomainWorkerDomainListDomainsResponseEnvelopeMessagesJSON `json:"-"` +type WorkerDomainReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerDomainReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerDomainWorkerDomainListDomainsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [WorkerDomainWorkerDomainListDomainsResponseEnvelopeMessages] -type workerDomainWorkerDomainListDomainsResponseEnvelopeMessagesJSON struct { +// workerDomainReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerDomainReplaceResponseEnvelopeMessages] +type workerDomainReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerDomainWorkerDomainListDomainsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerDomainReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerDomainWorkerDomainListDomainsResponseEnvelopeSuccess bool +type WorkerDomainReplaceResponseEnvelopeSuccess bool const ( - WorkerDomainWorkerDomainListDomainsResponseEnvelopeSuccessTrue WorkerDomainWorkerDomainListDomainsResponseEnvelopeSuccess = true + WorkerDomainReplaceResponseEnvelopeSuccessTrue WorkerDomainReplaceResponseEnvelopeSuccess = true ) diff --git a/workerdomain_test.go b/workerdomain_test.go index 29772f17b03..1c87929a57e 100644 --- a/workerdomain_test.go +++ b/workerdomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerDomainDelete(t *testing.T) { +func TestWorkerDomainListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,16 @@ func TestWorkerDomainDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - err := client.Workers.Domains.Delete( + _, err := client.Workers.Domains.List( context.TODO(), "9a7806061c88ada191ed06f989cc3dac", - "dbe10b4bc17c295377eabd600e1787fd", + cloudflare.WorkerDomainListParams{ + Environment: cloudflare.F("production"), + Hostname: cloudflare.F("foo.example.com"), + Service: cloudflare.F("foo"), + ZoneID: cloudflare.F[any]("593c9c94de529bbbfaac7c53ced0447d"), + ZoneName: cloudflare.F("example.com"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -43,7 +49,7 @@ func TestWorkerDomainDelete(t *testing.T) { } } -func TestWorkerDomainGet(t *testing.T) { +func TestWorkerDomainDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,7 +65,7 @@ func TestWorkerDomainGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Domains.Get( + err := client.Workers.Domains.Delete( context.TODO(), "9a7806061c88ada191ed06f989cc3dac", "dbe10b4bc17c295377eabd600e1787fd", @@ -73,7 +79,7 @@ func TestWorkerDomainGet(t *testing.T) { } } -func TestWorkerDomainWorkerDomainAttachToDomain(t *testing.T) { +func TestWorkerDomainGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -89,15 +95,10 @@ func TestWorkerDomainWorkerDomainAttachToDomain(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Domains.WorkerDomainAttachToDomain( + _, err := client.Workers.Domains.Get( context.TODO(), "9a7806061c88ada191ed06f989cc3dac", - cloudflare.WorkerDomainWorkerDomainAttachToDomainParams{ - Environment: cloudflare.F("production"), - Hostname: cloudflare.F("foo.example.com"), - Service: cloudflare.F("foo"), - ZoneID: cloudflare.F[any]("593c9c94de529bbbfaac7c53ced0447d"), - }, + "dbe10b4bc17c295377eabd600e1787fd", ) if err != nil { var apierr *cloudflare.Error @@ -108,7 +109,7 @@ func TestWorkerDomainWorkerDomainAttachToDomain(t *testing.T) { } } -func TestWorkerDomainWorkerDomainListDomainsWithOptionalParams(t *testing.T) { +func TestWorkerDomainReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -124,15 +125,14 @@ func TestWorkerDomainWorkerDomainListDomainsWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Domains.WorkerDomainListDomains( + _, err := client.Workers.Domains.Replace( context.TODO(), "9a7806061c88ada191ed06f989cc3dac", - cloudflare.WorkerDomainWorkerDomainListDomainsParams{ + cloudflare.WorkerDomainReplaceParams{ Environment: cloudflare.F("production"), Hostname: cloudflare.F("foo.example.com"), Service: cloudflare.F("foo"), ZoneID: cloudflare.F[any]("593c9c94de529bbbfaac7c53ced0447d"), - ZoneName: cloudflare.F("example.com"), }, ) if err != nil { diff --git a/workerfilter.go b/workerfilter.go index a9f08aa9ffd..684f8e5159e 100644 --- a/workerfilter.go +++ b/workerfilter.go @@ -31,12 +31,12 @@ func NewWorkerFilterService(opts ...option.RequestOption) (r *WorkerFilterServic return } -// Update Filter -func (r *WorkerFilterService) Update(ctx context.Context, zoneID string, filterID string, body WorkerFilterUpdateParams, opts ...option.RequestOption) (res *WorkerFilterUpdateResponse, err error) { +// Create Filter +func (r *WorkerFilterService) New(ctx context.Context, zoneID string, body WorkerFilterNewParams, opts ...option.RequestOption) (res *WorkerFilterNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerFilterUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/filters/%s", zoneID, filterID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env WorkerFilterNewResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/filters", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *WorkerFilterService) Update(ctx context.Context, zoneID string, filterI return } -// Delete Filter -func (r *WorkerFilterService) Delete(ctx context.Context, zoneID string, filterID string, opts ...option.RequestOption) (res *WorkerFilterDeleteResponse, err error) { +// List Filters +func (r *WorkerFilterService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]WorkerFilterListResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerFilterDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/filters/%s", zoneID, filterID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env WorkerFilterListResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/filters", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -57,12 +57,12 @@ func (r *WorkerFilterService) Delete(ctx context.Context, zoneID string, filterI return } -// Create Filter -func (r *WorkerFilterService) WorkerFiltersDeprecatedNewFilter(ctx context.Context, zoneID string, body WorkerFilterWorkerFiltersDeprecatedNewFilterParams, opts ...option.RequestOption) (res *WorkerFilterWorkerFiltersDeprecatedNewFilterResponse, err error) { +// Delete Filter +func (r *WorkerFilterService) Delete(ctx context.Context, zoneID string, filterID string, opts ...option.RequestOption) (res *WorkerFilterDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/filters", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env WorkerFilterDeleteResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/filters/%s", zoneID, filterID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -70,12 +70,12 @@ func (r *WorkerFilterService) WorkerFiltersDeprecatedNewFilter(ctx context.Conte return } -// List Filters -func (r *WorkerFilterService) WorkerFiltersDeprecatedListFilters(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]WorkerFilterWorkerFiltersDeprecatedListFiltersResponse, err error) { +// Update Filter +func (r *WorkerFilterService) Replace(ctx context.Context, zoneID string, filterID string, body WorkerFilterReplaceParams, opts ...option.RequestOption) (res *WorkerFilterReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/filters", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + var env WorkerFilterReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/filters/%s", zoneID, filterID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -83,75 +83,75 @@ func (r *WorkerFilterService) WorkerFiltersDeprecatedListFilters(ctx context.Con return } -type WorkerFilterUpdateResponse struct { +type WorkerFilterNewResponse struct { // Identifier - ID string `json:"id,required"` - Enabled bool `json:"enabled,required"` - Pattern string `json:"pattern,required"` - JSON workerFilterUpdateResponseJSON `json:"-"` + ID string `json:"id,required"` + JSON workerFilterNewResponseJSON `json:"-"` } -// workerFilterUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerFilterUpdateResponse] -type workerFilterUpdateResponseJSON struct { +// workerFilterNewResponseJSON contains the JSON metadata for the struct +// [WorkerFilterNewResponse] +type workerFilterNewResponseJSON struct { ID apijson.Field - Enabled apijson.Field - Pattern apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterDeleteResponse struct { +type WorkerFilterListResponse struct { // Identifier - ID string `json:"id,required"` - JSON workerFilterDeleteResponseJSON `json:"-"` + ID string `json:"id,required"` + Enabled bool `json:"enabled,required"` + Pattern string `json:"pattern,required"` + JSON workerFilterListResponseJSON `json:"-"` } -// workerFilterDeleteResponseJSON contains the JSON metadata for the struct -// [WorkerFilterDeleteResponse] -type workerFilterDeleteResponseJSON struct { +// workerFilterListResponseJSON contains the JSON metadata for the struct +// [WorkerFilterListResponse] +type workerFilterListResponseJSON struct { ID apijson.Field + Enabled apijson.Field + Pattern apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterDeleteResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedNewFilterResponse struct { +type WorkerFilterDeleteResponse struct { // Identifier - ID string `json:"id,required"` - JSON workerFilterWorkerFiltersDeprecatedNewFilterResponseJSON `json:"-"` + ID string `json:"id,required"` + JSON workerFilterDeleteResponseJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedNewFilterResponseJSON contains the JSON -// metadata for the struct [WorkerFilterWorkerFiltersDeprecatedNewFilterResponse] -type workerFilterWorkerFiltersDeprecatedNewFilterResponseJSON struct { +// workerFilterDeleteResponseJSON contains the JSON metadata for the struct +// [WorkerFilterDeleteResponse] +type workerFilterDeleteResponseJSON struct { ID apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedNewFilterResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedListFiltersResponse struct { +type WorkerFilterReplaceResponse struct { // Identifier - ID string `json:"id,required"` - Enabled bool `json:"enabled,required"` - Pattern string `json:"pattern,required"` - JSON workerFilterWorkerFiltersDeprecatedListFiltersResponseJSON `json:"-"` + ID string `json:"id,required"` + Enabled bool `json:"enabled,required"` + Pattern string `json:"pattern,required"` + JSON workerFilterReplaceResponseJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedListFiltersResponseJSON contains the JSON -// metadata for the struct [WorkerFilterWorkerFiltersDeprecatedListFiltersResponse] -type workerFilterWorkerFiltersDeprecatedListFiltersResponseJSON struct { +// workerFilterReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerFilterReplaceResponse] +type workerFilterReplaceResponseJSON struct { ID apijson.Field Enabled apijson.Field Pattern apijson.Field @@ -159,31 +159,31 @@ type workerFilterWorkerFiltersDeprecatedListFiltersResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedListFiltersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterUpdateParams struct { +type WorkerFilterNewParams struct { Enabled param.Field[bool] `json:"enabled,required"` Pattern param.Field[string] `json:"pattern,required"` } -func (r WorkerFilterUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WorkerFilterNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerFilterUpdateResponseEnvelope struct { - Errors []WorkerFilterUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerFilterUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerFilterUpdateResponse `json:"result,required"` +type WorkerFilterNewResponseEnvelope struct { + Errors []WorkerFilterNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerFilterNewResponseEnvelopeMessages `json:"messages,required"` + Result WorkerFilterNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerFilterUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workerFilterUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerFilterNewResponseEnvelopeSuccess `json:"success,required"` + JSON workerFilterNewResponseEnvelopeJSON `json:"-"` } -// workerFilterUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerFilterUpdateResponseEnvelope] -type workerFilterUpdateResponseEnvelopeJSON struct { +// workerFilterNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerFilterNewResponseEnvelope] +type workerFilterNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -192,67 +192,67 @@ type workerFilterUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerFilterUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerFilterNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterNewResponseEnvelopeErrorsJSON `json:"-"` } -// workerFilterUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerFilterUpdateResponseEnvelopeErrors] -type workerFilterUpdateResponseEnvelopeErrorsJSON struct { +// workerFilterNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerFilterNewResponseEnvelopeErrors] +type workerFilterNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerFilterNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterNewResponseEnvelopeMessagesJSON `json:"-"` } -// workerFilterUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [WorkerFilterUpdateResponseEnvelopeMessages] -type workerFilterUpdateResponseEnvelopeMessagesJSON struct { +// workerFilterNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerFilterNewResponseEnvelopeMessages] +type workerFilterNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerFilterUpdateResponseEnvelopeSuccess bool +type WorkerFilterNewResponseEnvelopeSuccess bool const ( - WorkerFilterUpdateResponseEnvelopeSuccessTrue WorkerFilterUpdateResponseEnvelopeSuccess = true + WorkerFilterNewResponseEnvelopeSuccessTrue WorkerFilterNewResponseEnvelopeSuccess = true ) -type WorkerFilterDeleteResponseEnvelope struct { - Errors []WorkerFilterDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerFilterDeleteResponseEnvelopeMessages `json:"messages,required"` - Result WorkerFilterDeleteResponse `json:"result,required,nullable"` +type WorkerFilterListResponseEnvelope struct { + Errors []WorkerFilterListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerFilterListResponseEnvelopeMessages `json:"messages,required"` + Result []WorkerFilterListResponse `json:"result,required"` // Whether the API call was successful - Success WorkerFilterDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON workerFilterDeleteResponseEnvelopeJSON `json:"-"` + Success WorkerFilterListResponseEnvelopeSuccess `json:"success,required"` + JSON workerFilterListResponseEnvelopeJSON `json:"-"` } -// workerFilterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerFilterDeleteResponseEnvelope] -type workerFilterDeleteResponseEnvelopeJSON struct { +// workerFilterListResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerFilterListResponseEnvelope] +type workerFilterListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -261,77 +261,67 @@ type workerFilterDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerFilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterDeleteResponseEnvelopeErrorsJSON `json:"-"` +type WorkerFilterListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterListResponseEnvelopeErrorsJSON `json:"-"` } -// workerFilterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerFilterDeleteResponseEnvelopeErrors] -type workerFilterDeleteResponseEnvelopeErrorsJSON struct { +// workerFilterListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerFilterListResponseEnvelopeErrors] +type workerFilterListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterDeleteResponseEnvelopeMessagesJSON `json:"-"` +type WorkerFilterListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterListResponseEnvelopeMessagesJSON `json:"-"` } -// workerFilterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [WorkerFilterDeleteResponseEnvelopeMessages] -type workerFilterDeleteResponseEnvelopeMessagesJSON struct { +// workerFilterListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerFilterListResponseEnvelopeMessages] +type workerFilterListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerFilterDeleteResponseEnvelopeSuccess bool +type WorkerFilterListResponseEnvelopeSuccess bool const ( - WorkerFilterDeleteResponseEnvelopeSuccessTrue WorkerFilterDeleteResponseEnvelopeSuccess = true + WorkerFilterListResponseEnvelopeSuccessTrue WorkerFilterListResponseEnvelopeSuccess = true ) -type WorkerFilterWorkerFiltersDeprecatedNewFilterParams struct { - Enabled param.Field[bool] `json:"enabled,required"` - Pattern param.Field[string] `json:"pattern,required"` -} - -func (r WorkerFilterWorkerFiltersDeprecatedNewFilterParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelope struct { - Errors []WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessages `json:"messages,required"` - Result WorkerFilterWorkerFiltersDeprecatedNewFilterResponse `json:"result,required,nullable"` +type WorkerFilterDeleteResponseEnvelope struct { + Errors []WorkerFilterDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerFilterDeleteResponseEnvelopeMessages `json:"messages,required"` + Result WorkerFilterDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeSuccess `json:"success,required"` - JSON workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeJSON `json:"-"` + Success WorkerFilterDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON workerFilterDeleteResponseEnvelopeJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelope] -type workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeJSON struct { +// workerFilterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerFilterDeleteResponseEnvelope] +type workerFilterDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -340,70 +330,76 @@ type workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrorsJSON `json:"-"` +type WorkerFilterDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrors] -type workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrorsJSON struct { +// workerFilterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerFilterDeleteResponseEnvelopeErrors] +type workerFilterDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessagesJSON `json:"-"` +type WorkerFilterDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessages] -type workerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessagesJSON struct { +// workerFilterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerFilterDeleteResponseEnvelopeMessages] +type workerFilterDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeSuccess bool +type WorkerFilterDeleteResponseEnvelopeSuccess bool const ( - WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeSuccessTrue WorkerFilterWorkerFiltersDeprecatedNewFilterResponseEnvelopeSuccess = true + WorkerFilterDeleteResponseEnvelopeSuccessTrue WorkerFilterDeleteResponseEnvelopeSuccess = true ) -type WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelope struct { - Errors []WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessages `json:"messages,required"` - Result []WorkerFilterWorkerFiltersDeprecatedListFiltersResponse `json:"result,required"` +type WorkerFilterReplaceParams struct { + Enabled param.Field[bool] `json:"enabled,required"` + Pattern param.Field[string] `json:"pattern,required"` +} + +func (r WorkerFilterReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type WorkerFilterReplaceResponseEnvelope struct { + Errors []WorkerFilterReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerFilterReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerFilterReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeSuccess `json:"success,required"` - JSON workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeJSON `json:"-"` + Success WorkerFilterReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerFilterReplaceResponseEnvelopeJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeJSON contains the -// JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelope] -type workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeJSON struct { +// workerFilterReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerFilterReplaceResponseEnvelope] +type workerFilterReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -412,53 +408,51 @@ type workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrorsJSON `json:"-"` +type WorkerFilterReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrors] -type workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrorsJSON struct { +// workerFilterReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerFilterReplaceResponseEnvelopeErrors] +type workerFilterReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessagesJSON `json:"-"` +type WorkerFilterReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerFilterReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessages] -type workerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessagesJSON struct { +// workerFilterReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerFilterReplaceResponseEnvelopeMessages] +type workerFilterReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerFilterReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeSuccess bool +type WorkerFilterReplaceResponseEnvelopeSuccess bool const ( - WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeSuccessTrue WorkerFilterWorkerFiltersDeprecatedListFiltersResponseEnvelopeSuccess = true + WorkerFilterReplaceResponseEnvelopeSuccessTrue WorkerFilterReplaceResponseEnvelopeSuccess = true ) diff --git a/workerfilter_test.go b/workerfilter_test.go index 260ff8ec0c4..920c8b8fe6c 100644 --- a/workerfilter_test.go +++ b/workerfilter_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerFilterUpdate(t *testing.T) { +func TestWorkerFilterNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestWorkerFilterUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Filters.Update( + _, err := client.Workers.Filters.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerFilterUpdateParams{ + cloudflare.WorkerFilterNewParams{ Enabled: cloudflare.F(true), Pattern: cloudflare.F("example.net/*"), }, @@ -47,7 +46,7 @@ func TestWorkerFilterUpdate(t *testing.T) { } } -func TestWorkerFilterDelete(t *testing.T) { +func TestWorkerFilterList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +62,7 @@ func TestWorkerFilterDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Filters.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Workers.Filters.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -77,7 +72,7 @@ func TestWorkerFilterDelete(t *testing.T) { } } -func TestWorkerFilterWorkerFiltersDeprecatedNewFilter(t *testing.T) { +func TestWorkerFilterDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,13 +88,10 @@ func TestWorkerFilterWorkerFiltersDeprecatedNewFilter(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Filters.WorkerFiltersDeprecatedNewFilter( + _, err := client.Workers.Filters.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerFilterWorkerFiltersDeprecatedNewFilterParams{ - Enabled: cloudflare.F(true), - Pattern: cloudflare.F("example.net/*"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -110,7 +102,7 @@ func TestWorkerFilterWorkerFiltersDeprecatedNewFilter(t *testing.T) { } } -func TestWorkerFilterWorkerFiltersDeprecatedListFilters(t *testing.T) { +func TestWorkerFilterReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -126,7 +118,15 @@ func TestWorkerFilterWorkerFiltersDeprecatedListFilters(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Filters.WorkerFiltersDeprecatedListFilters(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Workers.Filters.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.WorkerFilterReplaceParams{ + Enabled: cloudflare.F(true), + Pattern: cloudflare.F("example.net/*"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/workerqueue.go b/workerqueue.go index 23db7d50551..53b0c144f27 100644 --- a/workerqueue.go +++ b/workerqueue.go @@ -36,12 +36,12 @@ func NewWorkerQueueService(opts ...option.RequestOption) (r *WorkerQueueService) return } -// Updates a queue. -func (r *WorkerQueueService) Update(ctx context.Context, accountID string, name string, body WorkerQueueUpdateParams, opts ...option.RequestOption) (res *WorkerQueueUpdateResponse, err error) { +// Creates a new queue. +func (r *WorkerQueueService) New(ctx context.Context, accountID string, body WorkerQueueNewParams, opts ...option.RequestOption) (res *WorkerQueueNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerQueueUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/queues/%s", accountID, name) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env WorkerQueueNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/queues", accountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -88,12 +88,12 @@ func (r *WorkerQueueService) Get(ctx context.Context, accountID string, name str return } -// Creates a new queue. -func (r *WorkerQueueService) QueueNewQueue(ctx context.Context, accountID string, body WorkerQueueQueueNewQueueParams, opts ...option.RequestOption) (res *WorkerQueueQueueNewQueueResponse, err error) { +// Updates a queue. +func (r *WorkerQueueService) Replace(ctx context.Context, accountID string, name string, body WorkerQueueReplaceParams, opts ...option.RequestOption) (res *WorkerQueueReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerQueueQueueNewQueueResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/queues", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env WorkerQueueReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/queues/%s", accountID, name) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -101,17 +101,17 @@ func (r *WorkerQueueService) QueueNewQueue(ctx context.Context, accountID string return } -type WorkerQueueUpdateResponse struct { - CreatedOn interface{} `json:"created_on"` - ModifiedOn interface{} `json:"modified_on"` - QueueID interface{} `json:"queue_id"` - QueueName string `json:"queue_name"` - JSON workerQueueUpdateResponseJSON `json:"-"` +type WorkerQueueNewResponse struct { + CreatedOn interface{} `json:"created_on"` + ModifiedOn interface{} `json:"modified_on"` + QueueID interface{} `json:"queue_id"` + QueueName string `json:"queue_name"` + JSON workerQueueNewResponseJSON `json:"-"` } -// workerQueueUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerQueueUpdateResponse] -type workerQueueUpdateResponseJSON struct { +// workerQueueNewResponseJSON contains the JSON metadata for the struct +// [WorkerQueueNewResponse] +type workerQueueNewResponseJSON struct { CreatedOn apijson.Field ModifiedOn apijson.Field QueueID apijson.Field @@ -120,7 +120,7 @@ type workerQueueUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -207,17 +207,17 @@ func (r *WorkerQueueGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueQueueNewQueueResponse struct { - CreatedOn interface{} `json:"created_on"` - ModifiedOn interface{} `json:"modified_on"` - QueueID interface{} `json:"queue_id"` - QueueName string `json:"queue_name"` - JSON workerQueueQueueNewQueueResponseJSON `json:"-"` +type WorkerQueueReplaceResponse struct { + CreatedOn interface{} `json:"created_on"` + ModifiedOn interface{} `json:"modified_on"` + QueueID interface{} `json:"queue_id"` + QueueName string `json:"queue_name"` + JSON workerQueueReplaceResponseJSON `json:"-"` } -// workerQueueQueueNewQueueResponseJSON contains the JSON metadata for the struct -// [WorkerQueueQueueNewQueueResponse] -type workerQueueQueueNewQueueResponseJSON struct { +// workerQueueReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerQueueReplaceResponse] +type workerQueueReplaceResponseJSON struct { CreatedOn apijson.Field ModifiedOn apijson.Field QueueID apijson.Field @@ -226,31 +226,31 @@ type workerQueueQueueNewQueueResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueQueueNewQueueResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueUpdateParams struct { +type WorkerQueueNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerQueueUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WorkerQueueNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerQueueUpdateResponseEnvelope struct { - Errors []WorkerQueueUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerQueueUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerQueueUpdateResponse `json:"result,required,nullable"` +type WorkerQueueNewResponseEnvelope struct { + Errors []WorkerQueueNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerQueueNewResponseEnvelopeMessages `json:"messages,required"` + Result WorkerQueueNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerQueueUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WorkerQueueUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON workerQueueUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerQueueNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WorkerQueueNewResponseEnvelopeResultInfo `json:"result_info"` + JSON workerQueueNewResponseEnvelopeJSON `json:"-"` } -// workerQueueUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerQueueUpdateResponseEnvelope] -type workerQueueUpdateResponseEnvelopeJSON struct { +// workerQueueNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerQueueNewResponseEnvelope] +type workerQueueNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -260,56 +260,56 @@ type workerQueueUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerQueueNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueNewResponseEnvelopeErrorsJSON `json:"-"` } -// workerQueueUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerQueueUpdateResponseEnvelopeErrors] -type workerQueueUpdateResponseEnvelopeErrorsJSON struct { +// workerQueueNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerQueueNewResponseEnvelopeErrors] +type workerQueueNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerQueueNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueNewResponseEnvelopeMessagesJSON `json:"-"` } -// workerQueueUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WorkerQueueUpdateResponseEnvelopeMessages] -type workerQueueUpdateResponseEnvelopeMessagesJSON struct { +// workerQueueNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerQueueNewResponseEnvelopeMessages] +type workerQueueNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerQueueUpdateResponseEnvelopeSuccess bool +type WorkerQueueNewResponseEnvelopeSuccess bool const ( - WorkerQueueUpdateResponseEnvelopeSuccessTrue WorkerQueueUpdateResponseEnvelopeSuccess = true + WorkerQueueNewResponseEnvelopeSuccessTrue WorkerQueueNewResponseEnvelopeSuccess = true ) -type WorkerQueueUpdateResponseEnvelopeResultInfo struct { +type WorkerQueueNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -317,13 +317,13 @@ type WorkerQueueUpdateResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON workerQueueUpdateResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON workerQueueNewResponseEnvelopeResultInfoJSON `json:"-"` } -// workerQueueUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for -// the struct [WorkerQueueUpdateResponseEnvelopeResultInfo] -type workerQueueUpdateResponseEnvelopeResultInfoJSON struct { +// workerQueueNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the +// struct [WorkerQueueNewResponseEnvelopeResultInfo] +type workerQueueNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -332,7 +332,7 @@ type workerQueueUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -594,27 +594,27 @@ func (r *WorkerQueueGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (e return apijson.UnmarshalRoot(data, r) } -type WorkerQueueQueueNewQueueParams struct { +type WorkerQueueReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerQueueQueueNewQueueParams) MarshalJSON() (data []byte, err error) { +func (r WorkerQueueReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerQueueQueueNewQueueResponseEnvelope struct { - Errors []WorkerQueueQueueNewQueueResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerQueueQueueNewQueueResponseEnvelopeMessages `json:"messages,required"` - Result WorkerQueueQueueNewQueueResponse `json:"result,required,nullable"` +type WorkerQueueReplaceResponseEnvelope struct { + Errors []WorkerQueueReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerQueueReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerQueueReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerQueueQueueNewQueueResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WorkerQueueQueueNewQueueResponseEnvelopeResultInfo `json:"result_info"` - JSON workerQueueQueueNewQueueResponseEnvelopeJSON `json:"-"` + Success WorkerQueueReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WorkerQueueReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON workerQueueReplaceResponseEnvelopeJSON `json:"-"` } -// workerQueueQueueNewQueueResponseEnvelopeJSON contains the JSON metadata for the -// struct [WorkerQueueQueueNewQueueResponseEnvelope] -type workerQueueQueueNewQueueResponseEnvelopeJSON struct { +// workerQueueReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerQueueReplaceResponseEnvelope] +type workerQueueReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -624,56 +624,56 @@ type workerQueueQueueNewQueueResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueQueueNewQueueResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueQueueNewQueueResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueQueueNewQueueResponseEnvelopeErrorsJSON `json:"-"` +type WorkerQueueReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerQueueQueueNewQueueResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [WorkerQueueQueueNewQueueResponseEnvelopeErrors] -type workerQueueQueueNewQueueResponseEnvelopeErrorsJSON struct { +// workerQueueReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerQueueReplaceResponseEnvelopeErrors] +type workerQueueReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueQueueNewQueueResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueQueueNewQueueResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueQueueNewQueueResponseEnvelopeMessagesJSON `json:"-"` +type WorkerQueueReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerQueueQueueNewQueueResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [WorkerQueueQueueNewQueueResponseEnvelopeMessages] -type workerQueueQueueNewQueueResponseEnvelopeMessagesJSON struct { +// workerQueueReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerQueueReplaceResponseEnvelopeMessages] +type workerQueueReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueQueueNewQueueResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerQueueQueueNewQueueResponseEnvelopeSuccess bool +type WorkerQueueReplaceResponseEnvelopeSuccess bool const ( - WorkerQueueQueueNewQueueResponseEnvelopeSuccessTrue WorkerQueueQueueNewQueueResponseEnvelopeSuccess = true + WorkerQueueReplaceResponseEnvelopeSuccessTrue WorkerQueueReplaceResponseEnvelopeSuccess = true ) -type WorkerQueueQueueNewQueueResponseEnvelopeResultInfo struct { +type WorkerQueueReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -681,13 +681,13 @@ type WorkerQueueQueueNewQueueResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON workerQueueQueueNewQueueResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON workerQueueReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// workerQueueQueueNewQueueResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [WorkerQueueQueueNewQueueResponseEnvelopeResultInfo] -type workerQueueQueueNewQueueResponseEnvelopeResultInfoJSON struct { +// workerQueueReplaceResponseEnvelopeResultInfoJSON contains the JSON metadata for +// the struct [WorkerQueueReplaceResponseEnvelopeResultInfo] +type workerQueueReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -696,6 +696,6 @@ type workerQueueQueueNewQueueResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueQueueNewQueueResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/workerqueue_test.go b/workerqueue_test.go index a1d319fb891..9def46ac99f 100644 --- a/workerqueue_test.go +++ b/workerqueue_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerQueueUpdate(t *testing.T) { +func TestWorkerQueueNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,12 @@ func TestWorkerQueueUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Queues.Update( + _, err := client.Workers.Queues.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "example-queue", - cloudflare.WorkerQueueUpdateParams{ + cloudflare.WorkerQueueNewParams{ Body: cloudflare.F[any](map[string]interface{}{ - "queue_name": "renamed-example-queue", + "queue_name": "example-queue", }), }, ) @@ -134,7 +133,7 @@ func TestWorkerQueueGet(t *testing.T) { } } -func TestWorkerQueueQueueNewQueue(t *testing.T) { +func TestWorkerQueueReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -150,12 +149,13 @@ func TestWorkerQueueQueueNewQueue(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Queues.QueueNewQueue( + _, err := client.Workers.Queues.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerQueueQueueNewQueueParams{ + "example-queue", + cloudflare.WorkerQueueReplaceParams{ Body: cloudflare.F[any](map[string]interface{}{ - "queue_name": "example-queue", + "queue_name": "renamed-example-queue", }), }, ) diff --git a/workerqueueconsumer.go b/workerqueueconsumer.go index 062b5a03fe4..c4d1d9343a3 100644 --- a/workerqueueconsumer.go +++ b/workerqueueconsumer.go @@ -34,12 +34,12 @@ func NewWorkerQueueConsumerService(opts ...option.RequestOption) (r *WorkerQueue return } -// Updates the consumer for a queue, or creates one if it does not exist. -func (r *WorkerQueueConsumerService) Update(ctx context.Context, accountID string, name string, consumerName string, body WorkerQueueConsumerUpdateParams, opts ...option.RequestOption) (res *WorkerQueueConsumerUpdateResponse, err error) { +// Creates a new consumer for a queue. +func (r *WorkerQueueConsumerService) New(ctx context.Context, accountID string, name string, body WorkerQueueConsumerNewParams, opts ...option.RequestOption) (res *WorkerQueueConsumerNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerQueueConsumerUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", accountID, name, consumerName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env WorkerQueueConsumerNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", accountID, name) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -73,12 +73,12 @@ func (r *WorkerQueueConsumerService) Delete(ctx context.Context, accountID strin return } -// Creates a new consumer for a queue. -func (r *WorkerQueueConsumerService) QueueNewQueueConsumer(ctx context.Context, accountID string, name string, body WorkerQueueConsumerQueueNewQueueConsumerParams, opts ...option.RequestOption) (res *WorkerQueueConsumerQueueNewQueueConsumerResponse, err error) { +// Updates the consumer for a queue, or creates one if it does not exist. +func (r *WorkerQueueConsumerService) Replace(ctx context.Context, accountID string, name string, consumerName string, body WorkerQueueConsumerReplaceParams, opts ...option.RequestOption) (res *WorkerQueueConsumerReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", accountID, name) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env WorkerQueueConsumerReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", accountID, name, consumerName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -86,19 +86,19 @@ func (r *WorkerQueueConsumerService) QueueNewQueueConsumer(ctx context.Context, return } -type WorkerQueueConsumerUpdateResponse struct { - CreatedOn interface{} `json:"created_on"` - DeadLetterQueue interface{} `json:"dead_letter_queue"` - Environment interface{} `json:"environment"` - QueueName interface{} `json:"queue_name"` - ScriptName interface{} `json:"script_name"` - Settings WorkerQueueConsumerUpdateResponseSettings `json:"settings"` - JSON workerQueueConsumerUpdateResponseJSON `json:"-"` +type WorkerQueueConsumerNewResponse struct { + CreatedOn interface{} `json:"created_on"` + DeadLetterQueue string `json:"dead_letter_queue"` + Environment interface{} `json:"environment"` + QueueName interface{} `json:"queue_name"` + ScriptName interface{} `json:"script_name"` + Settings WorkerQueueConsumerNewResponseSettings `json:"settings"` + JSON workerQueueConsumerNewResponseJSON `json:"-"` } -// workerQueueConsumerUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerQueueConsumerUpdateResponse] -type workerQueueConsumerUpdateResponseJSON struct { +// workerQueueConsumerNewResponseJSON contains the JSON metadata for the struct +// [WorkerQueueConsumerNewResponse] +type workerQueueConsumerNewResponseJSON struct { CreatedOn apijson.Field DeadLetterQueue apijson.Field Environment apijson.Field @@ -109,20 +109,20 @@ type workerQueueConsumerUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerUpdateResponseSettings struct { - BatchSize float64 `json:"batch_size"` - MaxRetries float64 `json:"max_retries"` - MaxWaitTimeMs float64 `json:"max_wait_time_ms"` - JSON workerQueueConsumerUpdateResponseSettingsJSON `json:"-"` +type WorkerQueueConsumerNewResponseSettings struct { + BatchSize float64 `json:"batch_size"` + MaxRetries float64 `json:"max_retries"` + MaxWaitTimeMs float64 `json:"max_wait_time_ms"` + JSON workerQueueConsumerNewResponseSettingsJSON `json:"-"` } -// workerQueueConsumerUpdateResponseSettingsJSON contains the JSON metadata for the -// struct [WorkerQueueConsumerUpdateResponseSettings] -type workerQueueConsumerUpdateResponseSettingsJSON struct { +// workerQueueConsumerNewResponseSettingsJSON contains the JSON metadata for the +// struct [WorkerQueueConsumerNewResponseSettings] +type workerQueueConsumerNewResponseSettingsJSON struct { BatchSize apijson.Field MaxRetries apijson.Field MaxWaitTimeMs apijson.Field @@ -130,7 +130,7 @@ type workerQueueConsumerUpdateResponseSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -201,19 +201,19 @@ type WorkerQueueConsumerDeleteResponseArray []interface{} func (r WorkerQueueConsumerDeleteResponseArray) ImplementsWorkerQueueConsumerDeleteResponse() {} -type WorkerQueueConsumerQueueNewQueueConsumerResponse struct { - CreatedOn interface{} `json:"created_on"` - DeadLetterQueue string `json:"dead_letter_queue"` - Environment interface{} `json:"environment"` - QueueName interface{} `json:"queue_name"` - ScriptName interface{} `json:"script_name"` - Settings WorkerQueueConsumerQueueNewQueueConsumerResponseSettings `json:"settings"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseJSON `json:"-"` +type WorkerQueueConsumerReplaceResponse struct { + CreatedOn interface{} `json:"created_on"` + DeadLetterQueue interface{} `json:"dead_letter_queue"` + Environment interface{} `json:"environment"` + QueueName interface{} `json:"queue_name"` + ScriptName interface{} `json:"script_name"` + Settings WorkerQueueConsumerReplaceResponseSettings `json:"settings"` + JSON workerQueueConsumerReplaceResponseJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseJSON contains the JSON metadata -// for the struct [WorkerQueueConsumerQueueNewQueueConsumerResponse] -type workerQueueConsumerQueueNewQueueConsumerResponseJSON struct { +// workerQueueConsumerReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerQueueConsumerReplaceResponse] +type workerQueueConsumerReplaceResponseJSON struct { CreatedOn apijson.Field DeadLetterQueue apijson.Field Environment apijson.Field @@ -224,21 +224,20 @@ type workerQueueConsumerQueueNewQueueConsumerResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerQueueNewQueueConsumerResponseSettings struct { - BatchSize float64 `json:"batch_size"` - MaxRetries float64 `json:"max_retries"` - MaxWaitTimeMs float64 `json:"max_wait_time_ms"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseSettingsJSON `json:"-"` +type WorkerQueueConsumerReplaceResponseSettings struct { + BatchSize float64 `json:"batch_size"` + MaxRetries float64 `json:"max_retries"` + MaxWaitTimeMs float64 `json:"max_wait_time_ms"` + JSON workerQueueConsumerReplaceResponseSettingsJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseSettingsJSON contains the JSON -// metadata for the struct -// [WorkerQueueConsumerQueueNewQueueConsumerResponseSettings] -type workerQueueConsumerQueueNewQueueConsumerResponseSettingsJSON struct { +// workerQueueConsumerReplaceResponseSettingsJSON contains the JSON metadata for +// the struct [WorkerQueueConsumerReplaceResponseSettings] +type workerQueueConsumerReplaceResponseSettingsJSON struct { BatchSize apijson.Field MaxRetries apijson.Field MaxWaitTimeMs apijson.Field @@ -246,31 +245,31 @@ type workerQueueConsumerQueueNewQueueConsumerResponseSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerUpdateParams struct { +type WorkerQueueConsumerNewParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerQueueConsumerUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WorkerQueueConsumerNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerQueueConsumerUpdateResponseEnvelope struct { - Errors []WorkerQueueConsumerUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerQueueConsumerUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerQueueConsumerUpdateResponse `json:"result,required,nullable"` +type WorkerQueueConsumerNewResponseEnvelope struct { + Errors []WorkerQueueConsumerNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerQueueConsumerNewResponseEnvelopeMessages `json:"messages,required"` + Result WorkerQueueConsumerNewResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerQueueConsumerUpdateResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WorkerQueueConsumerUpdateResponseEnvelopeResultInfo `json:"result_info"` - JSON workerQueueConsumerUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerQueueConsumerNewResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WorkerQueueConsumerNewResponseEnvelopeResultInfo `json:"result_info"` + JSON workerQueueConsumerNewResponseEnvelopeJSON `json:"-"` } -// workerQueueConsumerUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [WorkerQueueConsumerUpdateResponseEnvelope] -type workerQueueConsumerUpdateResponseEnvelopeJSON struct { +// workerQueueConsumerNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerQueueConsumerNewResponseEnvelope] +type workerQueueConsumerNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -280,56 +279,56 @@ type workerQueueConsumerUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueConsumerUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerQueueConsumerNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueConsumerNewResponseEnvelopeErrorsJSON `json:"-"` } -// workerQueueConsumerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [WorkerQueueConsumerUpdateResponseEnvelopeErrors] -type workerQueueConsumerUpdateResponseEnvelopeErrorsJSON struct { +// workerQueueConsumerNewResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WorkerQueueConsumerNewResponseEnvelopeErrors] +type workerQueueConsumerNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueConsumerUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerQueueConsumerNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueConsumerNewResponseEnvelopeMessagesJSON `json:"-"` } -// workerQueueConsumerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [WorkerQueueConsumerUpdateResponseEnvelopeMessages] -type workerQueueConsumerUpdateResponseEnvelopeMessagesJSON struct { +// workerQueueConsumerNewResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerQueueConsumerNewResponseEnvelopeMessages] +type workerQueueConsumerNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerQueueConsumerUpdateResponseEnvelopeSuccess bool +type WorkerQueueConsumerNewResponseEnvelopeSuccess bool const ( - WorkerQueueConsumerUpdateResponseEnvelopeSuccessTrue WorkerQueueConsumerUpdateResponseEnvelopeSuccess = true + WorkerQueueConsumerNewResponseEnvelopeSuccessTrue WorkerQueueConsumerNewResponseEnvelopeSuccess = true ) -type WorkerQueueConsumerUpdateResponseEnvelopeResultInfo struct { +type WorkerQueueConsumerNewResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -337,13 +336,13 @@ type WorkerQueueConsumerUpdateResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON workerQueueConsumerUpdateResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON workerQueueConsumerNewResponseEnvelopeResultInfoJSON `json:"-"` } -// workerQueueConsumerUpdateResponseEnvelopeResultInfoJSON contains the JSON -// metadata for the struct [WorkerQueueConsumerUpdateResponseEnvelopeResultInfo] -type workerQueueConsumerUpdateResponseEnvelopeResultInfoJSON struct { +// workerQueueConsumerNewResponseEnvelopeResultInfoJSON contains the JSON metadata +// for the struct [WorkerQueueConsumerNewResponseEnvelopeResultInfo] +type workerQueueConsumerNewResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -352,7 +351,7 @@ type workerQueueConsumerUpdateResponseEnvelopeResultInfoJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -516,28 +515,27 @@ func (r *WorkerQueueConsumerDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerQueueNewQueueConsumerParams struct { +type WorkerQueueConsumerReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerQueueConsumerQueueNewQueueConsumerParams) MarshalJSON() (data []byte, err error) { +func (r WorkerQueueConsumerReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelope struct { - Errors []WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessages `json:"messages,required"` - Result WorkerQueueConsumerQueueNewQueueConsumerResponse `json:"result,required,nullable"` +type WorkerQueueConsumerReplaceResponseEnvelope struct { + Errors []WorkerQueueConsumerReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerQueueConsumerReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerQueueConsumerReplaceResponse `json:"result,required,nullable"` // Whether the API call was successful - Success WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeSuccess `json:"success,required"` - ResultInfo WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfo `json:"result_info"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeJSON `json:"-"` + Success WorkerQueueConsumerReplaceResponseEnvelopeSuccess `json:"success,required"` + ResultInfo WorkerQueueConsumerReplaceResponseEnvelopeResultInfo `json:"result_info"` + JSON workerQueueConsumerReplaceResponseEnvelopeJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelope] -type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeJSON struct { +// workerQueueConsumerReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerQueueConsumerReplaceResponseEnvelope] +type workerQueueConsumerReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -547,58 +545,56 @@ type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrorsJSON `json:"-"` +type WorkerQueueConsumerReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueConsumerReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrors] -type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrorsJSON struct { +// workerQueueConsumerReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerQueueConsumerReplaceResponseEnvelopeErrors] +type workerQueueConsumerReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessagesJSON `json:"-"` +type WorkerQueueConsumerReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerQueueConsumerReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessages] -type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessagesJSON struct { +// workerQueueConsumerReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerQueueConsumerReplaceResponseEnvelopeMessages] +type workerQueueConsumerReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeSuccess bool +type WorkerQueueConsumerReplaceResponseEnvelopeSuccess bool const ( - WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeSuccessTrue WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeSuccess = true + WorkerQueueConsumerReplaceResponseEnvelopeSuccessTrue WorkerQueueConsumerReplaceResponseEnvelopeSuccess = true ) -type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfo struct { +type WorkerQueueConsumerReplaceResponseEnvelopeResultInfo struct { // Total number of results for the requested service Count float64 `json:"count"` // Current page within paginated list of results @@ -606,14 +602,13 @@ type WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfo struct { // Number of results per page of results PerPage float64 `json:"per_page"` // Total results available without any search parameters - TotalCount float64 `json:"total_count"` - JSON workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfoJSON `json:"-"` + TotalCount float64 `json:"total_count"` + JSON workerQueueConsumerReplaceResponseEnvelopeResultInfoJSON `json:"-"` } -// workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfoJSON contains -// the JSON metadata for the struct -// [WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfo] -type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfoJSON struct { +// workerQueueConsumerReplaceResponseEnvelopeResultInfoJSON contains the JSON +// metadata for the struct [WorkerQueueConsumerReplaceResponseEnvelopeResultInfo] +type workerQueueConsumerReplaceResponseEnvelopeResultInfoJSON struct { Count apijson.Field Page apijson.Field PerPage apijson.Field @@ -622,6 +617,6 @@ type workerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfoJSON stru ExtraFields map[string]apijson.Field } -func (r *WorkerQueueConsumerQueueNewQueueConsumerResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerQueueConsumerReplaceResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/workerqueueconsumer_test.go b/workerqueueconsumer_test.go index 8f2ca1c57b9..d49b2375f71 100644 --- a/workerqueueconsumer_test.go +++ b/workerqueueconsumer_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerQueueConsumerUpdate(t *testing.T) { +func TestWorkerQueueConsumerNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,18 +29,19 @@ func TestWorkerQueueConsumerUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Queues.Consumers.Update( + _, err := client.Workers.Queues.Consumers.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-queue", - "example-consumer", - cloudflare.WorkerQueueConsumerUpdateParams{ + cloudflare.WorkerQueueConsumerNewParams{ Body: cloudflare.F[any](map[string]interface{}{ - "dead_letter_queue": "updated-example-dlq", + "dead_letter_queue": "example-dlq", "environment": "production", "script_name": "example-consumer", "settings": map[string]interface{}{ - "batch_size": int64(100), + "batch_size": int64(10), + "max_retries": int64(3), + "max_wait_time_ms": int64(5000), }, }), }, @@ -115,7 +116,7 @@ func TestWorkerQueueConsumerDelete(t *testing.T) { } } -func TestWorkerQueueConsumerQueueNewQueueConsumer(t *testing.T) { +func TestWorkerQueueConsumerReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -131,19 +132,18 @@ func TestWorkerQueueConsumerQueueNewQueueConsumer(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Queues.Consumers.QueueNewQueueConsumer( + _, err := client.Workers.Queues.Consumers.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-queue", - cloudflare.WorkerQueueConsumerQueueNewQueueConsumerParams{ + "example-consumer", + cloudflare.WorkerQueueConsumerReplaceParams{ Body: cloudflare.F[any](map[string]interface{}{ - "dead_letter_queue": "example-dlq", + "dead_letter_queue": "updated-example-dlq", "environment": "production", "script_name": "example-consumer", "settings": map[string]interface{}{ - "batch_size": int64(10), - "max_retries": int64(3), - "max_wait_time_ms": int64(5000), + "batch_size": int64(100), }, }), }, diff --git a/workerroute.go b/workerroute.go index 8c5e28b6679..5e59e845317 100644 --- a/workerroute.go +++ b/workerroute.go @@ -34,12 +34,25 @@ func NewWorkerRouteService(opts ...option.RequestOption) (r *WorkerRouteService) return } -// Updates the URL pattern or Worker associated with a route. -func (r *WorkerRouteService) Update(ctx context.Context, zoneID string, routeID string, body WorkerRouteUpdateParams, opts ...option.RequestOption) (res *WorkerRouteUpdateResponse, err error) { +// Creates a route that maps a URL pattern to a Worker. +func (r *WorkerRouteService) New(ctx context.Context, zoneID string, body WorkerRouteNewParams, opts ...option.RequestOption) (res *WorkerRouteNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerRouteUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/routes/%s", zoneID, routeID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + var env WorkerRouteNewResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/routes", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + if err != nil { + return + } + res = &env.Result + return +} + +// Returns routes for a zone. +func (r *WorkerRouteService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]WorkerRouteListResponse, err error) { + opts = append(r.Options[:], opts...) + var env WorkerRouteListResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/routes", zoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -73,12 +86,12 @@ func (r *WorkerRouteService) Get(ctx context.Context, zoneID string, routeID str return } -// Creates a route that maps a URL pattern to a Worker. -func (r *WorkerRouteService) WorkerRoutesNewRoute(ctx context.Context, zoneID string, body WorkerRouteWorkerRoutesNewRouteParams, opts ...option.RequestOption) (res *WorkerRouteWorkerRoutesNewRouteResponse, err error) { +// Updates the URL pattern or Worker associated with a route. +func (r *WorkerRouteService) Replace(ctx context.Context, zoneID string, routeID string, body WorkerRouteReplaceParams, opts ...option.RequestOption) (res *WorkerRouteReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerRouteWorkerRoutesNewRouteResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/routes", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + var env WorkerRouteReplaceResponseEnvelope + path := fmt.Sprintf("zones/%s/workers/routes/%s", zoneID, routeID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -86,31 +99,34 @@ func (r *WorkerRouteService) WorkerRoutesNewRoute(ctx context.Context, zoneID st return } -// Returns routes for a zone. -func (r *WorkerRouteService) WorkerRoutesListRoutes(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *[]WorkerRouteWorkerRoutesListRoutesResponse, err error) { - opts = append(r.Options[:], opts...) - var env WorkerRouteWorkerRoutesListRoutesResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/routes", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return +// Union satisfied by [WorkerRouteNewResponseUnknown] or [shared.UnionString]. +type WorkerRouteNewResponse interface { + ImplementsWorkerRouteNewResponse() } -type WorkerRouteUpdateResponse struct { +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*WorkerRouteNewResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type WorkerRouteListResponse struct { // Identifier ID string `json:"id,required"` Pattern string `json:"pattern,required"` // Name of the script, used in URLs and route configuration. - Script string `json:"script,required"` - JSON workerRouteUpdateResponseJSON `json:"-"` + Script string `json:"script,required"` + JSON workerRouteListResponseJSON `json:"-"` } -// workerRouteUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerRouteUpdateResponse] -type workerRouteUpdateResponseJSON struct { +// workerRouteListResponseJSON contains the JSON metadata for the struct +// [WorkerRouteListResponse] +type workerRouteListResponseJSON struct { ID apijson.Field Pattern apijson.Field Script apijson.Field @@ -118,7 +134,7 @@ type workerRouteUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerRouteUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -161,35 +177,18 @@ func (r *WorkerRouteGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [WorkerRouteWorkerRoutesNewRouteResponseUnknown] or -// [shared.UnionString]. -type WorkerRouteWorkerRoutesNewRouteResponse interface { - ImplementsWorkerRouteWorkerRoutesNewRouteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*WorkerRouteWorkerRoutesNewRouteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type WorkerRouteWorkerRoutesListRoutesResponse struct { +type WorkerRouteReplaceResponse struct { // Identifier ID string `json:"id,required"` Pattern string `json:"pattern,required"` // Name of the script, used in URLs and route configuration. - Script string `json:"script,required"` - JSON workerRouteWorkerRoutesListRoutesResponseJSON `json:"-"` + Script string `json:"script,required"` + JSON workerRouteReplaceResponseJSON `json:"-"` } -// workerRouteWorkerRoutesListRoutesResponseJSON contains the JSON metadata for the -// struct [WorkerRouteWorkerRoutesListRoutesResponse] -type workerRouteWorkerRoutesListRoutesResponseJSON struct { +// workerRouteReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerRouteReplaceResponse] +type workerRouteReplaceResponseJSON struct { ID apijson.Field Pattern apijson.Field Script apijson.Field @@ -197,32 +196,32 @@ type workerRouteWorkerRoutesListRoutesResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerRouteWorkerRoutesListRoutesResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerRouteUpdateParams struct { +type WorkerRouteNewParams struct { Pattern param.Field[string] `json:"pattern,required"` // Name of the script, used in URLs and route configuration. Script param.Field[string] `json:"script"` } -func (r WorkerRouteUpdateParams) MarshalJSON() (data []byte, err error) { +func (r WorkerRouteNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerRouteUpdateResponseEnvelope struct { - Errors []WorkerRouteUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerRouteUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerRouteUpdateResponse `json:"result,required"` +type WorkerRouteNewResponseEnvelope struct { + Errors []WorkerRouteNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerRouteNewResponseEnvelopeMessages `json:"messages,required"` + Result WorkerRouteNewResponse `json:"result,required"` // Whether the API call was successful - Success WorkerRouteUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workerRouteUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerRouteNewResponseEnvelopeSuccess `json:"success,required"` + JSON workerRouteNewResponseEnvelopeJSON `json:"-"` } -// workerRouteUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerRouteUpdateResponseEnvelope] -type workerRouteUpdateResponseEnvelopeJSON struct { +// workerRouteNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerRouteNewResponseEnvelope] +type workerRouteNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -231,53 +230,122 @@ type workerRouteUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerRouteUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerRouteUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerRouteNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteNewResponseEnvelopeErrorsJSON `json:"-"` } -// workerRouteUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerRouteUpdateResponseEnvelopeErrors] -type workerRouteUpdateResponseEnvelopeErrorsJSON struct { +// workerRouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerRouteNewResponseEnvelopeErrors] +type workerRouteNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerRouteUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerRouteUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerRouteNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteNewResponseEnvelopeMessagesJSON `json:"-"` +} + +// workerRouteNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerRouteNewResponseEnvelopeMessages] +type workerRouteNewResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerRouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type WorkerRouteNewResponseEnvelopeSuccess bool + +const ( + WorkerRouteNewResponseEnvelopeSuccessTrue WorkerRouteNewResponseEnvelopeSuccess = true +) + +type WorkerRouteListResponseEnvelope struct { + Errors []WorkerRouteListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerRouteListResponseEnvelopeMessages `json:"messages,required"` + Result []WorkerRouteListResponse `json:"result,required"` + // Whether the API call was successful + Success WorkerRouteListResponseEnvelopeSuccess `json:"success,required"` + JSON workerRouteListResponseEnvelopeJSON `json:"-"` +} + +// workerRouteListResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerRouteListResponseEnvelope] +type workerRouteListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerRouteListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerRouteListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteListResponseEnvelopeErrorsJSON `json:"-"` } -// workerRouteUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WorkerRouteUpdateResponseEnvelopeMessages] -type workerRouteUpdateResponseEnvelopeMessagesJSON struct { +// workerRouteListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerRouteListResponseEnvelopeErrors] +type workerRouteListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerRouteUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerRouteListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteListResponseEnvelopeMessagesJSON `json:"-"` +} + +// workerRouteListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerRouteListResponseEnvelopeMessages] +type workerRouteListResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerRouteListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerRouteUpdateResponseEnvelopeSuccess bool +type WorkerRouteListResponseEnvelopeSuccess bool const ( - WorkerRouteUpdateResponseEnvelopeSuccessTrue WorkerRouteUpdateResponseEnvelopeSuccess = true + WorkerRouteListResponseEnvelopeSuccessTrue WorkerRouteListResponseEnvelopeSuccess = true ) type WorkerRouteDeleteResponseEnvelope struct { @@ -418,98 +486,28 @@ const ( WorkerRouteGetResponseEnvelopeSuccessTrue WorkerRouteGetResponseEnvelopeSuccess = true ) -type WorkerRouteWorkerRoutesNewRouteParams struct { +type WorkerRouteReplaceParams struct { Pattern param.Field[string] `json:"pattern,required"` // Name of the script, used in URLs and route configuration. Script param.Field[string] `json:"script"` } -func (r WorkerRouteWorkerRoutesNewRouteParams) MarshalJSON() (data []byte, err error) { +func (r WorkerRouteReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerRouteWorkerRoutesNewRouteResponseEnvelope struct { - Errors []WorkerRouteWorkerRoutesNewRouteResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerRouteWorkerRoutesNewRouteResponseEnvelopeMessages `json:"messages,required"` - Result WorkerRouteWorkerRoutesNewRouteResponse `json:"result,required"` - // Whether the API call was successful - Success WorkerRouteWorkerRoutesNewRouteResponseEnvelopeSuccess `json:"success,required"` - JSON workerRouteWorkerRoutesNewRouteResponseEnvelopeJSON `json:"-"` -} - -// workerRouteWorkerRoutesNewRouteResponseEnvelopeJSON contains the JSON metadata -// for the struct [WorkerRouteWorkerRoutesNewRouteResponseEnvelope] -type workerRouteWorkerRoutesNewRouteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerRouteWorkerRoutesNewRouteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerRouteWorkerRoutesNewRouteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteWorkerRoutesNewRouteResponseEnvelopeErrorsJSON `json:"-"` -} - -// workerRouteWorkerRoutesNewRouteResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct [WorkerRouteWorkerRoutesNewRouteResponseEnvelopeErrors] -type workerRouteWorkerRoutesNewRouteResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerRouteWorkerRoutesNewRouteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerRouteWorkerRoutesNewRouteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteWorkerRoutesNewRouteResponseEnvelopeMessagesJSON `json:"-"` -} - -// workerRouteWorkerRoutesNewRouteResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [WorkerRouteWorkerRoutesNewRouteResponseEnvelopeMessages] -type workerRouteWorkerRoutesNewRouteResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerRouteWorkerRoutesNewRouteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type WorkerRouteWorkerRoutesNewRouteResponseEnvelopeSuccess bool - -const ( - WorkerRouteWorkerRoutesNewRouteResponseEnvelopeSuccessTrue WorkerRouteWorkerRoutesNewRouteResponseEnvelopeSuccess = true -) - -type WorkerRouteWorkerRoutesListRoutesResponseEnvelope struct { - Errors []WorkerRouteWorkerRoutesListRoutesResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerRouteWorkerRoutesListRoutesResponseEnvelopeMessages `json:"messages,required"` - Result []WorkerRouteWorkerRoutesListRoutesResponse `json:"result,required"` +type WorkerRouteReplaceResponseEnvelope struct { + Errors []WorkerRouteReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerRouteReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerRouteReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerRouteWorkerRoutesListRoutesResponseEnvelopeSuccess `json:"success,required"` - JSON workerRouteWorkerRoutesListRoutesResponseEnvelopeJSON `json:"-"` + Success WorkerRouteReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerRouteReplaceResponseEnvelopeJSON `json:"-"` } -// workerRouteWorkerRoutesListRoutesResponseEnvelopeJSON contains the JSON metadata -// for the struct [WorkerRouteWorkerRoutesListRoutesResponseEnvelope] -type workerRouteWorkerRoutesListRoutesResponseEnvelopeJSON struct { +// workerRouteReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerRouteReplaceResponseEnvelope] +type workerRouteReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -518,53 +516,51 @@ type workerRouteWorkerRoutesListRoutesResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerRouteWorkerRoutesListRoutesResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerRouteWorkerRoutesListRoutesResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteWorkerRoutesListRoutesResponseEnvelopeErrorsJSON `json:"-"` +type WorkerRouteReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerRouteWorkerRoutesListRoutesResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [WorkerRouteWorkerRoutesListRoutesResponseEnvelopeErrors] -type workerRouteWorkerRoutesListRoutesResponseEnvelopeErrorsJSON struct { +// workerRouteReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerRouteReplaceResponseEnvelopeErrors] +type workerRouteReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerRouteWorkerRoutesListRoutesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerRouteWorkerRoutesListRoutesResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerRouteWorkerRoutesListRoutesResponseEnvelopeMessagesJSON `json:"-"` +type WorkerRouteReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerRouteReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerRouteWorkerRoutesListRoutesResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [WorkerRouteWorkerRoutesListRoutesResponseEnvelopeMessages] -type workerRouteWorkerRoutesListRoutesResponseEnvelopeMessagesJSON struct { +// workerRouteReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerRouteReplaceResponseEnvelopeMessages] +type workerRouteReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerRouteWorkerRoutesListRoutesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerRouteReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerRouteWorkerRoutesListRoutesResponseEnvelopeSuccess bool +type WorkerRouteReplaceResponseEnvelopeSuccess bool const ( - WorkerRouteWorkerRoutesListRoutesResponseEnvelopeSuccessTrue WorkerRouteWorkerRoutesListRoutesResponseEnvelopeSuccess = true + WorkerRouteReplaceResponseEnvelopeSuccessTrue WorkerRouteReplaceResponseEnvelopeSuccess = true ) diff --git a/workerroute_test.go b/workerroute_test.go index 296641069b4..6d860922dce 100644 --- a/workerroute_test.go +++ b/workerroute_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerRouteUpdateWithOptionalParams(t *testing.T) { +func TestWorkerRouteNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestWorkerRouteUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Routes.Update( + _, err := client.Workers.Routes.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerRouteUpdateParams{ + cloudflare.WorkerRouteNewParams{ Pattern: cloudflare.F("example.net/*"), Script: cloudflare.F("this-is_my_script-01"), }, @@ -47,7 +46,7 @@ func TestWorkerRouteUpdateWithOptionalParams(t *testing.T) { } } -func TestWorkerRouteDelete(t *testing.T) { +func TestWorkerRouteList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -63,11 +62,7 @@ func TestWorkerRouteDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Routes.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - ) + _, err := client.Workers.Routes.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -77,7 +72,7 @@ func TestWorkerRouteDelete(t *testing.T) { } } -func TestWorkerRouteGet(t *testing.T) { +func TestWorkerRouteDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -93,7 +88,7 @@ func TestWorkerRouteGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Routes.Get( + _, err := client.Workers.Routes.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", @@ -107,7 +102,7 @@ func TestWorkerRouteGet(t *testing.T) { } } -func TestWorkerRouteWorkerRoutesNewRouteWithOptionalParams(t *testing.T) { +func TestWorkerRouteGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -123,13 +118,10 @@ func TestWorkerRouteWorkerRoutesNewRouteWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Routes.WorkerRoutesNewRoute( + _, err := client.Workers.Routes.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerRouteWorkerRoutesNewRouteParams{ - Pattern: cloudflare.F("example.net/*"), - Script: cloudflare.F("this-is_my_script-01"), - }, + "023e105f4ecef8ad9ca31a8372d0c353", ) if err != nil { var apierr *cloudflare.Error @@ -140,7 +132,7 @@ func TestWorkerRouteWorkerRoutesNewRouteWithOptionalParams(t *testing.T) { } } -func TestWorkerRouteWorkerRoutesListRoutes(t *testing.T) { +func TestWorkerRouteReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -156,7 +148,15 @@ func TestWorkerRouteWorkerRoutesListRoutes(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Routes.WorkerRoutesListRoutes(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Workers.Routes.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.WorkerRouteReplaceParams{ + Pattern: cloudflare.F("example.net/*"), + Script: cloudflare.F("this-is_my_script-01"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/workerscript.go b/workerscript.go index ac9b00d7e11..4afba89f573 100644 --- a/workerscript.go +++ b/workerscript.go @@ -10,7 +10,6 @@ import ( "mime/multipart" "net/http" "net/url" - "reflect" "time" "github.com/cloudflare/cloudflare-sdk-go/internal/apiform" @@ -18,9 +17,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" "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" ) // WorkerScriptService contains methods and other services that help with @@ -29,11 +26,11 @@ import ( // this service directly, and instead use the [NewWorkerScriptService] method // instead. type WorkerScriptService struct { - Options []option.RequestOption - Bindings *WorkerScriptBindingService - Schedules *WorkerScriptScheduleService - Tails *WorkerScriptTailService - UsageModels *WorkerScriptUsageModelService + Options []option.RequestOption + Bindings *WorkerScriptBindingService + Schedules *WorkerScriptScheduleService + Tail *WorkerScriptTailService + UsageModel *WorkerScriptUsageModelService } // NewWorkerScriptService generates a new service that applies the given options to @@ -44,34 +41,8 @@ func NewWorkerScriptService(opts ...option.RequestOption) (r *WorkerScriptServic r.Options = opts r.Bindings = NewWorkerScriptBindingService(opts...) r.Schedules = NewWorkerScriptScheduleService(opts...) - r.Tails = NewWorkerScriptTailService(opts...) - r.UsageModels = NewWorkerScriptUsageModelService(opts...) - return -} - -// Upload a worker, or a new version of a worker. -func (r *WorkerScriptService) New(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *WorkerScriptNewResponse, err error) { - opts = append(r.Options[:], opts...) - var env WorkerScriptNewResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/script", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Upload a worker module. -func (r *WorkerScriptService) Update(ctx context.Context, accountID string, scriptName string, params WorkerScriptUpdateParams, opts ...option.RequestOption) (res *WorkerScriptUpdateResponse, err error) { - opts = append(r.Options[:], opts...) - var env WorkerScriptUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/scripts/%s", accountID, scriptName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) - if err != nil { - return - } - res = &env.Result + r.Tail = NewWorkerScriptTailService(opts...) + r.UsageModel = NewWorkerScriptUsageModelService(opts...) return } @@ -107,23 +78,20 @@ func (r *WorkerScriptService) Get(ctx context.Context, accountID string, scriptN return } -// Union satisfied by [WorkerScriptNewResponseUnknown] or [shared.UnionString]. -type WorkerScriptNewResponse interface { - ImplementsWorkerScriptNewResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*WorkerScriptNewResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) +// Upload a worker module. +func (r *WorkerScriptService) Replace(ctx context.Context, accountID string, scriptName string, params WorkerScriptReplaceParams, opts ...option.RequestOption) (res *WorkerScriptReplaceResponse, err error) { + opts = append(r.Options[:], opts...) + var env WorkerScriptReplaceResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/scripts/%s", accountID, scriptName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) + if err != nil { + return + } + res = &env.Result + return } -type WorkerScriptUpdateResponse struct { +type WorkerScriptListResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -139,15 +107,15 @@ type WorkerScriptUpdateResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerScriptUpdateResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerScriptListResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerScriptUpdateResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerScriptListResponseJSON `json:"-"` } -// workerScriptUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerScriptUpdateResponse] -type workerScriptUpdateResponseJSON struct { +// workerScriptListResponseJSON contains the JSON metadata for the struct +// [WorkerScriptListResponse] +type workerScriptListResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -161,24 +129,24 @@ type workerScriptUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type WorkerScriptUpdateResponseTailConsumer struct { +type WorkerScriptListResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerScriptUpdateResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerScriptListResponseTailConsumerJSON `json:"-"` } -// workerScriptUpdateResponseTailConsumerJSON contains the JSON metadata for the -// struct [WorkerScriptUpdateResponseTailConsumer] -type workerScriptUpdateResponseTailConsumerJSON struct { +// workerScriptListResponseTailConsumerJSON contains the JSON metadata for the +// struct [WorkerScriptListResponseTailConsumer] +type workerScriptListResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -186,11 +154,11 @@ type workerScriptUpdateResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptListResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptListResponse struct { +type WorkerScriptReplaceResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -206,15 +174,15 @@ type WorkerScriptListResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerScriptListResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerScriptReplaceResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerScriptListResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerScriptReplaceResponseJSON `json:"-"` } -// workerScriptListResponseJSON contains the JSON metadata for the struct -// [WorkerScriptListResponse] -type workerScriptListResponseJSON struct { +// workerScriptReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerScriptReplaceResponse] +type workerScriptReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -228,24 +196,24 @@ type workerScriptListResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptListResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type WorkerScriptListResponseTailConsumer struct { +type WorkerScriptReplaceResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerScriptListResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerScriptReplaceResponseTailConsumerJSON `json:"-"` } -// workerScriptListResponseTailConsumerJSON contains the JSON metadata for the -// struct [WorkerScriptListResponseTailConsumer] -type workerScriptListResponseTailConsumerJSON struct { +// workerScriptReplaceResponseTailConsumerJSON contains the JSON metadata for the +// struct [WorkerScriptReplaceResponseTailConsumer] +type workerScriptReplaceResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -253,22 +221,22 @@ type workerScriptListResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptListResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptReplaceResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptNewResponseEnvelope struct { - Errors []WorkerScriptNewResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptNewResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptNewResponse `json:"result,required"` +type WorkerScriptListResponseEnvelope struct { + Errors []WorkerScriptListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptListResponseEnvelopeMessages `json:"messages,required"` + Result []WorkerScriptListResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptNewResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptNewResponseEnvelopeJSON `json:"-"` + Success WorkerScriptListResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptListResponseEnvelopeJSON `json:"-"` } -// workerScriptNewResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerScriptNewResponseEnvelope] -type workerScriptNewResponseEnvelopeJSON struct { +// workerScriptListResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerScriptListResponseEnvelope] +type workerScriptListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -277,62 +245,78 @@ type workerScriptNewResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptNewResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptNewResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptListResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptNewResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerScriptNewResponseEnvelopeErrors] -type workerScriptNewResponseEnvelopeErrorsJSON struct { +// workerScriptListResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerScriptListResponseEnvelopeErrors] +type workerScriptListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptNewResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptNewResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptListResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptNewResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WorkerScriptNewResponseEnvelopeMessages] -type workerScriptNewResponseEnvelopeMessagesJSON struct { +// workerScriptListResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [WorkerScriptListResponseEnvelopeMessages] +type workerScriptListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptNewResponseEnvelopeSuccess bool +type WorkerScriptListResponseEnvelopeSuccess bool const ( - WorkerScriptNewResponseEnvelopeSuccessTrue WorkerScriptNewResponseEnvelopeSuccess = true + WorkerScriptListResponseEnvelopeSuccessTrue WorkerScriptListResponseEnvelopeSuccess = true ) +type WorkerScriptDeleteParams struct { + // If set to true, delete will not be stopped by associated service binding, + // durable object, or other binding. Any of these associated bindings/durable + // objects will be deleted along with the script. + Force param.Field[bool] `query:"force"` +} + +// URLQuery serializes [WorkerScriptDeleteParams]'s query parameters as +// `url.Values`. +func (r WorkerScriptDeleteParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + // This interface is a union satisfied by one of the following: -// [WorkerScriptUpdateParamsVariant0], [WorkerScriptUpdateParamsVariant1]. -type WorkerScriptUpdateParams interface { - ImplementsWorkerScriptUpdateParams() +// [WorkerScriptReplaceParamsVariant0], [WorkerScriptReplaceParamsVariant1]. +type WorkerScriptReplaceParams interface { + ImplementsWorkerScriptReplaceParams() } -type WorkerScriptUpdateParamsVariant0 struct { +type WorkerScriptReplaceParamsVariant0 struct { // Rollback to provided deployment based on deployment ID. Request body will only // parse a "message" part. You can learn more about deployments // [here](https://developers.cloudflare.com/workers/platform/deployments/). @@ -342,10 +326,10 @@ type WorkerScriptUpdateParamsVariant0 struct { // and referenced in the metadata as `main_module` or `body_part` by part name. AnyPartName param.Field[[]io.Reader] `json:"" format:"binary"` // JSON encoded metadata about the uploaded parts and Worker configuration. - Metadata param.Field[WorkerScriptUpdateParamsVariant0Metadata] `json:"metadata"` + Metadata param.Field[WorkerScriptReplaceParamsVariant0Metadata] `json:"metadata"` } -func (r WorkerScriptUpdateParamsVariant0) MarshalMultipart() (data []byte, contentType string, err error) { +func (r WorkerScriptReplaceParamsVariant0) MarshalMultipart() (data []byte, contentType string, err error) { buf := bytes.NewBuffer(nil) writer := multipart.NewWriter(buf) err = apiform.MarshalRoot(r, writer) @@ -360,21 +344,21 @@ func (r WorkerScriptUpdateParamsVariant0) MarshalMultipart() (data []byte, conte return buf.Bytes(), writer.FormDataContentType(), nil } -// URLQuery serializes [WorkerScriptUpdateParamsVariant0]'s query parameters as +// URLQuery serializes [WorkerScriptReplaceParamsVariant0]'s query parameters as // `url.Values`. -func (r WorkerScriptUpdateParamsVariant0) URLQuery() (v url.Values) { +func (r WorkerScriptReplaceParamsVariant0) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -func (WorkerScriptUpdateParamsVariant0) ImplementsWorkerScriptUpdateParams() { +func (WorkerScriptReplaceParamsVariant0) ImplementsWorkerScriptReplaceParams() { } // JSON encoded metadata about the uploaded parts and Worker configuration. -type WorkerScriptUpdateParamsVariant0Metadata struct { +type WorkerScriptReplaceParamsVariant0Metadata struct { // List of bindings available to the worker. Bindings param.Field[[]interface{}] `json:"bindings"` // Name of the part in the multipart request that contains the script (e.g. the @@ -396,33 +380,33 @@ type WorkerScriptUpdateParamsVariant0Metadata struct { // the file exporting a `fetch` handler). Indicates a `module syntax` Worker. MainModule param.Field[string] `json:"main_module"` // Migrations to apply for Durable Objects associated with this Worker. - Migrations param.Field[WorkerScriptUpdateParamsVariant0MetadataMigrations] `json:"migrations"` - Placement param.Field[WorkerScriptUpdateParamsVariant0MetadataPlacement] `json:"placement"` + Migrations param.Field[WorkerScriptReplaceParamsVariant0MetadataMigrations] `json:"migrations"` + Placement param.Field[WorkerScriptReplaceParamsVariant0MetadataPlacement] `json:"placement"` // List of strings to use as tags for this Worker Tags param.Field[[]string] `json:"tags"` // List of Workers that will consume logs from the attached Worker. - TailConsumers param.Field[[]WorkerScriptUpdateParamsVariant0MetadataTailConsumer] `json:"tail_consumers"` + TailConsumers param.Field[[]WorkerScriptReplaceParamsVariant0MetadataTailConsumer] `json:"tail_consumers"` // Usage model to apply to invocations. - UsageModel param.Field[WorkerScriptUpdateParamsVariant0MetadataUsageModel] `json:"usage_model"` + UsageModel param.Field[WorkerScriptReplaceParamsVariant0MetadataUsageModel] `json:"usage_model"` // Key-value pairs to use as tags for this version of this Worker VersionTags param.Field[interface{}] `json:"version_tags"` } -func (r WorkerScriptUpdateParamsVariant0Metadata) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0Metadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Migrations to apply for Durable Objects associated with this Worker. // // Satisfied by -// [WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations], -// [WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations]. -type WorkerScriptUpdateParamsVariant0MetadataMigrations interface { - implementsWorkerScriptUpdateParamsVariant0MetadataMigrations() +// [WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations], +// [WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations]. +type WorkerScriptReplaceParamsVariant0MetadataMigrations interface { + implementsWorkerScriptReplaceParamsVariant0MetadataMigrations() } // A single set of migrations to apply. -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. @@ -433,112 +417,112 @@ type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigratio // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) implementsWorkerScriptUpdateParamsVariant0MetadataMigrations() { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations) implementsWorkerScriptReplaceParamsVariant0MetadataMigrations() { } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations struct { // Tag to set as the latest migration tag. NewTag param.Field[string] `json:"new_tag"` // Tag used to verify against the latest migration tag for this Worker. If they // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // Migrations to apply in order. - Steps param.Field[[]WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep] `json:"steps"` + Steps param.Field[[]WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep] `json:"steps"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrations) implementsWorkerScriptUpdateParamsVariant0MetadataMigrations() { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrations) implementsWorkerScriptReplaceParamsVariant0MetadataMigrations() { } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. NewClasses param.Field[[]string] `json:"new_classes"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { +type WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptUpdateParamsVariant0MetadataPlacement struct { +type WorkerScriptReplaceParamsVariant0MetadataPlacement struct { // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported - Mode param.Field[WorkerScriptUpdateParamsVariant0MetadataPlacementMode] `json:"mode"` + Mode param.Field[WorkerScriptReplaceParamsVariant0MetadataPlacementMode] `json:"mode"` } -func (r WorkerScriptUpdateParamsVariant0MetadataPlacement) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataPlacement) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported -type WorkerScriptUpdateParamsVariant0MetadataPlacementMode string +type WorkerScriptReplaceParamsVariant0MetadataPlacementMode string const ( - WorkerScriptUpdateParamsVariant0MetadataPlacementModeSmart WorkerScriptUpdateParamsVariant0MetadataPlacementMode = "smart" + WorkerScriptReplaceParamsVariant0MetadataPlacementModeSmart WorkerScriptReplaceParamsVariant0MetadataPlacementMode = "smart" ) // A reference to a script that will consume logs from the attached Worker. -type WorkerScriptUpdateParamsVariant0MetadataTailConsumer struct { +type WorkerScriptReplaceParamsVariant0MetadataTailConsumer struct { // Name of Worker that is to be the consumer. Service param.Field[string] `json:"service,required"` // Optional environment if the Worker utilizes one. @@ -547,19 +531,19 @@ type WorkerScriptUpdateParamsVariant0MetadataTailConsumer struct { Namespace param.Field[string] `json:"namespace"` } -func (r WorkerScriptUpdateParamsVariant0MetadataTailConsumer) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant0MetadataTailConsumer) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Usage model to apply to invocations. -type WorkerScriptUpdateParamsVariant0MetadataUsageModel string +type WorkerScriptReplaceParamsVariant0MetadataUsageModel string const ( - WorkerScriptUpdateParamsVariant0MetadataUsageModelBundled WorkerScriptUpdateParamsVariant0MetadataUsageModel = "bundled" - WorkerScriptUpdateParamsVariant0MetadataUsageModelUnbound WorkerScriptUpdateParamsVariant0MetadataUsageModel = "unbound" + WorkerScriptReplaceParamsVariant0MetadataUsageModelBundled WorkerScriptReplaceParamsVariant0MetadataUsageModel = "bundled" + WorkerScriptReplaceParamsVariant0MetadataUsageModelUnbound WorkerScriptReplaceParamsVariant0MetadataUsageModel = "unbound" ) -type WorkerScriptUpdateParamsVariant1 struct { +type WorkerScriptReplaceParamsVariant1 struct { // Rollback to provided deployment based on deployment ID. Request body will only // parse a "message" part. You can learn more about deployments // [here](https://developers.cloudflare.com/workers/platform/deployments/). @@ -569,35 +553,35 @@ type WorkerScriptUpdateParamsVariant1 struct { Message param.Field[string] `json:"message"` } -func (r WorkerScriptUpdateParamsVariant1) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptReplaceParamsVariant1) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// URLQuery serializes [WorkerScriptUpdateParamsVariant1]'s query parameters as +// URLQuery serializes [WorkerScriptReplaceParamsVariant1]'s query parameters as // `url.Values`. -func (r WorkerScriptUpdateParamsVariant1) URLQuery() (v url.Values) { +func (r WorkerScriptReplaceParamsVariant1) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -func (WorkerScriptUpdateParamsVariant1) ImplementsWorkerScriptUpdateParams() { +func (WorkerScriptReplaceParamsVariant1) ImplementsWorkerScriptReplaceParams() { } -type WorkerScriptUpdateResponseEnvelope struct { - Errors []WorkerScriptUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptUpdateResponse `json:"result,required"` +type WorkerScriptReplaceResponseEnvelope struct { + Errors []WorkerScriptReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerScriptReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptReplaceResponseEnvelopeJSON `json:"-"` } -// workerScriptUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerScriptUpdateResponseEnvelope] -type workerScriptUpdateResponseEnvelopeJSON struct { +// workerScriptReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptReplaceResponseEnvelope] +type workerScriptReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -606,136 +590,51 @@ type workerScriptUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerScriptUpdateResponseEnvelopeErrors] -type workerScriptUpdateResponseEnvelopeErrorsJSON struct { +// workerScriptReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerScriptReplaceResponseEnvelopeErrors] +type workerScriptReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [WorkerScriptUpdateResponseEnvelopeMessages] -type workerScriptUpdateResponseEnvelopeMessagesJSON struct { +// workerScriptReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerScriptReplaceResponseEnvelopeMessages] +type workerScriptReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptUpdateResponseEnvelopeSuccess bool +type WorkerScriptReplaceResponseEnvelopeSuccess bool const ( - WorkerScriptUpdateResponseEnvelopeSuccessTrue WorkerScriptUpdateResponseEnvelopeSuccess = true + WorkerScriptReplaceResponseEnvelopeSuccessTrue WorkerScriptReplaceResponseEnvelopeSuccess = true ) - -type WorkerScriptListResponseEnvelope struct { - Errors []WorkerScriptListResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptListResponseEnvelopeMessages `json:"messages,required"` - Result []WorkerScriptListResponse `json:"result,required"` - // Whether the API call was successful - Success WorkerScriptListResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptListResponseEnvelopeJSON `json:"-"` -} - -// workerScriptListResponseEnvelopeJSON contains the JSON metadata for the struct -// [WorkerScriptListResponseEnvelope] -type workerScriptListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerScriptListResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptListResponseEnvelopeErrorsJSON `json:"-"` -} - -// workerScriptListResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [WorkerScriptListResponseEnvelopeErrors] -type workerScriptListResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerScriptListResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptListResponseEnvelopeMessagesJSON `json:"-"` -} - -// workerScriptListResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [WorkerScriptListResponseEnvelopeMessages] -type workerScriptListResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -// Whether the API call was successful -type WorkerScriptListResponseEnvelopeSuccess bool - -const ( - WorkerScriptListResponseEnvelopeSuccessTrue WorkerScriptListResponseEnvelopeSuccess = true -) - -type WorkerScriptDeleteParams struct { - // If set to true, delete will not be stopped by associated service binding, - // durable object, or other binding. Any of these associated bindings/durable - // objects will be deleted along with the script. - Force param.Field[bool] `query:"force"` -} - -// URLQuery serializes [WorkerScriptDeleteParams]'s query parameters as -// `url.Values`. -func (r WorkerScriptDeleteParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} diff --git a/workerscript_test.go b/workerscript_test.go index 59bf4ec4b8b..dba0bc1d54a 100644 --- a/workerscript_test.go +++ b/workerscript_test.go @@ -17,7 +17,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerScriptNew(t *testing.T) { +func TestWorkerScriptList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -33,7 +33,7 @@ func TestWorkerScriptNew(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Workers.Scripts.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -43,7 +43,7 @@ func TestWorkerScriptNew(t *testing.T) { } } -func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { +func TestWorkerScriptDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,14 +59,89 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Update( + err := client.Workers.Scripts.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", - cloudflare.WorkerScriptUpdateParamsVariant0{ + cloudflare.WorkerScriptDeleteParams{ + Force: cloudflare.F(true), + }, + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestWorkerScriptGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Write([]byte("abc")) + })) + defer server.Close() + baseURL := server.URL + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + resp, err := client.Workers.Scripts.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "this-is_my_script-01", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } + defer resp.Body.Close() + + b, err := io.ReadAll(resp.Body) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } + if !bytes.Equal(b, []byte("abc")) { + t.Fatalf("return value not %s: %s", "abc", b) + } +} + +func TestWorkerScriptReplaceWithOptionalParams(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Workers.Scripts.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "this-is_my_script-01", + cloudflare.WorkerScriptReplaceParamsVariant0{ RollbackTo: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), - Metadata: cloudflare.F(cloudflare.WorkerScriptUpdateParamsVariant0Metadata{ + Metadata: cloudflare.F(cloudflare.WorkerScriptReplaceParamsVariant0Metadata{ Bindings: cloudflare.F([]interface{}{map[string]interface{}{}, map[string]interface{}{}, map[string]interface{}{}}), BodyPart: cloudflare.F("worker.js"), CompatibilityDate: cloudflare.F("2023-07-25"), @@ -74,12 +149,12 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { KeepBindings: cloudflare.F([]string{"string", "string", "string"}), Logpush: cloudflare.F(false), MainModule: cloudflare.F("worker.js"), - Migrations: cloudflare.F[cloudflare.WorkerScriptUpdateParamsVariant0MetadataMigrations](cloudflare.WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations(cloudflare.WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrations{ + Migrations: cloudflare.F[cloudflare.WorkerScriptReplaceParamsVariant0MetadataMigrations](cloudflare.WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations(cloudflare.WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrations{ NewTag: cloudflare.F("v2"), OldTag: cloudflare.F("v1"), DeletedClasses: cloudflare.F([]string{"string", "string", "string"}), NewClasses: cloudflare.F([]string{"string", "string", "string"}), - RenamedClasses: cloudflare.F([]cloudflare.WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass{{ + RenamedClasses: cloudflare.F([]cloudflare.WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass{{ From: cloudflare.F("string"), To: cloudflare.F("string"), }, { @@ -89,7 +164,7 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { From: cloudflare.F("string"), To: cloudflare.F("string"), }}), - TransferredClasses: cloudflare.F([]cloudflare.WorkerScriptUpdateParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass{{ + TransferredClasses: cloudflare.F([]cloudflare.WorkerScriptReplaceParamsVariant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass{{ From: cloudflare.F("string"), FromScript: cloudflare.F("string"), To: cloudflare.F("string"), @@ -103,11 +178,11 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { To: cloudflare.F("string"), }}), })), - Placement: cloudflare.F(cloudflare.WorkerScriptUpdateParamsVariant0MetadataPlacement{ - Mode: cloudflare.F(cloudflare.WorkerScriptUpdateParamsVariant0MetadataPlacementModeSmart), + Placement: cloudflare.F(cloudflare.WorkerScriptReplaceParamsVariant0MetadataPlacement{ + Mode: cloudflare.F(cloudflare.WorkerScriptReplaceParamsVariant0MetadataPlacementModeSmart), }), Tags: cloudflare.F([]string{"string", "string", "string"}), - TailConsumers: cloudflare.F([]cloudflare.WorkerScriptUpdateParamsVariant0MetadataTailConsumer{{ + TailConsumers: cloudflare.F([]cloudflare.WorkerScriptReplaceParamsVariant0MetadataTailConsumer{{ Environment: cloudflare.F("production"), Namespace: cloudflare.F("my-namespace"), Service: cloudflare.F("my-log-consumer"), @@ -120,7 +195,7 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { Namespace: cloudflare.F("my-namespace"), Service: cloudflare.F("my-log-consumer"), }}), - UsageModel: cloudflare.F(cloudflare.WorkerScriptUpdateParamsVariant0MetadataUsageModelBundled), + UsageModel: cloudflare.F(cloudflare.WorkerScriptReplaceParamsVariant0MetadataUsageModelBundled), VersionTags: cloudflare.F[any](map[string]interface{}{}), }), }, @@ -133,104 +208,3 @@ func TestWorkerScriptUpdateWithOptionalParams(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestWorkerScriptList(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Workers.Scripts.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestWorkerScriptDeleteWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - err := client.Workers.Scripts.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "this-is_my_script-01", - cloudflare.WorkerScriptDeleteParams{ - Force: cloudflare.F(true), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestWorkerScriptGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Write([]byte("abc")) - })) - defer server.Close() - baseURL := server.URL - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - resp, err := client.Workers.Scripts.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "this-is_my_script-01", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } - defer resp.Body.Close() - - b, err := io.ReadAll(resp.Body) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } - if !bytes.Equal(b, []byte("abc")) { - t.Fatalf("return value not %s: %s", "abc", b) - } -} diff --git a/workerscriptcontent.go b/workerscriptcontent.go index d3beb0511a3..c13f923599e 100644 --- a/workerscriptcontent.go +++ b/workerscriptcontent.go @@ -37,9 +37,9 @@ func NewWorkerScriptContentService(opts ...option.RequestOption) (r *WorkerScrip } // Put script content without touching config or metadata -func (r *WorkerScriptContentService) Update(ctx context.Context, accountID string, scriptName string, params WorkerScriptContentUpdateParams, opts ...option.RequestOption) (res *WorkerScriptContentUpdateResponse, err error) { +func (r *WorkerScriptContentService) Replace(ctx context.Context, accountID string, scriptName string, params WorkerScriptContentReplaceParams, opts ...option.RequestOption) (res *WorkerScriptContentReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptContentUpdateResponseEnvelope + var env WorkerScriptContentReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/content", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { @@ -49,7 +49,7 @@ func (r *WorkerScriptContentService) Update(ctx context.Context, accountID strin return } -type WorkerScriptContentUpdateResponse struct { +type WorkerScriptContentReplaceResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -65,15 +65,15 @@ type WorkerScriptContentUpdateResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerScriptContentUpdateResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerScriptContentReplaceResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerScriptContentUpdateResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerScriptContentReplaceResponseJSON `json:"-"` } -// workerScriptContentUpdateResponseJSON contains the JSON metadata for the struct -// [WorkerScriptContentUpdateResponse] -type workerScriptContentUpdateResponseJSON struct { +// workerScriptContentReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerScriptContentReplaceResponse] +type workerScriptContentReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -87,24 +87,24 @@ type workerScriptContentUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptContentUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptContentReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type WorkerScriptContentUpdateResponseTailConsumer struct { +type WorkerScriptContentReplaceResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerScriptContentUpdateResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerScriptContentReplaceResponseTailConsumerJSON `json:"-"` } -// workerScriptContentUpdateResponseTailConsumerJSON contains the JSON metadata for -// the struct [WorkerScriptContentUpdateResponseTailConsumer] -type workerScriptContentUpdateResponseTailConsumerJSON struct { +// workerScriptContentReplaceResponseTailConsumerJSON contains the JSON metadata +// for the struct [WorkerScriptContentReplaceResponseTailConsumer] +type workerScriptContentReplaceResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -112,11 +112,11 @@ type workerScriptContentUpdateResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptContentUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptContentReplaceResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptContentUpdateParams struct { +type WorkerScriptContentReplaceParams struct { // A module comprising a Worker script, often a javascript file. Multiple modules // may be provided as separate named parts, but at least one module must be // present. This should be referenced either in the metadata as `main_module` @@ -124,12 +124,12 @@ type WorkerScriptContentUpdateParams struct { // (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. AnyPartName param.Field[[]io.Reader] `json:"" format:"binary"` // JSON encoded metadata about the uploaded parts and Worker configuration. - Metadata param.Field[WorkerScriptContentUpdateParamsMetadata] `json:"metadata"` - CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` - CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` + Metadata param.Field[WorkerScriptContentReplaceParamsMetadata] `json:"metadata"` + CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` + CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` } -func (r WorkerScriptContentUpdateParams) MarshalMultipart() (data []byte, contentType string, err error) { +func (r WorkerScriptContentReplaceParams) MarshalMultipart() (data []byte, contentType string, err error) { buf := bytes.NewBuffer(nil) writer := multipart.NewWriter(buf) err = apiform.MarshalRoot(r, writer) @@ -145,7 +145,7 @@ func (r WorkerScriptContentUpdateParams) MarshalMultipart() (data []byte, conten } // JSON encoded metadata about the uploaded parts and Worker configuration. -type WorkerScriptContentUpdateParamsMetadata struct { +type WorkerScriptContentReplaceParamsMetadata struct { // Name of the part in the multipart request that contains the script (e.g. the // file adding a listener to the `fetch` event). Indicates a // `service worker syntax` Worker. @@ -155,22 +155,22 @@ type WorkerScriptContentUpdateParamsMetadata struct { MainModule param.Field[string] `json:"main_module"` } -func (r WorkerScriptContentUpdateParamsMetadata) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptContentReplaceParamsMetadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerScriptContentUpdateResponseEnvelope struct { - Errors []WorkerScriptContentUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptContentUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptContentUpdateResponse `json:"result,required"` +type WorkerScriptContentReplaceResponseEnvelope struct { + Errors []WorkerScriptContentReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptContentReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptContentReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptContentUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptContentUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerScriptContentReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptContentReplaceResponseEnvelopeJSON `json:"-"` } -// workerScriptContentUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [WorkerScriptContentUpdateResponseEnvelope] -type workerScriptContentUpdateResponseEnvelopeJSON struct { +// workerScriptContentReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerScriptContentReplaceResponseEnvelope] +type workerScriptContentReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -179,51 +179,51 @@ type workerScriptContentUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptContentUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptContentReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptContentUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptContentUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptContentReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptContentReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptContentUpdateResponseEnvelopeErrorsJSON contains the JSON metadata -// for the struct [WorkerScriptContentUpdateResponseEnvelopeErrors] -type workerScriptContentUpdateResponseEnvelopeErrorsJSON struct { +// workerScriptContentReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerScriptContentReplaceResponseEnvelopeErrors] +type workerScriptContentReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptContentUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptContentReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptContentUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptContentUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptContentReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptContentReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptContentUpdateResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [WorkerScriptContentUpdateResponseEnvelopeMessages] -type workerScriptContentUpdateResponseEnvelopeMessagesJSON struct { +// workerScriptContentReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerScriptContentReplaceResponseEnvelopeMessages] +type workerScriptContentReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptContentUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptContentReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptContentUpdateResponseEnvelopeSuccess bool +type WorkerScriptContentReplaceResponseEnvelopeSuccess bool const ( - WorkerScriptContentUpdateResponseEnvelopeSuccessTrue WorkerScriptContentUpdateResponseEnvelopeSuccess = true + WorkerScriptContentReplaceResponseEnvelopeSuccessTrue WorkerScriptContentReplaceResponseEnvelopeSuccess = true ) diff --git a/workerscriptcontent_test.go b/workerscriptcontent_test.go index 563744153b4..ee17012ff8d 100644 --- a/workerscriptcontent_test.go +++ b/workerscriptcontent_test.go @@ -15,7 +15,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerScriptContentUpdateWithOptionalParams(t *testing.T) { +func TestWorkerScriptContentReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -31,13 +31,13 @@ func TestWorkerScriptContentUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WorkerScripts.Content.Update( + _, err := client.WorkerScripts.Content.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", - cloudflare.WorkerScriptContentUpdateParams{ + cloudflare.WorkerScriptContentReplaceParams{ AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), - Metadata: cloudflare.F(cloudflare.WorkerScriptContentUpdateParamsMetadata{ + Metadata: cloudflare.F(cloudflare.WorkerScriptContentReplaceParamsMetadata{ BodyPart: cloudflare.F("worker.js"), MainModule: cloudflare.F("worker.js"), }), diff --git a/workerscriptschedule.go b/workerscriptschedule.go index 2f20082c7fb..3338db44eb4 100644 --- a/workerscriptschedule.go +++ b/workerscriptschedule.go @@ -32,9 +32,9 @@ func NewWorkerScriptScheduleService(opts ...option.RequestOption) (r *WorkerScri } // Fetches Cron Triggers for a Worker. -func (r *WorkerScriptScheduleService) WorkerCronTriggerGetCronTriggers(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse, err error) { +func (r *WorkerScriptScheduleService) List(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptScheduleListResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelope + var env WorkerScriptScheduleListResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/schedules", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -45,9 +45,9 @@ func (r *WorkerScriptScheduleService) WorkerCronTriggerGetCronTriggers(ctx conte } // Updates Cron Triggers for a Worker. -func (r *WorkerScriptScheduleService) WorkerCronTriggerUpdateCronTriggers(ctx context.Context, accountID string, scriptName string, body WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersParams, opts ...option.RequestOption) (res *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse, err error) { +func (r *WorkerScriptScheduleService) Replace(ctx context.Context, accountID string, scriptName string, body WorkerScriptScheduleReplaceParams, opts ...option.RequestOption) (res *WorkerScriptScheduleReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelope + var env WorkerScriptScheduleReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/schedules", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -57,35 +57,33 @@ func (r *WorkerScriptScheduleService) WorkerCronTriggerUpdateCronTriggers(ctx co return } -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse struct { - Schedules []WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseSchedule `json:"schedules"` - JSON workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseJSON `json:"-"` +type WorkerScriptScheduleListResponse struct { + Schedules []WorkerScriptScheduleListResponseSchedule `json:"schedules"` + JSON workerScriptScheduleListResponseJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseJSON contains the -// JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse] -type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseJSON struct { +// workerScriptScheduleListResponseJSON contains the JSON metadata for the struct +// [WorkerScriptScheduleListResponse] +type workerScriptScheduleListResponseJSON struct { Schedules apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseSchedule struct { - CreatedOn interface{} `json:"created_on"` - Cron interface{} `json:"cron"` - ModifiedOn interface{} `json:"modified_on"` - JSON workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseScheduleJSON `json:"-"` +type WorkerScriptScheduleListResponseSchedule struct { + CreatedOn interface{} `json:"created_on"` + Cron interface{} `json:"cron"` + ModifiedOn interface{} `json:"modified_on"` + JSON workerScriptScheduleListResponseScheduleJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseScheduleJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseSchedule] -type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseScheduleJSON struct { +// workerScriptScheduleListResponseScheduleJSON contains the JSON metadata for the +// struct [WorkerScriptScheduleListResponseSchedule] +type workerScriptScheduleListResponseScheduleJSON struct { CreatedOn apijson.Field Cron apijson.Field ModifiedOn apijson.Field @@ -93,39 +91,37 @@ type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseScheduleJSON st ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleListResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse struct { - Schedules []WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseSchedule `json:"schedules"` - JSON workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseJSON `json:"-"` +type WorkerScriptScheduleReplaceResponse struct { + Schedules []WorkerScriptScheduleReplaceResponseSchedule `json:"schedules"` + JSON workerScriptScheduleReplaceResponseJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseJSON contains the -// JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse] -type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseJSON struct { +// workerScriptScheduleReplaceResponseJSON contains the JSON metadata for the +// struct [WorkerScriptScheduleReplaceResponse] +type workerScriptScheduleReplaceResponseJSON struct { Schedules apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseSchedule struct { - CreatedOn interface{} `json:"created_on"` - Cron interface{} `json:"cron"` - ModifiedOn interface{} `json:"modified_on"` - JSON workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseScheduleJSON `json:"-"` +type WorkerScriptScheduleReplaceResponseSchedule struct { + CreatedOn interface{} `json:"created_on"` + Cron interface{} `json:"cron"` + ModifiedOn interface{} `json:"modified_on"` + JSON workerScriptScheduleReplaceResponseScheduleJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseScheduleJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseSchedule] -type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseScheduleJSON struct { +// workerScriptScheduleReplaceResponseScheduleJSON contains the JSON metadata for +// the struct [WorkerScriptScheduleReplaceResponseSchedule] +type workerScriptScheduleReplaceResponseScheduleJSON struct { CreatedOn apijson.Field Cron apijson.Field ModifiedOn apijson.Field @@ -133,23 +129,22 @@ type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseScheduleJSON ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseSchedule) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleReplaceResponseSchedule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelope struct { - Errors []WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponse `json:"result,required"` +type WorkerScriptScheduleListResponseEnvelope struct { + Errors []WorkerScriptScheduleListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptScheduleListResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptScheduleListResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeJSON `json:"-"` + Success WorkerScriptScheduleListResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptScheduleListResponseEnvelopeJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelope] -type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeJSON struct { +// workerScriptScheduleListResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptScheduleListResponseEnvelope] +type workerScriptScheduleListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -158,78 +153,75 @@ type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeJSON st ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptScheduleListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptScheduleListResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrors] -type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrorsJSON struct { +// workerScriptScheduleListResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerScriptScheduleListResponseEnvelopeErrors] +type workerScriptScheduleListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptScheduleListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptScheduleListResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessages] -type workerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessagesJSON struct { +// workerScriptScheduleListResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerScriptScheduleListResponseEnvelopeMessages] +type workerScriptScheduleListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeSuccess bool +type WorkerScriptScheduleListResponseEnvelopeSuccess bool const ( - WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeSuccessTrue WorkerScriptScheduleWorkerCronTriggerGetCronTriggersResponseEnvelopeSuccess = true + WorkerScriptScheduleListResponseEnvelopeSuccessTrue WorkerScriptScheduleListResponseEnvelopeSuccess = true ) -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersParams struct { +type WorkerScriptScheduleReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersParams) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptScheduleReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelope struct { - Errors []WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponse `json:"result,required"` +type WorkerScriptScheduleReplaceResponseEnvelope struct { + Errors []WorkerScriptScheduleReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptScheduleReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptScheduleReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeJSON `json:"-"` + Success WorkerScriptScheduleReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptScheduleReplaceResponseEnvelopeJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelope] -type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeJSON struct { +// workerScriptScheduleReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerScriptScheduleReplaceResponseEnvelope] +type workerScriptScheduleReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -238,53 +230,51 @@ type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptScheduleReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptScheduleReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrors] -type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrorsJSON struct { +// workerScriptScheduleReplaceResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerScriptScheduleReplaceResponseEnvelopeErrors] +type workerScriptScheduleReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptScheduleReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptScheduleReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessages] -type workerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessagesJSON struct { +// workerScriptScheduleReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerScriptScheduleReplaceResponseEnvelopeMessages] +type workerScriptScheduleReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptScheduleReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeSuccess bool +type WorkerScriptScheduleReplaceResponseEnvelopeSuccess bool const ( - WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeSuccessTrue WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersResponseEnvelopeSuccess = true + WorkerScriptScheduleReplaceResponseEnvelopeSuccessTrue WorkerScriptScheduleReplaceResponseEnvelopeSuccess = true ) diff --git a/workerscriptschedule_test.go b/workerscriptschedule_test.go index f68b7a7fede..0d1ae46f5ac 100644 --- a/workerscriptschedule_test.go +++ b/workerscriptschedule_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerScriptScheduleWorkerCronTriggerGetCronTriggers(t *testing.T) { +func TestWorkerScriptScheduleList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWorkerScriptScheduleWorkerCronTriggerGetCronTriggers(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Schedules.WorkerCronTriggerGetCronTriggers( + _, err := client.Workers.Scripts.Schedules.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", @@ -43,7 +43,7 @@ func TestWorkerScriptScheduleWorkerCronTriggerGetCronTriggers(t *testing.T) { } } -func TestWorkerScriptScheduleWorkerCronTriggerUpdateCronTriggers(t *testing.T) { +func TestWorkerScriptScheduleReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,11 +59,11 @@ func TestWorkerScriptScheduleWorkerCronTriggerUpdateCronTriggers(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Schedules.WorkerCronTriggerUpdateCronTriggers( + _, err := client.Workers.Scripts.Schedules.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", - cloudflare.WorkerScriptScheduleWorkerCronTriggerUpdateCronTriggersParams{ + cloudflare.WorkerScriptScheduleReplaceParams{ Body: cloudflare.F[any]("[{'cron': '*/30 * * * *'}]"), }, ) diff --git a/workerscripttail.go b/workerscripttail.go index 7662f36f023..ef08feabb8f 100644 --- a/workerscripttail.go +++ b/workerscripttail.go @@ -33,12 +33,12 @@ func NewWorkerScriptTailService(opts ...option.RequestOption) (r *WorkerScriptTa return } -// Deletes a tail from a Worker. -func (r *WorkerScriptTailService) Delete(ctx context.Context, accountID string, scriptName string, id string, opts ...option.RequestOption) (res *WorkerScriptTailDeleteResponse, err error) { +// Starts a tail that receives logs and exception from a Worker. +func (r *WorkerScriptTailService) New(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptTailNewResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptTailDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails/%s", accountID, scriptName, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) + var env WorkerScriptTailNewResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", accountID, scriptName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return } @@ -47,9 +47,9 @@ func (r *WorkerScriptTailService) Delete(ctx context.Context, accountID string, } // Get list of tails currently deployed on a Worker. -func (r *WorkerScriptTailService) WorkerTailLogsListTails(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptTailWorkerTailLogsListTailsResponse, err error) { +func (r *WorkerScriptTailService) List(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptTailListResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptTailWorkerTailLogsListTailsResponseEnvelope + var env WorkerScriptTailListResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -59,12 +59,12 @@ func (r *WorkerScriptTailService) WorkerTailLogsListTails(ctx context.Context, a return } -// Starts a tail that receives logs and exception from a Worker. -func (r *WorkerScriptTailService) WorkerTailLogsStartTail(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptTailWorkerTailLogsStartTailResponse, err error) { +// Deletes a tail from a Worker. +func (r *WorkerScriptTailService) Delete(ctx context.Context, accountID string, scriptName string, id string, opts ...option.RequestOption) (res *WorkerScriptTailDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptTailWorkerTailLogsStartTailResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", accountID, scriptName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + var env WorkerScriptTailDeleteResponseEnvelope + path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails/%s", accountID, scriptName, id) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return } @@ -72,37 +72,16 @@ func (r *WorkerScriptTailService) WorkerTailLogsStartTail(ctx context.Context, a return } -// Union satisfied by [WorkerScriptTailDeleteResponseUnknown], -// [WorkerScriptTailDeleteResponseArray] or [shared.UnionString]. -type WorkerScriptTailDeleteResponse interface { - ImplementsWorkerScriptTailDeleteResponse() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*WorkerScriptTailDeleteResponse)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type WorkerScriptTailDeleteResponseArray []interface{} - -func (r WorkerScriptTailDeleteResponseArray) ImplementsWorkerScriptTailDeleteResponse() {} - -type WorkerScriptTailWorkerTailLogsListTailsResponse struct { - ID interface{} `json:"id"` - ExpiresAt interface{} `json:"expires_at"` - URL interface{} `json:"url"` - JSON workerScriptTailWorkerTailLogsListTailsResponseJSON `json:"-"` +type WorkerScriptTailNewResponse struct { + ID interface{} `json:"id"` + ExpiresAt interface{} `json:"expires_at"` + URL interface{} `json:"url"` + JSON workerScriptTailNewResponseJSON `json:"-"` } -// workerScriptTailWorkerTailLogsListTailsResponseJSON contains the JSON metadata -// for the struct [WorkerScriptTailWorkerTailLogsListTailsResponse] -type workerScriptTailWorkerTailLogsListTailsResponseJSON struct { +// workerScriptTailNewResponseJSON contains the JSON metadata for the struct +// [WorkerScriptTailNewResponse] +type workerScriptTailNewResponseJSON struct { ID apijson.Field ExpiresAt apijson.Field URL apijson.Field @@ -110,20 +89,20 @@ type workerScriptTailWorkerTailLogsListTailsResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsListTailsResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailWorkerTailLogsStartTailResponse struct { - ID interface{} `json:"id"` - ExpiresAt interface{} `json:"expires_at"` - URL interface{} `json:"url"` - JSON workerScriptTailWorkerTailLogsStartTailResponseJSON `json:"-"` +type WorkerScriptTailListResponse struct { + ID interface{} `json:"id"` + ExpiresAt interface{} `json:"expires_at"` + URL interface{} `json:"url"` + JSON workerScriptTailListResponseJSON `json:"-"` } -// workerScriptTailWorkerTailLogsStartTailResponseJSON contains the JSON metadata -// for the struct [WorkerScriptTailWorkerTailLogsStartTailResponse] -type workerScriptTailWorkerTailLogsStartTailResponseJSON struct { +// workerScriptTailListResponseJSON contains the JSON metadata for the struct +// [WorkerScriptTailListResponse] +type workerScriptTailListResponseJSON struct { ID apijson.Field ExpiresAt apijson.Field URL apijson.Field @@ -131,22 +110,43 @@ type workerScriptTailWorkerTailLogsStartTailResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsStartTailResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailListResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailDeleteResponseEnvelope struct { - Errors []WorkerScriptTailDeleteResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptTailDeleteResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptTailDeleteResponse `json:"result,required"` +// Union satisfied by [WorkerScriptTailDeleteResponseUnknown], +// [WorkerScriptTailDeleteResponseArray] or [shared.UnionString]. +type WorkerScriptTailDeleteResponse interface { + ImplementsWorkerScriptTailDeleteResponse() +} + +func init() { + apijson.RegisterUnion( + reflect.TypeOf((*WorkerScriptTailDeleteResponse)(nil)).Elem(), + "", + apijson.UnionVariant{ + TypeFilter: gjson.String, + Type: reflect.TypeOf(shared.UnionString("")), + }, + ) +} + +type WorkerScriptTailDeleteResponseArray []interface{} + +func (r WorkerScriptTailDeleteResponseArray) ImplementsWorkerScriptTailDeleteResponse() {} + +type WorkerScriptTailNewResponseEnvelope struct { + Errors []WorkerScriptTailNewResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptTailNewResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptTailNewResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptTailDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptTailDeleteResponseEnvelopeJSON `json:"-"` + Success WorkerScriptTailNewResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptTailNewResponseEnvelopeJSON `json:"-"` } -// workerScriptTailDeleteResponseEnvelopeJSON contains the JSON metadata for the -// struct [WorkerScriptTailDeleteResponseEnvelope] -type workerScriptTailDeleteResponseEnvelopeJSON struct { +// workerScriptTailNewResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptTailNewResponseEnvelope] +type workerScriptTailNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -155,68 +155,67 @@ type workerScriptTailDeleteResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailDeleteResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailDeleteResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptTailNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailNewResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptTailDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for -// the struct [WorkerScriptTailDeleteResponseEnvelopeErrors] -type workerScriptTailDeleteResponseEnvelopeErrorsJSON struct { +// workerScriptTailNewResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerScriptTailNewResponseEnvelopeErrors] +type workerScriptTailNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailDeleteResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailDeleteResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptTailNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailNewResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptTailDeleteResponseEnvelopeMessagesJSON contains the JSON metadata -// for the struct [WorkerScriptTailDeleteResponseEnvelopeMessages] -type workerScriptTailDeleteResponseEnvelopeMessagesJSON struct { +// workerScriptTailNewResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerScriptTailNewResponseEnvelopeMessages] +type workerScriptTailNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptTailDeleteResponseEnvelopeSuccess bool +type WorkerScriptTailNewResponseEnvelopeSuccess bool const ( - WorkerScriptTailDeleteResponseEnvelopeSuccessTrue WorkerScriptTailDeleteResponseEnvelopeSuccess = true + WorkerScriptTailNewResponseEnvelopeSuccessTrue WorkerScriptTailNewResponseEnvelopeSuccess = true ) -type WorkerScriptTailWorkerTailLogsListTailsResponseEnvelope struct { - Errors []WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptTailWorkerTailLogsListTailsResponse `json:"result,required"` +type WorkerScriptTailListResponseEnvelope struct { + Errors []WorkerScriptTailListResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptTailListResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptTailListResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptTailWorkerTailLogsListTailsResponseEnvelopeJSON `json:"-"` + Success WorkerScriptTailListResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptTailListResponseEnvelopeJSON `json:"-"` } -// workerScriptTailWorkerTailLogsListTailsResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [WorkerScriptTailWorkerTailLogsListTailsResponseEnvelope] -type workerScriptTailWorkerTailLogsListTailsResponseEnvelopeJSON struct { +// workerScriptTailListResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptTailListResponseEnvelope] +type workerScriptTailListResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -225,70 +224,67 @@ type workerScriptTailWorkerTailLogsListTailsResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsListTailsResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptTailListResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailListResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrors] -type workerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrorsJSON struct { +// workerScriptTailListResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WorkerScriptTailListResponseEnvelopeErrors] +type workerScriptTailListResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptTailListResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailListResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessages] -type workerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessagesJSON struct { +// workerScriptTailListResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerScriptTailListResponseEnvelopeMessages] +type workerScriptTailListResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeSuccess bool +type WorkerScriptTailListResponseEnvelopeSuccess bool const ( - WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeSuccessTrue WorkerScriptTailWorkerTailLogsListTailsResponseEnvelopeSuccess = true + WorkerScriptTailListResponseEnvelopeSuccessTrue WorkerScriptTailListResponseEnvelopeSuccess = true ) -type WorkerScriptTailWorkerTailLogsStartTailResponseEnvelope struct { - Errors []WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptTailWorkerTailLogsStartTailResponse `json:"result,required"` +type WorkerScriptTailDeleteResponseEnvelope struct { + Errors []WorkerScriptTailDeleteResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptTailDeleteResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptTailDeleteResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptTailWorkerTailLogsStartTailResponseEnvelopeJSON `json:"-"` + Success WorkerScriptTailDeleteResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptTailDeleteResponseEnvelopeJSON `json:"-"` } -// workerScriptTailWorkerTailLogsStartTailResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [WorkerScriptTailWorkerTailLogsStartTailResponseEnvelope] -type workerScriptTailWorkerTailLogsStartTailResponseEnvelopeJSON struct { +// workerScriptTailDeleteResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptTailDeleteResponseEnvelope] +type workerScriptTailDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -297,53 +293,51 @@ type workerScriptTailWorkerTailLogsStartTailResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsStartTailResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptTailDeleteResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailDeleteResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrorsJSON contains the -// JSON metadata for the struct -// [WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrors] -type workerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrorsJSON struct { +// workerScriptTailDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WorkerScriptTailDeleteResponseEnvelopeErrors] +type workerScriptTailDeleteResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptTailDeleteResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptTailDeleteResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessagesJSON contains the -// JSON metadata for the struct -// [WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessages] -type workerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessagesJSON struct { +// workerScriptTailDeleteResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerScriptTailDeleteResponseEnvelopeMessages] +type workerScriptTailDeleteResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptTailDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeSuccess bool +type WorkerScriptTailDeleteResponseEnvelopeSuccess bool const ( - WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeSuccessTrue WorkerScriptTailWorkerTailLogsStartTailResponseEnvelopeSuccess = true + WorkerScriptTailDeleteResponseEnvelopeSuccessTrue WorkerScriptTailDeleteResponseEnvelopeSuccess = true ) diff --git a/workerscripttail_test.go b/workerscripttail_test.go index c1758086bc6..b12c2b52133 100644 --- a/workerscripttail_test.go +++ b/workerscripttail_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerScriptTailDelete(t *testing.T) { +func TestWorkerScriptTailNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,10 @@ func TestWorkerScriptTailDelete(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Tails.Delete( + _, err := client.Workers.Scripts.Tail.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", - "03dc9f77817b488fb26c5861ec18f791", ) if err != nil { var apierr *cloudflare.Error @@ -44,7 +43,7 @@ func TestWorkerScriptTailDelete(t *testing.T) { } } -func TestWorkerScriptTailWorkerTailLogsListTails(t *testing.T) { +func TestWorkerScriptTailList(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,7 +59,7 @@ func TestWorkerScriptTailWorkerTailLogsListTails(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Tails.WorkerTailLogsListTails( + _, err := client.Workers.Scripts.Tail.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", @@ -74,7 +73,7 @@ func TestWorkerScriptTailWorkerTailLogsListTails(t *testing.T) { } } -func TestWorkerScriptTailWorkerTailLogsStartTail(t *testing.T) { +func TestWorkerScriptTailDelete(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -90,10 +89,11 @@ func TestWorkerScriptTailWorkerTailLogsStartTail(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.Tails.WorkerTailLogsStartTail( + _, err := client.Workers.Scripts.Tail.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", + "03dc9f77817b488fb26c5861ec18f791", ) if err != nil { var apierr *cloudflare.Error diff --git a/workerscriptusagemodel.go b/workerscriptusagemodel.go index a12aff54085..f8badd09ff3 100644 --- a/workerscriptusagemodel.go +++ b/workerscriptusagemodel.go @@ -32,9 +32,9 @@ func NewWorkerScriptUsageModelService(opts ...option.RequestOption) (r *WorkerSc } // Fetches the Usage Model for a given Worker. -func (r *WorkerScriptUsageModelService) WorkerScriptFetchUsageModel(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse, err error) { +func (r *WorkerScriptUsageModelService) Get(ctx context.Context, accountID string, scriptName string, opts ...option.RequestOption) (res *WorkerScriptUsageModelGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelope + var env WorkerScriptUsageModelGetResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/usage-model", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { @@ -46,9 +46,9 @@ func (r *WorkerScriptUsageModelService) WorkerScriptFetchUsageModel(ctx context. // Updates the Usage Model for a given Worker. Requires a Workers Paid // subscription. -func (r *WorkerScriptUsageModelService) WorkerScriptUpdateUsageModel(ctx context.Context, accountID string, scriptName string, body WorkerScriptUsageModelWorkerScriptUpdateUsageModelParams, opts ...option.RequestOption) (res *WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse, err error) { +func (r *WorkerScriptUsageModelService) Replace(ctx context.Context, accountID string, scriptName string, body WorkerScriptUsageModelReplaceParams, opts ...option.RequestOption) (res *WorkerScriptUsageModelReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelope + var env WorkerScriptUsageModelReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/usage-model", accountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -58,55 +58,52 @@ func (r *WorkerScriptUsageModelService) WorkerScriptUpdateUsageModel(ctx context return } -type WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse struct { - UsageModel interface{} `json:"usage_model"` - JSON workerScriptUsageModelWorkerScriptFetchUsageModelResponseJSON `json:"-"` +type WorkerScriptUsageModelGetResponse struct { + UsageModel interface{} `json:"usage_model"` + JSON workerScriptUsageModelGetResponseJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptFetchUsageModelResponseJSON contains the JSON -// metadata for the struct -// [WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse] -type workerScriptUsageModelWorkerScriptFetchUsageModelResponseJSON struct { +// workerScriptUsageModelGetResponseJSON contains the JSON metadata for the struct +// [WorkerScriptUsageModelGetResponse] +type workerScriptUsageModelGetResponseJSON struct { UsageModel apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse struct { - UsageModel interface{} `json:"usage_model"` - JSON workerScriptUsageModelWorkerScriptUpdateUsageModelResponseJSON `json:"-"` +type WorkerScriptUsageModelReplaceResponse struct { + UsageModel interface{} `json:"usage_model"` + JSON workerScriptUsageModelReplaceResponseJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptUpdateUsageModelResponseJSON contains the JSON -// metadata for the struct -// [WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse] -type workerScriptUsageModelWorkerScriptUpdateUsageModelResponseJSON struct { +// workerScriptUsageModelReplaceResponseJSON contains the JSON metadata for the +// struct [WorkerScriptUsageModelReplaceResponse] +type workerScriptUsageModelReplaceResponseJSON struct { UsageModel apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelope struct { - Errors []WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptUsageModelWorkerScriptFetchUsageModelResponse `json:"result,required"` +type WorkerScriptUsageModelGetResponseEnvelope struct { + Errors []WorkerScriptUsageModelGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptUsageModelGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptUsageModelGetResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeJSON `json:"-"` + Success WorkerScriptUsageModelGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptUsageModelGetResponseEnvelopeJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelope] -type workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeJSON struct { +// workerScriptUsageModelGetResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerScriptUsageModelGetResponseEnvelope] +type workerScriptUsageModelGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -115,78 +112,75 @@ type workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeJSON struc ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptUsageModelGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptUsageModelGetResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrors] -type workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrorsJSON struct { +// workerScriptUsageModelGetResponseEnvelopeErrorsJSON contains the JSON metadata +// for the struct [WorkerScriptUsageModelGetResponseEnvelopeErrors] +type workerScriptUsageModelGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptUsageModelGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptUsageModelGetResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessages] -type workerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessagesJSON struct { +// workerScriptUsageModelGetResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerScriptUsageModelGetResponseEnvelopeMessages] +type workerScriptUsageModelGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeSuccess bool +type WorkerScriptUsageModelGetResponseEnvelopeSuccess bool const ( - WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeSuccessTrue WorkerScriptUsageModelWorkerScriptFetchUsageModelResponseEnvelopeSuccess = true + WorkerScriptUsageModelGetResponseEnvelopeSuccessTrue WorkerScriptUsageModelGetResponseEnvelopeSuccess = true ) -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelParams struct { +type WorkerScriptUsageModelReplaceParams struct { Body param.Field[interface{}] `json:"body,required"` } -func (r WorkerScriptUsageModelWorkerScriptUpdateUsageModelParams) MarshalJSON() (data []byte, err error) { +func (r WorkerScriptUsageModelReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelope struct { - Errors []WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessages `json:"messages,required"` - Result WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponse `json:"result,required"` +type WorkerScriptUsageModelReplaceResponseEnvelope struct { + Errors []WorkerScriptUsageModelReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerScriptUsageModelReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerScriptUsageModelReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeSuccess `json:"success,required"` - JSON workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeJSON `json:"-"` + Success WorkerScriptUsageModelReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerScriptUsageModelReplaceResponseEnvelopeJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeJSON contains -// the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelope] -type workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeJSON struct { +// workerScriptUsageModelReplaceResponseEnvelopeJSON contains the JSON metadata for +// the struct [WorkerScriptUsageModelReplaceResponseEnvelope] +type workerScriptUsageModelReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -195,53 +189,51 @@ type workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeJSON stru ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrorsJSON `json:"-"` +type WorkerScriptUsageModelReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptUsageModelReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrorsJSON -// contains the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrors] -type workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrorsJSON struct { +// workerScriptUsageModelReplaceResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct [WorkerScriptUsageModelReplaceResponseEnvelopeErrors] +type workerScriptUsageModelReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessagesJSON `json:"-"` +type WorkerScriptUsageModelReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerScriptUsageModelReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessagesJSON -// contains the JSON metadata for the struct -// [WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessages] -type workerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessagesJSON struct { +// workerScriptUsageModelReplaceResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct [WorkerScriptUsageModelReplaceResponseEnvelopeMessages] +type workerScriptUsageModelReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerScriptUsageModelReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeSuccess bool +type WorkerScriptUsageModelReplaceResponseEnvelopeSuccess bool const ( - WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeSuccessTrue WorkerScriptUsageModelWorkerScriptUpdateUsageModelResponseEnvelopeSuccess = true + WorkerScriptUsageModelReplaceResponseEnvelopeSuccessTrue WorkerScriptUsageModelReplaceResponseEnvelopeSuccess = true ) diff --git a/workerscriptusagemodel_test.go b/workerscriptusagemodel_test.go index fbb5aa46f2b..2b7e4ba89df 100644 --- a/workerscriptusagemodel_test.go +++ b/workerscriptusagemodel_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerScriptUsageModelWorkerScriptFetchUsageModel(t *testing.T) { +func TestWorkerScriptUsageModelGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,7 +29,7 @@ func TestWorkerScriptUsageModelWorkerScriptFetchUsageModel(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.UsageModels.WorkerScriptFetchUsageModel( + _, err := client.Workers.Scripts.UsageModel.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", @@ -43,7 +43,7 @@ func TestWorkerScriptUsageModelWorkerScriptFetchUsageModel(t *testing.T) { } } -func TestWorkerScriptUsageModelWorkerScriptUpdateUsageModel(t *testing.T) { +func TestWorkerScriptUsageModelReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -59,11 +59,11 @@ func TestWorkerScriptUsageModelWorkerScriptUpdateUsageModel(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Scripts.UsageModels.WorkerScriptUpdateUsageModel( + _, err := client.Workers.Scripts.UsageModel.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "this-is_my_script-01", - cloudflare.WorkerScriptUsageModelWorkerScriptUpdateUsageModelParams{ + cloudflare.WorkerScriptUsageModelReplaceParams{ Body: cloudflare.F[any]("{'usage_model': 'unbound'}"), }, ) diff --git a/workerserviceenvironmentcontent.go b/workerserviceenvironmentcontent.go index 9ca89d9fe31..919509edfa8 100644 --- a/workerserviceenvironmentcontent.go +++ b/workerserviceenvironmentcontent.go @@ -36,10 +36,19 @@ func NewWorkerServiceEnvironmentContentService(opts ...option.RequestOption) (r return } +// Get script content from a worker with an environment +func (r *WorkerServiceEnvironmentContentService) Get(ctx context.Context, accountID string, serviceName string, environmentName string, opts ...option.RequestOption) (res *http.Response, err error) { + opts = append(r.Options[:], opts...) + opts = append([]option.RequestOption{option.WithHeader("Accept", "string")}, opts...) + path := fmt.Sprintf("accounts/%s/workers/services/%s/environments/%s/content", accountID, serviceName, environmentName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) + return +} + // Put script content from a worker with an environment -func (r *WorkerServiceEnvironmentContentService) Update(ctx context.Context, accountID string, serviceName string, environmentName string, params WorkerServiceEnvironmentContentUpdateParams, opts ...option.RequestOption) (res *WorkerServiceEnvironmentContentUpdateResponse, err error) { +func (r *WorkerServiceEnvironmentContentService) Replace(ctx context.Context, accountID string, serviceName string, environmentName string, params WorkerServiceEnvironmentContentReplaceParams, opts ...option.RequestOption) (res *WorkerServiceEnvironmentContentReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerServiceEnvironmentContentUpdateResponseEnvelope + var env WorkerServiceEnvironmentContentReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/services/%s/environments/%s/content", accountID, serviceName, environmentName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { @@ -49,16 +58,7 @@ func (r *WorkerServiceEnvironmentContentService) Update(ctx context.Context, acc return } -// Get script content from a worker with an environment -func (r *WorkerServiceEnvironmentContentService) Get(ctx context.Context, accountID string, serviceName string, environmentName string, opts ...option.RequestOption) (res *http.Response, err error) { - opts = append(r.Options[:], opts...) - opts = append([]option.RequestOption{option.WithHeader("Accept", "string")}, opts...) - path := fmt.Sprintf("accounts/%s/workers/services/%s/environments/%s/content", accountID, serviceName, environmentName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) - return -} - -type WorkerServiceEnvironmentContentUpdateResponse struct { +type WorkerServiceEnvironmentContentReplaceResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -74,15 +74,15 @@ type WorkerServiceEnvironmentContentUpdateResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerServiceEnvironmentContentUpdateResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerServiceEnvironmentContentReplaceResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerServiceEnvironmentContentUpdateResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerServiceEnvironmentContentReplaceResponseJSON `json:"-"` } -// workerServiceEnvironmentContentUpdateResponseJSON contains the JSON metadata for -// the struct [WorkerServiceEnvironmentContentUpdateResponse] -type workerServiceEnvironmentContentUpdateResponseJSON struct { +// workerServiceEnvironmentContentReplaceResponseJSON contains the JSON metadata +// for the struct [WorkerServiceEnvironmentContentReplaceResponse] +type workerServiceEnvironmentContentReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -96,25 +96,25 @@ type workerServiceEnvironmentContentUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentContentUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentContentReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type WorkerServiceEnvironmentContentUpdateResponseTailConsumer struct { +type WorkerServiceEnvironmentContentReplaceResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerServiceEnvironmentContentUpdateResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerServiceEnvironmentContentReplaceResponseTailConsumerJSON `json:"-"` } -// workerServiceEnvironmentContentUpdateResponseTailConsumerJSON contains the JSON +// workerServiceEnvironmentContentReplaceResponseTailConsumerJSON contains the JSON // metadata for the struct -// [WorkerServiceEnvironmentContentUpdateResponseTailConsumer] -type workerServiceEnvironmentContentUpdateResponseTailConsumerJSON struct { +// [WorkerServiceEnvironmentContentReplaceResponseTailConsumer] +type workerServiceEnvironmentContentReplaceResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -122,11 +122,11 @@ type workerServiceEnvironmentContentUpdateResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentContentUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentContentReplaceResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentContentUpdateParams struct { +type WorkerServiceEnvironmentContentReplaceParams struct { // A module comprising a Worker script, often a javascript file. Multiple modules // may be provided as separate named parts, but at least one module must be // present. This should be referenced either in the metadata as `main_module` @@ -134,12 +134,12 @@ type WorkerServiceEnvironmentContentUpdateParams struct { // (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. AnyPartName param.Field[[]io.Reader] `json:"" format:"binary"` // JSON encoded metadata about the uploaded parts and Worker configuration. - Metadata param.Field[WorkerServiceEnvironmentContentUpdateParamsMetadata] `json:"metadata"` - CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` - CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` + Metadata param.Field[WorkerServiceEnvironmentContentReplaceParamsMetadata] `json:"metadata"` + CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` + CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` } -func (r WorkerServiceEnvironmentContentUpdateParams) MarshalMultipart() (data []byte, contentType string, err error) { +func (r WorkerServiceEnvironmentContentReplaceParams) MarshalMultipart() (data []byte, contentType string, err error) { buf := bytes.NewBuffer(nil) writer := multipart.NewWriter(buf) err = apiform.MarshalRoot(r, writer) @@ -155,7 +155,7 @@ func (r WorkerServiceEnvironmentContentUpdateParams) MarshalMultipart() (data [] } // JSON encoded metadata about the uploaded parts and Worker configuration. -type WorkerServiceEnvironmentContentUpdateParamsMetadata struct { +type WorkerServiceEnvironmentContentReplaceParamsMetadata struct { // Name of the part in the multipart request that contains the script (e.g. the // file adding a listener to the `fetch` event). Indicates a // `service worker syntax` Worker. @@ -165,22 +165,22 @@ type WorkerServiceEnvironmentContentUpdateParamsMetadata struct { MainModule param.Field[string] `json:"main_module"` } -func (r WorkerServiceEnvironmentContentUpdateParamsMetadata) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentContentReplaceParamsMetadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentContentUpdateResponseEnvelope struct { - Errors []WorkerServiceEnvironmentContentUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerServiceEnvironmentContentUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkerServiceEnvironmentContentUpdateResponse `json:"result,required"` +type WorkerServiceEnvironmentContentReplaceResponseEnvelope struct { + Errors []WorkerServiceEnvironmentContentReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerServiceEnvironmentContentReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerServiceEnvironmentContentReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerServiceEnvironmentContentUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workerServiceEnvironmentContentUpdateResponseEnvelopeJSON `json:"-"` + Success WorkerServiceEnvironmentContentReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerServiceEnvironmentContentReplaceResponseEnvelopeJSON `json:"-"` } -// workerServiceEnvironmentContentUpdateResponseEnvelopeJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentContentUpdateResponseEnvelope] -type workerServiceEnvironmentContentUpdateResponseEnvelopeJSON struct { +// workerServiceEnvironmentContentReplaceResponseEnvelopeJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentContentReplaceResponseEnvelope] +type workerServiceEnvironmentContentReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -189,53 +189,53 @@ type workerServiceEnvironmentContentUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentContentUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentContentReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentContentUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerServiceEnvironmentContentUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkerServiceEnvironmentContentReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerServiceEnvironmentContentReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerServiceEnvironmentContentUpdateResponseEnvelopeErrorsJSON contains the +// workerServiceEnvironmentContentReplaceResponseEnvelopeErrorsJSON contains the // JSON metadata for the struct -// [WorkerServiceEnvironmentContentUpdateResponseEnvelopeErrors] -type workerServiceEnvironmentContentUpdateResponseEnvelopeErrorsJSON struct { +// [WorkerServiceEnvironmentContentReplaceResponseEnvelopeErrors] +type workerServiceEnvironmentContentReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentContentUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentContentReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentContentUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerServiceEnvironmentContentUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkerServiceEnvironmentContentReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerServiceEnvironmentContentReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerServiceEnvironmentContentUpdateResponseEnvelopeMessagesJSON contains the +// workerServiceEnvironmentContentReplaceResponseEnvelopeMessagesJSON contains the // JSON metadata for the struct -// [WorkerServiceEnvironmentContentUpdateResponseEnvelopeMessages] -type workerServiceEnvironmentContentUpdateResponseEnvelopeMessagesJSON struct { +// [WorkerServiceEnvironmentContentReplaceResponseEnvelopeMessages] +type workerServiceEnvironmentContentReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentContentUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentContentReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerServiceEnvironmentContentUpdateResponseEnvelopeSuccess bool +type WorkerServiceEnvironmentContentReplaceResponseEnvelopeSuccess bool const ( - WorkerServiceEnvironmentContentUpdateResponseEnvelopeSuccessTrue WorkerServiceEnvironmentContentUpdateResponseEnvelopeSuccess = true + WorkerServiceEnvironmentContentReplaceResponseEnvelopeSuccessTrue WorkerServiceEnvironmentContentReplaceResponseEnvelopeSuccess = true ) diff --git a/workerserviceenvironmentcontent_test.go b/workerserviceenvironmentcontent_test.go index 9414de7f422..28a70cea5f3 100644 --- a/workerserviceenvironmentcontent_test.go +++ b/workerserviceenvironmentcontent_test.go @@ -17,15 +17,14 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerServiceEnvironmentContentUpdateWithOptionalParams(t *testing.T) { +func TestWorkerServiceEnvironmentContentGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Write([]byte("abc")) + })) + defer server.Close() + baseURL := server.URL client := cloudflare.NewClient( option.WithBaseURL(baseURL), option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), @@ -33,20 +32,11 @@ func TestWorkerServiceEnvironmentContentUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Services.Environments.Content.Update( + resp, err := client.Workers.Services.Environments.Content.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-worker", "production", - cloudflare.WorkerServiceEnvironmentContentUpdateParams{ - AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), - Metadata: cloudflare.F(cloudflare.WorkerServiceEnvironmentContentUpdateParamsMetadata{ - BodyPart: cloudflare.F("worker.js"), - MainModule: cloudflare.F("worker.js"), - }), - CfWorkerBodyPart: cloudflare.F("string"), - CfWorkerMainModulePart: cloudflare.F("string"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -55,16 +45,30 @@ func TestWorkerServiceEnvironmentContentUpdateWithOptionalParams(t *testing.T) { } t.Fatalf("err should be nil: %s", err.Error()) } + defer resp.Body.Close() + + b, err := io.ReadAll(resp.Body) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } + if !bytes.Equal(b, []byte("abc")) { + t.Fatalf("return value not %s: %s", "abc", b) + } } -func TestWorkerServiceEnvironmentContentGet(t *testing.T) { +func TestWorkerServiceEnvironmentContentReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Write([]byte("abc")) - })) - defer server.Close() - baseURL := server.URL + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } client := cloudflare.NewClient( option.WithBaseURL(baseURL), option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), @@ -72,11 +76,20 @@ func TestWorkerServiceEnvironmentContentGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - resp, err := client.Workers.Services.Environments.Content.Get( + _, err := client.Workers.Services.Environments.Content.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-worker", "production", + cloudflare.WorkerServiceEnvironmentContentReplaceParams{ + AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), + Metadata: cloudflare.F(cloudflare.WorkerServiceEnvironmentContentReplaceParamsMetadata{ + BodyPart: cloudflare.F("worker.js"), + MainModule: cloudflare.F("worker.js"), + }), + CfWorkerBodyPart: cloudflare.F("string"), + CfWorkerMainModulePart: cloudflare.F("string"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -85,17 +98,4 @@ func TestWorkerServiceEnvironmentContentGet(t *testing.T) { } t.Fatalf("err should be nil: %s", err.Error()) } - defer resp.Body.Close() - - b, err := io.ReadAll(resp.Body) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } - if !bytes.Equal(b, []byte("abc")) { - t.Fatalf("return value not %s: %s", "abc", b) - } } diff --git a/workerserviceenvironmentsetting.go b/workerserviceenvironmentsetting.go index 76ecbf8b987..aab2768fd91 100644 --- a/workerserviceenvironmentsetting.go +++ b/workerserviceenvironmentsetting.go @@ -32,12 +32,12 @@ func NewWorkerServiceEnvironmentSettingService(opts ...option.RequestOption) (r return } -// Get script settings from a worker with an environment -func (r *WorkerServiceEnvironmentSettingService) Get(ctx context.Context, accountID string, serviceName string, environmentName string, opts ...option.RequestOption) (res *WorkerServiceEnvironmentSettingGetResponse, err error) { +// Patch script metadata, such as bindings +func (r *WorkerServiceEnvironmentSettingService) Update(ctx context.Context, accountID string, serviceName string, environmentName string, body WorkerServiceEnvironmentSettingUpdateParams, opts ...option.RequestOption) (res *WorkerServiceEnvironmentSettingUpdateResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerServiceEnvironmentSettingGetResponseEnvelope + var env WorkerServiceEnvironmentSettingUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/services/%s/environments/%s/settings", accountID, serviceName, environmentName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) if err != nil { return } @@ -45,12 +45,12 @@ func (r *WorkerServiceEnvironmentSettingService) Get(ctx context.Context, accoun return } -// Patch script metadata, such as bindings -func (r *WorkerServiceEnvironmentSettingService) Modify(ctx context.Context, accountID string, serviceName string, environmentName string, body WorkerServiceEnvironmentSettingModifyParams, opts ...option.RequestOption) (res *WorkerServiceEnvironmentSettingModifyResponse, err error) { +// Get script settings from a worker with an environment +func (r *WorkerServiceEnvironmentSettingService) Get(ctx context.Context, accountID string, serviceName string, environmentName string, opts ...option.RequestOption) (res *WorkerServiceEnvironmentSettingGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerServiceEnvironmentSettingModifyResponseEnvelope + var env WorkerServiceEnvironmentSettingGetResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/services/%s/environments/%s/settings", accountID, serviceName, environmentName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -58,9 +58,9 @@ func (r *WorkerServiceEnvironmentSettingService) Modify(ctx context.Context, acc return } -type WorkerServiceEnvironmentSettingGetResponse struct { +type WorkerServiceEnvironmentSettingUpdateResponse struct { // List of bindings attached to this Worker - Bindings []WorkerServiceEnvironmentSettingGetResponseBinding `json:"bindings"` + Bindings []WorkerServiceEnvironmentSettingUpdateResponseBinding `json:"bindings"` // Opt your Worker into changes after this date CompatibilityDate string `json:"compatibility_date"` // Opt your Worker into specific changes @@ -68,20 +68,20 @@ type WorkerServiceEnvironmentSettingGetResponse struct { // Whether Logpush is turned on for the Worker. Logpush bool `json:"logpush"` // Migrations to apply for Durable Objects associated with this Worker. - Migrations WorkerServiceEnvironmentSettingGetResponseMigrations `json:"migrations"` - Placement WorkerServiceEnvironmentSettingGetResponsePlacement `json:"placement"` + Migrations WorkerServiceEnvironmentSettingUpdateResponseMigrations `json:"migrations"` + Placement WorkerServiceEnvironmentSettingUpdateResponsePlacement `json:"placement"` // Tags to help you manage your Workers Tags []string `json:"tags"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerServiceEnvironmentSettingGetResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerServiceEnvironmentSettingUpdateResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerServiceEnvironmentSettingGetResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerServiceEnvironmentSettingUpdateResponseJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseJSON contains the JSON metadata for -// the struct [WorkerServiceEnvironmentSettingGetResponse] -type workerServiceEnvironmentSettingGetResponseJSON struct { +// workerServiceEnvironmentSettingUpdateResponseJSON contains the JSON metadata for +// the struct [WorkerServiceEnvironmentSettingUpdateResponse] +type workerServiceEnvironmentSettingUpdateResponseJSON struct { Bindings apijson.Field CompatibilityDate apijson.Field CompatibilityFlags apijson.Field @@ -95,43 +95,44 @@ type workerServiceEnvironmentSettingGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A binding to allow the Worker to communicate with resources // // Union satisfied by -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding], -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding] -// or [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding]. -type WorkerServiceEnvironmentSettingGetResponseBinding interface { - implementsWorkerServiceEnvironmentSettingGetResponseBinding() +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBinding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBinding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBinding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2Binding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBinding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1Binding], +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBinding] +// or +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBinding]. +type WorkerServiceEnvironmentSettingUpdateResponseBinding interface { + implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingGetResponseBinding)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingUpdateResponseBinding)(nil)).Elem(), "") } -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Namespace identifier tag. NamespaceID string `json:"namespace_id,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingJSON struct { Name apijson.Field NamespaceID apijson.Field Type apijson.Field @@ -139,21 +140,21 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType = "kv_namespace" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersKvNamespaceBindingType = "kv_namespace" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBinding struct { // Optional environment if the Worker utilizes one. Environment string `json:"environment,required"` // A JavaScript variable name for the binding. @@ -161,14 +162,14 @@ type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding str // Name of Worker to bind to Service string `json:"service,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingJSON struct { Environment apijson.Field Name apijson.Field Service apijson.Field @@ -177,40 +178,40 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType = "service" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersServiceBindingType = "service" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBinding struct { // The exported class name of the Durable Object ClassName string `json:"class_name,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingType `json:"type,required"` // The environment of the script_name to bind to Environment string `json:"environment"` // Namespace identifier tag. NamespaceID string `json:"namespace_id"` // The script where the Durable Object is defined, if it is external to this Worker - ScriptName string `json:"script_name"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON `json:"-"` + ScriptName string `json:"script_name"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON contains -// the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON struct { +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingJSON +// contains the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingJSON struct { ClassName apijson.Field Name apijson.Field Type apijson.Field @@ -221,34 +222,34 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON stru ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType = "durable_object_namespace" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDoBindingType = "durable_object_namespace" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2Binding struct { // R2 bucket to bind to BucketName string `json:"bucket_name,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON contains -// the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON struct { +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingJSON +// contains the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2Binding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingJSON struct { BucketName apijson.Field Name apijson.Field Type apijson.Field @@ -256,34 +257,34 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON stru ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2Binding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType = "r2_bucket" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersR2BindingType = "r2_bucket" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Name of the Queue to bind to QueueName string `json:"queue_name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingJSON struct { Name apijson.Field QueueName apijson.Field Type apijson.Field @@ -291,21 +292,21 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON s ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType = "queue" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersQueueBindingType = "queue" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1Binding struct { // ID of the D1 database to bind to ID string `json:"id,required"` // A JavaScript variable name for the binding. @@ -313,14 +314,14 @@ type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding struct { // The name of the D1 database associated with the 'id' provided. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON contains -// the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON struct { +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingJSON +// contains the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1Binding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingJSON struct { ID apijson.Field Binding apijson.Field Name apijson.Field @@ -329,36 +330,36 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON stru ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1Binding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType = "d1" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersD1BindingType = "d1" ) -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Namespace to bind to Namespace string `json:"namespace,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingType `json:"type,required"` // Outbound worker - Outbound WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound `json:"outbound"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON `json:"-"` + Outbound WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutbound `json:"outbound"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingJSON struct { Name apijson.Field Namespace apijson.Field Type apijson.Field @@ -367,81 +368,81 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceB ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" ) // Outbound worker -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutbound struct { // Pass information from the Dispatch Worker to the Outbound Worker through the // parameters Params []string `json:"params"` // Outbound worker - Worker WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker `json:"worker"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON `json:"-"` + Worker WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker `json:"worker"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutbound] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON struct { Params apijson.Field Worker apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutbound) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Outbound worker -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { // Environment of the outbound worker Environment string `json:"environment"` // Name of the outbound worker - Service string `json:"service"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON `json:"-"` + Service string `json:"service"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON struct { Environment apijson.Field Service apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding struct { +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingType `json:"type,required"` // ID of the certificate to bind to - CertificateID string `json:"certificate_id"` - JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON `json:"-"` + CertificateID string `json:"certificate_id"` + JSON workerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON +// workerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding] -type workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBinding] +type workerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingJSON struct { Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -449,36 +450,36 @@ type workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSO ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { +func (r WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingUpdateResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType string +type WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingType string const ( - WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType = "mtls_certificate" + WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingUpdateResponseBindingsWorkersMtlsCertBindingType = "mtls_certificate" ) // Migrations to apply for Durable Objects associated with this Worker. // // Union satisfied by -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations] +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrations] // or -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations]. -type WorkerServiceEnvironmentSettingGetResponseMigrations interface { - implementsWorkerServiceEnvironmentSettingGetResponseMigrations() +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrations]. +type WorkerServiceEnvironmentSettingUpdateResponseMigrations interface { + implementsWorkerServiceEnvironmentSettingUpdateResponseMigrations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingGetResponseMigrations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingUpdateResponseMigrations)(nil)).Elem(), "") } // A single set of migrations to apply. -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations struct { +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrations struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses []string `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. @@ -489,17 +490,17 @@ type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrat // don't match, the upload is rejected. OldTag string `json:"old_tag"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass `json:"renamed_classes"` + RenamedClasses []WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClass `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass `json:"transferred_classes"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON `json:"-"` + TransferredClasses []WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClass `json:"transferred_classes"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrations] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsJSON struct { DeletedClasses apijson.Field NewClasses apijson.Field NewTag apijson.Field @@ -510,44 +511,44 @@ type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrat ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingGetResponseMigrations() { +func (r WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingUpdateResponseMigrations() { } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass struct { - From string `json:"from"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClass struct { + From string `json:"from"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClass] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON struct { From apijson.Field To apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsRenamedClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass struct { - From string `json:"from"` - FromScript string `json:"from_script"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClass struct { + From string `json:"from"` + FromScript string `json:"from_script"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClass] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON struct { From apijson.Field FromScript apijson.Field To apijson.Field @@ -555,25 +556,25 @@ type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrat ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSingleStepMigrationsTransferredClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations struct { +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrations struct { // Tag to set as the latest migration tag. NewTag string `json:"new_tag"` // Tag used to verify against the latest migration tag for this Worker. If they // don't match, the upload is rejected. OldTag string `json:"old_tag"` // Migrations to apply in order. - Steps []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep `json:"steps"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON `json:"-"` + Steps []WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStep `json:"steps"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrations] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsJSON struct { NewTag apijson.Field OldTag apijson.Field Steps apijson.Field @@ -581,30 +582,30 @@ type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigration ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingGetResponseMigrations() { +func (r WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingUpdateResponseMigrations() { } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep struct { +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStep struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses []string `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. NewClasses []string `json:"new_classes"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass `json:"renamed_classes"` + RenamedClasses []WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass `json:"transferred_classes"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON `json:"-"` + TransferredClasses []WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass `json:"transferred_classes"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStep] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepJSON struct { DeletedClasses apijson.Field NewClasses apijson.Field RenamedClasses apijson.Field @@ -613,41 +614,41 @@ type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigration ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStep) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { - From string `json:"from"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { + From string `json:"from"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON struct { From apijson.Field To apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { - From string `json:"from"` - FromScript string `json:"from_script"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { + From string `json:"from"` + FromScript string `json:"from_script"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON +// workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass] -type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass] +type workerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON struct { From apijson.Field FromScript apijson.Field To apijson.Field @@ -655,53 +656,54 @@ type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigration ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingGetResponsePlacement struct { +type WorkerServiceEnvironmentSettingUpdateResponsePlacement struct { // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported - Mode WorkerServiceEnvironmentSettingGetResponsePlacementMode `json:"mode"` - JSON workerServiceEnvironmentSettingGetResponsePlacementJSON `json:"-"` + Mode WorkerServiceEnvironmentSettingUpdateResponsePlacementMode `json:"mode"` + JSON workerServiceEnvironmentSettingUpdateResponsePlacementJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponsePlacementJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentSettingGetResponsePlacement] -type workerServiceEnvironmentSettingGetResponsePlacementJSON struct { +// workerServiceEnvironmentSettingUpdateResponsePlacementJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentSettingUpdateResponsePlacement] +type workerServiceEnvironmentSettingUpdateResponsePlacementJSON struct { Mode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponsePlacement) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponsePlacement) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported -type WorkerServiceEnvironmentSettingGetResponsePlacementMode string +type WorkerServiceEnvironmentSettingUpdateResponsePlacementMode string const ( - WorkerServiceEnvironmentSettingGetResponsePlacementModeSmart WorkerServiceEnvironmentSettingGetResponsePlacementMode = "smart" + WorkerServiceEnvironmentSettingUpdateResponsePlacementModeSmart WorkerServiceEnvironmentSettingUpdateResponsePlacementMode = "smart" ) // A reference to a script that will consume logs from the attached Worker. -type WorkerServiceEnvironmentSettingGetResponseTailConsumer struct { +type WorkerServiceEnvironmentSettingUpdateResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerServiceEnvironmentSettingGetResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerServiceEnvironmentSettingUpdateResponseTailConsumerJSON `json:"-"` } -// workerServiceEnvironmentSettingGetResponseTailConsumerJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentSettingGetResponseTailConsumer] -type workerServiceEnvironmentSettingGetResponseTailConsumerJSON struct { +// workerServiceEnvironmentSettingUpdateResponseTailConsumerJSON contains the JSON +// metadata for the struct +// [WorkerServiceEnvironmentSettingUpdateResponseTailConsumer] +type workerServiceEnvironmentSettingUpdateResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -709,13 +711,13 @@ type workerServiceEnvironmentSettingGetResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingGetResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponse struct { +type WorkerServiceEnvironmentSettingGetResponse struct { // List of bindings attached to this Worker - Bindings []WorkerServiceEnvironmentSettingModifyResponseBinding `json:"bindings"` + Bindings []WorkerServiceEnvironmentSettingGetResponseBinding `json:"bindings"` // Opt your Worker into changes after this date CompatibilityDate string `json:"compatibility_date"` // Opt your Worker into specific changes @@ -723,20 +725,20 @@ type WorkerServiceEnvironmentSettingModifyResponse struct { // Whether Logpush is turned on for the Worker. Logpush bool `json:"logpush"` // Migrations to apply for Durable Objects associated with this Worker. - Migrations WorkerServiceEnvironmentSettingModifyResponseMigrations `json:"migrations"` - Placement WorkerServiceEnvironmentSettingModifyResponsePlacement `json:"placement"` + Migrations WorkerServiceEnvironmentSettingGetResponseMigrations `json:"migrations"` + Placement WorkerServiceEnvironmentSettingGetResponsePlacement `json:"placement"` // Tags to help you manage your Workers Tags []string `json:"tags"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkerServiceEnvironmentSettingModifyResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkerServiceEnvironmentSettingGetResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workerServiceEnvironmentSettingModifyResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workerServiceEnvironmentSettingGetResponseJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseJSON contains the JSON metadata for -// the struct [WorkerServiceEnvironmentSettingModifyResponse] -type workerServiceEnvironmentSettingModifyResponseJSON struct { +// workerServiceEnvironmentSettingGetResponseJSON contains the JSON metadata for +// the struct [WorkerServiceEnvironmentSettingGetResponse] +type workerServiceEnvironmentSettingGetResponseJSON struct { Bindings apijson.Field CompatibilityDate apijson.Field CompatibilityFlags apijson.Field @@ -750,44 +752,43 @@ type workerServiceEnvironmentSettingModifyResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A binding to allow the Worker to communicate with resources // // Union satisfied by -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBinding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBinding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2Binding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBinding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding], -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBinding] -// or -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding]. -type WorkerServiceEnvironmentSettingModifyResponseBinding interface { - implementsWorkerServiceEnvironmentSettingModifyResponseBinding() +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding], +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding] +// or [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding]. +type WorkerServiceEnvironmentSettingGetResponseBinding interface { + implementsWorkerServiceEnvironmentSettingGetResponseBinding() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingModifyResponseBinding)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingGetResponseBinding)(nil)).Elem(), "") } -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Namespace identifier tag. NamespaceID string `json:"namespace_id,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingJSON struct { Name apijson.Field NamespaceID apijson.Field Type apijson.Field @@ -795,21 +796,21 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBind ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersKvNamespaceBindingType = "kv_namespace" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersKvNamespaceBindingType = "kv_namespace" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding struct { // Optional environment if the Worker utilizes one. Environment string `json:"environment,required"` // A JavaScript variable name for the binding. @@ -817,14 +818,14 @@ type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding // Name of Worker to bind to Service string `json:"service,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingJSON struct { Environment apijson.Field Name apijson.Field Service apijson.Field @@ -833,40 +834,40 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingJ ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersServiceBindingType = "service" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingGetResponseBindingsWorkersServiceBindingType = "service" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding struct { // The exported class name of the Durable Object ClassName string `json:"class_name,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType `json:"type,required"` // The environment of the script_name to bind to Environment string `json:"environment"` // Namespace identifier tag. NamespaceID string `json:"namespace_id"` // The script where the Durable Object is defined, if it is external to this Worker - ScriptName string `json:"script_name"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingJSON `json:"-"` + ScriptName string `json:"script_name"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingJSON -// contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingJSON struct { +// workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON contains +// the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingJSON struct { ClassName apijson.Field Name apijson.Field Type apijson.Field @@ -877,34 +878,34 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingJSON s ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDoBindingType = "durable_object_namespace" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDoBindingType = "durable_object_namespace" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2Binding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding struct { // R2 bucket to bind to BucketName string `json:"bucket_name,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingJSON -// contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2Binding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingJSON struct { +// workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON contains +// the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingJSON struct { BucketName apijson.Field Name apijson.Field Type apijson.Field @@ -912,34 +913,34 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingJSON s ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2Binding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersR2BindingType = "r2_bucket" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingGetResponseBindingsWorkersR2BindingType = "r2_bucket" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Name of the Queue to bind to QueueName string `json:"queue_name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingJSON struct { Name apijson.Field QueueName apijson.Field Type apijson.Field @@ -947,21 +948,21 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingJSO ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersQueueBindingType = "queue" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingGetResponseBindingsWorkersQueueBindingType = "queue" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding struct { // ID of the D1 database to bind to ID string `json:"id,required"` // A JavaScript variable name for the binding. @@ -969,14 +970,14 @@ type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding struc // The name of the D1 database associated with the 'id' provided. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingType `json:"type,required"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingJSON `json:"-"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType `json:"type,required"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingJSON -// contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingJSON struct { +// workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON contains +// the JSON metadata for the struct +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingJSON struct { ID apijson.Field Binding apijson.Field Name apijson.Field @@ -985,36 +986,36 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingJSON s ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersD1BindingType = "d1" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingGetResponseBindingsWorkersD1BindingType = "d1" ) -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // Namespace to bind to Namespace string `json:"namespace,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType `json:"type,required"` // Outbound worker - Outbound WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutbound `json:"outbound"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingJSON `json:"-"` + Outbound WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound `json:"outbound"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingJSON struct { Name apijson.Field Namespace apijson.Field Type apijson.Field @@ -1023,81 +1024,81 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespa ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" ) // Outbound worker -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutbound struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound struct { // Pass information from the Dispatch Worker to the Outbound Worker through the // parameters Params []string `json:"params"` // Outbound worker - Worker WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker `json:"worker"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON `json:"-"` + Worker WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker `json:"worker"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutbound] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundJSON struct { Params apijson.Field Worker apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutbound) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutbound) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Outbound worker -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { // Environment of the outbound worker Environment string `json:"environment"` // Name of the outbound worker - Service string `json:"service"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON `json:"-"` + Service string `json:"service"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorkerJSON struct { Environment apijson.Field Service apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundWorker) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding struct { +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding struct { // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. - Type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingType `json:"type,required"` + Type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType `json:"type,required"` // ID of the certificate to bind to - CertificateID string `json:"certificate_id"` - JSON workerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingJSON `json:"-"` + CertificateID string `json:"certificate_id"` + JSON workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingJSON +// workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding] -type workerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding] +type workerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingJSON struct { Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -1105,36 +1106,36 @@ type workerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingModifyResponseBinding() { +func (r WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingGetResponseBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingType string +type WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType string const ( - WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingModifyResponseBindingsWorkersMtlsCertBindingType = "mtls_certificate" + WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingGetResponseBindingsWorkersMtlsCertBindingType = "mtls_certificate" ) // Migrations to apply for Durable Objects associated with this Worker. // // Union satisfied by -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrations] +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations] // or -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrations]. -type WorkerServiceEnvironmentSettingModifyResponseMigrations interface { - implementsWorkerServiceEnvironmentSettingModifyResponseMigrations() +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations]. +type WorkerServiceEnvironmentSettingGetResponseMigrations interface { + implementsWorkerServiceEnvironmentSettingGetResponseMigrations() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingModifyResponseMigrations)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*WorkerServiceEnvironmentSettingGetResponseMigrations)(nil)).Elem(), "") } // A single set of migrations to apply. -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrations struct { +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses []string `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. @@ -1145,17 +1146,17 @@ type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMig // don't match, the upload is rejected. OldTag string `json:"old_tag"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses []WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClass `json:"renamed_classes"` + RenamedClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses []WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClass `json:"transferred_classes"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsJSON `json:"-"` + TransferredClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass `json:"transferred_classes"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrations] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsJSON struct { DeletedClasses apijson.Field NewClasses apijson.Field NewTag apijson.Field @@ -1166,44 +1167,44 @@ type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMig ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrations) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingModifyResponseMigrations() { +func (r WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingGetResponseMigrations() { } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClass struct { - From string `json:"from"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass struct { + From string `json:"from"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClass] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClassJSON struct { From apijson.Field To apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsRenamedClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsRenamedClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClass struct { - From string `json:"from"` - FromScript string `json:"from_script"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass struct { + From string `json:"from"` + FromScript string `json:"from_script"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClass] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClassJSON struct { From apijson.Field FromScript apijson.Field To apijson.Field @@ -1211,25 +1212,25 @@ type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMig ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSingleStepMigrationsTransferredClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSingleStepMigrationsTransferredClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrations struct { +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations struct { // Tag to set as the latest migration tag. NewTag string `json:"new_tag"` // Tag used to verify against the latest migration tag for this Worker. If they // don't match, the upload is rejected. OldTag string `json:"old_tag"` // Migrations to apply in order. - Steps []WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStep `json:"steps"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsJSON `json:"-"` + Steps []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep `json:"steps"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrations] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsJSON struct { NewTag apijson.Field OldTag apijson.Field Steps apijson.Field @@ -1237,30 +1238,30 @@ type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrat ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrations) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingModifyResponseMigrations() { +func (r WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingGetResponseMigrations() { } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStep struct { +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses []string `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. NewClasses []string `json:"new_classes"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses []WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass `json:"renamed_classes"` + RenamedClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses []WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass `json:"transferred_classes"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepJSON `json:"-"` + TransferredClasses []WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass `json:"transferred_classes"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStep] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepJSON struct { DeletedClasses apijson.Field NewClasses apijson.Field RenamedClasses apijson.Field @@ -1269,41 +1270,41 @@ type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrat ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStep) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStep) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { - From string `json:"from"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { + From string `json:"from"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClassJSON struct { From apijson.Field To apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsRenamedClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { - From string `json:"from"` - FromScript string `json:"from_script"` - To string `json:"to"` - JSON workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON `json:"-"` +type WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { + From string `json:"from"` + FromScript string `json:"from_script"` + To string `json:"to"` + JSON workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON +// workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON // contains the JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass] -type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON struct { +// [WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass] +type workerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClassJSON struct { From apijson.Field FromScript apijson.Field To apijson.Field @@ -1311,54 +1312,53 @@ type workerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrat ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseMigrationsWorkersSteppedMigrationsStepsTransferredClass) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponsePlacement struct { +type WorkerServiceEnvironmentSettingGetResponsePlacement struct { // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported - Mode WorkerServiceEnvironmentSettingModifyResponsePlacementMode `json:"mode"` - JSON workerServiceEnvironmentSettingModifyResponsePlacementJSON `json:"-"` + Mode WorkerServiceEnvironmentSettingGetResponsePlacementMode `json:"mode"` + JSON workerServiceEnvironmentSettingGetResponsePlacementJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponsePlacementJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentSettingModifyResponsePlacement] -type workerServiceEnvironmentSettingModifyResponsePlacementJSON struct { +// workerServiceEnvironmentSettingGetResponsePlacementJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentSettingGetResponsePlacement] +type workerServiceEnvironmentSettingGetResponsePlacementJSON struct { Mode apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponsePlacement) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponsePlacement) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported -type WorkerServiceEnvironmentSettingModifyResponsePlacementMode string +type WorkerServiceEnvironmentSettingGetResponsePlacementMode string const ( - WorkerServiceEnvironmentSettingModifyResponsePlacementModeSmart WorkerServiceEnvironmentSettingModifyResponsePlacementMode = "smart" + WorkerServiceEnvironmentSettingGetResponsePlacementModeSmart WorkerServiceEnvironmentSettingGetResponsePlacementMode = "smart" ) // A reference to a script that will consume logs from the attached Worker. -type WorkerServiceEnvironmentSettingModifyResponseTailConsumer struct { +type WorkerServiceEnvironmentSettingGetResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workerServiceEnvironmentSettingModifyResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workerServiceEnvironmentSettingGetResponseTailConsumerJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseTailConsumerJSON contains the JSON -// metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseTailConsumer] -type workerServiceEnvironmentSettingModifyResponseTailConsumerJSON struct { +// workerServiceEnvironmentSettingGetResponseTailConsumerJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentSettingGetResponseTailConsumer] +type workerServiceEnvironmentSettingGetResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -1366,114 +1366,43 @@ type workerServiceEnvironmentSettingModifyResponseTailConsumerJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerServiceEnvironmentSettingGetResponseEnvelope struct { - Errors []WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages `json:"messages,required"` - Result WorkerServiceEnvironmentSettingGetResponse `json:"result,required"` - // Whether the API call was successful - Success WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess `json:"success,required"` - JSON workerServiceEnvironmentSettingGetResponseEnvelopeJSON `json:"-"` -} - -// workerServiceEnvironmentSettingGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentSettingGetResponseEnvelope] -type workerServiceEnvironmentSettingGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerServiceEnvironmentSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON `json:"-"` -} - -// workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON contains the JSON -// metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors] -type workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON `json:"-"` -} - -// workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON contains the JSON -// metadata for the struct -// [WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages] -type workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Whether the API call was successful -type WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess bool - -const ( - WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccessTrue WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess = true -) - -type WorkerServiceEnvironmentSettingModifyParams struct { - Errors param.Field[[]WorkerServiceEnvironmentSettingModifyParamsError] `json:"errors,required"` - Messages param.Field[[]WorkerServiceEnvironmentSettingModifyParamsMessage] `json:"messages,required"` - Result param.Field[WorkerServiceEnvironmentSettingModifyParamsResult] `json:"result,required"` +type WorkerServiceEnvironmentSettingUpdateParams struct { + Errors param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsError] `json:"errors,required"` + Messages param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsMessage] `json:"messages,required"` + Result param.Field[WorkerServiceEnvironmentSettingUpdateParamsResult] `json:"result,required"` // Whether the API call was successful - Success param.Field[WorkerServiceEnvironmentSettingModifyParamsSuccess] `json:"success,required"` + Success param.Field[WorkerServiceEnvironmentSettingUpdateParamsSuccess] `json:"success,required"` } -func (r WorkerServiceEnvironmentSettingModifyParams) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsError struct { +type WorkerServiceEnvironmentSettingUpdateParamsError struct { Code param.Field[int64] `json:"code,required"` Message param.Field[string] `json:"message,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsError) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsError) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsMessage struct { +type WorkerServiceEnvironmentSettingUpdateParamsMessage struct { Code param.Field[int64] `json:"code,required"` Message param.Field[string] `json:"message,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsMessage) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsMessage) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResult struct { +type WorkerServiceEnvironmentSettingUpdateParamsResult struct { // List of bindings attached to this Worker - Bindings param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultBinding] `json:"bindings"` + Bindings param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultBinding] `json:"bindings"` // Opt your Worker into changes after this date CompatibilityDate param.Field[string] `json:"compatibility_date"` // Opt your Worker into specific changes @@ -1481,247 +1410,247 @@ type WorkerServiceEnvironmentSettingModifyParamsResult struct { // Whether Logpush is turned on for the Worker. Logpush param.Field[bool] `json:"logpush"` // Migrations to apply for Durable Objects associated with this Worker. - Migrations param.Field[WorkerServiceEnvironmentSettingModifyParamsResultMigrations] `json:"migrations"` - Placement param.Field[WorkerServiceEnvironmentSettingModifyParamsResultPlacement] `json:"placement"` + Migrations param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultMigrations] `json:"migrations"` + Placement param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultPlacement] `json:"placement"` // Tags to help you manage your Workers Tags param.Field[[]string] `json:"tags"` // List of Workers that will consume logs from the attached Worker. - TailConsumers param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultTailConsumer] `json:"tail_consumers"` + TailConsumers param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultTailConsumer] `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). UsageModel param.Field[string] `json:"usage_model"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResult) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResult) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // A binding to allow the Worker to communicate with resources // // Satisfied by -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBinding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBinding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2Binding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBinding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1Binding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBinding], -// [WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBinding]. -type WorkerServiceEnvironmentSettingModifyParamsResultBinding interface { - implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() -} - -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding struct { +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBinding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBinding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2Binding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBinding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1Binding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBinding], +// [WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBinding]. +type WorkerServiceEnvironmentSettingUpdateParamsResultBinding interface { + implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() +} + +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding struct { // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingType] `json:"type,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingType = "kv_namespace" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingType = "kv_namespace" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBinding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBinding struct { // Optional environment if the Worker utilizes one. Environment param.Field[string] `json:"environment,required"` // Name of Worker to bind to Service param.Field[string] `json:"service,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBindingType] `json:"type,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersServiceBindingType = "service" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBindingTypeService WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersServiceBindingType = "service" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBinding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBinding struct { // The exported class name of the Durable Object ClassName param.Field[string] `json:"class_name,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBindingType] `json:"type,required"` // The environment of the script_name to bind to Environment param.Field[string] `json:"environment"` // The script where the Durable Object is defined, if it is external to this Worker ScriptName param.Field[string] `json:"script_name"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDoBindingType = "durable_object_namespace" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBindingTypeDurableObjectNamespace WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDoBindingType = "durable_object_namespace" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2Binding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2Binding struct { // R2 bucket to bind to BucketName param.Field[string] `json:"bucket_name,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2BindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2BindingType] `json:"type,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2Binding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2Binding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2Binding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2BindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2BindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersR2BindingType = "r2_bucket" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2BindingTypeR2Bucket WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersR2BindingType = "r2_bucket" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBinding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBinding struct { // Name of the Queue to bind to QueueName param.Field[string] `json:"queue_name,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBindingType] `json:"type,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersQueueBindingType = "queue" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBindingTypeQueue WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersQueueBindingType = "queue" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1Binding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1Binding struct { // ID of the D1 database to bind to ID param.Field[string] `json:"id,required"` // The name of the D1 database associated with the 'id' provided. Name param.Field[string] `json:"name,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1BindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1BindingType] `json:"type,required"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1Binding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1Binding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1Binding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1BindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1BindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersD1BindingType = "d1" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1BindingTypeD1 WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersD1BindingType = "d1" ) -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBinding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBinding struct { // Namespace to bind to Namespace param.Field[string] `json:"namespace,required"` // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingType] `json:"type,required"` // Outbound worker - Outbound param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutbound] `json:"outbound"` + Outbound param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutbound] `json:"outbound"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingTypeDispatchNamespace WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingType = "dispatch_namespace" ) // Outbound worker -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutbound struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutbound struct { // Pass information from the Dispatch Worker to the Outbound Worker through the // parameters Params param.Field[[]string] `json:"params"` // Outbound worker - Worker param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker] `json:"worker"` + Worker param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker] `json:"worker"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutbound) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutbound) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Outbound worker -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker struct { // Environment of the outbound worker Environment param.Field[string] `json:"environment"` // Name of the outbound worker Service param.Field[string] `json:"service"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersDispatchNamespaceBindingOutboundWorker) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBinding struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBinding struct { // The class of resource that the binding provides. - Type param.Field[WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBindingType] `json:"type,required"` + Type param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBindingType] `json:"type,required"` // ID of the certificate to bind to CertificateID param.Field[string] `json:"certificate_id"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBinding) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBinding) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingModifyParamsResultBinding() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBinding) implementsWorkerServiceEnvironmentSettingUpdateParamsResultBinding() { } // The class of resource that the binding provides. -type WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBindingType string +type WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBindingType string const ( - WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersMtlsCertBindingType = "mtls_certificate" + WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBindingTypeMtlsCertificate WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersMtlsCertBindingType = "mtls_certificate" ) // Migrations to apply for Durable Objects associated with this Worker. // // Satisfied by -// [WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations], -// [WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrations]. -type WorkerServiceEnvironmentSettingModifyParamsResultMigrations interface { - implementsWorkerServiceEnvironmentSettingModifyParamsResultMigrations() +// [WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations], +// [WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrations]. +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrations interface { + implementsWorkerServiceEnvironmentSettingUpdateParamsResultMigrations() } // A single set of migrations to apply. -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. @@ -1732,112 +1661,112 @@ type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleSte // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass] `json:"transferred_classes"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingModifyParamsResultMigrations() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations) implementsWorkerServiceEnvironmentSettingUpdateParamsResultMigrations() { } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrations struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrations struct { // Tag to set as the latest migration tag. NewTag param.Field[string] `json:"new_tag"` // Tag used to verify against the latest migration tag for this Worker. If they // don't match, the upload is rejected. OldTag param.Field[string] `json:"old_tag"` // Migrations to apply in order. - Steps param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStep] `json:"steps"` + Steps param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStep] `json:"steps"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingModifyParamsResultMigrations() { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrations) implementsWorkerServiceEnvironmentSettingUpdateParamsResultMigrations() { } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStep struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStep struct { // A list of classes to delete Durable Object namespaces from. DeletedClasses param.Field[[]string] `json:"deleted_classes"` // A list of classes to create Durable Object namespaces from. NewClasses param.Field[[]string] `json:"new_classes"` // A list of classes with Durable Object namespaces that were renamed. - RenamedClasses param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` + RenamedClasses param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass] `json:"renamed_classes"` // A list of transfers for Durable Object namespaces from a different Worker and // class to a class defined in this Worker. - TransferredClasses param.Field[[]WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` + TransferredClasses param.Field[[]WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass] `json:"transferred_classes"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStep) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass struct { From param.Field[string] `json:"from"` To param.Field[string] `json:"to"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsRenamedClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass struct { From param.Field[string] `json:"from"` FromScript param.Field[string] `json:"from_script"` To param.Field[string] `json:"to"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSteppedMigrationsStepsTransferredClass) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkerServiceEnvironmentSettingModifyParamsResultPlacement struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultPlacement struct { // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported - Mode param.Field[WorkerServiceEnvironmentSettingModifyParamsResultPlacementMode] `json:"mode"` + Mode param.Field[WorkerServiceEnvironmentSettingUpdateParamsResultPlacementMode] `json:"mode"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultPlacement) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultPlacement) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Enables // [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). // Only `"smart"` is currently supported -type WorkerServiceEnvironmentSettingModifyParamsResultPlacementMode string +type WorkerServiceEnvironmentSettingUpdateParamsResultPlacementMode string const ( - WorkerServiceEnvironmentSettingModifyParamsResultPlacementModeSmart WorkerServiceEnvironmentSettingModifyParamsResultPlacementMode = "smart" + WorkerServiceEnvironmentSettingUpdateParamsResultPlacementModeSmart WorkerServiceEnvironmentSettingUpdateParamsResultPlacementMode = "smart" ) // A reference to a script that will consume logs from the attached Worker. -type WorkerServiceEnvironmentSettingModifyParamsResultTailConsumer struct { +type WorkerServiceEnvironmentSettingUpdateParamsResultTailConsumer struct { // Name of Worker that is to be the consumer. Service param.Field[string] `json:"service,required"` // Optional environment if the Worker utilizes one. @@ -1846,29 +1775,29 @@ type WorkerServiceEnvironmentSettingModifyParamsResultTailConsumer struct { Namespace param.Field[string] `json:"namespace"` } -func (r WorkerServiceEnvironmentSettingModifyParamsResultTailConsumer) MarshalJSON() (data []byte, err error) { +func (r WorkerServiceEnvironmentSettingUpdateParamsResultTailConsumer) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Whether the API call was successful -type WorkerServiceEnvironmentSettingModifyParamsSuccess bool +type WorkerServiceEnvironmentSettingUpdateParamsSuccess bool const ( - WorkerServiceEnvironmentSettingModifyParamsSuccessTrue WorkerServiceEnvironmentSettingModifyParamsSuccess = true + WorkerServiceEnvironmentSettingUpdateParamsSuccessTrue WorkerServiceEnvironmentSettingUpdateParamsSuccess = true ) -type WorkerServiceEnvironmentSettingModifyResponseEnvelope struct { - Errors []WorkerServiceEnvironmentSettingModifyResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerServiceEnvironmentSettingModifyResponseEnvelopeMessages `json:"messages,required"` - Result WorkerServiceEnvironmentSettingModifyResponse `json:"result,required"` +type WorkerServiceEnvironmentSettingUpdateResponseEnvelope struct { + Errors []WorkerServiceEnvironmentSettingUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerServiceEnvironmentSettingUpdateResponseEnvelopeMessages `json:"messages,required"` + Result WorkerServiceEnvironmentSettingUpdateResponse `json:"result,required"` // Whether the API call was successful - Success WorkerServiceEnvironmentSettingModifyResponseEnvelopeSuccess `json:"success,required"` - JSON workerServiceEnvironmentSettingModifyResponseEnvelopeJSON `json:"-"` + Success WorkerServiceEnvironmentSettingUpdateResponseEnvelopeSuccess `json:"success,required"` + JSON workerServiceEnvironmentSettingUpdateResponseEnvelopeJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseEnvelopeJSON contains the JSON -// metadata for the struct [WorkerServiceEnvironmentSettingModifyResponseEnvelope] -type workerServiceEnvironmentSettingModifyResponseEnvelopeJSON struct { +// workerServiceEnvironmentSettingUpdateResponseEnvelopeJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentSettingUpdateResponseEnvelope] +type workerServiceEnvironmentSettingUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -1877,53 +1806,124 @@ type workerServiceEnvironmentSettingModifyResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseEnvelopeErrors struct { +type WorkerServiceEnvironmentSettingUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON workerServiceEnvironmentSettingModifyResponseEnvelopeErrorsJSON `json:"-"` + JSON workerServiceEnvironmentSettingUpdateResponseEnvelopeErrorsJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseEnvelopeErrorsJSON contains the +// workerServiceEnvironmentSettingUpdateResponseEnvelopeErrorsJSON contains the // JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseEnvelopeErrors] -type workerServiceEnvironmentSettingModifyResponseEnvelopeErrorsJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseEnvelopeErrors] +type workerServiceEnvironmentSettingUpdateResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerServiceEnvironmentSettingModifyResponseEnvelopeMessages struct { +type WorkerServiceEnvironmentSettingUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` - JSON workerServiceEnvironmentSettingModifyResponseEnvelopeMessagesJSON `json:"-"` + JSON workerServiceEnvironmentSettingUpdateResponseEnvelopeMessagesJSON `json:"-"` } -// workerServiceEnvironmentSettingModifyResponseEnvelopeMessagesJSON contains the +// workerServiceEnvironmentSettingUpdateResponseEnvelopeMessagesJSON contains the // JSON metadata for the struct -// [WorkerServiceEnvironmentSettingModifyResponseEnvelopeMessages] -type workerServiceEnvironmentSettingModifyResponseEnvelopeMessagesJSON struct { +// [WorkerServiceEnvironmentSettingUpdateResponseEnvelopeMessages] +type workerServiceEnvironmentSettingUpdateResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerServiceEnvironmentSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// Whether the API call was successful +type WorkerServiceEnvironmentSettingUpdateResponseEnvelopeSuccess bool + +const ( + WorkerServiceEnvironmentSettingUpdateResponseEnvelopeSuccessTrue WorkerServiceEnvironmentSettingUpdateResponseEnvelopeSuccess = true +) + +type WorkerServiceEnvironmentSettingGetResponseEnvelope struct { + Errors []WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerServiceEnvironmentSettingGetResponse `json:"result,required"` + // Whether the API call was successful + Success WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerServiceEnvironmentSettingGetResponseEnvelopeJSON `json:"-"` +} + +// workerServiceEnvironmentSettingGetResponseEnvelopeJSON contains the JSON +// metadata for the struct [WorkerServiceEnvironmentSettingGetResponseEnvelope] +type workerServiceEnvironmentSettingGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerServiceEnvironmentSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON contains the JSON +// metadata for the struct +// [WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors] +type workerServiceEnvironmentSettingGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *WorkerServiceEnvironmentSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON contains the JSON +// metadata for the struct +// [WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages] +type workerServiceEnvironmentSettingGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerServiceEnvironmentSettingModifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerServiceEnvironmentSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerServiceEnvironmentSettingModifyResponseEnvelopeSuccess bool +type WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess bool const ( - WorkerServiceEnvironmentSettingModifyResponseEnvelopeSuccessTrue WorkerServiceEnvironmentSettingModifyResponseEnvelopeSuccess = true + WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccessTrue WorkerServiceEnvironmentSettingGetResponseEnvelopeSuccess = true ) diff --git a/workerserviceenvironmentsetting_test.go b/workerserviceenvironmentsetting_test.go index 8053ebd31ea..2c2fcc47f67 100644 --- a/workerserviceenvironmentsetting_test.go +++ b/workerserviceenvironmentsetting_test.go @@ -13,38 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerServiceEnvironmentSettingGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Workers.Services.Environments.Settings.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "my-worker", - "production", - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { +func TestWorkerServiceEnvironmentSettingUpdateWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -60,13 +29,13 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Services.Environments.Settings.Modify( + _, err := client.Workers.Services.Environments.Settings.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-worker", "production", - cloudflare.WorkerServiceEnvironmentSettingModifyParams{ - Errors: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsError{{ + cloudflare.WorkerServiceEnvironmentSettingUpdateParams{ + Errors: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsError{{ Code: cloudflare.F(int64(1000)), Message: cloudflare.F("string"), }, { @@ -76,7 +45,7 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { Code: cloudflare.F(int64(1000)), Message: cloudflare.F("string"), }}), - Messages: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsMessage{{ + Messages: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsMessage{{ Code: cloudflare.F(int64(1000)), Message: cloudflare.F("string"), }, { @@ -86,23 +55,23 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { Code: cloudflare.F(int64(1000)), Message: cloudflare.F("string"), }}), - Result: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResult{ - Bindings: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBinding{cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding{ - Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), - }), cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding{ - Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), - }), cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBinding{ - Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), + Result: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResult{ + Bindings: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBinding{cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding{ + Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), + }), cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding{ + Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), + }), cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBinding{ + Type: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultBindingsWorkersKvNamespaceBindingTypeKvNamespace), })}), CompatibilityDate: cloudflare.F("2022-04-05"), CompatibilityFlags: cloudflare.F([]string{"formdata_parser_supports_files", "formdata_parser_supports_files", "formdata_parser_supports_files"}), Logpush: cloudflare.F(false), - Migrations: cloudflare.F[cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultMigrations](cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrations{ + Migrations: cloudflare.F[cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultMigrations](cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrations{ NewTag: cloudflare.F("v2"), OldTag: cloudflare.F("v1"), DeletedClasses: cloudflare.F([]string{"string", "string", "string"}), NewClasses: cloudflare.F([]string{"string", "string", "string"}), - RenamedClasses: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass{{ + RenamedClasses: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsRenamedClass{{ From: cloudflare.F("string"), To: cloudflare.F("string"), }, { @@ -112,7 +81,7 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { From: cloudflare.F("string"), To: cloudflare.F("string"), }}), - TransferredClasses: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass{{ + TransferredClasses: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultMigrationsWorkersSingleStepMigrationsTransferredClass{{ From: cloudflare.F("string"), FromScript: cloudflare.F("string"), To: cloudflare.F("string"), @@ -126,11 +95,11 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { To: cloudflare.F("string"), }}), })), - Placement: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultPlacement{ - Mode: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultPlacementModeSmart), + Placement: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultPlacement{ + Mode: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultPlacementModeSmart), }), Tags: cloudflare.F([]string{"my-tag", "my-tag", "my-tag"}), - TailConsumers: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingModifyParamsResultTailConsumer{{ + TailConsumers: cloudflare.F([]cloudflare.WorkerServiceEnvironmentSettingUpdateParamsResultTailConsumer{{ Environment: cloudflare.F("production"), Namespace: cloudflare.F("my-namespace"), Service: cloudflare.F("my-log-consumer"), @@ -145,7 +114,7 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { }}), UsageModel: cloudflare.F("unbound"), }), - Success: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingModifyParamsSuccessTrue), + Success: cloudflare.F(cloudflare.WorkerServiceEnvironmentSettingUpdateParamsSuccessTrue), }, ) if err != nil { @@ -156,3 +125,34 @@ func TestWorkerServiceEnvironmentSettingModifyWithOptionalParams(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } + +func TestWorkerServiceEnvironmentSettingGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Workers.Services.Environments.Settings.Get( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + "my-worker", + "production", + ) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} diff --git a/workersforplatformdispatchnamespacescriptcontent.go b/workersforplatformdispatchnamespacescriptcontent.go index 0de35b75d7c..c9edb4e5f09 100644 --- a/workersforplatformdispatchnamespacescriptcontent.go +++ b/workersforplatformdispatchnamespacescriptcontent.go @@ -37,10 +37,20 @@ func NewWorkersForPlatformDispatchNamespaceScriptContentService(opts ...option.R return } +// Fetch script content from a script uploaded to a Workers for Platforms +// namespace. +func (r *WorkersForPlatformDispatchNamespaceScriptContentService) Get(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, opts ...option.RequestOption) (res *http.Response, err error) { + opts = append(r.Options[:], opts...) + opts = append([]option.RequestOption{option.WithHeader("Accept", "string")}, opts...) + path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s/content", accountID, dispatchNamespace, scriptName) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) + return +} + // Put script content for a script uploaded to a Workers for Platforms namespace. -func (r *WorkersForPlatformDispatchNamespaceScriptContentService) Update(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, params WorkersForPlatformDispatchNamespaceScriptContentUpdateParams, opts ...option.RequestOption) (res *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse, err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentService) Replace(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, params WorkersForPlatformDispatchNamespaceScriptContentReplaceParams, opts ...option.RequestOption) (res *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelope + var env WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s/content", accountID, dispatchNamespace, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { @@ -50,17 +60,7 @@ func (r *WorkersForPlatformDispatchNamespaceScriptContentService) Update(ctx con return } -// Fetch script content from a script uploaded to a Workers for Platforms -// namespace. -func (r *WorkersForPlatformDispatchNamespaceScriptContentService) Get(ctx context.Context, accountID string, dispatchNamespace string, scriptName string, opts ...option.RequestOption) (res *http.Response, err error) { - opts = append(r.Options[:], opts...) - opts = append([]option.RequestOption{option.WithHeader("Accept", "string")}, opts...) - path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s/content", accountID, dispatchNamespace, scriptName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...) - return -} - -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse struct { +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse struct { // The id of the script in the Workers system. Usually the script name. ID string `json:"id"` // When the script was created. @@ -76,16 +76,16 @@ type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse struct { // Specifies the placement mode for the Worker (e.g. 'smart'). PlacementMode string `json:"placement_mode"` // List of Workers that will consume logs from the attached Worker. - TailConsumers []WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumer `json:"tail_consumers"` + TailConsumers []WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumer `json:"tail_consumers"` // Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - UsageModel string `json:"usage_model"` - JSON workersForPlatformDispatchNamespaceScriptContentUpdateResponseJSON `json:"-"` + UsageModel string `json:"usage_model"` + JSON workersForPlatformDispatchNamespaceScriptContentReplaceResponseJSON `json:"-"` } -// workersForPlatformDispatchNamespaceScriptContentUpdateResponseJSON contains the +// workersForPlatformDispatchNamespaceScriptContentReplaceResponseJSON contains the // JSON metadata for the struct -// [WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse] -type workersForPlatformDispatchNamespaceScriptContentUpdateResponseJSON struct { +// [WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse] +type workersForPlatformDispatchNamespaceScriptContentReplaceResponseJSON struct { ID apijson.Field CreatedOn apijson.Field Etag apijson.Field @@ -99,25 +99,25 @@ type workersForPlatformDispatchNamespaceScriptContentUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // A reference to a script that will consume logs from the attached Worker. -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumer struct { +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumer struct { // Name of Worker that is to be the consumer. Service string `json:"service,required"` // Optional environment if the Worker utilizes one. Environment string `json:"environment"` // Optional dispatch namespace the script belongs to. - Namespace string `json:"namespace"` - JSON workersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumerJSON `json:"-"` + Namespace string `json:"namespace"` + JSON workersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumerJSON `json:"-"` } -// workersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumerJSON +// workersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumerJSON // contains the JSON metadata for the struct -// [WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumer] -type workersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumerJSON struct { +// [WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumer] +type workersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumerJSON struct { Service apijson.Field Environment apijson.Field Namespace apijson.Field @@ -125,11 +125,11 @@ type workersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumerJ ExtraFields map[string]apijson.Field } -func (r *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseTailConsumer) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkersForPlatformDispatchNamespaceScriptContentUpdateParams struct { +type WorkersForPlatformDispatchNamespaceScriptContentReplaceParams struct { // A module comprising a Worker script, often a javascript file. Multiple modules // may be provided as separate named parts, but at least one module must be // present. This should be referenced either in the metadata as `main_module` @@ -137,12 +137,12 @@ type WorkersForPlatformDispatchNamespaceScriptContentUpdateParams struct { // (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. AnyPartName param.Field[[]io.Reader] `json:"" format:"binary"` // JSON encoded metadata about the uploaded parts and Worker configuration. - Metadata param.Field[WorkersForPlatformDispatchNamespaceScriptContentUpdateParamsMetadata] `json:"metadata"` - CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` - CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` + Metadata param.Field[WorkersForPlatformDispatchNamespaceScriptContentReplaceParamsMetadata] `json:"metadata"` + CfWorkerBodyPart param.Field[string] `header:"CF-WORKER-BODY-PART"` + CfWorkerMainModulePart param.Field[string] `header:"CF-WORKER-MAIN-MODULE-PART"` } -func (r WorkersForPlatformDispatchNamespaceScriptContentUpdateParams) MarshalMultipart() (data []byte, contentType string, err error) { +func (r WorkersForPlatformDispatchNamespaceScriptContentReplaceParams) MarshalMultipart() (data []byte, contentType string, err error) { buf := bytes.NewBuffer(nil) writer := multipart.NewWriter(buf) err = apiform.MarshalRoot(r, writer) @@ -158,7 +158,7 @@ func (r WorkersForPlatformDispatchNamespaceScriptContentUpdateParams) MarshalMul } // JSON encoded metadata about the uploaded parts and Worker configuration. -type WorkersForPlatformDispatchNamespaceScriptContentUpdateParamsMetadata struct { +type WorkersForPlatformDispatchNamespaceScriptContentReplaceParamsMetadata struct { // Name of the part in the multipart request that contains the script (e.g. the // file adding a listener to the `fetch` event). Indicates a // `service worker syntax` Worker. @@ -168,23 +168,23 @@ type WorkersForPlatformDispatchNamespaceScriptContentUpdateParamsMetadata struct MainModule param.Field[string] `json:"main_module"` } -func (r WorkersForPlatformDispatchNamespaceScriptContentUpdateParamsMetadata) MarshalJSON() (data []byte, err error) { +func (r WorkersForPlatformDispatchNamespaceScriptContentReplaceParamsMetadata) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelope struct { - Errors []WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessages `json:"messages,required"` - Result WorkersForPlatformDispatchNamespaceScriptContentUpdateResponse `json:"result,required"` +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelope struct { + Errors []WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkersForPlatformDispatchNamespaceScriptContentReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeJSON `json:"-"` + Success WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeJSON `json:"-"` } -// workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeJSON +// workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeJSON // contains the JSON metadata for the struct -// [WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelope] -type workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeJSON struct { +// [WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelope] +type workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -193,53 +193,53 @@ type workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeJSON ExtraFields map[string]apijson.Field } -func (r *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrorsJSON `json:"-"` +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrorsJSON +// workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrorsJSON // contains the JSON metadata for the struct -// [WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrors] -type workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrorsJSON struct { +// [WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrors] +type workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessagesJSON `json:"-"` +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessagesJSON +// workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessagesJSON // contains the JSON metadata for the struct -// [WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessages] -type workersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessagesJSON struct { +// [WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessages] +type workersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeSuccess bool +type WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeSuccess bool const ( - WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeSuccessTrue WorkersForPlatformDispatchNamespaceScriptContentUpdateResponseEnvelopeSuccess = true + WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeSuccessTrue WorkersForPlatformDispatchNamespaceScriptContentReplaceResponseEnvelopeSuccess = true ) diff --git a/workersforplatformdispatchnamespacescriptcontent_test.go b/workersforplatformdispatchnamespacescriptcontent_test.go index 1bfbb5d5f31..24f33123329 100644 --- a/workersforplatformdispatchnamespacescriptcontent_test.go +++ b/workersforplatformdispatchnamespacescriptcontent_test.go @@ -17,15 +17,14 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkersForPlatformDispatchNamespaceScriptContentUpdateWithOptionalParams(t *testing.T) { +func TestWorkersForPlatformDispatchNamespaceScriptContentGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Write([]byte("abc")) + })) + defer server.Close() + baseURL := server.URL client := cloudflare.NewClient( option.WithBaseURL(baseURL), option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), @@ -33,20 +32,11 @@ func TestWorkersForPlatformDispatchNamespaceScriptContentUpdateWithOptionalParam option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Update( + resp, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-dispatch-namespace", "this-is_my_script-01", - cloudflare.WorkersForPlatformDispatchNamespaceScriptContentUpdateParams{ - AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), - Metadata: cloudflare.F(cloudflare.WorkersForPlatformDispatchNamespaceScriptContentUpdateParamsMetadata{ - BodyPart: cloudflare.F("worker.js"), - MainModule: cloudflare.F("worker.js"), - }), - CfWorkerBodyPart: cloudflare.F("string"), - CfWorkerMainModulePart: cloudflare.F("string"), - }, ) if err != nil { var apierr *cloudflare.Error @@ -55,16 +45,30 @@ func TestWorkersForPlatformDispatchNamespaceScriptContentUpdateWithOptionalParam } t.Fatalf("err should be nil: %s", err.Error()) } + defer resp.Body.Close() + + b, err := io.ReadAll(resp.Body) + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } + if !bytes.Equal(b, []byte("abc")) { + t.Fatalf("return value not %s: %s", "abc", b) + } } -func TestWorkersForPlatformDispatchNamespaceScriptContentGet(t *testing.T) { +func TestWorkersForPlatformDispatchNamespaceScriptContentReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - w.Write([]byte("abc")) - })) - defer server.Close() - baseURL := server.URL + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } client := cloudflare.NewClient( option.WithBaseURL(baseURL), option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), @@ -72,11 +76,20 @@ func TestWorkersForPlatformDispatchNamespaceScriptContentGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - resp, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Get( + _, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "my-dispatch-namespace", "this-is_my_script-01", + cloudflare.WorkersForPlatformDispatchNamespaceScriptContentReplaceParams{ + AnyPartName: cloudflare.F([]io.Reader{io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents"))), io.Reader(bytes.NewBuffer([]byte("some file contents")))}), + Metadata: cloudflare.F(cloudflare.WorkersForPlatformDispatchNamespaceScriptContentReplaceParamsMetadata{ + BodyPart: cloudflare.F("worker.js"), + MainModule: cloudflare.F("worker.js"), + }), + CfWorkerBodyPart: cloudflare.F("string"), + CfWorkerMainModulePart: cloudflare.F("string"), + }, ) if err != nil { var apierr *cloudflare.Error @@ -85,17 +98,4 @@ func TestWorkersForPlatformDispatchNamespaceScriptContentGet(t *testing.T) { } t.Fatalf("err should be nil: %s", err.Error()) } - defer resp.Body.Close() - - b, err := io.ReadAll(resp.Body) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } - if !bytes.Equal(b, []byte("abc")) { - t.Fatalf("return value not %s: %s", "abc", b) - } } diff --git a/workersubdomain.go b/workersubdomain.go index 5d311e59493..44f14e65e6f 100644 --- a/workersubdomain.go +++ b/workersubdomain.go @@ -31,12 +31,12 @@ func NewWorkerSubdomainService(opts ...option.RequestOption) (r *WorkerSubdomain return } -// Creates a Workers subdomain for an account. -func (r *WorkerSubdomainService) WorkerSubdomainNewSubdomain(ctx context.Context, accountID string, body WorkerSubdomainWorkerSubdomainNewSubdomainParams, opts ...option.RequestOption) (res *WorkerSubdomainWorkerSubdomainNewSubdomainResponse, err error) { +// Returns a Workers subdomain for an account. +func (r *WorkerSubdomainService) Get(ctx context.Context, accountID string, opts ...option.RequestOption) (res *WorkerSubdomainGetResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelope + var env WorkerSubdomainGetResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/subdomain", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -44,12 +44,12 @@ func (r *WorkerSubdomainService) WorkerSubdomainNewSubdomain(ctx context.Context return } -// Returns a Workers subdomain for an account. -func (r *WorkerSubdomainService) WorkerSubdomainGetSubdomain(ctx context.Context, accountID string, opts ...option.RequestOption) (res *WorkerSubdomainWorkerSubdomainGetSubdomainResponse, err error) { +// Creates a Workers subdomain for an account. +func (r *WorkerSubdomainService) Replace(ctx context.Context, accountID string, body WorkerSubdomainReplaceParams, opts ...option.RequestOption) (res *WorkerSubdomainReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelope + var env WorkerSubdomainReplaceResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/subdomain", accountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -57,61 +57,52 @@ func (r *WorkerSubdomainService) WorkerSubdomainGetSubdomain(ctx context.Context return } -type WorkerSubdomainWorkerSubdomainNewSubdomainResponse struct { - Name interface{} `json:"name"` - JSON workerSubdomainWorkerSubdomainNewSubdomainResponseJSON `json:"-"` +type WorkerSubdomainGetResponse struct { + Name interface{} `json:"name"` + JSON workerSubdomainGetResponseJSON `json:"-"` } -// workerSubdomainWorkerSubdomainNewSubdomainResponseJSON contains the JSON -// metadata for the struct [WorkerSubdomainWorkerSubdomainNewSubdomainResponse] -type workerSubdomainWorkerSubdomainNewSubdomainResponseJSON struct { +// workerSubdomainGetResponseJSON contains the JSON metadata for the struct +// [WorkerSubdomainGetResponse] +type workerSubdomainGetResponseJSON struct { Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainNewSubdomainResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainGetSubdomainResponse struct { - Name interface{} `json:"name"` - JSON workerSubdomainWorkerSubdomainGetSubdomainResponseJSON `json:"-"` +type WorkerSubdomainReplaceResponse struct { + Name interface{} `json:"name"` + JSON workerSubdomainReplaceResponseJSON `json:"-"` } -// workerSubdomainWorkerSubdomainGetSubdomainResponseJSON contains the JSON -// metadata for the struct [WorkerSubdomainWorkerSubdomainGetSubdomainResponse] -type workerSubdomainWorkerSubdomainGetSubdomainResponseJSON struct { +// workerSubdomainReplaceResponseJSON contains the JSON metadata for the struct +// [WorkerSubdomainReplaceResponse] +type workerSubdomainReplaceResponseJSON struct { Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainGetSubdomainResponse) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainNewSubdomainParams struct { - Body param.Field[interface{}] `json:"body,required"` -} - -func (r WorkerSubdomainWorkerSubdomainNewSubdomainParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelope struct { - Errors []WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessages `json:"messages,required"` - Result WorkerSubdomainWorkerSubdomainNewSubdomainResponse `json:"result,required"` +type WorkerSubdomainGetResponseEnvelope struct { + Errors []WorkerSubdomainGetResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerSubdomainGetResponseEnvelopeMessages `json:"messages,required"` + Result WorkerSubdomainGetResponse `json:"result,required"` // Whether the API call was successful - Success WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeSuccess `json:"success,required"` - JSON workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeJSON `json:"-"` + Success WorkerSubdomainGetResponseEnvelopeSuccess `json:"success,required"` + JSON workerSubdomainGetResponseEnvelopeJSON `json:"-"` } -// workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelope] -type workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeJSON struct { +// workerSubdomainGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [WorkerSubdomainGetResponseEnvelope] +type workerSubdomainGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -120,70 +111,75 @@ type workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrorsJSON `json:"-"` +type WorkerSubdomainGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerSubdomainGetResponseEnvelopeErrorsJSON `json:"-"` } -// workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrors] -type workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrorsJSON struct { +// workerSubdomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [WorkerSubdomainGetResponseEnvelopeErrors] +type workerSubdomainGetResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessagesJSON `json:"-"` +type WorkerSubdomainGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerSubdomainGetResponseEnvelopeMessagesJSON `json:"-"` } -// workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessages] -type workerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessagesJSON struct { +// workerSubdomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [WorkerSubdomainGetResponseEnvelopeMessages] +type workerSubdomainGetResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeSuccess bool +type WorkerSubdomainGetResponseEnvelopeSuccess bool const ( - WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeSuccessTrue WorkerSubdomainWorkerSubdomainNewSubdomainResponseEnvelopeSuccess = true + WorkerSubdomainGetResponseEnvelopeSuccessTrue WorkerSubdomainGetResponseEnvelopeSuccess = true ) -type WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelope struct { - Errors []WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrors `json:"errors,required"` - Messages []WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessages `json:"messages,required"` - Result WorkerSubdomainWorkerSubdomainGetSubdomainResponse `json:"result,required"` +type WorkerSubdomainReplaceParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WorkerSubdomainReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type WorkerSubdomainReplaceResponseEnvelope struct { + Errors []WorkerSubdomainReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []WorkerSubdomainReplaceResponseEnvelopeMessages `json:"messages,required"` + Result WorkerSubdomainReplaceResponse `json:"result,required"` // Whether the API call was successful - Success WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeSuccess `json:"success,required"` - JSON workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeJSON `json:"-"` + Success WorkerSubdomainReplaceResponseEnvelopeSuccess `json:"success,required"` + JSON workerSubdomainReplaceResponseEnvelopeJSON `json:"-"` } -// workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelope] -type workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeJSON struct { +// workerSubdomainReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [WorkerSubdomainReplaceResponseEnvelope] +type workerSubdomainReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -192,53 +188,51 @@ type workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrorsJSON `json:"-"` +type WorkerSubdomainReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerSubdomainReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrorsJSON contains -// the JSON metadata for the struct -// [WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrors] -type workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrorsJSON struct { +// workerSubdomainReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for +// the struct [WorkerSubdomainReplaceResponseEnvelopeErrors] +type workerSubdomainReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessagesJSON `json:"-"` +type WorkerSubdomainReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON workerSubdomainReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessagesJSON contains -// the JSON metadata for the struct -// [WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessages] -type workerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessagesJSON struct { +// workerSubdomainReplaceResponseEnvelopeMessagesJSON contains the JSON metadata +// for the struct [WorkerSubdomainReplaceResponseEnvelopeMessages] +type workerSubdomainReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *WorkerSubdomainReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeSuccess bool +type WorkerSubdomainReplaceResponseEnvelopeSuccess bool const ( - WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeSuccessTrue WorkerSubdomainWorkerSubdomainGetSubdomainResponseEnvelopeSuccess = true + WorkerSubdomainReplaceResponseEnvelopeSuccessTrue WorkerSubdomainReplaceResponseEnvelopeSuccess = true ) diff --git a/workersubdomain_test.go b/workersubdomain_test.go index 548ce38cdf4..137ff2eb18e 100644 --- a/workersubdomain_test.go +++ b/workersubdomain_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestWorkerSubdomainWorkerSubdomainNewSubdomain(t *testing.T) { +func TestWorkerSubdomainGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,13 +29,7 @@ func TestWorkerSubdomainWorkerSubdomainNewSubdomain(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Subdomains.WorkerSubdomainNewSubdomain( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.WorkerSubdomainWorkerSubdomainNewSubdomainParams{ - Body: cloudflare.F[any]("{'subdomain': 'example-subdomain'}"), - }, - ) + _, err := client.Workers.Subdomains.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -45,7 +39,7 @@ func TestWorkerSubdomainWorkerSubdomainNewSubdomain(t *testing.T) { } } -func TestWorkerSubdomainWorkerSubdomainGetSubdomain(t *testing.T) { +func TestWorkerSubdomainReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +55,13 @@ func TestWorkerSubdomainWorkerSubdomainGetSubdomain(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Workers.Subdomains.WorkerSubdomainGetSubdomain(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Workers.Subdomains.Replace( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.WorkerSubdomainReplaceParams{ + Body: cloudflare.F[any]("{'subdomain': 'example-subdomain'}"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/zaraz.go b/zaraz.go index b1289106388..daf41e89c3e 100644 --- a/zaraz.go +++ b/zaraz.go @@ -43,9 +43,9 @@ func NewZarazService(opts ...option.RequestOption) (r *ZarazService) { } // Updates Zaraz workflow for a zone. -func (r *ZarazService) WorkflowUpdate(ctx context.Context, zoneID string, body ZarazWorkflowUpdateParams, opts ...option.RequestOption) (res *ZarazWorkflowUpdateResponse, err error) { +func (r *ZarazService) Replace(ctx context.Context, zoneID string, body ZarazReplaceParams, opts ...option.RequestOption) (res *ZarazReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env ZarazWorkflowUpdateResponseEnvelope + var env ZarazReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/settings/zaraz/workflow", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { @@ -56,43 +56,43 @@ func (r *ZarazService) WorkflowUpdate(ctx context.Context, zoneID string, body Z } // Zaraz workflow -type ZarazWorkflowUpdateResponse string +type ZarazReplaceResponse string const ( - ZarazWorkflowUpdateResponseRealtime ZarazWorkflowUpdateResponse = "realtime" - ZarazWorkflowUpdateResponsePreview ZarazWorkflowUpdateResponse = "preview" + ZarazReplaceResponseRealtime ZarazReplaceResponse = "realtime" + ZarazReplaceResponsePreview ZarazReplaceResponse = "preview" ) -type ZarazWorkflowUpdateParams struct { +type ZarazReplaceParams struct { // Zaraz workflow - Body param.Field[ZarazWorkflowUpdateParamsBody] `json:"body,required"` + Body param.Field[ZarazReplaceParamsBody] `json:"body,required"` } -func (r ZarazWorkflowUpdateParams) MarshalJSON() (data []byte, err error) { +func (r ZarazReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r.Body) } // Zaraz workflow -type ZarazWorkflowUpdateParamsBody string +type ZarazReplaceParamsBody string const ( - ZarazWorkflowUpdateParamsBodyRealtime ZarazWorkflowUpdateParamsBody = "realtime" - ZarazWorkflowUpdateParamsBodyPreview ZarazWorkflowUpdateParamsBody = "preview" + ZarazReplaceParamsBodyRealtime ZarazReplaceParamsBody = "realtime" + ZarazReplaceParamsBodyPreview ZarazReplaceParamsBody = "preview" ) -type ZarazWorkflowUpdateResponseEnvelope struct { - Errors []ZarazWorkflowUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ZarazWorkflowUpdateResponseEnvelopeMessages `json:"messages,required"` +type ZarazReplaceResponseEnvelope struct { + Errors []ZarazReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []ZarazReplaceResponseEnvelopeMessages `json:"messages,required"` // Zaraz workflow - Result ZarazWorkflowUpdateResponse `json:"result,required"` + Result ZarazReplaceResponse `json:"result,required"` // Whether the API call was successful - Success bool `json:"success,required"` - JSON zarazWorkflowUpdateResponseEnvelopeJSON `json:"-"` + Success bool `json:"success,required"` + JSON zarazReplaceResponseEnvelopeJSON `json:"-"` } -// zarazWorkflowUpdateResponseEnvelopeJSON contains the JSON metadata for the -// struct [ZarazWorkflowUpdateResponseEnvelope] -type zarazWorkflowUpdateResponseEnvelopeJSON struct { +// zarazReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [ZarazReplaceResponseEnvelope] +type zarazReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -101,44 +101,44 @@ type zarazWorkflowUpdateResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazWorkflowUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazWorkflowUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazWorkflowUpdateResponseEnvelopeErrorsJSON `json:"-"` +type ZarazReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// zarazWorkflowUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [ZarazWorkflowUpdateResponseEnvelopeErrors] -type zarazWorkflowUpdateResponseEnvelopeErrorsJSON struct { +// zarazReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [ZarazReplaceResponseEnvelopeErrors] +type zarazReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazWorkflowUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazWorkflowUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazWorkflowUpdateResponseEnvelopeMessagesJSON `json:"-"` +type ZarazReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// zarazWorkflowUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [ZarazWorkflowUpdateResponseEnvelopeMessages] -type zarazWorkflowUpdateResponseEnvelopeMessagesJSON struct { +// zarazReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ZarazReplaceResponseEnvelopeMessages] +type zarazReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazWorkflowUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/zaraz_test.go b/zaraz_test.go index 7e8db11583d..e3ee176613b 100644 --- a/zaraz_test.go +++ b/zaraz_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestZarazWorkflowUpdate(t *testing.T) { +func TestZarazReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,11 @@ func TestZarazWorkflowUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zaraz.WorkflowUpdate( + _, err := client.Zaraz.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZarazWorkflowUpdateParams{ - Body: cloudflare.F(cloudflare.ZarazWorkflowUpdateParamsBodyRealtime), + cloudflare.ZarazReplaceParams{ + Body: cloudflare.F(cloudflare.ZarazReplaceParamsBodyRealtime), }, ) if err != nil { diff --git a/zarazconfig.go b/zarazconfig.go index 558831fd7bf..d4ad45c73d9 100644 --- a/zarazconfig.go +++ b/zarazconfig.go @@ -34,12 +34,14 @@ func NewZarazConfigService(opts ...option.RequestOption) (r *ZarazConfigService) return } -// Updates Zaraz configuration for a zone. -func (r *ZarazConfigService) Update(ctx context.Context, zoneID string, body ZarazConfigUpdateParams, opts ...option.RequestOption) (res *ZarazConfigUpdateResponse, err error) { +// Gets latest Zaraz configuration for a zone. It can be preview or published +// configuration, whichever was the last updated. Secret variables values will not +// be included. +func (r *ZarazConfigService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ZarazConfigGetResponse, err error) { opts = append(r.Options[:], opts...) - var env ZarazConfigUpdateResponseEnvelope + var env ZarazConfigGetResponseEnvelope path := fmt.Sprintf("zones/%s/settings/zaraz/config", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -47,14 +49,12 @@ func (r *ZarazConfigService) Update(ctx context.Context, zoneID string, body Zar return } -// Gets latest Zaraz configuration for a zone. It can be preview or published -// configuration, whichever was the last updated. Secret variables values will not -// be included. -func (r *ZarazConfigService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ZarazConfigGetResponse, err error) { +// Updates Zaraz configuration for a zone. +func (r *ZarazConfigService) Replace(ctx context.Context, zoneID string, body ZarazConfigReplaceParams, opts ...option.RequestOption) (res *ZarazConfigReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env ZarazConfigGetResponseEnvelope + var env ZarazConfigReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/settings/zaraz/config", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -63,35 +63,35 @@ func (r *ZarazConfigService) Get(ctx context.Context, zoneID string, opts ...opt } // Zaraz configuration -type ZarazConfigUpdateResponse struct { +type ZarazConfigGetResponse struct { // Data layer compatibility mode enabled. DataLayer bool `json:"dataLayer,required"` // The key for Zaraz debug mode. DebugKey string `json:"debugKey,required"` // General Zaraz settings. - Settings ZarazConfigUpdateResponseSettings `json:"settings,required"` + Settings ZarazConfigGetResponseSettings `json:"settings,required"` // Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID // and value is the tool configuration object. - Tools map[string]ZarazConfigUpdateResponseTool `json:"tools,required"` + Tools map[string]ZarazConfigGetResponseTool `json:"tools,required"` // Triggers set up under Zaraz configuration, where key is the trigger // alpha-numeric ID and value is the trigger configuration. - Triggers map[string]ZarazConfigUpdateResponseTrigger `json:"triggers,required"` + Triggers map[string]ZarazConfigGetResponseTrigger `json:"triggers,required"` // Variables set up under Zaraz configuration, where key is the variable // alpha-numeric ID and value is the variable configuration. Values of variables of // type secret are not included. - Variables map[string]ZarazConfigUpdateResponseVariable `json:"variables,required"` + Variables map[string]ZarazConfigGetResponseVariable `json:"variables,required"` // Zaraz internal version of the config. ZarazVersion int64 `json:"zarazVersion,required"` // Consent management configuration. - Consent ZarazConfigUpdateResponseConsent `json:"consent"` + Consent ZarazConfigGetResponseConsent `json:"consent"` // Single Page Application support enabled. - HistoryChange bool `json:"historyChange"` - JSON zarazConfigUpdateResponseJSON `json:"-"` + HistoryChange bool `json:"historyChange"` + JSON zarazConfigGetResponseJSON `json:"-"` } -// zarazConfigUpdateResponseJSON contains the JSON metadata for the struct -// [ZarazConfigUpdateResponse] -type zarazConfigUpdateResponseJSON struct { +// zarazConfigGetResponseJSON contains the JSON metadata for the struct +// [ZarazConfigGetResponse] +type zarazConfigGetResponseJSON struct { DataLayer apijson.Field DebugKey apijson.Field Settings apijson.Field @@ -105,16 +105,16 @@ type zarazConfigUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // General Zaraz settings. -type ZarazConfigUpdateResponseSettings struct { +type ZarazConfigGetResponseSettings struct { // Automatic injection of Zaraz scripts enabled. AutoInjectScript bool `json:"autoInjectScript,required"` // Details of the worker that receives and edits Zaraz Context object. - ContextEnricher ZarazConfigUpdateResponseSettingsContextEnricher `json:"contextEnricher"` + ContextEnricher ZarazConfigGetResponseSettingsContextEnricher `json:"contextEnricher"` // The domain Zaraz will use for writing and reading its cookies. CookieDomain string `json:"cookieDomain"` // Ecommerce API enabled. @@ -138,13 +138,13 @@ type ZarazConfigUpdateResponseSettings struct { // Custom endpoint for Zaraz main script. ScriptPath string `json:"scriptPath"` // Custom endpoint for Zaraz tracking requests. - TrackPath string `json:"trackPath"` - JSON zarazConfigUpdateResponseSettingsJSON `json:"-"` + TrackPath string `json:"trackPath"` + JSON zarazConfigGetResponseSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseSettingsJSON contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseSettings] -type zarazConfigUpdateResponseSettingsJSON struct { +// zarazConfigGetResponseSettingsJSON contains the JSON metadata for the struct +// [ZarazConfigGetResponseSettings] +type zarazConfigGetResponseSettingsJSON struct { AutoInjectScript apijson.Field ContextEnricher apijson.Field CookieDomain apijson.Field @@ -163,47 +163,47 @@ type zarazConfigUpdateResponseSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details of the worker that receives and edits Zaraz Context object. -type ZarazConfigUpdateResponseSettingsContextEnricher struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazConfigUpdateResponseSettingsContextEnricherJSON `json:"-"` +type ZarazConfigGetResponseSettingsContextEnricher struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazConfigGetResponseSettingsContextEnricherJSON `json:"-"` } -// zarazConfigUpdateResponseSettingsContextEnricherJSON contains the JSON metadata -// for the struct [ZarazConfigUpdateResponseSettingsContextEnricher] -type zarazConfigUpdateResponseSettingsContextEnricherJSON struct { +// zarazConfigGetResponseSettingsContextEnricherJSON contains the JSON metadata for +// the struct [ZarazConfigGetResponseSettingsContextEnricher] +type zarazConfigGetResponseSettingsContextEnricherJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigUpdateResponseToolsZarazManagedComponent] or -// [ZarazConfigUpdateResponseToolsZarazCustomManagedComponent]. -type ZarazConfigUpdateResponseTool interface { - implementsZarazConfigUpdateResponseTool() +// Union satisfied by [ZarazConfigGetResponseToolsZarazManagedComponent] or +// [ZarazConfigGetResponseToolsZarazCustomManagedComponent]. +type ZarazConfigGetResponseTool interface { + implementsZarazConfigGetResponseTool() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigUpdateResponseTool)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTool)(nil)).Elem(), "") } -type ZarazConfigUpdateResponseToolsZarazManagedComponent struct { +type ZarazConfigGetResponseToolsZarazManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazConfigGetResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -211,21 +211,21 @@ type ZarazConfigUpdateResponseToolsZarazManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazConfigUpdateResponseToolsZarazManagedComponentSetting `json:"settings,required"` - Type ZarazConfigUpdateResponseToolsZarazManagedComponentType `json:"type,required"` + Settings map[string]ZarazConfigGetResponseToolsZarazManagedComponentSetting `json:"settings,required"` + Type ZarazConfigGetResponseToolsZarazManagedComponentType `json:"type,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazConfigUpdateResponseToolsZarazManagedComponentAction `json:"actions"` + Actions map[string]ZarazConfigGetResponseToolsZarazManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazConfigUpdateResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazConfigUpdateResponseToolsZarazManagedComponentJSON `json:"-"` + NeoEvents []ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazConfigGetResponseToolsZarazManagedComponentJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazManagedComponentJSON contains the JSON -// metadata for the struct [ZarazConfigUpdateResponseToolsZarazManagedComponent] -type zarazConfigUpdateResponseToolsZarazManagedComponentJSON struct { +// zarazConfigGetResponseToolsZarazManagedComponentJSON contains the JSON metadata +// for the struct [ZarazConfigGetResponseToolsZarazManagedComponent] +type zarazConfigGetResponseToolsZarazManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -241,21 +241,20 @@ type zarazConfigUpdateResponseToolsZarazManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseToolsZarazManagedComponent) implementsZarazConfigUpdateResponseTool() { -} +func (r ZarazConfigGetResponseToolsZarazManagedComponent) implementsZarazConfigGetResponseTool() {} // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField interface { - ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField() +type ZarazConfigGetResponseToolsZarazManagedComponentDefaultField interface { + ImplementsZarazConfigGetResponseToolsZarazManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigUpdateResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigGetResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -273,13 +272,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigUpdateResponseToolsZarazManagedComponentSetting interface { - ImplementsZarazConfigUpdateResponseToolsZarazManagedComponentSetting() +type ZarazConfigGetResponseToolsZarazManagedComponentSetting interface { + ImplementsZarazConfigGetResponseToolsZarazManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigUpdateResponseToolsZarazManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigGetResponseToolsZarazManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -296,13 +295,13 @@ func init() { ) } -type ZarazConfigUpdateResponseToolsZarazManagedComponentType string +type ZarazConfigGetResponseToolsZarazManagedComponentType string const ( - ZarazConfigUpdateResponseToolsZarazManagedComponentTypeComponent ZarazConfigUpdateResponseToolsZarazManagedComponentType = "component" + ZarazConfigGetResponseToolsZarazManagedComponentTypeComponent ZarazConfigGetResponseToolsZarazManagedComponentType = "component" ) -type ZarazConfigUpdateResponseToolsZarazManagedComponentAction struct { +type ZarazConfigGetResponseToolsZarazManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -310,14 +309,13 @@ type ZarazConfigUpdateResponseToolsZarazManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigUpdateResponseToolsZarazManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigGetResponseToolsZarazManagedComponentActionJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazManagedComponentActionJSON contains the JSON -// metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazManagedComponentAction] -type zarazConfigUpdateResponseToolsZarazManagedComponentActionJSON struct { +// zarazConfigGetResponseToolsZarazManagedComponentActionJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseToolsZarazManagedComponentAction] +type zarazConfigGetResponseToolsZarazManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -326,11 +324,11 @@ type zarazConfigUpdateResponseToolsZarazManagedComponentActionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseToolsZarazManagedComponentNeoEvent struct { +type ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -338,14 +336,14 @@ type ZarazConfigUpdateResponseToolsZarazManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigUpdateResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazManagedComponentNeoEventJSON contains the -// JSON metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazManagedComponentNeoEvent] -type zarazConfigUpdateResponseToolsZarazManagedComponentNeoEventJSON struct { +// zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON contains the JSON +// metadata for the struct +// [ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent] +type zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -354,17 +352,17 @@ type zarazConfigUpdateResponseToolsZarazManagedComponentNeoEventJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponent struct { +type ZarazConfigGetResponseToolsZarazCustomManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -372,24 +370,23 @@ type ZarazConfigUpdateResponseToolsZarazCustomManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` - Type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentType `json:"type,required"` + Settings map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` + Type ZarazConfigGetResponseToolsZarazCustomManagedComponentType `json:"type,required"` // Cloudflare worker that acts as a managed component - Worker ZarazConfigUpdateResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` + Worker ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazConfigUpdateResponseToolsZarazCustomManagedComponentAction `json:"actions"` + Actions map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazConfigUpdateResponseToolsZarazCustomManagedComponentJSON `json:"-"` + NeoEvents []ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazConfigGetResponseToolsZarazCustomManagedComponentJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazCustomManagedComponentJSON contains the JSON -// metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazCustomManagedComponent] -type zarazConfigUpdateResponseToolsZarazCustomManagedComponentJSON struct { +// zarazConfigGetResponseToolsZarazCustomManagedComponentJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseToolsZarazCustomManagedComponent] +type zarazConfigGetResponseToolsZarazCustomManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -406,21 +403,21 @@ type zarazConfigUpdateResponseToolsZarazCustomManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseToolsZarazCustomManagedComponent) implementsZarazConfigUpdateResponseTool() { +func (r ZarazConfigGetResponseToolsZarazCustomManagedComponent) implementsZarazConfigGetResponseTool() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField interface { - ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField() +type ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField interface { + ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigUpdateResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -438,13 +435,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting interface { - ImplementsZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting() +type ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting interface { + ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigUpdateResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -461,34 +458,34 @@ func init() { ) } -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentType string +type ZarazConfigGetResponseToolsZarazCustomManagedComponentType string const ( - ZarazConfigUpdateResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigUpdateResponseToolsZarazCustomManagedComponentType = "custom-mc" + ZarazConfigGetResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigGetResponseToolsZarazCustomManagedComponentType = "custom-mc" ) // Cloudflare worker that acts as a managed component -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentWorker struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazConfigUpdateResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` +type ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazCustomManagedComponentWorkerJSON contains the +// zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON contains the // JSON metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazCustomManagedComponentWorker] -type zarazConfigUpdateResponseToolsZarazCustomManagedComponentWorkerJSON struct { +// [ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker] +type zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentAction struct { +type ZarazConfigGetResponseToolsZarazCustomManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -496,14 +493,14 @@ type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigUpdateResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazCustomManagedComponentActionJSON contains the +// zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON contains the // JSON metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazCustomManagedComponentAction] -type zarazConfigUpdateResponseToolsZarazCustomManagedComponentActionJSON struct { +// [ZarazConfigGetResponseToolsZarazCustomManagedComponentAction] +type zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -512,11 +509,11 @@ type zarazConfigUpdateResponseToolsZarazCustomManagedComponentActionJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEvent struct { +type ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -524,14 +521,14 @@ type ZarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` } -// zarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEvent] -type zarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON struct { +// zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent] +type zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -540,26 +537,26 @@ type zarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTrigger struct { +type ZarazConfigGetResponseTrigger struct { // Rules defining when the trigger is not fired. - ExcludeRules []ZarazConfigUpdateResponseTriggersExcludeRule `json:"excludeRules,required"` + ExcludeRules []ZarazConfigGetResponseTriggersExcludeRule `json:"excludeRules,required"` // Rules defining when the trigger is fired. - LoadRules []ZarazConfigUpdateResponseTriggersLoadRule `json:"loadRules,required"` + LoadRules []ZarazConfigGetResponseTriggersLoadRule `json:"loadRules,required"` // Trigger name. Name string `json:"name,required"` // Trigger description. - Description string `json:"description"` - System ZarazConfigUpdateResponseTriggersSystem `json:"system"` - JSON zarazConfigUpdateResponseTriggerJSON `json:"-"` + Description string `json:"description"` + System ZarazConfigGetResponseTriggersSystem `json:"system"` + JSON zarazConfigGetResponseTriggerJSON `json:"-"` } -// zarazConfigUpdateResponseTriggerJSON contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTrigger] -type zarazConfigUpdateResponseTriggerJSON struct { +// zarazConfigGetResponseTriggerJSON contains the JSON metadata for the struct +// [ZarazConfigGetResponseTrigger] +type zarazConfigGetResponseTriggerJSON struct { ExcludeRules apijson.Field LoadRules apijson.Field Name apijson.Field @@ -569,37 +566,37 @@ type zarazConfigUpdateResponseTriggerJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTrigger) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTrigger) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRule], -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRule], -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRule], -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule], -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRule], -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRule] or -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule]. -type ZarazConfigUpdateResponseTriggersExcludeRule interface { - implementsZarazConfigUpdateResponseTriggersExcludeRule() +// Union satisfied by [ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule], +// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule], +// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule], +// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule], +// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule], +// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule] or +// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule]. +type ZarazConfigGetResponseTriggersExcludeRule interface { + implementsZarazConfigGetResponseTriggersExcludeRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigUpdateResponseTriggersExcludeRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTriggersExcludeRule)(nil)).Elem(), "") } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON contains the JSON +// zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON contains the JSON // metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -608,39 +605,39 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp string +type ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON contains +// zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON contains // the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -648,30 +645,30 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON str ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -679,28 +676,28 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string +type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON contains the -// JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON struct { +// zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON contains the JSON +// metadata for the struct +// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -708,50 +705,50 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" + ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON contains +// zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON contains // the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON -// contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { +// zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -759,50 +756,50 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON st ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON contains +// zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON contains // the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -810,50 +807,50 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON str ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { +// zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -861,48 +858,48 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule] +type zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -910,64 +907,63 @@ type zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigUpdateResponseTriggersExcludeRule() { +func (r ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigGetResponseTriggersExcludeRule() { } -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string +type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON +// zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] -type zarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] +type zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRule], -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRule], -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRule], -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRule], -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRule], -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRule] or -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRule]. -type ZarazConfigUpdateResponseTriggersLoadRule interface { - implementsZarazConfigUpdateResponseTriggersLoadRule() +// Union satisfied by [ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule], +// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule], +// [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule], +// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule], +// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule], +// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule] or +// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule]. +type ZarazConfigGetResponseTriggersLoadRule interface { + implementsZarazConfigGetResponseTriggersLoadRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigUpdateResponseTriggersLoadRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTriggersLoadRule)(nil)).Elem(), "") } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON -// metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule] +type zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -976,39 +972,39 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp string +type ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule] +type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1016,30 +1012,30 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON +// zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -1047,28 +1043,27 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSO ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string +type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON -// metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule] +type zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1076,50 +1071,50 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleAction = "timer" + ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule] +type zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1127,50 +1122,50 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON +// zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule] +type zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1178,50 +1173,50 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON +// zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains the +// zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains the // JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { +// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule] +type zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1229,48 +1224,48 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON -// contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON contains +// the JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON -// contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRule] -type zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { +// zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule] +type zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1278,63 +1273,63 @@ type zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON st ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigUpdateResponseTriggersLoadRule() { +func (r ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigGetResponseTriggersLoadRule() { } -type ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction string +type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON +// zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] -type zarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] +type zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseTriggersSystem string +type ZarazConfigGetResponseTriggersSystem string const ( - ZarazConfigUpdateResponseTriggersSystemPageload ZarazConfigUpdateResponseTriggersSystem = "pageload" + ZarazConfigGetResponseTriggersSystemPageload ZarazConfigGetResponseTriggersSystem = "pageload" ) -// Union satisfied by [ZarazConfigUpdateResponseVariablesObject] or -// [ZarazConfigUpdateResponseVariablesObject]. -type ZarazConfigUpdateResponseVariable interface { - implementsZarazConfigUpdateResponseVariable() +// Union satisfied by [ZarazConfigGetResponseVariablesObject] or +// [ZarazConfigGetResponseVariablesObject]. +type ZarazConfigGetResponseVariable interface { + implementsZarazConfigGetResponseVariable() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigUpdateResponseVariable)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseVariable)(nil)).Elem(), "") } -type ZarazConfigUpdateResponseVariablesObject struct { - Name string `json:"name,required"` - Type ZarazConfigUpdateResponseVariablesObjectType `json:"type,required"` - Value string `json:"value,required"` - JSON zarazConfigUpdateResponseVariablesObjectJSON `json:"-"` +type ZarazConfigGetResponseVariablesObject struct { + Name string `json:"name,required"` + Type ZarazConfigGetResponseVariablesObjectType `json:"type,required"` + Value string `json:"value,required"` + JSON zarazConfigGetResponseVariablesObjectJSON `json:"-"` } -// zarazConfigUpdateResponseVariablesObjectJSON contains the JSON metadata for the -// struct [ZarazConfigUpdateResponseVariablesObject] -type zarazConfigUpdateResponseVariablesObjectJSON struct { +// zarazConfigGetResponseVariablesObjectJSON contains the JSON metadata for the +// struct [ZarazConfigGetResponseVariablesObject] +type zarazConfigGetResponseVariablesObjectJSON struct { Name apijson.Field Type apijson.Field Value apijson.Field @@ -1342,27 +1337,27 @@ type zarazConfigUpdateResponseVariablesObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigUpdateResponseVariablesObject) implementsZarazConfigUpdateResponseVariable() {} +func (r ZarazConfigGetResponseVariablesObject) implementsZarazConfigGetResponseVariable() {} -type ZarazConfigUpdateResponseVariablesObjectType string +type ZarazConfigGetResponseVariablesObjectType string const ( - ZarazConfigUpdateResponseVariablesObjectTypeString ZarazConfigUpdateResponseVariablesObjectType = "string" - ZarazConfigUpdateResponseVariablesObjectTypeSecret ZarazConfigUpdateResponseVariablesObjectType = "secret" + ZarazConfigGetResponseVariablesObjectTypeString ZarazConfigGetResponseVariablesObjectType = "string" + ZarazConfigGetResponseVariablesObjectTypeSecret ZarazConfigGetResponseVariablesObjectType = "secret" ) // Consent management configuration. -type ZarazConfigUpdateResponseConsent struct { - Enabled bool `json:"enabled,required"` - ButtonTextTranslations ZarazConfigUpdateResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` - CompanyEmail string `json:"companyEmail"` - CompanyName string `json:"companyName"` - CompanyStreetAddress string `json:"companyStreetAddress"` - ConsentModalIntroHTML string `json:"consentModalIntroHTML"` +type ZarazConfigGetResponseConsent struct { + Enabled bool `json:"enabled,required"` + ButtonTextTranslations ZarazConfigGetResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` + CompanyEmail string `json:"companyEmail"` + CompanyName string `json:"companyName"` + CompanyStreetAddress string `json:"companyStreetAddress"` + ConsentModalIntroHTML string `json:"consentModalIntroHTML"` // Object where keys are language codes ConsentModalIntroHTMLWithTranslations map[string]string `json:"consentModalIntroHTMLWithTranslations"` CookieName string `json:"cookieName"` @@ -1371,15 +1366,15 @@ type ZarazConfigUpdateResponseConsent struct { DefaultLanguage string `json:"defaultLanguage"` HideModal bool `json:"hideModal"` // Object where keys are purpose alpha-numeric IDs - Purposes map[string]ZarazConfigUpdateResponseConsentPurpose `json:"purposes"` + Purposes map[string]ZarazConfigGetResponseConsentPurpose `json:"purposes"` // Object where keys are purpose alpha-numeric IDs - PurposesWithTranslations map[string]ZarazConfigUpdateResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` - JSON zarazConfigUpdateResponseConsentJSON `json:"-"` + PurposesWithTranslations map[string]ZarazConfigGetResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` + JSON zarazConfigGetResponseConsentJSON `json:"-"` } -// zarazConfigUpdateResponseConsentJSON contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseConsent] -type zarazConfigUpdateResponseConsentJSON struct { +// zarazConfigGetResponseConsentJSON contains the JSON metadata for the struct +// [ZarazConfigGetResponseConsent] +type zarazConfigGetResponseConsentJSON struct { Enabled apijson.Field ButtonTextTranslations apijson.Field CompanyEmail apijson.Field @@ -1398,23 +1393,23 @@ type zarazConfigUpdateResponseConsentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseConsent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseConsent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseConsentButtonTextTranslations struct { +type ZarazConfigGetResponseConsentButtonTextTranslations struct { // Object where keys are language codes AcceptAll map[string]string `json:"accept_all,required"` // Object where keys are language codes ConfirmMyChoices map[string]string `json:"confirm_my_choices,required"` // Object where keys are language codes - RejectAll map[string]string `json:"reject_all,required"` - JSON zarazConfigUpdateResponseConsentButtonTextTranslationsJSON `json:"-"` + RejectAll map[string]string `json:"reject_all,required"` + JSON zarazConfigGetResponseConsentButtonTextTranslationsJSON `json:"-"` } -// zarazConfigUpdateResponseConsentButtonTextTranslationsJSON contains the JSON -// metadata for the struct [ZarazConfigUpdateResponseConsentButtonTextTranslations] -type zarazConfigUpdateResponseConsentButtonTextTranslationsJSON struct { +// zarazConfigGetResponseConsentButtonTextTranslationsJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseConsentButtonTextTranslations] +type zarazConfigGetResponseConsentButtonTextTranslationsJSON struct { AcceptAll apijson.Field ConfirmMyChoices apijson.Field RejectAll apijson.Field @@ -1422,42 +1417,41 @@ type zarazConfigUpdateResponseConsentButtonTextTranslationsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseConsentPurpose struct { - Description string `json:"description,required"` - Name string `json:"name,required"` - JSON zarazConfigUpdateResponseConsentPurposeJSON `json:"-"` +type ZarazConfigGetResponseConsentPurpose struct { + Description string `json:"description,required"` + Name string `json:"name,required"` + JSON zarazConfigGetResponseConsentPurposeJSON `json:"-"` } -// zarazConfigUpdateResponseConsentPurposeJSON contains the JSON metadata for the -// struct [ZarazConfigUpdateResponseConsentPurpose] -type zarazConfigUpdateResponseConsentPurposeJSON struct { +// zarazConfigGetResponseConsentPurposeJSON contains the JSON metadata for the +// struct [ZarazConfigGetResponseConsentPurpose] +type zarazConfigGetResponseConsentPurposeJSON struct { Description apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateResponseConsentPurposesWithTranslation struct { +type ZarazConfigGetResponseConsentPurposesWithTranslation struct { // Object where keys are language codes Description map[string]string `json:"description,required"` // Object where keys are language codes - Name map[string]string `json:"name,required"` - Order int64 `json:"order,required"` - JSON zarazConfigUpdateResponseConsentPurposesWithTranslationJSON `json:"-"` + Name map[string]string `json:"name,required"` + Order int64 `json:"order,required"` + JSON zarazConfigGetResponseConsentPurposesWithTranslationJSON `json:"-"` } -// zarazConfigUpdateResponseConsentPurposesWithTranslationJSON contains the JSON -// metadata for the struct -// [ZarazConfigUpdateResponseConsentPurposesWithTranslation] -type zarazConfigUpdateResponseConsentPurposesWithTranslationJSON struct { +// zarazConfigGetResponseConsentPurposesWithTranslationJSON contains the JSON +// metadata for the struct [ZarazConfigGetResponseConsentPurposesWithTranslation] +type zarazConfigGetResponseConsentPurposesWithTranslationJSON struct { Description apijson.Field Name apijson.Field Order apijson.Field @@ -1465,40 +1459,40 @@ type zarazConfigUpdateResponseConsentPurposesWithTranslationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigUpdateResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigGetResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Zaraz configuration -type ZarazConfigGetResponse struct { +type ZarazConfigReplaceResponse struct { // Data layer compatibility mode enabled. DataLayer bool `json:"dataLayer,required"` // The key for Zaraz debug mode. DebugKey string `json:"debugKey,required"` // General Zaraz settings. - Settings ZarazConfigGetResponseSettings `json:"settings,required"` + Settings ZarazConfigReplaceResponseSettings `json:"settings,required"` // Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID // and value is the tool configuration object. - Tools map[string]ZarazConfigGetResponseTool `json:"tools,required"` + Tools map[string]ZarazConfigReplaceResponseTool `json:"tools,required"` // Triggers set up under Zaraz configuration, where key is the trigger // alpha-numeric ID and value is the trigger configuration. - Triggers map[string]ZarazConfigGetResponseTrigger `json:"triggers,required"` + Triggers map[string]ZarazConfigReplaceResponseTrigger `json:"triggers,required"` // Variables set up under Zaraz configuration, where key is the variable // alpha-numeric ID and value is the variable configuration. Values of variables of // type secret are not included. - Variables map[string]ZarazConfigGetResponseVariable `json:"variables,required"` + Variables map[string]ZarazConfigReplaceResponseVariable `json:"variables,required"` // Zaraz internal version of the config. ZarazVersion int64 `json:"zarazVersion,required"` // Consent management configuration. - Consent ZarazConfigGetResponseConsent `json:"consent"` + Consent ZarazConfigReplaceResponseConsent `json:"consent"` // Single Page Application support enabled. - HistoryChange bool `json:"historyChange"` - JSON zarazConfigGetResponseJSON `json:"-"` + HistoryChange bool `json:"historyChange"` + JSON zarazConfigReplaceResponseJSON `json:"-"` } -// zarazConfigGetResponseJSON contains the JSON metadata for the struct -// [ZarazConfigGetResponse] -type zarazConfigGetResponseJSON struct { +// zarazConfigReplaceResponseJSON contains the JSON metadata for the struct +// [ZarazConfigReplaceResponse] +type zarazConfigReplaceResponseJSON struct { DataLayer apijson.Field DebugKey apijson.Field Settings apijson.Field @@ -1512,16 +1506,16 @@ type zarazConfigGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // General Zaraz settings. -type ZarazConfigGetResponseSettings struct { +type ZarazConfigReplaceResponseSettings struct { // Automatic injection of Zaraz scripts enabled. AutoInjectScript bool `json:"autoInjectScript,required"` // Details of the worker that receives and edits Zaraz Context object. - ContextEnricher ZarazConfigGetResponseSettingsContextEnricher `json:"contextEnricher"` + ContextEnricher ZarazConfigReplaceResponseSettingsContextEnricher `json:"contextEnricher"` // The domain Zaraz will use for writing and reading its cookies. CookieDomain string `json:"cookieDomain"` // Ecommerce API enabled. @@ -1545,13 +1539,13 @@ type ZarazConfigGetResponseSettings struct { // Custom endpoint for Zaraz main script. ScriptPath string `json:"scriptPath"` // Custom endpoint for Zaraz tracking requests. - TrackPath string `json:"trackPath"` - JSON zarazConfigGetResponseSettingsJSON `json:"-"` + TrackPath string `json:"trackPath"` + JSON zarazConfigReplaceResponseSettingsJSON `json:"-"` } -// zarazConfigGetResponseSettingsJSON contains the JSON metadata for the struct -// [ZarazConfigGetResponseSettings] -type zarazConfigGetResponseSettingsJSON struct { +// zarazConfigReplaceResponseSettingsJSON contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseSettings] +type zarazConfigReplaceResponseSettingsJSON struct { AutoInjectScript apijson.Field ContextEnricher apijson.Field CookieDomain apijson.Field @@ -1570,47 +1564,47 @@ type zarazConfigGetResponseSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details of the worker that receives and edits Zaraz Context object. -type ZarazConfigGetResponseSettingsContextEnricher struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazConfigGetResponseSettingsContextEnricherJSON `json:"-"` +type ZarazConfigReplaceResponseSettingsContextEnricher struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazConfigReplaceResponseSettingsContextEnricherJSON `json:"-"` } -// zarazConfigGetResponseSettingsContextEnricherJSON contains the JSON metadata for -// the struct [ZarazConfigGetResponseSettingsContextEnricher] -type zarazConfigGetResponseSettingsContextEnricherJSON struct { +// zarazConfigReplaceResponseSettingsContextEnricherJSON contains the JSON metadata +// for the struct [ZarazConfigReplaceResponseSettingsContextEnricher] +type zarazConfigReplaceResponseSettingsContextEnricherJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigGetResponseToolsZarazManagedComponent] or -// [ZarazConfigGetResponseToolsZarazCustomManagedComponent]. -type ZarazConfigGetResponseTool interface { - implementsZarazConfigGetResponseTool() +// Union satisfied by [ZarazConfigReplaceResponseToolsZarazManagedComponent] or +// [ZarazConfigReplaceResponseToolsZarazCustomManagedComponent]. +type ZarazConfigReplaceResponseTool interface { + implementsZarazConfigReplaceResponseTool() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTool)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigReplaceResponseTool)(nil)).Elem(), "") } -type ZarazConfigGetResponseToolsZarazManagedComponent struct { +type ZarazConfigReplaceResponseToolsZarazManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazConfigGetResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -1618,21 +1612,21 @@ type ZarazConfigGetResponseToolsZarazManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazConfigGetResponseToolsZarazManagedComponentSetting `json:"settings,required"` - Type ZarazConfigGetResponseToolsZarazManagedComponentType `json:"type,required"` + Settings map[string]ZarazConfigReplaceResponseToolsZarazManagedComponentSetting `json:"settings,required"` + Type ZarazConfigReplaceResponseToolsZarazManagedComponentType `json:"type,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazConfigGetResponseToolsZarazManagedComponentAction `json:"actions"` + Actions map[string]ZarazConfigReplaceResponseToolsZarazManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazConfigGetResponseToolsZarazManagedComponentJSON `json:"-"` + NeoEvents []ZarazConfigReplaceResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazConfigReplaceResponseToolsZarazManagedComponentJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazManagedComponentJSON contains the JSON metadata -// for the struct [ZarazConfigGetResponseToolsZarazManagedComponent] -type zarazConfigGetResponseToolsZarazManagedComponentJSON struct { +// zarazConfigReplaceResponseToolsZarazManagedComponentJSON contains the JSON +// metadata for the struct [ZarazConfigReplaceResponseToolsZarazManagedComponent] +type zarazConfigReplaceResponseToolsZarazManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -1648,20 +1642,21 @@ type zarazConfigGetResponseToolsZarazManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseToolsZarazManagedComponent) implementsZarazConfigGetResponseTool() {} +func (r ZarazConfigReplaceResponseToolsZarazManagedComponent) implementsZarazConfigReplaceResponseTool() { +} // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigGetResponseToolsZarazManagedComponentDefaultField interface { - ImplementsZarazConfigGetResponseToolsZarazManagedComponentDefaultField() +type ZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField interface { + ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigGetResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigReplaceResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -1679,13 +1674,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigGetResponseToolsZarazManagedComponentSetting interface { - ImplementsZarazConfigGetResponseToolsZarazManagedComponentSetting() +type ZarazConfigReplaceResponseToolsZarazManagedComponentSetting interface { + ImplementsZarazConfigReplaceResponseToolsZarazManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigGetResponseToolsZarazManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigReplaceResponseToolsZarazManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -1702,13 +1697,13 @@ func init() { ) } -type ZarazConfigGetResponseToolsZarazManagedComponentType string +type ZarazConfigReplaceResponseToolsZarazManagedComponentType string const ( - ZarazConfigGetResponseToolsZarazManagedComponentTypeComponent ZarazConfigGetResponseToolsZarazManagedComponentType = "component" + ZarazConfigReplaceResponseToolsZarazManagedComponentTypeComponent ZarazConfigReplaceResponseToolsZarazManagedComponentType = "component" ) -type ZarazConfigGetResponseToolsZarazManagedComponentAction struct { +type ZarazConfigReplaceResponseToolsZarazManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -1716,13 +1711,14 @@ type ZarazConfigGetResponseToolsZarazManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigGetResponseToolsZarazManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigReplaceResponseToolsZarazManagedComponentActionJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazManagedComponentActionJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseToolsZarazManagedComponentAction] -type zarazConfigGetResponseToolsZarazManagedComponentActionJSON struct { +// zarazConfigReplaceResponseToolsZarazManagedComponentActionJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazManagedComponentAction] +type zarazConfigReplaceResponseToolsZarazManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -1731,11 +1727,11 @@ type zarazConfigGetResponseToolsZarazManagedComponentActionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent struct { +type ZarazConfigReplaceResponseToolsZarazManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -1743,14 +1739,14 @@ type ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigReplaceResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON contains the JSON -// metadata for the struct -// [ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent] -type zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON struct { +// zarazConfigReplaceResponseToolsZarazManagedComponentNeoEventJSON contains the +// JSON metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazManagedComponentNeoEvent] +type zarazConfigReplaceResponseToolsZarazManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -1759,17 +1755,17 @@ type zarazConfigGetResponseToolsZarazManagedComponentNeoEventJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseToolsZarazCustomManagedComponent struct { +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -1777,23 +1773,24 @@ type ZarazConfigGetResponseToolsZarazCustomManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` - Type ZarazConfigGetResponseToolsZarazCustomManagedComponentType `json:"type,required"` + Settings map[string]ZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` + Type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentType `json:"type,required"` // Cloudflare worker that acts as a managed component - Worker ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` + Worker ZarazConfigReplaceResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazConfigGetResponseToolsZarazCustomManagedComponentAction `json:"actions"` + Actions map[string]ZarazConfigReplaceResponseToolsZarazCustomManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazConfigGetResponseToolsZarazCustomManagedComponentJSON `json:"-"` + NeoEvents []ZarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazConfigReplaceResponseToolsZarazCustomManagedComponentJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazCustomManagedComponentJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseToolsZarazCustomManagedComponent] -type zarazConfigGetResponseToolsZarazCustomManagedComponentJSON struct { +// zarazConfigReplaceResponseToolsZarazCustomManagedComponentJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazCustomManagedComponent] +type zarazConfigReplaceResponseToolsZarazCustomManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -1810,21 +1807,21 @@ type zarazConfigGetResponseToolsZarazCustomManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseToolsZarazCustomManagedComponent) implementsZarazConfigGetResponseTool() { +func (r ZarazConfigReplaceResponseToolsZarazCustomManagedComponent) implementsZarazConfigReplaceResponseTool() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField interface { - ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField() +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField interface { + ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigGetResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigReplaceResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -1842,13 +1839,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting interface { - ImplementsZarazConfigGetResponseToolsZarazCustomManagedComponentSetting() +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting interface { + ImplementsZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazConfigGetResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazConfigReplaceResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -1865,34 +1862,34 @@ func init() { ) } -type ZarazConfigGetResponseToolsZarazCustomManagedComponentType string +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentType string const ( - ZarazConfigGetResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigGetResponseToolsZarazCustomManagedComponentType = "custom-mc" + ZarazConfigReplaceResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigReplaceResponseToolsZarazCustomManagedComponentType = "custom-mc" ) // Cloudflare worker that acts as a managed component -type ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentWorker struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazConfigReplaceResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker] -type zarazConfigGetResponseToolsZarazCustomManagedComponentWorkerJSON struct { +// zarazConfigReplaceResponseToolsZarazCustomManagedComponentWorkerJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazCustomManagedComponentWorker] +type zarazConfigReplaceResponseToolsZarazCustomManagedComponentWorkerJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseToolsZarazCustomManagedComponentAction struct { +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -1900,14 +1897,14 @@ type ZarazConfigGetResponseToolsZarazCustomManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigReplaceResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseToolsZarazCustomManagedComponentAction] -type zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON struct { +// zarazConfigReplaceResponseToolsZarazCustomManagedComponentActionJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazCustomManagedComponentAction] +type zarazConfigReplaceResponseToolsZarazCustomManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -1916,11 +1913,11 @@ type zarazConfigGetResponseToolsZarazCustomManagedComponentActionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent struct { +type ZarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -1928,14 +1925,14 @@ type ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` } -// zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent] -type zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON struct { +// zarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEvent] +type zarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -1944,26 +1941,26 @@ type zarazConfigGetResponseToolsZarazCustomManagedComponentNeoEventJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTrigger struct { +type ZarazConfigReplaceResponseTrigger struct { // Rules defining when the trigger is not fired. - ExcludeRules []ZarazConfigGetResponseTriggersExcludeRule `json:"excludeRules,required"` + ExcludeRules []ZarazConfigReplaceResponseTriggersExcludeRule `json:"excludeRules,required"` // Rules defining when the trigger is fired. - LoadRules []ZarazConfigGetResponseTriggersLoadRule `json:"loadRules,required"` + LoadRules []ZarazConfigReplaceResponseTriggersLoadRule `json:"loadRules,required"` // Trigger name. Name string `json:"name,required"` // Trigger description. - Description string `json:"description"` - System ZarazConfigGetResponseTriggersSystem `json:"system"` - JSON zarazConfigGetResponseTriggerJSON `json:"-"` + Description string `json:"description"` + System ZarazConfigReplaceResponseTriggersSystem `json:"system"` + JSON zarazConfigReplaceResponseTriggerJSON `json:"-"` } -// zarazConfigGetResponseTriggerJSON contains the JSON metadata for the struct -// [ZarazConfigGetResponseTrigger] -type zarazConfigGetResponseTriggerJSON struct { +// zarazConfigReplaceResponseTriggerJSON contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTrigger] +type zarazConfigReplaceResponseTriggerJSON struct { ExcludeRules apijson.Field LoadRules apijson.Field Name apijson.Field @@ -1973,37 +1970,38 @@ type zarazConfigGetResponseTriggerJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTrigger) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTrigger) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule], -// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule], -// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule], -// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule], -// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule], -// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule] or -// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule]. -type ZarazConfigGetResponseTriggersExcludeRule interface { - implementsZarazConfigGetResponseTriggersExcludeRule() +// Union satisfied by +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRule], +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRule], +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRule], +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule], +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRule], +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRule] or +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule]. +type ZarazConfigReplaceResponseTriggersExcludeRule interface { + implementsZarazConfigReplaceResponseTriggersExcludeRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTriggersExcludeRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigReplaceResponseTriggersExcludeRule)(nil)).Elem(), "") } -type ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON contains the JSON -// metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -2012,39 +2010,39 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigGetResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2052,30 +2050,30 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -2083,28 +2081,28 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSO ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigGetResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON contains the JSON -// metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON contains the +// JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2112,50 +2110,50 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2163,50 +2161,50 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2214,50 +2212,50 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { +// zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2265,48 +2263,48 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule] -type zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2314,63 +2312,64 @@ type zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON st ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigGetResponseTriggersExcludeRule() { +func (r ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigReplaceResponseTriggersExcludeRule() { } -type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON +// zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] -type zarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] +type zarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule], -// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule], -// [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule], -// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule], -// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule], -// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule] or -// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule]. -type ZarazConfigGetResponseTriggersLoadRule interface { - implementsZarazConfigGetResponseTriggersLoadRule() +// Union satisfied by [ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRule], +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRule], +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRule], +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRule], +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRule], +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRule] or +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRule]. +type ZarazConfigReplaceResponseTriggersLoadRule interface { + implementsZarazConfigReplaceResponseTriggersLoadRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseTriggersLoadRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigReplaceResponseTriggersLoadRule)(nil)).Elem(), "") } -type ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule] -type zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -2379,39 +2378,39 @@ type zarazConfigGetResponseTriggersLoadRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazLoadRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigGetResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule] -type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2419,30 +2418,30 @@ type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON +// zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -2450,27 +2449,28 @@ type zarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON s ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigGetResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule] -type zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2478,50 +2478,50 @@ type zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazTimerRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleAction = "timer" + ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule] -type zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2529,50 +2529,50 @@ type zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON +// zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` -} - -// zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains the -// JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule] -type zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { +type ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` +} + +// zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains +// the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2580,50 +2580,50 @@ type zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON +// zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains the +// zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains the // JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule] -type zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2631,48 +2631,48 @@ type zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON contains -// the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule] -type zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { +// zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON +// contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRule] +type zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -2680,63 +2680,63 @@ type zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigGetResponseTriggersLoadRule() { +func (r ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigReplaceResponseTriggersLoadRule() { } -type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction string +type ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON +// zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] -type zarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] +type zarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseTriggersSystem string +type ZarazConfigReplaceResponseTriggersSystem string const ( - ZarazConfigGetResponseTriggersSystemPageload ZarazConfigGetResponseTriggersSystem = "pageload" + ZarazConfigReplaceResponseTriggersSystemPageload ZarazConfigReplaceResponseTriggersSystem = "pageload" ) -// Union satisfied by [ZarazConfigGetResponseVariablesObject] or -// [ZarazConfigGetResponseVariablesObject]. -type ZarazConfigGetResponseVariable interface { - implementsZarazConfigGetResponseVariable() +// Union satisfied by [ZarazConfigReplaceResponseVariablesObject] or +// [ZarazConfigReplaceResponseVariablesObject]. +type ZarazConfigReplaceResponseVariable interface { + implementsZarazConfigReplaceResponseVariable() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigGetResponseVariable)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazConfigReplaceResponseVariable)(nil)).Elem(), "") } -type ZarazConfigGetResponseVariablesObject struct { - Name string `json:"name,required"` - Type ZarazConfigGetResponseVariablesObjectType `json:"type,required"` - Value string `json:"value,required"` - JSON zarazConfigGetResponseVariablesObjectJSON `json:"-"` +type ZarazConfigReplaceResponseVariablesObject struct { + Name string `json:"name,required"` + Type ZarazConfigReplaceResponseVariablesObjectType `json:"type,required"` + Value string `json:"value,required"` + JSON zarazConfigReplaceResponseVariablesObjectJSON `json:"-"` } -// zarazConfigGetResponseVariablesObjectJSON contains the JSON metadata for the -// struct [ZarazConfigGetResponseVariablesObject] -type zarazConfigGetResponseVariablesObjectJSON struct { +// zarazConfigReplaceResponseVariablesObjectJSON contains the JSON metadata for the +// struct [ZarazConfigReplaceResponseVariablesObject] +type zarazConfigReplaceResponseVariablesObjectJSON struct { Name apijson.Field Type apijson.Field Value apijson.Field @@ -2744,27 +2744,27 @@ type zarazConfigGetResponseVariablesObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazConfigGetResponseVariablesObject) implementsZarazConfigGetResponseVariable() {} +func (r ZarazConfigReplaceResponseVariablesObject) implementsZarazConfigReplaceResponseVariable() {} -type ZarazConfigGetResponseVariablesObjectType string +type ZarazConfigReplaceResponseVariablesObjectType string const ( - ZarazConfigGetResponseVariablesObjectTypeString ZarazConfigGetResponseVariablesObjectType = "string" - ZarazConfigGetResponseVariablesObjectTypeSecret ZarazConfigGetResponseVariablesObjectType = "secret" + ZarazConfigReplaceResponseVariablesObjectTypeString ZarazConfigReplaceResponseVariablesObjectType = "string" + ZarazConfigReplaceResponseVariablesObjectTypeSecret ZarazConfigReplaceResponseVariablesObjectType = "secret" ) // Consent management configuration. -type ZarazConfigGetResponseConsent struct { - Enabled bool `json:"enabled,required"` - ButtonTextTranslations ZarazConfigGetResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` - CompanyEmail string `json:"companyEmail"` - CompanyName string `json:"companyName"` - CompanyStreetAddress string `json:"companyStreetAddress"` - ConsentModalIntroHTML string `json:"consentModalIntroHTML"` +type ZarazConfigReplaceResponseConsent struct { + Enabled bool `json:"enabled,required"` + ButtonTextTranslations ZarazConfigReplaceResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` + CompanyEmail string `json:"companyEmail"` + CompanyName string `json:"companyName"` + CompanyStreetAddress string `json:"companyStreetAddress"` + ConsentModalIntroHTML string `json:"consentModalIntroHTML"` // Object where keys are language codes ConsentModalIntroHTMLWithTranslations map[string]string `json:"consentModalIntroHTMLWithTranslations"` CookieName string `json:"cookieName"` @@ -2773,15 +2773,15 @@ type ZarazConfigGetResponseConsent struct { DefaultLanguage string `json:"defaultLanguage"` HideModal bool `json:"hideModal"` // Object where keys are purpose alpha-numeric IDs - Purposes map[string]ZarazConfigGetResponseConsentPurpose `json:"purposes"` + Purposes map[string]ZarazConfigReplaceResponseConsentPurpose `json:"purposes"` // Object where keys are purpose alpha-numeric IDs - PurposesWithTranslations map[string]ZarazConfigGetResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` - JSON zarazConfigGetResponseConsentJSON `json:"-"` + PurposesWithTranslations map[string]ZarazConfigReplaceResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` + JSON zarazConfigReplaceResponseConsentJSON `json:"-"` } -// zarazConfigGetResponseConsentJSON contains the JSON metadata for the struct -// [ZarazConfigGetResponseConsent] -type zarazConfigGetResponseConsentJSON struct { +// zarazConfigReplaceResponseConsentJSON contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseConsent] +type zarazConfigReplaceResponseConsentJSON struct { Enabled apijson.Field ButtonTextTranslations apijson.Field CompanyEmail apijson.Field @@ -2800,23 +2800,24 @@ type zarazConfigGetResponseConsentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseConsent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseConsent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseConsentButtonTextTranslations struct { +type ZarazConfigReplaceResponseConsentButtonTextTranslations struct { // Object where keys are language codes AcceptAll map[string]string `json:"accept_all,required"` // Object where keys are language codes ConfirmMyChoices map[string]string `json:"confirm_my_choices,required"` // Object where keys are language codes - RejectAll map[string]string `json:"reject_all,required"` - JSON zarazConfigGetResponseConsentButtonTextTranslationsJSON `json:"-"` + RejectAll map[string]string `json:"reject_all,required"` + JSON zarazConfigReplaceResponseConsentButtonTextTranslationsJSON `json:"-"` } -// zarazConfigGetResponseConsentButtonTextTranslationsJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseConsentButtonTextTranslations] -type zarazConfigGetResponseConsentButtonTextTranslationsJSON struct { +// zarazConfigReplaceResponseConsentButtonTextTranslationsJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseConsentButtonTextTranslations] +type zarazConfigReplaceResponseConsentButtonTextTranslationsJSON struct { AcceptAll apijson.Field ConfirmMyChoices apijson.Field RejectAll apijson.Field @@ -2824,41 +2825,42 @@ type zarazConfigGetResponseConsentButtonTextTranslationsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseConsentPurpose struct { - Description string `json:"description,required"` - Name string `json:"name,required"` - JSON zarazConfigGetResponseConsentPurposeJSON `json:"-"` +type ZarazConfigReplaceResponseConsentPurpose struct { + Description string `json:"description,required"` + Name string `json:"name,required"` + JSON zarazConfigReplaceResponseConsentPurposeJSON `json:"-"` } -// zarazConfigGetResponseConsentPurposeJSON contains the JSON metadata for the -// struct [ZarazConfigGetResponseConsentPurpose] -type zarazConfigGetResponseConsentPurposeJSON struct { +// zarazConfigReplaceResponseConsentPurposeJSON contains the JSON metadata for the +// struct [ZarazConfigReplaceResponseConsentPurpose] +type zarazConfigReplaceResponseConsentPurposeJSON struct { Description apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseConsentPurposesWithTranslation struct { +type ZarazConfigReplaceResponseConsentPurposesWithTranslation struct { // Object where keys are language codes Description map[string]string `json:"description,required"` // Object where keys are language codes - Name map[string]string `json:"name,required"` - Order int64 `json:"order,required"` - JSON zarazConfigGetResponseConsentPurposesWithTranslationJSON `json:"-"` + Name map[string]string `json:"name,required"` + Order int64 `json:"order,required"` + JSON zarazConfigReplaceResponseConsentPurposesWithTranslationJSON `json:"-"` } -// zarazConfigGetResponseConsentPurposesWithTranslationJSON contains the JSON -// metadata for the struct [ZarazConfigGetResponseConsentPurposesWithTranslation] -type zarazConfigGetResponseConsentPurposesWithTranslationJSON struct { +// zarazConfigReplaceResponseConsentPurposesWithTranslationJSON contains the JSON +// metadata for the struct +// [ZarazConfigReplaceResponseConsentPurposesWithTranslation] +type zarazConfigReplaceResponseConsentPurposesWithTranslationJSON struct { Description apijson.Field Name apijson.Field Order apijson.Field @@ -2866,45 +2868,108 @@ type zarazConfigGetResponseConsentPurposesWithTranslationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ZarazConfigGetResponseEnvelope struct { + Errors []ZarazConfigGetResponseEnvelopeErrors `json:"errors,required"` + Messages []ZarazConfigGetResponseEnvelopeMessages `json:"messages,required"` + // Zaraz configuration + Result ZarazConfigGetResponse `json:"result,required"` + // Whether the API call was successful + Success bool `json:"success,required"` + JSON zarazConfigGetResponseEnvelopeJSON `json:"-"` +} + +// zarazConfigGetResponseEnvelopeJSON contains the JSON metadata for the struct +// [ZarazConfigGetResponseEnvelope] +type zarazConfigGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ZarazConfigGetResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazConfigGetResponseEnvelopeErrorsJSON `json:"-"` +} + +// zarazConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ZarazConfigGetResponseEnvelopeErrors] +type zarazConfigGetResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ZarazConfigGetResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazConfigGetResponseEnvelopeMessagesJSON `json:"-"` +} + +// zarazConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ZarazConfigGetResponseEnvelopeMessages] +type zarazConfigGetResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigUpdateParams struct { +type ZarazConfigReplaceParams struct { // Data layer compatibility mode enabled. DataLayer param.Field[bool] `json:"dataLayer,required"` // The key for Zaraz debug mode. DebugKey param.Field[string] `json:"debugKey,required"` // General Zaraz settings. - Settings param.Field[ZarazConfigUpdateParamsSettings] `json:"settings,required"` + Settings param.Field[ZarazConfigReplaceParamsSettings] `json:"settings,required"` // Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID // and value is the tool configuration object. - Tools param.Field[map[string]ZarazConfigUpdateParamsTools] `json:"tools,required"` + Tools param.Field[map[string]ZarazConfigReplaceParamsTools] `json:"tools,required"` // Triggers set up under Zaraz configuration, where key is the trigger // alpha-numeric ID and value is the trigger configuration. - Triggers param.Field[map[string]ZarazConfigUpdateParamsTriggers] `json:"triggers,required"` + Triggers param.Field[map[string]ZarazConfigReplaceParamsTriggers] `json:"triggers,required"` // Variables set up under Zaraz configuration, where key is the variable // alpha-numeric ID and value is the variable configuration. Values of variables of // type secret are not included. - Variables param.Field[map[string]ZarazConfigUpdateParamsVariables] `json:"variables,required"` + Variables param.Field[map[string]ZarazConfigReplaceParamsVariables] `json:"variables,required"` // Zaraz internal version of the config. ZarazVersion param.Field[int64] `json:"zarazVersion,required"` // Consent management configuration. - Consent param.Field[ZarazConfigUpdateParamsConsent] `json:"consent"` + Consent param.Field[ZarazConfigReplaceParamsConsent] `json:"consent"` // Single Page Application support enabled. HistoryChange param.Field[bool] `json:"historyChange"` } -func (r ZarazConfigUpdateParams) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // General Zaraz settings. -type ZarazConfigUpdateParamsSettings struct { +type ZarazConfigReplaceParamsSettings struct { // Automatic injection of Zaraz scripts enabled. AutoInjectScript param.Field[bool] `json:"autoInjectScript,required"` // Details of the worker that receives and edits Zaraz Context object. - ContextEnricher param.Field[ZarazConfigUpdateParamsSettingsContextEnricher] `json:"contextEnricher"` + ContextEnricher param.Field[ZarazConfigReplaceParamsSettingsContextEnricher] `json:"contextEnricher"` // The domain Zaraz will use for writing and reading its cookies. CookieDomain param.Field[string] `json:"cookieDomain"` // Ecommerce API enabled. @@ -2931,32 +2996,32 @@ type ZarazConfigUpdateParamsSettings struct { TrackPath param.Field[string] `json:"trackPath"` } -func (r ZarazConfigUpdateParamsSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } // Details of the worker that receives and edits Zaraz Context object. -type ZarazConfigUpdateParamsSettingsContextEnricher struct { +type ZarazConfigReplaceParamsSettingsContextEnricher struct { EscapedWorkerName param.Field[string] `json:"escapedWorkerName,required"` WorkerTag param.Field[string] `json:"workerTag,required"` } -func (r ZarazConfigUpdateParamsSettingsContextEnricher) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsSettingsContextEnricher) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Satisfied by [ZarazConfigUpdateParamsToolsZarazLegacyTool], -// [ZarazConfigUpdateParamsToolsZarazManagedComponent], -// [ZarazConfigUpdateParamsToolsZarazCustomManagedComponent]. -type ZarazConfigUpdateParamsTools interface { - implementsZarazConfigUpdateParamsTools() +// Satisfied by [ZarazConfigReplaceParamsToolsZarazLegacyTool], +// [ZarazConfigReplaceParamsToolsZarazManagedComponent], +// [ZarazConfigReplaceParamsToolsZarazCustomManagedComponent]. +type ZarazConfigReplaceParamsTools interface { + implementsZarazConfigReplaceParamsTools() } -type ZarazConfigUpdateParamsToolsZarazLegacyTool struct { +type ZarazConfigReplaceParamsToolsZarazLegacyTool struct { // List of blocking trigger IDs BlockingTriggers param.Field[[]string] `json:"blockingTriggers,required"` // Default fields for tool's actions - DefaultFields param.Field[map[string]ZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields] `json:"defaultFields,required"` + DefaultFields param.Field[map[string]ZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields] `json:"defaultFields,required"` // Whether tool is enabled Enabled param.Field[bool] `json:"enabled,required"` // Tool's internal name @@ -2964,24 +3029,24 @@ type ZarazConfigUpdateParamsToolsZarazLegacyTool struct { // Tool's name defined by the user Name param.Field[string] `json:"name,required"` // List of actions configured on a tool - NeoEvents param.Field[[]ZarazConfigUpdateParamsToolsZarazLegacyToolNeoEvent] `json:"neoEvents,required"` - Type param.Field[ZarazConfigUpdateParamsToolsZarazLegacyToolType] `json:"type,required"` + NeoEvents param.Field[[]ZarazConfigReplaceParamsToolsZarazLegacyToolNeoEvent] `json:"neoEvents,required"` + Type param.Field[ZarazConfigReplaceParamsToolsZarazLegacyToolType] `json:"type,required"` // Default consent purpose ID DefaultPurpose param.Field[string] `json:"defaultPurpose"` } -func (r ZarazConfigUpdateParamsToolsZarazLegacyTool) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazLegacyTool) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsToolsZarazLegacyTool) implementsZarazConfigUpdateParamsTools() {} +func (r ZarazConfigReplaceParamsToolsZarazLegacyTool) implementsZarazConfigReplaceParamsTools() {} // Satisfied by [shared.UnionString], [shared.UnionBool]. -type ZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields interface { - ImplementsZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields() +type ZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields interface { + ImplementsZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields() } -type ZarazConfigUpdateParamsToolsZarazLegacyToolNeoEvent struct { +type ZarazConfigReplaceParamsToolsZarazLegacyToolNeoEvent struct { // List of blocking triggers IDs BlockingTriggers param.Field[[]string] `json:"blockingTriggers,required"` // Event payload @@ -2990,23 +3055,23 @@ type ZarazConfigUpdateParamsToolsZarazLegacyToolNeoEvent struct { FiringTriggers param.Field[[]string] `json:"firingTriggers,required"` } -func (r ZarazConfigUpdateParamsToolsZarazLegacyToolNeoEvent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazLegacyToolNeoEvent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsToolsZarazLegacyToolType string +type ZarazConfigReplaceParamsToolsZarazLegacyToolType string const ( - ZarazConfigUpdateParamsToolsZarazLegacyToolTypeLibrary ZarazConfigUpdateParamsToolsZarazLegacyToolType = "library" + ZarazConfigReplaceParamsToolsZarazLegacyToolTypeLibrary ZarazConfigReplaceParamsToolsZarazLegacyToolType = "library" ) -type ZarazConfigUpdateParamsToolsZarazManagedComponent struct { +type ZarazConfigReplaceParamsToolsZarazManagedComponent struct { // List of blocking trigger IDs BlockingTriggers param.Field[[]string] `json:"blockingTriggers,required"` // Tool's internal name Component param.Field[string] `json:"component,required"` // Default fields for tool's actions - DefaultFields param.Field[map[string]ZarazConfigUpdateParamsToolsZarazManagedComponentDefaultFields] `json:"defaultFields,required"` + DefaultFields param.Field[map[string]ZarazConfigReplaceParamsToolsZarazManagedComponentDefaultFields] `json:"defaultFields,required"` // Whether tool is enabled Enabled param.Field[bool] `json:"enabled,required"` // Tool's name defined by the user @@ -3014,40 +3079,41 @@ type ZarazConfigUpdateParamsToolsZarazManagedComponent struct { // List of permissions granted to the component Permissions param.Field[[]string] `json:"permissions,required"` // Tool's settings - Settings param.Field[map[string]ZarazConfigUpdateParamsToolsZarazManagedComponentSettings] `json:"settings,required"` - Type param.Field[ZarazConfigUpdateParamsToolsZarazManagedComponentType] `json:"type,required"` + Settings param.Field[map[string]ZarazConfigReplaceParamsToolsZarazManagedComponentSettings] `json:"settings,required"` + Type param.Field[ZarazConfigReplaceParamsToolsZarazManagedComponentType] `json:"type,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions param.Field[map[string]ZarazConfigUpdateParamsToolsZarazManagedComponentActions] `json:"actions"` + Actions param.Field[map[string]ZarazConfigReplaceParamsToolsZarazManagedComponentActions] `json:"actions"` // Default consent purpose ID DefaultPurpose param.Field[string] `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents param.Field[[]ZarazConfigUpdateParamsToolsZarazManagedComponentNeoEvent] `json:"neoEvents"` + NeoEvents param.Field[[]ZarazConfigReplaceParamsToolsZarazManagedComponentNeoEvent] `json:"neoEvents"` } -func (r ZarazConfigUpdateParamsToolsZarazManagedComponent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazManagedComponent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsToolsZarazManagedComponent) implementsZarazConfigUpdateParamsTools() {} +func (r ZarazConfigReplaceParamsToolsZarazManagedComponent) implementsZarazConfigReplaceParamsTools() { +} // Satisfied by [shared.UnionString], [shared.UnionBool]. -type ZarazConfigUpdateParamsToolsZarazManagedComponentDefaultFields interface { - ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentDefaultFields() +type ZarazConfigReplaceParamsToolsZarazManagedComponentDefaultFields interface { + ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentDefaultFields() } // Satisfied by [shared.UnionString], [shared.UnionBool]. -type ZarazConfigUpdateParamsToolsZarazManagedComponentSettings interface { - ImplementsZarazConfigUpdateParamsToolsZarazManagedComponentSettings() +type ZarazConfigReplaceParamsToolsZarazManagedComponentSettings interface { + ImplementsZarazConfigReplaceParamsToolsZarazManagedComponentSettings() } -type ZarazConfigUpdateParamsToolsZarazManagedComponentType string +type ZarazConfigReplaceParamsToolsZarazManagedComponentType string const ( - ZarazConfigUpdateParamsToolsZarazManagedComponentTypeComponent ZarazConfigUpdateParamsToolsZarazManagedComponentType = "component" + ZarazConfigReplaceParamsToolsZarazManagedComponentTypeComponent ZarazConfigReplaceParamsToolsZarazManagedComponentType = "component" ) -type ZarazConfigUpdateParamsToolsZarazManagedComponentActions struct { +type ZarazConfigReplaceParamsToolsZarazManagedComponentActions struct { // Tool event type ActionType param.Field[string] `json:"actionType,required"` // List of blocking triggers IDs @@ -3058,11 +3124,11 @@ type ZarazConfigUpdateParamsToolsZarazManagedComponentActions struct { FiringTriggers param.Field[[]string] `json:"firingTriggers,required"` } -func (r ZarazConfigUpdateParamsToolsZarazManagedComponentActions) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazManagedComponentActions) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsToolsZarazManagedComponentNeoEvent struct { +type ZarazConfigReplaceParamsToolsZarazManagedComponentNeoEvent struct { // Tool event type ActionType param.Field[string] `json:"actionType,required"` // List of blocking triggers IDs @@ -3073,17 +3139,17 @@ type ZarazConfigUpdateParamsToolsZarazManagedComponentNeoEvent struct { FiringTriggers param.Field[[]string] `json:"firingTriggers,required"` } -func (r ZarazConfigUpdateParamsToolsZarazManagedComponentNeoEvent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazManagedComponentNeoEvent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponent struct { +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponent struct { // List of blocking trigger IDs BlockingTriggers param.Field[[]string] `json:"blockingTriggers,required"` // Tool's internal name Component param.Field[string] `json:"component,required"` // Default fields for tool's actions - DefaultFields param.Field[map[string]ZarazConfigUpdateParamsToolsZarazCustomManagedComponentDefaultFields] `json:"defaultFields,required"` + DefaultFields param.Field[map[string]ZarazConfigReplaceParamsToolsZarazCustomManagedComponentDefaultFields] `json:"defaultFields,required"` // Whether tool is enabled Enabled param.Field[bool] `json:"enabled,required"` // Tool's name defined by the user @@ -3091,53 +3157,53 @@ type ZarazConfigUpdateParamsToolsZarazCustomManagedComponent struct { // List of permissions granted to the component Permissions param.Field[[]string] `json:"permissions,required"` // Tool's settings - Settings param.Field[map[string]ZarazConfigUpdateParamsToolsZarazCustomManagedComponentSettings] `json:"settings,required"` - Type param.Field[ZarazConfigUpdateParamsToolsZarazCustomManagedComponentType] `json:"type,required"` + Settings param.Field[map[string]ZarazConfigReplaceParamsToolsZarazCustomManagedComponentSettings] `json:"settings,required"` + Type param.Field[ZarazConfigReplaceParamsToolsZarazCustomManagedComponentType] `json:"type,required"` // Cloudflare worker that acts as a managed component - Worker param.Field[ZarazConfigUpdateParamsToolsZarazCustomManagedComponentWorker] `json:"worker,required"` + Worker param.Field[ZarazConfigReplaceParamsToolsZarazCustomManagedComponentWorker] `json:"worker,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions param.Field[map[string]ZarazConfigUpdateParamsToolsZarazCustomManagedComponentActions] `json:"actions"` + Actions param.Field[map[string]ZarazConfigReplaceParamsToolsZarazCustomManagedComponentActions] `json:"actions"` // Default consent purpose ID DefaultPurpose param.Field[string] `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents param.Field[[]ZarazConfigUpdateParamsToolsZarazCustomManagedComponentNeoEvent] `json:"neoEvents"` + NeoEvents param.Field[[]ZarazConfigReplaceParamsToolsZarazCustomManagedComponentNeoEvent] `json:"neoEvents"` } -func (r ZarazConfigUpdateParamsToolsZarazCustomManagedComponent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazCustomManagedComponent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsToolsZarazCustomManagedComponent) implementsZarazConfigUpdateParamsTools() { +func (r ZarazConfigReplaceParamsToolsZarazCustomManagedComponent) implementsZarazConfigReplaceParamsTools() { } // Satisfied by [shared.UnionString], [shared.UnionBool]. -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentDefaultFields interface { - ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentDefaultFields() +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentDefaultFields interface { + ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentDefaultFields() } // Satisfied by [shared.UnionString], [shared.UnionBool]. -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentSettings interface { - ImplementsZarazConfigUpdateParamsToolsZarazCustomManagedComponentSettings() +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentSettings interface { + ImplementsZarazConfigReplaceParamsToolsZarazCustomManagedComponentSettings() } -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentType string +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentType string const ( - ZarazConfigUpdateParamsToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigUpdateParamsToolsZarazCustomManagedComponentType = "custom-mc" + ZarazConfigReplaceParamsToolsZarazCustomManagedComponentTypeCustomMc ZarazConfigReplaceParamsToolsZarazCustomManagedComponentType = "custom-mc" ) // Cloudflare worker that acts as a managed component -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentWorker struct { +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentWorker struct { EscapedWorkerName param.Field[string] `json:"escapedWorkerName,required"` WorkerTag param.Field[string] `json:"workerTag,required"` } -func (r ZarazConfigUpdateParamsToolsZarazCustomManagedComponentWorker) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazCustomManagedComponentWorker) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentActions struct { +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentActions struct { // Tool event type ActionType param.Field[string] `json:"actionType,required"` // List of blocking triggers IDs @@ -3148,11 +3214,11 @@ type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentActions struct { FiringTriggers param.Field[[]string] `json:"firingTriggers,required"` } -func (r ZarazConfigUpdateParamsToolsZarazCustomManagedComponentActions) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazCustomManagedComponentActions) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentNeoEvent struct { +type ZarazConfigReplaceParamsToolsZarazCustomManagedComponentNeoEvent struct { // Tool event type ActionType param.Field[string] `json:"actionType,required"` // List of blocking triggers IDs @@ -3163,493 +3229,493 @@ type ZarazConfigUpdateParamsToolsZarazCustomManagedComponentNeoEvent struct { FiringTriggers param.Field[[]string] `json:"firingTriggers,required"` } -func (r ZarazConfigUpdateParamsToolsZarazCustomManagedComponentNeoEvent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsToolsZarazCustomManagedComponentNeoEvent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggers struct { +type ZarazConfigReplaceParamsTriggers struct { // Rules defining when the trigger is not fired. - ExcludeRules param.Field[[]ZarazConfigUpdateParamsTriggersExcludeRule] `json:"excludeRules,required"` + ExcludeRules param.Field[[]ZarazConfigReplaceParamsTriggersExcludeRule] `json:"excludeRules,required"` // Rules defining when the trigger is fired. - LoadRules param.Field[[]ZarazConfigUpdateParamsTriggersLoadRule] `json:"loadRules,required"` + LoadRules param.Field[[]ZarazConfigReplaceParamsTriggersLoadRule] `json:"loadRules,required"` // Trigger name. Name param.Field[string] `json:"name,required"` // Trigger description. - Description param.Field[string] `json:"description"` - System param.Field[ZarazConfigUpdateParamsTriggersSystem] `json:"system"` + Description param.Field[string] `json:"description"` + System param.Field[ZarazConfigReplaceParamsTriggersSystem] `json:"system"` } -func (r ZarazConfigUpdateParamsTriggers) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggers) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Satisfied by [ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRule], -// [ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRule]. -type ZarazConfigUpdateParamsTriggersExcludeRule interface { - implementsZarazConfigUpdateParamsTriggersExcludeRule() +// Satisfied by [ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRule], +// [ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRule]. +type ZarazConfigReplaceParamsTriggersExcludeRule interface { + implementsZarazConfigReplaceParamsTriggersExcludeRule() } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule struct { - ID param.Field[string] `json:"id,required"` - Match param.Field[string] `json:"match,required"` - Op param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp] `json:"op,required"` - Value param.Field[string] `json:"value,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule struct { + ID param.Field[string] `json:"id,required"` + Match param.Field[string] `json:"match,required"` + Op param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp] `json:"op,required"` + Value param.Field[string] `json:"value,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpContains ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpEquals ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettings struct { - Selector param.Field[string] `json:"selector,required"` - Type param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType] `json:"type,required"` - WaitForTags param.Field[int64] `json:"waitForTags,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettings struct { + Selector param.Field[string] `json:"selector,required"` + Type param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType] `json:"type,required"` + WaitForTags param.Field[int64] `json:"waitForTags,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigUpdateParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigReplaceParamsTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleAction = "timer" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleActionTimer ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleSettings struct { +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleSettings struct { Interval param.Field[int64] `json:"interval,required"` Limit param.Field[int64] `json:"limit,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazTimerRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazTimerRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { Selector param.Field[string] `json:"selector,required"` Validate param.Field[bool] `json:"validate,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazFormSubmissionRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleSettings struct { +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleSettings struct { Match param.Field[string] `json:"match,required"` Variable param.Field[string] `json:"variable,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazVariableMatchRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazVariableMatchRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleSettings struct { +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleSettings struct { Positions param.Field[string] `json:"positions,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazScrollDepthRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazScrollDepthRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigUpdateParamsTriggersExcludeRule() { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazConfigReplaceParamsTriggersExcludeRule() { } -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleAction string +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { +type ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { Selector param.Field[string] `json:"selector,required"` } -func (r ZarazConfigUpdateParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersExcludeRulesZarazElementVisibilityRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -// Satisfied by [ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRule], -// [ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRule]. -type ZarazConfigUpdateParamsTriggersLoadRule interface { - implementsZarazConfigUpdateParamsTriggersLoadRule() +// Satisfied by [ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRule], +// [ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRule]. +type ZarazConfigReplaceParamsTriggersLoadRule interface { + implementsZarazConfigReplaceParamsTriggersLoadRule() } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule struct { - ID param.Field[string] `json:"id,required"` - Match param.Field[string] `json:"match,required"` - Op param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp] `json:"op,required"` - Value param.Field[string] `json:"value,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule struct { + ID param.Field[string] `json:"id,required"` + Match param.Field[string] `json:"match,required"` + Op param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp] `json:"op,required"` + Value param.Field[string] `json:"value,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "EQUALS" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" - ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpContains ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpEquals ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "EQUALS" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpLessThan ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" + ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" + ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettings struct { - Selector param.Field[string] `json:"selector,required"` - Type param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsType] `json:"type,required"` - WaitForTags param.Field[int64] `json:"waitForTags,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettings struct { + Selector param.Field[string] `json:"selector,required"` + Type param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsType] `json:"type,required"` + WaitForTags param.Field[int64] `json:"waitForTags,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsType string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsType string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigUpdateParamsTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" + ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazConfigReplaceParamsTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleAction = "timer" + ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleActionTimer ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleAction = "timer" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleSettings struct { +type ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleSettings struct { Interval param.Field[int64] `json:"interval,required"` Limit param.Field[int64] `json:"limit,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazTimerRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazTimerRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleSettings struct { +type ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleSettings struct { Selector param.Field[string] `json:"selector,required"` Validate param.Field[bool] `json:"validate,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazFormSubmissionRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazFormSubmissionRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleSettings struct { +type ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleSettings struct { Match param.Field[string] `json:"match,required"` Variable param.Field[string] `json:"variable,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazVariableMatchRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazVariableMatchRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleSettings struct { +type ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleSettings struct { Positions param.Field[string] `json:"positions,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazScrollDepthRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazScrollDepthRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRule struct { - ID param.Field[string] `json:"id,required"` - Action param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleAction] `json:"action,required"` - Settings param.Field[ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleSettings] `json:"settings,required"` +type ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRule struct { + ID param.Field[string] `json:"id,required"` + Action param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleAction] `json:"action,required"` + Settings param.Field[ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleSettings] `json:"settings,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRule) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRule) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigUpdateParamsTriggersLoadRule() { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRule) implementsZarazConfigReplaceParamsTriggersLoadRule() { } -type ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleAction string +type ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleAction string const ( - ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleSettings struct { +type ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleSettings struct { Selector param.Field[string] `json:"selector,required"` } -func (r ZarazConfigUpdateParamsTriggersLoadRulesZarazElementVisibilityRuleSettings) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsTriggersLoadRulesZarazElementVisibilityRuleSettings) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsTriggersSystem string +type ZarazConfigReplaceParamsTriggersSystem string const ( - ZarazConfigUpdateParamsTriggersSystemPageload ZarazConfigUpdateParamsTriggersSystem = "pageload" + ZarazConfigReplaceParamsTriggersSystemPageload ZarazConfigReplaceParamsTriggersSystem = "pageload" ) -// Satisfied by [ZarazConfigUpdateParamsVariablesObject], -// [ZarazConfigUpdateParamsVariablesObject]. -type ZarazConfigUpdateParamsVariables interface { - implementsZarazConfigUpdateParamsVariables() +// Satisfied by [ZarazConfigReplaceParamsVariablesObject], +// [ZarazConfigReplaceParamsVariablesObject]. +type ZarazConfigReplaceParamsVariables interface { + implementsZarazConfigReplaceParamsVariables() } -type ZarazConfigUpdateParamsVariablesObject struct { - Name param.Field[string] `json:"name,required"` - Type param.Field[ZarazConfigUpdateParamsVariablesObjectType] `json:"type,required"` - Value param.Field[string] `json:"value,required"` +type ZarazConfigReplaceParamsVariablesObject struct { + Name param.Field[string] `json:"name,required"` + Type param.Field[ZarazConfigReplaceParamsVariablesObjectType] `json:"type,required"` + Value param.Field[string] `json:"value,required"` } -func (r ZarazConfigUpdateParamsVariablesObject) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsVariablesObject) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -func (r ZarazConfigUpdateParamsVariablesObject) implementsZarazConfigUpdateParamsVariables() {} +func (r ZarazConfigReplaceParamsVariablesObject) implementsZarazConfigReplaceParamsVariables() {} -type ZarazConfigUpdateParamsVariablesObjectType string +type ZarazConfigReplaceParamsVariablesObjectType string const ( - ZarazConfigUpdateParamsVariablesObjectTypeString ZarazConfigUpdateParamsVariablesObjectType = "string" - ZarazConfigUpdateParamsVariablesObjectTypeSecret ZarazConfigUpdateParamsVariablesObjectType = "secret" + ZarazConfigReplaceParamsVariablesObjectTypeString ZarazConfigReplaceParamsVariablesObjectType = "string" + ZarazConfigReplaceParamsVariablesObjectTypeSecret ZarazConfigReplaceParamsVariablesObjectType = "secret" ) // Consent management configuration. -type ZarazConfigUpdateParamsConsent struct { - Enabled param.Field[bool] `json:"enabled,required"` - ButtonTextTranslations param.Field[ZarazConfigUpdateParamsConsentButtonTextTranslations] `json:"buttonTextTranslations"` - CompanyEmail param.Field[string] `json:"companyEmail"` - CompanyName param.Field[string] `json:"companyName"` - CompanyStreetAddress param.Field[string] `json:"companyStreetAddress"` - ConsentModalIntroHTML param.Field[string] `json:"consentModalIntroHTML"` +type ZarazConfigReplaceParamsConsent struct { + Enabled param.Field[bool] `json:"enabled,required"` + ButtonTextTranslations param.Field[ZarazConfigReplaceParamsConsentButtonTextTranslations] `json:"buttonTextTranslations"` + CompanyEmail param.Field[string] `json:"companyEmail"` + CompanyName param.Field[string] `json:"companyName"` + CompanyStreetAddress param.Field[string] `json:"companyStreetAddress"` + ConsentModalIntroHTML param.Field[string] `json:"consentModalIntroHTML"` // Object where keys are language codes ConsentModalIntroHTMLWithTranslations param.Field[map[string]string] `json:"consentModalIntroHTMLWithTranslations"` CookieName param.Field[string] `json:"cookieName"` @@ -3658,16 +3724,16 @@ type ZarazConfigUpdateParamsConsent struct { DefaultLanguage param.Field[string] `json:"defaultLanguage"` HideModal param.Field[bool] `json:"hideModal"` // Object where keys are purpose alpha-numeric IDs - Purposes param.Field[map[string]ZarazConfigUpdateParamsConsentPurposes] `json:"purposes"` + Purposes param.Field[map[string]ZarazConfigReplaceParamsConsentPurposes] `json:"purposes"` // Object where keys are purpose alpha-numeric IDs - PurposesWithTranslations param.Field[map[string]ZarazConfigUpdateParamsConsentPurposesWithTranslations] `json:"purposesWithTranslations"` + PurposesWithTranslations param.Field[map[string]ZarazConfigReplaceParamsConsentPurposesWithTranslations] `json:"purposesWithTranslations"` } -func (r ZarazConfigUpdateParamsConsent) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsConsent) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsConsentButtonTextTranslations struct { +type ZarazConfigReplaceParamsConsentButtonTextTranslations struct { // Object where keys are language codes AcceptAll param.Field[map[string]string] `json:"accept_all,required"` // Object where keys are language codes @@ -3676,20 +3742,20 @@ type ZarazConfigUpdateParamsConsentButtonTextTranslations struct { RejectAll param.Field[map[string]string] `json:"reject_all,required"` } -func (r ZarazConfigUpdateParamsConsentButtonTextTranslations) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsConsentButtonTextTranslations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsConsentPurposes struct { +type ZarazConfigReplaceParamsConsentPurposes struct { Description param.Field[string] `json:"description,required"` Name param.Field[string] `json:"name,required"` } -func (r ZarazConfigUpdateParamsConsentPurposes) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsConsentPurposes) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateParamsConsentPurposesWithTranslations struct { +type ZarazConfigReplaceParamsConsentPurposesWithTranslations struct { // Object where keys are language codes Description param.Field[map[string]string] `json:"description,required"` // Object where keys are language codes @@ -3697,86 +3763,23 @@ type ZarazConfigUpdateParamsConsentPurposesWithTranslations struct { Order param.Field[int64] `json:"order,required"` } -func (r ZarazConfigUpdateParamsConsentPurposesWithTranslations) MarshalJSON() (data []byte, err error) { +func (r ZarazConfigReplaceParamsConsentPurposesWithTranslations) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } -type ZarazConfigUpdateResponseEnvelope struct { - Errors []ZarazConfigUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ZarazConfigUpdateResponseEnvelopeMessages `json:"messages,required"` - // Zaraz configuration - Result ZarazConfigUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success bool `json:"success,required"` - JSON zarazConfigUpdateResponseEnvelopeJSON `json:"-"` -} - -// zarazConfigUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [ZarazConfigUpdateResponseEnvelope] -type zarazConfigUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazConfigUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazConfigUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// zarazConfigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [ZarazConfigUpdateResponseEnvelopeErrors] -type zarazConfigUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazConfigUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazConfigUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// zarazConfigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [ZarazConfigUpdateResponseEnvelopeMessages] -type zarazConfigUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazConfigGetResponseEnvelope struct { - Errors []ZarazConfigGetResponseEnvelopeErrors `json:"errors,required"` - Messages []ZarazConfigGetResponseEnvelopeMessages `json:"messages,required"` +type ZarazConfigReplaceResponseEnvelope struct { + Errors []ZarazConfigReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []ZarazConfigReplaceResponseEnvelopeMessages `json:"messages,required"` // Zaraz configuration - Result ZarazConfigGetResponse `json:"result,required"` + Result ZarazConfigReplaceResponse `json:"result,required"` // Whether the API call was successful - Success bool `json:"success,required"` - JSON zarazConfigGetResponseEnvelopeJSON `json:"-"` + Success bool `json:"success,required"` + JSON zarazConfigReplaceResponseEnvelopeJSON `json:"-"` } -// zarazConfigGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [ZarazConfigGetResponseEnvelope] -type zarazConfigGetResponseEnvelopeJSON struct { +// zarazConfigReplaceResponseEnvelopeJSON contains the JSON metadata for the struct +// [ZarazConfigReplaceResponseEnvelope] +type zarazConfigReplaceResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -3785,44 +3788,44 @@ type zarazConfigGetResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazConfigGetResponseEnvelopeErrorsJSON `json:"-"` +type ZarazConfigReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazConfigReplaceResponseEnvelopeErrorsJSON `json:"-"` } -// zarazConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [ZarazConfigGetResponseEnvelopeErrors] -type zarazConfigGetResponseEnvelopeErrorsJSON struct { +// zarazConfigReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ZarazConfigReplaceResponseEnvelopeErrors] +type zarazConfigReplaceResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazConfigGetResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazConfigGetResponseEnvelopeMessagesJSON `json:"-"` +type ZarazConfigReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazConfigReplaceResponseEnvelopeMessagesJSON `json:"-"` } -// zarazConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [ZarazConfigGetResponseEnvelopeMessages] -type zarazConfigGetResponseEnvelopeMessagesJSON struct { +// zarazConfigReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ZarazConfigReplaceResponseEnvelopeMessages] +type zarazConfigReplaceResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazConfigReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } diff --git a/zarazconfig_test.go b/zarazconfig_test.go index 3f759817f60..be3cbe6af16 100644 --- a/zarazconfig_test.go +++ b/zarazconfig_test.go @@ -14,7 +14,33 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { +func TestZarazConfigGet(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := cloudflare.NewClient( + option.WithBaseURL(baseURL), + option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), + option.WithAPIEmail("dev@cloudflare.com"), + option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), + option.WithUserServiceKey("My User Service Key"), + ) + _, err := client.Zaraz.Config.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + if err != nil { + var apierr *cloudflare.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + +func TestZarazConfigReplaceWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -30,15 +56,15 @@ func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zaraz.Config.Update( + _, err := client.Zaraz.Config.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZarazConfigUpdateParams{ + cloudflare.ZarazConfigReplaceParams{ DataLayer: cloudflare.F(true), DebugKey: cloudflare.F("my-debug-key"), - Settings: cloudflare.F(cloudflare.ZarazConfigUpdateParamsSettings{ + Settings: cloudflare.F(cloudflare.ZarazConfigReplaceParamsSettings{ AutoInjectScript: cloudflare.F(true), - ContextEnricher: cloudflare.F(cloudflare.ZarazConfigUpdateParamsSettingsContextEnricher{ + ContextEnricher: cloudflare.F(cloudflare.ZarazConfigReplaceParamsSettingsContextEnricher{ EscapedWorkerName: cloudflare.F("string"), WorkerTag: cloudflare.F("string"), }), @@ -55,17 +81,17 @@ func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { ScriptPath: cloudflare.F("string"), TrackPath: cloudflare.F("string"), }), - Tools: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsTools{ - "aJvt": cloudflare.ZarazConfigUpdateParamsToolsZarazLegacyTool(cloudflare.ZarazConfigUpdateParamsToolsZarazLegacyTool{ + Tools: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsTools{ + "aJvt": cloudflare.ZarazConfigReplaceParamsToolsZarazLegacyTool(cloudflare.ZarazConfigReplaceParamsToolsZarazLegacyTool{ BlockingTriggers: cloudflare.F([]string{"string", "string", "string"}), - DefaultFields: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsToolsZarazLegacyToolDefaultFields{ + DefaultFields: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsToolsZarazLegacyToolDefaultFields{ "testKey": shared.UnionString("TEST123456"), }), DefaultPurpose: cloudflare.F("string"), Enabled: cloudflare.F(true), Name: cloudflare.F("Facebook Pixel"), Library: cloudflare.F("string"), - NeoEvents: cloudflare.F([]cloudflare.ZarazConfigUpdateParamsToolsZarazLegacyToolNeoEvent{{ + NeoEvents: cloudflare.F([]cloudflare.ZarazConfigReplaceParamsToolsZarazLegacyToolNeoEvent{{ BlockingTriggers: cloudflare.F([]string{"string", "string", "string"}), Data: cloudflare.F[any](map[string]interface{}{}), FiringTriggers: cloudflare.F([]string{"string"}), @@ -78,58 +104,58 @@ func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { Data: cloudflare.F[any](map[string]interface{}{}), FiringTriggers: cloudflare.F([]string{"string"}), }}), - Type: cloudflare.F(cloudflare.ZarazConfigUpdateParamsToolsZarazLegacyToolTypeLibrary), + Type: cloudflare.F(cloudflare.ZarazConfigReplaceParamsToolsZarazLegacyToolTypeLibrary), }), }), - Triggers: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsTriggers{ + Triggers: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsTriggers{ "ktBn": { Description: cloudflare.F("string"), - ExcludeRules: cloudflare.F([]cloudflare.ZarazConfigUpdateParamsTriggersExcludeRule{cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule{ + ExcludeRules: cloudflare.F([]cloudflare.ZarazConfigReplaceParamsTriggersExcludeRule{cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), - }), cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule{ + }), cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), - }), cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRule{ + }), cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersExcludeRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersExcludeRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), })}), - LoadRules: cloudflare.F([]cloudflare.ZarazConfigUpdateParamsTriggersLoadRule{cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule{ + LoadRules: cloudflare.F([]cloudflare.ZarazConfigReplaceParamsTriggersLoadRule{cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), - }), cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule{ + }), cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), - }), cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRule{ + }), cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRule{ ID: cloudflare.F("string"), Match: cloudflare.F("string"), - Op: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersLoadRulesZarazLoadRuleOpContains), + Op: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersLoadRulesZarazLoadRuleOpContains), Value: cloudflare.F("string"), })}), Name: cloudflare.F("string"), - System: cloudflare.F(cloudflare.ZarazConfigUpdateParamsTriggersSystemPageload), + System: cloudflare.F(cloudflare.ZarazConfigReplaceParamsTriggersSystemPageload), }, }), - Variables: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsVariables{ - "Autd": cloudflare.ZarazConfigUpdateParamsVariablesObject(cloudflare.ZarazConfigUpdateParamsVariablesObject{ + Variables: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsVariables{ + "Autd": cloudflare.ZarazConfigReplaceParamsVariablesObject(cloudflare.ZarazConfigReplaceParamsVariablesObject{ Name: cloudflare.F("ip"), - Type: cloudflare.F(cloudflare.ZarazConfigUpdateParamsVariablesObjectTypeString), + Type: cloudflare.F(cloudflare.ZarazConfigReplaceParamsVariablesObjectTypeString), Value: cloudflare.F("{{ system.device.ip }}"), }), }), ZarazVersion: cloudflare.F(int64(43)), - Consent: cloudflare.F(cloudflare.ZarazConfigUpdateParamsConsent{ - ButtonTextTranslations: cloudflare.F(cloudflare.ZarazConfigUpdateParamsConsentButtonTextTranslations{ + Consent: cloudflare.F(cloudflare.ZarazConfigReplaceParamsConsent{ + ButtonTextTranslations: cloudflare.F(cloudflare.ZarazConfigReplaceParamsConsentButtonTextTranslations{ AcceptAll: cloudflare.F(map[string]string{ "foo": "string", }), @@ -153,13 +179,13 @@ func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { DefaultLanguage: cloudflare.F("string"), Enabled: cloudflare.F(false), HideModal: cloudflare.F(true), - Purposes: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsConsentPurposes{ + Purposes: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsConsentPurposes{ "foo": { Description: cloudflare.F("string"), Name: cloudflare.F("string"), }, }), - PurposesWithTranslations: cloudflare.F(map[string]cloudflare.ZarazConfigUpdateParamsConsentPurposesWithTranslations{ + PurposesWithTranslations: cloudflare.F(map[string]cloudflare.ZarazConfigReplaceParamsConsentPurposesWithTranslations{ "foo": { Description: cloudflare.F(map[string]string{ "foo": "string", @@ -182,29 +208,3 @@ func TestZarazConfigUpdateWithOptionalParams(t *testing.T) { t.Fatalf("err should be nil: %s", err.Error()) } } - -func TestZarazConfigGet(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("dev@cloudflare.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("My User Service Key"), - ) - _, err := client.Zaraz.Config.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/zarazhistory.go b/zarazhistory.go index a95e014ec41..0892fda5bf2 100644 --- a/zarazhistory.go +++ b/zarazhistory.go @@ -39,12 +39,12 @@ func NewZarazHistoryService(opts ...option.RequestOption) (r *ZarazHistoryServic return } -// Restores a historical published Zaraz configuration by ID for a zone. -func (r *ZarazHistoryService) Update(ctx context.Context, zoneID string, body ZarazHistoryUpdateParams, opts ...option.RequestOption) (res *ZarazHistoryUpdateResponse, err error) { +// Lists a history of published Zaraz configuration records for a zone. +func (r *ZarazHistoryService) List(ctx context.Context, zoneID string, query ZarazHistoryListParams, opts ...option.RequestOption) (res *[]ZarazHistoryListResponse, err error) { opts = append(r.Options[:], opts...) - var env ZarazHistoryUpdateResponseEnvelope + var env ZarazHistoryListResponseEnvelope path := fmt.Sprintf("zones/%s/settings/zaraz/history", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) if err != nil { return } @@ -52,12 +52,12 @@ func (r *ZarazHistoryService) Update(ctx context.Context, zoneID string, body Za return } -// Lists a history of published Zaraz configuration records for a zone. -func (r *ZarazHistoryService) List(ctx context.Context, zoneID string, query ZarazHistoryListParams, opts ...option.RequestOption) (res *[]ZarazHistoryListResponse, err error) { +// Restores a historical published Zaraz configuration by ID for a zone. +func (r *ZarazHistoryService) Replace(ctx context.Context, zoneID string, body ZarazHistoryReplaceParams, opts ...option.RequestOption) (res *ZarazHistoryReplaceResponse, err error) { opts = append(r.Options[:], opts...) - var env ZarazHistoryListResponseEnvelope + var env ZarazHistoryReplaceResponseEnvelope path := fmt.Sprintf("zones/%s/settings/zaraz/history", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } @@ -65,36 +65,66 @@ func (r *ZarazHistoryService) List(ctx context.Context, zoneID string, query Zar return } +type ZarazHistoryListResponse struct { + // ID of the configuration + ID int64 `json:"id,required"` + // Date and time the configuration was created + CreatedAt time.Time `json:"createdAt,required" format:"date-time"` + // Configuration description provided by the user who published this configuration + Description string `json:"description,required"` + // Date and time the configuration was last updated + UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"` + // Alpha-numeric ID of the account user who published the configuration + UserID string `json:"userId,required"` + JSON zarazHistoryListResponseJSON `json:"-"` +} + +// zarazHistoryListResponseJSON contains the JSON metadata for the struct +// [ZarazHistoryListResponse] +type zarazHistoryListResponseJSON struct { + ID apijson.Field + CreatedAt apijson.Field + Description apijson.Field + UpdatedAt apijson.Field + UserID apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazHistoryListResponse) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + // Zaraz configuration -type ZarazHistoryUpdateResponse struct { +type ZarazHistoryReplaceResponse struct { // Data layer compatibility mode enabled. DataLayer bool `json:"dataLayer,required"` // The key for Zaraz debug mode. DebugKey string `json:"debugKey,required"` // General Zaraz settings. - Settings ZarazHistoryUpdateResponseSettings `json:"settings,required"` + Settings ZarazHistoryReplaceResponseSettings `json:"settings,required"` // Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID // and value is the tool configuration object. - Tools map[string]ZarazHistoryUpdateResponseTool `json:"tools,required"` + Tools map[string]ZarazHistoryReplaceResponseTool `json:"tools,required"` // Triggers set up under Zaraz configuration, where key is the trigger // alpha-numeric ID and value is the trigger configuration. - Triggers map[string]ZarazHistoryUpdateResponseTrigger `json:"triggers,required"` + Triggers map[string]ZarazHistoryReplaceResponseTrigger `json:"triggers,required"` // Variables set up under Zaraz configuration, where key is the variable // alpha-numeric ID and value is the variable configuration. Values of variables of // type secret are not included. - Variables map[string]ZarazHistoryUpdateResponseVariable `json:"variables,required"` + Variables map[string]ZarazHistoryReplaceResponseVariable `json:"variables,required"` // Zaraz internal version of the config. ZarazVersion int64 `json:"zarazVersion,required"` // Consent management configuration. - Consent ZarazHistoryUpdateResponseConsent `json:"consent"` + Consent ZarazHistoryReplaceResponseConsent `json:"consent"` // Single Page Application support enabled. - HistoryChange bool `json:"historyChange"` - JSON zarazHistoryUpdateResponseJSON `json:"-"` + HistoryChange bool `json:"historyChange"` + JSON zarazHistoryReplaceResponseJSON `json:"-"` } -// zarazHistoryUpdateResponseJSON contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponse] -type zarazHistoryUpdateResponseJSON struct { +// zarazHistoryReplaceResponseJSON contains the JSON metadata for the struct +// [ZarazHistoryReplaceResponse] +type zarazHistoryReplaceResponseJSON struct { DataLayer apijson.Field DebugKey apijson.Field Settings apijson.Field @@ -108,16 +138,16 @@ type zarazHistoryUpdateResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // General Zaraz settings. -type ZarazHistoryUpdateResponseSettings struct { +type ZarazHistoryReplaceResponseSettings struct { // Automatic injection of Zaraz scripts enabled. AutoInjectScript bool `json:"autoInjectScript,required"` // Details of the worker that receives and edits Zaraz Context object. - ContextEnricher ZarazHistoryUpdateResponseSettingsContextEnricher `json:"contextEnricher"` + ContextEnricher ZarazHistoryReplaceResponseSettingsContextEnricher `json:"contextEnricher"` // The domain Zaraz will use for writing and reading its cookies. CookieDomain string `json:"cookieDomain"` // Ecommerce API enabled. @@ -141,13 +171,13 @@ type ZarazHistoryUpdateResponseSettings struct { // Custom endpoint for Zaraz main script. ScriptPath string `json:"scriptPath"` // Custom endpoint for Zaraz tracking requests. - TrackPath string `json:"trackPath"` - JSON zarazHistoryUpdateResponseSettingsJSON `json:"-"` + TrackPath string `json:"trackPath"` + JSON zarazHistoryReplaceResponseSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseSettingsJSON contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseSettings] -type zarazHistoryUpdateResponseSettingsJSON struct { +// zarazHistoryReplaceResponseSettingsJSON contains the JSON metadata for the +// struct [ZarazHistoryReplaceResponseSettings] +type zarazHistoryReplaceResponseSettingsJSON struct { AutoInjectScript apijson.Field ContextEnricher apijson.Field CookieDomain apijson.Field @@ -166,47 +196,47 @@ type zarazHistoryUpdateResponseSettingsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Details of the worker that receives and edits Zaraz Context object. -type ZarazHistoryUpdateResponseSettingsContextEnricher struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazHistoryUpdateResponseSettingsContextEnricherJSON `json:"-"` +type ZarazHistoryReplaceResponseSettingsContextEnricher struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazHistoryReplaceResponseSettingsContextEnricherJSON `json:"-"` } -// zarazHistoryUpdateResponseSettingsContextEnricherJSON contains the JSON metadata -// for the struct [ZarazHistoryUpdateResponseSettingsContextEnricher] -type zarazHistoryUpdateResponseSettingsContextEnricherJSON struct { +// zarazHistoryReplaceResponseSettingsContextEnricherJSON contains the JSON +// metadata for the struct [ZarazHistoryReplaceResponseSettingsContextEnricher] +type zarazHistoryReplaceResponseSettingsContextEnricherJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseSettingsContextEnricher) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazHistoryUpdateResponseToolsZarazManagedComponent] or -// [ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent]. -type ZarazHistoryUpdateResponseTool interface { - implementsZarazHistoryUpdateResponseTool() +// Union satisfied by [ZarazHistoryReplaceResponseToolsZarazManagedComponent] or +// [ZarazHistoryReplaceResponseToolsZarazCustomManagedComponent]. +type ZarazHistoryReplaceResponseTool interface { + implementsZarazHistoryReplaceResponseTool() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryUpdateResponseTool)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryReplaceResponseTool)(nil)).Elem(), "") } -type ZarazHistoryUpdateResponseToolsZarazManagedComponent struct { +type ZarazHistoryReplaceResponseToolsZarazManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -214,21 +244,21 @@ type ZarazHistoryUpdateResponseToolsZarazManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazHistoryUpdateResponseToolsZarazManagedComponentSetting `json:"settings,required"` - Type ZarazHistoryUpdateResponseToolsZarazManagedComponentType `json:"type,required"` + Settings map[string]ZarazHistoryReplaceResponseToolsZarazManagedComponentSetting `json:"settings,required"` + Type ZarazHistoryReplaceResponseToolsZarazManagedComponentType `json:"type,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazHistoryUpdateResponseToolsZarazManagedComponentAction `json:"actions"` + Actions map[string]ZarazHistoryReplaceResponseToolsZarazManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazHistoryUpdateResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazHistoryUpdateResponseToolsZarazManagedComponentJSON `json:"-"` + NeoEvents []ZarazHistoryReplaceResponseToolsZarazManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazHistoryReplaceResponseToolsZarazManagedComponentJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazManagedComponentJSON contains the JSON -// metadata for the struct [ZarazHistoryUpdateResponseToolsZarazManagedComponent] -type zarazHistoryUpdateResponseToolsZarazManagedComponentJSON struct { +// zarazHistoryReplaceResponseToolsZarazManagedComponentJSON contains the JSON +// metadata for the struct [ZarazHistoryReplaceResponseToolsZarazManagedComponent] +type zarazHistoryReplaceResponseToolsZarazManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -244,21 +274,21 @@ type zarazHistoryUpdateResponseToolsZarazManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseToolsZarazManagedComponent) implementsZarazHistoryUpdateResponseTool() { +func (r ZarazHistoryReplaceResponseToolsZarazManagedComponent) implementsZarazHistoryReplaceResponseTool() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField interface { - ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField() +type ZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField interface { + ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazHistoryUpdateResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazHistoryReplaceResponseToolsZarazManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -276,13 +306,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazHistoryUpdateResponseToolsZarazManagedComponentSetting interface { - ImplementsZarazHistoryUpdateResponseToolsZarazManagedComponentSetting() +type ZarazHistoryReplaceResponseToolsZarazManagedComponentSetting interface { + ImplementsZarazHistoryReplaceResponseToolsZarazManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazHistoryUpdateResponseToolsZarazManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazHistoryReplaceResponseToolsZarazManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -299,13 +329,13 @@ func init() { ) } -type ZarazHistoryUpdateResponseToolsZarazManagedComponentType string +type ZarazHistoryReplaceResponseToolsZarazManagedComponentType string const ( - ZarazHistoryUpdateResponseToolsZarazManagedComponentTypeComponent ZarazHistoryUpdateResponseToolsZarazManagedComponentType = "component" + ZarazHistoryReplaceResponseToolsZarazManagedComponentTypeComponent ZarazHistoryReplaceResponseToolsZarazManagedComponentType = "component" ) -type ZarazHistoryUpdateResponseToolsZarazManagedComponentAction struct { +type ZarazHistoryReplaceResponseToolsZarazManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -313,14 +343,14 @@ type ZarazHistoryUpdateResponseToolsZarazManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazHistoryUpdateResponseToolsZarazManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazHistoryReplaceResponseToolsZarazManagedComponentActionJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazManagedComponentActionJSON contains the JSON -// metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazManagedComponentAction] -type zarazHistoryUpdateResponseToolsZarazManagedComponentActionJSON struct { +// zarazHistoryReplaceResponseToolsZarazManagedComponentActionJSON contains the +// JSON metadata for the struct +// [ZarazHistoryReplaceResponseToolsZarazManagedComponentAction] +type zarazHistoryReplaceResponseToolsZarazManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -329,11 +359,11 @@ type zarazHistoryUpdateResponseToolsZarazManagedComponentActionJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseToolsZarazManagedComponentNeoEvent struct { +type ZarazHistoryReplaceResponseToolsZarazManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -341,14 +371,14 @@ type ZarazHistoryUpdateResponseToolsZarazManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazHistoryUpdateResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazHistoryReplaceResponseToolsZarazManagedComponentNeoEventJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazManagedComponentNeoEventJSON contains the +// zarazHistoryReplaceResponseToolsZarazManagedComponentNeoEventJSON contains the // JSON metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazManagedComponentNeoEvent] -type zarazHistoryUpdateResponseToolsZarazManagedComponentNeoEventJSON struct { +// [ZarazHistoryReplaceResponseToolsZarazManagedComponentNeoEvent] +type zarazHistoryReplaceResponseToolsZarazManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -357,17 +387,17 @@ type zarazHistoryUpdateResponseToolsZarazManagedComponentNeoEventJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent struct { +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponent struct { // List of blocking trigger IDs BlockingTriggers []string `json:"blockingTriggers,required"` // Tool's internal name Component string `json:"component,required"` // Default fields for tool's actions - DefaultFields map[string]ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` + DefaultFields map[string]ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField `json:"defaultFields,required"` // Whether tool is enabled Enabled bool `json:"enabled,required"` // Tool's name defined by the user @@ -375,24 +405,24 @@ type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent struct { // List of permissions granted to the component Permissions []string `json:"permissions,required"` // Tool's settings - Settings map[string]ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` - Type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentType `json:"type,required"` + Settings map[string]ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting `json:"settings,required"` + Type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentType `json:"type,required"` // Cloudflare worker that acts as a managed component - Worker ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` + Worker ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorker `json:"worker,required"` // Actions configured on a tool. Either this or neoEvents field is required. - Actions map[string]ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentAction `json:"actions"` + Actions map[string]ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentAction `json:"actions"` // Default consent purpose ID DefaultPurpose string `json:"defaultPurpose"` // DEPRECATED - List of actions configured on a tool. Either this or actions field // is required. If both are present, actions field will take precedence. - NeoEvents []ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` - JSON zarazHistoryUpdateResponseToolsZarazCustomManagedComponentJSON `json:"-"` + NeoEvents []ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEvent `json:"neoEvents"` + JSON zarazHistoryReplaceResponseToolsZarazCustomManagedComponentJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazCustomManagedComponentJSON contains the JSON -// metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent] -type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentJSON struct { +// zarazHistoryReplaceResponseToolsZarazCustomManagedComponentJSON contains the +// JSON metadata for the struct +// [ZarazHistoryReplaceResponseToolsZarazCustomManagedComponent] +type zarazHistoryReplaceResponseToolsZarazCustomManagedComponentJSON struct { BlockingTriggers apijson.Field Component apijson.Field DefaultFields apijson.Field @@ -409,21 +439,21 @@ type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazCustomManagedComponent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseToolsZarazCustomManagedComponent) implementsZarazHistoryUpdateResponseTool() { +func (r ZarazHistoryReplaceResponseToolsZarazCustomManagedComponent) implementsZarazHistoryReplaceResponseTool() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField interface { - ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField() +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField interface { + ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), + reflect.TypeOf((*ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentDefaultField)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -441,13 +471,13 @@ func init() { } // Union satisfied by [shared.UnionString] or [shared.UnionBool]. -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting interface { - ImplementsZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting() +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting interface { + ImplementsZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting() } func init() { apijson.RegisterUnion( - reflect.TypeOf((*ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), + reflect.TypeOf((*ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentSetting)(nil)).Elem(), "", apijson.UnionVariant{ TypeFilter: gjson.String, @@ -464,34 +494,34 @@ func init() { ) } -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentType string +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentType string const ( - ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentType = "custom-mc" + ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentTypeCustomMc ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentType = "custom-mc" ) // Cloudflare worker that acts as a managed component -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorker struct { - EscapedWorkerName string `json:"escapedWorkerName,required"` - WorkerTag string `json:"workerTag,required"` - JSON zarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorker struct { + EscapedWorkerName string `json:"escapedWorkerName,required"` + WorkerTag string `json:"workerTag,required"` + JSON zarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorkerJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorkerJSON contains +// zarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorkerJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorker] -type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorkerJSON struct { +// [ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorker] +type zarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorkerJSON struct { EscapedWorkerName apijson.Field WorkerTag apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentWorker) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentAction struct { +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentAction struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -499,14 +529,14 @@ type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentAction struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazHistoryUpdateResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazHistoryReplaceResponseToolsZarazCustomManagedComponentActionJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazCustomManagedComponentActionJSON contains +// zarazHistoryReplaceResponseToolsZarazCustomManagedComponentActionJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentAction] -type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentActionJSON struct { +// [ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentAction] +type zarazHistoryReplaceResponseToolsZarazCustomManagedComponentActionJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -515,11 +545,11 @@ type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentActionJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentAction) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEvent struct { +type ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEvent struct { // Tool event type ActionType string `json:"actionType,required"` // List of blocking triggers IDs @@ -527,14 +557,14 @@ type ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEvent struct { // Event payload Data interface{} `json:"data,required"` // List of firing triggers IDs - FiringTriggers []string `json:"firingTriggers,required"` - JSON zarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` + FiringTriggers []string `json:"firingTriggers,required"` + JSON zarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON `json:"-"` } -// zarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON contains +// zarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEvent] -type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON struct { +// [ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEvent] +type zarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEventJSON struct { ActionType apijson.Field BlockingTriggers apijson.Field Data apijson.Field @@ -543,26 +573,26 @@ type zarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEventJSON stru ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseToolsZarazCustomManagedComponentNeoEvent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTrigger struct { +type ZarazHistoryReplaceResponseTrigger struct { // Rules defining when the trigger is not fired. - ExcludeRules []ZarazHistoryUpdateResponseTriggersExcludeRule `json:"excludeRules,required"` + ExcludeRules []ZarazHistoryReplaceResponseTriggersExcludeRule `json:"excludeRules,required"` // Rules defining when the trigger is fired. - LoadRules []ZarazHistoryUpdateResponseTriggersLoadRule `json:"loadRules,required"` + LoadRules []ZarazHistoryReplaceResponseTriggersLoadRule `json:"loadRules,required"` // Trigger name. Name string `json:"name,required"` // Trigger description. - Description string `json:"description"` - System ZarazHistoryUpdateResponseTriggersSystem `json:"system"` - JSON zarazHistoryUpdateResponseTriggerJSON `json:"-"` + Description string `json:"description"` + System ZarazHistoryReplaceResponseTriggersSystem `json:"system"` + JSON zarazHistoryReplaceResponseTriggerJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggerJSON contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTrigger] -type zarazHistoryUpdateResponseTriggerJSON struct { +// zarazHistoryReplaceResponseTriggerJSON contains the JSON metadata for the struct +// [ZarazHistoryReplaceResponseTrigger] +type zarazHistoryReplaceResponseTriggerJSON struct { ExcludeRules apijson.Field LoadRules apijson.Field Name apijson.Field @@ -572,38 +602,38 @@ type zarazHistoryUpdateResponseTriggerJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTrigger) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTrigger) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Union satisfied by -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRule], -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRule], -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRule], -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule], -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRule], -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRule] or -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule]. -type ZarazHistoryUpdateResponseTriggersExcludeRule interface { - implementsZarazHistoryUpdateResponseTriggersExcludeRule() +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRule], +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRule], +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRule], +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule], +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRule], +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRule] or +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule]. +type ZarazHistoryReplaceResponseTriggersExcludeRule interface { + implementsZarazHistoryReplaceResponseTriggersExcludeRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryUpdateResponseTriggersExcludeRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryReplaceResponseTriggersExcludeRule)(nil)).Elem(), "") } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON contains the +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON contains the // JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -612,39 +642,39 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazHistoryUpdateResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpContains ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "CONTAINS" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpEquals ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "EQUALS" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpStartsWith ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpEndsWith ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpMatchRegex ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpNotMatchRegex ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThan ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpGreaterThanOrEqual ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpLessThan ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOpLessThanOrEqual ZarazHistoryReplaceResponseTriggersExcludeRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -652,30 +682,30 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleJSON st ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleActionClickListener ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -683,28 +713,28 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSetting ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazHistoryUpdateResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeXpath ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsTypeCss ZarazHistoryReplaceResponseTriggersExcludeRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON contains the +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON contains the // JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -712,50 +742,50 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleActionTimer ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleAction = "timer" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -763,50 +793,50 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleJSON s ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleActionFormSubmission ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -814,50 +844,50 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleJSON st ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleActionVariableMatch ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -865,48 +895,48 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleJSON stru ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleActionScrollDepth ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -914,64 +944,64 @@ type zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleJSO ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazHistoryUpdateResponseTriggersExcludeRule() { +func (r ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRule) implementsZarazHistoryReplaceResponseTriggersExcludeRule() { } -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction string const ( - ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleActionElementVisibility ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] -type zarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings] +type zarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersExcludeRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -// Union satisfied by [ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRule], -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRule], -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRule], -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRule], -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRule], -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRule] or -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRule]. -type ZarazHistoryUpdateResponseTriggersLoadRule interface { - implementsZarazHistoryUpdateResponseTriggersLoadRule() +// Union satisfied by [ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRule], +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRule], +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRule], +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRule], +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRule], +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRule] or +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRule]. +type ZarazHistoryReplaceResponseTriggersLoadRule interface { + implementsZarazHistoryReplaceResponseTriggersLoadRule() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryUpdateResponseTriggersLoadRule)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryReplaceResponseTriggersLoadRule)(nil)).Elem(), "") } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRule struct { - ID string `json:"id,required"` - Match string `json:"match,required"` - Op ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` - Value string `json:"value,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRule struct { + ID string `json:"id,required"` + Match string `json:"match,required"` + Op ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp `json:"op,required"` + Value string `json:"value,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleJSON contains the JSON // metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleJSON struct { ID apijson.Field Match apijson.Field Op apijson.Field @@ -980,39 +1010,39 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazHistoryUpdateResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpContains ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "CONTAINS" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpEquals ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "EQUALS" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpStartsWith ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "STARTS_WITH" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpEndsWith ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "ENDS_WITH" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpMatchRegex ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "MATCH_REGEX" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpNotMatchRegex ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "NOT_MATCH_REGEX" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpGreaterThan ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpGreaterThanOrEqual ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "GREATER_THAN_OR_EQUAL" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpLessThan ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOpLessThanOrEqual ZarazHistoryReplaceResponseTriggersLoadRulesZarazLoadRuleOp = "LESS_THAN_OR_EQUAL" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON contains +// zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1020,30 +1050,30 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleActionClickListener ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleAction = "clickListener" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { - Selector string `json:"selector,required"` - Type ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` - WaitForTags int64 `json:"waitForTags,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings struct { + Selector string `json:"selector,required"` + Type ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType `json:"type,required"` + WaitForTags int64 `json:"waitForTags,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsJSON struct { Selector apijson.Field Type apijson.Field WaitForTags apijson.Field @@ -1051,28 +1081,28 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsJS ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" - ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazHistoryUpdateResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeXpath ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "xpath" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsTypeCss ZarazHistoryReplaceResponseTriggersLoadRulesZarazClickListenerRuleSettingsType = "css" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleJSON contains the JSON // metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1080,50 +1110,50 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleAction = "timer" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleActionTimer ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleAction = "timer" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettings struct { - Interval int64 `json:"interval,required"` - Limit int64 `json:"limit,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettings struct { + Interval int64 `json:"interval,required"` + Limit int64 `json:"limit,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains +// zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettingsJSON struct { Interval apijson.Field Limit apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazTimerRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains +// zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1131,50 +1161,50 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleJSON stru ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleActionFormSubmission ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleAction = "formSubmission" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { - Selector string `json:"selector,required"` - Validate bool `json:"validate,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings struct { + Selector string `json:"selector,required"` + Validate bool `json:"validate,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettingsJSON struct { Selector apijson.Field Validate apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazFormSubmissionRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains +// zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON contains // the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1182,50 +1212,50 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleJSON struc ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleActionVariableMatch ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleAction = "variableMatch" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { - Match string `json:"match,required"` - Variable string `json:"variable,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings struct { + Match string `json:"match,required"` + Variable string `json:"variable,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettingsJSON struct { Match apijson.Field Variable apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazVariableMatchRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains the -// JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { +// zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON contains +// the JSON metadata for the struct +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1233,48 +1263,48 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleJSON struct ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleActionScrollDepth ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleAction = "scrollDepth" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { - Positions string `json:"positions,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings struct { + Positions string `json:"positions,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettingsJSON struct { Positions apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazScrollDepthRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRule struct { - ID string `json:"id,required"` - Action ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` - Settings ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRule struct { + ID string `json:"id,required"` + Action ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction `json:"action,required"` + Settings ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings `json:"settings,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRule] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRule] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleJSON struct { ID apijson.Field Action apijson.Field Settings apijson.Field @@ -1282,63 +1312,63 @@ type zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleJSON s ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRule) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazHistoryUpdateResponseTriggersLoadRule() { +func (r ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRule) implementsZarazHistoryReplaceResponseTriggersLoadRule() { } -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction string +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction string const ( - ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" + ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleActionElementVisibility ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleAction = "elementVisibility" ) -type ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { - Selector string `json:"selector,required"` - JSON zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` +type ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings struct { + Selector string `json:"selector,required"` + JSON zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON `json:"-"` } -// zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON +// zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON // contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] -type zarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { +// [ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings] +type zarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettingsJSON struct { Selector apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseTriggersLoadRulesZarazElementVisibilityRuleSettings) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseTriggersSystem string +type ZarazHistoryReplaceResponseTriggersSystem string const ( - ZarazHistoryUpdateResponseTriggersSystemPageload ZarazHistoryUpdateResponseTriggersSystem = "pageload" + ZarazHistoryReplaceResponseTriggersSystemPageload ZarazHistoryReplaceResponseTriggersSystem = "pageload" ) -// Union satisfied by [ZarazHistoryUpdateResponseVariablesObject] or -// [ZarazHistoryUpdateResponseVariablesObject]. -type ZarazHistoryUpdateResponseVariable interface { - implementsZarazHistoryUpdateResponseVariable() +// Union satisfied by [ZarazHistoryReplaceResponseVariablesObject] or +// [ZarazHistoryReplaceResponseVariablesObject]. +type ZarazHistoryReplaceResponseVariable interface { + implementsZarazHistoryReplaceResponseVariable() } func init() { - apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryUpdateResponseVariable)(nil)).Elem(), "") + apijson.RegisterUnion(reflect.TypeOf((*ZarazHistoryReplaceResponseVariable)(nil)).Elem(), "") } -type ZarazHistoryUpdateResponseVariablesObject struct { - Name string `json:"name,required"` - Type ZarazHistoryUpdateResponseVariablesObjectType `json:"type,required"` - Value string `json:"value,required"` - JSON zarazHistoryUpdateResponseVariablesObjectJSON `json:"-"` +type ZarazHistoryReplaceResponseVariablesObject struct { + Name string `json:"name,required"` + Type ZarazHistoryReplaceResponseVariablesObjectType `json:"type,required"` + Value string `json:"value,required"` + JSON zarazHistoryReplaceResponseVariablesObjectJSON `json:"-"` } -// zarazHistoryUpdateResponseVariablesObjectJSON contains the JSON metadata for the -// struct [ZarazHistoryUpdateResponseVariablesObject] -type zarazHistoryUpdateResponseVariablesObjectJSON struct { +// zarazHistoryReplaceResponseVariablesObjectJSON contains the JSON metadata for +// the struct [ZarazHistoryReplaceResponseVariablesObject] +type zarazHistoryReplaceResponseVariablesObjectJSON struct { Name apijson.Field Type apijson.Field Value apijson.Field @@ -1346,27 +1376,27 @@ type zarazHistoryUpdateResponseVariablesObjectJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseVariablesObject) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r ZarazHistoryUpdateResponseVariablesObject) implementsZarazHistoryUpdateResponseVariable() {} +func (r ZarazHistoryReplaceResponseVariablesObject) implementsZarazHistoryReplaceResponseVariable() {} -type ZarazHistoryUpdateResponseVariablesObjectType string +type ZarazHistoryReplaceResponseVariablesObjectType string const ( - ZarazHistoryUpdateResponseVariablesObjectTypeString ZarazHistoryUpdateResponseVariablesObjectType = "string" - ZarazHistoryUpdateResponseVariablesObjectTypeSecret ZarazHistoryUpdateResponseVariablesObjectType = "secret" + ZarazHistoryReplaceResponseVariablesObjectTypeString ZarazHistoryReplaceResponseVariablesObjectType = "string" + ZarazHistoryReplaceResponseVariablesObjectTypeSecret ZarazHistoryReplaceResponseVariablesObjectType = "secret" ) // Consent management configuration. -type ZarazHistoryUpdateResponseConsent struct { - Enabled bool `json:"enabled,required"` - ButtonTextTranslations ZarazHistoryUpdateResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` - CompanyEmail string `json:"companyEmail"` - CompanyName string `json:"companyName"` - CompanyStreetAddress string `json:"companyStreetAddress"` - ConsentModalIntroHTML string `json:"consentModalIntroHTML"` +type ZarazHistoryReplaceResponseConsent struct { + Enabled bool `json:"enabled,required"` + ButtonTextTranslations ZarazHistoryReplaceResponseConsentButtonTextTranslations `json:"buttonTextTranslations"` + CompanyEmail string `json:"companyEmail"` + CompanyName string `json:"companyName"` + CompanyStreetAddress string `json:"companyStreetAddress"` + ConsentModalIntroHTML string `json:"consentModalIntroHTML"` // Object where keys are language codes ConsentModalIntroHTMLWithTranslations map[string]string `json:"consentModalIntroHTMLWithTranslations"` CookieName string `json:"cookieName"` @@ -1375,15 +1405,15 @@ type ZarazHistoryUpdateResponseConsent struct { DefaultLanguage string `json:"defaultLanguage"` HideModal bool `json:"hideModal"` // Object where keys are purpose alpha-numeric IDs - Purposes map[string]ZarazHistoryUpdateResponseConsentPurpose `json:"purposes"` + Purposes map[string]ZarazHistoryReplaceResponseConsentPurpose `json:"purposes"` // Object where keys are purpose alpha-numeric IDs - PurposesWithTranslations map[string]ZarazHistoryUpdateResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` - JSON zarazHistoryUpdateResponseConsentJSON `json:"-"` + PurposesWithTranslations map[string]ZarazHistoryReplaceResponseConsentPurposesWithTranslation `json:"purposesWithTranslations"` + JSON zarazHistoryReplaceResponseConsentJSON `json:"-"` } -// zarazHistoryUpdateResponseConsentJSON contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseConsent] -type zarazHistoryUpdateResponseConsentJSON struct { +// zarazHistoryReplaceResponseConsentJSON contains the JSON metadata for the struct +// [ZarazHistoryReplaceResponseConsent] +type zarazHistoryReplaceResponseConsentJSON struct { Enabled apijson.Field ButtonTextTranslations apijson.Field CompanyEmail apijson.Field @@ -1402,24 +1432,24 @@ type zarazHistoryUpdateResponseConsentJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseConsent) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseConsent) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseConsentButtonTextTranslations struct { +type ZarazHistoryReplaceResponseConsentButtonTextTranslations struct { // Object where keys are language codes AcceptAll map[string]string `json:"accept_all,required"` // Object where keys are language codes ConfirmMyChoices map[string]string `json:"confirm_my_choices,required"` // Object where keys are language codes - RejectAll map[string]string `json:"reject_all,required"` - JSON zarazHistoryUpdateResponseConsentButtonTextTranslationsJSON `json:"-"` + RejectAll map[string]string `json:"reject_all,required"` + JSON zarazHistoryReplaceResponseConsentButtonTextTranslationsJSON `json:"-"` } -// zarazHistoryUpdateResponseConsentButtonTextTranslationsJSON contains the JSON +// zarazHistoryReplaceResponseConsentButtonTextTranslationsJSON contains the JSON // metadata for the struct -// [ZarazHistoryUpdateResponseConsentButtonTextTranslations] -type zarazHistoryUpdateResponseConsentButtonTextTranslationsJSON struct { +// [ZarazHistoryReplaceResponseConsentButtonTextTranslations] +type zarazHistoryReplaceResponseConsentButtonTextTranslationsJSON struct { AcceptAll apijson.Field ConfirmMyChoices apijson.Field RejectAll apijson.Field @@ -1427,42 +1457,42 @@ type zarazHistoryUpdateResponseConsentButtonTextTranslationsJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseConsentButtonTextTranslations) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseConsentPurpose struct { - Description string `json:"description,required"` - Name string `json:"name,required"` - JSON zarazHistoryUpdateResponseConsentPurposeJSON `json:"-"` +type ZarazHistoryReplaceResponseConsentPurpose struct { + Description string `json:"description,required"` + Name string `json:"name,required"` + JSON zarazHistoryReplaceResponseConsentPurposeJSON `json:"-"` } -// zarazHistoryUpdateResponseConsentPurposeJSON contains the JSON metadata for the -// struct [ZarazHistoryUpdateResponseConsentPurpose] -type zarazHistoryUpdateResponseConsentPurposeJSON struct { +// zarazHistoryReplaceResponseConsentPurposeJSON contains the JSON metadata for the +// struct [ZarazHistoryReplaceResponseConsentPurpose] +type zarazHistoryReplaceResponseConsentPurposeJSON struct { Description apijson.Field Name apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseConsentPurpose) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZarazHistoryUpdateResponseConsentPurposesWithTranslation struct { +type ZarazHistoryReplaceResponseConsentPurposesWithTranslation struct { // Object where keys are language codes Description map[string]string `json:"description,required"` // Object where keys are language codes - Name map[string]string `json:"name,required"` - Order int64 `json:"order,required"` - JSON zarazHistoryUpdateResponseConsentPurposesWithTranslationJSON `json:"-"` + Name map[string]string `json:"name,required"` + Order int64 `json:"order,required"` + JSON zarazHistoryReplaceResponseConsentPurposesWithTranslationJSON `json:"-"` } -// zarazHistoryUpdateResponseConsentPurposesWithTranslationJSON contains the JSON +// zarazHistoryReplaceResponseConsentPurposesWithTranslationJSON contains the JSON // metadata for the struct -// [ZarazHistoryUpdateResponseConsentPurposesWithTranslation] -type zarazHistoryUpdateResponseConsentPurposesWithTranslationJSON struct { +// [ZarazHistoryReplaceResponseConsentPurposesWithTranslation] +type zarazHistoryReplaceResponseConsentPurposesWithTranslationJSON struct { Description apijson.Field Name apijson.Field Order apijson.Field @@ -1470,109 +1500,7 @@ type zarazHistoryUpdateResponseConsentPurposesWithTranslationJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZarazHistoryUpdateResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazHistoryListResponse struct { - // ID of the configuration - ID int64 `json:"id,required"` - // Date and time the configuration was created - CreatedAt time.Time `json:"createdAt,required" format:"date-time"` - // Configuration description provided by the user who published this configuration - Description string `json:"description,required"` - // Date and time the configuration was last updated - UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"` - // Alpha-numeric ID of the account user who published the configuration - UserID string `json:"userId,required"` - JSON zarazHistoryListResponseJSON `json:"-"` -} - -// zarazHistoryListResponseJSON contains the JSON metadata for the struct -// [ZarazHistoryListResponse] -type zarazHistoryListResponseJSON struct { - ID apijson.Field - CreatedAt apijson.Field - Description apijson.Field - UpdatedAt apijson.Field - UserID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazHistoryListResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazHistoryUpdateParams struct { - // ID of the Zaraz configuration to restore. - Body param.Field[int64] `json:"body,required"` -} - -func (r ZarazHistoryUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r.Body) -} - -type ZarazHistoryUpdateResponseEnvelope struct { - Errors []ZarazHistoryUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ZarazHistoryUpdateResponseEnvelopeMessages `json:"messages,required"` - // Zaraz configuration - Result ZarazHistoryUpdateResponse `json:"result,required"` - // Whether the API call was successful - Success bool `json:"success,required"` - JSON zarazHistoryUpdateResponseEnvelopeJSON `json:"-"` -} - -// zarazHistoryUpdateResponseEnvelopeJSON contains the JSON metadata for the struct -// [ZarazHistoryUpdateResponseEnvelope] -type zarazHistoryUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazHistoryUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazHistoryUpdateResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazHistoryUpdateResponseEnvelopeErrorsJSON `json:"-"` -} - -// zarazHistoryUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [ZarazHistoryUpdateResponseEnvelopeErrors] -type zarazHistoryUpdateResponseEnvelopeErrorsJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazHistoryUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type ZarazHistoryUpdateResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zarazHistoryUpdateResponseEnvelopeMessagesJSON `json:"-"` -} - -// zarazHistoryUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for -// the struct [ZarazHistoryUpdateResponseEnvelopeMessages] -type zarazHistoryUpdateResponseEnvelopeMessagesJSON struct { - Code apijson.Field - Message apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZarazHistoryUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ZarazHistoryReplaceResponseConsentPurposesWithTranslation) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } @@ -1675,3 +1603,75 @@ type zarazHistoryListResponseEnvelopeMessagesJSON struct { func (r *ZarazHistoryListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } + +type ZarazHistoryReplaceParams struct { + // ID of the Zaraz configuration to restore. + Body param.Field[int64] `json:"body,required"` +} + +func (r ZarazHistoryReplaceParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + +type ZarazHistoryReplaceResponseEnvelope struct { + Errors []ZarazHistoryReplaceResponseEnvelopeErrors `json:"errors,required"` + Messages []ZarazHistoryReplaceResponseEnvelopeMessages `json:"messages,required"` + // Zaraz configuration + Result ZarazHistoryReplaceResponse `json:"result,required"` + // Whether the API call was successful + Success bool `json:"success,required"` + JSON zarazHistoryReplaceResponseEnvelopeJSON `json:"-"` +} + +// zarazHistoryReplaceResponseEnvelopeJSON contains the JSON metadata for the +// struct [ZarazHistoryReplaceResponseEnvelope] +type zarazHistoryReplaceResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Result apijson.Field + Success apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazHistoryReplaceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ZarazHistoryReplaceResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazHistoryReplaceResponseEnvelopeErrorsJSON `json:"-"` +} + +// zarazHistoryReplaceResponseEnvelopeErrorsJSON contains the JSON metadata for the +// struct [ZarazHistoryReplaceResponseEnvelopeErrors] +type zarazHistoryReplaceResponseEnvelopeErrorsJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazHistoryReplaceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +type ZarazHistoryReplaceResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zarazHistoryReplaceResponseEnvelopeMessagesJSON `json:"-"` +} + +// zarazHistoryReplaceResponseEnvelopeMessagesJSON contains the JSON metadata for +// the struct [ZarazHistoryReplaceResponseEnvelopeMessages] +type zarazHistoryReplaceResponseEnvelopeMessagesJSON struct { + Code apijson.Field + Message apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZarazHistoryReplaceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} diff --git a/zarazhistory_test.go b/zarazhistory_test.go index 12cfbd073e9..19fd9f711ca 100644 --- a/zarazhistory_test.go +++ b/zarazhistory_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestZarazHistoryUpdate(t *testing.T) { +func TestZarazHistoryListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,11 +29,14 @@ func TestZarazHistoryUpdate(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zaraz.History.Update( + _, err := client.Zaraz.History.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZarazHistoryUpdateParams{ - Body: cloudflare.F(int64(12345)), + cloudflare.ZarazHistoryListParams{ + Limit: cloudflare.F(int64(1)), + Offset: cloudflare.F(int64(0)), + SortField: cloudflare.F(cloudflare.ZarazHistoryListParamsSortFieldID), + SortOrder: cloudflare.F(cloudflare.ZarazHistoryListParamsSortOrderDesc), }, ) if err != nil { @@ -45,7 +48,7 @@ func TestZarazHistoryUpdate(t *testing.T) { } } -func TestZarazHistoryListWithOptionalParams(t *testing.T) { +func TestZarazHistoryReplace(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,14 +64,11 @@ func TestZarazHistoryListWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zaraz.History.List( + _, err := client.Zaraz.History.Replace( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZarazHistoryListParams{ - Limit: cloudflare.F(int64(1)), - Offset: cloudflare.F(int64(0)), - SortField: cloudflare.F(cloudflare.ZarazHistoryListParamsSortFieldID), - SortOrder: cloudflare.F(cloudflare.ZarazHistoryListParamsSortOrderDesc), + cloudflare.ZarazHistoryReplaceParams{ + Body: cloudflare.F(int64(12345)), }, ) if err != nil { diff --git a/zone.go b/zone.go index 2281058dbf6..a3e6e696af7 100644 --- a/zone.go +++ b/zone.go @@ -23,7 +23,7 @@ import ( // directly, and instead use the [NewZoneService] method instead. type ZoneService struct { Options []option.RequestOption - Hold *ZoneHoldService + Holds *ZoneHoldService } // NewZoneService generates a new service that applies the given options to each @@ -32,7 +32,7 @@ type ZoneService struct { func NewZoneService(opts ...option.RequestOption) (r *ZoneService) { r = &ZoneService{} r.Options = opts - r.Hold = NewZoneHoldService(opts...) + r.Holds = NewZoneHoldService(opts...) return } diff --git a/zonehold.go b/zonehold.go index 7d73bbdf8d4..34ecd78ced1 100644 --- a/zonehold.go +++ b/zonehold.go @@ -34,9 +34,9 @@ func NewZoneHoldService(opts ...option.RequestOption) (r *ZoneHoldService) { // Enforce a zone hold on the zone, blocking the creation and activation of zones // with this zone's hostname. -func (r *ZoneHoldService) Enforce(ctx context.Context, zoneID string, body ZoneHoldEnforceParams, opts ...option.RequestOption) (res *ZoneHoldEnforceResponse, err error) { +func (r *ZoneHoldService) New(ctx context.Context, zoneID string, body ZoneHoldNewParams, opts ...option.RequestOption) (res *ZoneHoldNewResponse, err error) { opts = append(r.Options[:], opts...) - var env ZoneHoldEnforceResponseEnvelope + var env ZoneHoldNewResponseEnvelope path := fmt.Sprintf("zones/%s/hold", zoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { @@ -46,13 +46,13 @@ func (r *ZoneHoldService) Enforce(ctx context.Context, zoneID string, body ZoneH return } -// Retrieve whether the zone is subject to a zone hold, and metadata about the -// hold. -func (r *ZoneHoldService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ZoneHoldGetResponse, err error) { +// Stop enforcement of a zone hold on the zone, permanently or temporarily, +// allowing the creation and activation of zones with this zone's hostname. +func (r *ZoneHoldService) Delete(ctx context.Context, zoneID string, body ZoneHoldDeleteParams, opts ...option.RequestOption) (res *ZoneHoldDeleteResponse, err error) { opts = append(r.Options[:], opts...) - var env ZoneHoldGetResponseEnvelope + var env ZoneHoldDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/hold", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) if err != nil { return } @@ -60,13 +60,13 @@ func (r *ZoneHoldService) Get(ctx context.Context, zoneID string, opts ...option return } -// Stop enforcement of a zone hold on the zone, permanently or temporarily, -// allowing the creation and activation of zones with this zone's hostname. -func (r *ZoneHoldService) Remove(ctx context.Context, zoneID string, body ZoneHoldRemoveParams, opts ...option.RequestOption) (res *ZoneHoldRemoveResponse, err error) { +// Retrieve whether the zone is subject to a zone hold, and metadata about the +// hold. +func (r *ZoneHoldService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ZoneHoldGetResponse, err error) { opts = append(r.Options[:], opts...) - var env ZoneHoldRemoveResponseEnvelope + var env ZoneHoldGetResponseEnvelope path := fmt.Sprintf("zones/%s/hold", zoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return } @@ -74,16 +74,16 @@ func (r *ZoneHoldService) Remove(ctx context.Context, zoneID string, body ZoneHo return } -type ZoneHoldEnforceResponse struct { - Hold bool `json:"hold"` - HoldAfter string `json:"hold_after"` - IncludeSubdomains string `json:"include_subdomains"` - JSON zoneHoldEnforceResponseJSON `json:"-"` +type ZoneHoldNewResponse struct { + Hold bool `json:"hold"` + HoldAfter string `json:"hold_after"` + IncludeSubdomains string `json:"include_subdomains"` + JSON zoneHoldNewResponseJSON `json:"-"` } -// zoneHoldEnforceResponseJSON contains the JSON metadata for the struct -// [ZoneHoldEnforceResponse] -type zoneHoldEnforceResponseJSON struct { +// zoneHoldNewResponseJSON contains the JSON metadata for the struct +// [ZoneHoldNewResponse] +type zoneHoldNewResponseJSON struct { Hold apijson.Field HoldAfter apijson.Field IncludeSubdomains apijson.Field @@ -91,20 +91,20 @@ type zoneHoldEnforceResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneHoldEnforceResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZoneHoldGetResponse struct { - Hold bool `json:"hold"` - HoldAfter string `json:"hold_after"` - IncludeSubdomains string `json:"include_subdomains"` - JSON zoneHoldGetResponseJSON `json:"-"` +type ZoneHoldDeleteResponse struct { + Hold bool `json:"hold"` + HoldAfter string `json:"hold_after"` + IncludeSubdomains string `json:"include_subdomains"` + JSON zoneHoldDeleteResponseJSON `json:"-"` } -// zoneHoldGetResponseJSON contains the JSON metadata for the struct -// [ZoneHoldGetResponse] -type zoneHoldGetResponseJSON struct { +// zoneHoldDeleteResponseJSON contains the JSON metadata for the struct +// [ZoneHoldDeleteResponse] +type zoneHoldDeleteResponseJSON struct { Hold apijson.Field HoldAfter apijson.Field IncludeSubdomains apijson.Field @@ -112,20 +112,20 @@ type zoneHoldGetResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneHoldGetResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldDeleteResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZoneHoldRemoveResponse struct { - Hold bool `json:"hold"` - HoldAfter string `json:"hold_after"` - IncludeSubdomains string `json:"include_subdomains"` - JSON zoneHoldRemoveResponseJSON `json:"-"` +type ZoneHoldGetResponse struct { + Hold bool `json:"hold"` + HoldAfter string `json:"hold_after"` + IncludeSubdomains string `json:"include_subdomains"` + JSON zoneHoldGetResponseJSON `json:"-"` } -// zoneHoldRemoveResponseJSON contains the JSON metadata for the struct -// [ZoneHoldRemoveResponse] -type zoneHoldRemoveResponseJSON struct { +// zoneHoldGetResponseJSON contains the JSON metadata for the struct +// [ZoneHoldGetResponse] +type zoneHoldGetResponseJSON struct { Hold apijson.Field HoldAfter apijson.Field IncludeSubdomains apijson.Field @@ -133,11 +133,11 @@ type zoneHoldRemoveResponseJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneHoldRemoveResponse) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldGetResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZoneHoldEnforceParams struct { +type ZoneHoldNewParams struct { // If provided, the zone hold will extend to block any subdomain of the given zone, // as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with // the hostname 'example.com' and include_subdomains=true will block 'example.com', @@ -145,26 +145,26 @@ type ZoneHoldEnforceParams struct { IncludeSubdomains param.Field[bool] `query:"include_subdomains"` } -// URLQuery serializes [ZoneHoldEnforceParams]'s query parameters as `url.Values`. -func (r ZoneHoldEnforceParams) URLQuery() (v url.Values) { +// URLQuery serializes [ZoneHoldNewParams]'s query parameters as `url.Values`. +func (r ZoneHoldNewParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ ArrayFormat: apiquery.ArrayQueryFormatComma, NestedFormat: apiquery.NestedQueryFormatBrackets, }) } -type ZoneHoldEnforceResponseEnvelope struct { - Errors []ZoneHoldEnforceResponseEnvelopeErrors `json:"errors,required"` - Messages []ZoneHoldEnforceResponseEnvelopeMessages `json:"messages,required"` - Result ZoneHoldEnforceResponse `json:"result,required"` +type ZoneHoldNewResponseEnvelope struct { + Errors []ZoneHoldNewResponseEnvelopeErrors `json:"errors,required"` + Messages []ZoneHoldNewResponseEnvelopeMessages `json:"messages,required"` + Result ZoneHoldNewResponse `json:"result,required"` // Whether the API call was successful - Success ZoneHoldEnforceResponseEnvelopeSuccess `json:"success,required"` - JSON zoneHoldEnforceResponseEnvelopeJSON `json:"-"` + Success ZoneHoldNewResponseEnvelopeSuccess `json:"success,required"` + JSON zoneHoldNewResponseEnvelopeJSON `json:"-"` } -// zoneHoldEnforceResponseEnvelopeJSON contains the JSON metadata for the struct -// [ZoneHoldEnforceResponseEnvelope] -type zoneHoldEnforceResponseEnvelopeJSON struct { +// zoneHoldNewResponseEnvelopeJSON contains the JSON metadata for the struct +// [ZoneHoldNewResponseEnvelope] +type zoneHoldNewResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field Result apijson.Field @@ -173,55 +173,87 @@ type zoneHoldEnforceResponseEnvelopeJSON struct { ExtraFields map[string]apijson.Field } -func (r *ZoneHoldEnforceResponseEnvelope) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZoneHoldEnforceResponseEnvelopeErrors struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zoneHoldEnforceResponseEnvelopeErrorsJSON `json:"-"` +type ZoneHoldNewResponseEnvelopeErrors struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zoneHoldNewResponseEnvelopeErrorsJSON `json:"-"` } -// zoneHoldEnforceResponseEnvelopeErrorsJSON contains the JSON metadata for the -// struct [ZoneHoldEnforceResponseEnvelopeErrors] -type zoneHoldEnforceResponseEnvelopeErrorsJSON struct { +// zoneHoldNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct +// [ZoneHoldNewResponseEnvelopeErrors] +type zoneHoldNewResponseEnvelopeErrorsJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZoneHoldEnforceResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -type ZoneHoldEnforceResponseEnvelopeMessages struct { - Code int64 `json:"code,required"` - Message string `json:"message,required"` - JSON zoneHoldEnforceResponseEnvelopeMessagesJSON `json:"-"` +type ZoneHoldNewResponseEnvelopeMessages struct { + Code int64 `json:"code,required"` + Message string `json:"message,required"` + JSON zoneHoldNewResponseEnvelopeMessagesJSON `json:"-"` } -// zoneHoldEnforceResponseEnvelopeMessagesJSON contains the JSON metadata for the -// struct [ZoneHoldEnforceResponseEnvelopeMessages] -type zoneHoldEnforceResponseEnvelopeMessagesJSON struct { +// zoneHoldNewResponseEnvelopeMessagesJSON contains the JSON metadata for the +// struct [ZoneHoldNewResponseEnvelopeMessages] +type zoneHoldNewResponseEnvelopeMessagesJSON struct { Code apijson.Field Message apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *ZoneHoldEnforceResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { +func (r *ZoneHoldNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } // Whether the API call was successful -type ZoneHoldEnforceResponseEnvelopeSuccess bool +type ZoneHoldNewResponseEnvelopeSuccess bool const ( - ZoneHoldEnforceResponseEnvelopeSuccessTrue ZoneHoldEnforceResponseEnvelopeSuccess = true + ZoneHoldNewResponseEnvelopeSuccessTrue ZoneHoldNewResponseEnvelopeSuccess = true ) +type ZoneHoldDeleteParams struct { + // If `hold_after` is provided, the hold will be temporarily disabled, then + // automatically re-enabled by the system at the time specified in this + // RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely. + HoldAfter param.Field[string] `query:"hold_after"` +} + +// URLQuery serializes [ZoneHoldDeleteParams]'s query parameters as `url.Values`. +func (r ZoneHoldDeleteParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type ZoneHoldDeleteResponseEnvelope struct { + Result ZoneHoldDeleteResponse `json:"result"` + JSON zoneHoldDeleteResponseEnvelopeJSON `json:"-"` +} + +// zoneHoldDeleteResponseEnvelopeJSON contains the JSON metadata for the struct +// [ZoneHoldDeleteResponseEnvelope] +type zoneHoldDeleteResponseEnvelopeJSON struct { + Result apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *ZoneHoldDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type ZoneHoldGetResponseEnvelope struct { Errors []ZoneHoldGetResponseEnvelopeErrors `json:"errors,required"` Messages []ZoneHoldGetResponseEnvelopeMessages `json:"messages,required"` @@ -290,35 +322,3 @@ type ZoneHoldGetResponseEnvelopeSuccess bool const ( ZoneHoldGetResponseEnvelopeSuccessTrue ZoneHoldGetResponseEnvelopeSuccess = true ) - -type ZoneHoldRemoveParams struct { - // If `hold_after` is provided, the hold will be temporarily disabled, then - // automatically re-enabled by the system at the time specified in this - // RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely. - HoldAfter param.Field[string] `query:"hold_after"` -} - -// URLQuery serializes [ZoneHoldRemoveParams]'s query parameters as `url.Values`. -func (r ZoneHoldRemoveParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type ZoneHoldRemoveResponseEnvelope struct { - Result ZoneHoldRemoveResponse `json:"result"` - JSON zoneHoldRemoveResponseEnvelopeJSON `json:"-"` -} - -// zoneHoldRemoveResponseEnvelopeJSON contains the JSON metadata for the struct -// [ZoneHoldRemoveResponseEnvelope] -type zoneHoldRemoveResponseEnvelopeJSON struct { - Result apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *ZoneHoldRemoveResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/zonehold_test.go b/zonehold_test.go index 65b9d0243aa..95a8b4dfb4b 100644 --- a/zonehold_test.go +++ b/zonehold_test.go @@ -13,7 +13,7 @@ import ( "github.com/cloudflare/cloudflare-sdk-go/option" ) -func TestZoneHoldEnforceWithOptionalParams(t *testing.T) { +func TestZoneHoldNewWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -29,10 +29,10 @@ func TestZoneHoldEnforceWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zones.Hold.Enforce( + _, err := client.Zones.Holds.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZoneHoldEnforceParams{ + cloudflare.ZoneHoldNewParams{ IncludeSubdomains: cloudflare.F(true), }, ) @@ -45,7 +45,7 @@ func TestZoneHoldEnforceWithOptionalParams(t *testing.T) { } } -func TestZoneHoldGet(t *testing.T) { +func TestZoneHoldDeleteWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -61,7 +61,13 @@ func TestZoneHoldGet(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zones.Hold.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.Zones.Holds.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + cloudflare.ZoneHoldDeleteParams{ + HoldAfter: cloudflare.F("string"), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -71,7 +77,7 @@ func TestZoneHoldGet(t *testing.T) { } } -func TestZoneHoldRemoveWithOptionalParams(t *testing.T) { +func TestZoneHoldGet(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -87,13 +93,7 @@ func TestZoneHoldRemoveWithOptionalParams(t *testing.T) { option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), option.WithUserServiceKey("My User Service Key"), ) - _, err := client.Zones.Hold.Remove( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - cloudflare.ZoneHoldRemoveParams{ - HoldAfter: cloudflare.F("string"), - }, - ) + _, err := client.Zones.Holds.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) {